From ab8c3ab127085e886f4c1fb9407e40f5ae591133 Mon Sep 17 00:00:00 2001 From: btopro Date: Fri, 11 Aug 2023 17:33:54 -0400 Subject: [PATCH] https://github.com/elmsln/issues/issues/1644 --- .../@google/model-viewer/dist/model-viewer.js | 136 ++-- .../active-item/site-active-tags.js | 2 +- .../lib/ui-components/magic/site-view.js | 158 +++++ .../ui-components/routes/site-views-route.js | 155 ++--- .../ui-components/site/site-remote-content.js | 211 +------ .../haxcms-elements/package.json | 1 + .../play-list/lib/SLStyleManager.js | 1 + .../lib/play-list.haxProperties.json | 39 ++ .../@lrnwebcomponents/play-list/play-list.js | 56 ++ .../simple-fields/simple-fields.js | 2 +- .../@lrnwebcomponents/utils/utils.js | 2 +- .../dist/attention_seekers/bounce.js | 1 + .../dist/attention_seekers/flash.js | 1 + .../dist/attention_seekers/headShake.js | 1 + .../dist/attention_seekers/heartBeat.js | 1 + .../dist/attention_seekers/jello.js | 1 + .../dist/attention_seekers/pulse.js | 1 + .../dist/attention_seekers/rubberBand.js | 1 + .../dist/attention_seekers/shake.js | 1 + .../dist/attention_seekers/shakeX.js | 1 + .../dist/attention_seekers/shakeY.js | 1 + .../dist/attention_seekers/swing.js | 1 + .../animations/dist/attention_seekers/tada.js | 1 + .../dist/attention_seekers/wobble.js | 1 + .../dist/back_entrances/backInDown.js | 1 + .../dist/back_entrances/backInLeft.js | 1 + .../dist/back_entrances/backInRight.js | 1 + .../dist/back_entrances/backInUp.js | 1 + .../animations/dist/back_exits/backOutDown.js | 1 + .../animations/dist/back_exits/backOutLeft.js | 1 + .../dist/back_exits/backOutRight.js | 1 + .../animations/dist/back_exits/backOutUp.js | 1 + .../dist/bouncing_entrances/bounceIn.js | 1 + .../dist/bouncing_entrances/bounceInDown.js | 1 + .../dist/bouncing_entrances/bounceInLeft.js | 1 + .../dist/bouncing_entrances/bounceInRight.js | 1 + .../dist/bouncing_entrances/bounceInUp.js | 1 + .../dist/bouncing_exits/bounceOut.js | 1 + .../dist/bouncing_exits/bounceOutDown.js | 1 + .../dist/bouncing_exits/bounceOutLeft.js | 1 + .../dist/bouncing_exits/bounceOutRight.js | 1 + .../dist/bouncing_exits/bounceOutUp.js | 1 + .../animations/dist/easings/easings.js | 1 + .../dist/fading_entrances/fadeIn.js | 1 + .../dist/fading_entrances/fadeInBottomLeft.js | 1 + .../fading_entrances/fadeInBottomRight.js | 1 + .../dist/fading_entrances/fadeInDown.js | 1 + .../dist/fading_entrances/fadeInDownBig.js | 1 + .../dist/fading_entrances/fadeInLeft.js | 1 + .../dist/fading_entrances/fadeInLeftBig.js | 1 + .../dist/fading_entrances/fadeInRight.js | 1 + .../dist/fading_entrances/fadeInRightBig.js | 1 + .../dist/fading_entrances/fadeInTopLeft.js | 1 + .../dist/fading_entrances/fadeInTopRight.js | 1 + .../dist/fading_entrances/fadeInUp.js | 1 + .../dist/fading_entrances/fadeInUpBig.js | 1 + .../animations/dist/fading_exits/fadeOut.js | 1 + .../dist/fading_exits/fadeOutBottomLeft.js | 1 + .../dist/fading_exits/fadeOutBottomRight.js | 1 + .../dist/fading_exits/fadeOutDown.js | 1 + .../dist/fading_exits/fadeOutDownBig.js | 1 + .../dist/fading_exits/fadeOutLeft.js | 1 + .../dist/fading_exits/fadeOutLeftBig.js | 1 + .../dist/fading_exits/fadeOutRight.js | 1 + .../dist/fading_exits/fadeOutRightBig.js | 1 + .../dist/fading_exits/fadeOutTopLeft.js | 1 + .../dist/fading_exits/fadeOutTopRight.js | 1 + .../animations/dist/fading_exits/fadeOutUp.js | 1 + .../dist/fading_exits/fadeOutUpBig.js | 1 + .../animations/dist/flippers/flip.js | 1 + .../animations/dist/flippers/flipInX.js | 1 + .../animations/dist/flippers/flipInY.js | 1 + .../animations/dist/flippers/flipOutX.js | 1 + .../animations/dist/flippers/flipOutY.js | 1 + .../@shoelace-style/animations/dist/index.js | 1 + .../dist/lightspeed/lightSpeedInLeft.js | 1 + .../dist/lightspeed/lightSpeedInRight.js | 1 + .../dist/lightspeed/lightSpeedOutLeft.js | 1 + .../dist/lightspeed/lightSpeedOutRight.js | 1 + .../dist/rotating_entrances/rotateIn.js | 1 + .../rotating_entrances/rotateInDownLeft.js | 1 + .../rotating_entrances/rotateInDownRight.js | 1 + .../dist/rotating_entrances/rotateInUpLeft.js | 1 + .../rotating_entrances/rotateInUpRight.js | 1 + .../dist/rotating_exits/rotateOut.js | 1 + .../dist/rotating_exits/rotateOutDownLeft.js | 1 + .../dist/rotating_exits/rotateOutDownRight.js | 1 + .../dist/rotating_exits/rotateOutUpLeft.js | 1 + .../dist/rotating_exits/rotateOutUpRight.js | 1 + .../dist/sliding_entrances/slideInDown.js | 1 + .../dist/sliding_entrances/slideInLeft.js | 1 + .../dist/sliding_entrances/slideInRight.js | 1 + .../dist/sliding_entrances/slideInUp.js | 1 + .../dist/sliding_exits/slideOutDown.js | 1 + .../dist/sliding_exits/slideOutLeft.js | 1 + .../dist/sliding_exits/slideOutRight.js | 1 + .../dist/sliding_exits/slideOutUp.js | 1 + .../animations/dist/specials/hinge.js | 1 + .../animations/dist/specials/jackInTheBox.js | 1 + .../animations/dist/specials/rollIn.js | 1 + .../animations/dist/specials/rollOut.js | 1 + .../dist/zooming_entrances/zoomIn.js | 1 + .../dist/zooming_entrances/zoomInDown.js | 1 + .../dist/zooming_entrances/zoomInLeft.js | 1 + .../dist/zooming_entrances/zoomInRight.js | 1 + .../dist/zooming_entrances/zoomInUp.js | 1 + .../animations/dist/zooming_exits/zoomOut.js | 1 + .../dist/zooming_exits/zoomOutDown.js | 1 + .../dist/zooming_exits/zoomOutLeft.js | 1 + .../dist/zooming_exits/zoomOutRight.js | 1 + .../dist/zooming_exits/zoomOutUp.js | 1 + .../@shoelace-style/localize/dist/index.js | 1 + .../shoelace/dist/chunks/chunk.23QSDHN7.js | 1 + .../shoelace/dist/chunks/chunk.26CDGTKN.js | 74 +++ .../shoelace/dist/chunks/chunk.2A3352EO.js | 1 + .../shoelace/dist/chunks/chunk.2BBYS2AO.js | 1 + .../shoelace/dist/chunks/chunk.2DIBQ5MD.js | 85 +++ .../shoelace/dist/chunks/chunk.2KNNLHT6.js | 1 + .../shoelace/dist/chunks/chunk.2NHP677Q.js | 1 + .../shoelace/dist/chunks/chunk.2OFNWZUO.js | 1 + .../shoelace/dist/chunks/chunk.2UT2ZF7L.js | 227 +++++++ .../shoelace/dist/chunks/chunk.2WKF4RIH.js | 65 ++ .../shoelace/dist/chunks/chunk.2WKHOBLT.js | 68 ++ .../shoelace/dist/chunks/chunk.35QQGKS6.js | 1 + .../shoelace/dist/chunks/chunk.3ALMDSO3.js | 1 + .../shoelace/dist/chunks/chunk.3CX5T7GV.js | 1 + .../shoelace/dist/chunks/chunk.3CZS6ECK.js | 11 + .../shoelace/dist/chunks/chunk.3P2DZVT6.js | 1 + .../shoelace/dist/chunks/chunk.3Y6SB6QS.js | 1 + .../shoelace/dist/chunks/chunk.3YMXKNHC.js | 1 + .../shoelace/dist/chunks/chunk.4DOW4ZG2.js | 157 +++++ .../shoelace/dist/chunks/chunk.4FS6RVQD.js | 1 + .../shoelace/dist/chunks/chunk.4GRKCE6W.js | 94 +++ .../shoelace/dist/chunks/chunk.4P2RHPJ7.js | 1 + .../shoelace/dist/chunks/chunk.4XPIAYA2.js | 7 + .../shoelace/dist/chunks/chunk.5453BD52.js | 31 + .../shoelace/dist/chunks/chunk.5CIGH6UI.js | 1 + .../shoelace/dist/chunks/chunk.5E2TGPJ7.js | 1 + .../shoelace/dist/chunks/chunk.5F6CPPXO.js | 1 + .../shoelace/dist/chunks/chunk.5HRUL7SO.js | 20 + .../shoelace/dist/chunks/chunk.5NBMQ7EG.js | 13 + .../shoelace/dist/chunks/chunk.5UPJYW7M.js | 1 + .../shoelace/dist/chunks/chunk.5Y4WECUT.js | 9 + .../shoelace/dist/chunks/chunk.5ZUXEXMC.js | 1 + .../shoelace/dist/chunks/chunk.67AISYA7.js | 1 + .../shoelace/dist/chunks/chunk.6CDLFZKN.js | 1 + .../shoelace/dist/chunks/chunk.6D7NXPD5.js | 156 +++++ .../shoelace/dist/chunks/chunk.6HJKL75R.js | 25 + .../shoelace/dist/chunks/chunk.6IPOEJS3.js | 98 +++ .../shoelace/dist/chunks/chunk.6NO6TOOK.js | 13 + .../shoelace/dist/chunks/chunk.6Q3FCZAW.js | 1 + .../shoelace/dist/chunks/chunk.7B5CCNHM.js | 11 + .../shoelace/dist/chunks/chunk.7BDKFUSY.js | 1 + .../shoelace/dist/chunks/chunk.7BLP64MK.js | 50 ++ .../shoelace/dist/chunks/chunk.7JULRNN5.js | 55 ++ .../shoelace/dist/chunks/chunk.7RHUXUVD.js | 1 + .../shoelace/dist/chunks/chunk.7RZIFKWO.js | 1 + .../shoelace/dist/chunks/chunk.7UUIUZXI.js | 1 + .../shoelace/dist/chunks/chunk.7WBAK746.js | 1 + .../shoelace/dist/chunks/chunk.7ZCMJKGF.js | 1 + .../shoelace/dist/chunks/chunk.A2IRGVGD.js | 1 + .../shoelace/dist/chunks/chunk.A4EV4GKC.js | 59 ++ .../shoelace/dist/chunks/chunk.A4SOQOK5.js | 1 + .../shoelace/dist/chunks/chunk.AI4KLJFS.js | 1 + .../shoelace/dist/chunks/chunk.AMHT72HT.js | 52 ++ .../shoelace/dist/chunks/chunk.AXJGIJ6I.js | 25 + .../shoelace/dist/chunks/chunk.B4BZKR24.js | 1 + .../shoelace/dist/chunks/chunk.B7JJGOCZ.js | 30 + .../shoelace/dist/chunks/chunk.BAD6C56T.js | 1 + .../shoelace/dist/chunks/chunk.BDDLQS6W.js | 1 + .../shoelace/dist/chunks/chunk.BI7DHIJN.js | 21 + .../shoelace/dist/chunks/chunk.BT7SAYED.js | 1 + .../shoelace/dist/chunks/chunk.BUMKX4R7.js | 1 + .../shoelace/dist/chunks/chunk.BV3WOJKI.js | 25 + .../shoelace/dist/chunks/chunk.BVEHX6NS.js | 36 ++ .../shoelace/dist/chunks/chunk.BWSFZ3II.js | 46 ++ .../shoelace/dist/chunks/chunk.BYQQMUHG.js | 1 + .../shoelace/dist/chunks/chunk.BZCHZMPK.js | 21 + .../shoelace/dist/chunks/chunk.CAHT2E74.js | 59 ++ .../shoelace/dist/chunks/chunk.CB4P5CRU.js | 1 + .../shoelace/dist/chunks/chunk.CEMITGOC.js | 1 + .../shoelace/dist/chunks/chunk.CEU4JDVC.js | 1 + .../shoelace/dist/chunks/chunk.CGXJYWRD.js | 115 ++++ .../shoelace/dist/chunks/chunk.CJDR7567.js | 1 + .../shoelace/dist/chunks/chunk.COAGA4BW.js | 78 +++ .../shoelace/dist/chunks/chunk.CRA7IQJI.js | 108 ++++ .../shoelace/dist/chunks/chunk.CTT4DASP.js | 1 + .../shoelace/dist/chunks/chunk.CYAWIBIC.js | 1 + .../shoelace/dist/chunks/chunk.DHO3GHQI.js | 1 + .../shoelace/dist/chunks/chunk.DIRIFXCD.js | 1 + .../shoelace/dist/chunks/chunk.DQM2UOFS.js | 19 + .../shoelace/dist/chunks/chunk.DRJODFCK.js | 1 + .../shoelace/dist/chunks/chunk.DT3OOL5X.js | 1 + .../shoelace/dist/chunks/chunk.DV34JM5Y.js | 1 + .../shoelace/dist/chunks/chunk.DWRCQAX7.js | 1 + .../shoelace/dist/chunks/chunk.E2JGAFR4.js | 1 + .../shoelace/dist/chunks/chunk.EKHVZV23.js | 34 + .../shoelace/dist/chunks/chunk.EPB7DJXC.js | 1 + .../shoelace/dist/chunks/chunk.EQP3JFQP.js | 1 + .../shoelace/dist/chunks/chunk.F4VGSDIW.js | 1 + .../shoelace/dist/chunks/chunk.F5BGAPMF.js | 1 + .../shoelace/dist/chunks/chunk.F62XCO4D.js | 1 + .../shoelace/dist/chunks/chunk.FGNNVMLF.js | 111 ++++ .../shoelace/dist/chunks/chunk.FMRCD3VN.js | 1 + .../shoelace/dist/chunks/chunk.FWRCRSIY.js | 5 + .../shoelace/dist/chunks/chunk.G3SPB25T.js | 1 + .../shoelace/dist/chunks/chunk.G7UWKMCZ.js | 1 + .../shoelace/dist/chunks/chunk.GCN3DWSD.js | 1 + .../shoelace/dist/chunks/chunk.GF4UCFQ6.js | 1 + .../shoelace/dist/chunks/chunk.GI7VDIWX.js | 1 + .../shoelace/dist/chunks/chunk.GIIHC72T.js | 1 + .../shoelace/dist/chunks/chunk.GTFBBFI7.js | 8 + .../shoelace/dist/chunks/chunk.GTUXXKTG.js | 140 +++++ .../shoelace/dist/chunks/chunk.GU7HQTHB.js | 1 + .../shoelace/dist/chunks/chunk.GZ6BQYUU.js | 1 + .../shoelace/dist/chunks/chunk.HAL7R4WT.js | 0 .../shoelace/dist/chunks/chunk.HDC6JDQL.js | 154 +++++ .../shoelace/dist/chunks/chunk.HF7GESMZ.js | 1 + .../shoelace/dist/chunks/chunk.HINEY7NM.js | 331 ++++++++++ .../shoelace/dist/chunks/chunk.HNH4USWO.js | 201 ++++++ .../shoelace/dist/chunks/chunk.HNLZQAGV.js | 1 + .../shoelace/dist/chunks/chunk.HOZSVBVS.js | 90 +++ .../shoelace/dist/chunks/chunk.HQLHYAFA.js | 1 + .../shoelace/dist/chunks/chunk.HWUDMSYQ.js | 1 + .../shoelace/dist/chunks/chunk.HZD5FWDJ.js | 165 +++++ .../shoelace/dist/chunks/chunk.I3355KHS.js | 1 + .../shoelace/dist/chunks/chunk.I33L3NO6.js | 1 + .../shoelace/dist/chunks/chunk.I5XYF2B3.js | 6 + .../shoelace/dist/chunks/chunk.I64IM243.js | 1 + .../shoelace/dist/chunks/chunk.I7AKVNN5.js | 1 + .../shoelace/dist/chunks/chunk.I7SWWPU3.js | 43 ++ .../shoelace/dist/chunks/chunk.IC3AQISN.js | 1 + .../shoelace/dist/chunks/chunk.IGYXUK7A.js | 9 + .../shoelace/dist/chunks/chunk.IHME2EMJ.js | 11 + .../shoelace/dist/chunks/chunk.IIEUIBXQ.js | 1 + .../shoelace/dist/chunks/chunk.INRC77DZ.js | 120 ++++ .../shoelace/dist/chunks/chunk.IOFPPNUO.js | 15 + .../shoelace/dist/chunks/chunk.IQZHG2D6.js | 45 ++ .../shoelace/dist/chunks/chunk.IVQNJU3Y.js | 290 +++++++++ .../shoelace/dist/chunks/chunk.J2HL7VHU.js | 1 + .../shoelace/dist/chunks/chunk.JJKKOZIV.js | 1 + .../shoelace/dist/chunks/chunk.JOEELO5U.js | 21 + .../shoelace/dist/chunks/chunk.JTIOSPX3.js | 18 + .../shoelace/dist/chunks/chunk.KCCRPUDF.js | 1 + .../shoelace/dist/chunks/chunk.KCX7ISQ4.js | 21 + .../shoelace/dist/chunks/chunk.KE4SI4YI.js | 1 + .../shoelace/dist/chunks/chunk.KFR4Y7YR.js | 8 + .../shoelace/dist/chunks/chunk.KNEPZGUA.js | 1 + .../shoelace/dist/chunks/chunk.KQOUQHGE.js | 1 + .../shoelace/dist/chunks/chunk.KQVX545F.js | 1 + .../shoelace/dist/chunks/chunk.KUF2NWBY.js | 1 + .../shoelace/dist/chunks/chunk.L4EUGKFG.js | 1 + .../shoelace/dist/chunks/chunk.L6B3WVUK.js | 1 + .../shoelace/dist/chunks/chunk.LBC6JESY.js | 1 + .../shoelace/dist/chunks/chunk.LJWCUBTW.js | 1 + .../shoelace/dist/chunks/chunk.LMJPQPQT.js | 16 + .../shoelace/dist/chunks/chunk.LSWJYBJ7.js | 1 + .../shoelace/dist/chunks/chunk.LW4RYI2U.js | 1 + .../shoelace/dist/chunks/chunk.LWU627X7.js | 230 +++++++ .../shoelace/dist/chunks/chunk.M34G3YZA.js | 3 + .../shoelace/dist/chunks/chunk.MISXRW77.js | 82 +++ .../shoelace/dist/chunks/chunk.MLHBT46Z.js | 1 + .../shoelace/dist/chunks/chunk.MMIMZ23M.js | 1 + .../shoelace/dist/chunks/chunk.MMXCXQOI.js | 52 ++ .../shoelace/dist/chunks/chunk.MOS626YU.js | 27 + .../shoelace/dist/chunks/chunk.MPLFBEHE.js | 1 + .../shoelace/dist/chunks/chunk.MUPHLGOG.js | 1 + .../shoelace/dist/chunks/chunk.MXLUC5E3.js | 63 ++ .../shoelace/dist/chunks/chunk.NAC5KFYD.js | 68 ++ .../shoelace/dist/chunks/chunk.NB2K6DNX.js | 1 + .../shoelace/dist/chunks/chunk.NCZWQBRI.js | 22 + .../shoelace/dist/chunks/chunk.NG5GLA5L.js | 67 ++ .../shoelace/dist/chunks/chunk.NJGFDSYD.js | 41 ++ .../shoelace/dist/chunks/chunk.NKNX6N77.js | 1 + .../shoelace/dist/chunks/chunk.NM27SBSV.js | 1 + .../shoelace/dist/chunks/chunk.NNBOLKWI.js | 7 + .../shoelace/dist/chunks/chunk.NU54PZXL.js | 1 + .../shoelace/dist/chunks/chunk.NYIIDP5N.js | 1 + .../shoelace/dist/chunks/chunk.O32WFMMH.js | 16 + .../shoelace/dist/chunks/chunk.O4O6U4WJ.js | 1 + .../shoelace/dist/chunks/chunk.O5XSCRGW.js | 59 ++ .../shoelace/dist/chunks/chunk.O6IUBC6G.js | 51 ++ .../shoelace/dist/chunks/chunk.O7QHERLE.js | 1 + .../shoelace/dist/chunks/chunk.OBB4I6GS.js | 161 +++++ .../shoelace/dist/chunks/chunk.OF6LVDZA.js | 1 + .../shoelace/dist/chunks/chunk.OMEFMDGX.js | 1 + .../shoelace/dist/chunks/chunk.P4PERM2V.js | 86 +++ .../shoelace/dist/chunks/chunk.P57G7BFL.js | 1 + .../shoelace/dist/chunks/chunk.P5B6GUIV.js | 9 + .../shoelace/dist/chunks/chunk.P7ZG6EMR.js | 1 + .../shoelace/dist/chunks/chunk.PE55NVFX.js | 1 + .../shoelace/dist/chunks/chunk.PO5F4WEH.js | 20 + .../shoelace/dist/chunks/chunk.POBNWM3I.js | 60 ++ .../shoelace/dist/chunks/chunk.QC67S7H5.js | 1 + .../shoelace/dist/chunks/chunk.QCTB77SK.js | 116 ++++ .../shoelace/dist/chunks/chunk.QDRH7R4A.js | 45 ++ .../shoelace/dist/chunks/chunk.QEVRAUGO.js | 1 + .../shoelace/dist/chunks/chunk.QL5C2XOW.js | 0 .../shoelace/dist/chunks/chunk.QPEGQM42.js | 23 + .../shoelace/dist/chunks/chunk.QQMN2P7K.js | 1 + .../shoelace/dist/chunks/chunk.QSGNZ7NT.js | 1 + .../shoelace/dist/chunks/chunk.QTAHAGHK.js | 14 + .../shoelace/dist/chunks/chunk.QWQMLSZY.js | 1 + .../shoelace/dist/chunks/chunk.QZGTDMAZ.js | 1 + .../shoelace/dist/chunks/chunk.RAU7GTRD.js | 29 + .../shoelace/dist/chunks/chunk.RK73WSZS.js | 1 + .../shoelace/dist/chunks/chunk.RLM4MLNE.js | 12 + .../shoelace/dist/chunks/chunk.RMCOWJOW.js | 7 + .../shoelace/dist/chunks/chunk.RNVKO5WM.js | 1 + .../shoelace/dist/chunks/chunk.RSOSMS27.js | 1 + .../shoelace/dist/chunks/chunk.RXMELJZK.js | 34 + .../shoelace/dist/chunks/chunk.SH6R2Z4A.js | 1 + .../shoelace/dist/chunks/chunk.SI4ACBFK.js | 57 ++ .../shoelace/dist/chunks/chunk.SJA4DLBN.js | 1 + .../shoelace/dist/chunks/chunk.SL63ZM7T.js | 1 + .../shoelace/dist/chunks/chunk.SMHG5MDN.js | 1 + .../shoelace/dist/chunks/chunk.SOFC3U3P.js | 1 + .../shoelace/dist/chunks/chunk.STFL2MFH.js | 1 + .../shoelace/dist/chunks/chunk.SUMTNFRX.js | 1 + .../shoelace/dist/chunks/chunk.TD6B6IEL.js | 1 + .../shoelace/dist/chunks/chunk.TECP6JR2.js | 1 + .../shoelace/dist/chunks/chunk.TI56FHYX.js | 1 + .../shoelace/dist/chunks/chunk.TICGP7UW.js | 1 + .../shoelace/dist/chunks/chunk.TJOP7HQP.js | 1 + .../shoelace/dist/chunks/chunk.TLNU5YYZ.js | 1 + .../shoelace/dist/chunks/chunk.TLPGLTWN.js | 1 + .../shoelace/dist/chunks/chunk.TUVJKY7S.js | 15 + .../shoelace/dist/chunks/chunk.UCFEWFGG.js | 1 + .../shoelace/dist/chunks/chunk.UH4XZRLW.js | 28 + .../shoelace/dist/chunks/chunk.UIWRDYII.js | 1 + .../shoelace/dist/chunks/chunk.UVFVIZIV.js | 64 ++ .../shoelace/dist/chunks/chunk.V2WC33GK.js | 1 + .../shoelace/dist/chunks/chunk.VCLBTQVE.js | 6 + .../shoelace/dist/chunks/chunk.VDJ55VAV.js | 1 + .../shoelace/dist/chunks/chunk.VLPFGZU5.js | 1 + .../shoelace/dist/chunks/chunk.VPK2OSP4.js | 1 + .../shoelace/dist/chunks/chunk.VSXS3PB6.js | 321 ++++++++++ .../shoelace/dist/chunks/chunk.VXRBGRCD.js | 592 ++++++++++++++++++ .../shoelace/dist/chunks/chunk.W5P4KEEZ.js | 1 + .../shoelace/dist/chunks/chunk.WEONPICB.js | 1 + .../shoelace/dist/chunks/chunk.WIJ5PGEU.js | 84 +++ .../shoelace/dist/chunks/chunk.WISH4DLW.js | 12 + .../shoelace/dist/chunks/chunk.WLYACN3J.js | 1 + .../shoelace/dist/chunks/chunk.WTYX4MI2.js | 1 + .../shoelace/dist/chunks/chunk.WWTGXLZQ.js | 1 + .../shoelace/dist/chunks/chunk.WYWPK2VJ.js | 29 + .../shoelace/dist/chunks/chunk.X2QBSGH3.js | 1 + .../shoelace/dist/chunks/chunk.XNEONNEJ.js | 1 + .../shoelace/dist/chunks/chunk.XTIYYQUD.js | 1 + .../shoelace/dist/chunks/chunk.XYSY2YZG.js | 45 ++ .../shoelace/dist/chunks/chunk.Y4EMDR5Y.js | 1 + .../shoelace/dist/chunks/chunk.YFIYHUIW.js | 1 + .../shoelace/dist/chunks/chunk.YFMRETPM.js | 1 + .../shoelace/dist/chunks/chunk.YIQBNSY5.js | 1 + .../shoelace/dist/chunks/chunk.YL3TSWVM.js | 7 + .../shoelace/dist/chunks/chunk.YLW7C2A3.js | 54 ++ .../shoelace/dist/chunks/chunk.YTKNJGSR.js | 1 + .../shoelace/dist/chunks/chunk.YZHDFJWJ.js | 7 + .../shoelace/dist/chunks/chunk.Z5KRCOTW.js | 1 + .../shoelace/dist/chunks/chunk.Z75AU3J4.js | 1 + .../shoelace/dist/chunks/chunk.Z75LPS3C.js | 18 + .../shoelace/dist/chunks/chunk.ZNCHY6PX.js | 91 +++ .../shoelace/dist/chunks/chunk.ZQG4CH57.js | 1 + .../shoelace/dist/chunks/chunk.ZUGTGVV2.js | 24 + .../shoelace/dist/chunks/chunk.ZX6DT5AE.js | 1 + .../shoelace/dist/chunks/chunk.ZXVOFUQB.js | 1 + .../dist/components/alert/alert.component.js | 1 + .../shoelace/dist/components/alert/alert.js | 1 + .../dist/components/alert/alert.styles.js | 1 + .../animated-image.component.js | 1 + .../animated-image/animated-image.js | 1 + .../animated-image/animated-image.styles.js | 1 + .../animation/animation.component.js | 1 + .../dist/components/animation/animation.js | 1 + .../components/animation/animation.styles.js | 1 + .../dist/components/animation/animations.js | 1 + .../components/avatar/avatar.component.js | 1 + .../shoelace/dist/components/avatar/avatar.js | 1 + .../dist/components/avatar/avatar.styles.js | 1 + .../dist/components/badge/badge.component.js | 1 + .../shoelace/dist/components/badge/badge.js | 1 + .../dist/components/badge/badge.styles.js | 1 + .../breadcrumb-item.component.js | 1 + .../breadcrumb-item/breadcrumb-item.js | 1 + .../breadcrumb-item/breadcrumb-item.styles.js | 1 + .../breadcrumb/breadcrumb.component.js | 1 + .../dist/components/breadcrumb/breadcrumb.js | 1 + .../breadcrumb/breadcrumb.styles.js | 1 + .../button-group/button-group.component.js | 1 + .../components/button-group/button-group.js | 1 + .../button-group/button-group.styles.js | 1 + .../components/button/button.component.js | 1 + .../shoelace/dist/components/button/button.js | 1 + .../dist/components/button/button.styles.js | 1 + .../dist/components/card/card.component.js | 1 + .../shoelace/dist/components/card/card.js | 1 + .../dist/components/card/card.styles.js | 1 + .../carousel-item/carousel-item.component.js | 1 + .../components/carousel-item/carousel-item.js | 1 + .../carousel-item/carousel-item.styles.js | 1 + .../carousel/autoplay-controller.js | 1 + .../components/carousel/carousel.component.js | 1 + .../dist/components/carousel/carousel.js | 1 + .../components/carousel/carousel.styles.js | 1 + .../components/carousel/scroll-controller.js | 1 + .../components/checkbox/checkbox.component.js | 1 + .../dist/components/checkbox/checkbox.js | 1 + .../components/checkbox/checkbox.styles.js | 1 + .../color-picker/color-picker.component.js | 1 + .../components/color-picker/color-picker.js | 1 + .../color-picker/color-picker.styles.js | 1 + .../components/details/details.component.js | 1 + .../dist/components/details/details.js | 1 + .../dist/components/details/details.styles.js | 1 + .../components/dialog/dialog.component.js | 1 + .../shoelace/dist/components/dialog/dialog.js | 1 + .../dist/components/dialog/dialog.styles.js | 1 + .../components/divider/divider.component.js | 1 + .../dist/components/divider/divider.js | 1 + .../dist/components/divider/divider.styles.js | 1 + .../components/drawer/drawer.component.js | 1 + .../shoelace/dist/components/drawer/drawer.js | 1 + .../dist/components/drawer/drawer.styles.js | 1 + .../components/dropdown/dropdown.component.js | 1 + .../dist/components/dropdown/dropdown.js | 1 + .../components/dropdown/dropdown.styles.js | 1 + .../format-bytes/format-bytes.component.js | 1 + .../components/format-bytes/format-bytes.js | 1 + .../format-date/format-date.component.js | 1 + .../components/format-date/format-date.js | 1 + .../format-number/format-number.component.js | 1 + .../components/format-number/format-number.js | 1 + .../icon-button/icon-button.component.js | 1 + .../components/icon-button/icon-button.js | 1 + .../icon-button/icon-button.styles.js | 1 + .../dist/components/icon/icon.component.js | 1 + .../shoelace/dist/components/icon/icon.js | 1 + .../dist/components/icon/icon.styles.js | 1 + .../dist/components/icon/library.default.js | 1 + .../shoelace/dist/components/icon/library.js | 1 + .../dist/components/icon/library.system.js | 1 + .../image-comparer.component.js | 1 + .../image-comparer/image-comparer.js | 1 + .../image-comparer/image-comparer.styles.js | 1 + .../components/include/include.component.js | 1 + .../dist/components/include/include.js | 1 + .../dist/components/include/include.styles.js | 1 + .../dist/components/include/request.js | 1 + .../dist/components/input/input.component.js | 1 + .../shoelace/dist/components/input/input.js | 1 + .../dist/components/input/input.styles.js | 1 + .../menu-item/menu-item.component.js | 1 + .../dist/components/menu-item/menu-item.js | 1 + .../components/menu-item/menu-item.styles.js | 1 + .../menu-label/menu-label.component.js | 1 + .../dist/components/menu-label/menu-label.js | 1 + .../menu-label/menu-label.styles.js | 1 + .../dist/components/menu/menu.component.js | 1 + .../shoelace/dist/components/menu/menu.js | 1 + .../dist/components/menu/menu.styles.js | 1 + .../mutation-observer.component.js | 1 + .../mutation-observer/mutation-observer.js | 1 + .../mutation-observer.styles.js | 1 + .../components/option/option.component.js | 1 + .../shoelace/dist/components/option/option.js | 1 + .../dist/components/option/option.styles.js | 1 + .../dist/components/popup/popup.component.js | 1 + .../shoelace/dist/components/popup/popup.js | 1 + .../dist/components/popup/popup.styles.js | 1 + .../progress-bar/progress-bar.component.js | 1 + .../components/progress-bar/progress-bar.js | 1 + .../progress-bar/progress-bar.styles.js | 1 + .../progress-ring/progress-ring.component.js | 1 + .../components/progress-ring/progress-ring.js | 1 + .../progress-ring/progress-ring.styles.js | 1 + .../components/qr-code/qr-code.component.js | 1 + .../dist/components/qr-code/qr-code.js | 1 + .../dist/components/qr-code/qr-code.styles.js | 1 + .../radio-button/radio-button.component.js | 1 + .../components/radio-button/radio-button.js | 1 + .../radio-button/radio-button.styles.js | 1 + .../radio-group/radio-group.component.js | 1 + .../components/radio-group/radio-group.js | 1 + .../radio-group/radio-group.styles.js | 1 + .../dist/components/radio/radio.component.js | 1 + .../shoelace/dist/components/radio/radio.js | 1 + .../dist/components/radio/radio.styles.js | 1 + .../dist/components/range/range.component.js | 1 + .../shoelace/dist/components/range/range.js | 1 + .../dist/components/range/range.styles.js | 1 + .../components/rating/rating.component.js | 1 + .../shoelace/dist/components/rating/rating.js | 1 + .../dist/components/rating/rating.styles.js | 1 + .../relative-time/relative-time.component.js | 1 + .../components/relative-time/relative-time.js | 1 + .../resize-observer.component.js | 1 + .../resize-observer/resize-observer.js | 1 + .../resize-observer/resize-observer.styles.js | 1 + .../components/select/select.component.js | 1 + .../shoelace/dist/components/select/select.js | 1 + .../dist/components/select/select.styles.js | 1 + .../components/skeleton/skeleton.component.js | 1 + .../dist/components/skeleton/skeleton.js | 1 + .../components/skeleton/skeleton.styles.js | 1 + .../components/spinner/spinner.component.js | 1 + .../dist/components/spinner/spinner.js | 1 + .../dist/components/spinner/spinner.styles.js | 1 + .../split-panel/split-panel.component.js | 1 + .../components/split-panel/split-panel.js | 1 + .../split-panel/split-panel.styles.js | 1 + .../components/switch/switch.component.js | 1 + .../shoelace/dist/components/switch/switch.js | 1 + .../dist/components/switch/switch.styles.js | 1 + .../tab-group/tab-group.component.js | 1 + .../dist/components/tab-group/tab-group.js | 1 + .../components/tab-group/tab-group.styles.js | 1 + .../tab-panel/tab-panel.component.js | 1 + .../dist/components/tab-panel/tab-panel.js | 1 + .../components/tab-panel/tab-panel.styles.js | 1 + .../dist/components/tab/tab.component.js | 1 + .../shoelace/dist/components/tab/tab.js | 1 + .../dist/components/tab/tab.styles.js | 1 + .../dist/components/tag/tag.component.js | 1 + .../shoelace/dist/components/tag/tag.js | 1 + .../dist/components/tag/tag.styles.js | 1 + .../components/textarea/textarea.component.js | 1 + .../dist/components/textarea/textarea.js | 1 + .../components/textarea/textarea.styles.js | 1 + .../components/tooltip/tooltip.component.js | 1 + .../dist/components/tooltip/tooltip.js | 1 + .../dist/components/tooltip/tooltip.styles.js | 1 + .../tree-item/tree-item.component.js | 1 + .../dist/components/tree-item/tree-item.js | 1 + .../components/tree-item/tree-item.styles.js | 1 + .../dist/components/tree/tree.component.js | 1 + .../shoelace/dist/components/tree/tree.js | 1 + .../dist/components/tree/tree.styles.js | 1 + .../visually-hidden.component.js | 1 + .../visually-hidden/visually-hidden.js | 1 + .../visually-hidden/visually-hidden.styles.js | 1 + .../shoelace/dist/react/index.js | 1 + .../shoelace/dist/shoelace-autoloader.js | 1 + .../@shoelace-style/shoelace/dist/shoelace.js | 1 + .../shoelace/dist/themes/dark.styles.js | 474 ++++++++++++++ .../shoelace/dist/themes/light.styles.js | 475 ++++++++++++++ .../shoelace/dist/translations/da.js | 1 + .../shoelace/dist/translations/de-ch.js | 1 + .../shoelace/dist/translations/de.js | 1 + .../shoelace/dist/translations/en-gb.js | 1 + .../shoelace/dist/translations/en.js | 1 + .../shoelace/dist/translations/es.js | 1 + .../shoelace/dist/translations/fa.js | 1 + .../shoelace/dist/translations/fr.js | 1 + .../shoelace/dist/translations/he.js | 1 + .../shoelace/dist/translations/hu.js | 1 + .../shoelace/dist/translations/ja.js | 1 + .../shoelace/dist/translations/nl.js | 1 + .../shoelace/dist/translations/pl.js | 1 + .../shoelace/dist/translations/pt.js | 1 + .../shoelace/dist/translations/ru.js | 1 + .../shoelace/dist/translations/sv.js | 1 + .../shoelace/dist/translations/tr.js | 1 + .../shoelace/dist/translations/zh-tw.js | 1 + .../dist/utilities/animation-registry.js | 1 + .../shoelace/dist/utilities/animation.js | 1 + .../shoelace/dist/utilities/base-path.js | 1 + .../shoelace/dist/utilities/form.js | 1 + .../shoelace/dist/utilities/icon-library.js | 1 + .../shoelace/dist/utilities/localize.js | 1 + build/polymer.json | 6 + polymer.json | 6 + wc-registry.json | 2 +- 572 files changed, 8481 insertions(+), 381 deletions(-) create mode 100644 build/es6/node_modules/@lrnwebcomponents/haxcms-elements/lib/ui-components/magic/site-view.js create mode 100644 build/es6/node_modules/@lrnwebcomponents/play-list/lib/SLStyleManager.js create mode 100644 build/es6/node_modules/@lrnwebcomponents/play-list/lib/play-list.haxProperties.json create mode 100644 build/es6/node_modules/@lrnwebcomponents/play-list/play-list.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/bounce.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/flash.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/headShake.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/heartBeat.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/jello.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/pulse.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/rubberBand.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/shake.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/shakeX.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/shakeY.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/swing.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/tada.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/attention_seekers/wobble.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_entrances/backInDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_entrances/backInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_entrances/backInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_entrances/backInUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_exits/backOutDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_exits/backOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_exits/backOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/back_exits/backOutUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_entrances/bounceIn.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_entrances/bounceInDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_entrances/bounceInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_entrances/bounceInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_entrances/bounceInUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_exits/bounceOut.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_exits/bounceOutDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_exits/bounceOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_exits/bounceOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/bouncing_exits/bounceOutUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/easings/easings.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeIn.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInBottomLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInBottomRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInDownBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInLeftBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInRightBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInTopLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInTopRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_entrances/fadeInUpBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOut.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutBottomLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutBottomRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutDownBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutLeftBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutRightBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutTopLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutTopRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/fading_exits/fadeOutUpBig.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/flippers/flip.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/flippers/flipInX.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/flippers/flipInY.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/flippers/flipOutX.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/flippers/flipOutY.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/index.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/lightspeed/lightSpeedInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/lightspeed/lightSpeedInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/lightspeed/lightSpeedOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/lightspeed/lightSpeedOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_entrances/rotateIn.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_entrances/rotateInDownLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_entrances/rotateInDownRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_entrances/rotateInUpLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_entrances/rotateInUpRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_exits/rotateOut.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_exits/rotateOutDownLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_exits/rotateOutDownRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_exits/rotateOutUpLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/rotating_exits/rotateOutUpRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_entrances/slideInDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_entrances/slideInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_entrances/slideInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_entrances/slideInUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_exits/slideOutDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_exits/slideOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_exits/slideOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/sliding_exits/slideOutUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/specials/hinge.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/specials/jackInTheBox.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/specials/rollIn.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/specials/rollOut.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_entrances/zoomIn.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_entrances/zoomInDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_entrances/zoomInLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_entrances/zoomInRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_entrances/zoomInUp.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_exits/zoomOut.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_exits/zoomOutDown.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_exits/zoomOutLeft.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_exits/zoomOutRight.js create mode 100644 build/es6/node_modules/@shoelace-style/animations/dist/zooming_exits/zoomOutUp.js create mode 100644 build/es6/node_modules/@shoelace-style/localize/dist/index.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.23QSDHN7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.26CDGTKN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2A3352EO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2BBYS2AO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2DIBQ5MD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2KNNLHT6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2NHP677Q.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2OFNWZUO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2UT2ZF7L.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2WKF4RIH.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2WKHOBLT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.35QQGKS6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3ALMDSO3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3CX5T7GV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3CZS6ECK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3P2DZVT6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3Y6SB6QS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3YMXKNHC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4DOW4ZG2.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4FS6RVQD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4GRKCE6W.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4P2RHPJ7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4XPIAYA2.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5453BD52.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5CIGH6UI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5E2TGPJ7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5F6CPPXO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5HRUL7SO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5NBMQ7EG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5UPJYW7M.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5Y4WECUT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5ZUXEXMC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.67AISYA7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6CDLFZKN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6D7NXPD5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6HJKL75R.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6IPOEJS3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6NO6TOOK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6Q3FCZAW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7B5CCNHM.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7BDKFUSY.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7BLP64MK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7JULRNN5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7RHUXUVD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7RZIFKWO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7UUIUZXI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7WBAK746.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7ZCMJKGF.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.A2IRGVGD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.A4EV4GKC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.A4SOQOK5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.AI4KLJFS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.AMHT72HT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.AXJGIJ6I.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B4BZKR24.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B7JJGOCZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BAD6C56T.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BDDLQS6W.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BI7DHIJN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BT7SAYED.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BUMKX4R7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BV3WOJKI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BVEHX6NS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BWSFZ3II.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BYQQMUHG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BZCHZMPK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CAHT2E74.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CB4P5CRU.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CEMITGOC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CEU4JDVC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CGXJYWRD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CJDR7567.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.COAGA4BW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CRA7IQJI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CTT4DASP.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CYAWIBIC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DHO3GHQI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DIRIFXCD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DQM2UOFS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DRJODFCK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DT3OOL5X.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DV34JM5Y.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.DWRCQAX7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.E2JGAFR4.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EKHVZV23.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EPB7DJXC.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EQP3JFQP.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.F4VGSDIW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.F5BGAPMF.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.F62XCO4D.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FGNNVMLF.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FMRCD3VN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FWRCRSIY.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.G3SPB25T.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.G7UWKMCZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GCN3DWSD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GF4UCFQ6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GI7VDIWX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GIIHC72T.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GTFBBFI7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GTUXXKTG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GU7HQTHB.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GZ6BQYUU.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HAL7R4WT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HDC6JDQL.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HF7GESMZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HINEY7NM.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HNH4USWO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HNLZQAGV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HOZSVBVS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HQLHYAFA.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HWUDMSYQ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HZD5FWDJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I3355KHS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I33L3NO6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I5XYF2B3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I64IM243.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I7AKVNN5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.I7SWWPU3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IC3AQISN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IGYXUK7A.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IHME2EMJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IIEUIBXQ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.INRC77DZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IOFPPNUO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IQZHG2D6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IVQNJU3Y.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.J2HL7VHU.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.JJKKOZIV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.JOEELO5U.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.JTIOSPX3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KCCRPUDF.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KCX7ISQ4.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KE4SI4YI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KFR4Y7YR.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KNEPZGUA.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KQOUQHGE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KQVX545F.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KUF2NWBY.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.L4EUGKFG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.L6B3WVUK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LBC6JESY.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LJWCUBTW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LMJPQPQT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LSWJYBJ7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LW4RYI2U.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LWU627X7.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.M34G3YZA.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MISXRW77.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MLHBT46Z.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MMIMZ23M.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MMXCXQOI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MOS626YU.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MPLFBEHE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MUPHLGOG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MXLUC5E3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NAC5KFYD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NB2K6DNX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NCZWQBRI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NG5GLA5L.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NJGFDSYD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NKNX6N77.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NM27SBSV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NNBOLKWI.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NU54PZXL.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NYIIDP5N.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O32WFMMH.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O4O6U4WJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O5XSCRGW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O6IUBC6G.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O7QHERLE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.OBB4I6GS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.OF6LVDZA.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.OMEFMDGX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P4PERM2V.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P57G7BFL.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P5B6GUIV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P7ZG6EMR.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.PE55NVFX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.PO5F4WEH.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.POBNWM3I.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QC67S7H5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QCTB77SK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QDRH7R4A.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QEVRAUGO.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QL5C2XOW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QPEGQM42.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QQMN2P7K.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QSGNZ7NT.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QTAHAGHK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QWQMLSZY.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QZGTDMAZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RAU7GTRD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RK73WSZS.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RLM4MLNE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RMCOWJOW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RNVKO5WM.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RSOSMS27.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.RXMELJZK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SH6R2Z4A.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SI4ACBFK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SJA4DLBN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SL63ZM7T.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SMHG5MDN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SOFC3U3P.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.STFL2MFH.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SUMTNFRX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TD6B6IEL.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TECP6JR2.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TI56FHYX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TICGP7UW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TJOP7HQP.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TLNU5YYZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TLPGLTWN.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TUVJKY7S.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.UCFEWFGG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.UH4XZRLW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.UIWRDYII.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.UVFVIZIV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.V2WC33GK.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VCLBTQVE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VDJ55VAV.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VLPFGZU5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VPK2OSP4.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VSXS3PB6.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VXRBGRCD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.W5P4KEEZ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WEONPICB.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WIJ5PGEU.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WISH4DLW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WLYACN3J.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WTYX4MI2.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WWTGXLZQ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WYWPK2VJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.X2QBSGH3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XNEONNEJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XTIYYQUD.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XYSY2YZG.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.Y4EMDR5Y.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YFIYHUIW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YFMRETPM.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YIQBNSY5.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YL3TSWVM.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YLW7C2A3.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YTKNJGSR.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YZHDFJWJ.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.Z5KRCOTW.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.Z75AU3J4.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.Z75LPS3C.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZNCHY6PX.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZQG4CH57.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZUGTGVV2.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZX6DT5AE.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZXVOFUQB.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/alert/alert.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/alert/alert.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/alert/alert.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animated-image/animated-image.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animated-image/animated-image.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animated-image/animated-image.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animation/animation.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animation/animation.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animation/animation.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/animation/animations.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/avatar/avatar.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/avatar/avatar.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/avatar/avatar.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/badge/badge.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/badge/badge.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/badge/badge.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb-item/breadcrumb-item.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb-item/breadcrumb-item.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb-item/breadcrumb-item.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button-group/button-group.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button-group/button-group.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button-group/button-group.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button/button.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button/button.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/button/button.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/card/card.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/card/card.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/card/card.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel/autoplay-controller.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel/carousel.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel/carousel.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel/carousel.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/carousel/scroll-controller.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/checkbox/checkbox.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/checkbox/checkbox.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/checkbox/checkbox.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/color-picker/color-picker.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/color-picker/color-picker.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/color-picker/color-picker.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/details/details.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/details/details.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/details/details.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dialog/dialog.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dialog/dialog.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dialog/dialog.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/divider/divider.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/divider/divider.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/divider/divider.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/drawer/drawer.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/drawer/drawer.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/drawer/drawer.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dropdown/dropdown.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dropdown/dropdown.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/dropdown/dropdown.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-date/format-date.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-date/format-date.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-number/format-number.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/format-number/format-number.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon-button/icon-button.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon-button/icon-button.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon-button/icon-button.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/icon.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/icon.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/icon.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/library.default.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/library.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/icon/library.system.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/image-comparer/image-comparer.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/image-comparer/image-comparer.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/image-comparer/image-comparer.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/include/include.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/include/include.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/include/include.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/include/request.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/input/input.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/input/input.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/input/input.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-item/menu-item.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-item/menu-item.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-item/menu-item.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-label/menu-label.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-label/menu-label.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu-label/menu-label.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu/menu.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu/menu.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/menu/menu.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/mutation-observer/mutation-observer.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/mutation-observer/mutation-observer.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/mutation-observer/mutation-observer.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/option/option.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/option/option.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/option/option.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/popup/popup.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/popup/popup.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/popup/popup.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-ring/progress-ring.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-ring/progress-ring.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/progress-ring/progress-ring.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/qr-code/qr-code.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/qr-code/qr-code.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/qr-code/qr-code.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-button/radio-button.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-button/radio-button.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-button/radio-button.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-group/radio-group.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-group/radio-group.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio-group/radio-group.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio/radio.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio/radio.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/radio/radio.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/range/range.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/range/range.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/range/range.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/rating/rating.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/rating/rating.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/rating/rating.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/relative-time/relative-time.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/relative-time/relative-time.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/resize-observer/resize-observer.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/resize-observer/resize-observer.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/resize-observer/resize-observer.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/select/select.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/select/select.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/select/select.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/skeleton/skeleton.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/skeleton/skeleton.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/skeleton/skeleton.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/spinner/spinner.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/spinner/spinner.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/spinner/spinner.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/split-panel/split-panel.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/split-panel/split-panel.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/split-panel/split-panel.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/switch/switch.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/switch/switch.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/switch/switch.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-group/tab-group.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-group/tab-group.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-group/tab-group.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab/tab.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab/tab.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tab/tab.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tag/tag.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tag/tag.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tag/tag.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/textarea/textarea.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/textarea/textarea.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/textarea/textarea.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tooltip/tooltip.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tooltip/tooltip.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tooltip/tooltip.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree-item/tree-item.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree-item/tree-item.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree-item/tree-item.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree/tree.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree/tree.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/tree/tree.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/visually-hidden/visually-hidden.component.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/visually-hidden/visually-hidden.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/components/visually-hidden/visually-hidden.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/react/index.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/shoelace-autoloader.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/shoelace.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/themes/dark.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/themes/light.styles.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/da.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/de-ch.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/de.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/en-gb.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/en.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/es.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/fa.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/fr.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/he.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/hu.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/ja.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/nl.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/pl.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/pt.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/ru.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/sv.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/tr.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/translations/zh-tw.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/animation-registry.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/animation.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/base-path.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/form.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/icon-library.js create mode 100644 build/es6/node_modules/@shoelace-style/shoelace/dist/utilities/localize.js diff --git a/build/es6/node_modules/@google/model-viewer/dist/model-viewer.js b/build/es6/node_modules/@google/model-viewer/dist/model-viewer.js index bdaacc99491..367c35bb287 100644 --- a/build/es6/node_modules/@google/model-viewer/dist/model-viewer.js +++ b/build/es6/node_modules/@google/model-viewer/dist/model-viewer.js @@ -3,7 +3,7 @@ * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const i$2=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function e$3(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):i$2(e,t)} +const i$2=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function n$8(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):i$2(e,t)} /** * @license * Copyright 2021 Google LLC @@ -14,28 +14,39 @@ const i$2=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{... * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */ -const t="151",i=1,n=2,r=3,a=0,o=1,l=2,c=100,h=0,A=1,p=2,m=0,g=1,f=2,v=3,y=4,x=5,E=301,_=302,C=303,b=306,I=1e3,T=1001,B=1002,D=1003,U=1004,F=1005,O=1006,G=1007,H=1008,W=1009,q=1014,j=1015,K=1016,Y=1020,X=1023,J=1026,$=1027,Z=1028,ee=1030,te=33776,ie=33777,ne=33778,re=33779,se=35840,ae=35842,oe=37492,le=37496,ce=37808,he=36492,ue=2201,de=2202,Ae=2300,pe=2301,me=2302,ge=2400,fe=2401,ve=2402,ye=2500,xe=3e3,Ee=3001,_e="srgb",Ce="srgb-linear",Me="display-p3",be=7680,Se=35044,we="300 es",Ie=1035;class EventDispatcher{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const i=this._listeners[e];if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const i=t.slice(0);for(let t=0,n=i.length;t>8&255]+Te[e>>16&255]+Te[e>>24&255]+"-"+Te[255&t]+Te[t>>8&255]+"-"+Te[t>>16&15|64]+Te[t>>24&255]+"-"+Te[63&i|128]+Te[i>>8&255]+"-"+Te[i>>16&255]+Te[i>>24&255]+Te[255&n]+Te[n>>8&255]+Te[n>>16&255]+Te[n>>24&255]).toLowerCase()}function clamp$1(e,t,i){return Math.max(t,Math.min(i,e))}function euclideanModulo(e,t){return(e%t+t)%t}function lerp$1(e,t,i){return(1-i)*e+i*t}function isPowerOfTwo(e){return 0==(e&e-1)&&0!==e}function ceilPowerOfTwo(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function floorPowerOfTwo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function denormalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function normalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const De={DEG2RAD:Le,RAD2DEG:Re,generateUUID,clamp:clamp$1,euclideanModulo,mapLinear:function mapLinear(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function inverseLerp(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:lerp$1,damp:function damp(e,t,i,n){return lerp$1(e,t,1-Math.exp(-i*n))},pingpong:function pingpong(e,t=1){return t-Math.abs(euclideanModulo(e,2*t)-t)},smoothstep:function smoothstep(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function smootherstep(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function randInt(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function randFloat(e,t){return e+Math.random()*(t-e)},randFloatSpread:function randFloatSpread(e){return e*(.5-Math.random())},seededRandom:function seededRandom(e){void 0!==e&&(Be=e);let t=Be+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function degToRad(e){return e*Le},radToDeg:function radToDeg(e){return e*Re},isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler:function setQuaternionFromProperEuler(e,t,i,n,r){const a=Math.cos,o=Math.sin,l=a(i/2),c=o(i/2),h=a((t+n)/2),A=o((t+n)/2),p=a((t-n)/2),m=o((t-n)/2),g=a((n-t)/2),f=o((n-t)/2);switch(r){case"XYX":e.set(l*A,c*p,c*m,l*h);break;case"YZY":e.set(c*m,l*A,c*p,l*h);break;case"ZXZ":e.set(c*p,c*m,l*A,l*h);break;case"XZX":e.set(l*A,c*f,c*g,l*h);break;case"YXY":e.set(c*g,l*A,c*f,l*h);break;case"ZYZ":e.set(c*f,c*g,l*A,l*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize,denormalize};class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(clamp$1(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,n,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=n,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],A=i[7],p=i[2],m=i[5],g=i[8],f=n[0],v=n[3],y=n[6],x=n[1],E=n[4],_=n[7],C=n[2],b=n[5],I=n[8];return r[0]=a*f+o*x+l*C,r[3]=a*v+o*E+l*b,r[6]=a*y+o*_+l*I,r[1]=c*f+h*x+A*C,r[4]=c*v+h*E+A*b,r[7]=c*y+h*_+A*I,r[2]=p*f+m*x+g*C,r[5]=p*v+m*E+g*b,r[8]=p*y+m*_+g*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-i*r*h+i*o*l+n*r*c-n*a*l}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],A=h*a-o*c,p=o*l-h*r,m=c*r-a*l,g=t*A+i*p+n*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const f=1/g;return e[0]=A*f,e[1]=(n*c-h*i)*f,e[2]=(o*i-n*a)*f,e[3]=p*f,e[4]=(h*t-n*l)*f,e[5]=(n*r-o*t)*f,e[6]=m*f,e[7]=(i*l-c*t)*f,e[8]=(a*t-i*r)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-n*c,n*l,-n*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Pe.makeScale(e,t)),this}rotate(e){return this.premultiply(Pe.makeRotation(-e)),this}translate(e,t){return this.premultiply(Pe.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Pe=new Matrix3;function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function createElementNS(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const Ue=(new Matrix3).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),Qe=(new Matrix3).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const Fe={[Ce]:e=>e,[_e]:e=>e.convertSRGBToLinear(),[Me]:function DisplayP3ToLinearSRGB(e){return e.convertSRGBToLinear().applyMatrix3(Qe)}},Ne={[Ce]:e=>e,[_e]:e=>e.convertLinearToSRGB(),[Me]:function LinearSRGBToDisplayP3(e){return e.applyMatrix3(Ue).convertLinearToSRGB()}},ke={enabled:!1,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return Ce},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;const n=Fe[t],r=Ne[i];if(void 0===n||void 0===r)throw new Error(`Unsupported color space conversion, "${t}" to "${i}".`);return r(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let Oe;class ImageUtils{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Oe&&(Oe=createElementNS("canvas")),Oe.width=e.width,Oe.height=e.height;const i=Oe.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Oe}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case I:e.x=e.x-Math.floor(e.x);break;case T:e.x=e.x<0?0:1;break;case B:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case I:e.y=e.y-Math.floor(e.y);break;case T:e.y=e.y<0?0:1;break;case B:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}Texture$1.DEFAULT_IMAGE=null,Texture$1.DEFAULT_MAPPING=300,Texture$1.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,i=0,n=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;const a=.01,o=.1,l=e.elements,c=l[0],h=l[4],A=l[8],p=l[1],m=l[5],g=l[9],f=l[2],v=l[6],y=l[10];if(Math.abs(h-p)l&&e>x?ex?l=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,o=Math.sin(o*a)/r}const r=o*i;if(l=l*e+p*r,c=c*e+m*r,h=h*e+g*r,A=A*e+f*r,e===1-o){const e=1/Math.sqrt(l*l+c*c+h*h+A*A);l*=e,c*=e,h*=e,A*=e}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=A}static multiplyQuaternionsFlat(e,t,i,n,r,a){const o=i[n],l=i[n+1],c=i[n+2],h=i[n+3],A=r[a],p=r[a+1],m=r[a+2],g=r[a+3];return e[t]=o*g+h*A+l*m-c*p,e[t+1]=l*g+h*p+c*A-o*m,e[t+2]=c*g+h*m+o*p-l*A,e[t+3]=h*g-o*A-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,n=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(n/2),A=o(r/2),p=l(i/2),m=l(n/2),g=l(r/2);switch(a){case"XYZ":this._x=p*h*A+c*m*g,this._y=c*m*A-p*h*g,this._z=c*h*g+p*m*A,this._w=c*h*A-p*m*g;break;case"YXZ":this._x=p*h*A+c*m*g,this._y=c*m*A-p*h*g,this._z=c*h*g-p*m*A,this._w=c*h*A+p*m*g;break;case"ZXY":this._x=p*h*A-c*m*g,this._y=c*m*A+p*h*g,this._z=c*h*g+p*m*A,this._w=c*h*A-p*m*g;break;case"ZYX":this._x=p*h*A-c*m*g,this._y=c*m*A+p*h*g,this._z=c*h*g-p*m*A,this._w=c*h*A+p*m*g;break;case"YZX":this._x=p*h*A+c*m*g,this._y=c*m*A+p*h*g,this._z=c*h*g-p*m*A,this._w=c*h*A-p*m*g;break;case"XZY":this._x=p*h*A-c*m*g,this._y=c*m*A-p*h*g,this._z=c*h*g+p*m*A,this._w=c*h*A+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],A=t[10],p=i+o+A;if(p>0){const e=.5/Math.sqrt(p+1);this._w=.25/e,this._x=(h-l)*e,this._y=(r-c)*e,this._z=(a-n)*e}else if(i>o&&i>A){const e=2*Math.sqrt(1+i-o-A);this._w=(h-l)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+c)/e}else if(o>A){const e=2*Math.sqrt(1+o-i-A);this._w=(r-c)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(l+h)/e}else{const e=2*Math.sqrt(1+A-i-o);this._w=(a-n)/e,this._x=(r+c)/e,this._y=(l+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp$1(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=i*h+a*o+n*c-r*l,this._y=n*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-n*o,this._w=a*h-i*o-n*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const i=this._x,n=this._y,r=this._z,a=this._w;let o=a*e._w+i*e._x+n*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),A=Math.sin((1-t)*h)/c,p=Math.sin(t*h)/c;return this._w=a*A+this._w*p,this._x=i*A+this._x*p,this._y=n*A+this._y*p,this._z=r*A+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(r),i*Math.cos(r),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,i=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ze.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ze.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=l*t+a*n-o*i,h=l*i+o*t-r*n,A=l*n+r*i-a*t,p=-r*t-a*i-o*n;return this.x=c*l+p*-r+h*-o-A*-a,this.y=h*l+p*-a+A*-r-c*-o,this.z=A*l+p*-o+c*-a-h*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=n*l-r*o,this.y=r*a-i*l,this.z=i*o-n*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ve.copy(this).projectOnVector(e),this.sub(Ve)}reflect(e){return this.sub(Ve.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(clamp$1(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ve=new Vector3,ze=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,We),We.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ze),et.subVectors(this.max,Ze),je.subVectors(e.a,Ze),Ke.subVectors(e.b,Ze),Ye.subVectors(e.c,Ze),Xe.subVectors(Ke,je),Je.subVectors(Ye,Ke),$e.subVectors(je,Ye);let t=[0,-Xe.z,Xe.y,0,-Je.z,Je.y,0,-$e.z,$e.y,Xe.z,0,-Xe.x,Je.z,0,-Je.x,$e.z,0,-$e.x,-Xe.y,Xe.x,0,-Je.y,Je.x,0,-$e.y,$e.x,0];return!!satForAxes(t,je,Ke,Ye,et)&&(t=[1,0,0,0,1,0,0,0,1],!!satForAxes(t,je,Ke,Ye,et)&&(tt.crossVectors(Xe,Je),t=[tt.x,tt.y,tt.z],satForAxes(t,je,Ke,Ye,et)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,We).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(We).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(He[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),He[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),He[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),He[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),He[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),He[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),He[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),He[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(He)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const He=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],We=new Vector3,qe=new Box3,je=new Vector3,Ke=new Vector3,Ye=new Vector3,Xe=new Vector3,Je=new Vector3,$e=new Vector3,Ze=new Vector3,et=new Vector3,tt=new Vector3,it=new Vector3;function satForAxes(e,t,i,n,r){for(let a=0,o=e.length-3;a<=o;a+=3){it.fromArray(e,a);const o=r.x*Math.abs(it.x)+r.y*Math.abs(it.y)+r.z*Math.abs(it.z),l=t.dot(it),c=i.dot(it),h=n.dot(it);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const nt=new Box3,rt=new Vector3,st=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):nt.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rt.subVectors(e,this.center);const t=rt.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(rt,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(st.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rt.copy(e.center).add(st)),this.expandByPoint(rt.copy(e.center).sub(st))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const at=new Vector3,ot=new Vector3,lt=new Vector3,ct=new Vector3,ht=new Vector3,ut=new Vector3,dt=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,at)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=at.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(at.copy(this.origin).addScaledVector(this.direction,t),at.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){ot.copy(e).add(t).multiplyScalar(.5),lt.copy(t).sub(e).normalize(),ct.copy(this.origin).sub(ot);const r=.5*e.distanceTo(t),a=-this.direction.dot(lt),o=ct.dot(this.direction),l=-ct.dot(lt),c=ct.lengthSq(),h=Math.abs(1-a*a);let A,p,m,g;if(h>0)if(A=a*l-o,p=a*o-l,g=r*h,A>=0)if(p>=-g)if(p<=g){const e=1/h;A*=e,p*=e,m=A*(A+a*p+2*o)+p*(a*A+p+2*l)+c}else p=r,A=Math.max(0,-(a*p+o)),m=-A*A+p*(p+2*l)+c;else p=-r,A=Math.max(0,-(a*p+o)),m=-A*A+p*(p+2*l)+c;else p<=-g?(A=Math.max(0,-(-a*r+o)),p=A>0?-r:Math.min(Math.max(-r,-l),r),m=-A*A+p*(p+2*l)+c):p<=g?(A=0,p=Math.min(Math.max(-r,-l),r),m=p*(p+2*l)+c):(A=Math.max(0,-(a*r+o)),p=A>0?r:Math.min(Math.max(-r,-l),r),m=-A*A+p*(p+2*l)+c);else p=a>0?-r:r,A=Math.max(0,-(a*p+o)),m=-A*A+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,A),n&&n.copy(ot).addScaledVector(lt,p),m}intersectSphere(e,t){at.subVectors(e.center,this.origin);const i=at.dot(this.direction),n=at.dot(at)-i*i,r=e.radius*e.radius;if(n>r)return null;const a=Math.sqrt(r-n),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,A=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,n=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,n=(e.min.x-p.x)*c),h>=0?(r=(e.min.y-p.y)*h,a=(e.max.y-p.y)*h):(r=(e.max.y-p.y)*h,a=(e.min.y-p.y)*h),i>a||r>n?null:((r>i||isNaN(i))&&(i=r),(a=0?(o=(e.min.z-p.z)*A,l=(e.max.z-p.z)*A):(o=(e.max.z-p.z)*A,l=(e.min.z-p.z)*A),i>l||o>n?null:((o>i||i!=i)&&(i=o),(l=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,at)}intersectTriangle(e,t,i,n,r){ht.subVectors(t,e),ut.subVectors(i,e),dt.crossVectors(ht,ut);let a,o=this.direction.dot(dt);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ct.subVectors(this.origin,e);const l=a*this.direction.dot(ut.crossVectors(ct,ut));if(l<0)return null;const c=a*this.direction.dot(ht.cross(ct));if(c<0)return null;if(l+c>o)return null;const h=-a*ct.dot(dt);return h<0?null:this.at(h/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,n,r,a,o,l,c,h,A,p,m,g,f,v){const y=this.elements;return y[0]=e,y[4]=t,y[8]=i,y[12]=n,y[1]=r,y[5]=a,y[9]=o,y[13]=l,y[2]=c,y[6]=h,y[10]=A,y[14]=p,y[3]=m,y[7]=g,y[11]=f,y[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,n=1/At.setFromMatrixColumn(e,0).length(),r=1/At.setFromMatrixColumn(e,1).length(),a=1/At.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(n),c=Math.sin(n),h=Math.cos(r),A=Math.sin(r);if("XYZ"===e.order){const e=a*h,i=a*A,n=o*h,r=o*A;t[0]=l*h,t[4]=-l*A,t[8]=c,t[1]=i+n*c,t[5]=e-r*c,t[9]=-o*l,t[2]=r-e*c,t[6]=n+i*c,t[10]=a*l}else if("YXZ"===e.order){const e=l*h,i=l*A,n=c*h,r=c*A;t[0]=e+r*o,t[4]=n*o-i,t[8]=a*c,t[1]=a*A,t[5]=a*h,t[9]=-o,t[2]=i*o-n,t[6]=r+e*o,t[10]=a*l}else if("ZXY"===e.order){const e=l*h,i=l*A,n=c*h,r=c*A;t[0]=e-r*o,t[4]=-a*A,t[8]=n+i*o,t[1]=i+n*o,t[5]=a*h,t[9]=r-e*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if("ZYX"===e.order){const e=a*h,i=a*A,n=o*h,r=o*A;t[0]=l*h,t[4]=n*c-i,t[8]=e*c+r,t[1]=l*A,t[5]=r*c+e,t[9]=i*c-n,t[2]=-c,t[6]=o*l,t[10]=a*l}else if("YZX"===e.order){const e=a*l,i=a*c,n=o*l,r=o*c;t[0]=l*h,t[4]=r-e*A,t[8]=n*A+i,t[1]=A,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=i*A+n,t[10]=e-r*A}else if("XZY"===e.order){const e=a*l,i=a*c,n=o*l,r=o*c;t[0]=l*h,t[4]=-A,t[8]=c*h,t[1]=e*A+r,t[5]=a*h,t[9]=i*A-n,t[2]=n*A-i,t[6]=o*h,t[10]=r*A+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mt,e,gt)}lookAt(e,t,i){const n=this.elements;return yt.subVectors(e,t),0===yt.lengthSq()&&(yt.z=1),yt.normalize(),ft.crossVectors(i,yt),0===ft.lengthSq()&&(1===Math.abs(i.z)?yt.x+=1e-4:yt.z+=1e-4,yt.normalize(),ft.crossVectors(i,yt)),ft.normalize(),vt.crossVectors(yt,ft),n[0]=ft.x,n[4]=vt.x,n[8]=yt.x,n[1]=ft.y,n[5]=vt.y,n[9]=yt.y,n[2]=ft.z,n[6]=vt.z,n[10]=yt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],A=i[5],p=i[9],m=i[13],g=i[2],f=i[6],v=i[10],y=i[14],x=i[3],E=i[7],_=i[11],C=i[15],b=n[0],I=n[4],T=n[8],B=n[12],D=n[1],U=n[5],F=n[9],O=n[13],G=n[2],H=n[6],W=n[10],q=n[14],j=n[3],K=n[7],Y=n[11],X=n[15];return r[0]=a*b+o*D+l*G+c*j,r[4]=a*I+o*U+l*H+c*K,r[8]=a*T+o*F+l*W+c*Y,r[12]=a*B+o*O+l*q+c*X,r[1]=h*b+A*D+p*G+m*j,r[5]=h*I+A*U+p*H+m*K,r[9]=h*T+A*F+p*W+m*Y,r[13]=h*B+A*O+p*q+m*X,r[2]=g*b+f*D+v*G+y*j,r[6]=g*I+f*U+v*H+y*K,r[10]=g*T+f*F+v*W+y*Y,r[14]=g*B+f*O+v*q+y*X,r[3]=x*b+E*D+_*G+C*j,r[7]=x*I+E*U+_*H+C*K,r[11]=x*T+E*F+_*W+C*Y,r[15]=x*B+E*O+_*q+C*X,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],A=e[6],p=e[10],m=e[14];return e[3]*(+r*l*A-n*c*A-r*o*p+i*c*p+n*o*m-i*l*m)+e[7]*(+t*l*m-t*c*p+r*a*p-n*a*m+n*c*h-r*l*h)+e[11]*(+t*c*A-t*o*m-r*a*A+i*a*m+r*o*h-i*c*h)+e[15]*(-n*o*h-t*l*A+t*o*p+n*a*A-i*a*p+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],A=e[9],p=e[10],m=e[11],g=e[12],f=e[13],v=e[14],y=e[15],x=A*v*c-f*p*c+f*l*m-o*v*m-A*l*y+o*p*y,E=g*p*c-h*v*c-g*l*m+a*v*m+h*l*y-a*p*y,_=h*f*c-g*A*c+g*o*m-a*f*m-h*o*y+a*A*y,C=g*A*l-h*f*l-g*o*p+a*f*p+h*o*v-a*A*v,b=t*x+i*E+n*_+r*C;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/b;return e[0]=x*I,e[1]=(f*p*r-A*v*r-f*n*m+i*v*m+A*n*y-i*p*y)*I,e[2]=(o*v*r-f*l*r+f*n*c-i*v*c-o*n*y+i*l*y)*I,e[3]=(A*l*r-o*p*r-A*n*c+i*p*c+o*n*m-i*l*m)*I,e[4]=E*I,e[5]=(h*v*r-g*p*r+g*n*m-t*v*m-h*n*y+t*p*y)*I,e[6]=(g*l*r-a*v*r-g*n*c+t*v*c+a*n*y-t*l*y)*I,e[7]=(a*p*r-h*l*r+h*n*c-t*p*c-a*n*m+t*l*m)*I,e[8]=_*I,e[9]=(g*A*r-h*f*r-g*i*m+t*f*m+h*i*y-t*A*y)*I,e[10]=(a*f*r-g*o*r+g*i*c-t*f*c-a*i*y+t*o*y)*I,e[11]=(h*o*r-a*A*r-h*i*c+t*A*c+a*i*m-t*o*m)*I,e[12]=C*I,e[13]=(h*f*n-g*A*n+g*i*p-t*f*p-h*i*v+t*A*v)*I,e[14]=(g*o*n-a*f*n-g*i*l+t*f*l+a*i*v-t*o*v)*I,e[15]=(a*A*n-h*o*n+h*i*l-t*A*l-a*i*p+t*o*p)*I,this}scale(e){const t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-n*l,c*l+n*o,0,c*o+n*l,h*o+i,h*l-n*a,0,c*l-n*o,h*l+n*a,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,A=o+o,p=r*c,m=r*h,g=r*A,f=a*h,v=a*A,y=o*A,x=l*c,E=l*h,_=l*A,C=i.x,b=i.y,I=i.z;return n[0]=(1-(f+y))*C,n[1]=(m+_)*C,n[2]=(g-E)*C,n[3]=0,n[4]=(m-_)*b,n[5]=(1-(p+y))*b,n[6]=(v+x)*b,n[7]=0,n[8]=(g+E)*I,n[9]=(v-x)*I,n[10]=(1-(p+f))*I,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;let r=At.set(n[0],n[1],n[2]).length();const a=At.set(n[4],n[5],n[6]).length(),o=At.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],pt.copy(this);const l=1/r,c=1/a,h=1/o;return pt.elements[0]*=l,pt.elements[1]*=l,pt.elements[2]*=l,pt.elements[4]*=c,pt.elements[5]*=c,pt.elements[6]*=c,pt.elements[8]*=h,pt.elements[9]*=h,pt.elements[10]*=h,t.setFromRotationMatrix(pt),i.x=r,i.y=a,i.z=o,this}makePerspective(e,t,i,n,r,a){const o=this.elements,l=2*r/(t-e),c=2*r/(i-n),h=(t+e)/(t-e),A=(i+n)/(i-n),p=-(a+r)/(a-r),m=-2*a*r/(a-r);return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=A,o[13]=0,o[2]=0,o[6]=0,o[10]=p,o[14]=m,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,n,r,a){const o=this.elements,l=1/(t-e),c=1/(i-n),h=1/(a-r),A=(t+e)*l,p=(i+n)*c,m=(a+r)*h;return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-A,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-p,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-m,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const At=new Vector3,pt=new Matrix4,mt=new Vector3(0,0,0),gt=new Vector3(1,1,1),ft=new Vector3,vt=new Vector3,yt=new Vector3,xt=new Matrix4,Et=new Quaternion;class Euler{constructor(e=0,t=0,i=0,n=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,r=n[0],a=n[4],o=n[8],l=n[1],c=n[5],h=n[9],A=n[2],p=n[6],m=n[10];switch(t){case"XYZ":this._y=Math.asin(clamp$1(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp$1(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-A,r),this._z=0);break;case"ZXY":this._x=Math.asin(clamp$1(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-clamp$1(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(clamp$1(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-A,r)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-clamp$1(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return xt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xt,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Et.setFromEuler(this),this.setFromQuaternion(Et,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i=i.concat(r))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(wt,e,It),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(wt,Tt,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=serialize(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t0){n.children=[];for(let t=0;t0){n.animations=[];for(let t=0;t0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=n,i;function extractFromCache(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){Ut.subVectors(n,t),Qt.subVectors(i,t),Ft.subVectors(e,t);const a=Ut.dot(Ut),o=Ut.dot(Qt),l=Ut.dot(Ft),c=Qt.dot(Qt),h=Qt.dot(Ft),A=a*c-o*o;if(0===A)return r.set(-2,-1,-1);const p=1/A,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return r.set(1-m-g,g,m)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Nt),Nt.x>=0&&Nt.y>=0&&Nt.x+Nt.y<=1}static getUV(e,t,i,n,r,a,o,l){return!1===Wt&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Wt=!0),this.getInterpolation(e,t,i,n,r,a,o,l)}static getInterpolation(e,t,i,n,r,a,o,l){return this.getBarycoord(e,t,i,n,Nt),l.setScalar(0),l.addScaledVector(r,Nt.x),l.addScaledVector(a,Nt.y),l.addScaledVector(o,Nt.z),l}static isFrontFacing(e,t,i,n){return Ut.subVectors(i,t),Qt.subVectors(e,t),Ut.cross(Qt).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ut.subVectors(this.c,this.b),Qt.subVectors(this.a,this.b),.5*Ut.cross(Qt).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return!1===Wt&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Wt=!0),Triangle.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}getInterpolation(e,t,i,n,r){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,r=this.c;let a,o;kt.subVectors(n,i),Ot.subVectors(r,i),Vt.subVectors(e,i);const l=kt.dot(Vt),c=Ot.dot(Vt);if(l<=0&&c<=0)return t.copy(i);zt.subVectors(e,n);const h=kt.dot(zt),A=Ot.dot(zt);if(h>=0&&A<=h)return t.copy(n);const p=l*A-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(i).addScaledVector(kt,a);Ht.subVectors(e,r);const m=kt.dot(Ht),g=Ot.dot(Ht);if(g>=0&&m<=g)return t.copy(r);const f=m*c-l*g;if(f<=0&&c>=0&&g<=0)return o=c/(c-g),t.copy(i).addScaledVector(Ot,o);const v=h*g-m*A;if(v<=0&&A-h>=0&&m-g>=0)return Gt.subVectors(r,n),o=(A-h)/(A-h+(m-g)),t.copy(n).addScaledVector(Gt,o);const y=1/(v+f+p);return a=f*y,o=p*y,t.copy(i).addScaledVector(kt,a).addScaledVector(Ot,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let qt=0;class Material$1 extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qt++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=1,this.side=a,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=c,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=be,this.stencilZFail=be,this.stencilZPass=be,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function extractFromCache(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),this.side!==a&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(i.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){const t=extractFromCache(e.textures),n=extractFromCache(e.images);t.length>0&&(i.textures=t),n.length>0&&(i.images=n)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}const jt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Kt={h:0,s:0,l:0},Yt={h:0,s:0,l:0};function hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}class Color{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=_e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ke.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=ke.workingColorSpace){return this.r=e,this.g=t,this.b=i,ke.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=ke.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp$1(t,0,1),i=clamp$1(i,0,1),0===t)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=hue2rgb(r,n,e+1/3),this.g=hue2rgb(r,n,e),this.b=hue2rgb(r,n,e-1/3)}return ke.toWorkingColorSpace(this,n),this}setStyle(e,t=_e){function handleAlpha(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let n;const r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,ke.toWorkingColorSpace(this,t),handleAlpha(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,ke.toWorkingColorSpace(this,t),handleAlpha(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const e=parseFloat(n[1])/360,i=parseFloat(n[2])/100,r=parseFloat(n[3])/100;return handleAlpha(n[4]),this.setHSL(e,i,r,t)}break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=_e){const i=jt[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_e){return ke.fromWorkingColorSpace(Xt.copy(this),e),clamp$1(255*Xt.r,0,255)<<16^clamp$1(255*Xt.g,0,255)<<8^clamp$1(255*Xt.b,0,255)<<0}getHexString(e=_e){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ke.workingColorSpace){ke.fromWorkingColorSpace(Xt.copy(this),t);const i=Xt.r,n=Xt.g,r=Xt.b,a=Math.max(i,n,r),o=Math.min(i,n,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const e=a-o;switch(c=h<=.5?e/(a+o):e/(2-a-o),a){case i:l=(n-r)/e+(n>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}const a=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;0==(8388608&t);)t<<=1,i-=8388608;t&=-8388609,i+=947912704,a[e]=t|i}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(l[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:a,exponentTable:o,offsetTable:l}}const $t={toHalfFloat:function toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=clamp$1(e,-65504,65504),Jt.floatView[0]=e;const t=Jt.uint32View[0],i=t>>23&511;return Jt.baseTable[i]+((8388607&t)>>Jt.shiftTable[i])},fromHalfFloat:function fromHalfFloat(e){const t=e>>10;return Jt.uint32View[0]=Jt.mantissaTable[Jt.offsetTable[t]+(1023&e)]+Jt.exponentTable[t],Jt.floatView[0]}},Zt=new Vector3,ei=new Vector2;class BufferAttribute{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=Se,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const t in i){const n=i[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let r=!1;for(const t in this.morphAttributes){const i=this.morphAttributes[t],a=[];for(let t=0,n=i.length;t0&&(n[t]=a,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone(t));const n=e.attributes;for(const e in n){const i=n[e];this.setAttribute(e,i.clone(t))}const r=e.morphAttributes;for(const e in r){const i=[],n=r[e];for(let e=0,r=n.length;e0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e(e.far-e.near)**2)return}if(li.copy(r).invert(),ci.copy(e.ray).applyMatrix4(li),null!==i.boundingBox&&!1===ci.intersectsBox(i.boundingBox))return;let a;const o=i.index,l=i.attributes.position,c=i.attributes.uv,h=i.attributes.uv2,A=i.attributes.normal,p=i.groups,m=i.drawRange;if(null!==o)if(Array.isArray(n))for(let i=0,r=p.length;ii.far?null:{distance:p,point:bi.clone(),object:e}}(e,t,i,n,di,Ai,pi,Mi);if(m){r&&(fi.fromBufferAttribute(r,h),vi.fromBufferAttribute(r,A),yi.fromBufferAttribute(r,p),m.uv=Triangle.getInterpolation(Mi,di,Ai,pi,fi,vi,yi,new Vector2)),l&&(fi.fromBufferAttribute(l,h),vi.fromBufferAttribute(l,A),yi.fromBufferAttribute(l,p),m.uv2=Triangle.getInterpolation(Mi,di,Ai,pi,fi,vi,yi,new Vector2)),c&&(xi.fromBufferAttribute(c,h),_i.fromBufferAttribute(c,A),Ci.fromBufferAttribute(c,p),m.normal=Triangle.getInterpolation(Mi,di,Ai,pi,xi,_i,Ci,new Vector3),m.normal.dot(n.direction)>0&&m.normal.multiplyScalar(-1));const e={a:h,b:A,c:p,normal:new Vector3,materialIndex:0};Triangle.getNormal(di,Ai,pi,e.normal),m.face=e}return m}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};const o=this;n=Math.floor(n),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],A=[];let p=0,m=0;function buildPlane(e,t,i,n,r,a,g,f,v,y,x){const E=a/v,_=g/y,C=a/2,b=g/2,I=f/2,T=v+1,B=y+1;let D=0,U=0;const F=new Vector3;for(let a=0;a0?1:-1,h.push(F.x,F.y,F.z),A.push(l/v),A.push(1-a/y),D+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class PerspectiveCamera extends Camera{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Re*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Le*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Re*Math.atan(Math.tan(.5*Le*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Le*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/o,n*=a.width/e,i*=a.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ti=-90;class CubeCamera extends Object3D{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const n=new PerspectiveCamera(Ti,1,e,t);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);const r=new PerspectiveCamera(Ti,1,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const a=new PerspectiveCamera(Ti,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(0,1,0),this.add(a);const o=new PerspectiveCamera(Ti,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(0,-1,0),this.add(o);const l=new PerspectiveCamera(Ti,1,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const c=new PerspectiveCamera(Ti,1,e,t);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,-1),this.add(c)}update(e,t){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,a,o,l,c]=this.children,h=e.getRenderTarget(),A=e.toneMapping,p=e.xr.enabled;e.toneMapping=m,e.xr.enabled=!1;const g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,a),e.setRenderTarget(i,3),e.render(t,o),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=g,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(h),e.toneMapping=A,e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h){super(e=void 0!==e?e:[],t=void 0!==t?t:E,i,n,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new CubeTexture(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:O}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new BoxGeometry(5,5,5),r=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:o,blending:0});r.uniforms.tEquirect.value=t;const a=new Mesh(n,r),l=t.minFilter;t.minFilter===H&&(t.minFilter=O);return new CubeCamera(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,i,n){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,i,n);e.setRenderTarget(r)}}const Bi=new Vector3,Li=new Vector3,Ri=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=Bi.subVectors(i,t).cross(Li.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Bi),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Ri.getNormalMatrix(e),n=this.coplanarPoint(Bi).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Di=new Sphere,Ui=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,i=new Plane,n=new Plane,r=new Plane,a=new Plane){this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,n=i[0],r=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],A=i[7],p=i[8],m=i[9],g=i[10],f=i[11],v=i[12],y=i[13],x=i[14],E=i[15];return t[0].setComponents(o-n,A-l,f-p,E-v).normalize(),t[1].setComponents(o+n,A+l,f+p,E+v).normalize(),t[2].setComponents(o+r,A+c,f+m,E+y).normalize(),t[3].setComponents(o-r,A-c,f-m,E-y).normalize(),t[4].setComponents(o-a,A-h,f-g,E-x).normalize(),t[5].setComponents(o+a,A+h,f+g,E+x).normalize(),this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Di.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Di.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Di)}intersectsSprite(e){return Di.center.set(0,0,0),Di.radius=.7071067811865476,Di.applyMatrix4(e.matrixWorld),this.intersectsSphere(Di)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(i)0?e.max.x:e.min.x,Ui.y=n.normal.y>0?e.max.y:e.min.y,Ui.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Ui)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let e=null,t=!1,i=null,n=null;function onAnimationFrame(t,r){i(t,r),n=e.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(onAnimationFrame),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function WebGLAttributes(e,t){const i=t.isWebGL2,n=new WeakMap;return{get:function get(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function remove(t){t.isInterleavedBufferAttribute&&(t=t.data);const i=n.get(t);i&&(e.deleteBuffer(i.buffer),n.delete(t))},update:function update(t,r){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, vec2 fullSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\t\n\t\tvec2 lodFudge = pow( 1.95, lod ) / fullSize;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec2 fullSize = vec2( textureSize( sampler, 0 ) );\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), fullSize, floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), fullSize, ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_UV2\n\tattribute vec2 uv2;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},Fi={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaTest:{value:0}}},Ni={basic:{uniforms:mergeUniforms([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.fog]),vertexShader:Qi.meshbasic_vert,fragmentShader:Qi.meshbasic_frag},lambert:{uniforms:mergeUniforms([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.fog,Fi.lights,{emissive:{value:new Color(0)}}]),vertexShader:Qi.meshlambert_vert,fragmentShader:Qi.meshlambert_frag},phong:{uniforms:mergeUniforms([Fi.common,Fi.specularmap,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.fog,Fi.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:Qi.meshphong_vert,fragmentShader:Qi.meshphong_frag},standard:{uniforms:mergeUniforms([Fi.common,Fi.envmap,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.roughnessmap,Fi.metalnessmap,Fi.fog,Fi.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qi.meshphysical_vert,fragmentShader:Qi.meshphysical_frag},toon:{uniforms:mergeUniforms([Fi.common,Fi.aomap,Fi.lightmap,Fi.emissivemap,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.gradientmap,Fi.fog,Fi.lights,{emissive:{value:new Color(0)}}]),vertexShader:Qi.meshtoon_vert,fragmentShader:Qi.meshtoon_frag},matcap:{uniforms:mergeUniforms([Fi.common,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,Fi.fog,{matcap:{value:null}}]),vertexShader:Qi.meshmatcap_vert,fragmentShader:Qi.meshmatcap_frag},points:{uniforms:mergeUniforms([Fi.points,Fi.fog]),vertexShader:Qi.points_vert,fragmentShader:Qi.points_frag},dashed:{uniforms:mergeUniforms([Fi.common,Fi.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qi.linedashed_vert,fragmentShader:Qi.linedashed_frag},depth:{uniforms:mergeUniforms([Fi.common,Fi.displacementmap]),vertexShader:Qi.depth_vert,fragmentShader:Qi.depth_frag},normal:{uniforms:mergeUniforms([Fi.common,Fi.bumpmap,Fi.normalmap,Fi.displacementmap,{opacity:{value:1}}]),vertexShader:Qi.meshnormal_vert,fragmentShader:Qi.meshnormal_frag},sprite:{uniforms:mergeUniforms([Fi.sprite,Fi.fog]),vertexShader:Qi.sprite_vert,fragmentShader:Qi.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Qi.background_vert,fragmentShader:Qi.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Qi.backgroundCube_vert,fragmentShader:Qi.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qi.cube_vert,fragmentShader:Qi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qi.equirect_vert,fragmentShader:Qi.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([Fi.common,Fi.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qi.distanceRGBA_vert,fragmentShader:Qi.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([Fi.lights,Fi.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:Qi.shadow_vert,fragmentShader:Qi.shadow_frag}};Ni.physical={uniforms:mergeUniforms([Ni.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3}}]),vertexShader:Qi.meshphysical_vert,fragmentShader:Qi.meshphysical_frag};const ki={r:0,b:0,g:0};function WebGLBackground(e,t,i,n,r,l,c){const h=new Color(0);let A,p,m=!0===l?0:1,g=null,f=0,v=null;function setClear(t,i){t.getRGB(ki,getUnlitUniformColorSpace(e)),n.buffers.color.setClear(ki.r,ki.g,ki.b,i,c)}return{getClearColor:function(){return h},setClearColor:function(e,t=1){h.set(e),m=t,setClear(h,m)},getClearAlpha:function(){return m},setClearAlpha:function(e){m=e,setClear(h,m)},render:function render(n,l){let c=!1,y=!0===l.isScene?l.background:null;if(y&&y.isTexture){y=(l.backgroundBlurriness>0?i:t).get(y)}const x=e.xr,E=x.getSession&&x.getSession();E&&"additive"===E.environmentBlendMode&&(y=null),null===y?setClear(h,m):y&&y.isColor&&(setClear(y,1),c=!0),(e.autoClear||c)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===b)?(void 0===p&&(p=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(Ni.backgroundCube.uniforms),vertexShader:Ni.backgroundCube.vertexShader,fragmentShader:Ni.backgroundCube.fragmentShader,side:o,depthTest:!1,depthWrite:!1,fog:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),p.material.uniforms.envMap.value=y,p.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,p.material.uniforms.backgroundBlurriness.value=l.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=l.backgroundIntensity,p.material.toneMapped=y.encoding!==Ee,g===y&&f===y.version&&v===e.toneMapping||(p.material.needsUpdate=!0,g=y,f=y.version,v=e.toneMapping),p.layers.enableAll(),n.unshift(p,p.geometry,p.material,0,0,null)):y&&y.isTexture&&(void 0===A&&(A=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(Ni.background.uniforms),vertexShader:Ni.background.vertexShader,fragmentShader:Ni.background.fragmentShader,side:a,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(A)),A.material.uniforms.t2D.value=y,A.material.uniforms.backgroundIntensity.value=l.backgroundIntensity,A.material.toneMapped=y.encoding!==Ee,!0===y.matrixAutoUpdate&&y.updateMatrix(),A.material.uniforms.uvTransform.value.copy(y.matrix),g===y&&f===y.version&&v===e.toneMapping||(A.material.needsUpdate=!0,g=y,f=y.version,v=e.toneMapping),A.layers.enableAll(),n.unshift(A,A.geometry,A.material,0,0,null))}}}function WebGLBindingStates(e,t,i,n){const r=e.getParameter(34921),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||null!==a,l={},c=createBindingState(null);let h=c,A=!1;function bindVertexArrayObject(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function deleteVertexArrayObject(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function createBindingState(e){const t=[],i=[],n=[];for(let e=0;e=0){const i=r[t];let n=a[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===i)return!0;if(i.attribute!==n)return!0;if(n&&i.data!==n.data)return!0;o++}}return h.attributesNum!==o||h.index!==n}(r,m,p,g),f&&function saveCache(e,t,i,n){const r={},a=t.attributes;let o=0;const l=i.getAttributes();for(const t in l){if(l[t].location>=0){let i=a[t];void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor));const n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[t]=n,o++}}h.attributes=r,h.attributesNum=o,h.index=n}(r,m,p,g)}else{const e=!0===c.wireframe;h.geometry===m.id&&h.program===p.id&&h.wireframe===e||(h.geometry=m.id,h.program=p.id,h.wireframe=e,f=!0)}null!==g&&i.update(g,34963),(f||A)&&(A=!1,function setupVertexAttributes(r,a,o,l){if(!1===n.isWebGL2&&(r.isInstancedMesh||l.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;initAttributes();const c=l.attributes,h=o.getAttributes(),A=a.defaultAttributeValues;for(const t in h){const n=h[t];if(n.location>=0){let a=c[t];if(void 0===a&&("instanceMatrix"===t&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const t=a.normalized,o=a.itemSize,c=i.get(a);if(void 0===c)continue;const h=c.buffer,A=c.type,p=c.bytesPerElement;if(a.isInterleavedBufferAttribute){const i=a.data,c=i.stride,m=a.offset;if(i.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const r="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let a=void 0!==i.precision?i.precision:"highp";const o=getMaxPrecision(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=r||t.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=e.getParameter(34930),A=e.getParameter(35660),p=e.getParameter(3379),m=e.getParameter(34076),g=e.getParameter(34921),f=e.getParameter(36347),v=e.getParameter(36348),y=e.getParameter(36349),x=A>0,E=r||t.has("OES_texture_float");return{isWebGL2:r,drawBuffers:l,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const i=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:A,maxTextureSize:p,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:f,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:E,floatVertexTextures:x&&E,maxSamples:r?e.getParameter(36183):0}}function WebGLClipping(e){const t=this;let i=null,n=0,r=!1,a=!1;const o=new Plane,l=new Matrix3,c={value:null,needsUpdate:!1};function projectPlanes(e,i,n,r){const a=null!==e?e.length:0;let h=null;if(0!==a){if(h=c.value,!0!==r||null===h){const t=n+4*a,r=i.matrixWorldInverse;l.getNormalMatrix(r),(null===h||h.length0);t.numPlanes=n,t.numIntersection=0}();else{const e=a?0:n,t=4*e;let r=g.clippingState||null;c.value=r,r=projectPlanes(A,l,t,h);for(let e=0;e!==t;++e)r[e]=i[e];g.clippingState=r,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=e}}}function WebGLCubeMaps(e){let t=new WeakMap;function mapTextureMapping(e,t){return t===C?e.mapping=E:304===t&&(e.mapping=_),e}function onTextureDispose(e){const i=e.target;i.removeEventListener("dispose",onTextureDispose);const n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function get(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const n=i.mapping;if(n===C||304===n){if(t.has(i)){return mapTextureMapping(t.get(i).texture,i.mapping)}{const n=i.image;if(n&&n.height>0){const r=new WebGLCubeRenderTarget(n.height/2);return r.fromEquirectangularTexture(e,i),t.set(i,r),i.addEventListener("dispose",onTextureDispose),mapTextureMapping(r.texture,i.mapping)}return null}}}return i},dispose:function dispose(){t=new WeakMap}}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,i=1,n=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-e,a=i+e,o=n+t,l=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,o-=t*this.view.offsetY,l=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const Oi=[.125,.215,.35,.446,.526,.582],Gi=20,Vi=new OrthographicCamera,zi=new Color;let Hi=null;const Wi=(1+Math.sqrt(5))/2,qi=1/Wi,ji=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,Wi,qi),new Vector3(0,Wi,-qi),new Vector3(qi,0,Wi),new Vector3(-qi,0,Wi),new Vector3(Wi,qi,0),new Vector3(-Wi,qi,0)];class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){Hi=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,n,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?l=Oi[o-e+4-1]:0===o&&(l=0),n.push(l);const c=1/(a-2),h=-c,A=1+c,p=[h,h,A,h,A,A,h,h,A,A,h,A],m=6,g=6,f=3,v=2,y=1,x=new Float32Array(f*g*m),E=new Float32Array(v*g*m),_=new Float32Array(y*g*m);for(let e=0;e2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];x.set(n,f*g*e),E.set(p,v*g*e);const r=[e,e,e,e,e,e];_.set(r,y*g*e)}const C=new BufferGeometry;C.setAttribute("position",new BufferAttribute(x,f)),C.setAttribute("uv",new BufferAttribute(E,v)),C.setAttribute("faceIndex",new BufferAttribute(_,y)),t.push(C),r>4&&r--}return{lodPlanes:t,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function _getBlurShader(e,t,i){const n=new Float32Array(Gi),r=new Vector3(0,1,0),a=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:Gi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return a}(n,e,t)}return n}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,Vi)}_sceneToCubeUV(e,t,i,n){const r=new PerspectiveCamera(90,1,t,i),a=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,A=c.toneMapping;c.getClearColor(zi),c.toneMapping=m,c.autoClear=!1;const p=new MeshBasicMaterial({name:"PMREM.Background",side:o,depthWrite:!1,depthTest:!1}),g=new Mesh(new BoxGeometry,p);let f=!1;const v=e.background;v?v.isColor&&(p.color.copy(v),e.background=null,f=!0):(p.color.copy(zi),f=!0);for(let t=0;t<6;t++){const i=t%3;0===i?(r.up.set(0,a[t],0),r.lookAt(l[t],0,0)):1===i?(r.up.set(0,0,a[t]),r.lookAt(0,l[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,l[t]));const o=this._cubeSize;_setViewport(n,i*o,t>2?o:0,o,o),c.setRenderTarget(n),f&&c.render(g,r),c.render(e,r)}g.geometry.dispose(),g.material.dispose(),c.toneMapping=A,c.autoClear=h,e.background=v}_textureToCubeUV(e,t){const i=this._renderer,n=e.mapping===E||e.mapping===_;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const r=n?this._cubemapMaterial:this._equirectMaterial,a=new Mesh(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const o=this._cubeSize;_setViewport(t,0,0,3*o,2*o),i.setRenderTarget(t),i.render(a,Vi)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let t=1;tGi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const v=[];let y=0;for(let e=0;ex-4?n-x+4:0),4*(this._cubeSize-E),3*E,2*E),l.setRenderTarget(t),l.render(h,Vi)}}function _createRenderTarget(e,t,i){const n=new WebGLRenderTarget(e,t,i);return n.texture.mapping=b,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function _setViewport(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function WebGLCubeUVMaps(e){let t=new WeakMap,i=null;function onTextureDispose(e){const i=e.target;i.removeEventListener("dispose",onTextureDispose);const n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function get(n){if(n&&n.isTexture){const r=n.mapping,a=r===C||304===r,o=r===E||r===_;if(a||o){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let r=t.get(n);return null===i&&(i=new PMREMGenerator(e)),r=a?i.fromEquirectangular(n,r):i.fromCubemap(n,r),t.set(n,r),r.texture}if(t.has(n))return t.get(n).texture;{const r=n.image;if(a&&r&&r.height>0||o&&r&&function isCubeTextureComplete(e){let t=0;const i=6;for(let n=0;nt.maxTextureSize&&(f=Math.ceil(g/t.maxTextureSize),g=t.maxTextureSize);const v=new Float32Array(g*f*4*r),y=new DataArrayTexture(v,g,f,r);y.type=j,y.needsUpdate=!0;const x=4*m;for(let t=0;t0)return e;const r=t*i;let a=$i[r];if(void 0===a&&(a=new Float32Array(r),$i[r]=a),0!==t){n.toArray(a,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(a,r)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i":" "} ${r}: ${i[e]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return r}function getTexelEncodingFunction(e,t){const i=function getEncodingComponents(e){switch(e){case xe:return["Linear","( value )"];case Ee:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function getToneMappingFunction(e,t){let i;switch(t){case g:i="Linear";break;case f:i="Reinhard";break;case v:i="OptimizedCineon";break;case y:i="ACESFilmic";break;case x:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function filterEmptyLine(e){return""!==e}function replaceLightNums(e,t){const i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const an=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(e){return e.replace(an,includeReplacer)}function includeReplacer(e,t){const i=Qi[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return resolveIncludes(i)}const on=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function unrollLoops(e){return e.replace(on,loopReplacer)}function loopReplacer(e,t,i,n){let r="";for(let e=parseInt(t);e0&&(U+="\n"),F=[T,B].filter(filterEmptyLine).join("\n"),F.length>0&&(F+="\n")):(U=[generatePrecision(a),"#define SHADER_NAME "+a.shaderName,B,a.instancing?"#define USE_INSTANCING":"",a.instancingColor?"#define USE_INSTANCING_COLOR":"",a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+x:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",a.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",a.displacementMap?"#define USE_DISPLACEMENTMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.clearcoatMap?"#define USE_CLEARCOATMAP":"",a.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",a.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",a.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.transmission?"#define USE_TRANSMISSION":"",a.transmissionMap?"#define USE_TRANSMISSIONMAP":"",a.thicknessMap?"#define USE_THICKNESSMAP":"",a.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",a.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",a.mapUv?"#define MAP_UV "+a.mapUv:"",a.alphaMapUv?"#define ALPHAMAP_UV "+a.alphaMapUv:"",a.lightMapUv?"#define LIGHTMAP_UV "+a.lightMapUv:"",a.aoMapUv?"#define AOMAP_UV "+a.aoMapUv:"",a.emissiveMapUv?"#define EMISSIVEMAP_UV "+a.emissiveMapUv:"",a.bumpMapUv?"#define BUMPMAP_UV "+a.bumpMapUv:"",a.normalMapUv?"#define NORMALMAP_UV "+a.normalMapUv:"",a.displacementMapUv?"#define DISPLACEMENTMAP_UV "+a.displacementMapUv:"",a.metalnessMapUv?"#define METALNESSMAP_UV "+a.metalnessMapUv:"",a.roughnessMapUv?"#define ROUGHNESSMAP_UV "+a.roughnessMapUv:"",a.clearcoatMapUv?"#define CLEARCOATMAP_UV "+a.clearcoatMapUv:"",a.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+a.clearcoatNormalMapUv:"",a.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+a.clearcoatRoughnessMapUv:"",a.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+a.iridescenceMapUv:"",a.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+a.iridescenceThicknessMapUv:"",a.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+a.sheenColorMapUv:"",a.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+a.sheenRoughnessMapUv:"",a.specularMapUv?"#define SPECULARMAP_UV "+a.specularMapUv:"",a.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+a.specularColorMapUv:"",a.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+a.specularIntensityMapUv:"",a.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+a.transmissionMapUv:"",a.thicknessMapUv?"#define THICKNESSMAP_UV "+a.thicknessMapUv:"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexAlphas?"#define USE_COLOR_ALPHA":"",a.vertexUvs2?"#define USE_UV2":"",a.pointsUvs?"#define USE_POINTS_UV":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.morphColors&&a.isWebGL2?"#define USE_MORPHCOLORS":"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+a.morphTextureStride:"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_COUNT "+a.morphTargetsCount:"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+v:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&a.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),F=[T,generatePrecision(a),"#define SHADER_NAME "+a.shaderName,B,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+y:"",a.envMap?"#define "+x:"",a.envMap?"#define "+C:"",I?"#define CUBEUV_TEXEL_WIDTH "+I.texelWidth:"",I?"#define CUBEUV_TEXEL_HEIGHT "+I.texelHeight:"",I?"#define CUBEUV_MAX_MIP "+I.maxMip+".0":"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",a.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.clearcoat?"#define USE_CLEARCOAT":"",a.clearcoatMap?"#define USE_CLEARCOATMAP":"",a.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.iridescence?"#define USE_IRIDESCENCE":"",a.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",a.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",a.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.alphaTest?"#define USE_ALPHATEST":"",a.sheen?"#define USE_SHEEN":"",a.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",a.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",a.transmission?"#define USE_TRANSMISSION":"",a.transmissionMap?"#define USE_TRANSMISSIONMAP":"",a.thicknessMap?"#define USE_THICKNESSMAP":"",a.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors||a.instancingColor?"#define USE_COLOR":"",a.vertexAlphas?"#define USE_COLOR_ALPHA":"",a.vertexUvs2?"#define USE_UV2":"",a.pointsUvs?"#define USE_POINTS_UV":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+v:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.useLegacyLights?"#define LEGACY_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&a.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",a.toneMapping!==m?"#define TONE_MAPPING":"",a.toneMapping!==m?Qi.tonemapping_pars_fragment:"",a.toneMapping!==m?getToneMappingFunction("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.opaque?"#define OPAQUE":"",Qi.encodings_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",a.outputEncoding),a.useDepthPacking?"#define DEPTH_PACKING "+a.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),g=resolveIncludes(g),g=replaceLightNums(g,a),g=replaceClippingPlaneNums(g,a),f=resolveIncludes(f),f=replaceLightNums(f,a),f=replaceClippingPlaneNums(f,a),g=unrollLoops(g),f=unrollLoops(f),a.isWebGL2&&!0!==a.isRawShaderMaterial&&(O="#version 300 es\n",U=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+U,F=["#define varying in",a.glslVersion===we?"":"layout(location = 0) out highp vec4 pc_fragColor;",a.glslVersion===we?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+F);const G=O+F+f,H=WebGLShader(l,35633,O+U+g),W=WebGLShader(l,35632,G);if(l.attachShader(D,H),l.attachShader(D,W),void 0!==a.index0AttributeName?l.bindAttribLocation(D,0,a.index0AttributeName):!0===a.morphTargets&&l.bindAttribLocation(D,0,"position"),l.linkProgram(D),e.debug.checkShaderErrors){const t=l.getProgramInfoLog(D).trim(),i=l.getShaderInfoLog(H).trim(),n=l.getShaderInfoLog(W).trim();let r=!0,a=!0;if(!1===l.getProgramParameter(D,35714))if(r=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(l,D,H,W);else{const e=getShaderErrors(l,H,"vertex"),i=getShaderErrors(l,W,"fragment");console.error("THREE.WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(D,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==i&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:t,vertexShader:{log:i,prefix:U},fragmentShader:{log:n,prefix:F}})}let q,j;return l.deleteShader(H),l.deleteShader(W),this.getUniforms=function(){return void 0===q&&(q=new WebGLUniforms(l,D)),q},this.getAttributes=function(){return void 0===j&&(j=function fetchAttributeLocations(e,t){const i={},n=e.getProgramParameter(t,35721);for(let r=0;r0,le=a.iridescence>0,ce=a.sheen>0,he=a.transmission>0,ue=oe&&!!a.clearcoatMap,de=oe&&!!a.clearcoatNormalMap,Ae=oe&&!!a.clearcoatRoughnessMap,pe=le&&!!a.iridescenceMap,me=le&&!!a.iridescenceThicknessMap,ge=ce&&!!a.sheenColorMap,fe=ce&&!!a.sheenRoughnessMap,ve=!!a.specularMap,ye=!!a.specularColorMap,_e=!!a.specularIntensityMap,Ce=he&&!!a.transmissionMap,Me=he&&!!a.thicknessMap,be=!!a.gradientMap,Se=!!a.alphaMap,we=a.alphaTest>0,Ie=!!a.extensions,Te=!!I.attributes.uv2;return{isWebGL2:g,shaderID:U,shaderName:a.type,vertexShader:G,fragmentShader:H,defines:a.defines,customVertexShaderID:W,customFragmentShaderID:q,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:y,instancing:Y,instancingColor:Y&&null!==_.instanceColor,supportsVertexTextures:v,outputEncoding:null===K?e.outputEncoding:!0===K.isXRRenderTarget?K.texture.encoding:xe,map:X,matcap:J,envMap:$,envMapMode:$&&B.mapping,envMapCubeUVHeight:D,aoMap:Z,lightMap:ee,bumpMap:te,normalMap:ie,displacementMap:v&&ne,emissiveMap:re,normalMapObjectSpace:ie&&1===a.normalMapType,normalMapTangentSpace:ie&&0===a.normalMapType,decodeVideoTexture:X&&!0===a.map.isVideoTexture&&a.map.encoding===Ee,metalnessMap:se,roughnessMap:ae,clearcoat:oe,clearcoatMap:ue,clearcoatNormalMap:de,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:pe,iridescenceThicknessMap:me,sheen:ce,sheenColorMap:ge,sheenRoughnessMap:fe,specularMap:ve,specularColorMap:ye,specularIntensityMap:_e,transmission:he,transmissionMap:Ce,thicknessMap:Me,gradientMap:be,opaque:!1===a.transparent&&1===a.blending,alphaMap:Se,alphaTest:we,combine:a.combine,mapUv:X&&getChannel(a.map.channel),aoMapUv:Z&&getChannel(a.aoMap.channel),lightMapUv:ee&&getChannel(a.lightMap.channel),bumpMapUv:te&&getChannel(a.bumpMap.channel),normalMapUv:ie&&getChannel(a.normalMap.channel),displacementMapUv:ne&&getChannel(a.displacementMap.channel),emissiveMapUv:re&&getChannel(a.emissiveMap.channel),metalnessMapUv:se&&getChannel(a.metalnessMap.channel),roughnessMapUv:ae&&getChannel(a.roughnessMap.channel),clearcoatMapUv:ue&&getChannel(a.clearcoatMap.channel),clearcoatNormalMapUv:de&&getChannel(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&getChannel(a.clearcoatRoughnessMap.channel),iridescenceMapUv:pe&&getChannel(a.iridescenceMap.channel),iridescenceThicknessMapUv:me&&getChannel(a.iridescenceThicknessMap.channel),sheenColorMapUv:ge&&getChannel(a.sheenColorMap.channel),sheenRoughnessMapUv:fe&&getChannel(a.sheenRoughnessMap.channel),specularMapUv:ve&&getChannel(a.specularMap.channel),specularColorMapUv:ye&&getChannel(a.specularColorMap.channel),specularIntensityMapUv:_e&&getChannel(a.specularIntensityMap.channel),transmissionMapUv:Ce&&getChannel(a.transmissionMap.channel),thicknessMapUv:Me&&getChannel(a.thicknessMap.channel),alphaMapUv:Se&&getChannel(a.alphaMap.channel),vertexTangents:ie&&!!I.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!I.attributes.color&&4===I.attributes.color.itemSize,vertexUvs2:Te,pointsUvs:!0===_.isPoints&&!!I.attributes.uv&&(X||Se),fog:!!C,useFog:!0===a.fog,fogExp2:C&&C.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:f,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==I.morphAttributes.position,morphNormals:void 0!==I.morphAttributes.normal,morphColors:void 0!==I.morphAttributes.color,morphTargetsCount:O,morphTextureStride:j,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numSpotLightMaps:h.spotLightMap.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numSpotLightShadowsWithMaps:h.numSpotLightShadowsWithMaps,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:m,useLegacyLights:e.useLegacyLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===l,flipSided:a.side===o,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:Ie&&!0===a.extensions.derivatives,extensionFragDepth:Ie&&!0===a.extensions.fragDepth,extensionDrawBuffers:Ie&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:Ie&&!0===a.extensions.shaderTextureLOD,rendererExtensionFragDepth:g||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:g||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:g||n.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function getProgramCacheKey(t){const i=[];if(t.shaderID?i.push(t.shaderID):(i.push(t.customVertexShaderID),i.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)i.push(e),i.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function getProgramCacheKeyParameters(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(i,t),function getProgramCacheKeyBooleans(e,t){h.disableAll(),t.isWebGL2&&h.enable(0);t.supportsVertexTextures&&h.enable(1);t.instancing&&h.enable(2);t.instancingColor&&h.enable(3);t.matcap&&h.enable(4);t.envMap&&h.enable(5);t.normalMapObjectSpace&&h.enable(6);t.normalMapTangentSpace&&h.enable(7);t.clearcoat&&h.enable(8);t.iridescence&&h.enable(9);t.alphaTest&&h.enable(10);t.vertexColors&&h.enable(11);t.vertexAlphas&&h.enable(12);t.vertexUvs2&&h.enable(13);t.vertexTangents&&h.enable(14);e.push(h.mask),h.disableAll(),t.fog&&h.enable(0);t.useFog&&h.enable(1);t.flatShading&&h.enable(2);t.logarithmicDepthBuffer&&h.enable(3);t.skinning&&h.enable(4);t.morphTargets&&h.enable(5);t.morphNormals&&h.enable(6);t.morphColors&&h.enable(7);t.premultipliedAlpha&&h.enable(8);t.shadowMapEnabled&&h.enable(9);t.useLegacyLights&&h.enable(10);t.doubleSided&&h.enable(11);t.flipSided&&h.enable(12);t.useDepthPacking&&h.enable(13);t.dithering&&h.enable(14);t.transmission&&h.enable(15);t.sheen&&h.enable(16);t.decodeVideoTexture&&h.enable(17);t.opaque&&h.enable(18);t.pointsUvs&&h.enable(19);e.push(h.mask)}(i,t),i.push(e.outputEncoding)),i.push(t.customProgramCacheKey),i.join()},getUniforms:function getUniforms(e){const t=x[e.type];let i;if(t){const e=Ni[t];i=wi.clone(e.uniforms)}else i=e.uniforms;return i},acquireProgram:function acquireProgram(t,i){let n;for(let e=0,t=p.length;e0?n.push(h):!0===a.transparent?r.push(h):i.push(h)},unshift:function unshift(e,t,a,o,l,c){const h=getNextRenderItem(e,t,a,o,l,c);a.transmission>0?n.unshift(h):!0===a.transparent?r.unshift(h):i.unshift(h)},finish:function finish(){for(let i=t,n=e.length;i1&&i.sort(e||painterSortStable),n.length>1&&n.sort(t||reversePainterSortStable),r.length>1&&r.sort(t||reversePainterSortStable)}}}function WebGLRenderLists(){let e=new WeakMap;return{get:function get(t,i){const n=e.get(t);let r;return void 0===n?(r=new WebGLRenderList,e.set(t,[r])):i>=n.length?(r=new WebGLRenderList,n.push(r)):r=n[i],r},dispose:function dispose(){e=new WeakMap}}}function UniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Vector3,color:new Color};break;case"SpotLight":i={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":i={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=i,i}}}let hn=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function WebGLLights(e,t){const i=new UniformsCache,n=function ShadowUniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let e=0;e<9;e++)r.probe.push(new Vector3);const a=new Vector3,o=new Matrix4,l=new Matrix4;return{setup:function setup(a,o){let l=0,c=0,h=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let A=0,p=0,m=0,g=0,f=0,v=0,y=0,x=0,E=0,_=0;a.sort(shadowCastingAndTexturingLightsFirst);const C=!0===o?Math.PI:1;for(let e=0,t=a.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=Fi.LTC_FLOAT_1,r.rectAreaLTC2=Fi.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Fi.LTC_HALF_1,r.rectAreaLTC2=Fi.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=l,r.ambient[1]=c,r.ambient[2]=h;const b=r.hash;b.directionalLength===A&&b.pointLength===p&&b.spotLength===m&&b.rectAreaLength===g&&b.hemiLength===f&&b.numDirectionalShadows===v&&b.numPointShadows===y&&b.numSpotShadows===x&&b.numSpotMaps===E||(r.directional.length=A,r.spot.length=m,r.rectArea.length=g,r.point.length=p,r.hemi.length=f,r.directionalShadow.length=v,r.directionalShadowMap.length=v,r.pointShadow.length=y,r.pointShadowMap.length=y,r.spotShadow.length=x,r.spotShadowMap.length=x,r.directionalShadowMatrix.length=v,r.pointShadowMatrix.length=y,r.spotLightMatrix.length=x+E-_,r.spotLightMap.length=E,r.numSpotLightShadowsWithMaps=_,b.directionalLength=A,b.pointLength=p,b.spotLength=m,b.rectAreaLength=g,b.hemiLength=f,b.numDirectionalShadows=v,b.numPointShadows=y,b.numSpotShadows=x,b.numSpotMaps=E,r.version=hn++)},setupView:function setupView(e,t){let i=0,n=0,c=0,h=0,A=0;const p=t.matrixWorldInverse;for(let t=0,m=e.length;t=a.length?(o=new WebGLRenderState(e,t),a.push(o)):o=a[r],o},dispose:function dispose(){i=new WeakMap}}}class MeshDepthMaterial extends Material$1{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material$1{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function WebGLShadowMap(e,t,n){let c=new Frustum;const h=new Vector2,A=new Vector2,p=new Vector4,m=new MeshDepthMaterial({depthPacking:3201}),g=new MeshDistanceMaterial,f={},v=n.maxTextureSize,y={[a]:o,[o]:a,[l]:l},x=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),E=x.clone();E.defines.HORIZONTAL_PASS=1;const _=new BufferGeometry;_.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new Mesh(_,x),b=this;function VSMPass(i,n){const r=t.update(C);x.defines.VSM_SAMPLES!==i.blurSamples&&(x.defines.VSM_SAMPLES=i.blurSamples,E.defines.VSM_SAMPLES=i.blurSamples,x.needsUpdate=!0,E.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new WebGLRenderTarget(h.x,h.y)),x.uniforms.shadow_pass.value=i.map.texture,x.uniforms.resolution.value=i.mapSize,x.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(n,null,r,x,C,null),E.uniforms.shadow_pass.value=i.mapPass.texture,E.uniforms.resolution.value=i.mapSize,E.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(n,null,r,E,C,null)}function getDepthMaterial(t,i,n,a){let o=null;const l=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==l)o=l;else if(o=!0===n.isPointLight?g:m,e.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){const e=o.uuid,t=i.uuid;let n=f[e];void 0===n&&(n={},f[e]=n);let r=n[t];void 0===r&&(r=o.clone(),n[t]=r),o=r}if(o.visible=i.visible,o.wireframe=i.wireframe,o.side=a===r?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:y[i.side],o.alphaMap=i.alphaMap,o.alphaTest=i.alphaTest,o.map=i.map,o.clipShadows=i.clipShadows,o.clippingPlanes=i.clippingPlanes,o.clipIntersection=i.clipIntersection,o.displacementMap=i.displacementMap,o.displacementScale=i.displacementScale,o.displacementBias=i.displacementBias,o.wireframeLinewidth=i.wireframeLinewidth,o.linewidth=i.linewidth,!0===n.isPointLight&&!0===o.isMeshDistanceMaterial){e.properties.get(o).light=n}return o}function renderObject(i,n,a,o,l){if(!1===i.visible)return;if(i.layers.test(n.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&l===r)&&(!i.frustumCulled||c.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,i.matrixWorld);const n=t.update(i),r=i.material;if(Array.isArray(r)){const t=n.groups;for(let c=0,h=t.length;cv||h.y>v)&&(h.x>v&&(A.x=Math.floor(v/g.x),h.x=A.x*g.x,l.mapSize.x=A.x),h.y>v&&(A.y=Math.floor(v/g.y),h.y=A.y*g.y,l.mapSize.y=A.y)),null===l.map){const e=this.type!==r?{minFilter:D,magFilter:D}:{};l.map=new WebGLRenderTarget(h.x,h.y,e),l.map.texture.name=o.name+".shadowMap",l.camera.updateProjectionMatrix()}e.setRenderTarget(l.map),e.clear();const f=l.getViewportCount();for(let e=0;e=1):-1!==K.indexOf("OpenGL ES")&&(j=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),q=j>=2);let Y=null,X={};const J=e.getParameter(3088),$=e.getParameter(2978),Z=(new Vector4).fromArray(J),ee=(new Vector4).fromArray($);function createTexture(t,i,n){const r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;tn||e.height>n)&&(r=n/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?floorPowerOfTwo:Math.floor,a=n(r*e.width),o=n(r*e.height);void 0===v&&(v=createCanvas(a,o));const l=i?createCanvas(a,o):v;l.width=a,l.height=o;return l.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function isPowerOfTwo$1(e){return isPowerOfTwo(e.width)&&isPowerOfTwo(e.height)}function textureNeedsGenerateMipmaps(e,t){return e.generateMipmaps&&t&&e.minFilter!==D&&e.minFilter!==O}function generateMipmap(t){e.generateMipmap(t)}function getInternalFormat(i,n,r,a,o=!1){if(!1===l)return n;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let c=n;return 6403===n&&(5126===r&&(c=33326),5131===r&&(c=33325),5121===r&&(c=33321)),33319===n&&(5126===r&&(c=33328),5131===r&&(c=33327),5121===r&&(c=33323)),6408===n&&(5126===r&&(c=34836),5131===r&&(c=34842),5121===r&&(c=a===Ee&&!1===o?35907:32856),32819===r&&(c=32854),32820===r&&(c=32855)),33325!==c&&33326!==c&&33327!==c&&33328!==c&&34842!==c&&34836!==c||t.get("EXT_color_buffer_float"),c}function getMipLevels(e,t,i){return!0===textureNeedsGenerateMipmaps(e,i)||e.isFramebufferTexture&&e.minFilter!==D&&e.minFilter!==O?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function filterFallback(e){return e===D||e===U||e===F?9728:9729}function onTextureDispose(e){const t=e.target;t.removeEventListener("dispose",onTextureDispose),function deallocateTexture(e){const t=n.get(e);if(void 0===t.__webglInit)return;const i=e.source,r=y.get(i);if(r){const n=r[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&deleteTexture(e),0===Object.keys(r).length&&y.delete(i)}n.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function onRenderTargetDispose(t){const i=t.target;i.removeEventListener("dispose",onRenderTargetDispose),function deallocateRenderTarget(t){const i=t.texture,r=n.get(t),a=n.get(i);void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),o.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t]);else{if(e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let t=0;t0&&r.__version!==e.version){const i=e.image;if(null===i)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==i.complete)return void uploadTexture(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(3553,r.__webglTexture,33984+t)}const _={[I]:10497,[T]:33071,[B]:33648},C={[D]:9728,[U]:9984,[F]:9986,[O]:9729,[G]:9985,[H]:9987};function setTextureParameters(i,a,o){if(o?(e.texParameteri(i,10242,_[a.wrapS]),e.texParameteri(i,10243,_[a.wrapT]),32879!==i&&35866!==i||e.texParameteri(i,32882,_[a.wrapR]),e.texParameteri(i,10240,C[a.magFilter]),e.texParameteri(i,10241,C[a.minFilter])):(e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071),32879!==i&&35866!==i||e.texParameteri(i,32882,33071),a.wrapS===T&&a.wrapT===T||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,10240,filterFallback(a.magFilter)),e.texParameteri(i,10241,filterFallback(a.minFilter)),a.minFilter!==D&&a.minFilter!==O&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const o=t.get("EXT_texture_filter_anisotropic");if(a.magFilter===D)return;if(a.minFilter!==F&&a.minFilter!==H)return;if(a.type===j&&!1===t.has("OES_texture_float_linear"))return;if(!1===l&&a.type===K&&!1===t.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function initTexture(t,i){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",onTextureDispose));const r=i.source;let a=y.get(r);void 0===a&&(a={},y.set(r,a));const l=function getTextureCacheKey(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(i);if(l!==t.__cacheKey){void 0===a[l]&&(a[l]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),a[l].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&deleteTexture(i)),t.__cacheKey=l,t.__webglTexture=a[l].texture}return n}function uploadTexture(t,r,o){let c=3553;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(c=35866),r.isData3DTexture&&(c=32879);const h=initTexture(t,r),p=r.source;i.bindTexture(c,t.__webglTexture,33984+o);const m=n.get(p);if(p.version!==m.__version||!0===h){i.activeTexture(33984+o),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const t=function textureNeedsPowerOfTwo(e){return!l&&(e.wrapS!==T||e.wrapT!==T||e.minFilter!==D&&e.minFilter!==O)}(r)&&!1===isPowerOfTwo$1(r.image);let n=resizeImage(r.image,t,!1,A);n=verifyColorSpace(r,n);const g=isPowerOfTwo$1(n)||l,f=a.convert(r.format,r.encoding);let v,y=a.convert(r.type),x=getInternalFormat(r.internalFormat,f,y,r.encoding,r.isVideoTexture);setTextureParameters(c,r,g);const E=r.mipmaps,_=l&&!0!==r.isVideoTexture,C=void 0===m.__version||!0===h,b=getMipLevels(r,n,g);if(r.isDepthTexture)x=6402,l?x=r.type===j?36012:r.type===q?33190:r.type===Y?35056:33189:r.type===j&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===J&&6402===x&&1012!==r.type&&r.type!==q&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=q,y=a.convert(r.type)),r.format===$&&6402===x&&(x=34041,r.type!==Y&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Y,y=a.convert(r.type))),C&&(_?i.texStorage2D(3553,1,x,n.width,n.height):i.texImage2D(3553,0,x,n.width,n.height,0,f,y,null));else if(r.isDataTexture)if(E.length>0&&g){_&&C&&i.texStorage2D(3553,b,x,E[0].width,E[0].height);for(let e=0,t=E.length;e>=1,t>>=1}}else if(E.length>0&&g){_&&C&&i.texStorage2D(3553,b,x,E[0].width,E[0].height);for(let e=0,t=E.length;e=34069&&c<=34074)&&e.framebufferTexture2D(36160,l,c,n.get(o).__webglTexture,0),i.bindFramebuffer(36160,null)}function setupRenderBufferStorage(t,i,n){if(e.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n||useMultisampledRTT(i)){const t=i.depthTexture;t&&t.isDepthTexture&&(t.type===j?r=36012:t.type===q&&(r=33190));const n=getRenderTargetSamples(i);useMultisampledRTT(i)?m.renderbufferStorageMultisampleEXT(36161,n,r,i.width,i.height):e.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else e.renderbufferStorage(36161,r,i.width,i.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){const r=getRenderTargetSamples(i);n&&!1===useMultisampledRTT(i)?e.renderbufferStorageMultisample(36161,r,35056,i.width,i.height):useMultisampledRTT(i)?m.renderbufferStorageMultisampleEXT(36161,r,35056,i.width,i.height):e.renderbufferStorage(36161,34041,i.width,i.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function verifyColorSpace(e,i){const n=e.encoding,r=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===Ie||n!==xe&&(n===Ee?!1===l?!0===t.has("EXT_sRGB")&&r===X?(e.format=Ie,e.minFilter=O,e.generateMipmaps=!1):i=ImageUtils.sRGBToLinear(i):r===X&&a===W||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",n)),i}this.allocateTextureUnit=function allocateTextureUnit(){const e=E;return e>=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),E+=1,e},this.resetTextureUnits=function resetTextureUnits(){E=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function setTexture2DArray(e,t){const r=n.get(e);e.version>0&&r.__version!==e.version?uploadTexture(r,e,t):i.bindTexture(35866,r.__webglTexture,33984+t)},this.setTexture3D=function setTexture3D(e,t){const r=n.get(e);e.version>0&&r.__version!==e.version?uploadTexture(r,e,t):i.bindTexture(32879,r.__webglTexture,33984+t)},this.setTextureCube=function setTextureCube(t,r){const o=n.get(t);t.version>0&&o.__version!==t.version?function uploadCubeTexture(t,r,o){if(6!==r.image.length)return;const c=initTexture(t,r),A=r.source;i.bindTexture(34067,t.__webglTexture,33984+o);const p=n.get(A);if(A.version!==p.__version||!0===c){i.activeTexture(33984+o),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const t=r.isCompressedTexture||r.image[0].isCompressedTexture,n=r.image[0]&&r.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)m[e]=t||n?n?r.image[e].image:r.image[e]:resizeImage(r.image[e],!1,!0,h),m[e]=verifyColorSpace(r,m[e]);const g=m[0],f=isPowerOfTwo$1(g)||l,v=a.convert(r.format,r.encoding),y=a.convert(r.type),x=getInternalFormat(r.internalFormat,v,y,r.encoding),E=l&&!0!==r.isVideoTexture,_=void 0===p.__version||!0===c;let C,b=getMipLevels(r,g,f);if(setTextureParameters(34067,r,f),t){E&&_&&i.texStorage2D(34067,b,x,g.width,g.height);for(let e=0;e<6;e++){C=m[e].mipmaps;for(let t=0;t0&&b++,i.texStorage2D(34067,b,x,m[0].width,m[0].height));for(let e=0;e<6;e++)if(n){E?i.texSubImage2D(34069+e,0,0,0,m[e].width,m[e].height,v,y,m[e].data):i.texImage2D(34069+e,0,x,m[e].width,m[e].height,0,v,y,m[e].data);for(let t=0;t0&&!1===useMultisampledRTT(t)){const n=m?c:[c];h.__webglMultisampledFramebuffer=e.createFramebuffer(),h.__webglColorRenderbuffer=[],i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);for(let i=0;i0&&!1===useMultisampledRTT(t)){const r=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],a=t.width,o=t.height;let l=16384;const c=[],h=t.stencilBuffer?33306:36096,A=n.get(t),p=!0===t.isWebGLMultipleRenderTargets;if(p)for(let t=0;tl+h?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=l-h&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),null!==r&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));null!==o&&(n=t.getPose(e.targetRaySpace,i),null===n&&null!==r&&(n=r),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(un)))}return null!==o&&(o.visible=null!==n),null!==l&&(l.visible=null!==r),null!==c&&(c.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const i=new Group;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class DepthTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h){if((h=void 0!==h?h:J)!==J&&h!==$)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===J&&(i=q),void 0===i&&h===$&&(i=Y),super(null,n,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:D,this.minFilter=void 0!==l?l:D,this.flipY=!1,this.generateMipmaps=!1}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const i=this;let n=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,A=null,p=null,m=null,g=null;const f=t.getContextAttributes();let v=null,y=null;const x=[],E=[],_=new Set,C=new Map,b=new PerspectiveCamera;b.layers.enable(1),b.viewport=new Vector4;const I=new PerspectiveCamera;I.layers.enable(2),I.viewport=new Vector4;const T=[b,I],B=new ArrayCamera;B.layers.enable(1),B.layers.enable(2);let D=null,U=null;function onSessionEvent(e){const t=E.indexOf(e.inputSource);if(-1===t)return;const i=x[t];void 0!==i&&i.dispatchEvent({type:e.type,data:e.inputSource})}function onSessionEnd(){n.removeEventListener("select",onSessionEvent),n.removeEventListener("selectstart",onSessionEvent),n.removeEventListener("selectend",onSessionEvent),n.removeEventListener("squeeze",onSessionEvent),n.removeEventListener("squeezestart",onSessionEvent),n.removeEventListener("squeezeend",onSessionEvent),n.removeEventListener("end",onSessionEnd),n.removeEventListener("inputsourceschange",onInputSourcesChange);for(let e=0;e=0&&(E[n]=null,x[n].disconnect(i))}for(let t=0;t=E.length){E.push(i),n=e;break}if(null===E[e]){E[e]=i,n=e;break}}if(-1===n)break}const r=x[n];r&&r.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new WebXRController,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return null!==p?p:m},this.getBinding=function(){return A},this.getFrame=function(){return g},this.getSession=function(){return n},this.setSession=async function(h){if(n=h,null!==n){if(v=e.getRenderTarget(),n.addEventListener("select",onSessionEvent),n.addEventListener("selectstart",onSessionEvent),n.addEventListener("selectend",onSessionEvent),n.addEventListener("squeeze",onSessionEvent),n.addEventListener("squeezestart",onSessionEvent),n.addEventListener("squeezeend",onSessionEvent),n.addEventListener("end",onSessionEnd),n.addEventListener("inputsourceschange",onInputSourcesChange),!0!==f.xrCompatible&&await t.makeXRCompatible(),void 0===n.renderState.layers||!1===e.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||f.antialias,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};m=new XRWebGLLayer(n,t,i),n.updateRenderState({baseLayer:m}),y=new WebGLRenderTarget(m.framebufferWidth,m.framebufferHeight,{format:X,type:W,encoding:e.outputEncoding,stencilBuffer:f.stencil})}else{let i=null,a=null,o=null;f.depth&&(o=f.stencil?35056:33190,i=f.stencil?$:J,a=f.stencil?Y:q);const l={colorFormat:32856,depthFormat:o,scaleFactor:r};A=new XRWebGLBinding(n,t),p=A.createProjectionLayer(l),n.updateRenderState({layers:[p]}),y=new WebGLRenderTarget(p.textureWidth,p.textureHeight,{format:X,type:W,depthTexture:new DepthTexture(p.textureWidth,p.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:f.stencil,encoding:e.outputEncoding,samples:f.antialias?4:0});e.properties.get(y).__ignoreDepthValues=p.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await n.requestReferenceSpace(o),H.setContext(n),H.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const F=new Vector3,O=new Vector3;function updateCamera(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;B.near=I.near=b.near=e.near,B.far=I.far=b.far=e.far,D===B.near&&U===B.far||(n.updateRenderState({depthNear:B.near,depthFar:B.far}),D=B.near,U=B.far);const t=e.parent,i=B.cameras;updateCamera(B,t);for(let e=0;et&&(C.set(e,e.lastChangedTime),i.dispatchEvent({type:"planechanged",data:e}))}else _.add(e),C.set(e,n.lastChangedTime),i.dispatchEvent({type:"planeadded",data:e})}g=null})),this.setAnimationLoop=function(e){G=e},this.dispose=function(){}}}function WebGLMaterials(e,t){function refreshTransformUniform(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function refreshUniformsCommon(i,n){i.opacity.value=n.opacity,n.color&&i.diffuse.value.copy(n.color),n.emissive&&i.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(i.map.value=n.map,refreshTransformUniform(n.map,i.mapTransform)),n.alphaMap&&(i.alphaMap.value=n.alphaMap,refreshTransformUniform(n.alphaMap,i.alphaMapTransform)),n.bumpMap&&(i.bumpMap.value=n.bumpMap,refreshTransformUniform(n.bumpMap,i.bumpMapTransform),i.bumpScale.value=n.bumpScale,n.side===o&&(i.bumpScale.value*=-1)),n.normalMap&&(i.normalMap.value=n.normalMap,refreshTransformUniform(n.normalMap,i.normalMapTransform),i.normalScale.value.copy(n.normalScale),n.side===o&&i.normalScale.value.negate()),n.displacementMap&&(i.displacementMap.value=n.displacementMap,refreshTransformUniform(n.displacementMap,i.displacementMapTransform),i.displacementScale.value=n.displacementScale,i.displacementBias.value=n.displacementBias),n.emissiveMap&&(i.emissiveMap.value=n.emissiveMap,refreshTransformUniform(n.emissiveMap,i.emissiveMapTransform)),n.specularMap&&(i.specularMap.value=n.specularMap,refreshTransformUniform(n.specularMap,i.specularMapTransform)),n.alphaTest>0&&(i.alphaTest.value=n.alphaTest);const r=t.get(n).envMap;if(r&&(i.envMap.value=r,i.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const t=!0===e.useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*t,refreshTransformUniform(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,refreshTransformUniform(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function refreshFogUniforms(t,i){i.color.getRGB(t.fogColor.value,getUnlitUniformColorSpace(e)),i.isFog?(t.fogNear.value=i.near,t.fogFar.value=i.far):i.isFogExp2&&(t.fogDensity.value=i.density)},refreshMaterialUniforms:function refreshMaterialUniforms(e,i,n,r,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?refreshUniformsCommon(e,i):i.isMeshToonMaterial?(refreshUniformsCommon(e,i),function refreshUniformsToon(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(refreshUniformsCommon(e,i),function refreshUniformsPhong(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(refreshUniformsCommon(e,i),function refreshUniformsStandard(e,i){e.metalness.value=i.metalness,i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap,refreshTransformUniform(i.metalnessMap,e.metalnessMapTransform));e.roughness.value=i.roughness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap,refreshTransformUniform(i.roughnessMap,e.roughnessMapTransform));const n=t.get(i).envMap;n&&(e.envMapIntensity.value=i.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function refreshUniformsPhysical(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,refreshTransformUniform(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,refreshTransformUniform(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,refreshTransformUniform(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,refreshTransformUniform(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,refreshTransformUniform(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===o&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,refreshTransformUniform(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,refreshTransformUniform(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=i.texture,e.transmissionSamplerSize.value.set(i.width,i.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,refreshTransformUniform(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,refreshTransformUniform(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,refreshTransformUniform(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,refreshTransformUniform(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,a)):i.isMeshMatcapMaterial?(refreshUniformsCommon(e,i),function refreshUniformsMatcap(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?refreshUniformsCommon(e,i):i.isMeshDistanceMaterial?(refreshUniformsCommon(e,i),function refreshUniformsDistance(e,i){const n=t.get(i).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?refreshUniformsCommon(e,i):i.isLineBasicMaterial?(!function refreshUniformsLine(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function refreshUniformsDash(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function refreshUniformsPoints(e,t,i,n){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*n,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,n,r):i.isSpriteMaterial?function refreshUniformsSprites(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(e,t,i,n){let r={},a={},o=[];const l=i.isWebGL2?e.getParameter(35375):0;function hasUniformChanged(e,t,i){const n=e.value;if(void 0===i[t]){if("number"==typeof n)i[t]=n;else{const e=Array.isArray(n)?n:[n],r=[];for(let t=0;t0){r=i%n;0!==r&&n-r-o.boundary<0&&(i+=n-r,a.__offset=i)}i+=o.storage}r=i%n,r>0&&(i+=n-r);return e.__size=i,e.__cache={},this}(i),h=function createBuffer(t){const i=function allocateBindingPointIndex(){for(let e=0;e0&&function renderTransmissionPass(e,t,i,n){if(null===oe){const e=de.isWebGL2;oe=new WebGLRenderTarget(1024,1024,{generateMipmaps:!0,type:ue.has("EXT_color_buffer_half_float")?K:W,minFilter:H,samples:e&&!0===A?4:0})}const r=b.getRenderTarget();b.setRenderTarget(oe),b.clear();const a=b.toneMapping;b.toneMapping=m,renderObjects(e,i,n),ge.updateMultisampleRenderTarget(oe),ge.updateRenderTargetMipmap(oe);let c=!1;for(let e=0,r=t.length;e0&&renderObjects(r,t,i),a.length>0&&renderObjects(a,t,i),c.length>0&&renderObjects(c,t,i),Ae.buffers.depth.setTest(!0),Ae.buffers.depth.setMask(!0),Ae.buffers.color.setMask(!0),Ae.setPolygonOffset(!1)}function renderObjects(e,t,i){const n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r0?C[C.length-1]:null,_.pop(),x=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(e,t,i){me.get(e.texture).__webglTexture=t,me.get(e.depthTexture).__webglTexture=i;const n=me.get(e);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===ue.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const i=me.get(e);i.__webglFramebuffer=t,i.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,i=0){D=e,T=t,B=i;let n=!0,r=null,a=!1,o=!1;if(e){const i=me.get(e);void 0!==i.__useDefaultFramebuffer?(Ae.bindFramebuffer(36160,null),n=!1):void 0===i.__webglFramebuffer?ge.setupRenderTarget(e):i.__hasExternalTextures&&ge.rebindTextures(e,me.get(e.texture).__webglTexture,me.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=me.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=c[t],a=!0):r=de.isWebGL2&&e.samples>0&&!1===ge.useMultisampledRTT(e)?me.get(e).__webglMultisampledFramebuffer:c,O.copy(e.viewport),G.copy(e.scissor),q=e.scissorTest}else O.copy(te).multiplyScalar($).floor(),G.copy(ie).multiplyScalar($).floor(),q=ne;if(Ae.bindFramebuffer(36160,r)&&de.drawBuffers&&n&&Ae.drawBuffers(e,r),Ae.viewport(O),Ae.scissor(G),Ae.setScissorTest(q),a){const n=me.get(e.texture);Qe.framebufferTexture2D(36160,36064,34069+t,n.__webglTexture,i)}else if(o){const n=me.get(e.texture),r=t||0;Qe.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}U=-1},this.readRenderTargetPixels=function(e,t,i,n,r,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=me.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(l=l[o]),l){Ae.bindFramebuffer(36160,l);try{const o=e.texture,l=o.format,c=o.type;if(l!==X&&De.convert(l)!==Qe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===K&&(ue.has("EXT_color_buffer_half_float")||de.isWebGL2&&ue.has("EXT_color_buffer_float"));if(!(c===W||De.convert(c)===Qe.getParameter(35738)||c===j&&(de.isWebGL2||ue.has("OES_texture_float")||ue.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&Qe.readPixels(t,i,n,r,De.convert(l),De.convert(c),a)}finally{const e=null!==D?me.get(D).__webglFramebuffer:null;Ae.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,i=0){const n=Math.pow(2,-i),r=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n);ge.setTexture2D(t,0),Qe.copyTexSubImage2D(3553,i,0,0,e.x,e.y,r,a),Ae.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){const r=t.image.width,a=t.image.height,o=De.convert(i.format),l=De.convert(i.type);ge.setTexture2D(i,0),Qe.pixelStorei(37440,i.flipY),Qe.pixelStorei(37441,i.premultiplyAlpha),Qe.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?Qe.texSubImage2D(3553,n,e.x,e.y,r,a,o,l,t.image.data):t.isCompressedTexture?Qe.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):Qe.texSubImage2D(3553,n,e.x,e.y,o,l,t.image),0===n&&i.generateMipmaps&&Qe.generateMipmap(3553),Ae.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,n,r=0){if(b.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,c=De.convert(n.format),h=De.convert(n.type);let A;if(n.isData3DTexture)ge.setTexture3D(n,0),A=32879;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ge.setTexture2DArray(n,0),A=35866}Qe.pixelStorei(37440,n.flipY),Qe.pixelStorei(37441,n.premultiplyAlpha),Qe.pixelStorei(3317,n.unpackAlignment);const p=Qe.getParameter(3314),m=Qe.getParameter(32878),g=Qe.getParameter(3316),f=Qe.getParameter(3315),v=Qe.getParameter(32877),y=i.isCompressedTexture?i.mipmaps[0]:i.image;Qe.pixelStorei(3314,y.width),Qe.pixelStorei(32878,y.height),Qe.pixelStorei(3316,e.min.x),Qe.pixelStorei(3315,e.min.y),Qe.pixelStorei(32877,e.min.z),i.isDataTexture||i.isData3DTexture?Qe.texSubImage3D(A,r,t.x,t.y,t.z,a,o,l,c,h,y.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Qe.compressedTexSubImage3D(A,r,t.x,t.y,t.z,a,o,l,c,y.data)):Qe.texSubImage3D(A,r,t.x,t.y,t.z,a,o,l,c,h,y),Qe.pixelStorei(3314,p),Qe.pixelStorei(32878,m),Qe.pixelStorei(3316,g),Qe.pixelStorei(3315,f),Qe.pixelStorei(32877,v),0===r&&n.generateMipmaps&&Qe.generateMipmap(A),Ae.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?ge.setTextureCube(e,0):e.isData3DTexture?ge.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ge.setTexture2DArray(e,0):ge.setTexture2D(e,0),Ae.unbindTexture()},this.resetState=function(){T=0,B=0,D=null,Ae.reset(),Pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}}(class WebGL1Renderer extends WebGLRenderer{}).prototype.isWebGL1Renderer=!0;class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class InterleavedBuffer{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Se,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;nl)continue;p.applyMatrix4(this.matrixWorld);const a=e.ray.origin.distanceTo(p);ae.far||t.push({distance:a,point:A.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,a.start),n=Math.min(f.count,a.start+a.count)-1;il)continue;p.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(p);ne.far||t.push({distance:n,point:A.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;er.far)return;a.push({distance:c,distanceToRay:Math.sqrt(l),point:i,index:t,face:null,object:o})}}class VideoTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:O,this.magFilter=void 0!==r?r:O,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function updateVideo(){h.needsUpdate=!0,e.requestVideoFrameCallback(updateVideo)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class CompressedTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h,A,p){super(null,a,o,l,c,h,n,r,A,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(e,t,i,n,r,a){super(e,t,i,r,a),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=T}}class CanvasTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class MeshStandardMaterial extends Material$1{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MeshPhysicalMaterial extends MeshStandardMaterial{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return clamp$1(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Color(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Color(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Color(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function arraySlice(e,t,i){return isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)}function convertArray(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function getKeyframeOrder(e){const t=e.length,i=new Array(t);for(let e=0;e!==t;++e)i[e]=e;return i.sort((function compareTime(t,i){return e[t]-e[i]})),i}function sortedArray(e,t,i){const n=e.length,r=new e.constructor(n);for(let a=0,o=0;o!==n;++a){const n=i[a]*t;for(let i=0;i!==t;++i)r[o++]=e[n+i]}return r}function flattenJSON(e,t,i,n){let r=1,a=e[0];for(;void 0!==a&&void 0===a[n];)a=e[r++];if(void 0===a)return;let o=a[n];if(void 0!==o)if(Array.isArray(o))do{o=a[n],void 0!==o&&(t.push(a.time),i.push.apply(i,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[n],void 0!==o&&(t.push(a.time),o.toArray(i,i.length)),a=e[r++]}while(void 0!==a);else do{o=a[n],void 0!==o&&(t.push(a.time),i.push(o)),a=e[r++]}while(void 0!==a)}class Interpolant{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let a;i:{n:if(!(e=r)break e;{const o=t[1];e=r)break t}a=i,i=0}}for(;i>>1;et;)--a;if(++a,0!==r||a!==n){r>=a&&(a=Math.max(a,1),r=a-1);const e=this.getValueSize();this.times=arraySlice(i,r,a),this.values=arraySlice(this.values,r*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==r;t++){const n=i[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==a&&a>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,a),e=!1;break}a=n}if(void 0!==n&&isTypedArray(n))for(let t=0,i=n.length;t!==i;++t){const i=n[t];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){const e=arraySlice(this.times),t=arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===me,r=e.length-1;let a=1;for(let o=1;o0){e[a]=e[r];for(let e=r*i,n=a*i,o=0;o!==i;++o)t[n+o]=t[e+o];++a}return a!==e.length?(this.times=arraySlice(e,0,a),this.values=arraySlice(t,0,a*i)):(this.times=e,this.values=t),this}clone(){const e=arraySlice(this.times,0),t=arraySlice(this.values,0),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=pe;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=Ae,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-t)/(n-t);let c=e*o;for(let e=c+o;c!==e;c+=4)Quaternion.slerpFlat(r,0,a,c-o,a,c,l);return r}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=pe,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=Ae,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(e,t=-1,i,n=2500){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,n=1/(e.fps||1);for(let e=0,r=i.length;e!==r;++e)t.push(parseKeyframeTrack(i[e]).scale(n));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=i.length;e!==n;++e)t.push(KeyframeTrack.toJSON(i[e]));return n}static CreateFromMorphTargetSequence(e,t,i,n){const r=t.length,a=[];for(let e=0;e1){const e=a[1];let t=n[e];t||(n[e]=t=[]),t.push(i)}}const a=[];for(const e in n)a.push(this.CreateFromMorphTargetSequence(e,n[e],t,i));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const addNonemptyTrack=function(e,t,i,n,r){if(0!==i.length){const a=[],o=[];flattenJSON(i,a,o,n),0!==a.length&&r.push(new e(t,a,o))}},i=[],n=e.name||"default",r=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let e=0;e{t&&t(r),this.manager.itemEnd(e)}),0),r;if(void 0!==Gn[e])return void Gn[e].push({onLoad:t,onProgress:i,onError:n});Gn[e]=[],Gn[e].push({onLoad:t,onProgress:i,onError:n});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const i=Gn[e],n=t.body.getReader(),r=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),a=r?parseInt(r):0,o=0!==a;let l=0;const c=new ReadableStream({start(e){!function readData(){n.read().then((({done:t,value:n})=>{if(t)e.close();else{l+=n.byteLength;const t=new ProgressEvent("progress",{lengthComputable:o,loaded:l,total:a});for(let e=0,n=i.length;e{switch(l){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),i=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(i);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{kn.add(e,t);const i=Gn[e];delete Gn[e];for(let e=0,n=i.length;e{const i=Gn[e];if(void 0===i)throw this.manager.itemError(e),t;delete Gn[e];for(let e=0,n=i.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class ImageLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=kn.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;const o=createElementNS("img");function onImageLoad(){removeEventListeners(),kn.add(e,this),t&&t(this),r.manager.itemEnd(e)}function onImageError(t){removeEventListeners(),n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}function removeEventListeners(){o.removeEventListener("load",onImageLoad,!1),o.removeEventListener("error",onImageError,!1)}return o.addEventListener("load",onImageLoad,!1),o.addEventListener("error",onImageError,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class DataTextureLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){const r=this,a=new DataTexture,o=new FileLoader(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,(function(e){const i=r.parse(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:T,a.wrapT=void 0!==i.wrapT?i.wrapT:T,a.magFilter=void 0!==i.magFilter?i.magFilter:O,a.minFilter=void 0!==i.minFilter?i.minFilter:O,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(a.encoding=i.encoding),void 0!==i.flipY&&(a.flipY=i.flipY),void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps,a.minFilter=H),1===i.mipmapCount&&(a.minFilter=O),void 0!==i.generateMipmaps&&(a.generateMipmaps=i.generateMipmaps),a.needsUpdate=!0,t&&t(a,i))}),i,n),a}}class TextureLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){const r=new Texture$1,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),i,n),r}}class Light extends Object3D{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Color(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}const Vn=new Matrix4,zn=new Vector3,Hn=new Vector3;class LightShadow{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;zn.setFromMatrixPosition(e.matrixWorld),t.position.copy(zn),Hn.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Hn),t.updateMatrixWorld(),Vn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Vn),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Vn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class SpotLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=2*Re*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class SpotLight extends Light{constructor(e,t,i=0,n=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.distance=i,this.angle=n,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new SpotLightShadow}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Wn=new Matrix4,qn=new Vector3,jn=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),qn.setFromMatrixPosition(e.matrixWorld),i.position.copy(qn),jn.copy(i.position),jn.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(jn),i.updateMatrixWorld(),n.makeTranslation(-qn.x,-qn.y,-qn.z),Wn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Wn)}}class PointLight extends Light{constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new PointLightShadow}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Vector3)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*n),t.addScaledVector(a[2],.488603*r),t.addScaledVector(a[3],.488603*i),t.addScaledVector(a[4],i*n*1.092548),t.addScaledVector(a[5],n*r*1.092548),t.addScaledVector(a[6],.315392*(3*r*r-1)),t.addScaledVector(a[7],i*r*1.092548),t.addScaledVector(a[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){const i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*n),t.addScaledVector(a[2],1.023328*r),t.addScaledVector(a[3],1.023328*i),t.addScaledVector(a[4],.858086*i*n),t.addScaledVector(a[5],.858086*n*r),t.addScaledVector(a[6],.743125*r*r-.247708),t.addScaledVector(a[7],.858086*i*r),t.addScaledVector(a[8],.429043*(i*i-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const i=e.x,n=e.y,r=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-n*n)}}class LightProbe extends Light{constructor(e=new SphericalHarmonics3,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class LoaderUtils{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0,n=e.length;i0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(i[e]!==i[e+t]){o.setValue(i,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let e=i,r=n;e!==r;++e)t[e]=t[n+e%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let n=0;n!==r;++n)e[t+n]=e[i+n]}_slerp(e,t,i,n){Quaternion.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){const a=this._workIndex*r;Quaternion.multiplyQuaternionsFlat(e,a,e,t,e,i),Quaternion.slerpFlat(e,t,e,t,e,a,n)}_lerp(e,t,i,n,r){const a=1-n;for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]*a+e[i+o]*n}}_lerpAdditive(e,t,i,n,r){for(let a=0;a!==r;++a){const r=t+a;e[r]=e[r]+e[i+a]*n}}}const Kn="\\[\\]\\.:\\/",Yn=new RegExp("["+Kn+"]","g"),Xn="[^"+Kn+"]",Jn="[^"+Kn.replace("\\.","")+"]",$n=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Xn)+/(WCOD+)?/.source.replace("WCOD",Jn)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Xn)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Xn)+"$"),Zn=["material","materials","bones","map"];class PropertyBinding{constructor(e,t,i){this.path=t,this.parsedPath=i||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,i):new PropertyBinding(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Yn,"")}static parseTrackName(e){const t=$n.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=i.nodeName.substring(n+1);-1!==Zn.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){const searchNodeSubtree=function(e){for(let i=0;i0){const e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(a),t[i].accumulateAdditive(o);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(a),t[i].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let n=this.time+e,r=this._loopCount;const a=i===de;if(0===e)return-1===r?n:a&&1==(1&r)?t-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){const i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(a&&1==(1&r))return t-n}return n}_setEndings(e,t,i){const n=this._interpolantSettings;i?(n.endingStart=fe,n.endingEnd=fe):(n.endingStart=e?this.zeroSlopeAtStart?fe:ge:ve,n.endingEnd=t?this.zeroSlopeAtEnd?fe:ge:ve)}_scheduleFading(e,t,i){const n=this._mixer,r=n.time;let a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,l[0]=t,o[1]=r+e,l[1]=i,this}}const er=new Float32Array(1);class AnimationMixer extends EventDispatcher{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,a=e._propertyBindings,o=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let h=c[l];void 0===h&&(h={},c[l]=h);for(let e=0;e!==r;++e){const r=n[e],c=r.name;let A=h[c];if(void 0!==A)++A.referenceCount,a[e]=A;else{if(A=a[e],void 0!==A){null===A._cacheIndex&&(++A.referenceCount,this._addInactiveBinding(A,l,c));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;A=new PropertyMixer(PropertyBinding.create(i,c,n),r.ValueTypeName,r.getValueSize()),++A.referenceCount,this._addInactiveBinding(A,l,c),a[e]=A}o[e].resultBuffer=A.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==i;++o){t[o]._update(n,e,r,a)}const o=this._bindings,l=this._nActiveBindings;for(let e=0;e!==l;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e>8&255]+Ue[e>>16&255]+Ue[e>>24&255]+"-"+Ue[255&t]+Ue[t>>8&255]+"-"+Ue[t>>16&15|64]+Ue[t>>24&255]+"-"+Ue[63&i|128]+Ue[i>>8&255]+"-"+Ue[i>>16&255]+Ue[i>>24&255]+Ue[255&n]+Ue[n>>8&255]+Ue[n>>16&255]+Ue[n>>24&255]).toLowerCase()}function clamp$1(e,t,i){return Math.max(t,Math.min(i,e))}function euclideanModulo(e,t){return(e%t+t)%t}function lerp$1(e,t,i){return(1-i)*e+i*t}function isPowerOfTwo(e){return 0==(e&e-1)&&0!==e}function ceilPowerOfTwo(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function floorPowerOfTwo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function denormalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function normalize(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const Qe={DEG2RAD:Fe,RAD2DEG:Ne,generateUUID,clamp:clamp$1,euclideanModulo,mapLinear:function mapLinear(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function inverseLerp(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:lerp$1,damp:function damp(e,t,i,n){return lerp$1(e,t,1-Math.exp(-i*n))},pingpong:function pingpong(e,t=1){return t-Math.abs(euclideanModulo(e,2*t)-t)},smoothstep:function smoothstep(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function smootherstep(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function randInt(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function randFloat(e,t){return e+Math.random()*(t-e)},randFloatSpread:function randFloatSpread(e){return e*(.5-Math.random())},seededRandom:function seededRandom(e){void 0!==e&&(Pe=e);let t=Pe+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function degToRad(e){return e*Fe},radToDeg:function radToDeg(e){return e*Ne},isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler:function setQuaternionFromProperEuler(e,t,i,n,r){const a=Math.cos,o=Math.sin,l=a(i/2),c=o(i/2),h=a((t+n)/2),d=o((t+n)/2),A=a((t-n)/2),p=o((t-n)/2),m=a((n-t)/2),g=o((n-t)/2);switch(r){case"XYX":e.set(l*d,c*A,c*p,l*h);break;case"YZY":e.set(c*p,l*d,c*A,l*h);break;case"ZXZ":e.set(c*A,c*p,l*d,l*h);break;case"XZX":e.set(l*d,c*g,c*m,l*h);break;case"YXY":e.set(c*m,l*d,c*g,l*h);break;case"ZYZ":e.set(c*g,c*m,l*d,l*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize,denormalize};class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(clamp$1(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(e,t,i,n,r,a,o,l,c){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,o,l,c)}set(e,t,i,n,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=n,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],d=i[7],A=i[2],p=i[5],m=i[8],g=n[0],f=n[3],v=n[6],E=n[1],y=n[4],_=n[7],x=n[2],S=n[5],C=n[8];return r[0]=a*g+o*E+l*x,r[3]=a*f+o*y+l*S,r[6]=a*v+o*_+l*C,r[1]=c*g+h*E+d*x,r[4]=c*f+h*y+d*S,r[7]=c*v+h*_+d*C,r[2]=A*g+p*E+m*x,r[5]=A*f+p*y+m*S,r[8]=A*v+p*_+m*C,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-i*r*h+i*o*l+n*r*c-n*a*l}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,A=o*l-h*r,p=c*r-a*l,m=t*d+i*A+n*p;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=d*g,e[1]=(n*c-h*i)*g,e[2]=(o*i-n*a)*g,e[3]=A*g,e[4]=(h*t-n*l)*g,e[5]=(n*r-o*t)*g,e[6]=p*g,e[7]=(i*l-c*t)*g,e[8]=(a*t-i*r)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-n*c,n*l,-n*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Oe.makeScale(e,t)),this}rotate(e){return this.premultiply(Oe.makeRotation(-e)),this}translate(e,t){return this.premultiply(Oe.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Oe=new Matrix3;function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function createElementNS(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}const ke={};function warnOnce(e){e in ke||(ke[e]=!0,console.warn(e))}function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const Ge=(new Matrix3).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),Ve=(new Matrix3).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const He={[be]:e=>e,[Me]:e=>e.convertSRGBToLinear(),[Ie]:function DisplayP3ToLinearSRGB(e){return e.convertSRGBToLinear().applyMatrix3(Ve)}},ze={[be]:e=>e,[Me]:e=>e.convertLinearToSRGB(),[Ie]:function LinearSRGBToDisplayP3(e){return e.applyMatrix3(Ge).convertLinearToSRGB()}},We={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return be},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;const n=He[t],r=ze[i];if(void 0===n||void 0===r)throw new Error(`Unsupported color space conversion, "${t}" to "${i}".`);return r(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let qe;class ImageUtils{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===qe&&(qe=createElementNS("canvas")),qe.width=e.width,qe.height=e.height;const i=qe.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=qe}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case C:e.x=e.x-Math.floor(e.x);break;case b:e.x=e.x<0?0:1;break;case I:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case C:e.y=e.y-Math.floor(e.y);break;case b:e.y=e.y<0?0:1;break;case I:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return warnOnce("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Me?Se:3e3}set encoding(e){warnOnce("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Se?Me:Ce}}Texture$1.DEFAULT_IMAGE=null,Texture$1.DEFAULT_MAPPING=300,Texture$1.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,i=0,n=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;const a=.01,o=.1,l=e.elements,c=l[0],h=l[4],d=l[8],A=l[1],p=l[5],m=l[9],g=l[2],f=l[6],v=l[10];if(Math.abs(h-A)l&&e>E?eE?l=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,o=Math.sin(o*a)/r}const r=o*i;if(l=l*e+A*r,c=c*e+p*r,h=h*e+m*r,d=d*e+g*r,e===1-o){const e=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=e,c*=e,h*=e,d*=e}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,n,r,a){const o=i[n],l=i[n+1],c=i[n+2],h=i[n+3],d=r[a],A=r[a+1],p=r[a+2],m=r[a+3];return e[t]=o*m+h*d+l*p-c*A,e[t+1]=l*m+h*A+c*d-o*p,e[t+2]=c*m+h*p+o*A-l*d,e[t+3]=h*m-o*d-l*A-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,n=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(n/2),d=o(r/2),A=l(i/2),p=l(n/2),m=l(r/2);switch(a){case"XYZ":this._x=A*h*d+c*p*m,this._y=c*p*d-A*h*m,this._z=c*h*m+A*p*d,this._w=c*h*d-A*p*m;break;case"YXZ":this._x=A*h*d+c*p*m,this._y=c*p*d-A*h*m,this._z=c*h*m-A*p*d,this._w=c*h*d+A*p*m;break;case"ZXY":this._x=A*h*d-c*p*m,this._y=c*p*d+A*h*m,this._z=c*h*m+A*p*d,this._w=c*h*d-A*p*m;break;case"ZYX":this._x=A*h*d-c*p*m,this._y=c*p*d+A*h*m,this._z=c*h*m-A*p*d,this._w=c*h*d+A*p*m;break;case"YZX":this._x=A*h*d+c*p*m,this._y=c*p*d+A*h*m,this._z=c*h*m-A*p*d,this._w=c*h*d-A*p*m;break;case"XZY":this._x=A*h*d-c*p*m,this._y=c*p*d-A*h*m,this._z=c*h*m+A*p*d,this._w=c*h*d+A*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],A=i+o+d;if(A>0){const e=.5/Math.sqrt(A+1);this._w=.25/e,this._x=(h-l)*e,this._y=(r-c)*e,this._z=(a-n)*e}else if(i>o&&i>d){const e=2*Math.sqrt(1+i-o-d);this._w=(h-l)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+c)/e}else if(o>d){const e=2*Math.sqrt(1+o-i-d);this._w=(r-c)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(l+h)/e}else{const e=2*Math.sqrt(1+d-i-o);this._w=(a-n)/e,this._x=(r+c)/e,this._y=(l+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp$1(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=i*h+a*o+n*c-r*l,this._y=n*h+a*l+r*o-i*c,this._z=r*h+a*c+i*l-n*o,this._w=a*h-i*o-n*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const i=this._x,n=this._y,r=this._z,a=this._w;let o=a*e._w+i*e._x+n*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-t)*h)/c,A=Math.sin(t*h)/c;return this._w=a*d+this._w*A,this._x=i*d+this._x*A,this._y=n*d+this._y*A,this._z=r*d+this._z*A,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(r),i*Math.cos(r),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,i=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ke.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ke.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=l*t+a*n-o*i,h=l*i+o*t-r*n,d=l*n+r*i-a*t,A=-r*t-a*i-o*n;return this.x=c*l+A*-r+h*-o-d*-a,this.y=h*l+A*-a+d*-r-c*-o,this.z=d*l+A*-o+c*-a-h*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=n*l-r*o,this.y=r*a-i*l,this.z=i*o-n*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ye.copy(this).projectOnVector(e),this.sub(Ye)}reflect(e){return this.sub(Ye.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(clamp$1(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ye=new Vector3,Ke=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Je),Je.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(at),ot.subVectors(this.max,at),et.subVectors(e.a,at),tt.subVectors(e.b,at),it.subVectors(e.c,at),nt.subVectors(tt,et),rt.subVectors(it,tt),st.subVectors(et,it);let t=[0,-nt.z,nt.y,0,-rt.z,rt.y,0,-st.z,st.y,nt.z,0,-nt.x,rt.z,0,-rt.x,st.z,0,-st.x,-nt.y,nt.x,0,-rt.y,rt.x,0,-st.y,st.x,0];return!!satForAxes(t,et,tt,it,ot)&&(t=[1,0,0,0,1,0,0,0,1],!!satForAxes(t,et,tt,it,ot)&&(lt.crossVectors(nt,rt),t=[lt.x,lt.y,lt.z],satForAxes(t,et,tt,it,ot)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Je).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Je).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||($e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),$e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),$e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),$e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),$e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),$e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),$e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),$e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints($e)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const $e=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],Je=new Vector3,Ze=new Box3,et=new Vector3,tt=new Vector3,it=new Vector3,nt=new Vector3,rt=new Vector3,st=new Vector3,at=new Vector3,ot=new Vector3,lt=new Vector3,ct=new Vector3;function satForAxes(e,t,i,n,r){for(let a=0,o=e.length-3;a<=o;a+=3){ct.fromArray(e,a);const o=r.x*Math.abs(ct.x)+r.y*Math.abs(ct.y)+r.z*Math.abs(ct.z),l=t.dot(ct),c=i.dot(ct),h=n.dot(ct);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ht=new Box3,ut=new Vector3,dt=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):ht.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ut.subVectors(e,this.center);const t=ut.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(ut,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(dt.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ut.copy(e.center).add(dt)),this.expandByPoint(ut.copy(e.center).sub(dt))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const At=new Vector3,pt=new Vector3,mt=new Vector3,gt=new Vector3,ft=new Vector3,vt=new Vector3,Et=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,At)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=At.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(At.copy(this.origin).addScaledVector(this.direction,t),At.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){pt.copy(e).add(t).multiplyScalar(.5),mt.copy(t).sub(e).normalize(),gt.copy(this.origin).sub(pt);const r=.5*e.distanceTo(t),a=-this.direction.dot(mt),o=gt.dot(this.direction),l=-gt.dot(mt),c=gt.lengthSq(),h=Math.abs(1-a*a);let d,A,p,m;if(h>0)if(d=a*l-o,A=a*o-l,m=r*h,d>=0)if(A>=-m)if(A<=m){const e=1/h;d*=e,A*=e,p=d*(d+a*A+2*o)+A*(a*d+A+2*l)+c}else A=r,d=Math.max(0,-(a*A+o)),p=-d*d+A*(A+2*l)+c;else A=-r,d=Math.max(0,-(a*A+o)),p=-d*d+A*(A+2*l)+c;else A<=-m?(d=Math.max(0,-(-a*r+o)),A=d>0?-r:Math.min(Math.max(-r,-l),r),p=-d*d+A*(A+2*l)+c):A<=m?(d=0,A=Math.min(Math.max(-r,-l),r),p=A*(A+2*l)+c):(d=Math.max(0,-(a*r+o)),A=d>0?r:Math.min(Math.max(-r,-l),r),p=-d*d+A*(A+2*l)+c);else A=a>0?-r:r,d=Math.max(0,-(a*A+o)),p=-d*d+A*(A+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),n&&n.copy(pt).addScaledVector(mt,A),p}intersectSphere(e,t){At.subVectors(e.center,this.origin);const i=At.dot(this.direction),n=At.dot(At)-i*i,r=e.radius*e.radius;if(n>r)return null;const a=Math.sqrt(r-n),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,A=this.origin;return c>=0?(i=(e.min.x-A.x)*c,n=(e.max.x-A.x)*c):(i=(e.max.x-A.x)*c,n=(e.min.x-A.x)*c),h>=0?(r=(e.min.y-A.y)*h,a=(e.max.y-A.y)*h):(r=(e.max.y-A.y)*h,a=(e.min.y-A.y)*h),i>a||r>n?null:((r>i||isNaN(i))&&(i=r),(a=0?(o=(e.min.z-A.z)*d,l=(e.max.z-A.z)*d):(o=(e.max.z-A.z)*d,l=(e.min.z-A.z)*d),i>l||o>n?null:((o>i||i!=i)&&(i=o),(l=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,At)}intersectTriangle(e,t,i,n,r){ft.subVectors(t,e),vt.subVectors(i,e),Et.crossVectors(ft,vt);let a,o=this.direction.dot(Et);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}gt.subVectors(this.origin,e);const l=a*this.direction.dot(vt.crossVectors(gt,vt));if(l<0)return null;const c=a*this.direction.dot(ft.cross(gt));if(c<0)return null;if(l+c>o)return null;const h=-a*gt.dot(Et);return h<0?null:this.at(h/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(e,t,i,n,r,a,o,l,c,h,d,A,p,m,g,f){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,o,l,c,h,d,A,p,m,g,f)}set(e,t,i,n,r,a,o,l,c,h,d,A,p,m,g,f){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=r,v[5]=a,v[9]=o,v[13]=l,v[2]=c,v[6]=h,v[10]=d,v[14]=A,v[3]=p,v[7]=m,v[11]=g,v[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,n=1/yt.setFromMatrixColumn(e,0).length(),r=1/yt.setFromMatrixColumn(e,1).length(),a=1/yt.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(n),c=Math.sin(n),h=Math.cos(r),d=Math.sin(r);if("XYZ"===e.order){const e=a*h,i=a*d,n=o*h,r=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=i+n*c,t[5]=e-r*c,t[9]=-o*l,t[2]=r-e*c,t[6]=n+i*c,t[10]=a*l}else if("YXZ"===e.order){const e=l*h,i=l*d,n=c*h,r=c*d;t[0]=e+r*o,t[4]=n*o-i,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=i*o-n,t[6]=r+e*o,t[10]=a*l}else if("ZXY"===e.order){const e=l*h,i=l*d,n=c*h,r=c*d;t[0]=e-r*o,t[4]=-a*d,t[8]=n+i*o,t[1]=i+n*o,t[5]=a*h,t[9]=r-e*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if("ZYX"===e.order){const e=a*h,i=a*d,n=o*h,r=o*d;t[0]=l*h,t[4]=n*c-i,t[8]=e*c+r,t[1]=l*d,t[5]=r*c+e,t[9]=i*c-n,t[2]=-c,t[6]=o*l,t[10]=a*l}else if("YZX"===e.order){const e=a*l,i=a*c,n=o*l,r=o*c;t[0]=l*h,t[4]=r-e*d,t[8]=n*d+i,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=i*d+n,t[10]=e-r*d}else if("XZY"===e.order){const e=a*l,i=a*c,n=o*l,r=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=e*d+r,t[5]=a*h,t[9]=i*d-n,t[2]=n*d-i,t[6]=o*h,t[10]=r*d+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xt,e,St)}lookAt(e,t,i){const n=this.elements;return bt.subVectors(e,t),0===bt.lengthSq()&&(bt.z=1),bt.normalize(),Ct.crossVectors(i,bt),0===Ct.lengthSq()&&(1===Math.abs(i.z)?bt.x+=1e-4:bt.z+=1e-4,bt.normalize(),Ct.crossVectors(i,bt)),Ct.normalize(),Mt.crossVectors(bt,Ct),n[0]=Ct.x,n[4]=Mt.x,n[8]=bt.x,n[1]=Ct.y,n[5]=Mt.y,n[9]=bt.y,n[2]=Ct.z,n[6]=Mt.z,n[10]=bt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],d=i[5],A=i[9],p=i[13],m=i[2],g=i[6],f=i[10],v=i[14],E=i[3],y=i[7],_=i[11],x=i[15],S=n[0],C=n[4],b=n[8],I=n[12],T=n[1],B=n[5],U=n[9],F=n[13],O=n[2],G=n[6],W=n[10],q=n[14],X=n[3],j=n[7],Y=n[11],K=n[15];return r[0]=a*S+o*T+l*O+c*X,r[4]=a*C+o*B+l*G+c*j,r[8]=a*b+o*U+l*W+c*Y,r[12]=a*I+o*F+l*q+c*K,r[1]=h*S+d*T+A*O+p*X,r[5]=h*C+d*B+A*G+p*j,r[9]=h*b+d*U+A*W+p*Y,r[13]=h*I+d*F+A*q+p*K,r[2]=m*S+g*T+f*O+v*X,r[6]=m*C+g*B+f*G+v*j,r[10]=m*b+g*U+f*W+v*Y,r[14]=m*I+g*F+f*q+v*K,r[3]=E*S+y*T+_*O+x*X,r[7]=E*C+y*B+_*G+x*j,r[11]=E*b+y*U+_*W+x*Y,r[15]=E*I+y*F+_*q+x*K,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],A=e[10],p=e[14];return e[3]*(+r*l*d-n*c*d-r*o*A+i*c*A+n*o*p-i*l*p)+e[7]*(+t*l*p-t*c*A+r*a*A-n*a*p+n*c*h-r*l*h)+e[11]*(+t*c*d-t*o*p-r*a*d+i*a*p+r*o*h-i*c*h)+e[15]*(-n*o*h-t*l*d+t*o*A+n*a*d-i*a*A+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],A=e[10],p=e[11],m=e[12],g=e[13],f=e[14],v=e[15],E=d*f*c-g*A*c+g*l*p-o*f*p-d*l*v+o*A*v,y=m*A*c-h*f*c-m*l*p+a*f*p+h*l*v-a*A*v,_=h*g*c-m*d*c+m*o*p-a*g*p-h*o*v+a*d*v,x=m*d*l-h*g*l-m*o*A+a*g*A+h*o*f-a*d*f,S=t*E+i*y+n*_+r*x;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/S;return e[0]=E*C,e[1]=(g*A*r-d*f*r-g*n*p+i*f*p+d*n*v-i*A*v)*C,e[2]=(o*f*r-g*l*r+g*n*c-i*f*c-o*n*v+i*l*v)*C,e[3]=(d*l*r-o*A*r-d*n*c+i*A*c+o*n*p-i*l*p)*C,e[4]=y*C,e[5]=(h*f*r-m*A*r+m*n*p-t*f*p-h*n*v+t*A*v)*C,e[6]=(m*l*r-a*f*r-m*n*c+t*f*c+a*n*v-t*l*v)*C,e[7]=(a*A*r-h*l*r+h*n*c-t*A*c-a*n*p+t*l*p)*C,e[8]=_*C,e[9]=(m*d*r-h*g*r-m*i*p+t*g*p+h*i*v-t*d*v)*C,e[10]=(a*g*r-m*o*r+m*i*c-t*g*c-a*i*v+t*o*v)*C,e[11]=(h*o*r-a*d*r-h*i*c+t*d*c+a*i*p-t*o*p)*C,e[12]=x*C,e[13]=(h*g*n-m*d*n+m*i*A-t*g*A-h*i*f+t*d*f)*C,e[14]=(m*o*n-a*g*n-m*i*l+t*g*l+a*i*f-t*o*f)*C,e[15]=(a*d*n-h*o*n+h*i*l-t*d*l-a*i*A+t*o*A)*C,this}scale(e){const t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-n*l,c*l+n*o,0,c*o+n*l,h*o+i,h*l-n*a,0,c*l-n*o,h*l+n*a,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,d=o+o,A=r*c,p=r*h,m=r*d,g=a*h,f=a*d,v=o*d,E=l*c,y=l*h,_=l*d,x=i.x,S=i.y,C=i.z;return n[0]=(1-(g+v))*x,n[1]=(p+_)*x,n[2]=(m-y)*x,n[3]=0,n[4]=(p-_)*S,n[5]=(1-(A+v))*S,n[6]=(f+E)*S,n[7]=0,n[8]=(m+y)*C,n[9]=(f-E)*C,n[10]=(1-(A+g))*C,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;let r=yt.set(n[0],n[1],n[2]).length();const a=yt.set(n[4],n[5],n[6]).length(),o=yt.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],_t.copy(this);const l=1/r,c=1/a,h=1/o;return _t.elements[0]*=l,_t.elements[1]*=l,_t.elements[2]*=l,_t.elements[4]*=c,_t.elements[5]*=c,_t.elements[6]*=c,_t.elements[8]*=h,_t.elements[9]*=h,_t.elements[10]*=h,t.setFromRotationMatrix(_t),i.x=r,i.y=a,i.z=o,this}makePerspective(e,t,i,n,r,a,o=2e3){const l=this.elements,c=2*r/(t-e),h=2*r/(i-n),d=(t+e)/(t-e),A=(i+n)/(i-n);let p,m;if(o===Le)p=-(a+r)/(a-r),m=-2*a*r/(a-r);else{if(o!==De)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);p=-a/(a-r),m=-a*r/(a-r)}return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=A,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,r,a,o=2e3){const l=this.elements,c=1/(t-e),h=1/(i-n),d=1/(a-r),A=(t+e)*c,p=(i+n)*h;let m,g;if(o===Le)m=(a+r)*d,g=-2*d;else{if(o!==De)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);m=r*d,g=-1*d}return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-A,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const yt=new Vector3,_t=new Matrix4,xt=new Vector3(0,0,0),St=new Vector3(1,1,1),Ct=new Vector3,Mt=new Vector3,bt=new Vector3,It=new Matrix4,wt=new Quaternion;class Euler{constructor(e=0,t=0,i=0,n=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,r=n[0],a=n[4],o=n[8],l=n[1],c=n[5],h=n[9],d=n[2],A=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(clamp$1(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(A,c),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp$1(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(clamp$1(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-clamp$1(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(A,p),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(clamp$1(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-clamp$1(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(A,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return It.makeRotationFromQuaternion(e),this.setFromRotationMatrix(It,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return wt.setFromEuler(this),this.setFromQuaternion(wt,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i=i.concat(r))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ut,e,Pt),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ut,Ft,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=serialize(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t0){n.children=[];for(let t=0;t0){n.animations=[];for(let t=0;t0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=n,i;function extractFromCache(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){Vt.subVectors(n,t),Ht.subVectors(i,t),zt.subVectors(e,t);const a=Vt.dot(Vt),o=Vt.dot(Ht),l=Vt.dot(zt),c=Ht.dot(Ht),h=Ht.dot(zt),d=a*c-o*o;if(0===d)return r.set(-2,-1,-1);const A=1/d,p=(c*l-o*h)*A,m=(a*h-o*l)*A;return r.set(1-p-m,m,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Wt),Wt.x>=0&&Wt.y>=0&&Wt.x+Wt.y<=1}static getUV(e,t,i,n,r,a,o,l){return!1===Jt&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Jt=!0),this.getInterpolation(e,t,i,n,r,a,o,l)}static getInterpolation(e,t,i,n,r,a,o,l){return this.getBarycoord(e,t,i,n,Wt),l.setScalar(0),l.addScaledVector(r,Wt.x),l.addScaledVector(a,Wt.y),l.addScaledVector(o,Wt.z),l}static isFrontFacing(e,t,i,n){return Vt.subVectors(i,t),Ht.subVectors(e,t),Vt.cross(Ht).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Vt.subVectors(this.c,this.b),Ht.subVectors(this.a,this.b),.5*Vt.cross(Ht).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return!1===Jt&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Jt=!0),Triangle.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}getInterpolation(e,t,i,n,r){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,r=this.c;let a,o;qt.subVectors(n,i),Xt.subVectors(r,i),Yt.subVectors(e,i);const l=qt.dot(Yt),c=Xt.dot(Yt);if(l<=0&&c<=0)return t.copy(i);Kt.subVectors(e,n);const h=qt.dot(Kt),d=Xt.dot(Kt);if(h>=0&&d<=h)return t.copy(n);const A=l*d-h*c;if(A<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(i).addScaledVector(qt,a);$t.subVectors(e,r);const p=qt.dot($t),m=Xt.dot($t);if(m>=0&&p<=m)return t.copy(r);const g=p*c-l*m;if(g<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(i).addScaledVector(Xt,o);const f=h*m-p*d;if(f<=0&&d-h>=0&&p-m>=0)return jt.subVectors(r,n),o=(d-h)/(d-h+(p-m)),t.copy(n).addScaledVector(jt,o);const v=1/(f+g+A);return a=g*v,o=A*v,t.copy(i).addScaledVector(qt,a).addScaledVector(Xt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Zt=0;class Material$1 extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Zt++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=1,this.side=a,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=c,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=we,this.stencilZFail=we,this.stencilZPass=we,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),this.side!==a&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=this.alphaHash),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(i.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){const t=extractFromCache(e.textures),n=extractFromCache(e.images);t.length>0&&(i.textures=t),n.length>0&&(i.images=n)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}const ei={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ti={h:0,s:0,l:0},ii={h:0,s:0,l:0};function hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}class Color{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(void 0===t&&void 0===i){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Me){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,We.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=We.workingColorSpace){return this.r=e,this.g=t,this.b=i,We.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=We.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp$1(t,0,1),i=clamp$1(i,0,1),0===t)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=hue2rgb(r,n,e+1/3),this.g=hue2rgb(r,n,e),this.b=hue2rgb(r,n,e-1/3)}return We.toWorkingColorSpace(this,n),this}setStyle(e,t=Me){function handleAlpha(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let n;const r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return handleAlpha(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Me){const i=ei[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Me){return We.fromWorkingColorSpace(ni.copy(this),e),65536*Math.round(clamp$1(255*ni.r,0,255))+256*Math.round(clamp$1(255*ni.g,0,255))+Math.round(clamp$1(255*ni.b,0,255))}getHexString(e=Me){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=We.workingColorSpace){We.fromWorkingColorSpace(ni.copy(this),t);const i=ni.r,n=ni.g,r=ni.b,a=Math.max(i,n,r),o=Math.min(i,n,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const e=a-o;switch(c=h<=.5?e/(a+o):e/(2-a-o),a){case i:l=(n-r)/e+(n>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}const a=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;0==(8388608&t);)t<<=1,i-=8388608;t&=-8388609,i+=947912704,a[e]=t|i}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(l[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:a,exponentTable:o,offsetTable:l}}const si={toHalfFloat:function toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=clamp$1(e,-65504,65504),ri.floatView[0]=e;const t=ri.uint32View[0],i=t>>23&511;return ri.baseTable[i]+((8388607&t)>>ri.shiftTable[i])},fromHalfFloat:function fromHalfFloat(e){const t=e>>10;return ri.uint32View[0]=ri.mantissaTable[ri.offsetTable[t]+(1023&e)]+ri.exponentTable[t],ri.floatView[0]}},ai=new Vector3,oi=new Vector2;class BufferAttribute{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=Te,this.updateRange={offset:0,count:-1},this.gpuType=Y,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const t in i){const n=i[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let r=!1;for(const t in this.morphAttributes){const i=this.morphAttributes[t],a=[];for(let t=0,n=i.length;t0&&(n[t]=a,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone(t));const n=e.attributes;for(const e in n){const i=n[e];this.setAttribute(e,i.clone(t))}const r=e.morphAttributes;for(const e in r){const i=[],n=r[e];for(let e=0,r=n.length;e0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e(e.far-e.near)**2)return}mi.copy(r).invert(),gi.copy(e.ray).applyMatrix4(mi),null!==i.boundingBox&&!1===gi.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,gi)}}_computeIntersections(e,t,i){let n;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,A=r.groups,p=r.drawRange;if(null!==o)if(Array.isArray(a))for(let r=0,l=A.length;ri.far?null:{distance:A,point:Ui.clone(),object:e}}(e,t,i,n,yi,_i,xi,Di);if(p){r&&(bi.fromBufferAttribute(r,h),wi.fromBufferAttribute(r,d),Ti.fromBufferAttribute(r,A),p.uv=Triangle.getInterpolation(Di,yi,_i,xi,bi,wi,Ti,new Vector2)),l&&(bi.fromBufferAttribute(l,h),wi.fromBufferAttribute(l,d),Ti.fromBufferAttribute(l,A),p.uv1=Triangle.getInterpolation(Di,yi,_i,xi,bi,wi,Ti,new Vector2),p.uv2=p.uv1),c&&(Bi.fromBufferAttribute(c,h),Ri.fromBufferAttribute(c,d),Li.fromBufferAttribute(c,A),p.normal=Triangle.getInterpolation(Di,yi,_i,xi,Bi,Ri,Li,new Vector3),p.normal.dot(n.direction)>0&&p.normal.multiplyScalar(-1));const e={a:h,b:d,c:A,normal:new Vector3,materialIndex:0};Triangle.getNormal(yi,_i,xi,e.normal),p.face=e}return p}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};const o=this;n=Math.floor(n),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let A=0,p=0;function buildPlane(e,t,i,n,r,a,m,g,f,v,E){const y=a/f,_=m/v,x=a/2,S=m/2,C=g/2,b=f+1,I=v+1;let T=0,B=0;const U=new Vector3;for(let a=0;a0?1:-1,h.push(U.x,U.y,U.z),d.push(l/f),d.push(1-a/v),T+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=Le}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class PerspectiveCamera extends Camera{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ne*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Fe*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ne*Math.atan(Math.tan(.5*Fe*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Fe*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/o,n*=a.width/e,i*=a.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ni=-90;class CubeCamera extends Object3D{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null;const n=new PerspectiveCamera(Ni,1,e,t);n.layers=this.layers,this.add(n);const r=new PerspectiveCamera(Ni,1,e,t);r.layers=this.layers,this.add(r);const a=new PerspectiveCamera(Ni,1,e,t);a.layers=this.layers,this.add(a);const o=new PerspectiveCamera(Ni,1,e,t);o.layers=this.layers,this.add(o);const l=new PerspectiveCamera(Ni,1,e,t);l.layers=this.layers,this.add(l);const c=new PerspectiveCamera(Ni,1,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,n,r,a,o,l]=t;for(const e of t)this.remove(e);if(e===Le)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else{if(e!==De)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[n,r,a,o,l,c]=this.children,h=e.getRenderTarget(),d=e.toneMapping,A=e.xr.enabled;e.toneMapping=p,e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,a),e.setRenderTarget(i,3),e.render(t,o),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=m,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(h),e.toneMapping=d,e.xr.enabled=A,i.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h){super(e=void 0!==e?e:[],t=void 0!==t?t:y,i,n,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];void 0!==t.encoding&&(warnOnce("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Se?Me:Ce),this.texture=new CubeTexture(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:F}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new BoxGeometry(5,5,5),r=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:o,blending:0});r.uniforms.tEquirect.value=t;const a=new Mesh(n,r),l=t.minFilter;t.minFilter===G&&(t.minFilter=F);return new CubeCamera(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,i,n){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,i,n);e.setRenderTarget(r)}}const Qi=new Vector3,Oi=new Vector3,ki=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=Qi.subVectors(i,t).cross(Oi.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Qi),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||ki.getNormalMatrix(e),n=this.coplanarPoint(Qi).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Gi=new Sphere,Vi=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,i=new Plane,n=new Plane,r=new Plane,a=new Plane){this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=2e3){const i=this.planes,n=e.elements,r=n[0],a=n[1],o=n[2],l=n[3],c=n[4],h=n[5],d=n[6],A=n[7],p=n[8],m=n[9],g=n[10],f=n[11],v=n[12],E=n[13],y=n[14],_=n[15];if(i[0].setComponents(l-r,A-c,f-p,_-v).normalize(),i[1].setComponents(l+r,A+c,f+p,_+v).normalize(),i[2].setComponents(l+a,A+h,f+m,_+E).normalize(),i[3].setComponents(l-a,A-h,f-m,_-E).normalize(),i[4].setComponents(l-o,A-d,f-g,_-y).normalize(),t===Le)i[5].setComponents(l+o,A+d,f+g,_+y).normalize();else{if(t!==De)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);i[5].setComponents(o,d,g,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Gi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Gi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Gi)}intersectsSprite(e){return Gi.center.set(0,0,0),Gi.radius=.7071067811865476,Gi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Gi)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(i)0?e.max.x:e.min.x,Vi.y=n.normal.y>0?e.max.y:e.min.y,Vi.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Vi)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let e=null,t=!1,i=null,n=null;function onAnimationFrame(t,r){i(t,r),n=e.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(onAnimationFrame),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function WebGLAttributes(e,t){const i=t.isWebGL2,n=new WeakMap;return{get:function get(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function remove(t){t.isInterleavedBufferAttribute&&(t=t.data);const i=n.get(t);i&&(e.deleteBuffer(i.buffer),n.delete(t))},update:function update(t,r){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},zi={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},Wi={basic:{uniforms:mergeUniforms([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.fog]),vertexShader:Hi.meshbasic_vert,fragmentShader:Hi.meshbasic_frag},lambert:{uniforms:mergeUniforms([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.fog,zi.lights,{emissive:{value:new Color(0)}}]),vertexShader:Hi.meshlambert_vert,fragmentShader:Hi.meshlambert_frag},phong:{uniforms:mergeUniforms([zi.common,zi.specularmap,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.fog,zi.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:Hi.meshphong_vert,fragmentShader:Hi.meshphong_frag},standard:{uniforms:mergeUniforms([zi.common,zi.envmap,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.roughnessmap,zi.metalnessmap,zi.fog,zi.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Hi.meshphysical_vert,fragmentShader:Hi.meshphysical_frag},toon:{uniforms:mergeUniforms([zi.common,zi.aomap,zi.lightmap,zi.emissivemap,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.gradientmap,zi.fog,zi.lights,{emissive:{value:new Color(0)}}]),vertexShader:Hi.meshtoon_vert,fragmentShader:Hi.meshtoon_frag},matcap:{uniforms:mergeUniforms([zi.common,zi.bumpmap,zi.normalmap,zi.displacementmap,zi.fog,{matcap:{value:null}}]),vertexShader:Hi.meshmatcap_vert,fragmentShader:Hi.meshmatcap_frag},points:{uniforms:mergeUniforms([zi.points,zi.fog]),vertexShader:Hi.points_vert,fragmentShader:Hi.points_frag},dashed:{uniforms:mergeUniforms([zi.common,zi.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hi.linedashed_vert,fragmentShader:Hi.linedashed_frag},depth:{uniforms:mergeUniforms([zi.common,zi.displacementmap]),vertexShader:Hi.depth_vert,fragmentShader:Hi.depth_frag},normal:{uniforms:mergeUniforms([zi.common,zi.bumpmap,zi.normalmap,zi.displacementmap,{opacity:{value:1}}]),vertexShader:Hi.meshnormal_vert,fragmentShader:Hi.meshnormal_frag},sprite:{uniforms:mergeUniforms([zi.sprite,zi.fog]),vertexShader:Hi.sprite_vert,fragmentShader:Hi.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Hi.background_vert,fragmentShader:Hi.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Hi.backgroundCube_vert,fragmentShader:Hi.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Hi.cube_vert,fragmentShader:Hi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hi.equirect_vert,fragmentShader:Hi.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([zi.common,zi.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hi.distanceRGBA_vert,fragmentShader:Hi.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([zi.lights,zi.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:Hi.shadow_vert,fragmentShader:Hi.shadow_frag}};Wi.physical={uniforms:mergeUniforms([Wi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:Hi.meshphysical_vert,fragmentShader:Hi.meshphysical_frag};const qi={r:0,b:0,g:0};function WebGLBackground(e,t,i,n,r,l,c){const h=new Color(0);let d,A,p=!0===l?0:1,m=null,g=0,f=null;function setClear(t,i){t.getRGB(qi,getUnlitUniformColorSpace(e)),n.buffers.color.setClear(qi.r,qi.g,qi.b,i,c)}return{getClearColor:function(){return h},setClearColor:function(e,t=1){h.set(e),p=t,setClear(h,p)},getClearAlpha:function(){return p},setClearAlpha:function(e){p=e,setClear(h,p)},render:function render(l,v){let E=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?i:t).get(y)}switch(null===y?setClear(h,p):y&&y.isColor&&(setClear(y,1),E=!0),e.xr.getEnvironmentBlendMode()){case"opaque":E=!0;break;case"additive":n.buffers.color.setClear(0,0,0,1,c),E=!0;break;case"alpha-blend":n.buffers.color.setClear(0,0,0,0,c),E=!0}(e.autoClear||E)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===S)?(void 0===A&&(A=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(Wi.backgroundCube.uniforms),vertexShader:Wi.backgroundCube.vertexShader,fragmentShader:Wi.backgroundCube.fragmentShader,side:o,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),A.geometry.deleteAttribute("uv"),A.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(A.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(A)),A.material.uniforms.envMap.value=y,A.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,A.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,A.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,A.material.toneMapped=y.colorSpace!==Me,m===y&&g===y.version&&f===e.toneMapping||(A.material.needsUpdate=!0,m=y,g=y.version,f=e.toneMapping),A.layers.enableAll(),l.unshift(A,A.geometry,A.material,0,0,null)):y&&y.isTexture&&(void 0===d&&(d=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(Wi.background.uniforms),vertexShader:Wi.background.vertexShader,fragmentShader:Wi.background.fragmentShader,side:a,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=y,d.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,d.material.toneMapped=y.colorSpace!==Me,!0===y.matrixAutoUpdate&&y.updateMatrix(),d.material.uniforms.uvTransform.value.copy(y.matrix),m===y&&g===y.version&&f===e.toneMapping||(d.material.needsUpdate=!0,m=y,g=y.version,f=e.toneMapping),d.layers.enableAll(),l.unshift(d,d.geometry,d.material,0,0,null))}}}function WebGLBindingStates(e,t,i,n){const r=e.getParameter(e.MAX_VERTEX_ATTRIBS),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||null!==a,l={},c=createBindingState(null);let h=c,d=!1;function bindVertexArrayObject(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function deleteVertexArrayObject(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function createBindingState(e){const t=[],i=[],n=[];for(let e=0;e=0){const i=r[t];let n=a[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===i)return!0;if(i.attribute!==n)return!0;if(n&&i.data!==n.data)return!0;o++}}return h.attributesNum!==o||h.index!==n}(r,p,A,m),g&&function saveCache(e,t,i,n){const r={},a=t.attributes;let o=0;const l=i.getAttributes();for(const t in l){if(l[t].location>=0){let i=a[t];void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor));const n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[t]=n,o++}}h.attributes=r,h.attributesNum=o,h.index=n}(r,p,A,m)}else{const e=!0===c.wireframe;h.geometry===p.id&&h.program===A.id&&h.wireframe===e||(h.geometry=p.id,h.program=A.id,h.wireframe=e,g=!0)}null!==m&&i.update(m,e.ELEMENT_ARRAY_BUFFER),(g||d)&&(d=!1,function setupVertexAttributes(r,a,o,l){if(!1===n.isWebGL2&&(r.isInstancedMesh||l.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;initAttributes();const c=l.attributes,h=o.getAttributes(),d=a.defaultAttributeValues;for(const t in h){const a=h[t];if(a.location>=0){let o=c[t];if(void 0===o&&("instanceMatrix"===t&&r.instanceMatrix&&(o=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(o=r.instanceColor)),void 0!==o){const t=o.normalized,c=o.itemSize,h=i.get(o);if(void 0===h)continue;const d=h.buffer,A=h.type,p=h.bytesPerElement,m=!0===n.isWebGL2&&(A===e.INT||A===e.UNSIGNED_INT||o.gpuType===X);if(o.isInterleavedBufferAttribute){const i=o.data,n=i.stride,h=o.offset;if(i.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const r="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let a=void 0!==i.precision?i.precision:"highp";const o=getMaxPrecision(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=r||t.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),m=e.getParameter(e.MAX_VERTEX_ATTRIBS),g=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),E=d>0,y=r||t.has("OES_texture_float");return{isWebGL2:r,drawBuffers:l,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const i=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:f,maxFragmentUniforms:v,vertexTextures:E,floatFragmentTextures:y,floatVertexTextures:E&&y,maxSamples:r?e.getParameter(e.MAX_SAMPLES):0}}function WebGLClipping(e){const t=this;let i=null,n=0,r=!1,a=!1;const o=new Plane,l=new Matrix3,c={value:null,needsUpdate:!1};function projectPlanes(e,i,n,r){const a=null!==e?e.length:0;let h=null;if(0!==a){if(h=c.value,!0!==r||null===h){const t=n+4*a,r=i.matrixWorldInverse;l.getNormalMatrix(r),(null===h||h.length0);t.numPlanes=n,t.numIntersection=0}();else{const e=a?0:n,t=4*e;let r=m.clippingState||null;c.value=r,r=projectPlanes(d,l,t,h);for(let e=0;e!==t;++e)r[e]=i[e];m.clippingState=r,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=e}}}function WebGLCubeMaps(e){let t=new WeakMap;function mapTextureMapping(e,t){return t===x?e.mapping=y:304===t&&(e.mapping=_),e}function onTextureDispose(e){const i=e.target;i.removeEventListener("dispose",onTextureDispose);const n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function get(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const n=i.mapping;if(n===x||304===n){if(t.has(i)){return mapTextureMapping(t.get(i).texture,i.mapping)}{const n=i.image;if(n&&n.height>0){const r=new WebGLCubeRenderTarget(n.height/2);return r.fromEquirectangularTexture(e,i),t.set(i,r),i.addEventListener("dispose",onTextureDispose),mapTextureMapping(r.texture,i.mapping)}return null}}}return i},dispose:function dispose(){t=new WeakMap}}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,i=1,n=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-e,a=i+e,o=n+t,l=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,o-=t*this.view.offsetY,l=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const Xi=[.125,.215,.35,.446,.526,.582],ji=20,Yi=new OrthographicCamera,Ki=new Color;let $i=null;const Ji=(1+Math.sqrt(5))/2,Zi=1/Ji,en=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,Ji,Zi),new Vector3(0,Ji,-Zi),new Vector3(Zi,0,Ji),new Vector3(-Zi,0,Ji),new Vector3(Ji,Zi,0),new Vector3(-Ji,Zi,0)];class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){$i=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,n,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?l=Xi[o-e+4-1]:0===o&&(l=0),n.push(l);const c=1/(a-2),h=-c,d=1+c,A=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,m=6,g=3,f=2,v=1,E=new Float32Array(g*m*p),y=new Float32Array(f*m*p),_=new Float32Array(v*m*p);for(let e=0;e2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];E.set(n,g*m*e),y.set(A,f*m*e);const r=[e,e,e,e,e,e];_.set(r,v*m*e)}const x=new BufferGeometry;x.setAttribute("position",new BufferAttribute(E,g)),x.setAttribute("uv",new BufferAttribute(y,f)),x.setAttribute("faceIndex",new BufferAttribute(_,v)),t.push(x),r>4&&r--}return{lodPlanes:t,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function _getBlurShader(e,t,i){const n=new Float32Array(ji),r=new Vector3(0,1,0),a=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:ji,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return a}(n,e,t)}return n}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,Yi)}_sceneToCubeUV(e,t,i,n){const r=new PerspectiveCamera(90,1,t,i),a=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,d=c.toneMapping;c.getClearColor(Ki),c.toneMapping=p,c.autoClear=!1;const A=new MeshBasicMaterial({name:"PMREM.Background",side:o,depthWrite:!1,depthTest:!1}),m=new Mesh(new BoxGeometry,A);let g=!1;const f=e.background;f?f.isColor&&(A.color.copy(f),e.background=null,g=!0):(A.color.copy(Ki),g=!0);for(let t=0;t<6;t++){const i=t%3;0===i?(r.up.set(0,a[t],0),r.lookAt(l[t],0,0)):1===i?(r.up.set(0,0,a[t]),r.lookAt(0,l[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,l[t]));const o=this._cubeSize;_setViewport(n,i*o,t>2?o:0,o,o),c.setRenderTarget(n),g&&c.render(m,r),c.render(e,r)}m.geometry.dispose(),m.material.dispose(),c.toneMapping=d,c.autoClear=h,e.background=f}_textureToCubeUV(e,t){const i=this._renderer,n=e.mapping===y||e.mapping===_;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const r=n?this._cubemapMaterial:this._equirectMaterial,a=new Mesh(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const o=this._cubeSize;_setViewport(t,0,0,3*o,2*o),i.setRenderTarget(t),i.render(a,Yi)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let t=1;tji&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);const f=[];let v=0;for(let e=0;eE-4?n-E+4:0),4*(this._cubeSize-y),3*y,2*y),l.setRenderTarget(t),l.render(h,Yi)}}function _createRenderTarget(e,t,i){const n=new WebGLRenderTarget(e,t,i);return n.texture.mapping=S,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function _setViewport(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function WebGLCubeUVMaps(e){let t=new WeakMap,i=null;function onTextureDispose(e){const i=e.target;i.removeEventListener("dispose",onTextureDispose);const n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function get(n){if(n&&n.isTexture){const r=n.mapping,a=r===x||304===r,o=r===y||r===_;if(a||o){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let r=t.get(n);return null===i&&(i=new PMREMGenerator(e)),r=a?i.fromEquirectangular(n,r):i.fromCubemap(n,r),t.set(n,r),r.texture}if(t.has(n))return t.get(n).texture;{const r=n.image;if(a&&r&&r.height>0||o&&r&&function isCubeTextureComplete(e){let t=0;const i=6;for(let n=0;nt.maxTextureSize&&(g=Math.ceil(m/t.maxTextureSize),m=t.maxTextureSize);const f=new Float32Array(m*g*4*r),v=new DataArrayTexture(f,m,g,r);v.type=Y,v.needsUpdate=!0;const E=4*p;for(let t=0;t0)return e;const r=t*i;let a=an[r];if(void 0===a&&(a=new Float32Array(r),an[r]=a),0!==t){n.toArray(a,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(a,r)}return a}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i":" "} ${r}: ${i[e]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return r}function getTexelEncodingFunction(e,t){const i=function getEncodingComponents(e){switch(e){case be:return["Linear","( value )"];case Me:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function getToneMappingFunction(e,t){let i;switch(t){case m:i="Linear";break;case g:i="Reinhard";break;case f:i="OptimizedCineon";break;case v:i="ACESFilmic";break;case E:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function filterEmptyLine(e){return""!==e}function replaceLightNums(e,t){const i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function replaceClippingPlaneNums(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const pn=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(e){return e.replace(pn,includeReplacer)}const mn=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function includeReplacer(e,t){let i=Hi[t];if(void 0===i){const e=mn.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");i=Hi[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return resolveIncludes(i)}const gn=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function unrollLoops(e){return e.replace(gn,loopReplacer)}function loopReplacer(e,t,i,n){let r="";for(let e=parseInt(t);e0&&(B+="\n"),U=[b,"#define SHADER_TYPE "+a.shaderType,"#define SHADER_NAME "+a.shaderName,I].filter(filterEmptyLine).join("\n"),U.length>0&&(U+="\n")):(B=[generatePrecision(a),"#define SHADER_TYPE "+a.shaderType,"#define SHADER_NAME "+a.shaderName,I,a.instancing?"#define USE_INSTANCING":"",a.instancingColor?"#define USE_INSTANCING_COLOR":"",a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+E:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",a.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",a.displacementMap?"#define USE_DISPLACEMENTMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.anisotropyMap?"#define USE_ANISOTROPYMAP":"",a.clearcoatMap?"#define USE_CLEARCOATMAP":"",a.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",a.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",a.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.alphaHash?"#define USE_ALPHAHASH":"",a.transmission?"#define USE_TRANSMISSION":"",a.transmissionMap?"#define USE_TRANSMISSIONMAP":"",a.thicknessMap?"#define USE_THICKNESSMAP":"",a.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",a.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",a.mapUv?"#define MAP_UV "+a.mapUv:"",a.alphaMapUv?"#define ALPHAMAP_UV "+a.alphaMapUv:"",a.lightMapUv?"#define LIGHTMAP_UV "+a.lightMapUv:"",a.aoMapUv?"#define AOMAP_UV "+a.aoMapUv:"",a.emissiveMapUv?"#define EMISSIVEMAP_UV "+a.emissiveMapUv:"",a.bumpMapUv?"#define BUMPMAP_UV "+a.bumpMapUv:"",a.normalMapUv?"#define NORMALMAP_UV "+a.normalMapUv:"",a.displacementMapUv?"#define DISPLACEMENTMAP_UV "+a.displacementMapUv:"",a.metalnessMapUv?"#define METALNESSMAP_UV "+a.metalnessMapUv:"",a.roughnessMapUv?"#define ROUGHNESSMAP_UV "+a.roughnessMapUv:"",a.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+a.anisotropyMapUv:"",a.clearcoatMapUv?"#define CLEARCOATMAP_UV "+a.clearcoatMapUv:"",a.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+a.clearcoatNormalMapUv:"",a.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+a.clearcoatRoughnessMapUv:"",a.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+a.iridescenceMapUv:"",a.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+a.iridescenceThicknessMapUv:"",a.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+a.sheenColorMapUv:"",a.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+a.sheenRoughnessMapUv:"",a.specularMapUv?"#define SPECULARMAP_UV "+a.specularMapUv:"",a.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+a.specularColorMapUv:"",a.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+a.specularIntensityMapUv:"",a.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+a.transmissionMapUv:"",a.thicknessMapUv?"#define THICKNESSMAP_UV "+a.thicknessMapUv:"",a.vertexTangents&&!1===a.flatShading?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexAlphas?"#define USE_COLOR_ALPHA":"",a.vertexUv1s?"#define USE_UV1":"",a.vertexUv2s?"#define USE_UV2":"",a.vertexUv3s?"#define USE_UV3":"",a.pointsUvs?"#define USE_POINTS_UV":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.morphColors&&a.isWebGL2?"#define USE_MORPHCOLORS":"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+a.morphTextureStride:"",a.morphTargetsCount>0&&a.isWebGL2?"#define MORPHTARGETS_COUNT "+a.morphTargetsCount:"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+f:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.useLegacyLights?"#define LEGACY_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&a.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),U=[b,generatePrecision(a),"#define SHADER_TYPE "+a.shaderType,"#define SHADER_NAME "+a.shaderName,I,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+v:"",a.envMap?"#define "+E:"",a.envMap?"#define "+x:"",C?"#define CUBEUV_TEXEL_WIDTH "+C.texelWidth:"",C?"#define CUBEUV_TEXEL_HEIGHT "+C.texelHeight:"",C?"#define CUBEUV_MAX_MIP "+C.maxMip+".0":"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",a.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.anisotropy?"#define USE_ANISOTROPY":"",a.anisotropyMap?"#define USE_ANISOTROPYMAP":"",a.clearcoat?"#define USE_CLEARCOAT":"",a.clearcoatMap?"#define USE_CLEARCOATMAP":"",a.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.iridescence?"#define USE_IRIDESCENCE":"",a.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",a.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",a.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.alphaTest?"#define USE_ALPHATEST":"",a.alphaHash?"#define USE_ALPHAHASH":"",a.sheen?"#define USE_SHEEN":"",a.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",a.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",a.transmission?"#define USE_TRANSMISSION":"",a.transmissionMap?"#define USE_TRANSMISSIONMAP":"",a.thicknessMap?"#define USE_THICKNESSMAP":"",a.vertexTangents&&!1===a.flatShading?"#define USE_TANGENT":"",a.vertexColors||a.instancingColor?"#define USE_COLOR":"",a.vertexAlphas?"#define USE_COLOR_ALPHA":"",a.vertexUv1s?"#define USE_UV1":"",a.vertexUv2s?"#define USE_UV2":"",a.vertexUv3s?"#define USE_UV3":"",a.pointsUvs?"#define USE_POINTS_UV":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+f:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.useLegacyLights?"#define LEGACY_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&a.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",a.toneMapping!==p?"#define TONE_MAPPING":"",a.toneMapping!==p?Hi.tonemapping_pars_fragment:"",a.toneMapping!==p?getToneMappingFunction("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.opaque?"#define OPAQUE":"",Hi.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",a.outputColorSpace),a.useDepthPacking?"#define DEPTH_PACKING "+a.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),m=resolveIncludes(m),m=replaceLightNums(m,a),m=replaceClippingPlaneNums(m,a),g=resolveIncludes(g),g=replaceLightNums(g,a),g=replaceClippingPlaneNums(g,a),m=unrollLoops(m),g=unrollLoops(g),a.isWebGL2&&!0!==a.isRawShaderMaterial&&(F="#version 300 es\n",B=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+B,U=["#define varying in",a.glslVersion===Be?"":"layout(location = 0) out highp vec4 pc_fragColor;",a.glslVersion===Be?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+U);const O=F+B+m,G=F+U+g,W=WebGLShader(l,l.VERTEX_SHADER,O),q=WebGLShader(l,l.FRAGMENT_SHADER,G);if(l.attachShader(T,W),l.attachShader(T,q),void 0!==a.index0AttributeName?l.bindAttribLocation(T,0,a.index0AttributeName):!0===a.morphTargets&&l.bindAttribLocation(T,0,"position"),l.linkProgram(T),e.debug.checkShaderErrors){const t=l.getProgramInfoLog(T).trim(),i=l.getShaderInfoLog(W).trim(),n=l.getShaderInfoLog(q).trim();let r=!0,a=!0;if(!1===l.getProgramParameter(T,l.LINK_STATUS))if(r=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(l,T,W,q);else{const e=getShaderErrors(l,W,"vertex"),i=getShaderErrors(l,q,"fragment");console.error("THREE.WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(T,l.VALIDATE_STATUS)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==i&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:t,vertexShader:{log:i,prefix:B},fragmentShader:{log:n,prefix:U}})}let X,j;return l.deleteShader(W),l.deleteShader(q),this.getUniforms=function(){return void 0===X&&(X=new WebGLUniforms(l,T)),X},this.getAttributes=function(){return void 0===j&&(j=function fetchAttributeLocations(e,t){const i={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r0,ce=a.clearcoat>0,he=a.iridescence>0,ue=a.sheen>0,de=a.transmission>0,Ae=le&&!!a.anisotropyMap,pe=ce&&!!a.clearcoatMap,me=ce&&!!a.clearcoatNormalMap,ge=ce&&!!a.clearcoatRoughnessMap,fe=he&&!!a.iridescenceMap,ve=he&&!!a.iridescenceThicknessMap,Ee=ue&&!!a.sheenColorMap,ye=ue&&!!a.sheenRoughnessMap,_e=!!a.specularMap,xe=!!a.specularColorMap,Se=!!a.specularIntensityMap,Ce=de&&!!a.transmissionMap,Me=de&&!!a.thicknessMap,Ie=!!a.gradientMap,we=!!a.alphaMap,Te=a.alphaTest>0,Be=!!a.alphaHash,Re=!!a.extensions,Le=!!C.attributes.uv1,De=!!C.attributes.uv2,Ue=!!C.attributes.uv3;return{isWebGL2:m,shaderID:B,shaderType:a.type,shaderName:a.name,vertexShader:O,fragmentShader:G,defines:a.defines,customVertexShaderID:W,customFragmentShaderID:q,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:v,instancing:Y,instancingColor:Y&&null!==_.instanceColor,supportsVertexTextures:f,outputColorSpace:null===j?e.outputColorSpace:!0===j.isXRRenderTarget?j.texture.colorSpace:be,map:K,matcap:$,envMap:J,envMapMode:J&&I.mapping,envMapCubeUVHeight:T,aoMap:ee,lightMap:te,bumpMap:ie,normalMap:ne,displacementMap:f&&re,emissiveMap:se,normalMapObjectSpace:ne&&1===a.normalMapType,normalMapTangentSpace:ne&&0===a.normalMapType,metalnessMap:ae,roughnessMap:oe,anisotropy:le,anisotropyMap:Ae,clearcoat:ce,clearcoatMap:pe,clearcoatNormalMap:me,clearcoatRoughnessMap:ge,iridescence:he,iridescenceMap:fe,iridescenceThicknessMap:ve,sheen:ue,sheenColorMap:Ee,sheenRoughnessMap:ye,specularMap:_e,specularColorMap:xe,specularIntensityMap:Se,transmission:de,transmissionMap:Ce,thicknessMap:Me,gradientMap:Ie,opaque:!1===a.transparent&&1===a.blending,alphaMap:we,alphaTest:Te,alphaHash:Be,combine:a.combine,mapUv:K&&getChannel(a.map.channel),aoMapUv:ee&&getChannel(a.aoMap.channel),lightMapUv:te&&getChannel(a.lightMap.channel),bumpMapUv:ie&&getChannel(a.bumpMap.channel),normalMapUv:ne&&getChannel(a.normalMap.channel),displacementMapUv:re&&getChannel(a.displacementMap.channel),emissiveMapUv:se&&getChannel(a.emissiveMap.channel),metalnessMapUv:ae&&getChannel(a.metalnessMap.channel),roughnessMapUv:oe&&getChannel(a.roughnessMap.channel),anisotropyMapUv:Ae&&getChannel(a.anisotropyMap.channel),clearcoatMapUv:pe&&getChannel(a.clearcoatMap.channel),clearcoatNormalMapUv:me&&getChannel(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ge&&getChannel(a.clearcoatRoughnessMap.channel),iridescenceMapUv:fe&&getChannel(a.iridescenceMap.channel),iridescenceThicknessMapUv:ve&&getChannel(a.iridescenceThicknessMap.channel),sheenColorMapUv:Ee&&getChannel(a.sheenColorMap.channel),sheenRoughnessMapUv:ye&&getChannel(a.sheenRoughnessMap.channel),specularMapUv:_e&&getChannel(a.specularMap.channel),specularColorMapUv:xe&&getChannel(a.specularColorMap.channel),specularIntensityMapUv:Se&&getChannel(a.specularIntensityMap.channel),transmissionMapUv:Ce&&getChannel(a.transmissionMap.channel),thicknessMapUv:Me&&getChannel(a.thicknessMap.channel),alphaMapUv:we&&getChannel(a.alphaMap.channel),vertexTangents:!!C.attributes.tangent&&(ne||le),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!C.attributes.color&&4===C.attributes.color.itemSize,vertexUv1s:Le,vertexUv2s:De,vertexUv3s:Ue,pointsUvs:!0===_.isPoints&&!!C.attributes.uv&&(K||we),fog:!!x,useFog:!0===a.fog,fogExp2:x&&x.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:g,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==C.morphAttributes.position,morphNormals:void 0!==C.morphAttributes.normal,morphColors:void 0!==C.morphAttributes.color,morphTargetsCount:F,morphTextureStride:X,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numSpotLightMaps:h.spotLightMap.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numSpotLightShadowsWithMaps:h.numSpotLightShadowsWithMaps,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&A.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:p,useLegacyLights:e.useLegacyLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===l,flipSided:a.side===o,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:Re&&!0===a.extensions.derivatives,extensionFragDepth:Re&&!0===a.extensions.fragDepth,extensionDrawBuffers:Re&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:Re&&!0===a.extensions.shaderTextureLOD,rendererExtensionFragDepth:m||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:m||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:m||n.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function getProgramCacheKey(t){const i=[];if(t.shaderID?i.push(t.shaderID):(i.push(t.customVertexShaderID),i.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)i.push(e),i.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function getProgramCacheKeyParameters(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(i,t),function getProgramCacheKeyBooleans(e,t){h.disableAll(),t.isWebGL2&&h.enable(0);t.supportsVertexTextures&&h.enable(1);t.instancing&&h.enable(2);t.instancingColor&&h.enable(3);t.matcap&&h.enable(4);t.envMap&&h.enable(5);t.normalMapObjectSpace&&h.enable(6);t.normalMapTangentSpace&&h.enable(7);t.clearcoat&&h.enable(8);t.iridescence&&h.enable(9);t.alphaTest&&h.enable(10);t.vertexColors&&h.enable(11);t.vertexAlphas&&h.enable(12);t.vertexUv1s&&h.enable(13);t.vertexUv2s&&h.enable(14);t.vertexUv3s&&h.enable(15);t.vertexTangents&&h.enable(16);t.anisotropy&&h.enable(17);e.push(h.mask),h.disableAll(),t.fog&&h.enable(0);t.useFog&&h.enable(1);t.flatShading&&h.enable(2);t.logarithmicDepthBuffer&&h.enable(3);t.skinning&&h.enable(4);t.morphTargets&&h.enable(5);t.morphNormals&&h.enable(6);t.morphColors&&h.enable(7);t.premultipliedAlpha&&h.enable(8);t.shadowMapEnabled&&h.enable(9);t.useLegacyLights&&h.enable(10);t.doubleSided&&h.enable(11);t.flipSided&&h.enable(12);t.useDepthPacking&&h.enable(13);t.dithering&&h.enable(14);t.transmission&&h.enable(15);t.sheen&&h.enable(16);t.opaque&&h.enable(17);t.pointsUvs&&h.enable(18);e.push(h.mask)}(i,t),i.push(e.outputColorSpace)),i.push(t.customProgramCacheKey),i.join()},getUniforms:function getUniforms(e){const t=E[e.type];let i;if(t){const e=Wi[t];i=Fi.clone(e.uniforms)}else i=e.uniforms;return i},acquireProgram:function acquireProgram(t,i){let n;for(let e=0,t=A.length;e0?n.push(h):!0===a.transparent?r.push(h):i.push(h)},unshift:function unshift(e,t,a,o,l,c){const h=getNextRenderItem(e,t,a,o,l,c);a.transmission>0?n.unshift(h):!0===a.transparent?r.unshift(h):i.unshift(h)},finish:function finish(){for(let i=t,n=e.length;i1&&i.sort(e||painterSortStable),n.length>1&&n.sort(t||reversePainterSortStable),r.length>1&&r.sort(t||reversePainterSortStable)}}}function WebGLRenderLists(){let e=new WeakMap;return{get:function get(t,i){const n=e.get(t);let r;return void 0===n?(r=new WebGLRenderList,e.set(t,[r])):i>=n.length?(r=new WebGLRenderList,n.push(r)):r=n[i],r},dispose:function dispose(){e=new WeakMap}}}function UniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Vector3,color:new Color};break;case"SpotLight":i={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":i={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=i,i}}}let vn=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function WebGLLights(e,t){const i=new UniformsCache,n=function ShadowUniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let e=0;e<9;e++)r.probe.push(new Vector3);const a=new Vector3,o=new Matrix4,l=new Matrix4;return{setup:function setup(a,o){let l=0,c=0,h=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let d=0,A=0,p=0,m=0,g=0,f=0,v=0,E=0,y=0,_=0;a.sort(shadowCastingAndTexturingLightsFirst);const x=!0===o?Math.PI:1;for(let e=0,t=a.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=zi.LTC_FLOAT_1,r.rectAreaLTC2=zi.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=zi.LTC_HALF_1,r.rectAreaLTC2=zi.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=l,r.ambient[1]=c,r.ambient[2]=h;const S=r.hash;S.directionalLength===d&&S.pointLength===A&&S.spotLength===p&&S.rectAreaLength===m&&S.hemiLength===g&&S.numDirectionalShadows===f&&S.numPointShadows===v&&S.numSpotShadows===E&&S.numSpotMaps===y||(r.directional.length=d,r.spot.length=p,r.rectArea.length=m,r.point.length=A,r.hemi.length=g,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=v,r.pointShadowMap.length=v,r.spotShadow.length=E,r.spotShadowMap.length=E,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=v,r.spotLightMatrix.length=E+y-_,r.spotLightMap.length=y,r.numSpotLightShadowsWithMaps=_,S.directionalLength=d,S.pointLength=A,S.spotLength=p,S.rectAreaLength=m,S.hemiLength=g,S.numDirectionalShadows=f,S.numPointShadows=v,S.numSpotShadows=E,S.numSpotMaps=y,r.version=vn++)},setupView:function setupView(e,t){let i=0,n=0,c=0,h=0,d=0;const A=t.matrixWorldInverse;for(let t=0,p=e.length;t=a.length?(o=new WebGLRenderState(e,t),a.push(o)):o=a[r],o},dispose:function dispose(){i=new WeakMap}}}class MeshDepthMaterial extends Material$1{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material$1{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function WebGLShadowMap(e,t,n){let c=new Frustum;const h=new Vector2,d=new Vector2,A=new Vector4,p=new MeshDepthMaterial({depthPacking:3201}),m=new MeshDistanceMaterial,g={},f=n.maxTextureSize,v={[a]:o,[o]:a,[l]:l},E=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=E.clone();y.defines.HORIZONTAL_PASS=1;const _=new BufferGeometry;_.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Mesh(_,E),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i;let C=this.type;function VSMPass(i,n){const r=t.update(x);E.defines.VSM_SAMPLES!==i.blurSamples&&(E.defines.VSM_SAMPLES=i.blurSamples,y.defines.VSM_SAMPLES=i.blurSamples,E.needsUpdate=!0,y.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new WebGLRenderTarget(h.x,h.y)),E.uniforms.shadow_pass.value=i.map.texture,E.uniforms.resolution.value=i.mapSize,E.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(n,null,r,E,x,null),y.uniforms.shadow_pass.value=i.mapPass.texture,y.uniforms.resolution.value=i.mapSize,y.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(n,null,r,y,x,null)}function getDepthMaterial(t,i,n,a){let o=null;const l=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==l)o=l;else if(o=!0===n.isPointLight?m:p,e.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){const e=o.uuid,t=i.uuid;let n=g[e];void 0===n&&(n={},g[e]=n);let r=n[t];void 0===r&&(r=o.clone(),n[t]=r),o=r}if(o.visible=i.visible,o.wireframe=i.wireframe,o.side=a===r?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:v[i.side],o.alphaMap=i.alphaMap,o.alphaTest=i.alphaTest,o.map=i.map,o.clipShadows=i.clipShadows,o.clippingPlanes=i.clippingPlanes,o.clipIntersection=i.clipIntersection,o.displacementMap=i.displacementMap,o.displacementScale=i.displacementScale,o.displacementBias=i.displacementBias,o.wireframeLinewidth=i.wireframeLinewidth,o.linewidth=i.linewidth,!0===n.isPointLight&&!0===o.isMeshDistanceMaterial){e.properties.get(o).light=n}return o}function renderObject(i,n,a,o,l){if(!1===i.visible)return;if(i.layers.test(n.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&l===r)&&(!i.frustumCulled||c.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,i.matrixWorld);const n=t.update(i),r=i.material;if(Array.isArray(r)){const t=n.groups;for(let c=0,h=t.length;cf||h.y>f)&&(h.x>f&&(d.x=Math.floor(f/v.x),h.x=d.x*v.x,l.mapSize.x=d.x),h.y>f&&(d.y=Math.floor(f/v.y),h.y=d.y*v.y,l.mapSize.y=d.y)),null===l.map||!0===m||!0===g){const e=this.type!==r?{minFilter:T,magFilter:T}:{};null!==l.map&&l.map.dispose(),l.map=new WebGLRenderTarget(h.x,h.y,e),l.map.texture.name=o.name+".shadowMap",l.camera.updateProjectionMatrix()}e.setRenderTarget(l.map),e.clear();const E=l.getViewportCount();for(let e=0;e=1):-1!==j.indexOf("OpenGL ES")&&(X=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),q=X>=2);let Y=null,K={};const $=e.getParameter(e.SCISSOR_BOX),J=e.getParameter(e.VIEWPORT),ee=(new Vector4).fromArray($),te=(new Vector4).fromArray(J);function createTexture(t,i,r,a){const o=new Uint8Array(4),l=e.createTexture();e.bindTexture(t,l),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let l=0;ln||e.height>n)&&(r=n/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?floorPowerOfTwo:Math.floor,a=n(r*e.width),o=n(r*e.height);void 0===f&&(f=createCanvas(a,o));const l=i?createCanvas(a,o):f;l.width=a,l.height=o;return l.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function isPowerOfTwo$1(e){return isPowerOfTwo(e.width)&&isPowerOfTwo(e.height)}function textureNeedsGenerateMipmaps(e,t){return e.generateMipmaps&&t&&e.minFilter!==T&&e.minFilter!==F}function generateMipmap(t){e.generateMipmap(t)}function getInternalFormat(i,n,r,a,o=!1){if(!1===l)return n;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let c=n;return n===e.RED&&(r===e.FLOAT&&(c=e.R32F),r===e.HALF_FLOAT&&(c=e.R16F),r===e.UNSIGNED_BYTE&&(c=e.R8)),n===e.RG&&(r===e.FLOAT&&(c=e.RG32F),r===e.HALF_FLOAT&&(c=e.RG16F),r===e.UNSIGNED_BYTE&&(c=e.RG8)),n===e.RGBA&&(r===e.FLOAT&&(c=e.RGBA32F),r===e.HALF_FLOAT&&(c=e.RGBA16F),r===e.UNSIGNED_BYTE&&(c=a===Me&&!1===o?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(c=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(c=e.RGB5_A1)),c!==e.R16F&&c!==e.R32F&&c!==e.RG16F&&c!==e.RG32F&&c!==e.RGBA16F&&c!==e.RGBA32F||t.get("EXT_color_buffer_float"),c}function getMipLevels(e,t,i){return!0===textureNeedsGenerateMipmaps(e,i)||e.isFramebufferTexture&&e.minFilter!==T&&e.minFilter!==F?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function filterFallback(t){return t===T||t===B||t===U?e.NEAREST:e.LINEAR}function onTextureDispose(e){const t=e.target;t.removeEventListener("dispose",onTextureDispose),function deallocateTexture(e){const t=n.get(e);if(void 0===t.__webglInit)return;const i=e.source,r=v.get(i);if(r){const n=r[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&deleteTexture(e),0===Object.keys(r).length&&v.delete(i)}n.remove(e)}(t),t.isVideoTexture&&g.delete(t)}function onRenderTargetDispose(t){const i=t.target;i.removeEventListener("dispose",onRenderTargetDispose),function deallocateRenderTarget(t){const i=t.texture,r=n.get(t),a=n.get(i);void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),o.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t]);else{if(e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let t=0;t0&&a.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void uploadTexture(a,t,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+r)}const _={[C]:e.REPEAT,[b]:e.CLAMP_TO_EDGE,[I]:e.MIRRORED_REPEAT},x={[T]:e.NEAREST,[B]:e.NEAREST_MIPMAP_NEAREST,[U]:e.NEAREST_MIPMAP_LINEAR,[F]:e.LINEAR,[O]:e.LINEAR_MIPMAP_NEAREST,[G]:e.LINEAR_MIPMAP_LINEAR},S={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function setTextureParameters(i,a,o){if(o?(e.texParameteri(i,e.TEXTURE_WRAP_S,_[a.wrapS]),e.texParameteri(i,e.TEXTURE_WRAP_T,_[a.wrapT]),i!==e.TEXTURE_3D&&i!==e.TEXTURE_2D_ARRAY||e.texParameteri(i,e.TEXTURE_WRAP_R,_[a.wrapR]),e.texParameteri(i,e.TEXTURE_MAG_FILTER,x[a.magFilter]),e.texParameteri(i,e.TEXTURE_MIN_FILTER,x[a.minFilter])):(e.texParameteri(i,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(i,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i!==e.TEXTURE_3D&&i!==e.TEXTURE_2D_ARRAY||e.texParameteri(i,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),a.wrapS===b&&a.wrapT===b||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,e.TEXTURE_MAG_FILTER,filterFallback(a.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,filterFallback(a.minFilter)),a.minFilter!==T&&a.minFilter!==F&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),a.compareFunction&&(e.texParameteri(i,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(i,e.TEXTURE_COMPARE_FUNC,S[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){const o=t.get("EXT_texture_filter_anisotropic");if(a.magFilter===T)return;if(a.minFilter!==U&&a.minFilter!==G)return;if(a.type===Y&&!1===t.has("OES_texture_float_linear"))return;if(!1===l&&a.type===K&&!1===t.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function initTexture(t,i){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",onTextureDispose));const r=i.source;let a=v.get(r);void 0===a&&(a={},v.set(r,a));const l=function getTextureCacheKey(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(i);if(l!==t.__cacheKey){void 0===a[l]&&(a[l]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),a[l].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&deleteTexture(i)),t.__cacheKey=l,t.__webglTexture=a[l].texture}return n}function uploadTexture(t,r,o){let c=e.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),r.isData3DTexture&&(c=e.TEXTURE_3D);const h=initTexture(t,r),A=r.source;i.bindTexture(c,t.__webglTexture,e.TEXTURE0+o);const p=n.get(A);if(A.version!==p.__version||!0===h){i.activeTexture(e.TEXTURE0+o),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=function textureNeedsPowerOfTwo(e){return!l&&(e.wrapS!==b||e.wrapT!==b||e.minFilter!==T&&e.minFilter!==F)}(r)&&!1===isPowerOfTwo$1(r.image);let n=resizeImage(r.image,t,!1,d);n=verifyColorSpace(r,n);const m=isPowerOfTwo$1(n)||l,g=a.convert(r.format,r.colorSpace);let f,v=a.convert(r.type),E=getInternalFormat(r.internalFormat,g,v,r.colorSpace);setTextureParameters(c,r,m);const y=r.mipmaps,_=l&&!0!==r.isVideoTexture,x=void 0===p.__version||!0===h,S=getMipLevels(r,n,m);if(r.isDepthTexture)E=e.DEPTH_COMPONENT,l?E=r.type===Y?e.DEPTH_COMPONENT32F:r.type===j?e.DEPTH_COMPONENT24:r.type===$?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:r.type===Y&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===ee&&E===e.DEPTH_COMPONENT&&r.type!==q&&r.type!==j&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=j,v=a.convert(r.type)),r.format===te&&E===e.DEPTH_COMPONENT&&(E=e.DEPTH_STENCIL,r.type!==$&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=$,v=a.convert(r.type))),x&&(_?i.texStorage2D(e.TEXTURE_2D,1,E,n.width,n.height):i.texImage2D(e.TEXTURE_2D,0,E,n.width,n.height,0,g,v,null));else if(r.isDataTexture)if(y.length>0&&m){_&&x&&i.texStorage2D(e.TEXTURE_2D,S,E,y[0].width,y[0].height);for(let t=0,n=y.length;t>=1,r>>=1}}else if(y.length>0&&m){_&&x&&i.texStorage2D(e.TEXTURE_2D,S,E,y[0].width,y[0].height);for(let t=0,n=y.length;t=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,n.get(o).__webglTexture,0),i.bindFramebuffer(e.FRAMEBUFFER,null)}function setupRenderBufferStorage(t,i,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),i.depthBuffer&&!i.stencilBuffer){let r=e.DEPTH_COMPONENT16;if(n||useMultisampledRTT(i)){const t=i.depthTexture;t&&t.isDepthTexture&&(t.type===Y?r=e.DEPTH_COMPONENT32F:t.type===j&&(r=e.DEPTH_COMPONENT24));const n=getRenderTargetSamples(i);useMultisampledRTT(i)?p.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,n,r,i.width,i.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,n,r,i.width,i.height)}else e.renderbufferStorage(e.RENDERBUFFER,r,i.width,i.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(i.depthBuffer&&i.stencilBuffer){const r=getRenderTargetSamples(i);n&&!1===useMultisampledRTT(i)?e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,i.width,i.height):useMultisampledRTT(i)?p.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,i.width,i.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function verifyColorSpace(e,i){const n=e.colorSpace,r=e.format,a=e.type;return!0===e.isCompressedTexture||e.format===Re||n!==be&&n!==Ce&&(n===Me?!1===l?!0===t.has("EXT_sRGB")&&r===J?(e.format=Re,e.minFilter=F,e.generateMipmaps=!1):i=ImageUtils.sRGBToLinear(i):r===J&&a===W||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),i}this.allocateTextureUnit=function allocateTextureUnit(){const e=y;return e>=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),y+=1,e},this.resetTextureUnits=function resetTextureUnits(){y=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function setTexture2DArray(t,r){const a=n.get(t);t.version>0&&a.__version!==t.version?uploadTexture(a,t,r):i.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r)},this.setTexture3D=function setTexture3D(t,r){const a=n.get(t);t.version>0&&a.__version!==t.version?uploadTexture(a,t,r):i.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function setTextureCube(t,r){const o=n.get(t);t.version>0&&o.__version!==t.version?function uploadCubeTexture(t,r,o){if(6!==r.image.length)return;const c=initTexture(t,r),d=r.source;i.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);const A=n.get(d);if(d.version!==A.__version||!0===c){i.activeTexture(e.TEXTURE0+o),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=r.isCompressedTexture||r.image[0].isCompressedTexture,n=r.image[0]&&r.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=t||n?n?r.image[e].image:r.image[e]:resizeImage(r.image[e],!1,!0,h),p[e]=verifyColorSpace(r,p[e]);const m=p[0],g=isPowerOfTwo$1(m)||l,f=a.convert(r.format,r.colorSpace),v=a.convert(r.type),E=getInternalFormat(r.internalFormat,f,v,r.colorSpace),y=l&&!0!==r.isVideoTexture,_=void 0===A.__version||!0===c;let x,S=getMipLevels(r,m,g);if(setTextureParameters(e.TEXTURE_CUBE_MAP,r,g),t){y&&_&&i.texStorage2D(e.TEXTURE_CUBE_MAP,S,E,m.width,m.height);for(let t=0;t<6;t++){x=p[t].mipmaps;for(let n=0;n0&&S++,i.texStorage2D(e.TEXTURE_CUBE_MAP,S,E,p[0].width,p[0].height));for(let t=0;t<6;t++)if(n){y?i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,f,v,p[t].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,E,p[t].width,p[t].height,0,f,v,p[t].data);for(let n=0;n0&&!1===useMultisampledRTT(t)){const n=p?c:[c];h.__webglMultisampledFramebuffer=e.createFramebuffer(),h.__webglColorRenderbuffer=[],i.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer);for(let i=0;i0&&!1===useMultisampledRTT(t)){const r=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],a=t.width,o=t.height;let l=e.COLOR_BUFFER_BIT;const c=[],h=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,d=n.get(t),A=!0===t.isWebGLMultipleRenderTargets;if(A)for(let t=0;tl+h?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=l-h&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),null!==r&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));null!==o&&(n=t.getPose(e.targetRaySpace,i),null===n&&null!==r&&(n=r),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(En)))}return null!==o&&(o.visible=null!==n),null!==l&&(l.visible=null!==r),null!==c&&(c.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const i=new Group;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class DepthTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h){if((h=void 0!==h?h:ee)!==ee&&h!==te)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===ee&&(i=j),void 0===i&&h===te&&(i=$),super(null,n,r,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:T,this.minFilter=void 0!==l?l:T,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const i=this;let n=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,d=null,A=null,p=null,m=null;const g=t.getContextAttributes();let f=null,v=null;const E=[],y=[],_=new PerspectiveCamera;_.layers.enable(1),_.viewport=new Vector4;const x=new PerspectiveCamera;x.layers.enable(2),x.viewport=new Vector4;const S=[_,x],C=new ArrayCamera;C.layers.enable(1),C.layers.enable(2);let b=null,I=null;function onSessionEvent(e){const t=y.indexOf(e.inputSource);if(-1===t)return;const i=E[t];void 0!==i&&(i.update(e.inputSource,e.frame,c||a),i.dispatchEvent({type:e.type,data:e.inputSource}))}function onSessionEnd(){n.removeEventListener("select",onSessionEvent),n.removeEventListener("selectstart",onSessionEvent),n.removeEventListener("selectend",onSessionEvent),n.removeEventListener("squeeze",onSessionEvent),n.removeEventListener("squeezestart",onSessionEvent),n.removeEventListener("squeezeend",onSessionEvent),n.removeEventListener("end",onSessionEnd),n.removeEventListener("inputsourceschange",onInputSourcesChange);for(let e=0;e=0&&(y[n]=null,E[n].disconnect(i))}for(let t=0;t=y.length){y.push(i),n=e;break}if(null===y[e]){y[e]=i,n=e;break}}if(-1===n)break}const r=E[n];r&&r.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=E[e];return void 0===t&&(t=new WebXRController,E[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=E[e];return void 0===t&&(t=new WebXRController,E[e]=t),t.getGripSpace()},this.getHand=function(e){let t=E[e];return void 0===t&&(t=new WebXRController,E[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return null!==A?A:p},this.getBinding=function(){return d},this.getFrame=function(){return m},this.getSession=function(){return n},this.setSession=async function(h){if(n=h,null!==n){if(f=e.getRenderTarget(),n.addEventListener("select",onSessionEvent),n.addEventListener("selectstart",onSessionEvent),n.addEventListener("selectend",onSessionEvent),n.addEventListener("squeeze",onSessionEvent),n.addEventListener("squeezestart",onSessionEvent),n.addEventListener("squeezeend",onSessionEvent),n.addEventListener("end",onSessionEnd),n.addEventListener("inputsourceschange",onInputSourcesChange),!0!==g.xrCompatible&&await t.makeXRCompatible(),void 0===n.renderState.layers||!1===e.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};p=new XRWebGLLayer(n,t,i),n.updateRenderState({baseLayer:p}),v=new WebGLRenderTarget(p.framebufferWidth,p.framebufferHeight,{format:J,type:W,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil})}else{let i=null,a=null,o=null;g.depth&&(o=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,i=g.stencil?te:ee,a=g.stencil?$:j);const l={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:r};d=new XRWebGLBinding(n,t),A=d.createProjectionLayer(l),n.updateRenderState({layers:[A]}),v=new WebGLRenderTarget(A.textureWidth,A.textureHeight,{format:J,type:W,depthTexture:new DepthTexture(A.textureWidth,A.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0});e.properties.get(v).__ignoreDepthValues=A.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await n.requestReferenceSpace(o),F.setContext(n),F.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode};const T=new Vector3,B=new Vector3;function updateCamera(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;C.near=x.near=_.near=e.near,C.far=x.far=_.far=e.far,b===C.near&&I===C.far||(n.updateRenderState({depthNear:C.near,depthFar:C.far}),b=C.near,I=C.far);const t=e.parent,i=C.cameras;updateCamera(C,t);for(let e=0;e0&&(i.alphaTest.value=n.alphaTest);const r=t.get(n).envMap;if(r&&(i.envMap.value=r,i.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const t=!0===e.useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*t,refreshTransformUniform(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,refreshTransformUniform(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function refreshFogUniforms(t,i){i.color.getRGB(t.fogColor.value,getUnlitUniformColorSpace(e)),i.isFog?(t.fogNear.value=i.near,t.fogFar.value=i.far):i.isFogExp2&&(t.fogDensity.value=i.density)},refreshMaterialUniforms:function refreshMaterialUniforms(e,i,n,r,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?refreshUniformsCommon(e,i):i.isMeshToonMaterial?(refreshUniformsCommon(e,i),function refreshUniformsToon(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(refreshUniformsCommon(e,i),function refreshUniformsPhong(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(refreshUniformsCommon(e,i),function refreshUniformsStandard(e,i){e.metalness.value=i.metalness,i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap,refreshTransformUniform(i.metalnessMap,e.metalnessMapTransform));e.roughness.value=i.roughness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap,refreshTransformUniform(i.roughnessMap,e.roughnessMapTransform));const n=t.get(i).envMap;n&&(e.envMapIntensity.value=i.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function refreshUniformsPhysical(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,refreshTransformUniform(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,refreshTransformUniform(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,refreshTransformUniform(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,refreshTransformUniform(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,refreshTransformUniform(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===o&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,refreshTransformUniform(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,refreshTransformUniform(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=i.texture,e.transmissionSamplerSize.value.set(i.width,i.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,refreshTransformUniform(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,refreshTransformUniform(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,refreshTransformUniform(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,refreshTransformUniform(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,refreshTransformUniform(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,a)):i.isMeshMatcapMaterial?(refreshUniformsCommon(e,i),function refreshUniformsMatcap(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?refreshUniformsCommon(e,i):i.isMeshDistanceMaterial?(refreshUniformsCommon(e,i),function refreshUniformsDistance(e,i){const n=t.get(i).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?refreshUniformsCommon(e,i):i.isLineBasicMaterial?(!function refreshUniformsLine(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function refreshUniformsDash(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function refreshUniformsPoints(e,t,i,n){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*n,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,n,r):i.isSpriteMaterial?function refreshUniformsSprites(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,refreshTransformUniform(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,refreshTransformUniform(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(e,t,i,n){let r={},a={},o=[];const l=i.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function hasUniformChanged(e,t,i){const n=e.value;if(void 0===i[t]){if("number"==typeof n)i[t]=n;else{const e=Array.isArray(n)?n:[n],r=[];for(let t=0;t0){r=i%n;0!==r&&n-r-o.boundary<0&&(i+=n-r,a.__offset=i)}i+=o.storage}r=i%n,r>0&&(i+=n-r);return e.__size=i,e.__cache={},this}(i),h=function createBuffer(t){const i=function allocateBindingPointIndex(){for(let e=0;e0),A=!!i.morphAttributes.position,m=!!i.morphAttributes.normal,g=!!i.morphAttributes.color,f=n.toneMapped?b.toneMapping:p,v=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,E=void 0!==v?v.length:0,y=Ce.get(n),_=x.state.lights;if(!0===Ae&&(!0===pe||e!==O)){const t=e===O&&n.id===F;Ne.setState(n,e,t)}let S=!1;n.version===y.__version?y.needsLights&&y.lightsStateVersion!==_.state.version||y.outputColorSpace!==l||r.isInstancedMesh&&!1===y.instancing?S=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?S=!0:r.isSkinnedMesh||!0!==y.skinning?y.envMap!==c||!0===n.fog&&y.fog!==a?S=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===Ne.numPlanes&&y.numIntersection===Ne.numIntersection?(y.vertexAlphas!==h||y.vertexTangents!==d||y.morphTargets!==A||y.morphNormals!==m||y.morphColors!==g||y.toneMapping!==f||!0===_e.isWebGL2&&y.morphTargetsCount!==E)&&(S=!0):S=!0:S=!0:S=!0:(S=!0,y.__version=n.version);let C=y.currentProgram;!0===S&&(C=getProgram(n,t,r));let I=!1,T=!1,B=!1;const G=C.getUniforms(),W=y.uniforms;xe.useProgram(C.program)&&(I=!0,T=!0,B=!0);n.id!==F&&(F=n.id,T=!0);if(I||O!==e){if(G.setValue(qe,"projectionMatrix",e.projectionMatrix),_e.logarithmicDepthBuffer&&G.setValue(qe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),O!==e&&(O=e,T=!0,B=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=G.map.cameraPosition;void 0!==t&&t.setValue(qe,ve.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&G.setValue(qe,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&G.setValue(qe,"viewMatrix",e.matrixWorldInverse)}if(r.isSkinnedMesh){G.setOptional(qe,r,"bindMatrix"),G.setOptional(qe,r,"bindMatrixInverse");const e=r.skeleton;e&&(_e.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),G.setValue(qe,"boneTexture",e.boneTexture,Ie),G.setValue(qe,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const q=i.morphAttributes;(void 0!==q.position||void 0!==q.normal||void 0!==q.color&&!0===_e.isWebGL2)&&ke.update(r,i,C);(T||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,G.setValue(qe,"receiveShadow",r.receiveShadow));n.isMeshGouraudMaterial&&null!==n.envMap&&(W.envMap.value=c,W.flipEnvMap.value=c.isCubeTexture&&!1===c.isRenderTargetTexture?-1:1);T&&(G.setValue(qe,"toneMappingExposure",b.toneMappingExposure),y.needsLights&&function markUniformsLightsNeedsUpdate(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(W,B),a&&!0===n.fog&&Ue.refreshFogUniforms(W,a),Ue.refreshMaterialUniforms(W,n,ae,se,me),WebGLUniforms.upload(qe,y.uniformsList,W,Ie));n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(WebGLUniforms.upload(qe,y.uniformsList,W,Ie),n.uniformsNeedUpdate=!1);n.isSpriteMaterial&&G.setValue(qe,"center",r.center);if(G.setValue(qe,"modelViewMatrix",r.modelViewMatrix),G.setValue(qe,"normalMatrix",r.normalMatrix),G.setValue(qe,"modelMatrix",r.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const e=n.uniformsGroups;for(let t=0,i=e.length;t0&&function renderTransmissionPass(e,t,i,n){const r=_e.isWebGL2;null===me&&(me=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:ye.has("EXT_color_buffer_half_float")?K:W,minFilter:G,samples:r?4:0}));b.getDrawingBufferSize(fe),r?me.setSize(fe.x,fe.y):me.setSize(floorPowerOfTwo(fe.x),floorPowerOfTwo(fe.y));const a=b.getRenderTarget();b.setRenderTarget(me),b.getClearColor(ie),ne=b.getClearAlpha(),ne<1&&b.setClearColor(16777215,.5);b.clear();const c=b.toneMapping;b.toneMapping=p,renderObjects(e,i,n),Ie.updateMultisampleRenderTarget(me),Ie.updateRenderTargetMipmap(me);let h=!1;for(let e=0,r=t.length;e0&&renderObjects(r,t,i),a.length>0&&renderObjects(a,t,i),c.length>0&&renderObjects(c,t,i),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function renderObjects(e,t,i){const n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r0?C[C.length-1]:null,S.pop(),_=S.length>0?S[S.length-1]:null},this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return U},this.setRenderTargetTextures=function(e,t,i){Ce.get(e.texture).__webglTexture=t,Ce.get(e.depthTexture).__webglTexture=i;const n=Ce.get(e);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===ye.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const i=Ce.get(e);i.__webglFramebuffer=t,i.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,i=0){U=e,T=t,B=i;let n=!0,r=null,a=!1,o=!1;if(e){const i=Ce.get(e);void 0!==i.__useDefaultFramebuffer?(xe.bindFramebuffer(qe.FRAMEBUFFER,null),n=!1):void 0===i.__webglFramebuffer?Ie.setupRenderTarget(e):i.__hasExternalTextures&&Ie.rebindTextures(e,Ce.get(e.texture).__webglTexture,Ce.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Ce.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=c[t],a=!0):r=_e.isWebGL2&&e.samples>0&&!1===Ie.useMultisampledRTT(e)?Ce.get(e).__webglMultisampledFramebuffer:c,X.copy(e.viewport),ee.copy(e.scissor),te=e.scissorTest}else X.copy(ce).multiplyScalar(ae).floor(),ee.copy(he).multiplyScalar(ae).floor(),te=ue;if(xe.bindFramebuffer(qe.FRAMEBUFFER,r)&&_e.drawBuffers&&n&&xe.drawBuffers(e,r),xe.viewport(X),xe.scissor(ee),xe.setScissorTest(te),a){const n=Ce.get(e.texture);qe.framebufferTexture2D(qe.FRAMEBUFFER,qe.COLOR_ATTACHMENT0,qe.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,i)}else if(o){const n=Ce.get(e.texture),r=t||0;qe.framebufferTextureLayer(qe.FRAMEBUFFER,qe.COLOR_ATTACHMENT0,n.__webglTexture,i||0,r)}F=-1},this.readRenderTargetPixels=function(e,t,i,n,r,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=Ce.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(l=l[o]),l){xe.bindFramebuffer(qe.FRAMEBUFFER,l);try{const o=e.texture,l=o.format,c=o.type;if(l!==J&&He.convert(l)!==qe.getParameter(qe.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===K&&(ye.has("EXT_color_buffer_half_float")||_e.isWebGL2&&ye.has("EXT_color_buffer_float"));if(!(c===W||He.convert(c)===qe.getParameter(qe.IMPLEMENTATION_COLOR_READ_TYPE)||c===Y&&(_e.isWebGL2||ye.has("OES_texture_float")||ye.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&qe.readPixels(t,i,n,r,He.convert(l),He.convert(c),a)}finally{const e=null!==U?Ce.get(U).__webglFramebuffer:null;xe.bindFramebuffer(qe.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,i=0){const n=Math.pow(2,-i),r=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n);Ie.setTexture2D(t,0),qe.copyTexSubImage2D(qe.TEXTURE_2D,i,0,0,e.x,e.y,r,a),xe.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){const r=t.image.width,a=t.image.height,o=He.convert(i.format),l=He.convert(i.type);Ie.setTexture2D(i,0),qe.pixelStorei(qe.UNPACK_FLIP_Y_WEBGL,i.flipY),qe.pixelStorei(qe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),qe.pixelStorei(qe.UNPACK_ALIGNMENT,i.unpackAlignment),t.isDataTexture?qe.texSubImage2D(qe.TEXTURE_2D,n,e.x,e.y,r,a,o,l,t.image.data):t.isCompressedTexture?qe.compressedTexSubImage2D(qe.TEXTURE_2D,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):qe.texSubImage2D(qe.TEXTURE_2D,n,e.x,e.y,o,l,t.image),0===n&&i.generateMipmaps&&qe.generateMipmap(qe.TEXTURE_2D),xe.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,n,r=0){if(b.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,c=He.convert(n.format),h=He.convert(n.type);let d;if(n.isData3DTexture)Ie.setTexture3D(n,0),d=qe.TEXTURE_3D;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Ie.setTexture2DArray(n,0),d=qe.TEXTURE_2D_ARRAY}qe.pixelStorei(qe.UNPACK_FLIP_Y_WEBGL,n.flipY),qe.pixelStorei(qe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),qe.pixelStorei(qe.UNPACK_ALIGNMENT,n.unpackAlignment);const A=qe.getParameter(qe.UNPACK_ROW_LENGTH),p=qe.getParameter(qe.UNPACK_IMAGE_HEIGHT),m=qe.getParameter(qe.UNPACK_SKIP_PIXELS),g=qe.getParameter(qe.UNPACK_SKIP_ROWS),f=qe.getParameter(qe.UNPACK_SKIP_IMAGES),v=i.isCompressedTexture?i.mipmaps[0]:i.image;qe.pixelStorei(qe.UNPACK_ROW_LENGTH,v.width),qe.pixelStorei(qe.UNPACK_IMAGE_HEIGHT,v.height),qe.pixelStorei(qe.UNPACK_SKIP_PIXELS,e.min.x),qe.pixelStorei(qe.UNPACK_SKIP_ROWS,e.min.y),qe.pixelStorei(qe.UNPACK_SKIP_IMAGES,e.min.z),i.isDataTexture||i.isData3DTexture?qe.texSubImage3D(d,r,t.x,t.y,t.z,a,o,l,c,h,v.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),qe.compressedTexSubImage3D(d,r,t.x,t.y,t.z,a,o,l,c,v.data)):qe.texSubImage3D(d,r,t.x,t.y,t.z,a,o,l,c,h,v),qe.pixelStorei(qe.UNPACK_ROW_LENGTH,A),qe.pixelStorei(qe.UNPACK_IMAGE_HEIGHT,p),qe.pixelStorei(qe.UNPACK_SKIP_PIXELS,m),qe.pixelStorei(qe.UNPACK_SKIP_ROWS,g),qe.pixelStorei(qe.UNPACK_SKIP_IMAGES,f),0===r&&n.generateMipmaps&&qe.generateMipmap(d),xe.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Ie.setTextureCube(e,0):e.isData3DTexture?Ie.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Ie.setTexture2DArray(e,0):Ie.setTexture2D(e,0),xe.unbindTexture()},this.resetState=function(){T=0,B=0,U=null,xe.reset(),ze.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Le}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Me?Se:3e3}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Se?Me:be}}(class WebGL1Renderer extends WebGLRenderer{}).prototype.isWebGL1Renderer=!0;class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class InterleavedBuffer{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Te,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;nl)continue;A.applyMatrix4(this.matrixWorld);const a=e.ray.origin.distanceTo(A);ae.far||t.push({distance:a,point:d.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,a.start),n=Math.min(g.count,a.start+a.count)-1;il)continue;A.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(A);ne.far||t.push({distance:n,point:d.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;er.far)return;a.push({distance:c,distanceToRay:Math.sqrt(l),point:i,index:t,face:null,object:o})}}class VideoTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:F,this.magFilter=void 0!==r?r:F,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function updateVideo(){h.needsUpdate=!0,e.requestVideoFrameCallback(updateVideo)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class CompressedTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c,h,d,A){super(null,a,o,l,c,h,n,r,d,A),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(e,t,i,n,r,a){super(e,t,i,r,a),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=b}}class CanvasTexture extends Texture$1{constructor(e,t,i,n,r,a,o,l,c){super(e,t,i,n,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class MeshStandardMaterial extends Material$1{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MeshPhysicalMaterial extends MeshStandardMaterial{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return clamp$1(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Color(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Color(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Color(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function arraySlice(e,t,i){return isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)}function convertArray(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function getKeyframeOrder(e){const t=e.length,i=new Array(t);for(let e=0;e!==t;++e)i[e]=e;return i.sort((function compareTime(t,i){return e[t]-e[i]})),i}function sortedArray(e,t,i){const n=e.length,r=new e.constructor(n);for(let a=0,o=0;o!==n;++a){const n=i[a]*t;for(let i=0;i!==t;++i)r[o++]=e[n+i]}return r}function flattenJSON(e,t,i,n){let r=1,a=e[0];for(;void 0!==a&&void 0===a[n];)a=e[r++];if(void 0===a)return;let o=a[n];if(void 0!==o)if(Array.isArray(o))do{o=a[n],void 0!==o&&(t.push(a.time),i.push.apply(i,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[n],void 0!==o&&(t.push(a.time),o.toArray(i,i.length)),a=e[r++]}while(void 0!==a);else do{o=a[n],void 0!==o&&(t.push(a.time),i.push(o)),a=e[r++]}while(void 0!==a)}class Interpolant{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let a;i:{n:if(!(e=r)break e;{const o=t[1];e=r)break t}a=i,i=0}}for(;i>>1;et;)--a;if(++a,0!==r||a!==n){r>=a&&(a=Math.max(a,1),r=a-1);const e=this.getValueSize();this.times=arraySlice(i,r,a),this.values=arraySlice(this.values,r*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==r;t++){const n=i[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==a&&a>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,a),e=!1;break}a=n}if(void 0!==n&&isTypedArray(n))for(let t=0,i=n.length;t!==i;++t){const i=n[t];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){const e=arraySlice(this.times),t=arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===ve,r=e.length-1;let a=1;for(let o=1;o0){e[a]=e[r];for(let e=r*i,n=a*i,o=0;o!==i;++o)t[n+o]=t[e+o];++a}return a!==e.length?(this.times=arraySlice(e,0,a),this.values=arraySlice(t,0,a*i)):(this.times=e,this.values=t),this}clone(){const e=arraySlice(this.times,0),t=arraySlice(this.values,0),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=fe;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=ge,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-t)/(n-t);let c=e*o;for(let e=c+o;c!==e;c+=4)Quaternion.slerpFlat(r,0,a,c-o,a,c,l);return r}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=fe,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=ge,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(e,t=-1,i,n=2500){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,n=1/(e.fps||1);for(let e=0,r=i.length;e!==r;++e)t.push(parseKeyframeTrack(i[e]).scale(n));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=i.length;e!==n;++e)t.push(KeyframeTrack.toJSON(i[e]));return n}static CreateFromMorphTargetSequence(e,t,i,n){const r=t.length,a=[];for(let e=0;e1){const e=a[1];let t=n[e];t||(n[e]=t=[]),t.push(i)}}const a=[];for(const e in n)a.push(this.CreateFromMorphTargetSequence(e,n[e],t,i));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const addNonemptyTrack=function(e,t,i,n,r){if(0!==i.length){const a=[],o=[];flattenJSON(i,a,o,n),0!==a.length&&r.push(new e(t,a,o))}},i=[],n=e.name||"default",r=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let e=0;e{t&&t(r),this.manager.itemEnd(e)}),0),r;if(void 0!==Jn[e])return void Jn[e].push({onLoad:t,onProgress:i,onError:n});Jn[e]=[],Jn[e].push({onLoad:t,onProgress:i,onError:n});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const i=Jn[e],n=t.body.getReader(),r=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),a=r?parseInt(r):0,o=0!==a;let l=0;const c=new ReadableStream({start(e){!function readData(){n.read().then((({done:t,value:n})=>{if(t)e.close();else{l+=n.byteLength;const t=new ProgressEvent("progress",{lengthComputable:o,loaded:l,total:a});for(let e=0,n=i.length;e{switch(l){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),i=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(i);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{Kn.add(e,t);const i=Jn[e];delete Jn[e];for(let e=0,n=i.length;e{const i=Jn[e];if(void 0===i)throw this.manager.itemError(e),t;delete Jn[e];for(let e=0,n=i.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class ImageLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Kn.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;const o=createElementNS("img");function onImageLoad(){removeEventListeners(),Kn.add(e,this),t&&t(this),r.manager.itemEnd(e)}function onImageError(t){removeEventListeners(),n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}function removeEventListeners(){o.removeEventListener("load",onImageLoad,!1),o.removeEventListener("error",onImageError,!1)}return o.addEventListener("load",onImageLoad,!1),o.addEventListener("error",onImageError,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class DataTextureLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){const r=this,a=new DataTexture,o=new FileLoader(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,(function(e){const i=r.parse(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:b,a.wrapT=void 0!==i.wrapT?i.wrapT:b,a.magFilter=void 0!==i.magFilter?i.magFilter:F,a.minFilter=void 0!==i.minFilter?i.minFilter:F,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.colorSpace?a.colorSpace=i.colorSpace:void 0!==i.encoding&&(a.encoding=i.encoding),void 0!==i.flipY&&(a.flipY=i.flipY),void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps,a.minFilter=G),1===i.mipmapCount&&(a.minFilter=F),void 0!==i.generateMipmaps&&(a.generateMipmaps=i.generateMipmaps),a.needsUpdate=!0,t&&t(a,i))}),i,n),a}}class TextureLoader extends Loader{constructor(e){super(e)}load(e,t,i,n){const r=new Texture$1,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),i,n),r}}class Light extends Object3D{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Color(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}const Zn=new Matrix4,er=new Vector3,tr=new Vector3;class LightShadow{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;er.setFromMatrixPosition(e.matrixWorld),t.position.copy(er),tr.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(tr),t.updateMatrixWorld(),Zn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Zn),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Zn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class SpotLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=2*Ne*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class SpotLight extends Light{constructor(e,t,i=0,n=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.distance=i,this.angle=n,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new SpotLightShadow}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ir=new Matrix4,nr=new Vector3,rr=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),nr.setFromMatrixPosition(e.matrixWorld),i.position.copy(nr),rr.copy(i.position),rr.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(rr),i.updateMatrixWorld(),n.makeTranslation(-nr.x,-nr.y,-nr.z),ir.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ir)}}class PointLight extends Light{constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new PointLightShadow}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Vector3)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*n),t.addScaledVector(a[2],.488603*r),t.addScaledVector(a[3],.488603*i),t.addScaledVector(a[4],i*n*1.092548),t.addScaledVector(a[5],n*r*1.092548),t.addScaledVector(a[6],.315392*(3*r*r-1)),t.addScaledVector(a[7],i*r*1.092548),t.addScaledVector(a[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){const i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*n),t.addScaledVector(a[2],1.023328*r),t.addScaledVector(a[3],1.023328*i),t.addScaledVector(a[4],.858086*i*n),t.addScaledVector(a[5],.858086*n*r),t.addScaledVector(a[6],.743125*r*r-.247708),t.addScaledVector(a[7],.858086*i*r),t.addScaledVector(a[8],.429043*(i*i-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const i=e.x,n=e.y,r=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-n*n)}}class LightProbe extends Light{constructor(e=new SphericalHarmonics3,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class LoaderUtils{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0,n=e.length;i0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(i[e]!==i[e+t]){o.setValue(i,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let e=i,r=n;e!==r;++e)t[e]=t[n+e%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let n=0;n!==r;++n)e[t+n]=e[i+n]}_slerp(e,t,i,n){Quaternion.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){const a=this._workIndex*r;Quaternion.multiplyQuaternionsFlat(e,a,e,t,e,i),Quaternion.slerpFlat(e,t,e,t,e,a,n)}_lerp(e,t,i,n,r){const a=1-n;for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]*a+e[i+o]*n}}_lerpAdditive(e,t,i,n,r){for(let a=0;a!==r;++a){const r=t+a;e[r]=e[r]+e[i+a]*n}}}const sr="\\[\\]\\.:\\/",ar=new RegExp("["+sr+"]","g"),or="[^"+sr+"]",lr="[^"+sr.replace("\\.","")+"]",cr=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",or)+/(WCOD+)?/.source.replace("WCOD",lr)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",or)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",or)+"$"),hr=["material","materials","bones","map"];class PropertyBinding{constructor(e,t,i){this.path=t,this.parsedPath=i||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,i):new PropertyBinding(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(ar,"")}static parseTrackName(e){const t=cr.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=i.nodeName.substring(n+1);-1!==hr.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){const searchNodeSubtree=function(e){for(let i=0;i0){const e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(a),t[i].accumulateAdditive(o);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(a),t[i].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let n=this.time+e,r=this._loopCount;const a=i===me;if(0===e)return-1===r?n:a&&1==(1&r)?t-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){const i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(a&&1==(1&r))return t-n}return n}_setEndings(e,t,i){const n=this._interpolantSettings;i?(n.endingStart=ye,n.endingEnd=ye):(n.endingStart=e?this.zeroSlopeAtStart?ye:Ee:_e,n.endingEnd=t?this.zeroSlopeAtEnd?ye:Ee:_e)}_scheduleFading(e,t,i){const n=this._mixer,r=n.time;let a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,l[0]=t,o[1]=r+e,l[1]=i,this}}const ur=new Float32Array(1);class AnimationMixer extends EventDispatcher{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,a=e._propertyBindings,o=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let h=c[l];void 0===h&&(h={},c[l]=h);for(let e=0;e!==r;++e){const r=n[e],c=r.name;let d=h[c];if(void 0!==d)++d.referenceCount,a[e]=d;else{if(d=a[e],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,l,c));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;d=new PropertyMixer(PropertyBinding.create(i,c,n),r.ValueTypeName,r.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,l,c),a[e]=d}o[e].resultBuffer=d.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==i;++o){t[o]._update(n,e,r,a)}const o=this._bindings,l=this._nActiveBindings;for(let e=0;e!==l;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;ee:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o$3("string"==typeof e?e:e+"",void 0,nr))(t)})(e):e + */;const dr=window,Ar=dr.ShadowRoot&&(void 0===dr.ShadyCSS||dr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pr=Symbol(),mr=new WeakMap;class o$5{constructor(e,t,i){if(this._$cssResult$=!0,i!==pr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Ar&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=mr.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&mr.set(t,e))}return e}toString(){return this.cssText}}const gr=Ar?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o$5("string"==typeof e?e:e+"",void 0,pr))(t)})(e):e /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var ar;const or=window,lr=or.trustedTypes,cr=lr?lr.emptyScript:"",hr=or.reactiveElementPolyfillSupport,ur={toAttribute(e,t){switch(t){case Boolean:e=e?cr:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},a$2=(e,t)=>t!==e&&(t==t||e==e),dr={attribute:!0,type:String,converter:ur,reflect:!1,hasChanged:a$2};class d$1 extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=dr){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||dr}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(sr(e))}else void 0!==e&&t.push(sr(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{ir?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const i=document.createElement("style"),n=tr.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,e.appendChild(i)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=dr){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const a=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:ur).toAttribute(t,i.type);this._$El=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:ur;this._$El=r,this[r]=a.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||a$2)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} + */;var fr;const vr=window,Er=vr.trustedTypes,yr=Er?Er.emptyScript:"",_r=vr.reactiveElementPolyfillSupport,xr={toAttribute(e,t){switch(t){case Boolean:e=e?yr:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},a$3=(e,t)=>t!==e&&(t==t||e==e),Sr={attribute:!0,type:String,converter:xr,reflect:!1,hasChanged:a$3},Cr="finalized";class u$2 extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=Sr){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Sr}static finalize(){if(this.hasOwnProperty(Cr))return!1;this[Cr]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(gr(e))}else void 0!==e&&t.push(gr(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{Ar?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const i=document.createElement("style"),n=dr.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,e.appendChild(i)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=Sr){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const a=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:xr).toAttribute(t,i.type);this._$El=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:xr;this._$El=r,this[r]=a.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||a$3)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var Ar;d$1.finalized=!0,d$1.elementProperties=new Map,d$1.elementStyles=[],d$1.shadowRootOptions={mode:"open"},null==hr||hr({ReactiveElement:d$1}),(null!==(ar=or.reactiveElementVersions)&&void 0!==ar?ar:or.reactiveElementVersions=[]).push("1.6.1");const pr=window,mr=pr.trustedTypes,gr=mr?mr.createPolicy("lit-html",{createHTML:e=>e}):void 0,fr="$lit$",vr=`lit$${(Math.random()+"").slice(9)}$`,yr="?"+vr,xr=`<${yr}>`,Er=document,d=()=>Er.createComment(""),u=e=>null===e||"object"!=typeof e&&"function"!=typeof e,_r=Array.isArray,Cr="[ \t\n\f\r]",Mr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,br=/-->/g,Sr=/>/g,wr=RegExp(`>|${Cr}(?:([^\\s"'>=/]+)(${Cr}*=${Cr}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ir=/'/g,Tr=/"/g,Br=/^(?:script|style|textarea|title)$/i,Lr=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),Rr=Symbol.for("lit-noChange"),Dr=Symbol.for("lit-nothing"),Pr=new WeakMap,Ur=Er.createTreeWalker(Er,129,null,!1),P=(e,t)=>{const i=e.length-1,n=[];let r,a=2===t?"":"",o=Mr;for(let t=0;t"===c[0]?(o=null!=r?r:Mr,h=-1):void 0===c[1]?h=-2:(h=o.lastIndex-c[2].length,l=c[1],o=void 0===c[3]?wr:'"'===c[3]?Tr:Ir):o===Tr||o===Ir?o=wr:o===br||o===Sr?o=Mr:(o=wr,r=void 0);const p=o===wr&&e[t+1].startsWith("/>")?" ":"";a+=o===Mr?i+xr:h>=0?(n.push(l),i.slice(0,h)+fr+i.slice(h)+vr+p):i+vr+(-2===h?(n.push(void 0),t):p)}const l=a+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==gr?gr.createHTML(l):l,n]};class V{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const o=e.length-1,l=this.parts,[c,h]=P(e,t);if(this.el=V.createElement(c,i),Ur.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=Ur.nextNode())&&l.length0){n.textContent=mr?mr.emptyScript:"";for(let i=0;i_r(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Dr&&u(this._$AH)?this._$AA.nextSibling.data=e:this.$(Er.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=V.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.v(i);else{const e=new S(r,this),t=e.u(this.options);e.v(i),this.$(t),this._$AH=e}}_$AC(e){let t=Pr.get(e.strings);return void 0===t&&Pr.set(e.strings,t=new V(e)),t}T(e){_r(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new M(this.k(d()),this.k(d()),this,this.options)):i=t[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Dr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(void 0===r)e=N(this,e,t,0),a=!u(e)||e!==this._$AH&&e!==Rr,a&&(this._$AH=e);else{const n=e;let o,l;for(e=r[0],o=0;o{var n,r;const a=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let o=a._$litPart$;if(void 0===o){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;a._$litPart$=o=new M(t.insertBefore(d(),e),e,void 0,null!=i?i:{})}return o._$AI(e),o}; +var Mr;u$2[Cr]=!0,u$2.elementProperties=new Map,u$2.elementStyles=[],u$2.shadowRootOptions={mode:"open"},null==_r||_r({ReactiveElement:u$2}),(null!==(fr=vr.reactiveElementVersions)&&void 0!==fr?fr:vr.reactiveElementVersions=[]).push("1.6.2");const br=window,Ir=br.trustedTypes,wr=Ir?Ir.createPolicy("lit-html",{createHTML:e=>e}):void 0,Tr="$lit$",Br=`lit$${(Math.random()+"").slice(9)}$`,Rr="?"+Br,Lr=`<${Rr}>`,Dr=document,u$1=()=>Dr.createComment(""),d$1=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Ur=Array.isArray,Pr="[ \t\n\f\r]",Fr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nr=/-->/g,Qr=/>/g,Or=RegExp(`>|${Pr}(?:([^\\s"'>=/]+)(${Pr}*=${Pr}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),kr=/'/g,Gr=/"/g,Vr=/^(?:script|style|textarea|title)$/i,Hr=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),zr=Symbol.for("lit-noChange"),Wr=Symbol.for("lit-nothing"),qr=new WeakMap,Xr=Dr.createTreeWalker(Dr,129,null,!1);function P(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==wr?wr.createHTML(t):t}const V=(e,t)=>{const i=e.length-1,n=[];let r,a=2===t?"":"",o=Fr;for(let t=0;t"===c[0]?(o=null!=r?r:Fr,h=-1):void 0===c[1]?h=-2:(h=o.lastIndex-c[2].length,l=c[1],o=void 0===c[3]?Or:'"'===c[3]?Gr:kr):o===Gr||o===kr?o=Or:o===Nr||o===Qr?o=Fr:(o=Or,r=void 0);const A=o===Or&&e[t+1].startsWith("/>")?" ":"";a+=o===Fr?i+Lr:h>=0?(n.push(l),i.slice(0,h)+Tr+i.slice(h)+Br+A):i+Br+(-2===h?(n.push(void 0),t):A)}return[P(e,a+(e[i]||"")+(2===t?"":"")),n]};class N{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const o=e.length-1,l=this.parts,[c,h]=V(e,t);if(this.el=N.createElement(c,i),Xr.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=Xr.nextNode())&&l.length0){n.textContent=Ir?Ir.emptyScript:"";for(let i=0;iUr(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Wr&&d$1(this._$AH)?this._$AA.nextSibling.data=e:this.$(Dr.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=N.createElement(P(n.h,n.h[0]),this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.v(i);else{const e=new M(r,this),t=e.u(this.options);e.v(i),this.$(t),this._$AH=e}}_$AC(e){let t=qr.get(e.strings);return void 0===t&&qr.set(e.strings,t=new N(e)),t}T(e){Ur(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new R(this.k(u$1()),this.k(u$1()),this,this.options)):i=t[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Wr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(void 0===r)e=S$1(this,e,t,0),a=!d$1(e)||e!==this._$AH&&e!==zr,a&&(this._$AH=e);else{const n=e;let o,l;for(e=r[0],o=0;o{var n,r;const a=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let o=a._$litPart$;if(void 0===o){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;a._$litPart$=o=new R(t.insertBefore(u$1(),e),e,void 0,null!=i?i:{})}return o._$AI(e),o},Kr=window,$r=Kr.ShadowRoot&&(void 0===Kr.ShadyCSS||Kr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Jr=Symbol(),Zr=new WeakMap; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class o$2{constructor(e,t,i){if(this._$cssResult$=!0,i!==Jr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($r&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=Zr.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Zr.set(t,e))}return e}toString(){return this.cssText}}const es=$r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o$2("string"==typeof e?e:e+"",void 0,Jr))(t)})(e):e +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;var ts;const is=window,ns=is.trustedTypes,rs=ns?ns.emptyScript:"",ss=is.reactiveElementPolyfillSupport,as={toAttribute(e,t){switch(t){case Boolean:e=e?rs:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},a$1=(e,t)=>t!==e&&(t==t||e==e),os={attribute:!0,type:String,converter:as,reflect:!1,hasChanged:a$1},ls="finalized";class u extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=os){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||os}static finalize(){if(this.hasOwnProperty(ls))return!1;this[ls]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(es(e))}else void 0!==e&&t.push(es(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{$r?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const i=document.createElement("style"),n=Kr.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,e.appendChild(i)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=os){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const a=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:as).toAttribute(t,i.type);this._$El=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:as;this._$El=r,this[r]=a.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||a$1)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */var Nr,kr;class s extends d$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=B$1(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return Rr}}s.finalized=!0,s._$litElement$=!0,null===(Nr=globalThis.litElementHydrateSupport)||void 0===Nr||Nr.call(globalThis,{LitElement:s});const Or=globalThis.litElementPolyfillSupport;null==Or||Or({LitElement:s}),(null!==(kr=globalThis.litElementVersions)&&void 0!==kr?kr:globalThis.litElementVersions=[]).push("3.3.1"); + */ +var cs,hs;u[ls]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==ss||ss({ReactiveElement:u}),(null!==(ts=is.reactiveElementVersions)&&void 0!==ts?ts:is.reactiveElementVersions=[]).push("1.6.2");class s extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=D(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return zr}}s.finalized=!0,s._$litElement$=!0,null===(cs=globalThis.litElementHydrateSupport)||void 0===cs||cs.call(globalThis,{LitElement:s});const us=globalThis.litElementPolyfillSupport;null==us||us({LitElement:s}),(null!==(hs=globalThis.litElementVersions)&&void 0!==hs?hs:globalThis.litElementVersions=[]).push("3.3.2"); /* @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the 'License'); @@ -50,7 +61,7 @@ var Ar;d$1.finalized=!0,d$1.elementProperties=new Map,d$1.elementStyles=[],d$1.s * See the License for the specific language governing permissions and * limitations under the License. */ -const Gr=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,Vr=Gr&&null!=self.XRSession.prototype.requestHitTestSource,zr=null!=self.ResizeObserver,Hr=null!=self.IntersectionObserver,Wr=Vr;(()=>{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const qr=/android/i.test(navigator.userAgent),jr=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);const Kr=/firefox/i.test(navigator.userAgent),Yr=/OculusBrowser/.test(navigator.userAgent);jr&&/CriOS\//.test(navigator.userAgent);const Xr=qr&&!Kr&&!Yr,Jr=Boolean(window.webkit&&window.webkit.messageHandlers),$r=(()=>{if(jr){if(Jr)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{const e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))}}return!1})(),deserializeUrl=e=>e&&"null"!==e?toFullUrl(e):null,assertIsArCandidate=()=>{if(Wr)return;const e=[];throw Gr||e.push("WebXR Device API"),Vr||e.push("WebXR Hit Test API"),new Error(`The following APIs are required for AR, but are missing in this browser: ${e.join(", ")}`)},toFullUrl=e=>new URL(e,window.location.toString()).toString(),debounce=(e,t)=>{let i=null;return(...n)=>{null!=i&&self.clearTimeout(i),i=self.setTimeout((()=>{i=null,e(...n)}),t)}},clamp=(e,t,i)=>Math.max(t,Math.min(i,e)),Zr=(()=>{const e=(()=>{var e;if(null===(e=document.documentElement.getAttribute("itemtype"))||void 0===e?void 0:e.includes("schema.org/SearchResultsPage"))return!0;const t=null!=document.head?Array.from(document.head.querySelectorAll("meta")):[];for(const e of t)if("viewport"===e.name)return!0;return!1})();return e||console.warn('No detected; will cap pixel density at 1.'),()=>e?window.devicePixelRatio:1})(),es=(()=>{const e=new RegExp("[?&]model-viewer-debug-mode(&|$)");return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(e)})(); +const ds=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,As=ds&&null!=self.XRSession.prototype.requestHitTestSource,ps=null!=self.ResizeObserver,ms=null!=self.IntersectionObserver,gs=As;(()=>{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const fs=/android/i.test(navigator.userAgent),vs=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);const Es=/firefox/i.test(navigator.userAgent),ys=/OculusBrowser/.test(navigator.userAgent);vs&&/CriOS\//.test(navigator.userAgent);const _s=fs&&!Es&&!ys,xs=Boolean(window.webkit&&window.webkit.messageHandlers),Ss=(()=>{if(vs){if(xs)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{const e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))}}return!1})(),deserializeUrl=e=>e&&"null"!==e?toFullUrl(e):null,assertIsArCandidate=()=>{if(gs)return;const e=[];throw ds||e.push("WebXR Device API"),As||e.push("WebXR Hit Test API"),new Error(`The following APIs are required for AR, but are missing in this browser: ${e.join(", ")}`)},toFullUrl=e=>new URL(e,window.location.toString()).toString(),debounce=(e,t)=>{let i=null;return(...n)=>{null!=i&&self.clearTimeout(i),i=self.setTimeout((()=>{i=null,e(...n)}),t)}},clamp=(e,t,i)=>Math.max(t,Math.min(i,e)),Cs=(()=>{const e=(()=>{var e;if(null===(e=document.documentElement.getAttribute("itemtype"))||void 0===e?void 0:e.includes("schema.org/SearchResultsPage"))return!0;const t=null!=document.head?Array.from(document.head.querySelectorAll("meta")):[];for(const e of t)if("viewport"===e.name)return!0;return!1})();return e||console.warn('No detected; will cap pixel density at 1.'),()=>e?window.devicePixelRatio:1})(),Ms=(()=>{const e=new RegExp("[?&]model-viewer-debug-mode(&|$)");return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(e)})(); /* @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the 'License'); @@ -65,7 +76,7 @@ const Gr=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionS * See the License for the specific language governing permissions and * limitations under the License. */ -var __decorate$7=function(e,t,i,n){for(var r,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(a<3?r(o):a>3?r(t,i,o):r(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};const ts=Symbol("currentEnvironmentMap"),is=Symbol("currentBackground"),ns=Symbol("updateEnvironment"),rs=Symbol("cancelEnvironmentUpdate"); +var __decorate$7=function(e,t,i,n){for(var r,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(a<3?r(o):a>3?r(t,i,o):r(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o};const bs=Symbol("currentEnvironmentMap"),Is=Symbol("currentBackground"),ws=Symbol("updateEnvironment"),Ts=Symbol("cancelEnvironmentUpdate"); /* @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the 'License'); @@ -80,7 +91,7 @@ var __decorate$7=function(e,t,i,n){for(var r,a=arguments.length,o=a<3?t:null===n * See the License for the specific language governing permissions and * limitations under the License. */ -const ss=Lr` +const Bs=Hr` ")}))),e}function findTagsInHTML(e){let t={},n="";var r=e.match(/<\/([a-z,0-9]*?)-(\S*?)>/g);for(var o in r)n=r[o].replace("",""),t[n]=n;return t}function wipeSlot(e,t="*"){if("*"===t)for(;null!==e.firstChild;)e.removeChild(e.firstChild);else for(var n in e.childNodes)void 0!==e.childNodes[n]&&e.childNodes[n].slot===t&&e.removeChild(e.childNodes[n])}function generateResourceID(e="#"){function idPart(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e+idPart()+idPart()+"-"+idPart()+"-"+idPart()+"-"+idPart()+"-"+idPart()+idPart()+idPart()}export function utf2Html(e){return[...e].map((e=>e.codePointAt()>127?`&#${e.codePointAt()};`:e)).join("")}export function htmlEntities(e){return e.replace(/[\u00A0-\u9999<>\&]/gim,(function(e){return"&#"+e.charCodeAt(0)+";"}))}function stripMSWord(e){var t=e.split("\n\r").join("\n").split("\r").join("\n").split("\n\n").join("\n").split("\n\n").join("\n").split("\n\n").join("\n").split("\n").join(" ").replace(/( class=(")?Mso[a-zA-Z]+(")?)/g,"");t=(t=(t=t.replace(/<\!--(\s|.)*?-->/gim,"")).replace(/<\!(\s|.)*?>/gim,"")).replace(/<(\/)*(meta|link|title|html|head|body|span|font|br|\\\\?xml:|xml|st1:|o:|w:|m:|v:)(\s|.)*?>/gim,"");var n=["style","script","applet","embed","noframes","noscript"];for(var r in n){let e=new RegExp("<"+n[r]+"(s|.)*?"+n[r]+"(.*?)>","gim");t=t.replace(e,"")}for(var r in t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/ style='(\s|.)*?'/gim,"")).replace(/ face="(\s|.)*?"/gim,"")).replace(/ align=.*? /g,"")).replace(/ start='.*?'/g,"")).replace(/line-height:.*?\"/g,'"')).replace(/line-height:.*?;/g,"")).replace(/font-weight:normal;/g,"")).replace(/text-decoration:none;/g,"")).replace(/margin-.*?:.*?\"/g,'"')).replace(/margin-.*?:.*?;/g,"")).replace(/ style=""/g,"")).replace(/ id="(\s|.)*?"/gim,"")).replace(/ dir="(\s|.)*?"/gim,"")).replace(/ role="(\s|.)*?"/gim,"")).replace(/ contenteditable="(\s|.)*?"/gim,"")).replace(/ data-(\s|.)*?"(\s|.)*?"/gim,"")).replace(/ class="(\s|.)*?"/gim,"")).replace(/<\/a>/gm,"")).replace(/ /gm," ")).replace(/
/gm,"

")).replace(/<\/section>/gm,"

")).replace(/

/gm,"

")).replace(/

/gm,"

")).replace(/<\/p><\/p>/gm,"

")).replace(/<\/p><\/p>/gm,"

")).replace(/
/gm,"
")).replace(/


/gm,"

")).replace(/<\/p>
<\/b>/gm,"

")).replace(/

/gm,"

")).replace(/<\/p><\/b>/gm,"

")).replace(//gm,"")).replace(/<\/b>/gm,"")).replace(/

/gm,"

")).replace(/

    /gm,"
      ")).replace(/
        /gm,"
          ")).replace(/
        1. /gm,"
        2. ")).replace(//gm,"")).replace(//gm,"")).replace(/
        3. /gm,"

        4. ")).replace(/<\/p><\/li>/gm,"
        5. ")).replace(/
            /gm,"
              ")).replace(/<\/ul><\/b>/gm,"
            ")).replace(/
              /gm,"
                ")).replace(/<\/ol><\/b>/gm,"
              ")).replace(/

              /gm,"

              ")).replace(/<\/p><\/span>/gm,"

              ")).replace(/

              (\s*)<\/p>/gm," ")).replace(/

              <\/p>/gm,"")).replace(/

               <\/p>/gm," ")).replace(/

              <\/p>/gm,"")).replace(/


              <\/p>/gm,"")).replace(/<\/p>(\s*)

              /gm,"

              ")).replace(/ data-hax-ray="(\s|.)*?"/gim,"")).replace(/ class=""/gim,"")).replace(/ class="hax-active"/gim,"")).replace(/ contenteditable="(\s|.)*?"/gim,""),n){let e=new RegExp("<"+n[r]+">","gi");t=t.replace(e,"")}return t=t.trim()}function varExists(e,t){return"__failedToFind__"!=objectValFromStringPos(e,t,"__failedToFind__")}function varGet(e,t,n=""){return objectValFromStringPos(e,t,n)}function objectValFromStringPos(e,t,n=null){for(var r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,i=r.length;o{if(document.createElement("div").attachShadow({mode:"open"}).getSelection)return document.addEventListener("selectionchange",(e=>{document.dispatchEvent(new CustomEvent("-shadow-selectionchange"))})),()=>{};let e=!1;const t=[];return document.addEventListener("selectionchange",(n=>{e||(document.dispatchEvent(new CustomEvent("-shadow-selectionchange")),e=!0,window.setTimeout((()=>{e=!1}),0),t.forEach((e=>e(n))))})),e=>t.push(e)})();let r=!1,o=null;n((e=>{"Caret"===window.getSelection().type?r=!0:r&&!o&&(o=Promise.resolve(!0).then((()=>{r=!1,o=null})))}));export function isElementInViewport(e,t={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}){var n=e.getBoundingClientRect();return n.top>=t.top&&n.left>=t.left&&n.bottom<=t.bottom&&n.right<=t.right}function containsNextElement(e,t,n){const r=t;for(;(t=walkFromNode(t,n))&&t.contains(r););return!!t&&(t instanceof Element&&e.containsNode(t,!0))}function walkFromNode(e,t){if(!t)return e.previousSibling||e.parentNode||null;for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}return null}function initialSpace(e){return e.nodeType!==Node.TEXT_NODE?0:/^\s*/.exec(e.textContent)[0].length}const i=new Map;export function getRange(t){if(t.getSelection){const e=t.getSelection();return e.rangeCount?e.getRangeAt(0):null}const n=i.get(t);if(n)return n;const r=window.getSelection().toString(),o=internalGetShadowSelection(t),a=o&&o.range&&o.range.toString()||null;return null!==a&&a!==r&&a.replace(/\s/g,"")!==r.replace(/\s/g,"")&&(console.warn("invalid range, initial text:",r),console.warn("vs",a,o.mode,o.range)),i.set(t,o.range),window.setTimeout((()=>{i.delete(t)}),0),e&&console.debug("getRange got",o),o.range}const a=document.createTextNode("");export function internalGetShadowSelection(t){const n=document.createRange(),o=window.getSelection();if(o&&t.host&&!o.containsNode(t.host,!0))return{range:null,mode:"none"};t.insertBefore(a,t.childNodes[0]);const i=o.containsNode(a);if(a.remove(),i)return{range:null,mode:"outside-before"};t.appendChild(a);const l=o.containsNode(a);if(a.remove(),l)return{range:null,mode:"outside-after"};const measure=()=>o.toString().length;o.toString();if("None"===o.type)return null;if("Caret"!==o.type&&"Range"!==o.type)throw new TypeError("unexpected type: "+o.type);o.type;const c=findNode(o,t,!0);let s,p;if("Range"===o.type&&(s=findNode(o,t,!1),p=function getSelectionDirection(t,n,o){if("Range"!==t.type)return;const measure=()=>t.toString().length,i=measure();if(e&&console.info(`initial selection: "${t.toString()}"`),1===i&&r&&n===o)return e&&console.debug("resetting size=1"),t.extend(n,0),void t.collapseToEnd();let a;return t.modify("extend","forward","character"),a=measure(),e&&console.info(`forward selection: "${t.toString()}"`),a>i||containsNextElement(t,o,!0)?(e&&console.info("got forward >, moving right"),t.modify("extend","backward","character"),!0):ai||containsNextElement(t,n,!1)?(e&&console.info("got backwards >, moving left"),t.modify("extend","forward","character"),!1):a0?(n.setStart(c.childNodes[0],e),n.setEnd(c.childNodes[0],e)):(n.setStart(c,e),n.setEnd(c,e)),{range:n,mode:"caret"}}if(void 0===p){if("Range"!==o.type)throw new TypeError("unexpected type: "+o.type);return n.setStart(c.childNodes[0],0),n.setEnd(s,s.length),{range:n,mode:"all"}}const d=measure();let u,g;const m=s.length-function ignoredTrailingSpace(e){if(e.nodeType!==Node.TEXT_NODE)return 0;const t=/\s*$/.exec(e.textContent)[0].length;return t?t-1:0}(s);return p?(o.extend(c,0),u=measure()+initialSpace(c),o.extend(s,m),g=m-(measure()-d),o.extend(s,g)):(o.extend(s,m),g=m-measure(),o.extend(c,0),u=measure()-d+initialSpace(c),o.extend(c,u)),e&&(c===s?console.info("got string",c.textContent.substr(u,g-u)):(console.info(">>> string",c.textContent.substr(u)),console.info("<<< string",s.textContent.substr(0,g)))),n.setStart(c,u),n.setEnd(s,g),{mode:p?"right":"left",range:n}}export function ReplaceWithPolyfill(){var e,t=this.parentNode,n=arguments.length;if(t)for(n||t.removeChild(this);n--;)"object"!=typeof(e=arguments[n])?e=this.ownerDocument.createTextNode(e):e.parentNode&&e.parentNode.removeChild(e),n?t.insertBefore(e,this.nextSibling):t.replaceChild(e,this)} \ No newline at end of file +export function b64toBlob(e,t="",n=512){const r=atob(e),o=[];for(let e=0;e{let r={};for(var o in t){let n=t[o];if(!0===n||!1===n||null===n)r[o]=n;else if("function"==typeof n)try{r[o]=n(e)}catch(e){console.warn(e)}else"string"==typeof n&&varExists(e,n)?r[o]=varGet(e,n):r[o]=n}n.push(r)})),n}function camelToDash(e){return e.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()}function dashToCamel(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}function haxElementToNode(e){let t=e.tag,n=e.content?e.content:"",r=e.properties?e.properties:{};window.HaxStore&&window.HaxStore.instance&&window.HaxStore.instance._isSandboxed&&"iframe"===t&&(t="webview");var o=document.createElement(t);o.innerHTML=n;var i=o.cloneNode(!0);for(var a in r){let e=camelToDash(a);r.hasOwnProperty(a)&&(!0===r[a]?i.setAttribute(e,r[a]):!1===r[a]?i.removeAttribute(e):null!=r[a]&&r[a].constructor===Array?o.properties&&o.properties[a]&&o.properties[a].readOnly||(i.set?i.set(e,r[a]):i[e]=[...r[a]]):null!=r[a]&&r[a].constructor===Object?o.properties&&o.properties[a]&&o.properties[a].readOnly||(i.set?i.set(e,r[a]):i[e]={...r[a]}):i.setAttribute(e,r[a]))}return i}function camelCaseToDash(e){return e.replace(/([A-Z])/g,(e=>`-${e[0].toLowerCase()}`))}function encapScript(e){return e&&"function"==typeof e.replace&&(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(//gi,"<script>")).replace(/<\/script>/gi,"</script>")).replace(//gi,"")).replace(/<\/hax-(body|tray|store)[\s\S]*?>/gi,"")).replace(//gi,"")).replace(/<\/h-a-x*?>/gi,"")).replace(//gi,"<style>")).replace(/<\/style>/gi,"</style>")).replace(/[\s\S]*?<script[\s\S]*?>[\s\S]*?<\/script>/gi,(function(e,t,n,r){return e=(e=(e=(e=e.replace("<script>","