waku.org/assets/js/881.757d2b2f.js

73 lines
4.5 MiB

/*! For license information please see 881.757d2b2f.js.LICENSE.txt */
(self.webpackChunkwaku_docusaurus_template=self.webpackChunkwaku_docusaurus_template||[]).push([[881],{16829:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A});var r=n(87462),i=n(67294),s=n(45042),a=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=(0,s.Z)((function(e){return a.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=n(79626),c=n(70444),h=n(48137),u=n(27278),d=o,p=function(e){return"theme"!==e},f=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?d:p},m=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},g=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,c.hC)(t,n,r),(0,u.L)((function(){return(0,c.My)(t,n,r)})),null},A=function e(t,n){var s,a,o=t.__emotion_real===t,u=o&&t.__emotion_base||t;void 0!==n&&(s=n.label,a=n.target);var d=m(t,n,o),p=d||f(u),A=!p("as");return function(){var v=arguments,y=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==s&&y.push("label:"+s+";"),null==v[0]||void 0===v[0].raw)y.push.apply(y,v);else{0,y.push(v[0][0]);for(var x=v.length,b=1;b<x;b++)y.push(v[b],v[0][b])}var E=(0,l.w)((function(e,t,n){var r=A&&e.as||u,s="",o=[],m=e;if(null==e.theme){for(var v in m={},e)m[v]=e[v];m.theme=i.useContext(l.T)}"string"==typeof e.className?s=(0,c.fp)(t.registered,o,e.className):null!=e.className&&(s=e.className+" ");var x=(0,h.O)(y.concat(o),t.registered,m);s+=t.key+"-"+x.name,void 0!==a&&(s+=" "+a);var b=A&&void 0===d?f(r):p,E={};for(var _ in e)A&&"as"===_||b(_)&&(E[_]=e[_]);return E.className=s,E.ref=n,i.createElement(i.Fragment,null,i.createElement(g,{cache:t,serialized:x,isStringTag:"string"==typeof r}),i.createElement(r,E))}));return E.displayName=void 0!==s?s:"Styled("+("string"==typeof u?u:u.displayName||u.name||"Component")+")",E.defaultProps=t.defaultProps,E.__emotion_real=E,E.__emotion_base=u,E.__emotion_styles=y,E.__emotion_forwardProp=d,Object.defineProperty(E,"toString",{value:function(){return"."+a}}),E.withComponent=function(t,i){return e(t,(0,r.Z)({},n,i,{shouldForwardProp:m(E,i,!0)})).apply(void 0,y)},E}}.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){A[e]=A(e)}))},3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>h,kt:()=>f});var r=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},h=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},p=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,s=e.originalType,l=e.parentName,h=o(e,["components","mdxType","originalType","parentName"]),u=c(n),p=i,f=u["".concat(l,".").concat(p)]||u[p]||d[p]||s;return n?r.createElement(f,a(a({ref:t},h),{},{components:n})):r.createElement(f,a({ref:t},h))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var s=n.length,a=new Array(s);a[0]=p;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o[u]="string"==typeof e?e:i,a[1]=o;for(var c=2;c<s;c++)a[c]=n[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}p.displayName="MDXCreateElement"},96979:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdaptiveDpr:()=>Xm,AdaptiveEvents:()=>Ym,ArcballControls:()=>zo,Backdrop:()=>Df,BakeShadows:()=>zm,Billboard:()=>Oi,Bounds:()=>df,Box:()=>Gp,CameraShake:()=>Af,Center:()=>lf,Circle:()=>zp,Clone:()=>ro,Cloud:()=>Jf,ComputedAttribute:()=>$a,Cone:()=>Qp,ContactShadows:()=>If,CubeCamera:()=>ao,CubicBezierLine:()=>us,CurveModifier:()=>Mp,CycleRaycast:()=>v,Cylinder:()=>Vp,Detailed:()=>km,DeviceOrientationControls:()=>ho,Dodecahedron:()=>ef,Edges:()=>Ga,Effects:()=>Da,Environment:()=>_f,EnvironmentCube:()=>Mf,EnvironmentMap:()=>Sf,EnvironmentPortal:()=>wf,Extrude:()=>tf,FirstPersonControls:()=>hl,Float:()=>vf,FlyControls:()=>go,GizmoHelper:()=>bl,GizmoViewcube:()=>Fl,GizmoViewport:()=>Nl,GradientTexture:()=>La,Html:()=>A,Icosahedron:()=>Zp,Image:()=>ka,Instance:()=>Rm,Instances:()=>Pm,IsObject:()=>Ua,Lathe:()=>nf,Lightformer:()=>kf,Line:()=>ls,Loader:()=>S,MapControls:()=>wo,Merged:()=>Dm,MeshDistortMaterial:()=>Tp,MeshReflectorMaterial:()=>Lp,MeshWobbleMaterial:()=>Bp,Octahedron:()=>$p,OrbitControls:()=>Mo,OrthographicCamera:()=>io,PerspectiveCamera:()=>so,Plane:()=>jp,Point:()=>mm,PointMaterial:()=>Up,PointMaterialImpl:()=>Fp,PointerLockControls:()=>sl,Points:()=>Am,PointsBuffer:()=>gm,Polyhedron:()=>Jp,PositionalAudio:()=>ds,Preload:()=>Gm,PresentationControls:()=>gi,QuadraticBezierLine:()=>hs,Reflector:()=>Ff,Ring:()=>Kp,RoundedBox:()=>sf,Sampler:()=>Za,ScreenQuad:()=>of,Scroll:()=>P,ScrollControls:()=>I,Segment:()=>Nm,Segments:()=>Um,Select:()=>Fi,Shadow:()=>Lf,Sky:()=>Wf,Sphere:()=>Hp,SpotLight:()=>Nf,Stage:()=>Rf,Stars:()=>qf,Stats:()=>_u,Tetrahedron:()=>qp,Text:()=>fa,Torus:()=>Xp,TorusKnot:()=>Yp,TrackballControls:()=>Bo,Trail:()=>Ya,TransformControls:()=>qo,Tube:()=>Wp,calcPosFromAngles:()=>jf,isWebGL2Available:()=>Pa,meshBounds:()=>Wm,shaderMaterial:()=>Fa,softShadows:()=>Np,useAnimations:()=>fp,useAspect:()=>Mu,useBVH:()=>dp,useBounds:()=>pf,useBoxProjectedEnv:()=>xp,useCamera:()=>ul,useContextBridge:()=>pp,useCubeTexture:()=>kl,useCursor:()=>y,useDepthBuffer:()=>wu,useDetectGPU:()=>Nu,useFBO:()=>Su,useFBX:()=>Vc,useGLTF:()=>Yh,useGizmoContext:()=>pl,useHelper:()=>ku,useIntersect:()=>mp,useKTX2:()=>yu,useMatcapTexture:()=>em,useNormalTexture:()=>rm,useProgress:()=>E,useScroll:()=>T,useSelect:()=>Ui,useTexture:()=>Oa,useTrail:()=>Xa});var r=n(87462),i=n(67294),s=n(73935),a=n(99477),o=n(64232);const l=new a.Vector3,c=new a.Vector3,h=new a.Vector3;function u(e,t,n){const r=l.setFromMatrixPosition(e.matrixWorld);r.project(t);const i=n.width/2,s=n.height/2;return[r.x*i+i,-r.y*s+s]}const d=e=>Math.abs(e)<1e-10?0:e;function p(e,t,n=""){let r="matrix3d(";for(let i=0;16!==i;i++)r+=d(t[i]*e.elements[i])+(15!==i?",":")");return n+r}const f=(m=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,m));var m;const g=(e,t)=>p(e,(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1])(t),"translate(-50%,-50%)"),A=i.forwardRef((({children:e,eps:t=.001,style:n,className:p,prepend:m,center:A,fullscreen:v,portal:y,distanceFactor:x,sprite:b=!1,transform:E=!1,occlude:_,onOcclude:S,zIndexRange:w=[16777271,0],calculatePosition:M=u,as:C="div",wrapperClass:T,pointerEvents:I="auto",...B},R)=>{var P;const D=(0,o.useThree)((({gl:e})=>e)),L=(0,o.useThree)((({camera:e})=>e)),F=(0,o.useThree)((({scene:e})=>e)),U=(0,o.useThree)((({size:e})=>e)),O=(0,o.useThree)((({raycaster:e})=>e)),[N]=i.useState((()=>document.createElement(C))),k=i.useRef(null),G=i.useRef(0),z=i.useRef([0,0]),Q=i.useRef(null),V=i.useRef(null),H=null!==(P=null==y?void 0:y.current)&&void 0!==P?P:D.domElement.parentNode;i.useEffect((()=>{if(k.current){if(F.updateMatrixWorld(),E)N.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const e=M(k.current,L,U);N.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return H&&(m?H.prepend(N):H.appendChild(N)),()=>{H&&H.removeChild(N),s.unmountComponentAtNode(N)}}}),[H,E]),i.useLayoutEffect((()=>{T&&(N.className=T)}),[T]);const j=i.useMemo((()=>E?{position:"absolute",top:0,left:0,width:U.width,height:U.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:A?"translate3d(-50%,-50%,0)":"none",...v&&{top:-U.height/2,left:-U.width/2,width:U.width,height:U.height},...n}),[n,A,v,U,E]),W=i.useMemo((()=>({position:"absolute",pointerEvents:I})),[I]);i.useLayoutEffect((()=>{E?s.render(i.createElement("div",{ref:Q,style:j},i.createElement("div",{ref:V,style:W},i.createElement("div",{ref:R,className:p,style:n,children:e}))),N):s.render(i.createElement("div",{ref:R,style:j,className:p,children:e}),N)}));const X=i.useRef(!0);return(0,o.useFrame)((()=>{if(k.current){L.updateMatrixWorld(),k.current.updateWorldMatrix(!0,!1);const e=E?z.current:M(k.current,L,U);if(E||Math.abs(G.current-L.zoom)>t||Math.abs(z.current[0]-e[0])>t||Math.abs(z.current[1]-e[1])>t){const t=function(e,t){const n=l.setFromMatrixPosition(e.matrixWorld),r=c.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),s=t.getWorldDirection(h);return i.angleTo(s)>Math.PI/2}(k.current,L);let n=!1;"boolean"==typeof _?!0===_&&(n=[F]):Array.isArray(_)&&(n=_.map((e=>e.current)));const r=X.current;if(n){const e=function(e,t,n,r){const i=l.setFromMatrixPosition(e.matrixWorld),s=i.clone();s.project(t),n.setFromCamera(s,t);const a=n.intersectObjects(r,!0);if(a.length){const e=a[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}(k.current,L,O,n);X.current=e&&!t}else X.current=!t;if(r!==X.current&&(S?S(!X.current):N.style.display=X.current?"block":"none"),N.style.zIndex=`${function(e,t,n){if(t instanceof a.PerspectiveCamera||t instanceof a.OrthographicCamera){const r=l.setFromMatrixPosition(e.matrixWorld),i=c.setFromMatrixPosition(t.matrixWorld),s=r.distanceTo(i),a=(n[1]-n[0])/(t.far-t.near),o=n[1]-a*t.far;return Math.round(a*s+o)}}(k.current,L,w)}`,E){const[e,t]=[U.width/2,U.height/2],n=L.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:s,bottom:a,right:o}=L,l=f(L.matrixWorldInverse),c=r?`scale(${n})translate(${d(-(o+s)/2)}px,${d((i+a)/2)}px)`:`translateZ(${n}px)`;let h=k.current.matrixWorld;b&&(h=L.matrixWorldInverse.clone().transpose().copyPosition(h).scale(k.current.scale),h.elements[3]=h.elements[7]=h.elements[11]=0,h.elements[15]=1),N.style.width=U.width+"px",N.style.height=U.height+"px",N.style.perspective=r?"":`${n}px`,Q.current&&V.current&&(Q.current.style.transform=`${c}${l}translate(${e}px,${t}px)`,V.current.style.transform=g(h,1/((x||10)/400)))}else{const t=void 0===x?1:function(e,t){if(t instanceof a.OrthographicCamera)return t.zoom;if(t instanceof a.PerspectiveCamera){const n=l.setFromMatrixPosition(e.matrixWorld),r=c.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,s=n.distanceTo(r);return 1/(2*Math.tan(i/2)*s)}return 1}(k.current,L)*x;N.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}z.current=e,G.current=L.zoom}}})),i.createElement("group",(0,r.Z)({},B,{ref:k}))}));function v({onChanged:e,portal:t,preventDefault:n=!0,scroll:r=!0,keyCode:s=9}){const a=i.useRef(0),l=(0,o.useThree)((e=>e.raycaster)),c=(0,o.useThree)((e=>e.get)),h=(0,o.useThree)((e=>e.gl));return i.useEffect((()=>{var i;let o,u=[];const d=l.filter,p=null!==(i=null==t?void 0:t.current)&&void 0!==i?i:h.domElement.parentNode,f=()=>p&&e&&e(u,Math.round(a.current)%u.length);l.filter=(e,t)=>{let n=[...e];n.length===u.length&&u.every((e=>n.map((e=>e.object.uuid)).includes(e.object.uuid)))||(a.current=0,u=n,f()),d&&(n=d(n,t));for(let r=0;r<Math.round(a.current)%n.length;r++){const e=n.shift();n=[...n,e]}return n};const m=e=>{var t,n;a.current=e(a.current),null==(t=c().events.handlers)||t.onPointerCancel(void 0),null==(n=c().events.handlers)||n.onPointerMove(o),f()},g=e=>{(e.keyCode||e.which===s)&&(n&&e.preventDefault(),u.length>1&&m((e=>e+1)))},A=e=>{n&&e.preventDefault();let t=0;e||(e=window.event),e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),u.length>1&&m((e=>Math.abs(e-t)))},v=e=>o=e;return document.addEventListener("pointermove",v,{passive:!0}),r&&document.addEventListener("wheel",A),void 0!==s&&document.addEventListener("keydown",g),()=>{l.filter=d,void 0!==s&&document.removeEventListener("keydown",g),r&&document.removeEventListener("wheel",A),document.removeEventListener("pointermove",v)}}),[h,c,l,n,r,s]),null}function y(e,t="pointer",n="auto"){i.useEffect((()=>{if(e)return document.body.style.cursor=t,()=>{document.body.style.cursor=n}}),[e])}var x=n(14671);let b=0;const E=(0,x.Z)((e=>(a.DefaultLoadingManager.onStart=(t,n,r)=>{e({active:!0,item:t,loaded:n,total:r,progress:(n-b)/(r-b)*100})},a.DefaultLoadingManager.onLoad=()=>{e({active:!1})},a.DefaultLoadingManager.onError=t=>e((e=>({errors:[...e.errors,t]}))),a.DefaultLoadingManager.onProgress=(t,n,r)=>{n===r&&(b=r),e({active:!0,item:t,loaded:n,total:r,progress:(n-b)/(r-b)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}))),_=e=>`Loading ${e.toFixed(2)}%`;function S({containerStyles:e,innerStyles:t,barStyles:n,dataStyles:r,dataInterpolation:s=_,initialState:a=(e=>e)}){const{active:o,progress:l}=E(),c=i.useRef(0),h=i.useRef(0),u=i.useRef(null),[d,p]=i.useState(a(o));i.useEffect((()=>{let e;return o!==d&&(e=setTimeout((()=>p(o)),300)),()=>clearTimeout(e)}),[d,o]);const f=i.useCallback((()=>{u.current&&(c.current+=(l-c.current)/2,(c.current>.95*l||100===l)&&(c.current=l),u.current.innerText=s(c.current),c.current<l&&(h.current=requestAnimationFrame(f)))}),[s,l]);return i.useEffect((()=>(f(),()=>cancelAnimationFrame(h.current))),[f]),d?i.createElement("div",{style:{...w.container,opacity:o?1:0,...e}},i.createElement("div",null,i.createElement("div",{style:{...w.inner,...t}},i.createElement("div",{style:{...w.bar,transform:`scaleX(${l/100})`,...n}}),i.createElement("span",{ref:u,style:{...w.data,...r}})))):null}const w={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}};const M=function(e){return function(t){e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},C=i.createContext(null);function T(){return i.useContext(C)}function I({eps:e=1e-5,enabled:t=!0,infinite:n,horizontal:r,pages:s=1,distance:l=1,damping:c=4,style:h={},children:u}){const{gl:d,size:p,invalidate:f,events:m,raycaster:g}=(0,o.useThree)(),[A]=i.useState((()=>document.createElement("div"))),[v]=i.useState((()=>document.createElement("div"))),[y]=i.useState((()=>document.createElement("div"))),x=d.domElement.parentNode,b=i.useRef(0),E=i.useMemo((()=>{const t={el:A,eps:e,fill:v,fixed:y,horizontal:r,damping:c,offset:0,delta:0,scroll:b,pages:s,range(e,t,n=0){const r=e-n,i=r+t+2*n;return this.offset<r?0:this.offset>i?1:(this.offset-r)/(i-r)},curve(e,t,n=0){return Math.sin(this.range(e,t,n)*Math.PI)},visible(e,t,n=0){const r=e-n,i=r+t+2*n;return this.offset>=r&&this.offset<=i}};return t}),[e,c,r,s]);i.useEffect((()=>{A.style.position="absolute",A.style.width="100%",A.style.height="100%",A.style[r?"overflowX":"overflowY"]="auto",A.style[r?"overflowY":"overflowX"]="hidden",A.style.top="0px",A.style.left="0px";for(const n in h)A.style[n]=h[n];y.style.position="sticky",y.style.top="0px",y.style.left="0px",y.style.width="100%",y.style.height="100%",y.style.overflow="hidden",A.appendChild(y),v.style.height=r?"100%":s*l*100+"%",v.style.width=r?s*l*100+"%":"100%",v.style.pointerEvents="none",A.appendChild(v),x.appendChild(A),A[r?"scrollLeft":"scrollTop"]=1;const e=m.connected||d.domElement;requestAnimationFrame((()=>null==m.connect?void 0:m.connect(A)));const t=g.computeOffsets;return g.computeOffsets=({clientX:e,clientY:t})=>({offsetX:e-x.offsetLeft,offsetY:t-x.offsetTop}),()=>{x.removeChild(A),g.computeOffsets=t,null==m.connect||m.connect(e)}}),[s,l,r,A,v,y,x]),i.useEffect((()=>{const e=p[r?"width":"height"],i=A[r?"scrollWidth":"scrollHeight"],s=i-e;let a=0,o=!0,l=!0;const c=()=>{if(t&&!l&&(f(),a=A[r?"scrollLeft":"scrollTop"],b.current=a/s,n)){if(!o)if(a>=s){const e=1-E.offset;A[r?"scrollLeft":"scrollTop"]=1,b.current=E.offset=-e,o=!0}else if(a<=0){const e=1+E.offset;A[r?"scrollLeft":"scrollTop"]=i,b.current=E.offset=e,o=!0}o&&setTimeout((()=>o=!1),40)}};A.addEventListener("scroll",c,{passive:!0}),requestAnimationFrame((()=>l=!1));const h=e=>A.scrollLeft+=e.deltaY/2;return r&&A.addEventListener("wheel",h,{passive:!0}),()=>{A.removeEventListener("scroll",c),r&&A.removeEventListener("wheel",h)}}),[A,p,n,E,f,r,t]);let _=0;return(0,o.useFrame)(((t,n)=>{E.offset=a.MathUtils.damp(_=E.offset,b.current,c,n),E.delta=a.MathUtils.damp(E.delta,Math.abs(_-E.offset),c,n),E.delta>e&&f()})),i.createElement(C.Provider,{value:E},u)}const B=i.forwardRef((({children:e},t)=>{const n=i.useRef(null),r=T(),{width:s,height:a}=(0,o.useThree)((e=>e.viewport));return(0,o.useFrame)((()=>{n.current.position.x=r.horizontal?-s*(r.pages-1)*r.offset:0,n.current.position.y=r.horizontal?0:a*(r.pages-1)*r.offset})),i.createElement("group",{ref:M([t,n])},e)})),R=i.forwardRef((({children:e,style:t,...n},a)=>{const l=T(),c=i.useRef(null),{width:h,height:u}=(0,o.useThree)((e=>e.size)),d=i.useContext(o.context);return(0,o.useFrame)((()=>{l.delta>l.eps&&(c.current.style.transform=`translate3d(${l.horizontal?-h*(l.pages-1)*l.offset:0}px,${l.horizontal?0:u*(l.pages-1)*-l.offset}px,0)`)})),s.render(i.createElement("div",(0,r.Z)({ref:M([a,c]),style:{...t,position:"absolute",top:0,left:0,willChange:"transform"}},n),i.createElement(C.Provider,{value:l},i.createElement(o.context.Provider,{value:d},e))),l.fixed),null})),P=i.forwardRef((({html:e,...t},n)=>{const s=e?R:B;return i.createElement(s,(0,r.Z)({ref:n},t))}));var D=Object.defineProperty,L={};((e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})})(L,{assign:()=>pe,colors:()=>he,createStringInterpolator:()=>ae,skipAnimation:()=>ue,to:()=>oe,willAdvance:()=>de});var F=J(),U=e=>X(e,F),O=J();U.write=e=>X(e,O);var N=J();U.onStart=e=>X(e,N);var k=J();U.onFrame=e=>X(e,k);var G=J();U.onFinish=e=>X(e,G);var z=[];U.setTimeout=(e,t)=>{const n=U.now()+t,r=()=>{const e=z.findIndex((e=>e.cancel==r));~e&&z.splice(e,1),j-=~e?1:0},i={time:n,handler:e,cancel:r};return z.splice(Q(n),0,i),j+=1,Y(),i};var Q=e=>~(~z.findIndex((t=>t.time>e))||~z.length);U.cancel=e=>{N.delete(e),k.delete(e),G.delete(e),F.delete(e),O.delete(e)},U.sync=e=>{W=!0,U.batchedUpdates(e),W=!1},U.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,U.onStart(n)}return r.handler=e,r.cancel=()=>{N.delete(n),t=null},r};var V="undefined"!=typeof window?window.requestAnimationFrame:()=>{};U.use=e=>V=e,U.now="undefined"!=typeof performance?()=>performance.now():Date.now,U.batchedUpdates=e=>e(),U.catch=console.error,U.frameLoop="always",U.advance=()=>{"demand"!==U.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):K()};var H=-1,j=0,W=!1;function X(e,t){W?(t.delete(e),e(0)):(t.add(e),Y())}function Y(){H<0&&(H=0,"demand"!==U.frameLoop&&V(q))}function q(){~H&&(V(q),U.batchedUpdates(K))}function K(){const e=H;H=U.now();const t=Q(H);t&&(Z(z.splice(0,t),(e=>e.handler())),j-=t),j?(N.flush(),F.flush(e?Math.min(64,H-e):16.667),k.flush(),O.flush(),G.flush()):H=-1}function J(){let e=new Set,t=e;return{add(n){j+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(j-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,j-=t.size,Z(t,(t=>t(n)&&e.add(t))),j+=e.size,t=e)}}}function Z(e,t){e.forEach((e=>{try{t(e)}catch(za){U.catch(za)}}))}function $(){}var ee={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function te(e,t){if(ee.arr(e)){if(!ee.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var ne=(e,t)=>e.forEach(t);function re(e,t,n){if(ee.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var ie=e=>ee.und(e)?[]:ee.arr(e)?e:[e];function se(e,t){if(e.size){const n=Array.from(e);e.clear(),ne(n,t)}}var ae,oe,le=(e,...t)=>se(e,(e=>e(...t))),ce=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),he=null,ue=!1,de=$,pe=e=>{e.to&&(oe=e.to),e.now&&(U.now=e.now),void 0!==e.colors&&(he=e.colors),null!=e.skipAnimation&&(ue=e.skipAnimation),e.createStringInterpolator&&(ae=e.createStringInterpolator),e.requestAnimationFrame&&U.use(e.requestAnimationFrame),e.batchedUpdates&&(U.batchedUpdates=e.batchedUpdates),e.willAdvance&&(de=e.willAdvance),e.frameLoop&&(U.frameLoop=e.frameLoop)},fe=new Set,me=[],ge=[],Ae=0,ve={get idle(){return!fe.size&&!me.length},start(e){Ae>e.priority?(fe.add(e),U.onStart(ye)):(xe(e),U(Ee))},advance:Ee,sort(e){if(Ae)U.onFrame((()=>ve.sort(e)));else{const t=me.indexOf(e);~t&&(me.splice(t,1),be(e))}},clear(){me=[],fe.clear()}};function ye(){fe.forEach(xe),fe.clear(),U(Ee)}function xe(e){me.includes(e)||be(e)}function be(e){me.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(me,(t=>t.priority>e.priority)),0,e)}function Ee(e){const t=ge;for(let n=0;n<me.length;n++){const r=me[n];Ae=r.priority,r.idle||(de(r),r.advance(e),r.idle||t.push(r))}return Ae=0,(ge=me).length=0,(me=t).length>0}var _e="[-+]?\\d*\\.?\\d+",Se=_e+"%";function we(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Me=new RegExp("rgb"+we(_e,_e,_e)),Ce=new RegExp("rgba"+we(_e,_e,_e,_e)),Te=new RegExp("hsl"+we(_e,Se,Se)),Ie=new RegExp("hsla"+we(_e,Se,Se,_e)),Be=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Re=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Pe=/^#([0-9a-fA-F]{6})$/,De=/^#([0-9a-fA-F]{8})$/;function Le(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fe(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=Le(i,r,e+1/3),a=Le(i,r,e),o=Le(i,r,e-1/3);return Math.round(255*s)<<24|Math.round(255*a)<<16|Math.round(255*o)<<8}function Ue(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Oe(e){return(parseFloat(e)%360+360)%360/360}function Ne(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ke(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ge(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Pe.exec(e))?parseInt(t[1]+"ff",16)>>>0:he&&void 0!==he[e]?he[e]:(t=Me.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|255)>>>0:(t=Ce.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|Ne(t[4]))>>>0:(t=Be.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=De.exec(e))?parseInt(t[1],16)>>>0:(t=Re.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Te.exec(e))?(255|Fe(Oe(t[1]),ke(t[2]),ke(t[3])))>>>0:(t=Ie.exec(e))?(Fe(Oe(t[1]),ke(t[2]),ke(t[3]))|Ne(t[4]))>>>0:null}(e);if(null===t)return e;t=t||0;return`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`}var ze=(e,t,n)=>{if(ee.fun(e))return e;if(ee.arr(e))return ze({range:e,output:t,extrapolate:n});if(ee.str(e.output[0]))return ae(e);const r=e,i=r.output,s=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",o=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,s);return function(e,t,n,r,i,s,a,o,l){let c=l?l(e):e;if(c<t){if("identity"===a)return c;"clamp"===a&&(c=t)}if(c>n){if("identity"===o)return c;"clamp"===o&&(c=n)}if(r===i)return r;if(t===n)return e<=t?r:i;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=s(c),r===-1/0?c=-c:i===1/0?c+=r:c=c*(i-r)+r;return c}(e,s[t],s[t+1],i[t],i[t+1],l,a,o,r.map)}};var Qe=1.70158,Ve=1.525*Qe,He=Qe+1,je=2*Math.PI/3,We=2*Math.PI/4.5,Xe=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Ye={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>He*e*e*e-Qe*e*e,easeOutBack:e=>1+He*Math.pow(e-1,3)+Qe*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Ve)/2:(Math.pow(2*e-2,2)*((Ve+1)*(2*e-2)+Ve)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*je),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*je)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*We)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*We)/2+1,easeInBounce:e=>1-Xe(1-e),easeOutBounce:Xe,easeInOutBounce:e=>e<.5?(1-Xe(1-2*e))/2:(1+Xe(2*e-1))/2,steps:(e,t="end")=>n=>{const r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(r):Math.ceil(r))/e)}},qe=Symbol.for("FluidValue.get"),Ke=Symbol.for("FluidValue.observers"),Je=e=>Boolean(e&&e[qe]),Ze=e=>e&&e[qe]?e[qe]():e,$e=e=>e[Ke]||null;function et(e,t){const n=e[Ke];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var tt=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");nt(this,e)}},nt=(e,t)=>at(e,qe,t);function rt(e,t){if(e[qe]){let n=e[Ke];n||at(e,Ke,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function it(e,t){const n=e[Ke];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Ke]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var st,at=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ot=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,lt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ct=new RegExp(`(${ot.source})(%|[a-z]+)`,"i"),ht=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ut=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,dt=e=>{const[t,n]=pt(e);if(!t||ce())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&ut.test(n)?dt(n):n||e},pt=e=>{const t=ut.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},ft=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,mt=e=>{st||(st=he?new RegExp(`(${Object.keys(he).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ze(e).replace(ut,dt).replace(lt,Ge).replace(st,Ge))),n=t.map((e=>e.match(ot).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),i=r.map((t=>ze({...e,output:t})));return e=>{const n=!ct.test(t[0])&&t.find((e=>ct.test(e)))?.replace(ot,"");let r=0;return t[0].replace(ot,(()=>`${i[r++](e)}${n||""}`)).replace(ht,ft)}},gt="react-spring: ",At=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${gt}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},vt=At(console.warn);var yt=At(console.warn);function xt(e){return ee.str(e)&&("#"==e[0]||/\d/.test(e)||!ce()&&ut.test(e)||e in(he||{}))}var bt=ce()?i.useEffect:i.useLayoutEffect,Et=()=>{const e=(0,i.useRef)(!1);return bt((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function _t(){const e=(0,i.useState)()[1],t=Et();return()=>{t.current&&e(Math.random())}}var St=e=>(0,i.useEffect)(e,wt),wt=[];function Mt(e){const t=(0,i.useRef)();return(0,i.useEffect)((()=>{t.current=e})),t.current}var Ct=Symbol.for("Animated:node"),Tt=e=>e&&e[Ct],It=(e,t)=>{return n=e,r=Ct,i=t,Object.defineProperty(n,r,{value:i,writable:!0,configurable:!0});var n,r,i},Bt=e=>e&&e[Ct]&&e[Ct].getPayload(),Rt=class{constructor(){It(this,this)}getPayload(){return this.payload||[]}},Pt=class extends Rt{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ee.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Pt(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ee.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,ee.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Dt=class extends Pt{constructor(e){super(0),this._string=null,this._toString=ze({output:[e,e]})}static create(e){return new Dt(e)}getValue(){const e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(ee.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ze({output:[this.getValue(),e]})),this._value=0,super.reset()}},Lt={dependencies:null},Ft=class extends Rt{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return re(this.source,((n,r)=>{var i;(i=n)&&i[Ct]===i?t[r]=n.getValue(e):Je(n)?t[r]=Ze(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ne(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return re(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Lt.dependencies&&Je(e)&&Lt.dependencies.add(e);const t=Bt(e);t&&ne(t,(e=>this.add(e)))}},Ut=class extends Ft{constructor(e){super(e)}static create(e){return new Ut(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Ot)),!0)}};function Ot(e){return(xt(e)?Dt:Pt).create(e)}function Nt(e){const t=Tt(e);return t?t.constructor:ee.arr(e)?Ut:xt(e)?Dt:Pt}var kt=(e,t)=>{const n=!ee.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,i.forwardRef)(((r,s)=>{const a=(0,i.useRef)(null),o=n&&(0,i.useCallback)((e=>{a.current=function(e,t){e&&(ee.fun(e)?e(t):e.current=t);return t}(s,e)}),[s]),[l,c]=function(e,t){const n=new Set;Lt.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)});return e=new Ft(e),Lt.dependencies=null,[e,n]}(r,t),h=_t(),u=()=>{const e=a.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&h()},d=new Gt(u,c),p=(0,i.useRef)();bt((()=>(p.current=d,ne(c,(e=>rt(e,d))),()=>{p.current&&(ne(p.current.deps,(e=>it(e,p.current))),U.cancel(p.current.update))}))),(0,i.useEffect)(u,[]),St((()=>()=>{const e=p.current;ne(e.deps,(t=>it(t,e)))}));const f=t.getComponentProps(l.getValue());return i.createElement(e,{...f,ref:o})}))},Gt=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&U.write(this.update)}};var zt=Symbol.for("AnimatedComponent"),Qt=e=>ee.str(e)?e:e&&ee.str(e.displayName)?e.displayName:ee.fun(e)&&e.name||null;function Vt(e,...t){return ee.fun(e)?e(...t):e}var Ht=(e,t)=>!0===e||!!(t&&e&&(ee.fun(e)?e(t):ie(e).includes(t))),jt=(e,t)=>ee.obj(e)?t&&e[t]:e,Wt=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Xt=e=>e,Yt=(e,t=Xt)=>{let n=qt;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const n=t(e[i],i);ee.und(n)||(r[i]=n)}return r},qt=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Kt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Jt(e){const t=function(e){const t={};let n=0;if(re(e,((e,r)=>{Kt[r]||(t[r]=e,n++)})),n)return t}(e);if(t){const n={to:t};return re(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function Zt(e){return e=Ze(e),ee.arr(e)?e.map(Zt):xt(e)?L.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function $t(e){for(const t in e)return!0;return!1}function en(e){return ee.fun(e)||ee.arr(e)&&ee.obj(e[0])}function tn(e,t){e.ref?.delete(e),t?.delete(e)}function nn(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var rn={tension:170,friction:26,mass:1,damping:1,easing:Ye.linear,clamp:!1},sn=class{constructor(){this.velocity=0,Object.assign(this,rn)}};function an(e,t){if(ee.und(t.decay)){const n=!ee.und(t.tension)||!ee.und(t.friction);!n&&ee.und(t.frequency)&&ee.und(t.damping)&&ee.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var on=[],ln=class{constructor(){this.changed=!1,this.values=on,this.toValues=null,this.fromValues=on,this.config=new sn,this.immediate=!1}};function cn(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise(((a,o)=>{let l,c,h=Ht(n.cancel??r?.cancel,t);if(h)p();else{ee.und(n.pause)||(i.paused=Ht(n.pause,t));let e=r?.pause;!0!==e&&(e=i.paused||Ht(e,t)),l=Vt(n.delay||0,t),e?(i.resumeQueue.add(d),s.pause()):(s.resume(),d())}function u(){i.resumeQueue.add(d),i.timeouts.delete(c),c.cancel(),l=c.time-U.now()}function d(){l>0&&!L.skipAnimation?(i.delayed=!0,c=U.setTimeout(p,l),i.pauseQueue.add(u),i.timeouts.add(c)):p()}function p(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(u),i.timeouts.delete(c),e<=(i.cancelId||0)&&(h=!0);try{s.start({...n,callId:e,cancel:h},a)}catch(t){o(t)}}}))}var hn=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?pn(e.get()):t.every((e=>e.noop))?un(e.get()):dn(e.get(),t.every((e=>e.finished))),un=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),dn=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),pn=e=>({value:e,cancelled:!0,finished:!1});function fn(e,t,n,r){const{callId:i,parentId:s,onRest:a}=t,{asyncTo:o,promise:l}=n;return s||e!==o||t.reset?n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=Yt(t,((e,t)=>"onRest"===t?void 0:e));let h,u;const d=new Promise(((e,t)=>(h=e,u=t))),p=e=>{const t=i<=(n.cancelId||0)&&pn(r)||i!==n.asyncId&&dn(r,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{const s=new gn,a=new An;return(async()=>{if(L.skipAnimation)throw mn(n),a.result=dn(r,!1),u(a),a;p(s);const o=ee.obj(e)?{...e}:{...t,to:e};o.parentId=i,re(c,((e,t)=>{ee.und(o[t])&&(o[t]=e)}));const l=await r.start(o);return p(s),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};let m;if(L.skipAnimation)return mn(n),dn(r,!1);try{let t;t=ee.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,r.stop.bind(r))),await Promise.all([t.then(h),d]),m=dn(r.get(),!0,!1)}catch(g){if(g instanceof gn)m=g.result;else{if(!(g instanceof An))throw g;m=g.result}}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?o:void 0,n.promise=s?l:void 0)}return ee.fun(a)&&U.batchedUpdates((()=>{a(m,r,r.item)})),m})():l}function mn(e,t){se(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var gn=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},An=class extends Error{constructor(){super("SkipAnimationSignal")}},vn=e=>e instanceof xn,yn=1,xn=class extends tt{constructor(){super(...arguments),this.id=yn++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Tt(this);return e&&e.getValue()}to(...e){return L.to(this,e)}interpolate(...e){return vt(`${gt}The "interpolate" function is deprecated in v9 (use "to" instead)`),L.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){et(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ve.sort(this),et(this,{type:"priority",parent:this,priority:e})}},bn=Symbol.for("SpringPhase"),En=e=>(1&e[bn])>0,_n=e=>(2&e[bn])>0,Sn=e=>(4&e[bn])>0,wn=(e,t)=>t?e[bn]|=3:e[bn]&=-3,Mn=(e,t)=>t?e[bn]|=4:e[bn]&=-5,Cn=class extends xn{constructor(e,t){if(super(),this.animation=new ln,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ee.und(e)||!ee.und(t)){const n=ee.obj(e)?{...e}:{...t,from:e};ee.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(_n(this)||this._state.asyncTo)||Sn(this)}get goal(){return Ze(this.animation.to)}get velocity(){const e=Tt(this);return e instanceof Pt?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return En(this)}get isAnimating(){return _n(this)}get isPaused(){return Sn(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,a=Bt(r.to);!a&&Je(r.to)&&(i=ie(Ze(r.to))),r.values.forEach(((o,l)=>{if(o.done)return;const c=o.constructor==Dt?1:a?a[l].lastPosition:i[l];let h=r.immediate,u=c;if(!h){if(u=o.lastPosition,s.tension<=0)return void(o.done=!0);let t=o.elapsedTime+=e;const n=r.fromValues[l],i=null!=o.v0?o.v0:o.v0=ee.arr(s.velocity)?s.velocity[l]:s.velocity;let a;const d=s.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(ee.und(s.duration))if(s.decay){const e=!0===s.decay?.998:s.decay,r=Math.exp(-(1-e)*t);u=n+i/(1-e)*(1-r),h=Math.abs(o.lastPosition-u)<=d,a=i*r}else{a=null==o.lastVelocity?i:o.lastVelocity;const t=s.restVelocity||d/10,r=s.clamp?0:s.bounce,l=!ee.und(r),p=n==c?o.v0>0:n<c;let f,m=!1;const g=1,A=Math.ceil(e/g);for(let e=0;e<A&&(f=Math.abs(a)>t,f||(h=Math.abs(c-u)<=d,!h));++e){l&&(m=u==c||u>c==p,m&&(a=-a*r,u=c));a+=(1e-6*-s.tension*(u-c)+.001*-s.friction*a)/s.mass*g,u+=a*g}}else{let r=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,o.durationProgress>0&&(o.elapsedTime=s.duration*o.durationProgress,t=o.elapsedTime+=e)),r=(s.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,o.durationProgress=r),u=n+s.easing(r)*(c-n),a=(u-o.lastPosition)/e,h=1==r}o.lastVelocity=a,Number.isNaN(u)&&(console.warn("Got NaN while animating:",this),h=!0)}a&&!a[l].done&&(h=!1),h?o.done=!0:t=!1,o.setValue(u,s.round)&&(n=!0)}));const o=Tt(this),l=o.getValue();if(t){const e=Ze(r.to);l===e&&!n||s.decay?n&&s.decay&&this._onChange(l):(o.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return U.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(_n(this)){const{to:e,config:t}=this.animation;U.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return ee.und(e)?(n=this.queue||[],this.queue=[]):n=[ee.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>hn(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),mn(this._state,e&&this._lastCallId),U.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=ee.obj(n)?n[t]:n,(null==n||en(n))&&(n=void 0),r=ee.obj(r)?r[t]:r,null==r&&(r=void 0);const i={to:n,from:r};return En(this)||(e.reverse&&([n,r]=[r,n]),r=Ze(r),ee.und(r)?Tt(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Yt(e,((e,t)=>/^on/.test(t)?jt(e,n):e))),Ln(this,e,"onProps"),Fn(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return cn(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{Sn(this)||(Mn(this,!0),le(s.pauseQueue),Fn(this,"onPause",dn(this,Tn(this,this.animation.to)),this))},resume:()=>{Sn(this)&&(Mn(this,!1),_n(this)&&this._resume(),le(s.resumeQueue),Fn(this,"onResume",dn(this,Tn(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){const t=In(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(pn(this));const r=!ee.und(e.to),i=!ee.und(e.from);if(r||i){if(!(t.callId>this._lastToId))return n(pn(this));this._lastToId=t.callId}const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:u=c}=e;!i||r||t.default&&!ee.und(h)||(h=u),t.reverse&&([h,u]=[u,h]);const d=!te(u,c);d&&(o.from=u),u=Ze(u);const p=!te(h,l);p&&this._focus(h);const f=en(t.to),{config:m}=o,{decay:g,velocity:A}=m;(r||i)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(an(n={...n},t),t={...n,...t}),an(e,t),Object.assign(e,t);for(const a in rn)null==e[a]&&(e[a]=rn[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;ee.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r)}(m,Vt(t.config,s),t.config!==a.config?Vt(a.config,s):void 0);let v=Tt(this);if(!v||ee.und(h))return n(dn(this,!0));const y=ee.und(t.reset)?i&&!t.default:!ee.und(u)&&Ht(t.reset,s),x=y?u:this.get(),b=Zt(h),E=ee.num(b)||ee.arr(b)||xt(b),_=!f&&(!E||Ht(a.immediate||t.immediate,s));if(p){const e=Nt(h);if(e!==v.constructor){if(!_)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(b)}}const S=v.constructor;let w=Je(h),M=!1;if(!w){const e=y||!En(this)&&d;(p||e)&&(M=te(Zt(x),b),w=!M),(te(o.immediate,_)||_)&&te(m.decay,g)&&te(m.velocity,A)||(w=!0)}if(M&&_n(this)&&(o.changed&&!y?w=!0:w||this._stop(l)),!f&&((w||Je(l))&&(o.values=v.getPayload(),o.toValues=Je(h)?null:S==Dt?[1]:ie(b)),o.immediate!=_&&(o.immediate=_,_||y||this._set(l)),w)){const{onRest:e}=o;ne(Dn,(e=>Ln(this,t,e)));const r=dn(this,Tn(this,l));le(this._pendingCalls,r),this._pendingCalls.add(n),o.changed&&U.batchedUpdates((()=>{o.changed=!y,e?.(r,this),y?Vt(a.onRest,r):o.onStart?.(r,this)}))}y&&this._set(x),f?n(fn(t.to,t,this._state,this)):w?this._start():_n(this)&&!p?this._pendingCalls.add(n):n(un(x))}_focus(e){const t=this.animation;e!==t.to&&($e(this)&&this._detach(),t.to=e,$e(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Je(t)&&(rt(t,this),vn(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Je(e)&&it(e,this)}_set(e,t=!0){const n=Ze(e);if(!ee.und(n)){const e=Tt(this);if(!e||!te(n,e.getValue())){const r=Nt(n);e&&e.constructor==r?e.setValue(n):It(this,r.create(n)),e&&U.batchedUpdates((()=>{this._onChange(n,t)}))}}return Tt(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Fn(this,"onStart",dn(this,Tn(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Vt(this.animation.onChange,e,this)),Vt(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Tt(this).reset(Ze(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),_n(this)||(wn(this,!0),Sn(this)||this._resume())}_resume(){L.skipAnimation?this.finish():ve.start(this)}_stop(e,t){if(_n(this)){wn(this,!1);const n=this.animation;ne(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),et(this,{type:"idle",parent:this});const r=t?pn(this.get()):dn(this.get(),Tn(this,e??n.to));le(this._pendingCalls,r),n.changed&&(n.changed=!1,Fn(this,"onRest",r,this))}}};function Tn(e,t){const n=Zt(t);return te(Zt(e.get()),n)}function In(e,t=e.loop,n=e.to){const r=Vt(t);if(r){const i=!0!==r&&Jt(r),s=(i||e).reverse,a=!i||i.reset;return Bn({...e,loop:t,default:!1,pause:void 0,to:!s||en(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function Bn(e){const{to:t,from:n}=e=Jt(e),r=new Set;return ee.obj(t)&&Pn(t,r),ee.obj(n)&&Pn(n,r),e.keys=r.size?Array.from(r):null,e}function Rn(e){const t=Bn(e);return ee.und(t.default)&&(t.default=Yt(t)),t}function Pn(e,t){re(e,((e,n)=>null!=e&&t.add(n)))}var Dn=["onStart","onRest","onChange","onPause","onResume"];function Ln(e,t,n){e.animation[n]=t[n]!==Wt(t,n)?jt(t[n],e.key):void 0}function Fn(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Un=["onStart","onChange","onRest"],On=1,Nn=class{constructor(e,t){this.id=On++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];ee.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Bn(e)),this}start(e){let{queue:t}=this;return e?t=ie(e).map(Bn):this.queue=[],this._flush?this._flush(this,t):(jn(this,t),kn(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;ne(ie(t),(t=>n[t].stop(!!e)))}else mn(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ee.und(e))this.start({pause:!0});else{const t=this.springs;ne(ie(e),(e=>t[e].pause()))}return this}resume(e){if(ee.und(e))this.start({pause:!1});else{const t=this.springs;ne(ie(e),(e=>t[e].resume()))}return this}each(e){re(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,se(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const s=!r&&this._started,a=i||s&&n.size?this.get():null;i&&t.size&&se(t,(([e,t])=>{t.value=a,e(t,this,this._item)})),s&&(this._started=!1,se(n,(([e,t])=>{t.value=a,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}U.onFrame(this._onFrame)}};function kn(e,t){return Promise.all(t.map((t=>Gn(e,t)))).then((t=>hn(e,t)))}async function Gn(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,c=ee.obj(t.default)&&t.default;a&&(t.loop=!1),!1===i&&(t.to=null),!1===s&&(t.from=null);const h=ee.arr(i)||ee.fun(i)?i:void 0;h?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):ne(Un,(n=>{const r=t[n];if(ee.fun(r)){const i=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const u=e._state;t.pause===!u.paused?(u.paused=t.pause,le(t.pause?u.pauseQueue:u.resumeQueue)):u.paused&&(t.pause=!0);const d=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),p=!0===t.cancel||!0===Wt(t,"cancel");(h||p&&u.asyncId)&&d.push(cn(++e._lastAsyncId,{props:t,state:u,actions:{pause:$,resume:$,start(t,n){p?(mn(u,e._lastAsyncId),n(pn(e))):(t.onRest=o,n(fn(h,t,u,e)))}}})),u.paused&&await new Promise((e=>{u.resumeQueue.add(e)}));const f=hn(e,await Promise.all(d));if(a&&f.finished&&(!n||!f.noop)){const n=In(t,a,i);if(n)return jn(e,[n]),Gn(e,n,!0)}return l&&U.batchedUpdates((()=>l(f,e,e.item))),f}function zn(e,t){const n={...e.springs};return t&&ne(ie(t),(e=>{ee.und(e.keys)&&(e=Bn(e)),ee.obj(e.to)||(e={...e,to:void 0}),Hn(n,e,(e=>Vn(e)))})),Qn(e,n),n}function Qn(e,t){re(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,rt(t,e))}))}function Vn(e,t){const n=new Cn;return n.key=e,t&&rt(n,t),n}function Hn(e,t,n){t.keys&&ne(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function jn(e,t){ne(t,(t=>{Hn(e.springs,t,(t=>Vn(t,e)))}))}var Wn=({children:e,...t})=>{const n=(0,i.useContext)(Xn),r=t.pause||!!n.pause,s=t.immediate||!!n.immediate;t=function(e,t){const[n]=(0,i.useState)((()=>({inputs:t,result:e()}))),r=(0,i.useRef)(),s=r.current;let a=s;if(a){const n=Boolean(t&&a.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,a.inputs));n||(a={inputs:t,result:e()})}else a=n;return(0,i.useEffect)((()=>{r.current=a,s==n&&(n.inputs=n.result=void 0)}),[a]),a.result}((()=>({pause:r,immediate:s})),[r,s]);const{Provider:a}=Xn;return i.createElement(a,{value:t},e)},Xn=function(e,t){return Object.assign(e,i.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Wn,{});Wn.Provider=Xn.Provider,Wn.Consumer=Xn.Consumer;var Yn=()=>{const e=[],t=function(t){yt(`${gt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const r=[];return ne(e,((e,i)=>{if(ee.und(t))r.push(e.start());else{const s=n(t,e,i);s&&r.push(e.start(s))}})),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return ne(e,(e=>e.pause(...arguments))),this},t.resume=function(){return ne(e,(e=>e.resume(...arguments))),this},t.set=function(t){ne(e,((e,n)=>{const r=ee.fun(t)?t(n,e):t;r&&e.set(r)}))},t.start=function(t){const n=[];return ne(e,((e,r)=>{if(ee.und(t))n.push(e.start());else{const i=this._getProps(t,e,r);i&&n.push(e.start(i))}})),n},t.stop=function(){return ne(e,(e=>e.stop(...arguments))),this},t.update=function(t){return ne(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return ee.fun(e)?e(n,t):e};return t._getProps=n,t};function qn(e,t,n){const r=ee.fun(t)&&t;r&&!n&&(n=[]);const s=(0,i.useMemo)((()=>r||3==arguments.length?Yn():void 0),[]),a=(0,i.useRef)(0),o=_t(),l=(0,i.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=zn(e,t);return a.current>0&&!l.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?kn(e,t):new Promise((r=>{Qn(e,n),l.queue.push((()=>{r(kn(e,t))})),o()}))}})),[]),c=(0,i.useRef)([...l.ctrls]),h=[],u=Mt(e)||0;function d(e,n){for(let i=e;i<n;i++){const e=c.current[i]||(c.current[i]=new Nn(null,l.flush)),n=r?r(i,e):t[i];n&&(h[i]=Rn(n))}}(0,i.useMemo)((()=>{ne(c.current.slice(e,u),(e=>{tn(e,s),e.stop(!0)})),c.current.length=e,d(u,e)}),[e]),(0,i.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=c.current.map(((e,t)=>zn(e,h[t]))),f=(0,i.useContext)(Wn),m=Mt(f),g=f!==m&&$t(f);bt((()=>{a.current++,l.ctrls=c.current;const{queue:e}=l;e.length&&(l.queue=[],ne(e,(e=>e()))),ne(c.current,((e,t)=>{s?.add(e),g&&e.start({default:f});const n=h[t];n&&(nn(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),St((()=>()=>{ne(l.ctrls,(e=>e.stop(!0)))}));const A=p.map((e=>({...e})));return s?[A,s]:A}function Kn(e,t){const n=ee.fun(e),[[r],i]=qn(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,i]:r}var Jn=class extends xn{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=ze(...t);const n=this._get(),r=Nt(n);It(this,r.create(n))}advance(e){const t=this._get();te(t,this.get())||(Tt(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&$n(this._active)&&er(this)}_get(){const e=ee.arr(this.source)?this.source.map(Ze):ie(Ze(this.source));return this.calc(...e)}_start(){this.idle&&!$n(this._active)&&(this.idle=!1,ne(Bt(this),(e=>{e.done=!1})),L.skipAnimation?(U.batchedUpdates((()=>this.advance())),er(this)):ve.start(this))}_attach(){let e=1;ne(ie(this.source),(t=>{Je(t)&&rt(t,this),vn(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){ne(ie(this.source),(e=>{Je(e)&&it(e,this)})),this._active.clear(),er(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ie(this.source).reduce(((e,t)=>Math.max(e,(vn(t)?t.priority:0)+1)),0))}};function Zn(e){return!1!==e.idle}function $n(e){return!e.size||Array.from(e).every(Zn)}function er(e){e.idle||(e.idle=!0,ne(Bt(e),(e=>{e.done=!0})),et(e,{type:"idle",parent:e}))}L.assign({createStringInterpolator:mt,to:(e,t)=>new Jn(e,t)});ve.advance;var tr=["primitive"].concat(Object.keys(a).filter((e=>/^[A-Z]/.test(e))).map((e=>e[0].toLowerCase()+e.slice(1))));L.assign({createStringInterpolator:mt,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},frameLoop:"demand"}),(0,o.addEffect)((()=>{U.advance()}));var nr=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Ft(e)),getComponentProps:r=(e=>e)}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=e=>{const t=Qt(e)||"Anonymous";return(e=ee.str(e)?s[e]||(s[e]=kt(e,i)):e[zt]||(e[zt]=kt(e,i))).displayName=`Animated(${t})`,e};return re(e,((t,n)=>{ee.arr(e)&&(n=Qt(t)),s[n]=s(t)})),{animated:s}})(tr,{applyAnimatedValues:o.applyProps}),rr=nr.animated;const ir={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function sr(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function ar(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-sr(t-e,n-t,r)+t:e>n?+sr(e-n,n-t,r)+n:e}function or(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function lr(e,t,n){return(t=or(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(n),!0).forEach((function(t){lr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ur={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function dr(e){return e?e[0].toUpperCase()+e.slice(1):""}const pr=["enter","leave"];function fr(e,t="",n=!1){const r=ur[e],i=r&&r[t]||t;return"on"+dr(e)+dr(i)+(function(e=!1,t){return e&&!pr.includes(t)}(n,i)?"Capture":"")}const mr=["gotpointercapture","lostpointercapture"];function gr(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=mr.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}function Ar(e){return"touches"in e}function vr(e){return Ar(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function yr(e){return Ar(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function xr(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,s=(t.clientY+e.clientY)/2,a=Math.hypot(n,r),o=-180*Math.atan2(n,r)/Math.PI;return{angle:o,distance:a,origin:[i,s]}}catch(n){}return null}function br(e){return function(e){return Array.from(e.touches).filter((t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function Er(e,t){const[n,r]=Array.from(e.touches).filter((e=>t.includes(e.identifier)));return xr(n,r)}function _r(e){const t=yr(e);return Ar(e)?t.identifier:t.pointerId}function Sr(e){const t=yr(e);return[t.clientX,t.clientY]}function wr(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return 1===r?(t*=40,n*=40):2===r&&(t*=800,n*=800),[t,n]}function Mr(e,...t){return"function"==typeof e?e(...t):e}function Cr(){}function Tr(...e){return 0===e.length?Cr:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Ir(e,t){return Object.assign({},t,e||{})}class Br{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Mr(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);ir.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[s,a]=t._movement,[o,l]=n.threshold,{_step:c,values:h}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(s)>=o&&h[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&h[1])):(!1===c[0]&&(c[0]=Math.abs(s)>=o&&Math.sign(s)*o),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const u=[0,0];if(n.hasCustomTransform){const[e,t]=h;u[0]=!1!==c[0]?e-c[0]:0,u[1]=!1!==c[1]?t-c[1]:0}else u[0]=!1!==c[0]?s-c[0]:0,u[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(u);const d=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Mr(n.bounds,t)),this.setup&&this.setup()),t.movement=u,this.computeOffset()));const[f,m]=t.offset,[[g,A],[v,y]]=t._bounds;t.overflow=[f<g?-1:f>A?1:0,m<v?-1:m>y?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const x=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,i]){const[[s,a],[o,l]]=e;return[ar(t,s,a,r),ar(n,o,l,i)]}(t._bounds,t.offset,x),t.delta=ir.sub(t.offset,d),this.computeMovement(),p&&(!t.last||i>32)){t.delta=ir.sub(t.offset,d);const e=t.delta.map(Math.abs);ir.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(hr(hr(hr({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Rr extends Br{constructor(...e){super(...e),lr(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ir.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ir.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[vr(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),i=Math.abs(t);return r>i&&r>n?"x":i>r&&i>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Pr=e=>e,Dr={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>hr(hr({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return ir.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?ir.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Pr},threshold:e=>ir.toVector(e,0)};const Lr=hr(hr({},Dr),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Lr.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),Fr={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Ur="undefined"!=typeof window&&window.document&&window.document.createElement;function Or(){return Ur&&"ontouchstart"in window}const Nr={isBrowser:Ur,gesture:function(){try{return"constructor"in GestureEvent}catch(za){return!1}}(),touch:Or(),touchscreen:Or()||Ur&&window.navigator.maxTouchPoints>1,pointer:Ur&&"onpointerdown"in window,pointerLock:Ur&&"exitPointerLock"in window.document},kr={mouse:0,touch:0,pen:8},Gr=hr(hr({},Lr),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&Nr.pointerLock,Nr.touch&&n?"touch":this.pointerLock?"mouse":Nr.pointer&&!i?"pointer":Nr.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Nr.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i}){const s=ir.toVector(e,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,s},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(ir.toVector(e)),distance:this.transform(ir.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?hr(hr({},kr),e):kr,keyboardDisplacement:(e=10)=>e});function zr(e){const[t,n]=e.overflow,[r,i]=e._delta,[s,a]=e._direction;(t<0&&r>0&&s<0||t>0&&r<0&&s>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&i>0&&a<0||n>0&&i<0&&a>0)&&(e._movement[1]=e._movementBound[1])}const Qr=hr(hr({},Dr),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Nr.touch&&Nr.gesture)return"gesture";if(Nr.touch&&r)return"touch";if(Nr.touchscreen){if(Nr.pointer)return"pointer";if(Nr.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const i=e=>{const t=Ir(Mr(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{const t=Ir(Mr(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[i(),s()]:e=>[i(e),s(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return ir.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});const Vr=hr(hr({},Lr),{},{mouseOnly:(e=!0)=>e});const Hr=Lr;const jr=Lr;const Wr=hr(hr({},Lr),{},{mouseOnly:(e=!0)=>e}),Xr=new Map,Yr=new Map;function qr(e){Xr.set(e.key,e.engine),Yr.set(e.key,e.resolver)}const Kr={key:"drag",engine:class extends Rr{constructor(...e){super(...e),lr(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Lr.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=_r(e),n._pointerActive=!0,this.computeValues(Sr(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==vr(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=_r(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const i=Sr(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ir.sub(i,t._values),this.computeValues(i)),ir.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(a){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=_r(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,s]=t._distance;if(t.tap=i<=n.tapsThreshold&&s<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[i,s]=t._movement,[a,o]=n.swipe.velocity,[l,c]=n.swipe.distance,h=n.swipe.duration;if(t.elapsedTime<h){const n=Math.abs(e/t.timeDelta),h=Math.abs(r/t.timeDelta);n>a&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),h>o&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Fr[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,ir.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Fr&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Gr},Jr={key:"hover",engine:class extends Rr{constructor(...e){super(...e),lr(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(Sr(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const n=Sr(e);t._movement=t._delta=ir.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:Wr},Zr={key:"move",engine:class extends Rr{constructor(...e){super(...e),lr(this,"ingKey","moving")}move(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(Sr(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=Sr(e),n=this.state;n._delta=ir.sub(t,n._values),ir.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},resolver:Vr},$r={key:"pinch",engine:class extends Br{constructor(...e){super(...e),lr(this,"ingKey","pinching"),lr(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;this.state.offset="wheel"===e?ir.add(t,n):[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=30*Math.abs(t)-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout((()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()}),0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every((e=>n.has(e))))return;if(n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=Er(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every((e=>r.has(e))))return;if(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2)return;this.start(e);const i=xr(...Array.from(n.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=Er(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=xr(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],i=t.angle-r;let s=0;Math.abs(i)>270&&(s+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*s]),n.origin=t.origin,n.turns=s,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some((e=>!this.ctrl.touchIds.has(e)))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch(n){}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=ir.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&!(Array.isArray(t)?t.find((t=>e[t])):e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-wr(e)[1]/100*t.offset[0],0],ir.addTo(t._movement,t._delta),zr(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:Qr},ei={key:"scroll",engine:class extends Rr{constructor(...e){super(...e),lr(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=function(e){var t,n;const{scrollX:r,scrollY:i,scrollLeft:s,scrollTop:a}=e.currentTarget;return[null!==(t=null!=r?r:s)&&void 0!==t?t:0,null!==(n=null!=i?i:a)&&void 0!==n?n:0]}(e);t._delta=ir.sub(n,t._values),ir.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},resolver:Hr},ti={key:"wheel",engine:class extends Rr{constructor(...e){super(...e),lr(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=wr(e),ir.addTo(t._movement,t._delta),zr(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},resolver:jr};function ni(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const ri={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Nr.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},ii=["target","eventOptions","window","enabled","transform"];function si(e={},t){const n={};for(const[r,i]of Object.entries(t))switch(typeof i){case"function":n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=si(e[r],i);break;case"boolean":i&&(n[r]=e[r])}return n}class ai{constructor(e,t){lr(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){const s=this._listeners,a=function(e,t=""){const n=ur[e];return e+(n&&n[t]||t)}(t,n),o=hr(hr({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,r,o);const l=()=>{e.removeEventListener(a,r,o),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class oi{constructor(){lr(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class li{constructor(e){lr(this,"gestures",new Set),lr(this,"_targetEventStore",new ai(this)),lr(this,"gestureEventStores",{}),lr(this,"gestureTimeoutStores",{}),lr(this,"handlers",{}),lr(this,"config",{}),lr(this,"pointerIds",new Set),lr(this,"touchIds",new Set),lr(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&ci(e,"drag");t.wheel&&ci(e,"wheel");t.scroll&&ci(e,"scroll");t.move&&ci(e,"move");t.pinch&&ci(e,"pinch");t.hover&&ci(e,"hover")}(this,e)}setEventIds(e){return Ar(e)?(this.touchIds=new Set(br(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:i,eventOptions:s,window:a,enabled:o,transform:l}=r,c=ni(r,ii);if(n.shared=si({target:i,eventOptions:s,window:a,enabled:o,transform:l},ri),t){const e=Yr.get(t);n[t]=si(hr({shared:n.shared},c),e)}else for(const h in c){const e=Yr.get(h);e&&(n[h]=si(hr({shared:n.shared},c[h]),e))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],s=hi(n,i.eventOptions,!!r);if(i.enabled){new(Xr.get(t))(this,e,t).bind(s)}}const i=hi(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)i(t,"",(n=>this.nativeHandlers[t](hr(hr({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Tr(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:i,passive:s}=gr(e);this._targetEventStore.add(r,t,"",n[e],{capture:i,passive:s})}}}}function ci(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ai(e,t),e.gestureTimeoutStores[t]=new oi}const hi=(e,t,n)=>(r,i,s,a={},o=!1)=>{var l,c;const h=null!==(l=a.capture)&&void 0!==l?l:t.capture,u=null!==(c=a.passive)&&void 0!==c?c:t.passive;let d=o?r:fr(r,i,h);n&&u&&(d+="Passive"),e[d]=e[d]||[],e[d].push(s)},ui=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function di(e,t,n,r,i,s){if(!e.has(n))return;if(!Xr.has(r))return void 0;const a=n+"Start",o=n+"End";i[r]=e=>{let r;return e.first&&a in t&&t[a](e),n in t&&(r=t[n](e)),e.last&&o in t&&t[o](e),r},s[r]=s[r]||{}}function pi(e,t){const[n,r,i]=function(e){const t={},n={},r=new Set;for(let i in e)ui.test(i)?(r.add(RegExp.lastMatch),n[i]=e[i]):t[i]=e[i];return[n,t,r]}(e),s={};return di(i,n,"onDrag","drag",s,t),di(i,n,"onWheel","wheel",s,t),di(i,n,"onScroll","scroll",s,t),di(i,n,"onPinch","pinch",s,t),di(i,n,"onMove","move",s,t),di(i,n,"onHover","hover",s,t),{handlers:s,config:t,nativeHandlers:r}}function fi(e,t={},n,r){const s=i.useMemo((()=>new li(e)),[]);if(s.applyHandlers(e,r),s.applyConfig(t,n),i.useEffect(s.effect.bind(s)),i.useEffect((()=>s.clean.bind(s)),[]),void 0===t.target)return s.bind.bind(s)}function mi(e,t){const n=([Kr,$r,ei,ti,Zr,Jr].forEach(qr),function(e,t){const{handlers:n,nativeHandlers:r,config:i}=pi(e,t||{});return fi(n,i,void 0,r)});return n(e,t||{})}function gi({snap:e,global:t,cursor:n=!0,children:s,speed:l=1,rotation:c=[0,0,0],zoom:h=1,polar:u=[0,Math.PI/2],azimuth:d=[-1/0,1/0],config:p={mass:1,tension:170,friction:26}}){const{size:f,gl:m}=(0,o.useThree)(),g=i.useMemo((()=>[c[0]+u[0],c[0]+u[1]]),[c[0],u[0],u[1]]),A=i.useMemo((()=>[c[1]+d[0],c[1]+d[1]]),[c[1],d[0],d[1]]),v=i.useMemo((()=>[a.MathUtils.clamp(c[0],...g),a.MathUtils.clamp(c[1],...A),c[2]]),[c[0],c[1],c[2],g,A]),[y,x]=Kn((()=>({scale:1,rotation:v,config:p})));i.useEffect((()=>{x.start({scale:1,rotation:v,config:p})}),[v]),i.useEffect((()=>{t&&n&&(m.domElement.style.cursor="grab")}),[t,n,m.domElement]);const b=mi({onHover:({last:e})=>{n&&!t&&(m.domElement.style.cursor=e?"auto":"grab")},onDrag:({down:t,delta:[r,i],memo:[s,o]=y.rotation.animation.to||v})=>{n&&(m.domElement.style.cursor=t?"grabbing":"grab"),r=a.MathUtils.clamp(o+r/f.width*Math.PI*l,...A),i=a.MathUtils.clamp(s+i/f.height*Math.PI*l,...g);const c=e&&!t&&"boolean"!=typeof e?e:p;return x.start({scale:t&&i>g[1]/2?h:1,rotation:e&&!t?v:[i,r,0],config:e=>"scale"===e?{...c,friction:3*c.friction}:c}),[i,r]}},{target:t?m.domElement:void 0});return i.createElement(rr.group,(0,r.Z)({},null==b?void 0:b(),y),s)}const Ai=new a.Frustum,vi=new a.Vector3,yi=new a.Vector3,xi=new a.Vector3,bi=new a.Vector3,Ei=new a.Vector3,_i=new a.Vector3,Si=new a.Vector3,wi=new a.Vector3,Mi=new a.Vector3,Ci=new a.Vector3,Ti=new a.Vector3,Ii=new a.Vector3,Bi=new a.Vector3,Ri=new a.Vector3;class Pi{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new a.Vector3,this.endPoint=new a.Vector3,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Ai,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera)yi.copy(e),yi.x=Math.min(e.x,t.x),yi.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),xi.setFromMatrixPosition(this.camera.matrixWorld),bi.copy(yi),Ei.set(t.x,yi.y,0),_i.copy(t),Si.set(yi.x,t.y,0),bi.unproject(this.camera),Ei.unproject(this.camera),_i.unproject(this.camera),Si.unproject(this.camera),Ii.copy(bi).sub(xi),Bi.copy(Ei).sub(xi),Ri.copy(_i).sub(xi),Ii.normalize(),Bi.normalize(),Ri.normalize(),Ii.multiplyScalar(this.deep),Bi.multiplyScalar(this.deep),Ri.multiplyScalar(this.deep),Ii.add(xi),Bi.add(xi),Ri.add(xi),(n=Ai.planes)[0].setFromCoplanarPoints(xi,bi,Ei),n[1].setFromCoplanarPoints(xi,Ei,_i),n[2].setFromCoplanarPoints(_i,Si,xi),n[3].setFromCoplanarPoints(Si,bi,xi),n[4].setFromCoplanarPoints(Ei,_i,Si),n[5].setFromCoplanarPoints(Ri,Bi,Ii),n[5].normal.multiplyScalar(-1);else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),i=Math.max(e.y,t.y),s=Math.max(e.x,t.x),a=Math.min(e.y,t.y);var n;bi.set(r,i,-1),Ei.set(s,i,-1),_i.set(s,a,-1),Si.set(r,a,-1),wi.set(r,i,1),Mi.set(s,i,1),Ci.set(s,a,1),Ti.set(r,a,1),bi.unproject(this.camera),Ei.unproject(this.camera),_i.unproject(this.camera),Si.unproject(this.camera),wi.unproject(this.camera),Mi.unproject(this.camera),Ci.unproject(this.camera),Ti.unproject(this.camera),(n=Ai.planes)[0].setFromCoplanarPoints(bi,wi,Mi),n[1].setFromCoplanarPoints(Ei,Mi,Ci),n[2].setFromCoplanarPoints(Ci,Ti,Si),n[3].setFromCoplanarPoints(Ti,wi,bi),n[4].setFromCoplanarPoints(Ei,_i,Si),n[5].setFromCoplanarPoints(Ci,Mi,wi),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&void 0!==t.material&&(null===t.geometry.boundingSphere&&t.geometry.computeBoundingSphere(),vi.copy(t.geometry.boundingSphere.center),vi.applyMatrix4(t.matrixWorld),e.containsPoint(vi)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}var Di=n(60374);const Li=i.createContext([]);function Fi({box:e,multiple:t,children:n,onChange:s,border:l="1px solid #55aaff",backgroundColor:c="rgba(75, 160, 255, 0.1)",filter:h=(e=>e),...u}){const{camera:d,raycaster:p,gl:f,controls:m,size:g,get:A}=(0,o.useThree)(),[v,y]=i.useState(!1),[x,b]=i.useReducer(((e,{object:t,shift:n})=>void 0===t?[]:Array.isArray(t)?t:n?e.includes(t)?e.filter((e=>e!==t)):[t,...e]:e[0]===t?[]:[t]),[]);i.useEffect((()=>{null==s||s(x)}),[x]);const E=i.useCallback((e=>{e.stopPropagation(),b({object:h([e.object])[0],shift:t&&e.shiftKey})}),[]),_=i.useCallback((e=>!v&&b({})),[v]),S=i.useRef(null);return i.useEffect((()=>{if(!e||!t)return;const n=new Pi(d,S.current),r=document.createElement("div");r.style.pointerEvents="none",r.style.border=l,r.style.backgroundColor=c,r.style.position="fixed";const i=new a.Vector2,s=new a.Vector2,o=new a.Vector2,u=p.enabled,v=null==m?void 0:m.enabled;let y=!1;function x(e,t){var n;const{offsetX:r,offsetY:i}=null!==(n=null==p.computeOffsets?void 0:p.computeOffsets(e,A()))&&void 0!==n?n:e,{width:s,height:a}=g;t.set(r/s*2-1,-i/a*2+1)}function E(e){e.shiftKey&&(!function(e){var t;m&&(m.enabled=!1),p.enabled=!1,y=!0,null==(t=f.domElement.parentElement)||t.appendChild(r),r.style.left=`${e.clientX}px`,r.style.top=`${e.clientY}px`,r.style.width="0px",r.style.height="0px",i.x=e.clientX,i.y=e.clientY}(e),x(e,n.startPoint))}let _=[];function w(e){if(y){!function(e){o.x=Math.max(i.x,e.clientX),o.y=Math.max(i.y,e.clientY),s.x=Math.min(i.x,e.clientX),s.y=Math.min(i.y,e.clientY),r.style.left=`${s.x}px`,r.style.top=`${s.y}px`,r.style.width=o.x-s.x+"px",r.style.height=o.y-s.y+"px"}(e),x(e,n.endPoint);const t=n.select().sort((e=>e.uuid)).filter((e=>e.isMesh));(0,Di.Z)(t,_)||(_=t,b({object:h(t)}))}}function M(e){var t;y&&y&&(m&&(m.enabled=v),p.enabled=u,y=!1,null==(t=r.parentElement)||t.removeChild(r))}return document.addEventListener("pointerdown",E,{passive:!0}),document.addEventListener("pointermove",w,{passive:!0,capture:!0}),document.addEventListener("pointerup",M,{passive:!0}),()=>{document.removeEventListener("pointerdown",E),document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",M)}}),[g,p,d,m,f]),i.createElement("group",(0,r.Z)({ref:S,onClick:E,onPointerOver:()=>y(!0),onPointerOut:()=>y(!1),onPointerMissed:_},u),i.createElement(Li.Provider,{value:x},n))}function Ui(){return i.useContext(Li)}const Oi=i.forwardRef((function({follow:e=!0,lockX:t=!1,lockY:n=!1,lockZ:s=!1,...a},l){const c=i.useRef();return(0,o.useFrame)((({camera:r})=>{if(!e||!c.current)return;const i=c.current.rotation.clone();c.current.quaternion.copy(r.quaternion),t&&(c.current.rotation.x=i.x),n&&(c.current.rotation.y=i.y),s&&(c.current.rotation.z=i.z)})),i.createElement("group",(0,r.Z)({ref:M([c,l])},a))})),Ni=new a.Box3,ki=new a.Vector3;class Gi extends a.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new a.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new a.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new a.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new a.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new a.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new a.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new a.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),Ni.setFromBufferAttribute(t),this.boundingBox.union(Ni))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere),null===this.boundingBox&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,s=e.count;i<s;i++)ki.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(ki)),ki.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(ki));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}class zi extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new a.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:"\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_vertex>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\t\t\t\t#include <clipping_planes_pars_vertex>\n\n\t\t\t\tuniform float linewidth;\n\t\t\t\tuniform vec2 resolution;\n\n\t\t\t\tattribute vec3 instanceStart;\n\t\t\t\tattribute vec3 instanceEnd;\n\n\t\t\t\tattribute vec3 instanceColorStart;\n\t\t\t\tattribute vec3 instanceColorEnd;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashScale;\n\t\t\t\t\tattribute float instanceDistanceStart;\n\t\t\t\t\tattribute float instanceDistanceEnd;\n\t\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#endif\n\n\t\t\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t\t\t// conservative estimate of the near plane\n\t\t\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#ifdef USE_COLOR\n\n\t\t\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t\t\t// camera space\n\t\t\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\tworldStart = start.xyz;\n\t\t\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\t\t\tif ( perspective ) {\n\n\t\t\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// clip space\n\t\t\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t\t\t// ndc space\n\t\t\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t\t\t// direction\n\t\t\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t\t\t// account for clip-space aspect ratio\n\t\t\t\t\tdir.x *= aspect;\n\t\t\t\t\tdir = normalize( dir );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\t\t\tvec3 offset;\n\t\t\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t\t\t// set the world position\n\t\t\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t\t\t// project the worldpos\n\t\t\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t\t\t// segments overlap neatly\n\t\t\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\t\t\tdir.x /= aspect;\n\t\t\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset += - dir;\n\n\t\t\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\t\t\toffset += dir;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth;\n\n\t\t\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t\t\t// select end\n\t\t\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t\t\t// back to clip space\n\t\t\t\t\t\toffset *= clip.w;\n\n\t\t\t\t\t\tclip.xy += offset;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_Position = clip;\n\n\t\t\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t\t#include <clipping_planes_vertex>\n\t\t\t\t\t#include <fog_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:`\n\t\t\t\tuniform vec3 diffuse;\n\t\t\t\tuniform float opacity;\n\t\t\t\tuniform float linewidth;\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashOffset;\n\t\t\t\t\tuniform float dashSize;\n\t\t\t\t\tuniform float gapSize;\n\n\t\t\t\t#endif\n\n\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_fragment>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <clipping_planes_pars_fragment>\n\n\t\t\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\t\t\tfloat mua;\n\t\t\t\t\tfloat mub;\n\n\t\t\t\t\tvec3 p13 = p1 - p3;\n\t\t\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\t\t\tmua = numer / denom;\n\t\t\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\t\t\treturn vec2( mua, mub );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat alpha = opacity;\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\t\t\tfloat len = length( delta );\n\t\t\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\t#include <color_fragment>\n\n\t\t\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <${parseInt(a.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t\t\t}\n\t\t\t`,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(e){Boolean(e)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)},set:function(e){Boolean(e)!==Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const Qi=new a.Vector3,Vi=new a.Vector3,Hi=new a.Vector4,ji=new a.Vector4,Wi=new a.Vector4,Xi=new a.Vector3,Yi=new a.Matrix4,qi=new a.Line3,Ki=new a.Vector3,Ji=new a.Box3,Zi=new a.Sphere,$i=new a.Vector4;let es,ts,ns,rs;function is(e,t,n){return $i.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),$i.multiplyScalar(1/$i.w),$i.x=rs/n.width,$i.y=rs/n.height,$i.applyMatrix4(e.projectionMatrixInverse),$i.multiplyScalar(1/$i.w),Math.abs(Math.max($i.x,$i.y))}class ss extends a.Mesh{constructor(e=new Gi,t=new zi({color:16777215*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let s=0,a=0,o=t.count;s<o;s++,a+=2)Qi.fromBufferAttribute(t,s),Vi.fromBufferAttribute(n,s),r[a]=0===a?0:r[a-1],r[a+1]=r[a]+Qi.distanceTo(Vi);const i=new a.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,r=e.camera;null!==r||n||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=void 0!==e.params.Line2&&e.params.Line2.threshold||0;es=e.ray;const s=this.matrixWorld,o=this.geometry,l=this.material;let c,h;if(rs=l.linewidth+i,ts=o.attributes.instanceStart,ns=o.attributes.instanceEnd,null===o.boundingSphere&&o.computeBoundingSphere(),Zi.copy(o.boundingSphere).applyMatrix4(s),n)c=.5*rs;else{c=is(r,Math.max(r.near,Zi.distanceToPoint(es.origin)),l.resolution)}if(Zi.radius+=c,!1!==es.intersectsSphere(Zi)){if(null===o.boundingBox&&o.computeBoundingBox(),Ji.copy(o.boundingBox).applyMatrix4(s),n)h=.5*rs;else{h=is(r,Math.max(r.near,Ji.distanceToPoint(es.origin)),l.resolution)}Ji.expandByScalar(h),!1!==es.intersectsBox(Ji)&&(n?function(e,t){for(let n=0,r=ts.count;n<r;n++){qi.start.fromBufferAttribute(ts,n),qi.end.fromBufferAttribute(ns,n);const r=new a.Vector3,i=new a.Vector3;es.distanceSqToSegment(qi.start,qi.end,i,r),i.distanceTo(r)<.5*rs&&t.push({point:i,pointOnLine:r,distance:es.origin.distanceTo(i),object:e,face:null,faceIndex:n,uv:null,uv2:null})}}(this,t):function(e,t,n){const r=t.projectionMatrix,i=e.material.resolution,s=e.matrixWorld,o=e.geometry,l=o.attributes.instanceStart,c=o.attributes.instanceEnd,h=-t.near;es.at(1,Wi),Wi.w=1,Wi.applyMatrix4(t.matrixWorldInverse),Wi.applyMatrix4(r),Wi.multiplyScalar(1/Wi.w),Wi.x*=i.x/2,Wi.y*=i.y/2,Wi.z=0,Xi.copy(Wi),Yi.multiplyMatrices(t.matrixWorldInverse,s);for(let u=0,d=l.count;u<d;u++){if(Hi.fromBufferAttribute(l,u),ji.fromBufferAttribute(c,u),Hi.w=1,ji.w=1,Hi.applyMatrix4(Yi),ji.applyMatrix4(Yi),Hi.z>h&&ji.z>h)continue;if(Hi.z>h){const e=Hi.z-ji.z,t=(Hi.z-h)/e;Hi.lerp(ji,t)}else if(ji.z>h){const e=ji.z-Hi.z,t=(ji.z-h)/e;ji.lerp(Hi,t)}Hi.applyMatrix4(r),ji.applyMatrix4(r),Hi.multiplyScalar(1/Hi.w),ji.multiplyScalar(1/ji.w),Hi.x*=i.x/2,Hi.y*=i.y/2,ji.x*=i.x/2,ji.y*=i.y/2,qi.start.copy(Hi),qi.start.z=0,qi.end.copy(ji),qi.end.z=0;const t=qi.closestPointToPointParameter(Xi,!0);qi.at(t,Ki);const o=a.MathUtils.lerp(Hi.z,ji.z,t),d=o>=-1&&o<=1,p=Xi.distanceTo(Ki)<.5*rs;if(d&&p){qi.start.fromBufferAttribute(l,u),qi.end.fromBufferAttribute(c,u),qi.start.applyMatrix4(s),qi.end.applyMatrix4(s);const t=new a.Vector3,r=new a.Vector3;es.distanceSqToSegment(qi.start,qi.end,r,t),n.push({point:r,pointOnLine:t,distance:es.origin.distanceTo(r),object:e,face:null,faceIndex:u,uv:null,uv2:null})}}}(this,r,t))}}}class as extends Gi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class os extends ss{constructor(e=new as,t=new zi({color:16777215*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}const ls=i.forwardRef((function({points:e,color:t="black",vertexColors:n,lineWidth:s,dashed:o,...l},c){const[h]=i.useState((()=>new os)),[u]=i.useState((()=>new zi)),[d]=i.useState((()=>new a.Vector2(512,512))),p=i.useMemo((()=>{const t=new as,r=e.map((e=>e instanceof a.Vector3?e.toArray():e));if(t.setPositions(r.flat()),n){const e=n.map((e=>e instanceof a.Color?e.toArray():e));t.setColors(e.flat())}return t}),[e,n]);return i.useLayoutEffect((()=>{h.computeLineDistances()}),[e,h]),i.useLayoutEffect((()=>{o?u.defines.USE_DASH="":delete u.defines.USE_DASH,u.needsUpdate=!0}),[o,u]),i.useEffect((()=>()=>p.dispose()),[p]),i.createElement("primitive",(0,r.Z)({object:h,ref:c},l),i.createElement("primitive",{object:p,attach:"geometry"}),i.createElement("primitive",(0,r.Z)({object:u,attach:"material",color:t,vertexColors:Boolean(n),resolution:d,linewidth:s,dashed:o},l)))})),cs=new a.Vector3,hs=i.forwardRef((function({start:e=[0,0,0],end:t=[0,0,0],mid:n,segments:s=20,...o},l){const c=i.useRef(null),[h]=i.useState((()=>new a.QuadraticBezierCurve3(void 0,void 0,void 0))),u=i.useCallback(((e,t,n,r=20)=>(e instanceof a.Vector3?h.v0.copy(e):h.v0.set(...e),t instanceof a.Vector3?h.v2.copy(t):h.v2.set(...t),n instanceof a.Vector3?h.v1.copy(n):h.v1.copy(h.v0.clone().add(h.v2.clone().sub(h.v0)).add(cs.set(0,h.v0.y-h.v2.y,0))),h.getPoints(r))),[]);i.useLayoutEffect((()=>{c.current.setPoints=(e,t,n)=>{const r=u(e,t,n);c.current.geometry&&c.current.geometry.setPositions(r.map((e=>e.toArray())).flat())}}),[]);const d=i.useMemo((()=>u(e,t,n,s)),[e,t,n,s]);return i.createElement(ls,(0,r.Z)({ref:M([c,l]),points:d},o))})),us=i.forwardRef((function({start:e,end:t,midA:n,midB:s,segments:o=20,...l},c){const h=i.useMemo((()=>{const r=e instanceof a.Vector3?e:new a.Vector3(...e),i=t instanceof a.Vector3?t:new a.Vector3(...t),l=n instanceof a.Vector3?n:new a.Vector3(...n),c=s instanceof a.Vector3?s:new a.Vector3(...s);return new a.CubicBezierCurve3(r,l,c,i).getPoints(o)}),[e,t,n,s,o]);return i.createElement(ls,(0,r.Z)({ref:c,points:h},l))})),ds=i.forwardRef((({url:e,distance:t=1,loop:n=!0,autoplay:s,...l},c)=>{const h=i.useRef(),u=(0,o.useThree)((({camera:e})=>e)),[d]=i.useState((()=>new a.AudioListener)),p=(0,o.useLoader)(a.AudioLoader,e);return i.useEffect((()=>{const e=h.current;e&&(e.setBuffer(p),e.setRefDistance(t),e.setLoop(n),s&&!e.isPlaying&&e.play())}),[p,u,t,n]),i.useEffect((()=>{const e=h.current;return u.add(d),()=>{u.remove(d),e&&(e.isPlaying&&e.stop(),e.source&&e.source._connected&&e.disconnect())}}),[]),i.createElement("positionalAudio",(0,r.Z)({ref:M([h,c]),args:[d]},l))}));function ps(){var e,t=0,n=[],r=0,i=0;var s=d((function(e){i||o(1,e)})),a=d((function(e){i||o(-1,e)}));function o(n,r){i++;var s=0;try{r===m&&p();var a=n>0&&u(r);a?a.call(r,d((function(e){s++,o(1,e)})),d((function(e){s++,o(-1,e)}))):(t=n,e=r,l())}catch(za){t||s||o(-1,za)}}function l(){r||(setTimeout(c,0),r=1)}function c(){var e=n;r=0,n=[],e.forEach(h)}function h(e){e()}function u(e){var t=e&&(f(e)||"object"==typeof e)&&e.then;return f(t)&&t}function d(e){var t=0;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];t++||e.apply(this,n)}}function p(){throw new TypeError("Chaining cycle detected")}var f=function(e){return"function"==typeof e},m={then:function(r,i){var s=ps();return n.push((function(){var n=t>0?r:i;if(f(n))try{var a=n(e);a===s&&p();var o=u(a);o?o.call(a,s.resolve,s.reject):s.resolve(a)}catch(l){s.reject(l)}else s[t>0?"resolve":"reject"](e)})),t&&l(),s},resolve:s,reject:a};return m}function fs(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return{then:n.then.bind(n),resolve:e,reject:t}}ps.all=fs.all=function(e){var t=0,n=[],r=ms();return 0===e.length?r.resolve([]):e.forEach((function(i,s){var a=ms();a.resolve(i),a.then((function(i){t++,n[s]=i,t===e.length&&r.resolve(n)}),r.reject)})),r};var ms="function"==typeof Promise?fs:ps;function gs(){var e=Object.create(null);function t(r,i){var s=r.id,a=r.name,o=r.dependencies;void 0===o&&(o=[]);var l=r.init;void 0===l&&(l=function(){});var c=r.getTransferables;if(void 0===c&&(c=null),!e[s])try{o=o.map((function(n){return n&&n.isWorkerModule&&(t(n,(function(e){if(e instanceof Error)throw e})),n=e[n.id].value),n})),l=n("<"+a+">.init",l),c&&(c=n("<"+a+">.getTransferables",c));var h=null;"function"==typeof l?h=l.apply(void 0,o):console.error("worker module init function failed to rehydrate"),e[s]={id:s,value:h,getTransferables:c},i(h)}catch(u){u&&u.noLog||console.error(u),i(u)}}function n(e,t){var n=void 0;self.troikaDefine=function(e){return n=e};var r=URL.createObjectURL(new Blob(["/** "+e.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+t+"\n)"],{type:"application/javascript"}));try{importScripts(r)}catch(i){console.error(i)}return URL.revokeObjectURL(r),delete self.troikaDefine,n}self.addEventListener("message",(function(n){var r=n.data,i=r.messageId,s=r.action,a=r.data;try{"registerModule"===s&&t(a,(function(e){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:{isCallable:"function"==typeof e}})})),"callModule"===s&&function(t,n){var r,i=t.id,s=t.args;e[i]&&"function"==typeof e[i].value||n(new Error("Worker module "+i+": not found or its 'init' did not return a function"));try{var a=(r=e[i]).value.apply(r,s);a&&"function"==typeof a.then?a.then(o,(function(e){return n(e instanceof Error?e:new Error(""+e))})):o(a)}catch(l){n(l)}function o(t){try{var r=e[i].getTransferables&&e[i].getTransferables(t);r&&Array.isArray(r)&&r.length||(r=void 0),n(t,r)}catch(l){console.error(l),n(l)}}}(a,(function(e,t){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:e},t||void 0)}))}catch(o){postMessage({messageId:i,success:!1,error:o.stack})}}))}var As=function(){var e=!1;if("undefined"!=typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),e=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return As=function(){return e},e},vs=0,ys=0,xs=!1,bs=Object.create(null),Es=Object.create(null),_s=Object.create(null);function Ss(e){if(!(e&&"function"==typeof e.init||xs))throw new Error("requires `options.init` function");var t=e.dependencies,n=e.init,r=e.getTransferables,i=e.workerId;if(!As())return function(e){var t=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t._getInitResult().then((function(t){if("function"==typeof t)return t.apply(void 0,e);throw new Error("Worker module function was called but `init` did not return a callable function")}))};return t._getInitResult=function(){var n=e.dependencies,r=e.init;n=Array.isArray(n)?n.map((function(e){return e&&e._getInitResult?e._getInitResult():e})):[];var i=ms.all(n).then((function(e){return r.apply(null,e)}));return t._getInitResult=function(){return i},i},t}(e);null==i&&(i="#default");var s="workerModule"+ ++vs,a=e.name||s,o=null;function l(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!o){o=Ms(i,"registerModule",l.workerModuleData);var n=function(){o=null,Es[i].delete(n)};(Es[i]||(Es[i]=new Set)).add(n)}return o.then((function(t){if(t.isCallable)return Ms(i,"callModule",{id:s,args:e});throw new Error("Worker module function was called but `init` did not return a callable function")}))}return t=t&&t.map((function(e){return"function"!=typeof e||e.workerModuleData||(xs=!0,e=Ss({workerId:i,name:"<"+a+"> function dependency: "+e.name,init:"function(){return (\n"+ws(e)+"\n)}"}),xs=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e})),l.workerModuleData={isWorkerModule:!0,id:s,name:a,dependencies:t,init:ws(n),getTransferables:r&&ws(r)},l}function ws(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t="function "+t),t}function Ms(e,t,n){var r=ms(),i=++ys;return _s[i]=function(e){e.success?r.resolve(e.result):r.reject(new Error("Error in worker "+t+" call: "+e.error))},function(e){var t=bs[e];if(!t){var n=ws(gs);(t=bs[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+" **/\n\n;("+n+")()"],{type:"application/javascript"})))).onmessage=function(e){var t=e.data,n=t.messageId,r=_s[n];if(!r)throw new Error("WorkerModule response with empty or unknown messageId");delete _s[n],r(t)}}return t}(e).postMessage({messageId:i,action:t,data:n}),r}var Cs=Ss({name:"Thenable",dependencies:[ms],init:function(e){return e}});function Ts(){var e=function(e){function t(e,t,n,r,i,s,a,o){var l=1-a;o.x=l*l*e+2*l*a*n+a*a*i,o.y=l*l*t+2*l*a*r+a*a*s}function n(e,t,n,r,i,s,a,o,l,c){var h=1-l;c.x=h*h*h*e+3*h*h*l*n+3*h*l*l*i+l*l*l*a,c.y=h*h*h*t+3*h*h*l*r+3*h*l*l*s+l*l*l*o}function r(e,t){for(var n,r,i,s,a,o=/([MLQCZ])([^MLQCZ]*)/g;n=o.exec(e);){var l=n[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map((function(e){return parseFloat(e)}));switch(n[1]){case"M":s=r=l[0],a=i=l[1];break;case"L":l[0]===s&&l[1]===a||t("L",s,a,s=l[0],a=l[1]);break;case"Q":t("Q",s,a,s=l[2],a=l[3],l[0],l[1]);break;case"C":t("C",s,a,s=l[4],a=l[5],l[0],l[1],l[2],l[3]);break;case"Z":s===r&&a===i||t("L",s,a,r,i)}}}function i(e,i,s){void 0===s&&(s=16);var a={x:0,y:0};r(e,(function(e,r,o,l,c,h,u,d,p){switch(e){case"L":i(r,o,l,c);break;case"Q":for(var f=r,m=o,g=1;g<s;g++)t(r,o,h,u,l,c,g/(s-1),a),i(f,m,a.x,a.y),f=a.x,m=a.y;break;case"C":for(var A=r,v=o,y=1;y<s;y++)n(r,o,h,u,d,p,l,c,y/(s-1),a),i(A,v,a.x,a.y),A=a.x,v=a.y}}))}var s="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",a="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",o=new WeakMap,l={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function c(e,t){var n=e.getContext?e.getContext("webgl",l):e,r=o.get(n);if(!r){var i="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext,s={},a={},c={},h=-1,u=[];function d(e){var t=s[e];if(!t&&!(t=s[e]=n.getExtension(e)))throw new Error(e+" not supported");return t}function p(e,t){var r=n.createShader(t);return n.shaderSource(r,e),n.compileShader(r),r}function f(e,t,r,s){if(!a[e]){var o={},l={},c=n.createProgram();n.attachShader(c,p(t,n.VERTEX_SHADER)),n.attachShader(c,p(r,n.FRAGMENT_SHADER)),n.linkProgram(c),a[e]={program:c,transaction:function(e){n.useProgram(c),e({setUniform:function(e,t){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var s=l[t]||(l[t]=n.getUniformLocation(c,t));n["uniform"+e].apply(n,[s].concat(r))},setAttribute:function(e,t,r,s,a){var l=o[e];l||(l=o[e]={buf:n.createBuffer(),loc:n.getAttribLocation(c,e),data:null}),n.bindBuffer(n.ARRAY_BUFFER,l.buf),n.vertexAttribPointer(l.loc,t,n.FLOAT,!1,0,0),n.enableVertexAttribArray(l.loc),i?n.vertexAttribDivisor(l.loc,s):d("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(l.loc,s),a!==l.data&&(n.bufferData(n.ARRAY_BUFFER,a,r),l.data=a)}})}}}a[e].transaction(s)}function m(e,t){h++;try{n.activeTexture(n.TEXTURE0+h);var r=c[e];r||(r=c[e]=n.createTexture(),n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.bindTexture(n.TEXTURE_2D,r),t(r,h)}finally{h--}}function g(e,t,r){var i=n.createFramebuffer();u.push(i),n.bindFramebuffer(n.FRAMEBUFFER,i),n.activeTexture(n.TEXTURE0+t),n.bindTexture(n.TEXTURE_2D,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);try{r(i)}finally{n.deleteFramebuffer(i),n.bindFramebuffer(n.FRAMEBUFFER,u[--u.length-1]||null)}}function A(){s={},a={},c={},h=-1,u.length=0}n.canvas.addEventListener("webglcontextlost",(function(e){A(),e.preventDefault()}),!1),o.set(n,r={gl:n,isWebGL2:i,getExtension:d,withProgram:f,withTexture:m,withTextureFramebuffer:g,handleContextLoss:A})}t(r)}function h(e,t,n,r,i,o,l,h){void 0===l&&(l=15),void 0===h&&(h=null),c(e,(function(e){var c=e.gl,u=e.withProgram;(0,e.withTexture)("copy",(function(e,d){c.texImage2D(c.TEXTURE_2D,0,c.RGBA,i,o,0,c.RGBA,c.UNSIGNED_BYTE,t),u("copy",s,a,(function(e){var t=e.setUniform;(0,e.setAttribute)("aUV",2,c.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t("1i","image",d),c.bindFramebuffer(c.FRAMEBUFFER,h||null),c.disable(c.BLEND),c.colorMask(8&l,4&l,2&l,1&l),c.viewport(n,r,i,o),c.scissor(n,r,i,o),c.drawArrays(c.TRIANGLES,0,3)}))}))}))}var u=Object.freeze({__proto__:null,withWebGLContext:c,renderImageData:h,resizeWebGLCanvasWithoutClearing:function(e,t,n){var r=e.width,i=e.height;c(e,(function(s){var a=s.gl,o=new Uint8Array(r*i*4);a.readPixels(0,0,r,i,a.RGBA,a.UNSIGNED_BYTE,o),e.width=t,e.height=n,h(a,o,0,0,r,i)}))}});function d(e,t,n,r,s,a){void 0===a&&(a=1);var o=new Uint8Array(e*t),l=r[2]-r[0],c=r[3]-r[1],h=[];i(n,(function(e,t,n,r){h.push({x1:e,y1:t,x2:n,y2:r,minX:Math.min(e,n),minY:Math.min(t,r),maxX:Math.max(e,n),maxY:Math.max(t,r)})})),h.sort((function(e,t){return e.maxX-t.maxX}));for(var u=0;u<e;u++)for(var d=0;d<t;d++){var p=g(r[0]+l*(u+.5)/e,r[1]+c*(d+.5)/t),f=Math.pow(1-Math.abs(p)/s,a)/2;p<0&&(f=1-f),f=Math.max(0,Math.min(255,Math.round(255*f))),o[d*e+u]=f}return o;function g(e,t){for(var n=1/0,r=1/0,i=h.length;i--;){var s=h[i];if(s.maxX+r<=e)break;if(e+r>s.minX&&t-r<s.maxY&&t+r>s.minY){var a=m(e,t,s.x1,s.y1,s.x2,s.y2);a<n&&(n=a,r=Math.sqrt(n))}}return function(e,t){for(var n=0,r=h.length;r--;){var i=h[r];if(i.maxX<=e)break;i.y1>t!=i.y2>t&&e<(i.x2-i.x1)*(t-i.y1)/(i.y2-i.y1)+i.x1&&(n+=i.y1<i.y2?1:-1)}return 0!==n}(e,t)&&(r=-r),r}}function p(e,t,n,r,i,s,a,o,l,c){void 0===s&&(s=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0),f(e,t,n,r,i,s,a,null,o,l,c)}function f(e,t,n,r,i,s,a,o,l,c,u){void 0===s&&(s=1),void 0===l&&(l=0),void 0===c&&(c=0),void 0===u&&(u=0);for(var p=d(e,t,n,r,i,s),f=new Uint8Array(4*p.length),m=0;m<p.length;m++)f[4*m+u]=p[m];h(a,f,l,c,e,t,1<<3-u,o)}function m(e,t,n,r,i,s){var a=i-n,o=s-r,l=a*a+o*o,c=l?Math.max(0,Math.min(1,((e-n)*a+(t-r)*o)/l)):0,h=e-(n+c*a),u=t-(r+c*o);return h*h+u*u}var g=Object.freeze({__proto__:null,generate:d,generateIntoCanvas:p,generateIntoFramebuffer:f}),A="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",v="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",y="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",x=new Float32Array([0,0,2,0,0,2]),b=null,E=!1,_={},S=new WeakMap;function w(e){if(!E&&!I(e))throw new Error("WebGL generation not supported")}function M(e,t,n,r,i,s,a){if(void 0===s&&(s=1),void 0===a&&(a=null),!a&&!(a=b)){var o="function"==typeof OffscreenCanvas?new OffscreenCanvas(1,1):"undefined"!=typeof document?document.createElement("canvas"):null;if(!o)throw new Error("OffscreenCanvas or DOM canvas not supported");a=b=o.getContext("webgl",{depth:!1})}w(a);var l=new Uint8Array(e*t*4);c(a,(function(a){var o=a.gl,c=a.withTexture,h=a.withTextureFramebuffer;c("readable",(function(a,c){o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,null),h(a,c,(function(a){T(e,t,n,r,i,s,o,a,0,0,0),o.readPixels(0,0,e,t,o.RGBA,o.UNSIGNED_BYTE,l)}))}))}));for(var h=new Uint8Array(e*t),u=0,d=0;u<l.length;u+=4)h[d++]=l[u];return h}function C(e,t,n,r,i,s,a,o,l,c){void 0===s&&(s=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0),T(e,t,n,r,i,s,a,null,o,l,c)}function T(e,t,n,r,a,o,l,h,u,d,p){void 0===o&&(o=1),void 0===u&&(u=0),void 0===d&&(d=0),void 0===p&&(p=0),w(l);var f=[];i(n,(function(e,t,n,r){f.push(e,t,n,r)})),f=new Float32Array(f),c(l,(function(n){var i=n.gl,l=n.isWebGL2,c=n.getExtension,m=n.withProgram,g=n.withTexture,b=n.withTextureFramebuffer,E=n.handleContextLoss;if(g("rawDistances",(function(n,g){e===n._lastWidth&&t===n._lastHeight||i.texImage2D(i.TEXTURE_2D,0,i.RGBA,n._lastWidth=e,n._lastHeight=t,0,i.RGBA,i.UNSIGNED_BYTE,null),m("main",A,v,(function(s){var h=s.setAttribute,u=s.setUniform,d=!l&&c("ANGLE_instanced_arrays"),p=!l&&c("EXT_blend_minmax");h("aUV",2,i.STATIC_DRAW,0,x),h("aLineSegment",4,i.DYNAMIC_DRAW,1,f),u.apply(void 0,["4f","uGlyphBounds"].concat(r)),u("1f","uMaxDistance",a),u("1f","uExponent",o),b(n,g,(function(n){i.enable(i.BLEND),i.colorMask(!0,!0,!0,!0),i.viewport(0,0,e,t),i.scissor(0,0,e,t),i.blendFunc(i.ONE,i.ONE),i.blendEquationSeparate(i.FUNC_ADD,l?i.MAX:p.MAX_EXT),i.clear(i.COLOR_BUFFER_BIT),l?i.drawArraysInstanced(i.TRIANGLES,0,3,f.length/4):d.drawArraysInstancedANGLE(i.TRIANGLES,0,3,f.length/4)}))})),m("post",s,y,(function(n){n.setAttribute("aUV",2,i.STATIC_DRAW,0,x),n.setUniform("1i","tex",g),i.bindFramebuffer(i.FRAMEBUFFER,h),i.disable(i.BLEND),i.colorMask(0===p,1===p,2===p,3===p),i.viewport(u,d,e,t),i.scissor(u,d,e,t),i.drawArrays(i.TRIANGLES,0,3)}))})),i.isContextLost())throw E(),new Error("webgl context lost")}))}function I(e){var t=e&&e!==b?e.canvas||e:_,n=S.get(t);if(void 0===n){E=!0;var r=null;try{var i=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],s=M(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,e);n=s&&i.length===s.length&&s.every((function(e,t){return e===i[t]})),n||(r="bad trial run results",console.info(i,s))}catch(a){n=!1,r=a.message}r&&console.warn("WebGL SDF generation not supported:",r),E=!1,S.set(t,n)}return n}var B=Object.freeze({__proto__:null,generate:M,generateIntoCanvas:C,generateIntoFramebuffer:T,isSupported:I});return e.forEachPathCommand=r,e.generate=function(e,t,n,r,i,s){void 0===i&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),void 0===s&&(s=1);try{return M.apply(B,arguments)}catch(za){return console.info("WebGL SDF generation failed, falling back to JS",za),d.apply(g,arguments)}},e.generateIntoCanvas=function(e,t,n,r,i,s,a,o,l,c){void 0===i&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),void 0===s&&(s=1),void 0===o&&(o=0),void 0===l&&(l=0),void 0===c&&(c=0);try{return C.apply(B,arguments)}catch(za){return console.info("WebGL SDF generation failed, falling back to JS",za),p.apply(g,arguments)}},e.javascript=g,e.pathToLineSegments=i,e.webgl=B,e.webglUtils=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return e}const Is=function(){var e=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},r={};n.L=1,r[1]="L",Object.keys(t).forEach((function(e,t){n[e]=1<<t+1,r[n[e]]=e})),Object.freeze(n);var i=n.LRI|n.RLI|n.FSI,s=n.L|n.R|n.AL,a=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,o=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,l=n.S|n.WS|n.B|i|n.PDI|o,c=null;function h(e){return function(){if(!c){c=new Map;var e=function(e){if(t.hasOwnProperty(e)){var r=0;t[e].split(",").forEach((function(t){var i=t.split("+"),s=i[0],a=i[1];s=parseInt(s,36),a=a?parseInt(a,36):0,c.set(r+=s,n[e]);for(var o=0;o<a;o++)c.set(++r,n[e])}))}};for(var r in t)e(r)}}(),c.get(e.codePointAt(0))||n.L}var u,d,p,f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(e,t){var n,r=0,i=new Map,s=t&&new Map;return e.split(",").forEach((function e(a){if(-1!==a.indexOf("+"))for(var o=+a;o--;)e(n);else{n=a;var l=a.split(">"),c=l[0],h=l[1];c=String.fromCodePoint(r+=parseInt(c,36)),h=String.fromCodePoint(r+=parseInt(h,36)),i.set(c,h),t&&s.set(h,c)}})),{map:i,reverseMap:s}}function g(){if(!u){var e=m(f.pairs,!0),t=e.map,n=e.reverseMap;u=t,d=n,p=m(f.canonical,!1).map}}function A(e){return g(),u.get(e)||null}function v(e){return g(),d.get(e)||null}function y(e){return g(),p.get(e)||null}var x=n.L,b=n.R,E=n.EN,_=n.ES,S=n.ET,w=n.AN,M=n.CS,C=n.B,T=n.S,I=n.ON,B=n.BN,R=n.NSM,P=n.AL,D=n.LRO,L=n.RLO,F=n.LRE,U=n.RLE,O=n.PDF,N=n.LRI,k=n.RLI,G=n.FSI,z=n.PDI;var Q,V="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1";function H(e){return function(){if(!Q){var e=m(V,!0),t=e.map;e.reverseMap.forEach((function(e,n){t.set(n,e)})),Q=t}}(),Q.get(e)||null}function j(e,t,n,r){var i=e.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);var s=[];return t.paragraphs.forEach((function(i){var a=Math.max(n,i.start),o=Math.min(r,i.end);if(a<o){for(var c=t.levels.slice(a,o+1),u=o;u>=a&&h(e[u])&l;u--)c[u]=i.level;for(var d=i.level,p=1/0,f=0;f<c.length;f++){var m=c[f];m>d&&(d=m),m<p&&(p=1|m)}for(var g=d;g>=p;g--)for(var A=0;A<c.length;A++)if(c[A]>=g){for(var v=A;A+1<c.length&&c[A+1]>=g;)A++;A>v&&s.push([v+a,A+a])}}})),s}function W(e,t,n,r){for(var i=j(e,t,n,r),s=[],a=0;a<e.length;a++)s[a]=a;return i.forEach((function(e){for(var t=e[0],n=e[1],r=s.slice(t,n+1),i=r.length;i--;)s[n-i]=r[i]})),s}return e.closingToOpeningBracket=v,e.getBidiCharType=h,e.getBidiCharTypeName=function(e){return r[h(e)]},e.getCanonicalBracket=y,e.getEmbeddingLevels=function(e,t){for(var n=new Uint32Array(e.length),r=0;r<e.length;r++)n[r]=h(e[r]);var c=new Map;function u(e,t){var r=n[e];n[e]=t,c.set(r,c.get(r)-1),r&a&&c.set(a,c.get(a)-1),c.set(t,(c.get(t)||0)+1),t&a&&c.set(a,(c.get(a)||0)+1)}for(var d=new Uint8Array(e.length),p=new Map,f=[],m=null,g=0;g<e.length;g++)m||f.push(m={start:g,end:e.length-1,level:"rtl"===t?1:"ltr"===t?0:zt(g,!1)}),n[g]&C&&(m.end=g,m=null);for(var Q=U|F|L|D|i|z|O|C,V=function(e){return e+(1&e?1:2)},H=function(e){return e+(1&e?2:1)},j=0;j<f.length;j++){var W=[{_level:(m=f[j]).level,_override:0,_isolate:0}],X=void 0,Y=0,q=0,K=0;c.clear();for(var J=m.start;J<=m.end;J++){var Z=n[J];if(X=W[W.length-1],c.set(Z,(c.get(Z)||0)+1),Z&a&&c.set(a,(c.get(a)||0)+1),Z&Q)if(Z&(U|F)){d[J]=X._level;var $=(Z===U?H:V)(X._level);$<=125&&!Y&&!q?W.push({_level:$,_override:0,_isolate:0}):Y||q++}else if(Z&(L|D)){d[J]=X._level;var ee=(Z===L?H:V)(X._level);ee<=125&&!Y&&!q?W.push({_level:ee,_override:Z&L?b:x,_isolate:0}):Y||q++}else if(Z&i){Z&G&&(Z=1===zt(J+1,!0)?k:N),d[J]=X._level,X._override&&u(J,X._override);var te=(Z===k?H:V)(X._level);te<=125&&0===Y&&0===q?(K++,W.push({_level:te,_override:0,_isolate:1,_isolInitIndex:J})):Y++}else if(Z&z){if(Y>0)Y--;else if(K>0){for(q=0;!W[W.length-1]._isolate;)W.pop();var ne=W[W.length-1]._isolInitIndex;null!=ne&&(p.set(ne,J),p.set(J,ne)),W.pop(),K--}X=W[W.length-1],d[J]=X._level,X._override&&u(J,X._override)}else Z&O?(0===Y&&(q>0?q--:!X._isolate&&W.length>1&&(W.pop(),X=W[W.length-1])),d[J]=X._level):Z&C&&(d[J]=m.level);else d[J]=X._level,X._override&&Z!==B&&u(J,X._override)}for(var re=[],ie=null,se=m.start;se<=m.end;se++){var ae=n[se];if(!(ae&o)){var oe=d[se],le=ae&i,ce=ae===z;ie&&oe===ie._level?(ie._end=se,ie._endsWithIsolInit=le):re.push(ie={_start:se,_end:se,_level:oe,_startsWithPDI:ce,_endsWithIsolInit:le})}}for(var he=[],ue=0;ue<re.length;ue++){var de=re[ue];if(!de._startsWithPDI||de._startsWithPDI&&!p.has(de._start)){for(var pe=[ie=de],fe=void 0;ie&&ie._endsWithIsolInit&&null!=(fe=p.get(ie._end));)for(var me=ue+1;me<re.length;me++)if(re[me]._start===fe){pe.push(ie=re[me]);break}for(var ge=[],Ae=0;Ae<pe.length;Ae++)for(var ve=pe[Ae],ye=ve._start;ye<=ve._end;ye++)ge.push(ye);for(var xe=d[ge[0]],be=m.level,Ee=ge[0]-1;Ee>=0;Ee--)if(!(n[Ee]&o)){be=d[Ee];break}var _e=ge[ge.length-1],Se=d[_e],we=m.level;if(!(n[_e]&i))for(var Me=_e+1;Me<=m.end;Me++)if(!(n[Me]&o)){we=d[Me];break}he.push({_seqIndices:ge,_sosType:Math.max(be,xe)%2?b:x,_eosType:Math.max(we,Se)%2?b:x})}}for(var Ce=0;Ce<he.length;Ce++){var Te=he[Ce],Ie=Te._seqIndices,Be=Te._sosType,Re=Te._eosType,Pe=1&d[Ie[0]]?b:x;if(c.get(R))for(var De=0;De<Ie.length;De++){var Le=Ie[De];if(n[Le]&R){for(var Fe=Be,Ue=De-1;Ue>=0;Ue--)if(!(n[Ie[Ue]]&o)){Fe=n[Ie[Ue]];break}u(Le,Fe&(i|z)?I:Fe)}}if(c.get(E))for(var Oe=0;Oe<Ie.length;Oe++){var Ne=Ie[Oe];if(n[Ne]&E)for(var ke=Oe-1;ke>=-1;ke--){var Ge=-1===ke?Be:n[Ie[ke]];if(Ge&s){Ge===P&&u(Ne,w);break}}}if(c.get(P))for(var ze=0;ze<Ie.length;ze++){var Qe=Ie[ze];n[Qe]&P&&u(Qe,b)}if(c.get(_)||c.get(M))for(var Ve=1;Ve<Ie.length-1;Ve++){var He=Ie[Ve];if(n[He]&(_|M)){for(var je=0,We=0,Xe=Ve-1;Xe>=0&&(je=n[Ie[Xe]])&o;Xe--);for(var Ye=Ve+1;Ye<Ie.length&&(We=n[Ie[Ye]])&o;Ye++);je===We&&(n[He]===_?je===E:je&(E|w))&&u(He,je)}}if(c.get(E))for(var qe=0;qe<Ie.length;qe++){var Ke=Ie[qe];if(n[Ke]&E){for(var Je=qe-1;Je>=0&&n[Ie[Je]]&(S|o);Je--)u(Ie[Je],E);for(qe++;qe<Ie.length&&n[Ie[qe]]&(S|o|E);qe++)n[Ie[qe]]!==E&&u(Ie[qe],E)}}if(c.get(S)||c.get(_)||c.get(M))for(var Ze=0;Ze<Ie.length;Ze++){var $e=Ie[Ze];if(n[$e]&(S|_|M)){u($e,I);for(var et=Ze-1;et>=0&&n[Ie[et]]&o;et--)u(Ie[et],I);for(var tt=Ze+1;tt<Ie.length&&n[Ie[tt]]&o;tt++)u(Ie[tt],I)}}if(c.get(E))for(var nt=0,rt=Be;nt<Ie.length;nt++){var it=Ie[nt],st=n[it];st&E?rt===x&&u(it,x):st&s&&(rt=st)}if(c.get(a)){for(var at=b|E|w,ot=at|x,lt=[],ct=[],ht=0;ht<Ie.length;ht++)if(n[Ie[ht]]&a){var ut=e[Ie[ht]],dt=void 0;if(null!==A(ut)){if(!(ct.length<63))break;ct.push({char:ut,seqIndex:ht})}else if(null!==(dt=v(ut)))for(var pt=ct.length-1;pt>=0;pt--){var ft=ct[pt].char;if(ft===dt||ft===v(y(ut))||A(y(ft))===ut){lt.push([ct[pt].seqIndex,ht]),ct.length=pt;break}}}lt.sort((function(e,t){return e[0]-t[0]}));for(var mt=0;mt<lt.length;mt++){for(var gt=lt[mt],At=gt[0],vt=gt[1],yt=!1,xt=0,bt=At+1;bt<vt;bt++){var Et=Ie[bt];if(n[Et]&ot){yt=!0;var _t=n[Et]&at?b:x;if(_t===Pe){xt=_t;break}}}if(yt&&!xt){xt=Be;for(var St=At-1;St>=0;St--){var wt=Ie[St];if(n[wt]&ot){var Mt=n[wt]&at?b:x;xt=Mt!==Pe?Mt:Pe;break}}}if(xt){if(n[Ie[At]]=n[Ie[vt]]=xt,xt!==Pe)for(var Ct=At+1;Ct<Ie.length;Ct++)if(!(n[Ie[Ct]]&o)){h(e[Ie[Ct]])&R&&(n[Ie[Ct]]=xt);break}if(xt!==Pe)for(var Tt=vt+1;Tt<Ie.length;Tt++)if(!(n[Ie[Tt]]&o)){h(e[Ie[Tt]])&R&&(n[Ie[Tt]]=xt);break}}}for(var It=0;It<Ie.length;It++)if(n[Ie[It]]&a){for(var Bt=It,Rt=It,Pt=Be,Dt=It-1;Dt>=0;Dt--){if(!(n[Ie[Dt]]&o)){Pt=n[Ie[Dt]]&at?b:x;break}Bt=Dt}for(var Lt=Re,Ft=It+1;Ft<Ie.length;Ft++){if(!(n[Ie[Ft]]&(a|o))){Lt=n[Ie[Ft]]&at?b:x;break}Rt=Ft}for(var Ut=Bt;Ut<=Rt;Ut++)n[Ie[Ut]]=Pt===Lt?Pt:Pe;It=Rt}}}for(var Ot=m.start;Ot<=m.end;Ot++){var Nt=d[Ot],kt=n[Ot];if(1&Nt?kt&(x|E|w)&&d[Ot]++:kt&b?d[Ot]++:kt&(w|E)&&(d[Ot]+=2),kt&o&&(d[Ot]=0===Ot?m.level:d[Ot-1]),Ot===m.end||h(e[Ot])&(T|C))for(var Gt=Ot;Gt>=0&&h(e[Gt])&l;Gt--)d[Gt]=m.level}}return{levels:d,paragraphs:f};function zt(t,r){for(var s=t;s<e.length;s++){var a=n[s];if(a&(b|P))return 1;if(a&(C|x)||r&&a===z)return 0;if(a&i){var o=Qt(s);s=-1===o?e.length:o}}return 0}function Qt(t){for(var r=1,s=t+1;s<e.length;s++){var a=n[s];if(a&C)break;if(a&z){if(0==--r)return s}else a&i&&r++}return-1}},e.getMirroredCharacter=H,e.getMirroredCharactersMap=function(e,t,n,r){var i=e.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);for(var s=new Map,a=n;a<=r;a++)if(1&t[a]){var o=H(e[a]);null!==o&&s.set(a,o)}return s},e.getReorderSegments=j,e.getReorderedIndices=W,e.getReorderedString=function(e,t,n,r){var i=W(e,t,n,r),s=[].concat(e);return i.forEach((function(n,r){s[r]=(1&t.levels[n]?H(e[n]):null)||e[n]})),s.join("")},e.openingToClosingBracket=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return e},Bs=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Rs(e){return e.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(e,t){let n=a.ShaderChunk[t];return n?Rs(n):e}))}const Ps=[];for(let qm=0;qm<256;qm++)Ps[qm]=(qm<16?"0":"")+qm.toString(16);const Ds=Object.assign||function(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){let n=arguments[t];if(n)for(let t in n)n.hasOwnProperty(t)&&(e[t]=n[t])}return e},Ls=Date.now(),Fs=new WeakMap,Us=new Map;let Os=1e10;function Ns(e,t){const n=function(e){const t=JSON.stringify(e,Gs);let n=Qs.get(t);null==n&&Qs.set(t,n=++zs);return n}(t);let r=Fs.get(e);if(r||Fs.set(e,r=Object.create(null)),r[n])return new r[n];const i=`_onBeforeCompile${n}`,s=function(r){e.onBeforeCompile.call(this,r);const s=this.customProgramCacheKey()+"|"+r.vertexShader+"|"+r.fragmentShader;let a=Us[s];if(!a){const e=function({vertexShader:e,fragmentShader:t},n,r){let{vertexDefs:i,vertexMainIntro:s,vertexMainOutro:a,vertexTransform:o,fragmentDefs:l,fragmentMainIntro:c,fragmentMainOutro:h,fragmentColorTransform:u,customRewriter:d,timeUniform:p}=n;i=i||"",s=s||"",a=a||"",l=l||"",c=c||"",h=h||"",(o||d)&&(e=Rs(e));(u||d)&&(t=Rs(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n")));if(d){let n=d({vertexShader:e,fragmentShader:t});e=n.vertexShader,t=n.fragmentShader}if(u){let e=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(t=>(e.push(t),""))),h=`${u}\n${e.join("\n")}\n${h}`}if(p){const e=`\nuniform float ${p};\n`;i=e+i,l=e+l}o&&(i=`${i}\nvoid troikaVertexTransform${r}(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ${o}\n}\n`,s=`\ntroika_position_${r} = vec3(position);\ntroika_normal_${r} = vec3(normal);\ntroika_uv_${r} = vec2(uv);\ntroikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r});\n${s}\n`,e=(e=`vec3 troika_position_${r};\nvec3 troika_normal_${r};\nvec2 troika_uv_${r};\n${e}\n`).replace(/\b(position|normal|uv)\b/g,((e,t,n,i)=>/\battribute\s+vec[23]\s+$/.test(i.substr(0,n))?t:`troika_${t}_${r}`)));return e=ks(e,r,i,s,a),t=ks(t,r,l,c,h),{vertexShader:e,fragmentShader:t}}(r,t,n);a=Us[s]=e}r.vertexShader=a.vertexShader,r.fragmentShader=a.fragmentShader,Ds(r.uniforms,this.uniforms),t.timeUniform&&(r.uniforms[t.timeUniform]={get value(){return Date.now()-Ls}}),this[i]&&this[i](r)},o=function(){return l(t.chained?e:e.clone())},l=function(r){const i=Object.create(r,c);return Object.defineProperty(i,"baseMaterial",{value:e}),Object.defineProperty(i,"id",{value:Os++}),i.uuid=function(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Ps[255&e]+Ps[e>>8&255]+Ps[e>>16&255]+Ps[e>>24&255]+"-"+Ps[255&t]+Ps[t>>8&255]+"-"+Ps[t>>16&15|64]+Ps[t>>24&255]+"-"+Ps[63&n|128]+Ps[n>>8&255]+"-"+Ps[n>>16&255]+Ps[n>>24&255]+Ps[255&r]+Ps[r>>8&255]+Ps[r>>16&255]+Ps[r>>24&255]).toUpperCase()}(),i.uniforms=Ds({},r.uniforms,t.uniforms),i.defines=Ds({},r.defines,t.defines),i.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",i.extensions=Ds({},r.extensions,t.extensions),i._listeners=void 0,i},c={constructor:{value:o},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get:()=>s,set(e){this[i]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),e.isShaderMaterial||e.isDerivedMaterial||(Ds(this.extensions,t.extensions),Ds(this.defines,t.defines),Ds(this.uniforms,a.UniformsUtils.clone(t.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const t=new e.constructor;return l(t).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let n=this._depthMaterial;return n||(n=this._depthMaterial=Ns(e.isDerivedMaterial?e.getDepthMaterial():new a.MeshDepthMaterial({depthPacking:a.RGBADepthPacking}),t),n.defines.IS_DEPTH_MATERIAL="",n.uniforms=this.uniforms),n}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let n=this._distanceMaterial;return n||(n=this._distanceMaterial=Ns(e.isDerivedMaterial?e.getDistanceMaterial():new a.MeshDistanceMaterial,t),n.defines.IS_DISTANCE_MATERIAL="",n.uniforms=this.uniforms),n}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:t,_distanceMaterial:n}=this;t&&t.dispose(),n&&n.dispose(),e.dispose.call(this)}}};return r[n]=o,new o}function ks(e,t,n,r,i){return(r||i||n)&&(e=e.replace(Bs,`\n${n}\nvoid troikaOrigMain${t}() {`),e+=`\nvoid main() {\n ${r}\n troikaOrigMain${t}();\n ${i}\n}`),e}function Gs(e,t){return"uniforms"===e?void 0:"function"==typeof t?t.toString():t}let zs=0;const Qs=new Map;a.DoubleSide;const Vs=()=>(self.performance||Date).now(),Hs=Ts();let js;const Ws=function(){const e=[];let t=0;function n(){const r=Vs();for(;e.length&&Vs()-r<5;)e.shift()();t=e.length?setTimeout(n,0):0}return(...r)=>{const i=ms();return e.push((()=>{const e=Vs();try{Hs.webgl.generateIntoCanvas(...r),i.resolve({timing:Vs()-e})}catch(t){i.reject(t)}})),t||(t=setTimeout(n,0)),i}}(),Xs=function(){const e={};let t=0;return function(n,r,i,s,a,o,l,c,h,u){const d="TroikaTextSDFGenerator_JS_"+t++%4;let p=e[d];return p||(p=e[d]={workerModule:Ss({name:d,workerId:d,dependencies:[Ts,Vs],init(e,t){const n=e().javascript.generate;return function(...e){const r=t();return{textureData:n(...e),timing:t()-r}}},getTransferables:e=>[e.textureData.buffer]}),requests:0,idleTimer:null}),p.requests++,clearTimeout(p.idleTimer),p.workerModule(n,r,i,s,a,o).then((({textureData:e,timing:t})=>{const i=Vs(),s=new Uint8Array(4*e.length);for(let n=0;n<e.length;n++)s[4*n+u]=e[n];return Hs.webglUtils.renderImageData(l,s,c,h,n,r,1<<3-u),t+=Vs()-i,0==--p.requests&&(p.idleTimer=setTimeout((()=>{!function(e){Es[e]&&Es[e].forEach((function(e){e()})),bs[e]&&(bs[e].terminate(),delete bs[e])}(d)}),2e3)),{timing:t}}))}}();const Ys=Hs.webglUtils.resizeWebGLCanvasWithoutClearing;const qs=Ss({name:"Typr Font Parser",dependencies:[function(){return"undefined"==typeof window&&(self.window=self),function(e){var t={parse:function(e){var n=t._bin,r=new Uint8Array(e);if("ttcf"==n.readASCII(r,0,4)){var i=4;n.readUshort(r,i),i+=2,n.readUshort(r,i),i+=2;var s=n.readUint(r,i);i+=4;for(var a=[],o=0;o<s;o++){var l=n.readUint(r,i);i+=4,a.push(t._readFont(r,l))}return a}return[t._readFont(r,0)]},_readFont:function(e,n){var r=t._bin,i=n;r.readFixed(e,n),n+=4;var s=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2;for(var a=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GPOS","GSUB","SVG "],o={_data:e,_offset:i},l={},c=0;c<s;c++){var h=r.readASCII(e,n,4);n+=4,r.readUint(e,n),n+=4;var u=r.readUint(e,n);n+=4;var d=r.readUint(e,n);n+=4,l[h]={offset:u,length:d}}for(c=0;c<a.length;c++){var p=a[c];l[p]&&(o[p.trim()]=t[p.trim()].parse(e,l[p].offset,l[p].length,o))}return o},_tabOffset:function(e,n,r){for(var i=t._bin,s=i.readUshort(e,r+4),a=r+12,o=0;o<s;o++){var l=i.readASCII(e,a,4);a+=4,i.readUint(e,a),a+=4;var c=i.readUint(e,a);if(a+=4,i.readUint(e,a),a+=4,l==n)return c}return 0}};t._bin={readFixed:function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<8|e[t+3])/65540},readF2dot14:function(e,n){return t._bin.readShort(e,n)/16384},readInt:function(e,n){return t._bin._view(e).getInt32(n)},readInt8:function(e,n){return t._bin._view(e).getInt8(n)},readShort:function(e,n){return t._bin._view(e).getInt16(n)},readUshort:function(e,n){return t._bin._view(e).getUint16(n)},readUshorts:function(e,n,r){for(var i=[],s=0;s<r;s++)i.push(t._bin.readUshort(e,n+2*s));return i},readUint:function(e,n){return t._bin._view(e).getUint32(n)},readUint64:function(e,n){return 4294967296*t._bin.readUint(e,n)+t._bin.readUint(e,n+4)},readASCII:function(e,t,n){for(var r="",i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},readUnicode:function(e,t,n){for(var r="",i=0;i<n;i++){var s=e[t++]<<8|e[t++];r+=String.fromCharCode(s)}return r},_tdec:"undefined"!=typeof window&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(e,n,r){var i=t._bin._tdec;return i&&0==n&&r==e.length?i.decode(e):t._bin.readASCII(e,n,r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},readASCIIArray:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(String.fromCharCode(e[t+i]));return r},_view:function(e){return e._dataView||(e._dataView=e.buffer?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(new Uint8Array(e).buffer))}},t._lctf={},t._lctf.parse=function(e,n,r,i,s){var a=t._bin,o={},l=n;a.readFixed(e,n),n+=4;var c=a.readUshort(e,n);n+=2;var h=a.readUshort(e,n);n+=2;var u=a.readUshort(e,n);return n+=2,o.scriptList=t._lctf.readScriptList(e,l+c),o.featureList=t._lctf.readFeatureList(e,l+h),o.lookupList=t._lctf.readLookupList(e,l+u,s),o},t._lctf.readLookupList=function(e,n,r){var i=t._bin,s=n,a=[],o=i.readUshort(e,n);n+=2;for(var l=0;l<o;l++){var c=i.readUshort(e,n);n+=2;var h=t._lctf.readLookupTable(e,s+c,r);a.push(h)}return a},t._lctf.readLookupTable=function(e,n,r){var i=t._bin,s=n,a={tabs:[]};a.ltype=i.readUshort(e,n),n+=2,a.flag=i.readUshort(e,n),n+=2;var o=i.readUshort(e,n);n+=2;for(var l=a.ltype,c=0;c<o;c++){var h=i.readUshort(e,n);n+=2;var u=r(e,l,s+h,a);a.tabs.push(u)}return a},t._lctf.numOfOnes=function(e){for(var t=0,n=0;n<32;n++)0!=(e>>>n&1)&&t++;return t},t._lctf.readClassDef=function(e,n){var r=t._bin,i=[],s=r.readUshort(e,n);if(n+=2,1==s){var a=r.readUshort(e,n);n+=2;var o=r.readUshort(e,n);n+=2;for(var l=0;l<o;l++)i.push(a+l),i.push(a+l),i.push(r.readUshort(e,n)),n+=2}if(2==s){var c=r.readUshort(e,n);for(n+=2,l=0;l<c;l++)i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2}return i},t._lctf.getInterval=function(e,t){for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1];if(e[n+2],r<=t&&t<=i)return n}return-1},t._lctf.readCoverage=function(e,n){var r=t._bin,i={};i.fmt=r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);return n+=2,1==i.fmt&&(i.tab=r.readUshorts(e,n,s)),2==i.fmt&&(i.tab=r.readUshorts(e,n,3*s)),i},t._lctf.coverageIndex=function(e,n){var r=e.tab;if(1==e.fmt)return r.indexOf(n);if(2==e.fmt){var i=t._lctf.getInterval(r,n);if(-1!=i)return r[i+2]+(n-r[i])}return-1},t._lctf.readFeatureList=function(e,n){var r=t._bin,i=n,s=[],a=r.readUshort(e,n);n+=2;for(var o=0;o<a;o++){var l=r.readASCII(e,n,4);n+=4;var c=r.readUshort(e,n);n+=2;var h=t._lctf.readFeatureTable(e,i+c);h.tag=l.trim(),s.push(h)}return s},t._lctf.readFeatureTable=function(e,n){var r=t._bin,i=n,s={},a=r.readUshort(e,n);n+=2,a>0&&(s.featureParams=i+a);var o=r.readUshort(e,n);n+=2,s.tab=[];for(var l=0;l<o;l++)s.tab.push(r.readUshort(e,n+2*l));return s},t._lctf.readScriptList=function(e,n){var r=t._bin,i=n,s={},a=r.readUshort(e,n);n+=2;for(var o=0;o<a;o++){var l=r.readASCII(e,n,4);n+=4;var c=r.readUshort(e,n);n+=2,s[l.trim()]=t._lctf.readScriptTable(e,i+c)}return s},t._lctf.readScriptTable=function(e,n){var r=t._bin,i=n,s={},a=r.readUshort(e,n);n+=2,s.default=t._lctf.readLangSysTable(e,i+a);var o=r.readUshort(e,n);n+=2;for(var l=0;l<o;l++){var c=r.readASCII(e,n,4);n+=4;var h=r.readUshort(e,n);n+=2,s[c.trim()]=t._lctf.readLangSysTable(e,i+h)}return s},t._lctf.readLangSysTable=function(e,n){var r=t._bin,i={};r.readUshort(e,n),n+=2,i.reqFeature=r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);return n+=2,i.features=r.readUshorts(e,n,s),i},t.CFF={},t.CFF.parse=function(e,n,r){var i=t._bin;(e=new Uint8Array(e.buffer,n,r))[n=0],e[++n],e[++n],e[++n],n++;var s=[];n=t.CFF.readIndex(e,n,s);for(var a=[],o=0;o<s.length-1;o++)a.push(i.readASCII(e,n+s[o],s[o+1]-s[o]));n+=s[s.length-1];var l=[];n=t.CFF.readIndex(e,n,l);var c=[];for(o=0;o<l.length-1;o++)c.push(t.CFF.readDict(e,n+l[o],n+l[o+1]));n+=l[l.length-1];var h=c[0],u=[];n=t.CFF.readIndex(e,n,u);var d=[];for(o=0;o<u.length-1;o++)d.push(i.readASCII(e,n+u[o],u[o+1]-u[o]));if(n+=u[u.length-1],t.CFF.readSubrs(e,n,h),h.CharStrings){n=h.CharStrings,u=[],n=t.CFF.readIndex(e,n,u);var p=[];for(o=0;o<u.length-1;o++)p.push(i.readBytes(e,n+u[o],u[o+1]-u[o]));h.CharStrings=p}if(h.ROS){n=h.FDArray;var f=[];for(n=t.CFF.readIndex(e,n,f),h.FDArray=[],o=0;o<f.length-1;o++){var m=t.CFF.readDict(e,n+f[o],n+f[o+1]);t.CFF._readFDict(e,m,d),h.FDArray.push(m)}n+=f[f.length-1],n=h.FDSelect,h.FDSelect=[];var g=e[n];if(n++,3!=g)throw g;var A=i.readUshort(e,n);for(n+=2,o=0;o<A+1;o++)h.FDSelect.push(i.readUshort(e,n),e[n+2]),n+=3}return h.Encoding&&(h.Encoding=t.CFF.readEncoding(e,h.Encoding,h.CharStrings.length)),h.charset&&(h.charset=t.CFF.readCharset(e,h.charset,h.CharStrings.length)),t.CFF._readFDict(e,h,d),h},t.CFF._readFDict=function(e,n,r){var i;for(var s in n.Private&&(i=n.Private[1],n.Private=t.CFF.readDict(e,i,i+n.Private[0]),n.Private.Subrs&&t.CFF.readSubrs(e,i+n.Private.Subrs,n.Private)),n)-1!=["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(s)&&(n[s]=r[n[s]-426+35])},t.CFF.readSubrs=function(e,n,r){var i=t._bin,s=[];n=t.CFF.readIndex(e,n,s);var a,o=s.length;a=o<1240?107:o<33900?1131:32768,r.Bias=a,r.Subrs=[];for(var l=0;l<s.length-1;l++)r.Subrs.push(i.readBytes(e,n+s[l],s[l+1]-s[l]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(e,t){for(var n=0;n<e.charset.length;n++)if(e.charset[n]==t)return n;return-1},t.CFF.glyphBySE=function(e,n){return n<0||n>255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[n])},t.CFF.readEncoding=function(e,n,r){t._bin;var i=[".notdef"],s=e[n];if(n++,0!=s)throw"error: unknown encoding format: "+s;var a=e[n];n++;for(var o=0;o<a;o++)i.push(e[n+o]);return i},t.CFF.readCharset=function(e,n,r){var i=t._bin,s=[".notdef"],a=e[n];if(n++,0==a)for(var o=0;o<r;o++){var l=i.readUshort(e,n);n+=2,s.push(l)}else{if(1!=a&&2!=a)throw"error: format: "+a;for(;s.length<r;){l=i.readUshort(e,n),n+=2;var c=0;for(1==a?(c=e[n],n++):(c=i.readUshort(e,n),n+=2),o=0;o<=c;o++)s.push(l),l++}}return s},t.CFF.readIndex=function(e,n,r){var i=t._bin,s=i.readUshort(e,n)+1,a=e[n+=2];if(n++,1==a)for(var o=0;o<s;o++)r.push(e[n+o]);else if(2==a)for(o=0;o<s;o++)r.push(i.readUshort(e,n+2*o));else if(3==a)for(o=0;o<s;o++)r.push(16777215&i.readUint(e,n+3*o-1));else if(1!=s)throw"unsupported offset size: "+a+", count: "+s;return(n+=s*a)-1},t.CFF.getCharString=function(e,n,r){var i=t._bin,s=e[n],a=e[n+1];e[n+2],e[n+3],e[n+4];var o=1,l=null,c=null;s<=20&&(l=s,o=1),12==s&&(l=100*s+a,o=2),21<=s&&s<=27&&(l=s,o=1),28==s&&(c=i.readShort(e,n+1),o=3),29<=s&&s<=31&&(l=s,o=1),32<=s&&s<=246&&(c=s-139,o=1),247<=s&&s<=250&&(c=256*(s-247)+a+108,o=2),251<=s&&s<=254&&(c=256*-(s-251)-a-108,o=2),255==s&&(c=i.readInt(e,n+1)/65535,o=5),r.val=null!=c?c:"o"+l,r.size=o},t.CFF.readCharString=function(e,n,r){for(var i=n+r,s=t._bin,a=[];n<i;){var o=e[n],l=e[n+1];e[n+2],e[n+3],e[n+4];var c=1,h=null,u=null;o<=20&&(h=o,c=1),12==o&&(h=100*o+l,c=2),19!=o&&20!=o||(h=o,c=2),21<=o&&o<=27&&(h=o,c=1),28==o&&(u=s.readShort(e,n+1),c=3),29<=o&&o<=31&&(h=o,c=1),32<=o&&o<=246&&(u=o-139,c=1),247<=o&&o<=250&&(u=256*(o-247)+l+108,c=2),251<=o&&o<=254&&(u=256*-(o-251)-l-108,c=2),255==o&&(u=s.readInt(e,n+1)/65535,c=5),a.push(null!=u?u:"o"+h),n+=c}return a},t.CFF.readDict=function(e,n,r){for(var i=t._bin,s={},a=[];n<r;){var o=e[n],l=e[n+1];e[n+2],e[n+3],e[n+4];var c=1,h=null,u=null;if(28==o&&(u=i.readShort(e,n+1),c=3),29==o&&(u=i.readInt(e,n+1),c=5),32<=o&&o<=246&&(u=o-139,c=1),247<=o&&o<=250&&(u=256*(o-247)+l+108,c=2),251<=o&&o<=254&&(u=256*-(o-251)-l-108,c=2),255==o)throw u=i.readInt(e,n+1)/65535,c=5,"unknown number";if(30==o){var d=[];for(c=1;;){var p=e[n+c];c++;var f=p>>4,m=15&p;if(15!=f&&d.push(f),15!=m&&d.push(m),15==m)break}for(var g="",A=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],v=0;v<d.length;v++)g+=A[d[v]];u=parseFloat(g)}o<=21&&(h=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][o],c=1,12==o&&(h=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],c=2)),null!=h?(s[h]=1==a.length?a[0]:a,a=[]):a.push(u),n+=c}return s},t.cmap={},t.cmap.parse=function(e,n,r){e=new Uint8Array(e.buffer,n,r),n=0;var i=t._bin,s={};i.readUshort(e,n),n+=2;var a=i.readUshort(e,n);n+=2;var o=[];s.tables=[];for(var l=0;l<a;l++){var c=i.readUshort(e,n);n+=2;var h=i.readUshort(e,n);n+=2;var u=i.readUint(e,n);n+=4;var d="p"+c+"e"+h,p=o.indexOf(u);if(-1==p){var f;p=s.tables.length,o.push(u);var m=i.readUshort(e,u);0==m?f=t.cmap.parse0(e,u):4==m?f=t.cmap.parse4(e,u):6==m?f=t.cmap.parse6(e,u):12==m?f=t.cmap.parse12(e,u):console.debug("unknown format: "+m,c,h,u),s.tables.push(f)}if(null!=s[d])throw"multiple tables for one platform+encoding";s[d]=p}return s},t.cmap.parse0=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,i.map=[];for(var a=0;a<s-6;a++)i.map.push(e[n+a]);return i},t.cmap.parse4=function(e,n){var r=t._bin,i=n,s={};s.format=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2;var o=r.readUshort(e,n);n+=2;var l=o/2;s.searchRange=r.readUshort(e,n),n+=2,s.entrySelector=r.readUshort(e,n),n+=2,s.rangeShift=r.readUshort(e,n),n+=2,s.endCount=r.readUshorts(e,n,l),n+=2*l,n+=2,s.startCount=r.readUshorts(e,n,l),n+=2*l,s.idDelta=[];for(var c=0;c<l;c++)s.idDelta.push(r.readShort(e,n)),n+=2;for(s.idRangeOffset=r.readUshorts(e,n,l),n+=2*l,s.glyphIdArray=[];n<i+a;)s.glyphIdArray.push(r.readUshort(e,n)),n+=2;return s},t.cmap.parse6=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,i.firstCode=r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);n+=2,i.glyphIdArray=[];for(var a=0;a<s;a++)i.glyphIdArray.push(r.readUshort(e,n)),n+=2;return i},t.cmap.parse12=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,n+=2,r.readUint(e,n),n+=4,r.readUint(e,n),n+=4;var s=r.readUint(e,n);n+=4,i.groups=[];for(var a=0;a<s;a++){var o=n+12*a,l=r.readUint(e,o+0),c=r.readUint(e,o+4),h=r.readUint(e,o+8);i.groups.push([l,c,h])}return i},t.glyf={},t.glyf.parse=function(e,t,n,r){for(var i=[],s=0;s<r.maxp.numGlyphs;s++)i.push(null);return i},t.glyf._parseGlyf=function(e,n){var r=t._bin,i=e._data,s=t._tabOffset(i,"glyf",e._offset)+e.loca[n];if(e.loca[n]==e.loca[n+1])return null;var a={};if(a.noc=r.readShort(i,s),s+=2,a.xMin=r.readShort(i,s),s+=2,a.yMin=r.readShort(i,s),s+=2,a.xMax=r.readShort(i,s),s+=2,a.yMax=r.readShort(i,s),s+=2,a.xMin>=a.xMax||a.yMin>=a.yMax)return null;if(a.noc>0){a.endPts=[];for(var o=0;o<a.noc;o++)a.endPts.push(r.readUshort(i,s)),s+=2;var l=r.readUshort(i,s);if(s+=2,i.length-s<l)return null;a.instructions=r.readBytes(i,s,l),s+=l;var c=a.endPts[a.noc-1]+1;for(a.flags=[],o=0;o<c;o++){var h=i[s];if(s++,a.flags.push(h),0!=(8&h)){var u=i[s];s++;for(var d=0;d<u;d++)a.flags.push(h),o++}}for(a.xs=[],o=0;o<c;o++){var p=0!=(2&a.flags[o]),f=0!=(16&a.flags[o]);p?(a.xs.push(f?i[s]:-i[s]),s++):f?a.xs.push(0):(a.xs.push(r.readShort(i,s)),s+=2)}for(a.ys=[],o=0;o<c;o++)p=0!=(4&a.flags[o]),f=0!=(32&a.flags[o]),p?(a.ys.push(f?i[s]:-i[s]),s++):f?a.ys.push(0):(a.ys.push(r.readShort(i,s)),s+=2);var m=0,g=0;for(o=0;o<c;o++)m+=a.xs[o],g+=a.ys[o],a.xs[o]=m,a.ys[o]=g}else{var A;a.parts=[];do{A=r.readUshort(i,s),s+=2;var v={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(a.parts.push(v),v.glyphIndex=r.readUshort(i,s),s+=2,1&A){var y=r.readShort(i,s);s+=2;var x=r.readShort(i,s);s+=2}else y=r.readInt8(i,s),s++,x=r.readInt8(i,s),s++;2&A?(v.m.tx=y,v.m.ty=x):(v.p1=y,v.p2=x),8&A?(v.m.a=v.m.d=r.readF2dot14(i,s),s+=2):64&A?(v.m.a=r.readF2dot14(i,s),s+=2,v.m.d=r.readF2dot14(i,s),s+=2):128&A&&(v.m.a=r.readF2dot14(i,s),s+=2,v.m.b=r.readF2dot14(i,s),s+=2,v.m.c=r.readF2dot14(i,s),s+=2,v.m.d=r.readF2dot14(i,s),s+=2)}while(32&A);if(256&A){var b=r.readUshort(i,s);for(s+=2,a.instr=[],o=0;o<b;o++)a.instr.push(i[s]),s++}}return a},t.GPOS={},t.GPOS.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GPOS.subt)},t.GPOS.subt=function(e,n,r,i){var s=t._bin,a=r,o={};if(o.fmt=s.readUshort(e,r),r+=2,1==n||2==n||3==n||7==n||8==n&&o.fmt<=2){var l=s.readUshort(e,r);r+=2,o.coverage=t._lctf.readCoverage(e,l+a)}if(1==n&&1==o.fmt){var c=s.readUshort(e,r);r+=2;var h=t._lctf.numOfOnes(c);0!=c&&(o.pos=t.GPOS.readValueRecord(e,r,c))}else if(2==n&&o.fmt>=1&&o.fmt<=2){c=s.readUshort(e,r),r+=2;var u=s.readUshort(e,r);r+=2,h=t._lctf.numOfOnes(c);var d=t._lctf.numOfOnes(u);if(1==o.fmt){o.pairsets=[];var p=s.readUshort(e,r);r+=2;for(var f=0;f<p;f++){var m=a+s.readUshort(e,r);r+=2;var g=s.readUshort(e,m);m+=2;for(var A=[],v=0;v<g;v++){var y=s.readUshort(e,m);m+=2,0!=c&&(w=t.GPOS.readValueRecord(e,m,c),m+=2*h),0!=u&&(M=t.GPOS.readValueRecord(e,m,u),m+=2*d),A.push({gid2:y,val1:w,val2:M})}o.pairsets.push(A)}}if(2==o.fmt){var x=s.readUshort(e,r);r+=2;var b=s.readUshort(e,r);r+=2;var E=s.readUshort(e,r);r+=2;var _=s.readUshort(e,r);for(r+=2,o.classDef1=t._lctf.readClassDef(e,a+x),o.classDef2=t._lctf.readClassDef(e,a+b),o.matrix=[],f=0;f<E;f++){var S=[];for(v=0;v<_;v++){var w=null,M=null;0!=c&&(w=t.GPOS.readValueRecord(e,r,c),r+=2*h),0!=u&&(M=t.GPOS.readValueRecord(e,r,u),r+=2*d),S.push({val1:w,val2:M})}o.matrix.push(S)}}}else{if(9==n&&1==o.fmt){var C=s.readUshort(e,r);r+=2;var T=s.readUint(e,r);if(r+=4,9==i.ltype)i.ltype=C;else if(i.ltype!=C)throw"invalid extension substitution";return t.GPOS.subt(e,i.ltype,a+T)}console.debug("unsupported GPOS table LookupType",n,"format",o.fmt)}return o},t.GPOS.readValueRecord=function(e,n,r){var i=t._bin,s=[];return s.push(1&r?i.readShort(e,n):0),n+=1&r?2:0,s.push(2&r?i.readShort(e,n):0),n+=2&r?2:0,s.push(4&r?i.readShort(e,n):0),n+=4&r?2:0,s.push(8&r?i.readShort(e,n):0),n+=8&r?2:0,s},t.GSUB={},t.GSUB.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GSUB.subt)},t.GSUB.subt=function(e,n,r,i){var s=t._bin,a=r,o={};if(o.fmt=s.readUshort(e,r),r+=2,1!=n&&4!=n&&5!=n&&6!=n)return null;if(1==n||4==n||5==n&&o.fmt<=2||6==n&&o.fmt<=2){var l=s.readUshort(e,r);r+=2,o.coverage=t._lctf.readCoverage(e,a+l)}if(1==n&&o.fmt>=1&&o.fmt<=2){if(1==o.fmt)o.delta=s.readShort(e,r),r+=2;else if(2==o.fmt){var c=s.readUshort(e,r);r+=2,o.newg=s.readUshorts(e,r,c),r+=2*o.newg.length}}else if(4==n){o.vals=[],c=s.readUshort(e,r),r+=2;for(var h=0;h<c;h++){var u=s.readUshort(e,r);r+=2,o.vals.push(t.GSUB.readLigatureSet(e,a+u))}}else if(5==n&&2==o.fmt){if(2==o.fmt){var d=s.readUshort(e,r);r+=2,o.cDef=t._lctf.readClassDef(e,a+d),o.scset=[];var p=s.readUshort(e,r);for(r+=2,h=0;h<p;h++){var f=s.readUshort(e,r);r+=2,o.scset.push(0==f?null:t.GSUB.readSubClassSet(e,a+f))}}}else if(6==n&&3==o.fmt){if(3==o.fmt){for(h=0;h<3;h++){c=s.readUshort(e,r),r+=2;for(var m=[],g=0;g<c;g++)m.push(t._lctf.readCoverage(e,a+s.readUshort(e,r+2*g)));r+=2*c,0==h&&(o.backCvg=m),1==h&&(o.inptCvg=m),2==h&&(o.ahedCvg=m)}c=s.readUshort(e,r),r+=2,o.lookupRec=t.GSUB.readSubstLookupRecords(e,r,c)}}else{if(7==n&&1==o.fmt){var A=s.readUshort(e,r);r+=2;var v=s.readUint(e,r);if(r+=4,9==i.ltype)i.ltype=A;else if(i.ltype!=A)throw"invalid extension substitution";return t.GSUB.subt(e,i.ltype,a+v)}console.debug("unsupported GSUB table LookupType",n,"format",o.fmt)}return o},t.GSUB.readSubClassSet=function(e,n){var r=t._bin.readUshort,i=n,s=[],a=r(e,n);n+=2;for(var o=0;o<a;o++){var l=r(e,n);n+=2,s.push(t.GSUB.readSubClassRule(e,i+l))}return s},t.GSUB.readSubClassRule=function(e,n){var r=t._bin.readUshort,i={},s=r(e,n),a=r(e,n+=2);n+=2,i.input=[];for(var o=0;o<s-1;o++)i.input.push(r(e,n)),n+=2;return i.substLookupRecords=t.GSUB.readSubstLookupRecords(e,n,a),i},t.GSUB.readSubstLookupRecords=function(e,n,r){for(var i=t._bin.readUshort,s=[],a=0;a<r;a++)s.push(i(e,n),i(e,n+2)),n+=4;return s},t.GSUB.readChainSubClassSet=function(e,n){var r=t._bin,i=n,s=[],a=r.readUshort(e,n);n+=2;for(var o=0;o<a;o++){var l=r.readUshort(e,n);n+=2,s.push(t.GSUB.readChainSubClassRule(e,i+l))}return s},t.GSUB.readChainSubClassRule=function(e,n){for(var r=t._bin,i={},s=["backtrack","input","lookahead"],a=0;a<s.length;a++){var o=r.readUshort(e,n);n+=2,1==a&&o--,i[s[a]]=r.readUshorts(e,n,o),n+=2*i[s[a]].length}return o=r.readUshort(e,n),n+=2,i.subst=r.readUshorts(e,n,2*o),n+=2*i.subst.length,i},t.GSUB.readLigatureSet=function(e,n){var r=t._bin,i=n,s=[],a=r.readUshort(e,n);n+=2;for(var o=0;o<a;o++){var l=r.readUshort(e,n);n+=2,s.push(t.GSUB.readLigature(e,i+l))}return s},t.GSUB.readLigature=function(e,n){var r=t._bin,i={chain:[]};i.nglyph=r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);n+=2;for(var a=0;a<s-1;a++)i.chain.push(r.readUshort(e,n)),n+=2;return i},t.head={},t.head.parse=function(e,n,r){var i=t._bin,s={};return i.readFixed(e,n),n+=4,s.fontRevision=i.readFixed(e,n),n+=4,i.readUint(e,n),n+=4,i.readUint(e,n),n+=4,s.flags=i.readUshort(e,n),n+=2,s.unitsPerEm=i.readUshort(e,n),n+=2,s.created=i.readUint64(e,n),n+=8,s.modified=i.readUint64(e,n),n+=8,s.xMin=i.readShort(e,n),n+=2,s.yMin=i.readShort(e,n),n+=2,s.xMax=i.readShort(e,n),n+=2,s.yMax=i.readShort(e,n),n+=2,s.macStyle=i.readUshort(e,n),n+=2,s.lowestRecPPEM=i.readUshort(e,n),n+=2,s.fontDirectionHint=i.readShort(e,n),n+=2,s.indexToLocFormat=i.readShort(e,n),n+=2,s.glyphDataFormat=i.readShort(e,n),n+=2,s},t.hhea={},t.hhea.parse=function(e,n,r){var i=t._bin,s={};return i.readFixed(e,n),n+=4,s.ascender=i.readShort(e,n),n+=2,s.descender=i.readShort(e,n),n+=2,s.lineGap=i.readShort(e,n),n+=2,s.advanceWidthMax=i.readUshort(e,n),n+=2,s.minLeftSideBearing=i.readShort(e,n),n+=2,s.minRightSideBearing=i.readShort(e,n),n+=2,s.xMaxExtent=i.readShort(e,n),n+=2,s.caretSlopeRise=i.readShort(e,n),n+=2,s.caretSlopeRun=i.readShort(e,n),n+=2,s.caretOffset=i.readShort(e,n),n+=2,n+=8,s.metricDataFormat=i.readShort(e,n),n+=2,s.numberOfHMetrics=i.readUshort(e,n),n+=2,s},t.hmtx={},t.hmtx.parse=function(e,n,r,i){for(var s=t._bin,a={aWidth:[],lsBearing:[]},o=0,l=0,c=0;c<i.maxp.numGlyphs;c++)c<i.hhea.numberOfHMetrics&&(o=s.readUshort(e,n),n+=2,l=s.readShort(e,n),n+=2),a.aWidth.push(o),a.lsBearing.push(l);return a},t.kern={},t.kern.parse=function(e,n,r,i){var s=t._bin,a=s.readUshort(e,n);if(n+=2,1==a)return t.kern.parseV1(e,n-2,r,i);var o=s.readUshort(e,n);n+=2;for(var l={glyph1:[],rval:[]},c=0;c<o;c++){n+=2,r=s.readUshort(e,n),n+=2;var h=s.readUshort(e,n);n+=2;var u=h>>>8;if(0!=(u&=15))throw"unknown kern table format: "+u;n=t.kern.readFormat0(e,n,l)}return l},t.kern.parseV1=function(e,n,r,i){var s=t._bin;s.readFixed(e,n),n+=4;var a=s.readUint(e,n);n+=4;for(var o={glyph1:[],rval:[]},l=0;l<a;l++){s.readUint(e,n),n+=4;var c=s.readUshort(e,n);n+=2,s.readUshort(e,n),n+=2;var h=c>>>8;if(0!=(h&=15))throw"unknown kern table format: "+h;n=t.kern.readFormat0(e,n,o)}return o},t.kern.readFormat0=function(e,n,r){var i=t._bin,s=-1,a=i.readUshort(e,n);n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2;for(var o=0;o<a;o++){var l=i.readUshort(e,n);n+=2;var c=i.readUshort(e,n);n+=2;var h=i.readShort(e,n);n+=2,l!=s&&(r.glyph1.push(l),r.rval.push({glyph2:[],vals:[]}));var u=r.rval[r.rval.length-1];u.glyph2.push(c),u.vals.push(h),s=l}return n},t.loca={},t.loca.parse=function(e,n,r,i){var s=t._bin,a=[],o=i.head.indexToLocFormat,l=i.maxp.numGlyphs+1;if(0==o)for(var c=0;c<l;c++)a.push(s.readUshort(e,n+(c<<1))<<1);if(1==o)for(c=0;c<l;c++)a.push(s.readUint(e,n+(c<<2)));return a},t.maxp={},t.maxp.parse=function(e,n,r){var i=t._bin,s={},a=i.readUint(e,n);return n+=4,s.numGlyphs=i.readUshort(e,n),n+=2,65536==a&&(s.maxPoints=i.readUshort(e,n),n+=2,s.maxContours=i.readUshort(e,n),n+=2,s.maxCompositePoints=i.readUshort(e,n),n+=2,s.maxCompositeContours=i.readUshort(e,n),n+=2,s.maxZones=i.readUshort(e,n),n+=2,s.maxTwilightPoints=i.readUshort(e,n),n+=2,s.maxStorage=i.readUshort(e,n),n+=2,s.maxFunctionDefs=i.readUshort(e,n),n+=2,s.maxInstructionDefs=i.readUshort(e,n),n+=2,s.maxStackElements=i.readUshort(e,n),n+=2,s.maxSizeOfInstructions=i.readUshort(e,n),n+=2,s.maxComponentElements=i.readUshort(e,n),n+=2,s.maxComponentDepth=i.readUshort(e,n),n+=2),s},t.name={},t.name.parse=function(e,n,r){var i=t._bin,s={};i.readUshort(e,n),n+=2;var a=i.readUshort(e,n);n+=2,i.readUshort(e,n);for(var o,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],c=n+=2,h=0;h<a;h++){var u=i.readUshort(e,n);n+=2;var d=i.readUshort(e,n);n+=2;var p=i.readUshort(e,n);n+=2;var f=i.readUshort(e,n);n+=2;var m=i.readUshort(e,n);n+=2;var g=i.readUshort(e,n);n+=2;var A,v=l[f],y=c+12*a+g;if(0==u)A=i.readUnicode(e,y,m/2);else if(3==u&&0==d)A=i.readUnicode(e,y,m/2);else if(0==d)A=i.readASCII(e,y,m);else if(1==d)A=i.readUnicode(e,y,m/2);else if(3==d)A=i.readUnicode(e,y,m/2);else{if(1!=u)throw"unknown encoding "+d+", platformID: "+u;A=i.readASCII(e,y,m),console.debug("reading unknown MAC encoding "+d+" as ASCII")}var x="p"+u+","+p.toString(16);null==s[x]&&(s[x]={}),s[x][void 0!==v?v:f]=A,s[x]._lang=p}for(var b in s)if(null!=s[b].postScriptName&&1033==s[b]._lang)return s[b];for(var b in s)if(null!=s[b].postScriptName&&0==s[b]._lang)return s[b];for(var b in s)if(null!=s[b].postScriptName&&3084==s[b]._lang)return s[b];for(var b in s)if(null!=s[b].postScriptName)return s[b];for(var b in s){o=b;break}return console.debug("returning name table with languageID "+s[o]._lang),s[o]},t["OS/2"]={},t["OS/2"].parse=function(e,n,r){var i=t._bin.readUshort(e,n);n+=2;var s={};if(0==i)t["OS/2"].version0(e,n,s);else if(1==i)t["OS/2"].version1(e,n,s);else if(2==i||3==i||4==i)t["OS/2"].version2(e,n,s);else{if(5!=i)throw"unknown OS/2 table version: "+i;t["OS/2"].version5(e,n,s)}return s},t["OS/2"].version0=function(e,n,r){var i=t._bin;return r.xAvgCharWidth=i.readShort(e,n),n+=2,r.usWeightClass=i.readUshort(e,n),n+=2,r.usWidthClass=i.readUshort(e,n),n+=2,r.fsType=i.readUshort(e,n),n+=2,r.ySubscriptXSize=i.readShort(e,n),n+=2,r.ySubscriptYSize=i.readShort(e,n),n+=2,r.ySubscriptXOffset=i.readShort(e,n),n+=2,r.ySubscriptYOffset=i.readShort(e,n),n+=2,r.ySuperscriptXSize=i.readShort(e,n),n+=2,r.ySuperscriptYSize=i.readShort(e,n),n+=2,r.ySuperscriptXOffset=i.readShort(e,n),n+=2,r.ySuperscriptYOffset=i.readShort(e,n),n+=2,r.yStrikeoutSize=i.readShort(e,n),n+=2,r.yStrikeoutPosition=i.readShort(e,n),n+=2,r.sFamilyClass=i.readShort(e,n),n+=2,r.panose=i.readBytes(e,n,10),n+=10,r.ulUnicodeRange1=i.readUint(e,n),n+=4,r.ulUnicodeRange2=i.readUint(e,n),n+=4,r.ulUnicodeRange3=i.readUint(e,n),n+=4,r.ulUnicodeRange4=i.readUint(e,n),n+=4,r.achVendID=[i.readInt8(e,n),i.readInt8(e,n+1),i.readInt8(e,n+2),i.readInt8(e,n+3)],n+=4,r.fsSelection=i.readUshort(e,n),n+=2,r.usFirstCharIndex=i.readUshort(e,n),n+=2,r.usLastCharIndex=i.readUshort(e,n),n+=2,r.sTypoAscender=i.readShort(e,n),n+=2,r.sTypoDescender=i.readShort(e,n),n+=2,r.sTypoLineGap=i.readShort(e,n),n+=2,r.usWinAscent=i.readUshort(e,n),n+=2,r.usWinDescent=i.readUshort(e,n),n+2},t["OS/2"].version1=function(e,n,r){var i=t._bin;return n=t["OS/2"].version0(e,n,r),r.ulCodePageRange1=i.readUint(e,n),n+=4,r.ulCodePageRange2=i.readUint(e,n),n+4},t["OS/2"].version2=function(e,n,r){var i=t._bin;return n=t["OS/2"].version1(e,n,r),r.sxHeight=i.readShort(e,n),n+=2,r.sCapHeight=i.readShort(e,n),n+=2,r.usDefault=i.readUshort(e,n),n+=2,r.usBreak=i.readUshort(e,n),n+=2,r.usMaxContext=i.readUshort(e,n),n+2},t["OS/2"].version5=function(e,n,r){var i=t._bin;return n=t["OS/2"].version2(e,n,r),r.usLowerOpticalPointSize=i.readUshort(e,n),n+=2,r.usUpperOpticalPointSize=i.readUshort(e,n),n+2},t.post={},t.post.parse=function(e,n,r){var i=t._bin,s={};return s.version=i.readFixed(e,n),n+=4,s.italicAngle=i.readFixed(e,n),n+=4,s.underlinePosition=i.readShort(e,n),n+=2,s.underlineThickness=i.readShort(e,n),n+=2,s},null==t&&(t={}),null==t.U&&(t.U={}),t.U.codeToGlyph=function(e,t){var n=e.cmap,r=-1;if(null!=n.p0e4?r=n.p0e4:null!=n.p3e1?r=n.p3e1:null!=n.p1e0?r=n.p1e0:null!=n.p0e3&&(r=n.p0e3),-1==r)throw"no familiar platform and encoding!";var i=n.tables[r];if(0==i.format)return t>=i.map.length?0:i.map[t];if(4==i.format){for(var s=-1,a=0;a<i.endCount.length;a++)if(t<=i.endCount[a]){s=a;break}return-1==s||i.startCount[s]>t?0:65535&(0!=i.idRangeOffset[s]?i.glyphIdArray[t-i.startCount[s]+(i.idRangeOffset[s]>>1)-(i.idRangeOffset.length-s)]:t+i.idDelta[s])}if(12==i.format){if(t>i.groups[i.groups.length-1][1])return 0;for(a=0;a<i.groups.length;a++){var o=i.groups[a];if(o[0]<=t&&t<=o[1])return o[2]+(t-o[0])}return 0}throw"unknown cmap table format "+i.format},t.U.glyphToPath=function(e,n){var r={cmds:[],crds:[]};if(e.SVG&&e.SVG.entries[n]){var i=e.SVG.entries[n];return null==i?r:("string"==typeof i&&(i=t.SVG.toPath(i),e.SVG.entries[n]=i),i)}if(e.CFF){var s={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:e.CFF.Private?e.CFF.Private.defaultWidthX:0,open:!1},a=e.CFF,o=e.CFF.Private;if(a.ROS){for(var l=0;a.FDSelect[l+2]<=n;)l+=2;o=a.FDArray[a.FDSelect[l+1]].Private}t.U._drawCFF(e.CFF.CharStrings[n],s,a,o,r)}else e.glyf&&t.U._drawGlyf(n,e,r);return r},t.U._drawGlyf=function(e,n,r){var i=n.glyf[e];null==i&&(i=n.glyf[e]=t.glyf._parseGlyf(n,e)),null!=i&&(i.noc>-1?t.U._simpleGlyph(i,r):t.U._compoGlyph(i,n,r))},t.U._simpleGlyph=function(e,n){for(var r=0;r<e.noc;r++){for(var i=0==r?0:e.endPts[r-1]+1,s=e.endPts[r],a=i;a<=s;a++){var o=a==i?s:a-1,l=a==s?i:a+1,c=1&e.flags[a],h=1&e.flags[o],u=1&e.flags[l],d=e.xs[a],p=e.ys[a];if(a==i)if(c){if(!h){t.U.P.moveTo(n,d,p);continue}t.U.P.moveTo(n,e.xs[o],e.ys[o])}else h?t.U.P.moveTo(n,e.xs[o],e.ys[o]):t.U.P.moveTo(n,(e.xs[o]+d)/2,(e.ys[o]+p)/2);c?h&&t.U.P.lineTo(n,d,p):u?t.U.P.qcurveTo(n,d,p,e.xs[l],e.ys[l]):t.U.P.qcurveTo(n,d,p,(d+e.xs[l])/2,(p+e.ys[l])/2)}t.U.P.closePath(n)}},t.U._compoGlyph=function(e,n,r){for(var i=0;i<e.parts.length;i++){var s={cmds:[],crds:[]},a=e.parts[i];t.U._drawGlyf(a.glyphIndex,n,s);for(var o=a.m,l=0;l<s.crds.length;l+=2){var c=s.crds[l],h=s.crds[l+1];r.crds.push(c*o.a+h*o.b+o.tx),r.crds.push(c*o.c+h*o.d+o.ty)}for(l=0;l<s.cmds.length;l++)r.cmds.push(s.cmds[l])}},t.U._getGlyphClass=function(e,n){var r=t._lctf.getInterval(n,e);return-1==r?0:n[r+2]},t.U.getPairAdjustment=function(e,n,r){var i=0,s=!1;if(e.GPOS)for(var a=e.GPOS,o=a.lookupList,l=a.featureList,c=[],h=0;h<l.length;h++){var u=l[h];if("kern"==u.tag){s=!0;for(var d=0;d<u.tab.length;d++)if(!c[u.tab[d]]){c[u.tab[d]]=!0;for(var p=o[u.tab[d]],f=0;f<p.tabs.length;f++)if(null!=p.tabs[f]){var m,g=p.tabs[f];if(!g.coverage||-1!=(m=t._lctf.coverageIndex(g.coverage,n)))if(1==p.ltype);else if(2==p.ltype){var A;if(1==g.fmt){var v=g.pairsets[m];for(h=0;h<v.length;h++)v[h].gid2==r&&(A=v[h])}else if(2==g.fmt){var y=t.U._getGlyphClass(n,g.classDef1),x=t.U._getGlyphClass(r,g.classDef2);A=g.matrix[y][x]}A&&A.val1&&A.val1[2]&&(i+=A.val1[2]),A&&A.val2&&A.val2[0]&&(i+=A.val2[0])}}}}}if(e.kern&&!s){var b=e.kern.glyph1.indexOf(n);if(-1!=b){var E=e.kern.rval[b].glyph2.indexOf(r);-1!=E&&(i+=e.kern.rval[b].vals[E])}}return i},t.U._applySubs=function(e,n,r,i){for(var s=e.length-n-1,a=0;a<r.tabs.length;a++)if(null!=r.tabs[a]){var o,l=r.tabs[a];if(!l.coverage||-1!=(o=t._lctf.coverageIndex(l.coverage,e[n])))if(1==r.ltype)e[n],1==l.fmt?e[n]=e[n]+l.delta:e[n]=l.newg[o];else if(4==r.ltype)for(var c=l.vals[o],h=0;h<c.length;h++){var u=c[h],d=u.chain.length;if(!(d>s)){for(var p=!0,f=0,m=0;m<d;m++){for(;-1==e[n+f+(1+m)];)f++;u.chain[m]!=e[n+f+(1+m)]&&(p=!1)}if(p){for(e[n]=u.nglyph,m=0;m<d+f;m++)e[n+m+1]=-1;break}}}else if(5==r.ltype&&2==l.fmt)for(var g=t._lctf.getInterval(l.cDef,e[n]),A=l.cDef[g+2],v=l.scset[A],y=0;y<v.length;y++){var x=v[y],b=x.input;if(!(b.length>s)){for(p=!0,m=0;m<b.length;m++){var E=t._lctf.getInterval(l.cDef,e[n+1+m]);if(-1==g&&l.cDef[E+2]!=b[m]){p=!1;break}}if(p){var _=x.substLookupRecords;for(h=0;h<_.length;h+=2)_[h],_[h+1]}}}else if(6==r.ltype&&3==l.fmt){if(!t.U._glsCovered(e,l.backCvg,n-l.backCvg.length))continue;if(!t.U._glsCovered(e,l.inptCvg,n))continue;if(!t.U._glsCovered(e,l.ahedCvg,n+l.inptCvg.length))continue;var S=l.lookupRec;for(y=0;y<S.length;y+=2){g=S[y];var w=i[S[y+1]];t.U._applySubs(e,n+g,w,i)}}}},t.U._glsCovered=function(e,n,r){for(var i=0;i<n.length;i++)if(-1==t._lctf.coverageIndex(n[i],e[r+i]))return!1;return!0},t.U.glyphsToPath=function(e,n,r){for(var i={cmds:[],crds:[]},s=0,a=0;a<n.length;a++){var o=n[a];if(-1!=o){for(var l=a<n.length-1&&-1!=n[a+1]?n[a+1]:0,c=t.U.glyphToPath(e,o),h=0;h<c.crds.length;h+=2)i.crds.push(c.crds[h]+s),i.crds.push(c.crds[h+1]);for(r&&i.cmds.push(r),h=0;h<c.cmds.length;h++)i.cmds.push(c.cmds[h]);r&&i.cmds.push("X"),s+=e.hmtx.aWidth[o],a<n.length-1&&(s+=t.U.getPairAdjustment(e,o,l))}}return i},t.U.P={},t.U.P.moveTo=function(e,t,n){e.cmds.push("M"),e.crds.push(t,n)},t.U.P.lineTo=function(e,t,n){e.cmds.push("L"),e.crds.push(t,n)},t.U.P.curveTo=function(e,t,n,r,i,s,a){e.cmds.push("C"),e.crds.push(t,n,r,i,s,a)},t.U.P.qcurveTo=function(e,t,n,r,i){e.cmds.push("Q"),e.crds.push(t,n,r,i)},t.U.P.closePath=function(e){e.cmds.push("Z")},t.U._drawCFF=function(e,n,r,i,s){for(var a=n.stack,o=n.nStems,l=n.haveWidth,c=n.width,h=n.open,u=0,d=n.x,p=n.y,f=0,m=0,g=0,A=0,v=0,y=0,x=0,b=0,E=0,_=0,S={val:0,size:0};u<e.length;){t.CFF.getCharString(e,u,S);var w=S.val;if(u+=S.size,"o1"==w||"o18"==w)a.length%2!=0&&!l&&(c=a.shift()+i.nominalWidthX),o+=a.length>>1,a.length=0,l=!0;else if("o3"==w||"o23"==w)a.length%2!=0&&!l&&(c=a.shift()+i.nominalWidthX),o+=a.length>>1,a.length=0,l=!0;else if("o4"==w)a.length>1&&!l&&(c=a.shift()+i.nominalWidthX,l=!0),h&&t.U.P.closePath(s),p+=a.pop(),t.U.P.moveTo(s,d,p),h=!0;else if("o5"==w)for(;a.length>0;)d+=a.shift(),p+=a.shift(),t.U.P.lineTo(s,d,p);else if("o6"==w||"o7"==w)for(var M=a.length,C="o6"==w,T=0;T<M;T++){var I=a.shift();C?d+=I:p+=I,C=!C,t.U.P.lineTo(s,d,p)}else if("o8"==w||"o24"==w){M=a.length;for(var B=0;B+6<=M;)f=d+a.shift(),m=p+a.shift(),g=f+a.shift(),A=m+a.shift(),d=g+a.shift(),p=A+a.shift(),t.U.P.curveTo(s,f,m,g,A,d,p),B+=6;"o24"==w&&(d+=a.shift(),p+=a.shift(),t.U.P.lineTo(s,d,p))}else{if("o11"==w)break;if("o1234"==w||"o1235"==w||"o1236"==w||"o1237"==w)"o1234"==w&&(m=p,g=(f=d+a.shift())+a.shift(),_=A=m+a.shift(),y=A,b=p,d=(x=(v=(E=g+a.shift())+a.shift())+a.shift())+a.shift(),t.U.P.curveTo(s,f,m,g,A,E,_),t.U.P.curveTo(s,v,y,x,b,d,p)),"o1235"==w&&(f=d+a.shift(),m=p+a.shift(),g=f+a.shift(),A=m+a.shift(),E=g+a.shift(),_=A+a.shift(),v=E+a.shift(),y=_+a.shift(),x=v+a.shift(),b=y+a.shift(),d=x+a.shift(),p=b+a.shift(),a.shift(),t.U.P.curveTo(s,f,m,g,A,E,_),t.U.P.curveTo(s,v,y,x,b,d,p)),"o1236"==w&&(f=d+a.shift(),m=p+a.shift(),g=f+a.shift(),_=A=m+a.shift(),y=A,x=(v=(E=g+a.shift())+a.shift())+a.shift(),b=y+a.shift(),d=x+a.shift(),t.U.P.curveTo(s,f,m,g,A,E,_),t.U.P.curveTo(s,v,y,x,b,d,p)),"o1237"==w&&(f=d+a.shift(),m=p+a.shift(),g=f+a.shift(),A=m+a.shift(),E=g+a.shift(),_=A+a.shift(),v=E+a.shift(),y=_+a.shift(),x=v+a.shift(),b=y+a.shift(),Math.abs(x-d)>Math.abs(b-p)?d=x+a.shift():p=b+a.shift(),t.U.P.curveTo(s,f,m,g,A,E,_),t.U.P.curveTo(s,v,y,x,b,d,p));else if("o14"==w){if(a.length>0&&!l&&(c=a.shift()+r.nominalWidthX,l=!0),4==a.length){var R=a.shift(),P=a.shift(),D=a.shift(),L=a.shift(),F=t.CFF.glyphBySE(r,D),U=t.CFF.glyphBySE(r,L);t.U._drawCFF(r.CharStrings[F],n,r,i,s),n.x=R,n.y=P,t.U._drawCFF(r.CharStrings[U],n,r,i,s)}h&&(t.U.P.closePath(s),h=!1)}else if("o19"==w||"o20"==w)a.length%2!=0&&!l&&(c=a.shift()+i.nominalWidthX),o+=a.length>>1,a.length=0,l=!0,u+=o+7>>3;else if("o21"==w)a.length>2&&!l&&(c=a.shift()+i.nominalWidthX,l=!0),p+=a.pop(),d+=a.pop(),h&&t.U.P.closePath(s),t.U.P.moveTo(s,d,p),h=!0;else if("o22"==w)a.length>1&&!l&&(c=a.shift()+i.nominalWidthX,l=!0),d+=a.pop(),h&&t.U.P.closePath(s),t.U.P.moveTo(s,d,p),h=!0;else if("o25"==w){for(;a.length>6;)d+=a.shift(),p+=a.shift(),t.U.P.lineTo(s,d,p);f=d+a.shift(),m=p+a.shift(),g=f+a.shift(),A=m+a.shift(),d=g+a.shift(),p=A+a.shift(),t.U.P.curveTo(s,f,m,g,A,d,p)}else if("o26"==w)for(a.length%2&&(d+=a.shift());a.length>0;)f=d,m=p+a.shift(),d=g=f+a.shift(),p=(A=m+a.shift())+a.shift(),t.U.P.curveTo(s,f,m,g,A,d,p);else if("o27"==w)for(a.length%2&&(p+=a.shift());a.length>0;)m=p,g=(f=d+a.shift())+a.shift(),A=m+a.shift(),d=g+a.shift(),p=A,t.U.P.curveTo(s,f,m,g,A,d,p);else if("o10"==w||"o29"==w){var O="o10"==w?i:r;if(0==a.length)console.debug("error: empty stack");else{var N=a.pop(),k=O.Subrs[N+O.Bias];n.x=d,n.y=p,n.nStems=o,n.haveWidth=l,n.width=c,n.open=h,t.U._drawCFF(k,n,r,i,s),d=n.x,p=n.y,o=n.nStems,l=n.haveWidth,c=n.width,h=n.open}}else if("o30"==w||"o31"==w){var G=a.length,z=(B=0,"o31"==w);for(B+=G-(M=-3&G);B<M;)z?(m=p,g=(f=d+a.shift())+a.shift(),p=(A=m+a.shift())+a.shift(),M-B==5?(d=g+a.shift(),B++):d=g,z=!1):(f=d,m=p+a.shift(),g=f+a.shift(),A=m+a.shift(),d=g+a.shift(),M-B==5?(p=A+a.shift(),B++):p=A,z=!0),t.U.P.curveTo(s,f,m,g,A,d,p),B+=4}else{if("o"==(w+"").charAt(0))throw console.debug("Unknown operation: "+w,e),w;a.push(w)}}}n.x=d,n.y=p,n.nStems=o,n.haveWidth=l,n.width=c,n.open=h};var n=t,r={Typr:n};return e.Typr=n,e.default=r,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr},function(){return function(e){var t=Uint8Array,n=Uint16Array,r=Uint32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,t){for(var i=new n(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return[i,a]},l=o(i,2),c=l[0],h=l[1];c[28]=258,h[258]=28;for(var u=o(s,0)[0],d=new n(32768),p=0;p<32768;++p){var f=(43690&p)>>>1|(21845&p)<<1;f=(61680&(f=(52428&f)>>>2|(13107&f)<<2))>>>4|(3855&f)<<4,d[p]=((65280&f)>>>8|(255&f)<<8)>>>1}var m=function(e,t,r){for(var i=e.length,s=0,a=new n(t);s<i;++s)++a[e[s]-1];var o,l=new n(t);for(s=0;s<t;++s)l[s]=l[s-1]+a[s-1]<<1;if(r){o=new n(1<<t);var c=15-t;for(s=0;s<i;++s)if(e[s])for(var h=s<<4|e[s],u=t-e[s],p=l[e[s]-1]++<<u,f=p|(1<<u)-1;p<=f;++p)o[d[p]>>>c]=h}else for(o=new n(i),s=0;s<i;++s)e[s]&&(o[s]=d[l[e[s]-1]++]>>>15-e[s]);return o},g=new t(288);for(p=0;p<144;++p)g[p]=8;for(p=144;p<256;++p)g[p]=9;for(p=256;p<280;++p)g[p]=7;for(p=280;p<288;++p)g[p]=8;var A=new t(32);for(p=0;p<32;++p)A[p]=5;var v=m(g,9,1),y=m(A,5,1),x=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},b=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},E=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],S=function(e,t,n){var r=new Error(t||_[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,S),!n)throw r;return r},w=function(e,o,l){var h=e.length;if(!h||l&&!l.l&&h<5)return o||new t(0);var d=!o||l,p=!l||l.i;l||(l={}),o||(o=new t(3*h));var f,g=function(e){var n=o.length;if(e>n){var r=new t(Math.max(2*n,e));r.set(o),o=r}},A=l.f||0,_=l.p||0,w=l.b||0,M=l.l,C=l.d,T=l.m,I=l.n,B=8*h;do{if(!M){l.f=A=b(e,_,1);var R=b(e,_+1,3);if(_+=3,!R){var P=e[(V=((f=_)/8|0)+(7&f&&1)+4)-4]|e[V-3]<<8,D=V+P;if(D>h){p&&S(0);break}d&&g(w+P),o.set(e.subarray(V,D),w),l.b=w+=P,l.p=_=8*D;continue}if(1==R)M=v,C=y,T=9,I=5;else if(2==R){var L=b(e,_,31)+257,F=b(e,_+10,15)+4,U=L+b(e,_+5,31)+1;_+=14;for(var O=new t(U),N=new t(19),k=0;k<F;++k)N[a[k]]=b(e,_+3*k,7);_+=3*F;var G=x(N),z=(1<<G)-1,Q=m(N,G,1);for(k=0;k<U;){var V,H=Q[b(e,_,z)];if(_+=15&H,(V=H>>>4)<16)O[k++]=V;else{var j=0,W=0;for(16==V?(W=3+b(e,_,3),_+=2,j=O[k-1]):17==V?(W=3+b(e,_,7),_+=3):18==V&&(W=11+b(e,_,127),_+=7);W--;)O[k++]=j}}var X=O.subarray(0,L),Y=O.subarray(L);T=x(X),I=x(Y),M=m(X,T,1),C=m(Y,I,1)}else S(1);if(_>B){p&&S(0);break}}d&&g(w+131072);for(var q=(1<<T)-1,K=(1<<I)-1,J=_;;J=_){var Z=(j=M[E(e,_)&q])>>>4;if((_+=15&j)>B){p&&S(0);break}if(j||S(2),Z<256)o[w++]=Z;else{if(256==Z){J=_,M=null;break}var $=Z-254;if(Z>264){var ee=i[k=Z-257];$=b(e,_,(1<<ee)-1)+c[k],_+=ee}var te=C[E(e,_)&K],ne=te>>>4;if(te||S(3),_+=15&te,Y=u[ne],ne>3&&(ee=s[ne],Y+=E(e,_)&(1<<ee)-1,_+=ee),_>B){p&&S(0);break}d&&g(w+131072);for(var re=w+$;w<re;w+=4)o[w]=o[w-Y],o[w+1]=o[w+1-Y],o[w+2]=o[w+2-Y],o[w+3]=o[w+3-Y];w=re}}l.l=M,l.p=J,l.b=w,M&&(A=1,l.m=T,l.d=C,l.n=I)}while(!A);return w==o.length?o:function(e,i,s){(null==i||i<0)&&(i=0),(null==s||s>e.length)&&(s=e.length);var a=new(e instanceof n?n:e instanceof r?r:t)(s-i);return a.set(e.subarray(i,s)),a}(o,0,w)},M=new t(0),C="undefined"!=typeof TextDecoder&&new TextDecoder;try{C.decode(M,{stream:!0})}catch(e){}return e.convert_streams=function(e){var t=new DataView(e),n=0;function r(){var e=t.getUint16(n);return n+=2,e}function i(){var e=t.getUint32(n);return n+=4,e}function s(e){A.setUint16(v,e),v+=2}function a(e){A.setUint32(v,e),v+=4}for(var o={signature:i(),flavor:i(),length:i(),numTables:r(),reserved:r(),totalSfntSize:i(),majorVersion:r(),minorVersion:r(),metaOffset:i(),metaLength:i(),metaOrigLength:i(),privOffset:i(),privLength:i()},l=0;Math.pow(2,l)<=o.numTables;)l++;l--;for(var c=16*Math.pow(2,l),h=16*o.numTables-c,u=12,d=[],p=0;p<o.numTables;p++)d.push({tag:i(),offset:i(),compLength:i(),origLength:i(),origChecksum:i()}),u+=16;var f,m=new Uint8Array(12+16*d.length+d.reduce((function(e,t){return e+t.origLength+4}),0)),g=m.buffer,A=new DataView(g),v=0;return a(o.flavor),s(o.numTables),s(c),s(l),s(h),d.forEach((function(e){a(e.tag),a(e.origChecksum),a(u),a(e.origLength),e.outOffset=u,(u+=e.origLength)%4!=0&&(u+=4-u%4)})),d.forEach((function(t){var n,r=e.slice(t.offset,t.offset+t.compLength);if(t.compLength!=t.origLength){var i=new Uint8Array(t.origLength);n=new Uint8Array(r,2),w(n,i)}else i=new Uint8Array(r);m.set(i,t.outOffset);var s=0;(u=t.outOffset+t.origLength)%4!=0&&(s=4-u%4),m.set(new Uint8Array(s).buffer,t.outOffset+t.origLength),f=u+s})),g.slice(0,f)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams},function(e,t){const n={M:2,L:2,Q:4,C:6,Z:0},r={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},i=1,s=2,a=4,o=8,l=16,c=32;let h;function u(e){if(!h){const e={R:s,L:i,D:a,C:l,U:c,T:o};h=new Map;for(let t in r){let n=0;r[t].split(",").forEach((r=>{let[i,s]=r.split("+");i=parseInt(i,36),s=s?parseInt(s,36):0,h.set(n+=i,e[t]);for(let a=s;a--;)h.set(++n,e[t])}))}}return h.get(e)||c}const d=1,p=2,f=3,m=4,g=[null,"isol","init","fina","medi"];function A(e){const t=new Uint8Array(e.length);let n=c,r=d,h=-1;for(let g=0;g<e.length;g++){const A=e.codePointAt(g);let v=0|u(A),y=d;v&o||(n&(i|a|l)?v&(s|a|l)?(y=f,r!==d&&r!==f||t[h]++):v&(i|c)&&(r!==p&&r!==m||t[h]--):n&(s|c)&&(r!==p&&r!==m||t[h]--),r=t[g]=y,n=v,h=g,A>65535&&g++)}return t}function v(t){const r=Object.create(null),i={unitsPerEm:t.head.unitsPerEm,ascender:t.hhea.ascender,descender:t.hhea.descender,forEachGlyph(s,a,o,l){let c=0;const h=1/i.unitsPerEm*a,u=function(t,n){const r=[];for(let s=0;s<n.length;s++){const i=n.codePointAt(s);i>65535&&s++,r.push(e.U.codeToGlyph(t,i))}const i=t.GSUB;if(i){const{lookupList:t,featureList:s}=i;let a;const o=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,l=[];s.forEach((i=>{if(o.test(i.tag))for(let s=0;s<i.tab.length;s++){if(l[i.tab[s]])continue;l[i.tab[s]]=!0;const o=t[i.tab[s]],c=/^(isol|init|fina|medi)$/.test(i.tag);c&&!a&&(a=A(n));for(let n=0;n<r.length;n++)a&&c&&g[a[n]]!==i.tag||e.U._applySubs(r,n,o,t)}}))}return r}(t,s);let d=0,p=-1;return u.forEach(((i,u)=>{if(-1!==i){let s=r[i];if(!s){const{cmds:a,crds:o}=e.U.glyphToPath(t,i);let l,c,h,u,d="",p=0;for(let e=0,t=a.length;e<t;e++){const t=n[a[e]];d+=a[e];for(let e=1;e<=t;e++)d+=(e>1?",":"")+o[p++]}if(o.length){l=c=1/0,h=u=-1/0;for(let e=0,t=o.length;e<t;e+=2){let t=o[e],n=o[e+1];t<l&&(l=t),n<c&&(c=n),t>h&&(h=t),n>u&&(u=n)}}else l=h=c=u=0;s=r[i]={index:i,advanceWidth:t.hmtx.aWidth[i],xMin:l,yMin:c,xMax:h,yMax:u,path:d,pathCommandCount:a.length}}-1!==p&&(c+=e.U.getPairAdjustment(t,p,i)*h),l.call(null,s,c,d),s.advanceWidth&&(c+=s.advanceWidth*h),o&&(c+=o*a),p=i}d+=s.codePointAt(d)>65535?2:1})),c}};return i}return function(n){const r=new Uint8Array(n,0,4),i=e._bin.readASCII(r,0,4);if("wOFF"===i)n=t(n);else if("wOF2"===i)throw new Error("woff2 fonts not supported");return v(e.parse(n)[0])}}],init:(e,t,n)=>n(e(),t())}),Ks={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},Js=new a.Color;let Zs=!1;function $s(){return(self.performance||Date).now()}const ea=Object.create(null);function ta(e,t){Zs=!0,e=ra({},e);const n=$s();if(e.font=function(e){ia||(ia="undefined"==typeof document?{}:document.createElement("a"));return ia.href=e,ia.href}(e.font||Ks.defaultFontURL),e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||Ks.sdfGlyphSize,null!=e.colorRanges){let t={};for(let n in e.colorRanges)if(e.colorRanges.hasOwnProperty(n)){let r=e.colorRanges[n];"number"!=typeof r&&(r=Js.set(r).getHex()),t[n]=r}e.colorRanges=t}Object.freeze(e);const{textureWidth:r,sdfExponent:i}=Ks,{sdfGlyphSize:s}=e,o=r/s*4;let l=ea[s];if(!l){const e=document.createElement("canvas");e.width=r,e.height=256*s/o,l=ea[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:e,sdfTexture:new a.Texture(e,void 0,void 0,void 0,a.LinearFilter,a.LinearFilter),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,function(e){const t=e.sdfCanvas;t.addEventListener("webglcontextlost",(t=>{console.log("Context Lost",t),t.preventDefault(),e.contextLost=!0})),t.addEventListener("webglcontextrestored",(t=>{console.log("Context Restored",t),e.contextLost=!1;const n=[];e.glyphsByFont.forEach((t=>{t.forEach((t=>{n.push(na(t,e,!0))}))})),ms.all(n).then((()=>{sa(e),e.sdfTexture.needsUpdate=!0}))}))}(l)}const{sdfTexture:c,sdfCanvas:h}=l;let u=l.glyphsByFont.get(e.font);u||l.glyphsByFont.set(e.font,u=new Map),oa(e).then((a=>{const{glyphIds:d,glyphPositions:p,fontSize:f,unitsPerEm:m,timings:g}=a,A=[],v=new Float32Array(4*d.length),y=f/m;let x=0,b=0;const E=$s();d.forEach(((e,t)=>{let n=u.get(e);if(!n){const{path:t,pathBounds:r}=a.glyphData[e],i=Math.max(r[2]-r[0],r[3]-r[1])/s*(Ks.sdfMargin*s+.5),o=l.glyphCount++,c=[r[0]-i,r[1]-i,r[2]+i,r[3]+i];u.set(e,n={path:t,atlasIndex:o,sdfViewBox:c}),A.push(n)}const{sdfViewBox:r}=n,i=p[b++],o=p[b++];v[x++]=i+r[0]*y,v[x++]=o+r[1]*y,v[x++]=i+r[2]*y,v[x++]=o+r[3]*y,d[t]=n.atlasIndex})),g.quads=(g.quads||0)+($s()-E);const _=$s();g.sdf={};const S=h.height,w=Math.ceil(l.glyphCount/o),M=Math.pow(2,Math.ceil(Math.log2(w*s)));M>S&&(console.info(`Increasing SDF texture size ${S}->${M}`),Ys(h,r,M),c.dispose()),ms.all(A.map((t=>na(t,l,e.gpuAccelerateSDF).then((({timing:e})=>{g.sdf[t.atlasIndex]=e}))))).then((()=>{A.length&&!l.contextLost&&(sa(l),c.needsUpdate=!0),g.sdfTotal=$s()-_,g.total=$s()-n,t(Object.freeze({parameters:e,sdfTexture:c,sdfGlyphSize:s,sdfExponent:i,glyphBounds:v,glyphAtlasIndices:d,glyphColors:a.glyphColors,caretPositions:a.caretPositions,caretHeight:a.caretHeight,chunkedBounds:a.chunkedBounds,ascender:a.ascender,descender:a.descender,lineHeight:a.lineHeight,topBaseline:a.topBaseline,blockBounds:a.blockBounds,visibleBounds:a.visibleBounds,timings:a.timings,get totalBounds(){return console.log("totalBounds deprecated, use blockBounds instead"),a.blockBounds},get totalBlockSize(){console.log("totalBlockSize deprecated, use blockBounds instead");const[e,t,n,r]=a.blockBounds;return[n-e,r-t]}}))}))})),ms.all([]).then((()=>{var e;l.contextLost||(e=h)._warm||(Hs.webgl.isSupported(e),e._warm=!0)}))}function na({path:e,atlasIndex:t,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:s},a){if(s)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=Ks,c=Math.max(n[2]-n[0],n[3]-n[1]),h=Math.floor(t/4);return function(e,t,n,r,i,s,a,o,l,c,h=!0){return h?Ws(e,t,n,r,i,s,a,o,l,c).then(null,(h=>(js||(console.warn("WebGL SDF generation failed, falling back to JS",h),js=!0),Xs(e,t,n,r,i,s,a,o,l,c)))):Xs(e,t,n,r,i,s,a,o,l,c)}(r,r,e,n,c,l,i,h%(o/r)*r,Math.floor(h/(o/r))*r,t%4,a)}function ra(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}let ia;function sa(e){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:t,sdfTexture:n}=e,{width:r,height:i}=t,s=e.sdfCanvas.getContext("webgl");let a=n.image.data;a&&a.length===r*i*4||(a=new Uint8Array(r*i*4),n.image={width:r,height:i,data:a},n.flipY=!1,n.isDataTexture=!0),s.readPixels(0,0,r,i,s.RGBA,s.UNSIGNED_BYTE,a)}}const aa=Ss({name:"Typesetter",dependencies:[Ks,qs,function(e,t,n){const{defaultFontURL:r}=n,i=Object.create(null),s=1/0,a=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,o=/[\s\-\u007C\u00AD\u2010\u2012-\u2014\u2027\u2056\u2E17\u2E40]/;function l(t,n){t||(t=r);let s=i[t];s?s.pending?s.pending.push(n):n(s):(i[t]={pending:[n]},function(t,n){!function i(){const s=e=>{console.error(`Failure loading font ${t}${t===r?"":"; trying fallback"}`,e),t!==r&&(t=r,i())};try{const r=new XMLHttpRequest;r.open("get",t,!0),r.responseType="arraybuffer",r.onload=function(){if(r.status>=400)s(new Error(r.statusText));else if(r.status>0)try{const t=e(r.response);n(t)}catch(za){s(za)}},r.onerror=s,r.send()}catch(a){s(a)}}()}(t,(e=>{let n=i[t].pending;i[t]=e,n.forEach((t=>t(e)))})))}function c({text:e="",font:n=r,sdfGlyphSize:i=64,fontSize:c=1,letterSpacing:f=0,lineHeight:m="normal",maxWidth:g=s,direction:A,textAlign:v="left",textIndent:y=0,whiteSpace:x="normal",overflowWrap:b="normal",anchorX:E=0,anchorY:_=0,includeCaretPositions:S=!1,chunkedBoundsSize:w=8192,colorRanges:M=null},C,T=!1){const I=d(),B={fontLoad:0,typesetting:0};e.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),c=+c,f=+f,g=+g,m=m||"normal",y=+y,l(n,(n=>{const r=isFinite(g);let i=null,l=null,R=null,P=null,D=null,L=null,F=null,U=0,O=0,N="nowrap"!==x;const{ascender:k,descender:G,unitsPerEm:z}=n;B.fontLoad=d()-I;const Q=d(),V=c/z;"normal"===m&&(m=(k-G)/z);const H=((m*=c)-(k-G)*V)/2,j=-(k*V+H),W=Math.min(m,(k-G)*V),X=(k+G)/2*V-W/2;let Y=y,q=new p;const K=[q];n.forEachGlyph(e,c,f,((t,n,i)=>{const s=e.charAt(i),l=t.advanceWidth*V,h=q.count;let u;if("isEmpty"in t||(t.isWhitespace=!!s&&/\s/.test(s),t.canBreakAfter=!!s&&o.test(s),t.isEmpty=t.xMin===t.xMax||t.yMin===t.yMax||a.test(s)),t.isWhitespace||t.isEmpty||O++,N&&r&&!t.isWhitespace&&n+l+Y>g&&h){if(q.glyphAt(h-1).glyphObj.canBreakAfter)u=new p,Y=-n;else for(let e=h;e--;){if(0===e&&"break-word"===b){u=new p,Y=-n;break}if(q.glyphAt(e).glyphObj.canBreakAfter){u=q.splitAt(e+1);const t=u.glyphAt(0).x;Y-=t;for(let e=u.count;e--;)u.glyphAt(e).x-=t;break}}u&&(q.isSoftWrapped=!0,q=u,K.push(q),U=g)}let d=q.glyphAt(q.count);d.glyphObj=t,d.x=n+Y,d.width=l,d.charIndex=i,"\n"===s&&(q=new p,K.push(q),Y=-(n+l+f*c)+y)})),K.forEach((e=>{for(let t=e.count;t--;){let{glyphObj:n,x:r,width:i}=e.glyphAt(t);if(!n.isWhitespace)return e.width=r+i,void(e.width>U&&(U=e.width))}}));let J=0,Z=0;if(E&&("number"==typeof E?J=-E:"string"==typeof E&&(J=-U*("left"===E?0:"center"===E?.5:"right"===E?1:h(E)))),_)if("number"==typeof _)Z=-_;else if("string"==typeof _){let e=K.length*m;Z="top"===_?0:"top-baseline"===_?-j:"middle"===_?e/2:"bottom"===_?e:"bottom-baseline"===_?e-H+G*V:h(_)*e}if(!T){const r=t.getEmbeddingLevels(e,A);i=new Uint16Array(O),l=new Float32Array(2*O),R={},L=[s,s,-s,-s],F=[];let a=j;S&&(D=new Float32Array(3*e.length)),M&&(P=new Uint8Array(3*O));let o,c,h=0,d=-1,p=-1;if(K.forEach(((f,g)=>{let{count:A,width:y}=f;if(A>0){let m=0;for(let e=A;e--&&f.glyphAt(e).glyphObj.isWhitespace;)m++;let g=0,x=0;if("center"===v)g=(U-y)/2;else if("right"===v)g=U-y;else if("justify"===v&&f.isSoftWrapped){let e=0;for(let t=A-m;t--;)f.glyphAt(t).glyphObj.isWhitespace&&e++;x=(U-y)/e}if(x||g){let e=0;for(let t=0;t<A;t++){let n=f.glyphAt(t);const r=n.glyphObj;n.x+=g+e,0!==x&&r.isWhitespace&&t<A-m&&(e+=x,n.width+=x)}}const b=t.getReorderSegments(e,r,f.glyphAt(0).charIndex,f.glyphAt(f.count-1).charIndex);for(let e=0;e<b.length;e++){const[t,n]=b[e];let r=1/0,i=-1/0;for(let e=0;e<A;e++)if(f.glyphAt(e).charIndex>=t){let t=e,s=e;for(;s<A;s++){let e=f.glyphAt(s);if(e.charIndex>n)break;s<A-m&&(r=Math.min(r,e.x),i=Math.max(i,e.x+e.width))}for(let e=t;e<s;e++){const t=f.glyphAt(e);t.x=i-(t.x+t.width-r)}break}}let E;const _=e=>E=e;for(let v=0;v<A;v++){let m=f.glyphAt(v);E=m.glyphObj;const g=E.index,A=1&r.levels[m.charIndex];if(A){const r=t.getMirroredCharacter(e[m.charIndex]);r&&n.forEachGlyph(r,0,0,_)}if(S){const{charIndex:e}=m,t=m.x+J,n=m.x+m.width+J;D[3*e]=A?n:t,D[3*e+1]=A?t:n,D[3*e+2]=a+X+Z;const r=e-d;r>1&&u(D,d,r),d=e}if(M){const{charIndex:e}=m;for(;e>p;)p++,M.hasOwnProperty(p)&&(c=M[p])}if(!E.isWhitespace&&!E.isEmpty){const e=h++;R[g]||(R[g]={path:E.path,pathBounds:[E.xMin,E.yMin,E.xMax,E.yMax]});const t=m.x+J,n=a+Z;l[2*e]=t,l[2*e+1]=n;const r=t+E.xMin*V,u=n+E.yMin*V,d=t+E.xMax*V,p=n+E.yMax*V;r<L[0]&&(L[0]=r),u<L[1]&&(L[1]=u),d>L[2]&&(L[2]=d),p>L[3]&&(L[3]=p),e%w==0&&(o={start:e,end:e,rect:[s,s,-s,-s]},F.push(o)),o.end++;const f=o.rect;if(r<f[0]&&(f[0]=r),u<f[1]&&(f[1]=u),d>f[2]&&(f[2]=d),p>f[3]&&(f[3]=p),i[e]=g,M){const t=3*e;P[t]=c>>16&255,P[t+1]=c>>8&255,P[t+2]=255&c}}}}a-=m})),D){const t=e.length-d;t>1&&u(D,d,t)}}B.typesetting=d()-Q,C({glyphIds:i,glyphPositions:l,glyphData:R,caretPositions:D,caretHeight:W,glyphColors:P,chunkedBounds:F,fontSize:c,unitsPerEm:z,ascender:k*V,descender:G*V,lineHeight:m,topBaseline:j,blockBounds:[J,Z-K.length*m,J+U,Z],visibleBounds:L,timings:B})}))}function h(e){let t=e.match(/^([\d.]+)%$/),n=t?parseFloat(t[1]):NaN;return isNaN(n)?0:n/100}function u(e,t,n){const r=e[3*t],i=e[3*t+1],s=e[3*t+2],a=(i-r)/n;for(let o=0;o<n;o++){const n=3*(t+o);e[n]=r+a*o,e[n+1]=r+a*(o+1),e[n+2]=s}}function d(){return(self.performance||Date).now()}function p(){this.data=[]}const f=["glyphObj","x","width","charIndex"];return p.prototype={width:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/f.length)},glyphAt(e){let t=p.flyweight;return t.data=this.data,t.index=e,t},splitAt(e){let t=new p;return t.data=this.data.splice(e*f.length),t}},p.flyweight=f.reduce(((e,t,n,r)=>(Object.defineProperty(e,t,{get(){return this.data[this.index*f.length+n]},set(e){this.data[this.index*f.length+n]=e}}),e)),{data:null,index:0}),{typeset:c,measure:function(e,t){c(e,(e=>{const[n,r,i,s]=e.blockBounds;t({width:i-n,height:s-r})}),{metricsOnly:!0})},loadFont:l}},Is],init(e,t,n,r){const{defaultFontURL:i}=e;return n(t,r(),{defaultFontURL:i})}}),oa=Ss({name:"Typesetter",dependencies:[aa,Cs],init:(e,t)=>function(n){const r=new t;return e.typeset(n,r.resolve),r},getTransferables(e){const t=[e.glyphPositions.buffer,e.glyphIds.buffer];return e.caretPositions&&t.push(e.caretPositions.buffer),e.glyphColors&&t.push(e.glyphColors.buffer),t}});const la=(()=>{const e={};const t="aTroikaGlyphIndex";class n extends a.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new a.Sphere,this.boundingBox=new a.Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===a.BackSide?t/2:0,e===a.DoubleSide?t:t/2)}set detail(t){if(t!==this._detail){this._detail=t,("number"!=typeof t||t<1)&&(t=1);let n=function(t){let n=e[t];if(!n){const r=new a.PlaneBufferGeometry(1,1,t,t),i=r.clone(),s=r.attributes,o=i.attributes,l=new a.BufferGeometry,c=s.uv.count;for(let e=0;e<c;e++)o.position.array[3*e]*=-1,o.normal.array[3*e+2]*=-1;["position","normal","uv"].forEach((e=>{l.setAttribute(e,new a.Float32BufferAttribute([...s[e].array,...o[e].array],s[e].itemSize))})),l.setIndex([...r.index.array,...i.index.array.map((e=>e+c))]),l.translate(.5,.5,0),n=e[t]=l}return n}(t);["position","normal","uv"].forEach((e=>{this.attributes[e]=n.attributes[e].clone()})),this.setIndex(n.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,n,s,a,o){r(this,"aTroikaGlyphBounds",e,4),r(this,t,n,1),r(this,"aTroikaGlyphColor",o,3),this._blockBounds=s,this._chunkedBounds=a,i(this,n.length),this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:n}=this;if(t){const{PI:r,floor:i,min:s,max:a,sin:o,cos:l}=Math,c=r/2,h=2*r,u=Math.abs(t),d=e[0]/u,p=e[2]/u,f=i((d+c)/h)!==i((p+c)/h)?-u:s(o(d)*u,o(p)*u),m=i((d-c)/h)!==i((p-c)/h)?u:a(o(d)*u,o(p)*u),g=i((d+r)/h)!==i((p+r)/h)?2*u:a(u-l(d)*u,u-l(p)*u);n.min.set(f,e[1],t<0?-g:0),n.max.set(m,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(t).count,r=this._chunkedBounds;if(r)for(let t=r.length;t--;){n=r[t].end;let i=r[t].rect;if(i[1]<e.w&&i[3]>e.y&&i[0]<e.z&&i[2]>e.x)break}i(this,n)}}function r(e,t,n,r){const i=e.getAttribute(t);n?i&&i.array.length===n.length?(i.array.set(n),i.needsUpdate=!0):(e.setAttribute(t,new a.InstancedBufferAttribute(n,r)),delete e._maxInstanceCount,e.dispose()):i&&e.deleteAttribute(t)}function i(e,t){e[e.hasOwnProperty("instanceCount")?"instanceCount":"maxInstancedCount"]=t}return n.prototype.setAttribute||(n.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this}),n})();const ca=(()=>{const e=new a.MeshBasicMaterial({color:16777215,side:a.DoubleSide,transparent:!0}),t=8421504,n=new a.Matrix4,r=new a.Vector3,i=new a.Vector3,s=[],o=new a.Vector3,l="+x+y";function c(e){return Array.isArray(e)?e[0]:e}let h=()=>{const t=new a.Mesh(new a.PlaneBufferGeometry(1,1),e);return h=()=>t,t},u=()=>{const t=new a.Mesh(new a.PlaneBufferGeometry(1,1,32,1),e);return u=()=>t,t};const d={type:"syncstart"},p={type:"synccomplete"},f=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],m=f.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class g extends a.Mesh{constructor(){super(new la,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=t,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=l,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(d),ta({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},(t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{n.forEach((e=>e&&e()))}))),this.dispatchEvent(p),e&&e()}))))}onBeforeRender(e,t,n,r,i,s){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i),i._hadOwnSide=i.hasOwnProperty("side"),this.geometry.setSide(i._actualSide=i.side),i.side=a.FrontSide}onAfterRender(e,t,n,r,i,s){i._hadOwnSide?i.side=i._actualSide:delete i.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let t=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=e.clone());if(t&&t.baseMaterial===n||(t=this._derivedMaterial=function(e){const t=Ns(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new a.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new a.Vector4(0,0,0,0)},uTroikaClipRect:{value:new a.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new a.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new a.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new a.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:e,fragmentShader:t}){let n=/\buniform\s+vec3\s+diffuse\b/;return n.test(t)&&(t=t.replace(n,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),n.test(e)||(e=e.replace(Bs,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}(n),n.addEventListener("dispose",(function e(){n.removeEventListener("dispose",e),t.dispose()}))),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let e=t._outlineMtl;return e||(e=t._outlineMtl=Object.create(t,{id:{value:t.id+.1}}),e.isTextOutlineMaterial=!0,e.depthWrite=!1,e.map=null,t.addEventListener("dispose",(function n(){t.removeEventListener("dispose",n),e.dispose()}))),[e,t]}return t}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return c(this.material).getDepthMaterial()}get customDistanceMaterial(){return c(this.material).getDistanceMaterial()}_prepareForRender(e){const s=e.isTextOutlineMaterial,c=e.uniforms,h=this.textRenderInfo;if(h){const{sdfTexture:e,blockBounds:n}=h;c.uTroikaSDFTexture.value=e,c.uTroikaSDFTextureSize.value.set(e.image.width,e.image.height),c.uTroikaSDFGlyphSize.value=h.sdfGlyphSize,c.uTroikaSDFExponent.value=h.sdfExponent,c.uTroikaTotalBounds.value.fromArray(n),c.uTroikaUseGlyphColors.value=!s&&!!h.glyphColors;let r,i,a,o=0,l=0,u=0,d=0,p=0;if(s){let{outlineWidth:e,outlineOffsetX:t,outlineOffsetY:n,outlineBlur:i,outlineOpacity:s}=this;o=this._parsePercent(e)||0,l=Math.max(0,this._parsePercent(i)||0),r=s,d=this._parsePercent(t)||0,p=this._parsePercent(n)||0}else u=Math.max(0,this._parsePercent(this.strokeWidth)||0),u&&(a=this.strokeColor,c.uTroikaStrokeColor.value.set(null==a?t:a),i=this.strokeOpacity,null==i&&(i=1)),r=this.fillOpacity;c.uTroikaDistanceOffset.value=o,c.uTroikaPositionOffset.value.set(d,p),c.uTroikaBlurRadius.value=l,c.uTroikaStrokeWidth.value=u,c.uTroikaStrokeOpacity.value=i,c.uTroikaFillOpacity.value=null==r?1:r,c.uTroikaCurveRadius.value=this.curveRadius||0;let f=this.clipRect;if(f&&Array.isArray(f)&&4===f.length)c.uTroikaClipRect.value.fromArray(f);else{const e=100*(this.fontSize||.1);c.uTroikaClipRect.value.set(n[0]-e,n[1]-e,n[2]+e,n[3]+e)}this.geometry.applyClipRect(c.uTroikaClipRect.value)}c.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const u=s?this.outlineColor||0:this.color;if(null==u)delete e.color;else{const t=e.hasOwnProperty("color")?e.color:e.color=new a.Color;u===t._input&&"object"!=typeof u||t.set(t._input=u)}let d=this.orientation||l;if(d!==e._orientation){let t=c.uTroikaOrient.value;d=d.replace(/[^-+xyz]/g,"");let s=d!==l&&d.match(/^([-+])([xyz])([-+])([xyz])$/);if(s){let[,e,a,l,c]=s;r.set(0,0,0)[a]="-"===e?1:-1,i.set(0,0,0)[c]="-"===l?-1:1,n.lookAt(o,r.cross(i),i),t.setFromMatrix4(n)}else t.identity();e._orientation=d}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new a.Vector2){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new a.Vector2){return r.copy(e),this.localPositionToTextCoords(this.worldToLocal(r),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:r}=this;if(n){const i=n.blockBounds,a=r?u():h(),o=a.geometry,{position:l,uv:c}=o.attributes;for(let e=0;e<c.count;e++){let t=i[0]+c.getX(e)*(i[2]-i[0]);const n=i[1]+c.getY(e)*(i[3]-i[1]);let s=0;r&&(s=r-Math.cos(t/r)*r,t=Math.sin(t/r)*r),l.setXYZ(e,t,n,s)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,s.length=0,a.raycast(e,s);for(let e=0;e<s.length;e++)s[e].object=this,t.push(s[e])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,m.forEach((t=>{this[t]=e[t]})),this}clone(){return(new this.constructor).copy(this)}}f.forEach((e=>{const t="_private_"+e;Object.defineProperty(g.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}));let A=!1;return Object.defineProperty(g.prototype,"anchor",{get(){return this._deprecated_anchor},set(e){this._deprecated_anchor=e,A||(console.warn("TextMesh: `anchor` has been deprecated; use `anchorX` and `anchorY` instead."),A=!0),Array.isArray(e)?(this.anchorX=100*(+e[0]||0)+"%",this.anchorY=100*(+e[1]||0)+"%"):this.anchorX=this.anchorY=0}}),g})();new WeakMap;new WeakMap;function ha(e,t,n=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;const r=e.length;if(t.length!==r)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}const ua=[];function da(e,t,n=!1,r={}){for(const s of ua)if(ha(t,s.keys,s.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return s.response;if(!n)throw s.promise}const i={keys:t,equal:r.equal,promise:e(...t).then((e=>i.response=e)).then((()=>{r.lifespan&&r.lifespan>0&&setTimeout((()=>{const e=ua.indexOf(i);-1!==e&&ua.splice(e,1)}),r.lifespan)})).catch((e=>i.error=e))};if(ua.push(i),!n)throw i.promise}const pa=(e,t,n)=>da(e,t,!1,n),fa=i.forwardRef((({anchorX:e="center",anchorY:t="middle",font:n,children:s,characters:a,onSync:l,...c},h)=>{const u=(0,o.useThree)((({invalidate:e})=>e)),[d]=i.useState((()=>new ca)),[p,f]=i.useMemo((()=>{const e=[];let t="";return i.Children.forEach(s,(n=>{"string"==typeof n||"number"==typeof n?t+=n:e.push(n)})),[e,t]}),[s]);return pa((()=>new Promise((e=>function({font:e,characters:t,sdfGlyphSize:n},r){ta({font:e,sdfGlyphSize:n,text:Array.isArray(t)?t.join("\n"):""+t},r)}({font:n,characters:a},e)))),["troika-text",n,a]),i.useLayoutEffect((()=>{d.sync((()=>{u(),l&&l(d)}))})),i.useEffect((()=>()=>d.dispose()),[d]),i.createElement("primitive",(0,r.Z)({object:d,ref:h,font:n,text:f,anchorX:e,anchorY:t},c),p)})),ma={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};var ga=Object.defineProperty,Aa=(e,t,n)=>(((e,t,n)=>{t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class va{constructor(){Aa(this,"enabled",!0),Aa(this,"needsSwap",!0),Aa(this,"clear",!1),Aa(this,"renderToScreen",!1)}setSize(e,t){}render(e,t,n,r,i){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}class ya{constructor(e){Aa(this,"camera",new a.OrthographicCamera(-1,1,1,-1,0,1)),Aa(this,"geometry",new a.PlaneGeometry(2,2)),Aa(this,"mesh"),this.mesh=new a.Mesh(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}}var xa=Object.defineProperty,ba=(e,t,n)=>(((e,t,n)=>{t in e?xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class Ea extends va{constructor(e,t="tDiffuse"){super(),ba(this,"textureID"),ba(this,"uniforms"),ba(this,"material"),ba(this,"fsQuad"),this.textureID=t,e instanceof a.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):(this.uniforms=a.UniformsUtils.clone(e.uniforms),this.material=new a.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new ya(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}var _a=Object.defineProperty,Sa=(e,t,n)=>(((e,t,n)=>{t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class wa extends va{constructor(e,t){super(),Sa(this,"scene"),Sa(this,"camera"),Sa(this,"inverse"),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class Ma extends va{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}var Ca=Object.defineProperty,Ta=(e,t,n)=>(((e,t,n)=>{t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);var Ia=Object.defineProperty,Ba=(e,t,n)=>(((e,t,n)=>{t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const Ra={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\tgl_FragColor = LinearTosRGB( tex );","}"].join("\n")};(0,o.extend)({EffectComposer:class{constructor(e,t){if(Ta(this,"renderer"),Ta(this,"_pixelRatio"),Ta(this,"_width"),Ta(this,"_height"),Ta(this,"renderTarget1"),Ta(this,"renderTarget2"),Ta(this,"writeBuffer"),Ta(this,"readBuffer"),Ta(this,"renderToScreen"),Ta(this,"passes",[]),Ta(this,"copyPass"),Ta(this,"clock"),this.renderer=e,void 0===t){const n={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat},r=e.getSize(new a.Vector2);this._pixelRatio=e.getPixelRatio(),this._width=r.width,this._height=r.height,(t=new a.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,void 0===ma&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Ea&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Ea(ma),this.copyPass.material.blending=a.NoBlending,this.clock=new a.Clock}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;const r=this.passes.length;for(let i=0;i<r;i++){const t=this.passes[i];if(!1!==t.enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),t.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==wa&&(t instanceof wa?n=!0:t instanceof Ma&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new a.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let i=0;i<this.passes.length;i++)this.passes[i].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}},RenderPass:class extends va{constructor(e,t,n,r,i=0){super(),Ba(this,"scene"),Ba(this,"camera"),Ba(this,"overrideMaterial"),Ba(this,"clearColor"),Ba(this,"clearAlpha"),Ba(this,"clearDepth",!1),Ba(this,"_oldClearColor",new a.Color),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.needsSwap=!1}render(e,t,n){let r,i=e.autoClear;e.autoClear=!1;let s=null;void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,r),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=i}},ShaderPass:Ea});const Pa=()=>{try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(za){return!1}},Da=i.forwardRef((({children:e,multisamping:t=8,renderIndex:n=1,disableGamma:s=!1,disableRenderPass:l=!1,...c},h)=>{const u=i.useRef(),d=(0,o.useThree)((({scene:e})=>e)),p=(0,o.useThree)((({camera:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=(0,o.useThree)((({size:e})=>e)),[g]=i.useState((()=>{if(Pa()&&t>0){const e=new a.WebGLRenderTarget(m.width,m.height,{format:a.RGBAFormat,encoding:a.sRGBEncoding});return e.samples=8,e}}));return i.useEffect((()=>{var e,t;null==(e=u.current)||e.setSize(m.width,m.height),null==(t=u.current)||t.setPixelRatio(f.getPixelRatio())}),[f,m]),(0,o.useFrame)((()=>{var e;return null==(e=u.current)?void 0:e.render()}),n),i.createElement("effectComposer",(0,r.Z)({ref:M([h,u]),args:[f,g]},c),!l&&i.createElement("renderPass",{attachArray:"passes",args:[d,p]}),!s&&i.createElement("shaderPass",{attachArray:"passes",args:[Ra]}),e)}));function La({stops:e,colors:t,size:n=1024,...s}){const l=(0,o.useThree)((e=>e.gl)),c=i.useMemo((()=>{const r=document.createElement("canvas"),i=r.getContext("2d");r.width=16,r.height=n;const s=i.createLinearGradient(0,0,0,n);let o=e.length;for(;o--;)s.addColorStop(e[o],t[o]);i.fillStyle=s,i.fillRect(0,0,16,n);const l=new a.Texture(r);return l.needsUpdate=!0,l}),[e]);return i.useEffect((()=>()=>{c.dispose()}),[c]),i.createElement("primitive",(0,r.Z)({object:c,attach:"map",encoding:l.outputEncoding},s))}function Fa(e,t,n,r){return class extends a.ShaderMaterial{constructor(){const i=Object.entries(e);super({uniforms:i.reduce(((e,[t,n])=>({...e,...a.UniformsUtils.clone({[t]:{value:n}})})),{}),vertexShader:t,fragmentShader:n}),i.forEach((([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t}))),r&&r(this)}}}const Ua=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function Oa(e){const t=(0,o.useThree)((e=>e.gl)),n=(0,o.useLoader)(a.TextureLoader,Ua(e)?Object.values(e):e);if((0,i.useEffect)((()=>{(Array.isArray(n)?n:[n]).forEach(t.initTexture)}),[t,n]),Ua(e)){const t=Object.keys(e),r={};return t.forEach((e=>Object.assign(r,{[e]:n[t.indexOf(e)]}))),r}return n}Oa.preload=e=>o.useLoader.preload(a.TextureLoader,e),Oa.clear=e=>o.useLoader.clear(a.TextureLoader,e);const Na=Fa({color:new a.Color("white"),scale:[1,1],imageBounds:[1,1],map:null,zoom:1,grayscale:0},"\n varying vec2 vUv;\n void main() {\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);\n vUv = uv;\n }\n","\n // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44\n varying vec2 vUv;\n uniform vec2 scale;\n uniform vec2 imageBounds;\n uniform vec3 color;\n uniform sampler2D map;\n uniform float zoom;\n uniform float grayscale;\n const vec3 luma = vec3(.299, 0.587, 0.114);\n vec4 toGrayscale(vec4 color, float intensity) {\n return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a);\n }\n vec2 aspect(vec2 size) {\n return size / min(size.x, size.y);\n }\n void main() {\n vec2 s = aspect(scale);\n vec2 i = aspect(imageBounds);\n float rs = s.x / s.y;\n float ri = i.x / i.y;\n vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);\n vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;\n vec2 uv = vUv * s / new + offset;\n vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5);\n gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, 1.0), grayscale);\n \n #include <tonemapping_fragment>\n #include <encodings_fragment>\n }\n"),ka=i.forwardRef((({children:e,color:t,segments:n=1,scale:s=1,zoom:a=1,grayscale:l=0,url:c,toneMapped:h,...u},d)=>{(0,o.extend)({ImageMaterial:Na});const p=Oa(c),f=Array.isArray(s)?[s[0],s[1]]:[s,s],m=[p.image.width,p.image.height];return i.createElement("mesh",(0,r.Z)({ref:d,scale:s},u),i.createElement("planeGeometry",{args:[1,1,n,n]}),i.createElement("imageMaterial",{color:t,map:p,zoom:a,grayscale:l,scale:f,imageBounds:m,toneMapped:h}),e)}));function Ga({userData:e,children:t,geometry:n,threshold:s=15,color:o="black",...l}){const c=i.useRef(null);return i.useLayoutEffect((()=>{const e=c.current.parent;if(e){const t=n||e.geometry;t===c.current.userData.currentGeom&&s===c.current.userData.currentThreshold||(c.current.userData.currentGeom=t,c.current.userData.currentThreshold=s,c.current.geometry=new a.EdgesGeometry(t,s))}})),i.createElement("lineSegments",(0,r.Z)({ref:c,raycast:()=>null},l),t||i.createElement("lineBasicMaterial",{color:o}))}function za(e,t){const n=new a.Matrix4,r=new a.Ray,i=new a.Sphere,s=new a.Vector3,o=this.geometry;if(i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),!1===e.ray.intersectSphere(i,s))return;n.copy(this.matrixWorld).invert(),r.copy(e.ray).applyMatrix4(n);const l=new a.Vector3,c=new a.Vector3,h=new a.Vector3,u=this instanceof a.LineSegments?2:1,d=o.index,p=o.attributes;if(null!==d){const n=d.array,i=p.position.array,a=p.width.array;for(let o=0,d=n.length-1;o<d;o+=u){const u=n[o],p=n[o+1];l.fromArray(i,3*u),c.fromArray(i,3*p);const f=null!=a[Math.floor(o/3)]?a[Math.floor(o/3)]:1,m=e.params.Line.threshold+this.material.lineWidth*f/2,g=m*m;if(r.distanceSqToSegment(l,c,s,h)>g)continue;s.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(s);A<e.near||A>e.far||(t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:o,face:null,faceIndex:null,object:this}),o=d)}}}function Qa(e,t,n,r,i){let s;if(e=e.subarray||e.slice?e:e.buffer,n=n.subarray||n.slice?n:n.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,n.set)n.set(e,r);else for(s=0;s<e.length;s++)n[s+r]=e[s];return n}class Va extends a.BufferGeometry{constructor(){super(),this.type="MeshLine",this.isMeshLine=!0,this.positions=[],this.raycast=za,this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new a.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get(){return this}},geom:{enumerable:!0,get(){return this._geom},set(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setGeometry(e,t){this._geometry=e,e instanceof a.BufferGeometry?this.setPoints(e.getAttribute("position").array,t):this.setPoints(e,t)}setPoints(e,t){if(e instanceof Float32Array||e instanceof Array){if(this._points=e,this.widthCallback=t,this.positions=[],this.counters=[],e.length&&e[0]instanceof a.Vector3)for(var n=0;n<e.length;n++){const t=e[n];var r=n/e.length;this.positions.push(t.x,t.y,t.z),this.positions.push(t.x,t.y,t.z),this.counters.push(r),this.counters.push(r)}else for(n=0;n<e.length;n+=3)r=n/e.length,this.positions.push(e[n],e[n+1],e[n+2]),this.positions.push(e[n],e[n+1],e[n+2]),this.counters.push(r),this.counters.push(r);this.process()}else console.error("ERROR: The BufferArray of points is not instancied correctly.")}compareV3(e,t){const n=6*e,r=6*t;return this.positions[n]===this.positions[r]&&this.positions[n+1]===this.positions[r+1]&&this.positions[n+2]===this.positions[r+2]}copyV3(e){const t=6*e;return[this.positions[t],this.positions[t+1],this.positions[t+2]]}process(){const e=this.positions.length/6;let t,n;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],n=this.compareV3(0,e-1)?this.copyV3(e-2):this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(let r=0;r<e;r++){if(this.side.push(1),this.side.push(-1),t=this.widthCallback?this.widthCallback(r/(e-1)):1,this.width.push(t),this.width.push(t),this.uvs.push(r/(e-1),0),this.uvs.push(r/(e-1),1),r<e-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);const e=2*r;this.indices_array.push(e,e+1,e+2),this.indices_array.push(e+2,e+1,e+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}n=this.compareV3(e-1,0)?this.copyV3(1):this.copyV3(e-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),this._attributes&&this._attributes.position.count===this.positions.length?(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0):this._attributes={position:new a.BufferAttribute(new Float32Array(this.positions),3),previous:new a.BufferAttribute(new Float32Array(this.previous),3),next:new a.BufferAttribute(new Float32Array(this.next),3),side:new a.BufferAttribute(new Float32Array(this.side),1),width:new a.BufferAttribute(new Float32Array(this.width),1),uv:new a.BufferAttribute(new Float32Array(this.uvs),2),index:new a.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new a.BufferAttribute(new Float32Array(this.counters),1)},this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:n}){const r=this._attributes.position.array,i=this._attributes.previous.array,s=this._attributes.next.array,a=r.length;Qa(r,0,i,0,a),Qa(r,6,r,0,a-6),r[a-6]=e,r[a-5]=t,r[a-4]=n,r[a-3]=e,r[a-2]=t,r[a-1]=n,Qa(r,6,s,0,a-6),s[a-6]=e,s[a-5]=t,s[a-4]=n,s[a-3]=e,s[a-2]=t,s[a-1]=n,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}}a.ShaderChunk.meshline_vert=["","#include <common>","",a.ShaderChunk.logdepthbuf_pars_vertex,a.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",a.ShaderChunk.logdepthbuf_vertex,a.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",a.ShaderChunk.fog_vertex,"}"].join("\n"),a.ShaderChunk.meshline_frag=["",a.ShaderChunk.fog_pars_fragment,a.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",a.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",a.ShaderChunk.fog_fragment,"}"].join("\n");class Ha extends a.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},a.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new a.Color(16777215)},opacity:{value:1},resolution:{value:new a.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new a.Vector2(1,1)}}),vertexShader:a.ShaderChunk.meshline_vert,fragmentShader:a.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=0!==e?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}}const ja={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},Wa=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function Xa(e,t){const{length:n,local:r,decay:s,interval:l,stride:c}={...ja,...t},h=i.useRef(),[u]=i.useState((()=>new a.Vector3));i.useLayoutEffect((()=>{e&&(h.current=Float32Array.from({length:10*n*3},((t,n)=>e.position.getComponent(n%3))))}),[n,e]);const d=i.useRef(new a.Vector3),p=i.useRef(0);return(0,o.useFrame)((()=>{if(e&&h.current){if(0===p.current){let t;r?t=e.position:(e.getWorldPosition(u),t=u);const n=1*s;for(let e=0;e<n;e++)t.distanceTo(d.current)<c||(Wa(h.current,3),h.current.set(t.toArray(),h.current.length-3));d.current.copy(t)}p.current++,p.current=p.current%l}})),h}const Ya=i.forwardRef(((e,t)=>{const{children:n}=e,{width:r,length:s,decay:l,local:c,stride:h,interval:u}={...ja,...e},{color:d="hotpink",attenuation:p,target:f}=e,m=(0,o.useThree)((e=>e.size)),g=i.useRef(null),[A,v]=i.useState(null),y=Xa(A,{length:s,decay:l,local:c,stride:h,interval:u});i.useEffect((()=>{const e=(null==f?void 0:f.current)||g.current.children.find((e=>e instanceof a.Object3D));e&&v(e)}),[y,f]);const x=i.useMemo((()=>new Va),[]),b=i.useMemo((()=>{var e;const t=new Ha({lineWidth:.1*r,color:d,sizeAttenuation:1,resolution:new a.Vector2(m.width,m.height)});let i;if(n)if(Array.isArray(n))i=n.find((e=>{const t=e;return"string"==typeof t.type&&"meshLineMaterial"===t.type}));else{const e=n;"string"==typeof e.type&&"meshLineMaterial"===e.type&&(i=e)}return"object"==typeof(null==(e=i)?void 0:e.props)&&t.setValues(i.props),t}),[r,d,m,n]);return i.useEffect((()=>{b.uniforms.resolution.value.set(m.width,m.height)}),[m]),(0,o.useFrame)((()=>{y.current&&x.setPoints(y.current,p)})),i.createElement("group",null,i.createElement("mesh",{ref:t,geometry:x,material:b}),i.createElement("group",{ref:g},n))})),qa=new a.Triangle,Ka=new a.Vector3;class Ja{constructor(e){let t=e.geometry;t.index&&(console.warn("THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry."),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.colorAttribute=this.geometry.getAttribute("color"),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){const e=this.positionAttribute,t=this.weightAttribute,n=new Float32Array(e.count/3);for(let i=0;i<e.count;i+=3){let r=1;t&&(r=t.getX(i)+t.getX(i+1)+t.getX(i+2)),qa.a.fromBufferAttribute(e,i),qa.b.fromBufferAttribute(e,i+1),qa.c.fromBufferAttribute(e,i+2),r*=qa.getArea(),n[i/3]=r}this.distribution=new Float32Array(e.count/3);let r=0;for(let i=0;i<n.length;i++)r+=n[i],this.distribution[i]=r;return this}setRandomGenerator(e){return this.randomFunction=e,this}sample(e,t,n){const r=this.sampleFaceIndex();return this.sampleFace(r,e,t,n)}sampleFaceIndex(){const e=this.distribution[this.distribution.length-1];return this.binarySearch(this.randomFunction()*e)}binarySearch(e){const t=this.distribution;let n=0,r=t.length-1,i=-1;for(;n<=r;){const s=Math.ceil((n+r)/2);if(0===s||t[s-1]<=e&&t[s]>e){i=s;break}e<t[s]?r=s-1:n=s+1}return i}sampleFace(e,t,n,r){let i=this.randomFunction(),s=this.randomFunction();return i+s>1&&(i=1-i,s=1-s),qa.a.fromBufferAttribute(this.positionAttribute,3*e),qa.b.fromBufferAttribute(this.positionAttribute,3*e+1),qa.c.fromBufferAttribute(this.positionAttribute,3*e+2),t.set(0,0,0).addScaledVector(qa.a,i).addScaledVector(qa.b,s).addScaledVector(qa.c,1-(i+s)),void 0!==n&&qa.getNormal(n),void 0!==r&&void 0!==this.colorAttribute&&(qa.a.fromBufferAttribute(this.colorAttribute,3*e),qa.b.fromBufferAttribute(this.colorAttribute,3*e+1),qa.c.fromBufferAttribute(this.colorAttribute,3*e+2),Ka.set(0,0,0).addScaledVector(qa.a,i).addScaledVector(qa.b,s).addScaledVector(qa.c,1-(i+s)),r.r=Ka.x,r.g=Ka.y,r.b=Ka.z),this}}const Za=({children:e,weight:t,transform:n,instances:s,mesh:o,...l})=>{const c=i.useRef(null),h=i.useRef(null),u=i.useRef(null);return i.useEffect((()=>{var e,t;h.current=null!==(e=null==s?void 0:s.current)&&void 0!==e?e:c.current.children.find((e=>e.hasOwnProperty("instanceMatrix"))),u.current=null!==(t=null==o?void 0:o.current)&&void 0!==t?t:c.current.children.find((e=>"Mesh"===e.type))}),[e,null==o?void 0:o.current,null==s?void 0:s.current]),i.useEffect((()=>{if(void 0===u.current)return;if(void 0===h.current)return;const e=new Ja(u.current);t&&e.setWeightAttribute(t),e.build();const r=new a.Vector3,i=new a.Vector3,s=new a.Color,o=new a.Object3D;u.current.updateMatrixWorld(!0);for(let t=0;t<h.current.count;t++)e.sample(r,i,s),"function"==typeof n?n({dummy:o,sampledMesh:u.current,position:r,normal:i,color:s},t):o.position.copy(r),o.updateMatrix(),h.current.setMatrixAt(t,o.matrix);h.current.instanceMatrix.needsUpdate=!0}),[e,null==o?void 0:o.current,null==s?void 0:s.current]),i.createElement("group",(0,r.Z)({ref:c},l),e)},$a=({compute:e,name:t,...n})=>{const[s]=i.useState((()=>new a.BufferAttribute(new Float32Array(0),1))),o=i.useRef(null);return i.useLayoutEffect((()=>{if(o.current){var t;const n=null!==(t=o.current.parent)&&void 0!==t?t:o.current.__r3f.parent,r=e(n);o.current.copy(r)}}),[e]),i.createElement("primitive",(0,r.Z)({ref:o,object:s,attachObject:["attributes",t]},n))};var eo=n(25030),to=n.n(eo);function no(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData"],deep:n,inject:r,castShadow:s,receiveShadow:a}){let o=to()(e,t);return n&&(o.geometry&&"materialsOnly"!==n&&(o.geometry=o.geometry.clone()),o.material&&"geometriesOnly"!==n&&(o.material=o.material.clone())),r&&(o="function"==typeof r?{...o,children:r(e)}:i.isValidElement(r)?{...o,children:r}:{...o,...r}),"Mesh"===e.type&&(s&&(o.castShadow=!0),a&&(o.receiveShadow=!0)),o}const ro=i.forwardRef((({object:e,children:t,deep:n,castShadow:s,receiveShadow:a,inject:o,keys:l,...c},h)=>{const u={keys:l,deep:n,inject:o,castShadow:s,receiveShadow:a};if(Array.isArray(e))return i.createElement("group",(0,r.Z)({},c,{ref:h}),e.map((e=>i.createElement(ro,(0,r.Z)({key:e.uuid,object:e},u)))),t);const{children:d,...p}=no(e,u),f=e.type[0].toLowerCase()+e.type.slice(1);return i.createElement(f,(0,r.Z)({},p,c,{ref:h}),(null==e?void 0:e.children).map((e=>{let t={},n=e.type[0].toLowerCase()+e.type.slice(1);return"group"===n||"object3D"===n?(n=ro,t={object:e,...u}):t=no(e,u),i.createElement(n,(0,r.Z)({key:e.uuid},t))})),t,d)})),io=i.forwardRef((({makeDefault:e,...t},n)=>{const s=(0,o.useThree)((({set:e})=>e)),a=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{c.current&&!t.manual&&c.current.updateProjectionMatrix()}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=a;return s((()=>({camera:c.current}))),()=>s((()=>({camera:e})))}}),[a,c,e,s]),i.createElement("orthographicCamera",(0,r.Z)({left:l.width/-2,right:l.width/2,top:l.height/2,bottom:l.height/-2,ref:M([c,n])},t))})),so=i.forwardRef((({makeDefault:e,...t},n)=>{const s=(0,o.useThree)((({set:e})=>e)),a=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{const{current:e}=c;e&&!t.manual&&(e.aspect=l.width/l.height,e.updateProjectionMatrix())}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=a;return s((()=>({camera:c.current}))),()=>s((()=>({camera:e})))}}),[a,c,e,s]),i.createElement("perspectiveCamera",(0,r.Z)({ref:M([c,n])},t))}));function ao({children:e,fog:t,frames:n=1/0,resolution:r=256,near:s=1,far:l=1e3,...c}){const h=i.useRef(),[u,d]=i.useState(),p=(0,o.useThree)((({scene:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=i.useMemo((()=>{const e=new a.WebGLCubeRenderTarget(r);return e.texture.type=a.HalfFloatType,e}),[r]);let g=0;return(0,o.useFrame)((()=>{if(u&&h.current&&(n===1/0||g<n)){h.current.traverse((e=>e.visible=!1));const e=p.fog;p.fog=t||e,u.update(f,p),p.fog=e,h.current.traverse((e=>e.visible=!0)),g++}})),i.createElement("group",c,i.createElement("cubeCamera",{ref:d,args:[s,l,m]}),i.createElement("group",{ref:h},e(m.texture)))}var oo=Object.defineProperty,lo=(e,t,n)=>(((e,t,n)=>{t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class co extends a.EventDispatcher{constructor(e){super(),lo(this,"object"),lo(this,"changeEvent",{type:"change"}),lo(this,"EPS",1e-6),lo(this,"enabled",!0),lo(this,"deviceOrientation",{alpha:0,beta:0,gamma:0}),lo(this,"screenOrientation",0),lo(this,"alphaOffset",0),lo(this,"onDeviceOrientationChangeEvent",(e=>{this.deviceOrientation=e})),lo(this,"onScreenOrientationChangeEvent",(()=>{this.screenOrientation=window.orientation||0})),lo(this,"zee",new a.Vector3(0,0,1)),lo(this,"euler",new a.Euler),lo(this,"q0",new a.Quaternion),lo(this,"q1",new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5))),lo(this,"setObjectQuaternion",((e,t,n,r,i)=>{this.euler.set(n,t,-r,"YXZ"),e.setFromEuler(this.euler),e.multiply(this.q1),e.multiply(this.q0.setFromAxisAngle(this.zee,-i))})),lo(this,"connect",(()=>{this.onScreenOrientationChangeEvent(),void 0!==window.DeviceOrientationEvent&&"function"==typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then((e=>{"granted"==e&&(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent))})).catch((e=>{console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",e)})):(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent)),this.enabled=!0})),lo(this,"disconnect",(()=>{window.removeEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.removeEventListener("deviceorientation",this.onDeviceOrientationChangeEvent),this.enabled=!1})),lo(this,"lastQuaternion",new a.Quaternion),lo(this,"update",(()=>{if(!1===this.enabled)return;const e=this.deviceOrientation;if(e){const t=e.alpha?a.MathUtils.degToRad(e.alpha)+this.alphaOffset:0,n=e.beta?a.MathUtils.degToRad(e.beta):0,r=e.gamma?a.MathUtils.degToRad(e.gamma):0,i=this.screenOrientation?a.MathUtils.degToRad(this.screenOrientation):0;this.setObjectQuaternion(this.object.quaternion,t,n,r,i),8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS&&(this.lastQuaternion.copy(this.object.quaternion),this.dispatchEvent(this.changeEvent))}})),lo(this,"dispose",(()=>this.disconnect())),this.object=e,this.object.rotation.reorder("YXZ"),this.connect()}}const ho=i.forwardRef(((e,t)=>{const{camera:n,onChange:s,...a}=e,l=(0,o.useThree)((e=>e.camera)),c=(0,o.useThree)((e=>e.invalidate)),h=n||l,[u]=i.useState((()=>new co(h)));return i.useEffect((()=>{const e=e=>{c(),s&&s(e)};return null==u||null==u.addEventListener||u.addEventListener("change",e),()=>null==u||null==u.removeEventListener?void 0:u.removeEventListener("change",e)}),[s,u,c]),(0,o.useFrame)((()=>null==u?void 0:u.update())),i.useEffect((()=>{const e=u;return null==e||e.connect(),()=>null==e?void 0:e.dispose()}),[u]),u?i.createElement("primitive",(0,r.Z)({ref:t,dispose:void 0,object:u},a)):null}));var uo=Object.defineProperty,po=(e,t,n)=>(((e,t,n)=>{t in e?uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function fo(e){e.preventDefault()}class mo extends a.EventDispatcher{constructor(e,t){super(),po(this,"object"),po(this,"domElement",null),po(this,"movementSpeed",1),po(this,"rollSpeed",.005),po(this,"dragToLook",!1),po(this,"autoForward",!1),po(this,"changeEvent",{type:"change"}),po(this,"EPS",1e-6),po(this,"tmpQuaternion",new a.Quaternion),po(this,"mouseStatus",0),po(this,"movementSpeedMultiplier",1),po(this,"moveState",{up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0}),po(this,"moveVector",new a.Vector3(0,0,0)),po(this,"rotationVector",new a.Vector3(0,0,0)),po(this,"keydown",(e=>{if(!e.altKey){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}})),po(this,"keyup",(e=>{switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()})),po(this,"pointerdown",(e=>{if(this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}})),po(this,"pointermove",(e=>{if(!this.dragToLook||this.mouseStatus>0){const t=this.getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this.updateRotationVector()}})),po(this,"pointerup",(e=>{if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()})),po(this,"lastQuaternion",new a.Quaternion),po(this,"lastPosition",new a.Vector3),po(this,"update",(e=>{const t=e*this.movementSpeed,n=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*n,this.rotationVector.y*n,this.rotationVector.z*n,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS)&&(this.dispatchEvent(this.changeEvent),this.lastQuaternion.copy(this.object.quaternion),this.lastPosition.copy(this.object.position))})),po(this,"updateMovementVector",(()=>{const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back})),po(this,"updateRotationVector",(()=>{this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft})),po(this,"getContainerDimensions",(()=>this.domElement==document||this.domElement instanceof Document?{size:[window.innerWidth,window.innerHeight],offset:[0,0]}:{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]})),po(this,"connect",(e=>{this.domElement=e,!e||e instanceof Document||e.setAttribute("tabindex",-1),this.domElement.addEventListener("contextmenu",fo),this.domElement.addEventListener("pointermove",this.pointermove),this.domElement.addEventListener("pointerdown",this.pointerdown),this.domElement.addEventListener("pointerup",this.pointerup),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup)})),po(this,"dispose",(()=>{this.domElement.removeEventListener("contextmenu",fo),this.domElement.removeEventListener("pointermove",this.pointermove),this.domElement.removeEventListener("pointerdown",this.pointerdown),this.domElement.removeEventListener("pointerup",this.pointerup),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup)})),this.object=e,void 0!==t&&this.connect(t),this.updateMovementVector(),this.updateRotationVector()}}const go=i.forwardRef(((e,t)=>{const{onChange:n,...s}=e,a=(0,o.useThree)((({invalidate:e})=>e)),l=(0,o.useThree)((({camera:e})=>e)),c=(0,o.useThree)((({gl:e})=>e)),[h]=i.useState((()=>new mo(l,c.domElement)));return i.useEffect((()=>{const e=e=>{a(),n&&n(e)};return null==h||null==h.addEventListener||h.addEventListener("change",e),()=>null==h||null==h.removeEventListener?void 0:h.removeEventListener("change",e)}),[n,h,a]),(0,o.useFrame)(((e,t)=>null==h?void 0:h.update(t))),h?i.createElement("primitive",(0,r.Z)({ref:t,dispose:void 0,object:h},s)):null}));var Ao=Object.defineProperty,vo=(e,t,n)=>(((e,t,n)=>{t in e?Ao(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const yo=new a.Ray,xo=new a.Plane,bo=Math.cos(Math.PI/180*70),Eo=(e,t)=>(e%t+t)%t;class _o extends a.EventDispatcher{constructor(e,t){super(),vo(this,"object"),vo(this,"domElement"),vo(this,"enabled",!0),vo(this,"target",new a.Vector3),vo(this,"minDistance",0),vo(this,"maxDistance",1/0),vo(this,"minZoom",0),vo(this,"maxZoom",1/0),vo(this,"minPolarAngle",0),vo(this,"maxPolarAngle",Math.PI),vo(this,"minAzimuthAngle",-1/0),vo(this,"maxAzimuthAngle",1/0),vo(this,"enableDamping",!1),vo(this,"dampingFactor",.05),vo(this,"enableZoom",!0),vo(this,"zoomSpeed",1),vo(this,"enableRotate",!0),vo(this,"rotateSpeed",1),vo(this,"enablePan",!0),vo(this,"panSpeed",1),vo(this,"screenSpacePanning",!0),vo(this,"keyPanSpeed",7),vo(this,"zoomToCursor",!1),vo(this,"autoRotate",!1),vo(this,"autoRotateSpeed",2),vo(this,"reverseOrbit",!1),vo(this,"reverseHorizontalOrbit",!1),vo(this,"reverseVerticalOrbit",!1),vo(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),vo(this,"mouseButtons",{LEFT:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN}),vo(this,"touches",{ONE:a.TOUCH.ROTATE,TWO:a.TOUCH.DOLLY_PAN}),vo(this,"target0"),vo(this,"position0"),vo(this,"zoom0"),vo(this,"_domElementKeyEvents",null),vo(this,"getPolarAngle"),vo(this,"getAzimuthalAngle"),vo(this,"setPolarAngle"),vo(this,"setAzimuthalAngle"),vo(this,"getDistance"),vo(this,"listenToKeyEvents"),vo(this,"stopListenToKeyEvents"),vo(this,"saveState"),vo(this,"reset"),vo(this,"update"),vo(this,"connect"),vo(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=e=>{let t=Eo(e,2*Math.PI),r=h.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),u.phi=t-r,n.update()},this.setAzimuthalAngle=e=>{let t=Eo(e,2*Math.PI),r=h.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),u.theta=t-r,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",J),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",J),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),l=o.NONE},this.update=(()=>{const t=new a.Vector3,i=new a.Vector3(0,1,0),s=(new a.Quaternion).setFromUnitVectors(e.up,i),f=s.clone().invert(),m=new a.Vector3,g=new a.Quaternion,A=2*Math.PI;return function(){const v=n.object.position;s.setFromUnitVectors(e.up,i),f.copy(s).invert(),t.copy(v).sub(n.target),t.applyQuaternion(s),h.setFromVector3(t),n.autoRotate&&l===o.NONE&&I(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(h.theta+=u.theta*n.dampingFactor,h.phi+=u.phi*n.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);let y=n.minAzimuthAngle,x=n.maxAzimuthAngle;isFinite(y)&&isFinite(x)&&(y<-Math.PI?y+=A:y>Math.PI&&(y-=A),x<-Math.PI?x+=A:x>Math.PI&&(x-=A),h.theta=y<=x?Math.max(y,Math.min(x,h.theta)):h.theta>(y+x)/2?Math.max(y,h.theta):Math.min(x,h.theta)),h.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,h.phi)),h.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(p,n.dampingFactor):n.target.add(p),n.zoomToCursor&&w||n.object.isOrthographicCamera?h.radius=O(h.radius):h.radius=O(h.radius*d),t.setFromSpherical(h),t.applyQuaternion(f),v.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,p.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),p.set(0,0,0));let b=!1;if(n.zoomToCursor&&w){let r=null;if(n.object instanceof a.PerspectiveCamera&&n.object.isPerspectiveCamera){const e=t.length();r=O(e*d);const i=e-r;n.object.position.addScaledVector(_,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const e=new a.Vector3(S.x,S.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0;const i=new a.Vector3(S.x,S.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(yo.origin.copy(n.object.position),yo.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(yo.direction))<bo?e.lookAt(n.target):(xo.setFromNormalAndCoplanarPoint(n.object.up,n.target),yo.intersectPlane(xo,n.target))))}else n.object instanceof a.OrthographicCamera&&n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0);return d=1,w=!1,!!(b||m.distanceToSquared(n.object.position)>c||8*(1-g.dot(n.object.quaternion))>c)&&(n.dispatchEvent(r),m.copy(n.object.position),g.copy(n.object.quaternion),b=!1,!0)}})(),this.connect=e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",Z),n.domElement.addEventListener("pointerdown",W),n.domElement.addEventListener("pointercancel",q),n.domElement.addEventListener("wheel",K)},this.dispose=()=>{var e,t,r,i,s,a;null==(e=n.domElement)||e.removeEventListener("contextmenu",Z),null==(t=n.domElement)||t.removeEventListener("pointerdown",W),null==(r=n.domElement)||r.removeEventListener("pointercancel",q),null==(i=n.domElement)||i.removeEventListener("wheel",K),null==(s=n.domElement)||s.ownerDocument.removeEventListener("pointermove",X),null==(a=n.domElement)||a.ownerDocument.removeEventListener("pointerup",Y),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",J)};const n=this,r={type:"change"},i={type:"start"},s={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const c=1e-6,h=new a.Spherical,u=new a.Spherical;let d=1;const p=new a.Vector3,f=new a.Vector2,m=new a.Vector2,g=new a.Vector2,A=new a.Vector2,v=new a.Vector2,y=new a.Vector2,x=new a.Vector2,b=new a.Vector2,E=new a.Vector2,_=new a.Vector3,S=new a.Vector2;let w=!1;const M=[],C={};function T(){return Math.pow(.95,n.zoomSpeed)}function I(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function B(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}const R=(()=>{const e=new a.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),p.add(e)}})(),P=(()=>{const e=new a.Vector3;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),p.add(e)}})(),D=(()=>{const e=new a.Vector3;return function(t,r){const i=n.domElement;if(i&&n.object instanceof a.PerspectiveCamera&&n.object.isPerspectiveCamera){const s=n.object.position;e.copy(s).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),R(2*t*a/i.clientHeight,n.object.matrix),P(2*r*a/i.clientHeight,n.object.matrix)}else i&&n.object instanceof a.OrthographicCamera&&n.object.isOrthographicCamera?(R(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),P(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function L(e){n.object instanceof a.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof a.OrthographicCamera&&n.object.isOrthographicCamera?d/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(e){n.object instanceof a.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof a.OrthographicCamera&&n.object.isOrthographicCamera?d*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function U(e){if(!n.zoomToCursor||!n.domElement)return;w=!0;const t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,s=t.width,a=t.height;S.x=r/s*2-1,S.y=-i/a*2+1,_.set(S.x,S.y,1).unproject(n.object).sub(n.object.position).normalize()}function O(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function N(e){f.set(e.clientX,e.clientY)}function k(e){A.set(e.clientX,e.clientY)}function G(){if(1==M.length)f.set(M[0].pageX,M[0].pageY);else{const e=.5*(M[0].pageX+M[1].pageX),t=.5*(M[0].pageY+M[1].pageY);f.set(e,t)}}function z(){if(1==M.length)A.set(M[0].pageX,M[0].pageY);else{const e=.5*(M[0].pageX+M[1].pageX),t=.5*(M[0].pageY+M[1].pageY);A.set(e,t)}}function Q(){const e=M[0].pageX-M[1].pageX,t=M[0].pageY-M[1].pageY,n=Math.sqrt(e*e+t*t);x.set(0,n)}function V(e){if(1==M.length)m.set(e.pageX,e.pageY);else{const t=te(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);m.set(n,r)}g.subVectors(m,f).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(I(2*Math.PI*g.x/t.clientHeight),B(2*Math.PI*g.y/t.clientHeight)),f.copy(m)}function H(e){if(1==M.length)v.set(e.pageX,e.pageY);else{const t=te(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);v.set(n,r)}y.subVectors(v,A).multiplyScalar(n.panSpeed),D(y.x,y.y),A.copy(v)}function j(e){const t=te(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);b.set(0,s),E.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),L(E.y),x.copy(b)}function W(e){var t,r;!1!==n.enabled&&(0===M.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",X),null==(r=n.domElement)||r.ownerDocument.addEventListener("pointerup",Y)),function(e){M.push(e)}(e),"touch"===e.pointerType?function(e){switch(ee(e),M.length){case 1:switch(n.touches.ONE){case a.TOUCH.ROTATE:if(!1===n.enableRotate)return;G(),l=o.TOUCH_ROTATE;break;case a.TOUCH.PAN:if(!1===n.enablePan)return;z(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(n.touches.TWO){case a.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&Q(),n.enablePan&&z(),l=o.TOUCH_DOLLY_PAN;break;case a.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&Q(),n.enableRotate&&G(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&n.dispatchEvent(i)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case a.MOUSE.DOLLY:if(!1===n.enableZoom)return;!function(e){U(e),x.set(e.clientX,e.clientY)}(e),l=o.DOLLY;break;case a.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;k(e),l=o.PAN}else{if(!1===n.enableRotate)return;N(e),l=o.ROTATE}break;case a.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;N(e),l=o.ROTATE}else{if(!1===n.enablePan)return;k(e),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&n.dispatchEvent(i)}(e))}function X(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(ee(e),l){case o.TOUCH_ROTATE:if(!1===n.enableRotate)return;V(e),n.update();break;case o.TOUCH_PAN:if(!1===n.enablePan)return;H(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&j(e),n.enablePan&&H(e)}(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&j(e),n.enableRotate&&V(e)}(e),n.update();break;default:l=o.NONE}}(e):function(e){if(!1===n.enabled)return;switch(l){case o.ROTATE:if(!1===n.enableRotate)return;!function(e){m.set(e.clientX,e.clientY),g.subVectors(m,f).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(I(2*Math.PI*g.x/t.clientHeight),B(2*Math.PI*g.y/t.clientHeight)),f.copy(m),n.update()}(e);break;case o.DOLLY:if(!1===n.enableZoom)return;!function(e){b.set(e.clientX,e.clientY),E.subVectors(b,x),E.y>0?L(T()):E.y<0&&F(T()),x.copy(b),n.update()}(e);break;case o.PAN:if(!1===n.enablePan)return;!function(e){v.set(e.clientX,e.clientY),y.subVectors(v,A).multiplyScalar(n.panSpeed),D(y.x,y.y),A.copy(v),n.update()}(e)}}(e))}function Y(e){var t,r,i;$(e),0===M.length&&(null==(t=n.domElement)||t.releasePointerCapture(e.pointerId),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",X),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",Y)),n.dispatchEvent(s),l=o.NONE}function q(e){$(e)}function K(e){!1===n.enabled||!1===n.enableZoom||l!==o.NONE&&l!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),function(e){U(e),e.deltaY<0?F(T()):e.deltaY>0&&L(T()),n.update()}(e),n.dispatchEvent(s))}function J(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:D(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:D(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:D(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:D(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function Z(e){!1!==n.enabled&&e.preventDefault()}function $(e){delete C[e.pointerId];for(let t=0;t<M.length;t++)if(M[t].pointerId==e.pointerId)return void M.splice(t,1)}function ee(e){let t=C[e.pointerId];void 0===t&&(t=new a.Vector2,C[e.pointerId]=t),t.set(e.pageX,e.pageY)}function te(e){const t=e.pointerId===M[0].pointerId?M[1]:M[0];return C[t.pointerId]}void 0!==t&&this.connect(t),this.update()}}class So extends _o{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=a.MOUSE.PAN,this.mouseButtons.RIGHT=a.MOUSE.ROTATE,this.touches.ONE=a.TOUCH.PAN,this.touches.TWO=a.TOUCH.DOLLY_ROTATE}}const wo=i.forwardRef(((e={enableDamping:!0},t)=>{const{camera:n,onChange:s,onStart:a,onEnd:l,...c}=e,h=(0,o.useThree)((({invalidate:e})=>e)),u=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({gl:e})=>e.domElement)),p=n||u,f=i.useMemo((()=>new So(p)),[p]);return i.useEffect((()=>{f.connect(d);const e=e=>{h(),s&&s(e)};return f.addEventListener("change",e),a&&f.addEventListener("start",a),l&&f.addEventListener("end",l),()=>{f.dispose(),f.removeEventListener("change",e),a&&f.removeEventListener("start",a),l&&f.removeEventListener("end",l)}}),[s,a,l,f,h,d]),(0,o.useFrame)((()=>f.update())),i.createElement("primitive",(0,r.Z)({ref:t,dispose:void 0,object:f,enableDamping:!0},c))})),Mo=i.forwardRef((({makeDefault:e,camera:t,regress:n,domElement:s,enableDamping:a=!0,onChange:l,onStart:c,onEnd:h,...u},d)=>{const p=(0,o.useThree)((e=>e.invalidate)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.gl)),g=(0,o.useThree)((e=>e.events)),A=(0,o.useThree)((e=>e.set)),v=(0,o.useThree)((e=>e.get)),y=(0,o.useThree)((e=>e.performance)),x=t||f,b=s||g.connected||m.domElement,E=i.useMemo((()=>new _o(x)),[x]);return(0,o.useFrame)((()=>{E.enabled&&E.update()})),i.useEffect((()=>(E.connect(b),()=>{E.dispose()})),[b,n,E,p]),i.useEffect((()=>{const e=e=>{p(),n&&y.regress(),l&&l(e)};return E.addEventListener("change",e),c&&E.addEventListener("start",c),h&&E.addEventListener("end",h),()=>{c&&E.removeEventListener("start",c),h&&E.removeEventListener("end",h),E.removeEventListener("change",e)}}),[l,c,h]),i.useEffect((()=>{if(e){const e=v().controls;return A({controls:E}),()=>A({controls:e})}}),[e,E]),i.createElement("primitive",(0,r.Z)({ref:d,object:E,enableDamping:a},u))}));var Co=Object.defineProperty,To=(e,t,n)=>(((e,t,n)=>{t in e?Co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class Io extends a.EventDispatcher{constructor(e,t){super(),To(this,"enabled",!0),To(this,"screen",{left:0,top:0,width:0,height:0}),To(this,"rotateSpeed",1),To(this,"zoomSpeed",1.2),To(this,"panSpeed",.3),To(this,"noRotate",!1),To(this,"noZoom",!1),To(this,"noPan",!1),To(this,"staticMoving",!1),To(this,"dynamicDampingFactor",.2),To(this,"minDistance",0),To(this,"maxDistance",1/0),To(this,"keys",["KeyA","KeyS","KeyD"]),To(this,"mouseButtons",{LEFT:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN}),To(this,"object"),To(this,"domElement"),To(this,"cursorZoom",!1),To(this,"target",new a.Vector3),To(this,"mousePosition",new a.Vector2),To(this,"STATE",{NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4}),To(this,"EPS",1e-6),To(this,"lastZoom",1),To(this,"lastPosition",new a.Vector3),To(this,"cursorVector",new a.Vector3),To(this,"targetVector",new a.Vector3),To(this,"_state",this.STATE.NONE),To(this,"_keyState",this.STATE.NONE),To(this,"_eye",new a.Vector3),To(this,"_movePrev",new a.Vector2),To(this,"_moveCurr",new a.Vector2),To(this,"_lastAxis",new a.Vector3),To(this,"_lastAngle",0),To(this,"_zoomStart",new a.Vector2),To(this,"_zoomEnd",new a.Vector2),To(this,"_touchZoomDistanceStart",0),To(this,"_touchZoomDistanceEnd",0),To(this,"_panStart",new a.Vector2),To(this,"_panEnd",new a.Vector2),To(this,"target0"),To(this,"position0"),To(this,"up0"),To(this,"zoom0"),To(this,"changeEvent",{type:"change"}),To(this,"startEvent",{type:"start"}),To(this,"endEvent",{type:"end"}),To(this,"onScreenVector",new a.Vector2),To(this,"getMouseOnScreen",((e,t)=>(this.onScreenVector.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),this.onScreenVector))),To(this,"onCircleVector",new a.Vector2),To(this,"getMouseOnCircle",((e,t)=>(this.onCircleVector.set((e-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-t))/this.screen.width),this.onCircleVector))),To(this,"axis",new a.Vector3),To(this,"quaternion",new a.Quaternion),To(this,"eyeDirection",new a.Vector3),To(this,"objectUpDirection",new a.Vector3),To(this,"objectSidewaysDirection",new a.Vector3),To(this,"moveDirection",new a.Vector3),To(this,"angle",0),To(this,"rotateCamera",(()=>{this.moveDirection.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0),this.angle=this.moveDirection.length(),this.angle?(this._eye.copy(this.object.position).sub(this.target),this.eyeDirection.copy(this._eye).normalize(),this.objectUpDirection.copy(this.object.up).normalize(),this.objectSidewaysDirection.crossVectors(this.objectUpDirection,this.eyeDirection).normalize(),this.objectUpDirection.setLength(this._moveCurr.y-this._movePrev.y),this.objectSidewaysDirection.setLength(this._moveCurr.x-this._movePrev.x),this.moveDirection.copy(this.objectUpDirection.add(this.objectSidewaysDirection)),this.axis.crossVectors(this.moveDirection,this._eye).normalize(),this.angle*=this.rotateSpeed,this.quaternion.setFromAxisAngle(this.axis,this.angle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion),this._lastAxis.copy(this.axis),this._lastAngle=this.angle):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),this.quaternion.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion)),this._movePrev.copy(this._moveCurr)})),To(this,"zoomCamera",(()=>{let e;if(this._state===this.STATE.TOUCH_ZOOM_PAN)e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom/=e,this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type");else{if(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,Math.abs(e-1)>this.EPS&&e>0&&(this.object.isPerspectiveCamera?(e>1&&this._eye.length()>=this.maxDistance-this.EPS&&(e=1),this._eye.multiplyScalar(e)):this.object.isOrthographicCamera?(e>1&&this.object.zoom<this.maxDistance*this.maxDistance&&(e=1),this.object.zoom/=e):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor,this.cursorZoom){this.targetVector.copy(this.target).project(this.object);let t=this.cursorVector.set(this.mousePosition.x,this.mousePosition.y,this.targetVector.z).unproject(this.object);this.target.lerpVectors(t,this.target,e)}this.object.isOrthographicCamera&&this.object.updateProjectionMatrix()}})),To(this,"mouseChange",new a.Vector2),To(this,"objectUp",new a.Vector3),To(this,"pan",new a.Vector3),To(this,"panCamera",(()=>{if(this.domElement&&(this.mouseChange.copy(this._panEnd).sub(this._panStart),this.mouseChange.lengthSq()>this.EPS)){if(this.object.isOrthographicCamera){const e=this.object,t=(e.right-e.left)/this.object.zoom,n=(e.top-e.bottom)/this.object.zoom;this.mouseChange.x*=t,this.mouseChange.y*=n}else this.mouseChange.multiplyScalar(this._eye.length()*this.panSpeed);this.pan.copy(this._eye).cross(this.object.up).setLength(this.mouseChange.x),this.pan.add(this.objectUp.copy(this.object.up).setLength(this.mouseChange.y)),this.object.position.add(this.pan),this.target.add(this.pan),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(this.mouseChange.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}})),To(this,"checkDistances",(()=>{this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))})),To(this,"handleResize",(()=>{if(!this.domElement)return;const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height})),To(this,"update",(()=>{this._eye.subVectors(this.object.position,this.target),this.noRotate||this.rotateCamera(),this.noZoom||this.zoomCamera(),this.noPan||this.panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this.checkDistances(),this.object.lookAt(this.target),this.lastPosition.distanceToSquared(this.object.position)>this.EPS&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||this.lastZoom!==this.object.zoom)&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")})),To(this,"reset",(()=>{this._state=this.STATE.NONE,this._keyState=this.STATE.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.up.copy(this.up0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom})),To(this,"keydown",(e=>{!1!==this.enabled&&(window.removeEventListener("keydown",this.keydown),this._keyState===this.STATE.NONE&&(e.code!==this.keys[this.STATE.ROTATE]||this.noRotate?e.code!==this.keys[this.STATE.ZOOM]||this.noZoom?e.code!==this.keys[this.STATE.PAN]||this.noPan||(this._keyState=this.STATE.PAN):this._keyState=this.STATE.ZOOM:this._keyState=this.STATE.ROTATE))})),To(this,"onPointerDown",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseDown(e)}})),To(this,"onPointerMove",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseMove(e)}})),To(this,"onPointerUp",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseUp()}})),To(this,"keyup",(()=>{!1!==this.enabled&&(this._keyState=this.STATE.NONE,window.addEventListener("keydown",this.keydown))})),To(this,"onMouseDown",(e=>{if(!this.domElement)return;if(this._state===this.STATE.NONE)switch(e.button){case this.mouseButtons.LEFT:this._state=this.STATE.ROTATE;break;case this.mouseButtons.MIDDLE:this._state=this.STATE.ZOOM;break;case this.mouseButtons.RIGHT:this._state=this.STATE.PAN;break;default:this._state=this.STATE.NONE}const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||(this._panStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.startEvent)})),To(this,"onMouseMove",(e=>{if(!1===this.enabled)return;const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||this._panEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):this._zoomEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)))})),To(this,"onMouseUp",(()=>{this.domElement&&!1!==this.enabled&&(this._state=this.STATE.NONE,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.endEvent))})),To(this,"mousewheel",(e=>{if(!1!==this.enabled&&!0!==this.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=.025*e.deltaY;break;case 1:this._zoomStart.y-=.01*e.deltaY;break;default:this._zoomStart.y-=25e-5*e.deltaY}this.mousePosition.x=e.offsetX/this.screen.width*2-1,this.mousePosition.y=-e.offsetY/this.screen.height*2+1,this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}})),To(this,"touchstart",(e=>{if(!1!==this.enabled){if(e.preventDefault(),1===e.touches.length)this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr);else{this._state=this.STATE.TOUCH_ZOOM_PAN;const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+n*n);const r=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panStart.copy(this.getMouseOnScreen(r,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(this.startEvent)}})),To(this,"touchmove",(e=>{if(!1!==this.enabled)if(e.preventDefault(),1===e.touches.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY));else{const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=Math.sqrt(t*t+n*n);const r=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panEnd.copy(this.getMouseOnScreen(r,i))}})),To(this,"touchend",(e=>{if(!1!==this.enabled){switch(e.touches.length){case 0:this._state=this.STATE.NONE;break;case 1:this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr)}this.dispatchEvent(this.endEvent)}})),To(this,"contextmenu",(e=>{!1!==this.enabled&&e.preventDefault()})),To(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("contextmenu",this.contextmenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.mousewheel),this.domElement.addEventListener("touchstart",this.touchstart),this.domElement.addEventListener("touchend",this.touchend),this.domElement.addEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup),this.handleResize()})),To(this,"dispose",(()=>{this.domElement&&(this.domElement.removeEventListener("contextmenu",this.contextmenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.mousewheel),this.domElement.removeEventListener("touchstart",this.touchstart),this.domElement.removeEventListener("touchend",this.touchend),this.domElement.removeEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup))})),this.object=e,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,void 0!==t&&this.connect(t),this.update()}}const Bo=i.forwardRef((({makeDefault:e,camera:t,domElement:n,regress:s,onChange:a,onStart:l,onEnd:c,...h},u)=>{const{invalidate:d,camera:p,gl:f,events:m,set:g,get:A,performance:v,viewport:y}=(0,o.useThree)(),x=t||p,b=n||m.connected||f.domElement,E=i.useMemo((()=>new Io(x)),[x]);return(0,o.useFrame)((()=>{E.enabled&&E.update()})),i.useEffect((()=>(E.connect(b),()=>{E.dispose()})),[b,s,E,d]),i.useEffect((()=>{const e=e=>{d(),s&&v.regress(),a&&a(e)};return E.addEventListener("change",e),l&&E.addEventListener("start",l),c&&E.addEventListener("end",c),()=>{l&&E.removeEventListener("start",l),c&&E.removeEventListener("end",c),E.removeEventListener("change",e)}}),[a,l,c]),i.useEffect((()=>{E.handleResize()}),[y]),i.useEffect((()=>{if(e){const e=A().controls;return g({controls:E}),()=>g({controls:e})}}),[e,E]),i.createElement("primitive",(0,r.Z)({ref:u,object:E},h))}));var Ro=Object.defineProperty,Po=(e,t,n)=>(((e,t,n)=>{t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const Do={IDLE:Symbol(),ROTATE:Symbol(),PAN:Symbol(),SCALE:Symbol(),FOV:Symbol(),FOCUS:Symbol(),ZROTATE:Symbol(),TOUCH_MULTI:Symbol(),ANIMATION_FOCUS:Symbol(),ANIMATION_ROTATE:Symbol()},Lo={NONE:Symbol(),ONE_FINGER:Symbol(),ONE_FINGER_SWITCHED:Symbol(),TWO_FINGER:Symbol(),MULT_FINGER:Symbol(),CURSOR:Symbol()},Fo={x:0,y:0},Uo={camera:new a.Matrix4,gizmos:new a.Matrix4},Oo={type:"change"},No={type:"start"},ko={type:"end"};class Go extends a.EventDispatcher{constructor(e,t=null,n=null){super(),Po(this,"camera"),Po(this,"domElement"),Po(this,"scene"),Po(this,"mouseActions"),Po(this,"_mouseOp"),Po(this,"_v2_1"),Po(this,"_v3_1"),Po(this,"_v3_2"),Po(this,"_m4_1"),Po(this,"_m4_2"),Po(this,"_quat"),Po(this,"_translationMatrix"),Po(this,"_rotationMatrix"),Po(this,"_scaleMatrix"),Po(this,"_rotationAxis"),Po(this,"_cameraMatrixState"),Po(this,"_cameraProjectionState"),Po(this,"_fovState"),Po(this,"_upState"),Po(this,"_zoomState"),Po(this,"_nearPos"),Po(this,"_farPos"),Po(this,"_gizmoMatrixState"),Po(this,"_up0"),Po(this,"_zoom0"),Po(this,"_fov0"),Po(this,"_initialNear"),Po(this,"_nearPos0"),Po(this,"_initialFar"),Po(this,"_farPos0"),Po(this,"_cameraMatrixState0"),Po(this,"_gizmoMatrixState0"),Po(this,"_button"),Po(this,"_touchStart"),Po(this,"_touchCurrent"),Po(this,"_input"),Po(this,"_switchSensibility"),Po(this,"_startFingerDistance"),Po(this,"_currentFingerDistance"),Po(this,"_startFingerRotation"),Po(this,"_currentFingerRotation"),Po(this,"_devPxRatio"),Po(this,"_downValid"),Po(this,"_nclicks"),Po(this,"_downEvents"),Po(this,"_clickStart"),Po(this,"_maxDownTime"),Po(this,"_maxInterval"),Po(this,"_posThreshold"),Po(this,"_movementThreshold"),Po(this,"_currentCursorPosition"),Po(this,"_startCursorPosition"),Po(this,"_grid"),Po(this,"_gridPosition"),Po(this,"_gizmos"),Po(this,"_curvePts"),Po(this,"_timeStart"),Po(this,"_animationId"),Po(this,"focusAnimationTime"),Po(this,"_timePrev"),Po(this,"_timeCurrent"),Po(this,"_anglePrev"),Po(this,"_angleCurrent"),Po(this,"_cursorPosPrev"),Po(this,"_cursorPosCurr"),Po(this,"_wPrev"),Po(this,"_wCurr"),Po(this,"adjustNearFar"),Po(this,"scaleFactor"),Po(this,"dampingFactor"),Po(this,"wMax"),Po(this,"enableAnimations"),Po(this,"enableGrid"),Po(this,"cursorZoom"),Po(this,"minFov"),Po(this,"maxFov"),Po(this,"enabled"),Po(this,"enablePan"),Po(this,"enableRotate"),Po(this,"enableZoom"),Po(this,"minDistance"),Po(this,"maxDistance"),Po(this,"minZoom"),Po(this,"maxZoom"),Po(this,"target"),Po(this,"_currentTarget"),Po(this,"_tbRadius"),Po(this,"_state"),Po(this,"onWindowResize",(()=>{const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3;if(this.camera){const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e)}const t=this._tbRadius/e,n=new a.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new a.BufferGeometry).setFromPoints(n);for(const i in this._gizmos.children){this._gizmos.children[i].geometry=r}this.dispatchEvent(Oo)})),Po(this,"onContextMenu",(e=>{if(this.enabled)for(let t=0;t<this.mouseActions.length;t++)if(2==this.mouseActions[t].mouse){e.preventDefault();break}})),Po(this,"onPointerCancel",(()=>{this._touchStart.splice(0,this._touchStart.length),this._touchCurrent.splice(0,this._touchCurrent.length),this._input=Lo.NONE})),Po(this,"onPointerDown",(e=>{if(0==e.button&&e.isPrimary?(this._downValid=!0,this._downEvents.push(e)):this._downValid=!1,"touch"==e.pointerType&&this._input!=Lo.CURSOR)switch(this._touchStart.push(e),this._touchCurrent.push(e),this._input){case Lo.NONE:this._input=Lo.ONE_FINGER,this.onSinglePanStart(e,"ROTATE"),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp);break;case Lo.ONE_FINGER:case Lo.ONE_FINGER_SWITCHED:this._input=Lo.TWO_FINGER,this.onRotateStart(),this.onPinchStart(),this.onDoublePanStart();break;case Lo.TWO_FINGER:this._input=Lo.MULT_FINGER,this.onTriplePanStart()}else if("touch"!=e.pointerType&&this._input==Lo.NONE){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT"),this._mouseOp=this.getOpFromAction(e.button,t),this._mouseOp&&(window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),this._input=Lo.CURSOR,this._button=e.button,this.onSinglePanStart(e,this._mouseOp))}})),Po(this,"onPointerMove",(e=>{if("touch"==e.pointerType&&this._input!=Lo.CURSOR)switch(this._input){case Lo.ONE_FINGER:this.updateTouchEvent(e),this.onSinglePanMove(e,Do.ROTATE);break;case Lo.ONE_FINGER_SWITCHED:if(this.calculatePointersDistance(this._touchCurrent[0],e)*this._devPxRatio>=this._switchSensibility){this._input=Lo.ONE_FINGER,this.updateTouchEvent(e),this.onSinglePanStart(e,"ROTATE");break}break;case Lo.TWO_FINGER:this.updateTouchEvent(e),this.onRotateMove(),this.onPinchMove(),this.onDoublePanMove();break;case Lo.MULT_FINGER:this.updateTouchEvent(e),this.onTriplePanMove()}else if("touch"!=e.pointerType&&this._input==Lo.CURSOR){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT");const n=this.getOpStateFromAction(this._button,t);n&&this.onSinglePanMove(e,n)}if(this._downValid){this.calculatePointersDistance(this._downEvents[this._downEvents.length-1],e)*this._devPxRatio>this._movementThreshold&&(this._downValid=!1)}})),Po(this,"onPointerUp",(e=>{if("touch"==e.pointerType&&this._input!=Lo.CURSOR){const t=this._touchCurrent.length;for(let n=0;n<t;n++)if(this._touchCurrent[n].pointerId==e.pointerId){this._touchCurrent.splice(n,1),this._touchStart.splice(n,1);break}switch(this._input){case Lo.ONE_FINGER:case Lo.ONE_FINGER_SWITCHED:window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=Lo.NONE,this.onSinglePanEnd();break;case Lo.TWO_FINGER:this.onDoublePanEnd(),this.onPinchEnd(),this.onRotateEnd(),this._input=Lo.ONE_FINGER_SWITCHED;break;case Lo.MULT_FINGER:0==this._touchCurrent.length&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=Lo.NONE,this.onTriplePanEnd())}}else"touch"!=e.pointerType&&this._input==Lo.CURSOR&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=Lo.NONE,this.onSinglePanEnd(),this._button=-1);if(e.isPrimary)if(this._downValid){if(e.timeStamp-this._downEvents[this._downEvents.length-1].timeStamp<=this._maxDownTime)if(0==this._nclicks)this._nclicks=1,this._clickStart=performance.now();else{const t=e.timeStamp-this._clickStart,n=this.calculatePointersDistance(this._downEvents[1],this._downEvents[0])*this._devPxRatio;t<=this._maxInterval&&n<=this._posThreshold?(this._nclicks=0,this._downEvents.splice(0,this._downEvents.length),this.onDoubleTap(e)):(this._nclicks=1,this._downEvents.shift(),this._clickStart=performance.now())}else this._downValid=!1,this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)}else this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)})),Po(this,"onWheel",(e=>{var t,n;if(this.enabled&&this.enableZoom&&this.domElement){let r=null;e.ctrlKey||e.metaKey?r="CTRL":e.shiftKey&&(r="SHIFT");const i=this.getOpFromAction("WHEEL",r);if(i){e.preventDefault(),this.dispatchEvent(No);const r=125;let s=e.deltaY/r,o=1;switch(s>0?o=1/this.scaleFactor:s<0&&(o=this.scaleFactor),i){case"ZOOM":if(this.updateTbState(Do.SCALE,!0),s>0?o=1/Math.pow(this.scaleFactor,s):s<0&&(o=Math.pow(this.scaleFactor,-s)),this.cursorZoom&&this.enablePan){let r;this.camera instanceof a.OrthographicCamera&&(r=null==(t=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position)),this.camera instanceof a.PerspectiveCamera&&(r=null==(n=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:n.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)),void 0!==r&&this.applyTransformMatrix(this.applyScale(o,r))}else this.applyTransformMatrix(this.applyScale(o,this._gizmos.position));this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(Do.IDLE,!1),this.dispatchEvent(Oo),this.dispatchEvent(ko);break;case"FOV":if(this.camera instanceof a.PerspectiveCamera){this.updateTbState(Do.FOV,!0),0!=e.deltaX&&(s=e.deltaX/r,o=1,s>0?o=1/Math.pow(this.scaleFactor,s):s<0&&(o=Math.pow(this.scaleFactor,-s))),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const t=this._v3_1.distanceTo(this._gizmos.position);let n=t/o;n=a.MathUtils.clamp(n,this.minDistance,this.maxDistance);const i=t*Math.tan(a.MathUtils.DEG2RAD*this.camera.fov*.5);let l=a.MathUtils.RAD2DEG*(2*Math.atan(i/n));l>this.maxFov?l=this.maxFov:l<this.minFov&&(l=this.minFov);o=t/(i/Math.tan(a.MathUtils.DEG2RAD*(l/2))),this.setFov(l),this.applyTransformMatrix(this.applyScale(o,this._gizmos.position,!1))}this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(Do.IDLE,!1),this.dispatchEvent(Oo),this.dispatchEvent(ko)}}}})),Po(this,"onSinglePanStart",((e,t)=>{if(this.enabled&&this.domElement)switch(this.dispatchEvent(No),this.setCenter(e.clientX,e.clientY),t){case"PAN":if(!this.enablePan)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(Oo)),this.camera){this.updateTbState(Do.PAN,!0);const e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&(this.drawGrid(),this.dispatchEvent(Oo))}break;case"ROTATE":if(!this.enableRotate)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1),this.camera){this.updateTbState(Do.ROTATE,!0);const e=this.unprojectOnTbSurface(this.camera,Fo.x,Fo.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.activateGizmos(!0),this.enableAnimations&&(this._timePrev=this._timeCurrent=performance.now(),this._angleCurrent=this._anglePrev=0,this._cursorPosPrev.copy(this._startCursorPosition),this._cursorPosCurr.copy(this._cursorPosPrev),this._wCurr=0,this._wPrev=this._wCurr)}this.dispatchEvent(Oo);break;case"FOV":if(!this.enableZoom)return;this.camera instanceof a.PerspectiveCamera&&(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(Oo)),this.updateTbState(Do.FOV,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition));break;case"ZOOM":if(!this.enableZoom)return;-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(Oo)),this.updateTbState(Do.SCALE,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),Po(this,"onSinglePanMove",((e,t)=>{if(this.enabled&&this.domElement){const n=t!=this._state;switch(this.setCenter(e.clientX,e.clientY),t){case Do.PAN:if(this.enablePan&&this.camera)if(n){this.dispatchEvent(ko),this.dispatchEvent(No),this.updateTbState(t,!0);const e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.drawGrid(),this.activateGizmos(!1)}else{const e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition))}break;case Do.ROTATE:if(this.enableRotate&&this.camera)if(n){this.dispatchEvent(ko),this.dispatchEvent(No),this.updateTbState(t,!0);const e=this.unprojectOnTbSurface(this.camera,Fo.x,Fo.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!0)}else{const e=this.unprojectOnTbSurface(this.camera,Fo.x,Fo.y,this.domElement,this._tbRadius);void 0!==e&&this._currentCursorPosition.copy(e);const t=this._startCursorPosition.distanceTo(this._currentCursorPosition),n=this._startCursorPosition.angleTo(this._currentCursorPosition),r=Math.max(t/this._tbRadius,n);this.applyTransformMatrix(this.rotate(this.calculateRotationAxis(this._startCursorPosition,this._currentCursorPosition),r)),this.enableAnimations&&(this._timePrev=this._timeCurrent,this._timeCurrent=performance.now(),this._anglePrev=this._angleCurrent,this._angleCurrent=r,this._cursorPosPrev.copy(this._cursorPosCurr),this._cursorPosCurr.copy(this._currentCursorPosition),this._wPrev=this._wCurr,this._wCurr=this.calculateAngularSpeed(this._anglePrev,this._angleCurrent,this._timePrev,this._timeCurrent))}break;case Do.SCALE:if(this.enableZoom)if(n)this.dispatchEvent(ko),this.dispatchEvent(No),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let n=1;t<0?n=1/Math.pow(this.scaleFactor,-t*e):t>0&&(n=Math.pow(this.scaleFactor,t*e)),this.applyTransformMatrix(this.applyScale(n,this._gizmos.position))}break;case Do.FOV:if(this.enableZoom&&this.camera instanceof a.PerspectiveCamera)if(n)this.dispatchEvent(ko),this.dispatchEvent(No),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let n=1;t<0?n=1/Math.pow(this.scaleFactor,-t*e):t>0&&(n=Math.pow(this.scaleFactor,t*e)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const r=this._v3_1.distanceTo(this._gizmos.position);let i=r/n;i=a.MathUtils.clamp(i,this.minDistance,this.maxDistance);const s=r*Math.tan(a.MathUtils.DEG2RAD*this._fovState*.5);let o=a.MathUtils.RAD2DEG*(2*Math.atan(s/i));o=a.MathUtils.clamp(o,this.minFov,this.maxFov);const l=s/Math.tan(a.MathUtils.DEG2RAD*(o/2));n=r/l,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(o),this.applyTransformMatrix(this.applyScale(n,this._v3_2,!1));const c=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(l/r);this._m4_1.makeTranslation(c.x,c.y,c.z)}}this.dispatchEvent(Oo)}})),Po(this,"onSinglePanEnd",(()=>{if(this._state==Do.ROTATE){if(!this.enableRotate)return;if(this.enableAnimations){if(performance.now()-this._timeCurrent<120){const e=Math.abs((this._wPrev+this._wCurr)/2),t=this;this._animationId=window.requestAnimationFrame((function(n){t.updateTbState(Do.ANIMATION_ROTATE,!0);const r=t.calculateRotationAxis(t._cursorPosPrev,t._cursorPosCurr);t.onRotationAnim(n,r,Math.min(e,t.wMax))}))}else this.updateTbState(Do.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(Oo)}else this.updateTbState(Do.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(Oo)}else this._state!=Do.PAN&&this._state!=Do.IDLE||(this.updateTbState(Do.IDLE,!1),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1),this.dispatchEvent(Oo));this.dispatchEvent(ko)})),Po(this,"onDoubleTap",(e=>{if(this.enabled&&this.enablePan&&this.scene&&this.camera&&this.domElement){this.dispatchEvent(No),this.setCenter(e.clientX,e.clientY);const t=this.unprojectOnObj(this.getCursorNDC(Fo.x,Fo.y,this.domElement),this.camera);if(t&&this.enableAnimations){const e=this;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),this._timeStart=-1,this._animationId=window.requestAnimationFrame((function(n){e.updateTbState(Do.ANIMATION_FOCUS,!0),e.onFocusAnim(n,t,e._cameraMatrixState,e._gizmoMatrixState)}))}else t&&!this.enableAnimations&&(this.updateTbState(Do.FOCUS,!0),this.focus(t,this.scaleFactor),this.updateTbState(Do.IDLE,!1),this.dispatchEvent(Oo))}this.dispatchEvent(ko)})),Po(this,"onDoublePanStart",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.dispatchEvent(No),this.updateTbState(Do.PAN,!0),this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement,!0);void 0!==e&&this._startCursorPosition.copy(e),this._currentCursorPosition.copy(this._startCursorPosition),this.activateGizmos(!1)}})),Po(this,"onDoublePanMove",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=Do.PAN&&(this.updateTbState(Do.PAN,!0),this._startCursorPosition.copy(this._currentCursorPosition));const e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement,!0);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition,!0)),this.dispatchEvent(Oo)}})),Po(this,"onDoublePanEnd",(()=>{this.updateTbState(Do.IDLE,!1),this.dispatchEvent(ko)})),Po(this,"onRotateStart",(()=>{var e;this.enabled&&this.enableRotate&&(this.dispatchEvent(No),this.updateTbState(Do.ZROTATE,!0),this._startFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this._currentFingerRotation=this._startFingerRotation,null==(e=this.camera)||e.getWorldDirection(this._rotationAxis),this.enablePan||this.enableZoom||this.activateGizmos(!0))})),Po(this,"onRotateMove",(()=>{var e;if(this.enabled&&this.enableRotate&&this.camera&&this.domElement){let t;this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=Do.ZROTATE&&(this.updateTbState(Do.ZROTATE,!0),this._startFingerRotation=this._currentFingerRotation),this._currentFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this.enablePan?this.camera&&(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),t=null==(e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._v3_2)):t=(new a.Vector3).setFromMatrixPosition(this._gizmoMatrixState);const n=a.MathUtils.DEG2RAD*(this._startFingerRotation-this._currentFingerRotation);void 0!==t&&this.applyTransformMatrix(this.zRotate(t,n)),this.dispatchEvent(Oo)}})),Po(this,"onRotateEnd",(()=>{this.updateTbState(Do.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(ko)})),Po(this,"onPinchStart",(()=>{this.enabled&&this.enableZoom&&(this.dispatchEvent(No),this.updateTbState(Do.SCALE,!0),this._startFingerDistance=this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),this._currentFingerDistance=this._startFingerDistance,this.activateGizmos(!1))})),Po(this,"onPinchMove",(()=>{var e,t;if(this.enabled&&this.enableZoom&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const n=12;this._state!=Do.SCALE&&(this._startFingerDistance=this._currentFingerDistance,this.updateTbState(Do.SCALE,!0)),this._currentFingerDistance=Math.max(this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),n*this._devPxRatio);const r=this._currentFingerDistance/this._startFingerDistance;let i;this.enablePan?this.camera instanceof a.OrthographicCamera?i=null==(e=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position):this.camera instanceof a.PerspectiveCamera&&(i=null==(t=this.unprojectOnTbPlane(this.camera,Fo.x,Fo.y,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)):i=this._gizmos.position,void 0!==i&&this.applyTransformMatrix(this.applyScale(r,i)),this.dispatchEvent(Oo)}})),Po(this,"onPinchEnd",(()=>{this.updateTbState(Do.IDLE,!1),this.dispatchEvent(ko)})),Po(this,"onTriplePanStart",(()=>{if(this.enabled&&this.enableZoom&&this.domElement){this.dispatchEvent(No),this.updateTbState(Do.SCALE,!0);let e=0,t=0;const n=this._touchCurrent.length;for(let r=0;r<n;r++)e+=this._touchCurrent[r].clientX,t+=this._touchCurrent[r].clientY;this.setCenter(e/n,t/n),this._startCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),Po(this,"onTriplePanMove",(()=>{if(this.enabled&&this.enableZoom&&this.camera&&this.domElement){let e=0,t=0;const n=this._touchCurrent.length;for(let a=0;a<n;a++)e+=this._touchCurrent[a].clientX,t+=this._touchCurrent[a].clientY;this.setCenter(e/n,t/n);const r=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(Fo.x,Fo.y,this.domElement).y);const i=this._currentCursorPosition.y-this._startCursorPosition.y;let s=1;i<0?s=1/Math.pow(this.scaleFactor,-i*r):i>0&&(s=Math.pow(this.scaleFactor,i*r)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const o=this._v3_1.distanceTo(this._gizmos.position);let l=o/s;l=a.MathUtils.clamp(l,this.minDistance,this.maxDistance);const c=o*Math.tan(a.MathUtils.DEG2RAD*this._fovState*.5);let h=a.MathUtils.RAD2DEG*(2*Math.atan(c/l));h=a.MathUtils.clamp(h,this.minFov,this.maxFov);const u=c/Math.tan(a.MathUtils.DEG2RAD*(h/2));s=o/u,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(h),this.applyTransformMatrix(this.applyScale(s,this._v3_2,!1));const d=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(u/o);this._m4_1.makeTranslation(d.x,d.y,d.z),this.dispatchEvent(Oo)}})),Po(this,"onTriplePanEnd",(()=>{this.updateTbState(Do.IDLE,!1),this.dispatchEvent(ko)})),Po(this,"setCenter",((e,t)=>{Fo.x=e,Fo.y=t})),Po(this,"initializeMouseActions",(()=>{this.setMouseAction("PAN",0,"CTRL"),this.setMouseAction("PAN",2),this.setMouseAction("ROTATE",0),this.setMouseAction("ZOOM","WHEEL"),this.setMouseAction("ZOOM",1),this.setMouseAction("FOV","WHEEL","SHIFT"),this.setMouseAction("FOV",1,"SHIFT")})),Po(this,"setMouseAction",((e,t,n=null)=>{let r;if(!["PAN","ROTATE","ZOOM","FOV"].includes(e)||![0,1,2,"WHEEL"].includes(t)||!["CTRL","SHIFT",null].includes(n))return!1;if("WHEEL"==t&&"ZOOM"!=e&&"FOV"!=e)return!1;switch(e){case"PAN":r=Do.PAN;break;case"ROTATE":r=Do.ROTATE;break;case"ZOOM":r=Do.SCALE;break;case"FOV":r=Do.FOV}const i={operation:e,mouse:t,key:n,state:r};for(let s=0;s<this.mouseActions.length;s++)if(this.mouseActions[s].mouse==i.mouse&&this.mouseActions[s].key==i.key)return this.mouseActions.splice(s,1,i),!0;return this.mouseActions.push(i),!0})),Po(this,"getOpFromAction",((e,t)=>{let n;for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&n.key==t)return n.operation;if(t)for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&null==n.key)return n.operation;return null})),Po(this,"getOpStateFromAction",((e,t)=>{let n;for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&n.key==t)return n.state;if(t)for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&null==n.key)return n.state;return null})),Po(this,"getAngle",((e,t)=>180*Math.atan2(t.clientY-e.clientY,t.clientX-e.clientX)/Math.PI)),Po(this,"updateTouchEvent",(e=>{for(let t=0;t<this._touchCurrent.length;t++)if(this._touchCurrent[t].pointerId==e.pointerId){this._touchCurrent.splice(t,1,e);break}})),Po(this,"calculateAngularSpeed",((e,t,n,r)=>{const i=(r-n)/1e3;return 0==i?0:(t-e)/i})),Po(this,"calculatePointersDistance",((e,t)=>Math.sqrt(Math.pow(t.clientX-e.clientX,2)+Math.pow(t.clientY-e.clientY,2)))),Po(this,"calculateRotationAxis",((e,t)=>(this._rotationMatrix.extractRotation(this._cameraMatrixState),this._quat.setFromRotationMatrix(this._rotationMatrix),this._rotationAxis.crossVectors(e,t).applyQuaternion(this._quat),this._rotationAxis.normalize().clone()))),Po(this,"calculateTbRadius",(e=>{const t=e.position.distanceTo(this._gizmos.position);if(e instanceof a.PerspectiveCamera){const n=a.MathUtils.DEG2RAD*e.fov*.5,r=Math.atan(e.aspect*Math.tan(n));return Math.tan(Math.min(n,r))*t*.67}if(e instanceof a.OrthographicCamera)return.67*Math.min(e.top,e.right)})),Po(this,"focus",((e,t,n=1)=>{if(this.camera){const r=e.clone();r.sub(this._gizmos.position).multiplyScalar(n),this._translationMatrix.makeTranslation(r.x,r.y,r.z);const i=this._gizmoMatrixState.clone();this._gizmoMatrixState.premultiply(this._translationMatrix),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale);const s=this._cameraMatrixState.clone();this._cameraMatrixState.premultiply(this._translationMatrix),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.enableZoom&&this.applyTransformMatrix(this.applyScale(t,this._gizmos.position)),this._gizmoMatrixState.copy(i),this._cameraMatrixState.copy(s)}})),Po(this,"drawGrid",(()=>{if(this.scene){const e=8947848,t=3;let n,r,i,s;if(this.camera instanceof a.OrthographicCamera){const e=this.camera.right-this.camera.left,a=this.camera.bottom-this.camera.top;i=Math.max(e,a),s=i/20,n=i/this.camera.zoom*t,r=n/s*this.camera.zoom}else if(this.camera instanceof a.PerspectiveCamera){const e=this.camera.position.distanceTo(this._gizmos.position),o=a.MathUtils.DEG2RAD*this.camera.fov*.5,l=Math.atan(this.camera.aspect*Math.tan(o));i=Math.tan(Math.max(o,l))*e*2,s=i/20,n=i*t,r=n/s}null==this._grid&&this.camera&&(this._grid=new a.GridHelper(n,r,e,e),this._grid.position.copy(this._gizmos.position),this._gridPosition.copy(this._grid.position),this._grid.quaternion.copy(this.camera.quaternion),this._grid.rotateX(.5*Math.PI),this.scene.add(this._grid))}})),Po(this,"connect",(e=>{e===document&&console.error('THREE.ArcballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.style.touchAction="none",this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onWheel)})),Po(this,"dispose",(()=>{var e,t,n,r,i;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointercancel",this.onPointerCancel),null==(n=this.domElement)||n.removeEventListener("wheel",this.onWheel),null==(r=this.domElement)||r.removeEventListener("contextmenu",this.onContextMenu),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),null==(i=this.scene)||i.remove(this._gizmos),this.disposeGrid()})),Po(this,"disposeGrid",(()=>{this._grid&&this.scene&&(this.scene.remove(this._grid),this._grid=null)})),Po(this,"easeOutCubic",(e=>1-Math.pow(1-e,3))),Po(this,"activateGizmos",(e=>{for(const t of this._gizmos.children)t.material.setValues({opacity:e?1:.6})})),Po(this,"getCursorNDC",((e,t,n)=>{const r=n.getBoundingClientRect();return this._v2_1.setX((e-r.left)/r.width*2-1),this._v2_1.setY((r.bottom-t)/r.height*2-1),this._v2_1.clone()})),Po(this,"getCursorPosition",((e,t,n)=>(this._v2_1.copy(this.getCursorNDC(e,t,n)),this.camera instanceof a.OrthographicCamera&&(this._v2_1.x*=.5*(this.camera.right-this.camera.left),this._v2_1.y*=.5*(this.camera.top-this.camera.bottom)),this._v2_1.clone()))),Po(this,"setCamera",(e=>{if(e){e.lookAt(this.target),e.updateMatrix(),e instanceof a.PerspectiveCamera&&(this._fov0=e.fov,this._fovState=e.fov),this._cameraMatrixState0.copy(e.matrix),this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraProjectionState.copy(e.projectionMatrix),this._zoom0=e.zoom,this._zoomState=this._zoom0,this._initialNear=e.near,this._nearPos0=e.position.distanceTo(this.target)-e.near,this._nearPos=this._initialNear,this._initialFar=e.far,this._farPos0=e.position.distanceTo(this.target)-e.far,this._farPos=this._initialFar,this._up0.copy(e.up),this._upState.copy(e.up),this.camera=e,this.camera.updateProjectionMatrix();const t=this.calculateTbRadius(e);void 0!==t&&(this._tbRadius=t),this.makeGizmos(this.target,this._tbRadius)}})),Po(this,"makeGizmos",((e,t)=>{const n=new a.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new a.BufferGeometry).setFromPoints(n),i=new a.LineBasicMaterial({color:16744576,fog:!1,transparent:!0,opacity:.6}),s=new a.LineBasicMaterial({color:8454016,fog:!1,transparent:!0,opacity:.6}),o=new a.LineBasicMaterial({color:8421631,fog:!1,transparent:!0,opacity:.6}),l=new a.Line(r,i),c=new a.Line(r,s),h=new a.Line(r,o),u=.5*Math.PI;if(l.rotation.x=u,c.rotation.y=u,this._gizmoMatrixState0.identity().setPosition(e),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this.camera&&1!=this.camera.zoom){const t=1/this.camera.zoom;this._scaleMatrix.makeScale(t,t,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._gizmoMatrixState.premultiply(this._translationMatrix).premultiply(this._scaleMatrix),this._translationMatrix.makeTranslation(e.x,e.y,e.z),this._gizmoMatrixState.premultiply(this._translationMatrix)}this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.clear(),this._gizmos.add(l),this._gizmos.add(c),this._gizmos.add(h)})),Po(this,"onFocusAnim",((e,t,n,r)=>{if(-1==this._timeStart&&(this._timeStart=e),this._state==Do.ANIMATION_FOCUS){const i=(e-this._timeStart)/this.focusAnimationTime;if(this._gizmoMatrixState.copy(r),i>=1)this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,this.scaleFactor),this._timeStart=-1,this.updateTbState(Do.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(Oo);else{const e=this.easeOutCubic(i),s=1-e+this.scaleFactor*e;this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,s,e),this.dispatchEvent(Oo);const a=this;this._animationId=window.requestAnimationFrame((function(e){a.onFocusAnim(e,t,n,r.clone())}))}}else this._animationId=-1,this._timeStart=-1})),Po(this,"onRotationAnim",((e,t,n)=>{if(-1==this._timeStart&&(this._anglePrev=0,this._angleCurrent=0,this._timeStart=e),this._state==Do.ANIMATION_ROTATE){const r=(e-this._timeStart)/1e3;if(n+-this.dampingFactor*r>0){this._angleCurrent=.5*-this.dampingFactor*Math.pow(r,2)+n*r+0,this.applyTransformMatrix(this.rotate(t,this._angleCurrent)),this.dispatchEvent(Oo);const e=this;this._animationId=window.requestAnimationFrame((function(r){e.onRotationAnim(r,t,n)}))}else this._animationId=-1,this._timeStart=-1,this.updateTbState(Do.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(Oo)}else this._animationId=-1,this._timeStart=-1,this._state!=Do.ROTATE&&(this.activateGizmos(!1),this.dispatchEvent(Oo))})),Po(this,"pan",((e,t,n=!1)=>{if(this.camera){const r=e.clone().sub(t);if(this.camera instanceof a.OrthographicCamera&&r.multiplyScalar(1/this.camera.zoom),this.camera instanceof a.PerspectiveCamera&&n){this._v3_1.setFromMatrixPosition(this._cameraMatrixState0),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);const e=this._v3_1.distanceTo(this._v3_2)/this.camera.position.distanceTo(this._gizmos.position);r.multiplyScalar(1/e)}this._v3_1.set(r.x,r.y,0).applyQuaternion(this.camera.quaternion),this._m4_1.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z),this.setTransformationMatrices(this._m4_1,this._m4_1)}return Uo})),Po(this,"reset",(()=>{if(this.camera){this.camera.zoom=this._zoom0,this.camera instanceof a.PerspectiveCamera&&(this.camera.fov=this._fov0),this.camera.near=this._nearPos,this.camera.far=this._farPos,this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(this._up0),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this._gizmoMatrixState0.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this._gizmos.position,this._tbRadius),this.camera.lookAt(this._gizmos.position),this.updateTbState(Do.IDLE,!1),this.dispatchEvent(Oo)}})),Po(this,"rotate",((e,t)=>{const n=this._gizmos.position;return this._translationMatrix.makeTranslation(-n.x,-n.y,-n.z),this._rotationMatrix.makeRotationAxis(e,-t),this._m4_1.makeTranslation(n.x,n.y,n.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1),Uo})),Po(this,"copyState",(()=>{if(this.camera){const e=JSON.stringify(this.camera instanceof a.OrthographicCamera?{arcballState:{cameraFar:this.camera.far,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}}:{arcballState:{cameraFar:this.camera.far,cameraFov:this.camera.fov,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}});navigator.clipboard.writeText(e)}})),Po(this,"pasteState",(()=>{const e=this;navigator.clipboard.readText().then((function(t){e.setStateFromJSON(t)}))})),Po(this,"saveState",(()=>{this.camera&&(this._cameraMatrixState0.copy(this.camera.matrix),this._gizmoMatrixState0.copy(this._gizmos.matrix),this._nearPos=this.camera.near,this._farPos=this.camera.far,this._zoom0=this.camera.zoom,this._up0.copy(this.camera.up),this.camera instanceof a.PerspectiveCamera&&(this._fov0=this.camera.fov))})),Po(this,"applyScale",((e,t,n=!0)=>{if(!this.camera)return;const r=t.clone();let i=1/e;if(this.camera instanceof a.OrthographicCamera){this.camera.zoom=this._zoomState,this.camera.zoom*=e,this.camera.zoom>this.maxZoom?(this.camera.zoom=this.maxZoom,i=this._zoomState/this.maxZoom):this.camera.zoom<this.minZoom&&(this.camera.zoom=this.minZoom,i=this._zoomState/this.minZoom),this.camera.updateProjectionMatrix(),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState),this._scaleMatrix.makeScale(i,i,i),this._translationMatrix.makeTranslation(-this._v3_1.x,-this._v3_1.y,-this._v3_1.z),this._m4_2.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z).multiply(this._scaleMatrix),this._m4_2.multiply(this._translationMatrix),r.sub(this._v3_1);const t=r.clone().multiplyScalar(i);return r.sub(t),this._m4_1.makeTranslation(r.x,r.y,r.z),this._m4_2.premultiply(this._m4_1),this.setTransformationMatrices(this._m4_1,this._m4_2),Uo}if(this.camera instanceof a.PerspectiveCamera){this._v3_1.setFromMatrixPosition(this._cameraMatrixState),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);let e=this._v3_1.distanceTo(r),t=e-e*i;const s=e-t;s<this.minDistance?(i=this.minDistance/e,t=e-e*i):s>this.maxDistance&&(i=this.maxDistance/e,t=e-e*i);let a=r.clone().sub(this._v3_1).normalize().multiplyScalar(t);if(this._m4_1.makeTranslation(a.x,a.y,a.z),n){const n=this._v3_2;e=n.distanceTo(r),t=e-e*i,a=r.clone().sub(this._v3_2).normalize().multiplyScalar(t),this._translationMatrix.makeTranslation(n.x,n.y,n.z),this._scaleMatrix.makeScale(i,i,i),this._m4_2.makeTranslation(a.x,a.y,a.z).multiply(this._translationMatrix),this._m4_2.multiply(this._scaleMatrix),this._translationMatrix.makeTranslation(-n.x,-n.y,-n.z),this._m4_2.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1,this._m4_2)}else this.setTransformationMatrices(this._m4_1);return Uo}})),Po(this,"setFov",(e=>{this.camera instanceof a.PerspectiveCamera&&(this.camera.fov=a.MathUtils.clamp(e,this.minFov,this.maxFov),this.camera.updateProjectionMatrix())})),Po(this,"setTarget",((e,t,n)=>{if(this.camera){this.target.set(e,t,n),this._gizmos.position.set(e,t,n);const r=this.calculateTbRadius(this.camera);void 0!==r&&(this._tbRadius=r),this.makeGizmos(this.target,this._tbRadius),this.camera.lookAt(this.target)}})),Po(this,"zRotate",((e,t)=>(this._rotationMatrix.makeRotationAxis(this._rotationAxis,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._m4_1.makeTranslation(e.x,e.y,e.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(e),this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis,t),this._v3_2.sub(this._v3_1),this._m4_2.makeTranslation(this._v3_2.x,this._v3_2.y,this._v3_2.z),this.setTransformationMatrices(this._m4_1,this._m4_2),Uo))),Po(this,"unprojectOnObj",((e,t)=>{if(!this.scene)return null;const n=new a.Raycaster;n.near=t.near,n.far=t.far,n.setFromCamera(e,t);const r=n.intersectObjects(this.scene.children,!0);for(let i=0;i<r.length;i++)if(r[i].object.uuid!=this._gizmos.uuid&&r[i].face)return r[i].point.clone();return null})),Po(this,"unprojectOnTbSurface",((e,t,n,r,i)=>{if(e instanceof a.OrthographicCamera){this._v2_1.copy(this.getCursorPosition(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0);const e=Math.pow(this._v2_1.x,2),i=Math.pow(this._v2_1.y,2),s=Math.pow(this._tbRadius,2);return e+i<=.5*s?this._v3_1.setZ(Math.sqrt(s-(e+i))):this._v3_1.setZ(.5*s/Math.sqrt(e+i)),this._v3_1}if(e instanceof a.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const s=this._v3_1.clone().normalize(),o=e.position.distanceTo(this._gizmos.position),l=Math.pow(i,2),c=this._v3_1.z,h=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));if(0==h)return s.set(this._v3_1.x,this._v3_1.y,i),s;const u=c/h,d=o;let p=Math.pow(u,2)+1,f=2*u*d,m=Math.pow(d,2)-l,g=Math.pow(f,2)-4*p*m;if(g>=0){this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(u*this._v2_1.x+d);if(a.MathUtils.RAD2DEG*this._v2_1.angle()>=45){const e=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return s.multiplyScalar(e),s.z+=o,s}}p=u,f=d,m=.5*-l,g=Math.pow(f,2)-4*p*m,this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(u*this._v2_1.x+d);const A=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return s.multiplyScalar(A),s.z+=o,s}})),Po(this,"unprojectOnTbPlane",((e,t,n,r,i=!1)=>{if(e instanceof a.OrthographicCamera)return this._v2_1.copy(this.getCursorPosition(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0),this._v3_1.clone();if(e instanceof a.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const s=this._v3_1.clone().normalize(),a=this._v3_1.z,o=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));let l;if(l=i?this._v3_1.setFromMatrixPosition(this._cameraMatrixState0).distanceTo(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0)):e.position.distanceTo(this._gizmos.position),0==o)return s.set(0,0,0),s;const c=l,h=-c/(a/o),u=Math.sqrt(Math.pow(c,2)+Math.pow(h,2));return s.multiplyScalar(u),s.z=0,s}})),Po(this,"updateMatrixState",(()=>{this.camera&&(this._cameraMatrixState.copy(this.camera.matrix),this._gizmoMatrixState.copy(this._gizmos.matrix),this.camera instanceof a.OrthographicCamera&&(this._cameraProjectionState.copy(this.camera.projectionMatrix),this.camera.updateProjectionMatrix(),this._zoomState=this.camera.zoom),this.camera instanceof a.PerspectiveCamera&&(this._fovState=this.camera.fov))})),Po(this,"updateTbState",((e,t)=>{this._state=e,t&&this.updateMatrixState()})),Po(this,"update",(()=>{const e=1e-6;if(!this.target.equals(this._currentTarget)&&this.camera){this._gizmos.position.set(this.target.x,this.target.y,this.target.z);const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this.target,this._tbRadius),this._currentTarget.copy(this.target)}if(this.camera){if(this.camera instanceof a.OrthographicCamera&&(this.camera.zoom>this.maxZoom||this.camera.zoom<this.minZoom)){const e=a.MathUtils.clamp(this.camera.zoom,this.minZoom,this.maxZoom);this.applyTransformMatrix(this.applyScale(e/this.camera.zoom,this._gizmos.position,!0))}if(this.camera instanceof a.PerspectiveCamera){const t=this.camera.position.distanceTo(this._gizmos.position);if(t>this.maxDistance+e||t<this.minDistance-e){const e=a.MathUtils.clamp(t,this.minDistance,this.maxDistance);this.applyTransformMatrix(this.applyScale(e/t,this._gizmos.position)),this.updateMatrixState()}(this.camera.fov<this.minFov||this.camera.fov>this.maxFov)&&(this.camera.fov=a.MathUtils.clamp(this.camera.fov,this.minFov,this.maxFov),this.camera.updateProjectionMatrix());const n=this._tbRadius,r=this.calculateTbRadius(this.camera);if(void 0!==r&&(this._tbRadius=r),n<this._tbRadius-e||n>this._tbRadius+e){const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3,t=this._tbRadius/e,n=new a.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new a.BufferGeometry).setFromPoints(n);for(const i in this._gizmos.children){this._gizmos.children[i].geometry=r}}}this.camera.lookAt(this._gizmos.position)}})),Po(this,"setStateFromJSON",(e=>{const t=JSON.parse(e);if(t.arcballState&&this.camera){this._cameraMatrixState.fromArray(t.arcballState.cameraMatrix.elements),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(t.arcballState.cameraUp),this.camera.near=t.arcballState.cameraNear,this.camera.far=t.arcballState.cameraFar,this.camera.zoom=t.arcballState.cameraZoom,this.camera instanceof a.PerspectiveCamera&&(this.camera.fov=t.arcballState.cameraFov),this._gizmoMatrixState.fromArray(t.arcballState.gizmoMatrix.elements),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e);const n=(new a.Matrix4).copy(this._gizmoMatrixState0);this.makeGizmos(this._gizmos.position,this._tbRadius),this._gizmoMatrixState0.copy(n),this.camera.lookAt(this._gizmos.position),this.updateTbState(Do.IDLE,!1),this.dispatchEvent(Oo)}})),this.camera=null,this.domElement=t,this.scene=n,this.mouseActions=[],this._mouseOp=null,this._v2_1=new a.Vector2,this._v3_1=new a.Vector3,this._v3_2=new a.Vector3,this._m4_1=new a.Matrix4,this._m4_2=new a.Matrix4,this._quat=new a.Quaternion,this._translationMatrix=new a.Matrix4,this._rotationMatrix=new a.Matrix4,this._scaleMatrix=new a.Matrix4,this._rotationAxis=new a.Vector3,this._cameraMatrixState=new a.Matrix4,this._cameraProjectionState=new a.Matrix4,this._fovState=1,this._upState=new a.Vector3,this._zoomState=1,this._nearPos=0,this._farPos=0,this._gizmoMatrixState=new a.Matrix4,this._up0=new a.Vector3,this._zoom0=1,this._fov0=0,this._initialNear=0,this._nearPos0=0,this._initialFar=0,this._farPos0=0,this._cameraMatrixState0=new a.Matrix4,this._gizmoMatrixState0=new a.Matrix4,this._button=-1,this._touchStart=[],this._touchCurrent=[],this._input=Lo.NONE,this._switchSensibility=32,this._startFingerDistance=0,this._currentFingerDistance=0,this._startFingerRotation=0,this._currentFingerRotation=0,this._devPxRatio=0,this._downValid=!0,this._nclicks=0,this._downEvents=[],this._clickStart=0,this._maxDownTime=250,this._maxInterval=300,this._posThreshold=24,this._movementThreshold=24,this._currentCursorPosition=new a.Vector3,this._startCursorPosition=new a.Vector3,this._grid=null,this._gridPosition=new a.Vector3,this._gizmos=new a.Group,this._curvePts=128,this._timeStart=-1,this._animationId=-1,this.focusAnimationTime=500,this._timePrev=0,this._timeCurrent=0,this._anglePrev=0,this._angleCurrent=0,this._cursorPosPrev=new a.Vector3,this._cursorPosCurr=new a.Vector3,this._wPrev=0,this._wCurr=0,this.adjustNearFar=!1,this.scaleFactor=1.1,this.dampingFactor=25,this.wMax=20,this.enableAnimations=!0,this.enableGrid=!1,this.cursorZoom=!1,this.minFov=5,this.maxFov=90,this.enabled=!0,this.enablePan=!0,this.enableRotate=!0,this.enableZoom=!0,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.target=new a.Vector3(0,0,0),this._currentTarget=new a.Vector3(0,0,0),this._tbRadius=1,this._state=Do.IDLE,this.setCamera(e),this.scene&&this.scene.add(this._gizmos),this._devPxRatio=window.devicePixelRatio,this.initializeMouseActions(),this.domElement&&this.connect(this.domElement),window.addEventListener("resize",this.onWindowResize)}applyTransformMatrix(e){if((null==e?void 0:e.camera)&&this.camera&&(this._m4_1.copy(this._cameraMatrixState).premultiply(e.camera),this._m4_1.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.updateMatrix(),this._state!=Do.ROTATE&&this._state!=Do.ZROTATE&&this._state!=Do.ANIMATION_ROTATE||this.camera.up.copy(this._upState).applyQuaternion(this.camera.quaternion)),(null==e?void 0:e.gizmos)&&(this._m4_1.copy(this._gizmoMatrixState).premultiply(e.gizmos),this._m4_1.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix()),(this._state==Do.SCALE||this._state==Do.FOCUS||this._state==Do.ANIMATION_FOCUS)&&this.camera){const e=this.calculateTbRadius(this.camera);if(void 0!==e&&(this._tbRadius=e),this.adjustNearFar){const e=this.camera.position.distanceTo(this._gizmos.position),t=new a.Box3;t.setFromObject(this._gizmos);const n=new a.Sphere;t.getBoundingSphere(n);const r=Math.max(this._nearPos0,n.radius+n.center.length()),i=e-this._initialNear,s=Math.min(r,i);this.camera.near=e-s;const o=Math.min(this._farPos0,-n.radius+n.center.length()),l=e-this._initialFar,c=Math.min(o,l);this.camera.far=e-c,this.camera.updateProjectionMatrix()}else{let e=!1;this.camera.near!=this._initialNear&&(this.camera.near=this._initialNear,e=!0),this.camera.far!=this._initialFar&&(this.camera.far=this._initialFar,e=!0),e&&this.camera.updateProjectionMatrix()}}}setGizmosVisible(e){this._gizmos.visible=e,this.dispatchEvent(Oo)}setTransformationMatrices(e=null,t=null){e?Uo.camera?Uo.camera.copy(e):Uo.camera=e.clone():Uo.camera=null,t?Uo.gizmos?Uo.gizmos.copy(t):Uo.gizmos=t.clone():Uo.gizmos=null}}const zo=(0,i.forwardRef)((({camera:e,makeDefault:t,regress:n,domElement:s,onChange:a,onStart:l,onEnd:c,...h},u)=>{const d=(0,o.useThree)((e=>e.invalidate)),p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.events)),g=(0,o.useThree)((e=>e.set)),A=(0,o.useThree)((e=>e.get)),v=(0,o.useThree)((e=>e.performance)),y=e||p,x=s||m.connected||f.domElement,b=(0,i.useMemo)((()=>new Go(y)),[y]);return(0,o.useFrame)((()=>{b.enabled&&b.update()})),(0,i.useEffect)((()=>(b.connect(x),()=>{b.dispose()})),[x,n,b,d]),(0,i.useEffect)((()=>{const e=e=>{d(),n&&v.regress(),a&&a(e)};return b.addEventListener("change",e),l&&b.addEventListener("start",l),c&&b.addEventListener("end",c),()=>{b.removeEventListener("change",e),l&&b.removeEventListener("start",l),c&&b.removeEventListener("end",c)}}),[a,l,c]),(0,i.useEffect)((()=>{if(t){const e=A().controls;return g({controls:b}),()=>g({controls:e})}}),[t,b]),i.createElement("primitive",(0,r.Z)({ref:u,object:b},h))}));var Qo=n(76427),Vo=n.n(Qo),Ho=Object.defineProperty,jo=(e,t,n)=>(((e,t,n)=>{t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class Wo extends a.Object3D{constructor(e,t){super(),jo(this,"isTransformControls",!0),jo(this,"visible",!1),jo(this,"domElement"),jo(this,"raycaster",new a.Raycaster),jo(this,"gizmo"),jo(this,"plane"),jo(this,"tempVector",new a.Vector3),jo(this,"tempVector2",new a.Vector3),jo(this,"tempQuaternion",new a.Quaternion),jo(this,"unit",{X:new a.Vector3(1,0,0),Y:new a.Vector3(0,1,0),Z:new a.Vector3(0,0,1)}),jo(this,"pointStart",new a.Vector3),jo(this,"pointEnd",new a.Vector3),jo(this,"offset",new a.Vector3),jo(this,"rotationAxis",new a.Vector3),jo(this,"startNorm",new a.Vector3),jo(this,"endNorm",new a.Vector3),jo(this,"rotationAngle",0),jo(this,"cameraPosition",new a.Vector3),jo(this,"cameraQuaternion",new a.Quaternion),jo(this,"cameraScale",new a.Vector3),jo(this,"parentPosition",new a.Vector3),jo(this,"parentQuaternion",new a.Quaternion),jo(this,"parentQuaternionInv",new a.Quaternion),jo(this,"parentScale",new a.Vector3),jo(this,"worldPositionStart",new a.Vector3),jo(this,"worldQuaternionStart",new a.Quaternion),jo(this,"worldScaleStart",new a.Vector3),jo(this,"worldPosition",new a.Vector3),jo(this,"worldQuaternion",new a.Quaternion),jo(this,"worldQuaternionInv",new a.Quaternion),jo(this,"worldScale",new a.Vector3),jo(this,"eye",new a.Vector3),jo(this,"positionStart",new a.Vector3),jo(this,"quaternionStart",new a.Quaternion),jo(this,"scaleStart",new a.Vector3),jo(this,"camera"),jo(this,"object"),jo(this,"enabled",!0),jo(this,"axis",null),jo(this,"mode","translate"),jo(this,"translationSnap",null),jo(this,"rotationSnap",null),jo(this,"scaleSnap",null),jo(this,"space","world"),jo(this,"size",1),jo(this,"dragging",!1),jo(this,"showX",!0),jo(this,"showY",!0),jo(this,"showZ",!0),jo(this,"changeEvent",{type:"change"}),jo(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),jo(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),jo(this,"objectChangeEvent",{type:"objectChange"}),jo(this,"intersectObjectWithRay",((e,t,n)=>{const r=t.intersectObject(e,!0);for(let i=0;i<r.length;i++)if(r[i].object.visible||n)return r[i];return!1})),jo(this,"attach",(e=>(this.object=e,this.visible=!0,this))),jo(this,"detach",(()=>(this.object=void 0,this.visible=!1,this.axis=null,this))),jo(this,"reset",(()=>this.enabled?(this.dragging&&void 0!==this.object&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this)),jo(this,"updateMatrixWorld",(()=>{void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()})),jo(this,"pointerHover",(e=>{if(void 0===this.object||!0===this.dragging)return;this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);this.axis=t?t.object.name:null})),jo(this,"pointerDown",(e=>{if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if("scale"===this.mode?e="local":"E"!==this.axis&&"XYZE"!==this.axis&&"XYZ"!==this.axis||(e="world"),"local"===e&&"rotate"===this.mode){const e=this.rotationSnap;"X"===this.axis&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),"Y"===this.axis&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),"Z"===this.axis&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}})),jo(this,"pointerMove",(e=>{const t=this.axis,n=this.mode,r=this.object;let i=this.space;if("scale"===n?i="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(i="world"),void 0===r||null===t||!1===this.dragging||-1!==e.button)return;this.raycaster.setFromCamera(e,this.camera);const s=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===n)this.offset.copy(this.pointEnd).sub(this.pointStart),"local"===i&&"XYZ"!==t&&this.offset.applyQuaternion(this.worldQuaternionInv),-1===t.indexOf("X")&&(this.offset.x=0),-1===t.indexOf("Y")&&(this.offset.y=0),-1===t.indexOf("Z")&&(this.offset.z=0),"local"===i&&"XYZ"!==t?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&("local"===i&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),"world"===i&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),-1===t.search("X")&&(this.tempVector2.x=1),-1===t.search("Y")&&(this.tempVector2.y=1),-1===t.search("Z")&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(-1!==t.search("X")&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this.offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),"local"===i&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===i&&"E"!==t&&"XYZE"!==t?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}})),jo(this,"pointerUp",(e=>{0===e.button&&(this.dragging&&null!==this.axis&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)})),jo(this,"getPointer",(e=>{var t,n;if(this.domElement&&(null==(t=this.domElement.ownerDocument)?void 0:t.pointerLockElement))return{x:0,y:0,button:e.button};{const t=e.changedTouches?e.changedTouches[0]:e,r=null==(n=this.domElement)?void 0:n.getBoundingClientRect();return{x:(t.clientX-r.left)/r.width*2-1,y:-(t.clientY-r.top)/r.height*2+1,button:e.button}}})),jo(this,"onPointerHover",(e=>{if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(e))}})),jo(this,"onPointerDown",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))})),jo(this,"onPointerMove",(e=>{this.enabled&&this.pointerMove(this.getPointer(e))})),jo(this,"onPointerUp",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(e)))})),jo(this,"getMode",(()=>this.mode)),jo(this,"setMode",(e=>{this.mode=e})),jo(this,"setTranslationSnap",(e=>{this.translationSnap=e})),jo(this,"setRotationSnap",(e=>{this.rotationSnap=e})),jo(this,"setScaleSnap",(e=>{this.scaleSnap=e})),jo(this,"setSize",(e=>{this.size=e})),jo(this,"setSpace",(e=>{this.space=e})),jo(this,"update",(()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")})),jo(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)})),jo(this,"dispose",(()=>{var e,t,n,r,i,s;null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointermove",this.onPointerHover),null==(r=null==(n=this.domElement)?void 0:n.ownerDocument)||r.removeEventListener("pointermove",this.onPointerMove),null==(s=null==(i=this.domElement)?void 0:i.ownerDocument)||s.removeEventListener("pointerup",this.onPointerUp),this.traverse((e=>{const t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))})),this.domElement=t,this.camera=e,this.gizmo=new Xo,this.add(this.gizmo),this.plane=new Yo,this.add(this.plane);const n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return void 0!==n?n:t},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+"-changed",value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n("camera",this.camera),n("object",this.object),n("enabled",this.enabled),n("axis",this.axis),n("mode",this.mode),n("translationSnap",this.translationSnap),n("rotationSnap",this.rotationSnap),n("scaleSnap",this.scaleSnap),n("space",this.space),n("size",this.size),n("dragging",this.dragging),n("showX",this.showX),n("showY",this.showY),n("showZ",this.showZ),n("worldPosition",this.worldPosition),n("worldPositionStart",this.worldPositionStart),n("worldQuaternion",this.worldQuaternion),n("worldQuaternionStart",this.worldQuaternionStart),n("cameraPosition",this.cameraPosition),n("cameraQuaternion",this.cameraQuaternion),n("pointStart",this.pointStart),n("pointEnd",this.pointEnd),n("rotationAxis",this.rotationAxis),n("rotationAngle",this.rotationAngle),n("eye",this.eye),void 0!==t&&this.connect(t)}}class Xo extends a.Object3D{constructor(){super(),jo(this,"isTransformControlsGizmo",!0),jo(this,"type","TransformControlsGizmo"),jo(this,"tempVector",new a.Vector3(0,0,0)),jo(this,"tempEuler",new a.Euler),jo(this,"alignVector",new a.Vector3(0,1,0)),jo(this,"zeroVector",new a.Vector3(0,0,0)),jo(this,"lookAtMatrix",new a.Matrix4),jo(this,"tempQuaternion",new a.Quaternion),jo(this,"tempQuaternion2",new a.Quaternion),jo(this,"identityQuaternion",new a.Quaternion),jo(this,"unitX",new a.Vector3(1,0,0)),jo(this,"unitY",new a.Vector3(0,1,0)),jo(this,"unitZ",new a.Vector3(0,0,1)),jo(this,"gizmo"),jo(this,"picker"),jo(this,"helper"),jo(this,"rotationAxis",new a.Vector3),jo(this,"cameraPosition",new a.Vector3),jo(this,"worldPositionStart",new a.Vector3),jo(this,"worldQuaternionStart",new a.Quaternion),jo(this,"worldPosition",new a.Vector3),jo(this,"worldQuaternion",new a.Quaternion),jo(this,"eye",new a.Vector3),jo(this,"camera",null),jo(this,"enabled",!0),jo(this,"axis",null),jo(this,"mode","translate"),jo(this,"space","world"),jo(this,"size",1),jo(this,"dragging",!1),jo(this,"showX",!0),jo(this,"showY",!0),jo(this,"showZ",!0),jo(this,"updateMatrixWorld",(()=>{let e=this.space;"scale"===this.mode&&(e="local");const t="local"===e?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let r=0;r<n.length;r++){const e=n[r];let i;if(e.visible=!0,e.rotation.set(0,0,0),e.position.copy(this.worldPosition),i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),e.scale.set(1,1,1).multiplyScalar(i*this.size/7),"helper"!==e.tag){if(e.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const n=.99,r=.2,i=0;"X"!==e.name&&"XYZX"!==e.name||Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Y"!==e.name&&"XYZY"!==e.name||Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Z"!==e.name&&"XYZZ"!==e.name||Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XY"===e.name&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"YZ"===e.name&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XZ"===e.name&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),-1!==e.name.search("X")&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.x*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Y")&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.y*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Z")&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.z*=-1:"bwd"===e.tag&&(e.visible=!1))}else"rotate"===this.mode&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),-1!==e.name.search("E")&&e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),"X"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Y"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Z"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)));e.visible=e.visible&&(-1===e.name.indexOf("X")||this.showX),e.visible=e.visible&&(-1===e.name.indexOf("Y")||this.showY),e.visible=e.visible&&(-1===e.name.indexOf("Z")||this.showZ),e.visible=e.visible&&(-1===e.name.indexOf("E")||this.showX&&this.showY&&this.showZ),e.material.tempOpacity=e.material.tempOpacity||e.material.opacity,e.material.tempColor=e.material.tempColor||e.material.color.clone(),e.material.color.copy(e.material.tempColor),e.material.opacity=e.material.tempOpacity,this.enabled?this.axis&&(e.name===this.axis||this.axis.split("").some((function(t){return e.name===t}))?(e.material.opacity=1,e.material.color.lerp(new a.Color(1,1,1),.5)):(e.material.opacity*=.25,e.material.color.lerp(new a.Color(1,1,1),.5))):(e.material.opacity*=.5,e.material.color.lerp(new a.Color(1,1,1),.5))}else e.visible=!1,"AXIS"===e.name?(e.position.copy(this.worldPositionStart),e.visible=!!this.axis,"X"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Y"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Z"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"XYZE"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),e.quaternion.multiply(this.tempQuaternion),e.visible=this.dragging),"E"===this.axis&&(e.visible=!1)):"START"===e.name?(e.position.copy(this.worldPositionStart),e.visible=this.dragging):"END"===e.name?(e.position.copy(this.worldPosition),e.visible=this.dragging):"DELTA"===e.name?(e.position.copy(this.worldPositionStart),e.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),e.scale.copy(this.tempVector),e.visible=this.dragging):(e.quaternion.copy(t),this.dragging?e.position.copy(this.worldPositionStart):e.position.copy(this.worldPosition),this.axis&&(e.visible=-1!==this.axis.search(e.name)))}super.updateMatrixWorld()}));const e=new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,side:a.DoubleSide,fog:!1,toneMapped:!1}),t=new a.LineBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;const r=e.clone();r.opacity=.33;const i=e.clone();i.color.set(16711680);const s=e.clone();s.color.set(65280);const o=e.clone();o.color.set(255);const l=e.clone();l.opacity=.25;const c=l.clone();c.color.set(16776960);const h=l.clone();h.color.set(65535);const u=l.clone();u.color.set(16711935);e.clone().color.set(16776960);const d=t.clone();d.color.set(16711680);const p=t.clone();p.color.set(65280);const f=t.clone();f.color.set(255);const m=t.clone();m.color.set(65535);const g=t.clone();g.color.set(16711935);const A=t.clone();A.color.set(16776960);const v=t.clone();v.color.set(7895160);const y=A.clone();y.opacity=.25;const x=new a.CylinderGeometry(0,.05,.2,12,1,!1),b=new a.BoxGeometry(.125,.125,.125),E=new a.BufferGeometry;E.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));const _=(e,t)=>{const n=new a.BufferGeometry,r=[];for(let i=0;i<=64*t;++i)r.push(0,Math.cos(i/32*Math.PI)*e,Math.sin(i/32*Math.PI)*e);return n.setAttribute("position",new a.Float32BufferAttribute(r,3)),n},S={X:[[new a.Mesh(x,i),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new a.Mesh(x,i),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new a.Line(E,d)]],Y:[[new a.Mesh(x,s),[0,1,0],null,null,"fwd"],[new a.Mesh(x,s),[0,1,0],[Math.PI,0,0],null,"bwd"],[new a.Line(E,p),null,[0,0,Math.PI/2]]],Z:[[new a.Mesh(x,o),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new a.Mesh(x,o),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new a.Line(E,f),null,[0,-Math.PI/2,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),l.clone()),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneGeometry(.295,.295),c.clone()),[.15,.15,0]],[new a.Line(E,A),[.18,.3,0],null,[.125,1,1]],[new a.Line(E,A),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new a.Mesh(new a.PlaneGeometry(.295,.295),h.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new a.Line(E,m),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new a.Line(E,m),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new a.Mesh(new a.PlaneGeometry(.295,.295),u.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new a.Line(E,g),[.18,0,.3],null,[.125,1,1]],[new a.Line(E,g),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},w={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),n)]],XY:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneGeometry(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},M={START:[[new a.Mesh(new a.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new a.Mesh(new a.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new a.Line((()=>{const e=new a.BufferGeometry;return e.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,1,1],3)),e})(),r),null,null,null,"helper"]],X:[[new a.Line(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(E,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(E,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},C={X:[[new a.Line(_(1,.5),d)],[new a.Mesh(new a.OctahedronGeometry(.04,0),i),[0,0,.99],null,[1,3,1]]],Y:[[new a.Line(_(1,.5),p),null,[0,0,-Math.PI/2]],[new a.Mesh(new a.OctahedronGeometry(.04,0),s),[0,0,.99],null,[3,1,1]]],Z:[[new a.Line(_(1,.5),f),null,[0,Math.PI/2,0]],[new a.Mesh(new a.OctahedronGeometry(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new a.Line(_(1.25,1),y),null,[0,Math.PI/2,0]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),y),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),y),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),y),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new a.Mesh(new a.CylinderGeometry(.03,0,.15,4,1,!1),y),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new a.Line(_(1,1),v),null,[0,Math.PI/2,0]]]},T={AXIS:[[new a.Line(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},I={X:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusGeometry(1.25,.1,2,24),n)]],XYZE:[[new a.Mesh(new a.SphereGeometry(.7,10,8),n)]]},B={X:[[new a.Mesh(b,i),[.8,0,0],[0,0,-Math.PI/2]],[new a.Line(E,d),null,null,[.8,1,1]]],Y:[[new a.Mesh(b,s),[0,.8,0]],[new a.Line(E,p),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new a.Mesh(b,o),[0,0,.8],[Math.PI/2,0,0]],[new a.Line(E,f),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new a.Mesh(b,c),[.85,.85,0],null,[2,2,.2]],[new a.Line(E,A),[.855,.98,0],null,[.125,1,1]],[new a.Line(E,A),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new a.Mesh(b,h),[0,.85,.85],null,[.2,2,2]],[new a.Line(E,m),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new a.Line(E,m),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new a.Mesh(b,u),[.85,0,.85],null,[2,.2,2]],[new a.Line(E,g),[.855,0,.98],null,[.125,1,1]],[new a.Line(E,g),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),l.clone()),[1.1,0,0]]],XYZY:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),l.clone()),[0,1.1,0]]],XYZZ:[[new a.Mesh(new a.BoxGeometry(.125,.125,.125),l.clone()),[0,0,1.1]]]},R={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new a.Mesh(b,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new a.Mesh(b,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new a.Mesh(b,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),n),[0,0,1.1]]]},P={X:[[new a.Line(E,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(E,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(E,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D=e=>{const t=new a.Object3D;for(let n in e)for(let r=e[n].length;r--;){const i=e[n][r][0].clone(),s=e[n][r][1],a=e[n][r][2],o=e[n][r][3],l=e[n][r][4];i.name=n,i.tag=l,s&&i.position.set(s[0],s[1],s[2]),a&&i.rotation.set(a[0],a[1],a[2]),o&&i.scale.set(o[0],o[1],o[2]),i.updateMatrix();const c=i.geometry.clone();c.applyMatrix4(i.matrix),i.geometry=c,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=D(S)),this.add(this.gizmo.rotate=D(C)),this.add(this.gizmo.scale=D(B)),this.add(this.picker.translate=D(w)),this.add(this.picker.rotate=D(I)),this.add(this.picker.scale=D(R)),this.add(this.helper.translate=D(M)),this.add(this.helper.rotate=D(T)),this.add(this.helper.scale=D(P)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class Yo extends a.Mesh{constructor(){super(new a.PlaneGeometry(1e5,1e5,2,2),new a.MeshBasicMaterial({visible:!1,wireframe:!0,side:a.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),jo(this,"isTransformControlsPlane",!0),jo(this,"type","TransformControlsPlane"),jo(this,"unitX",new a.Vector3(1,0,0)),jo(this,"unitY",new a.Vector3(0,1,0)),jo(this,"unitZ",new a.Vector3(0,0,1)),jo(this,"tempVector",new a.Vector3),jo(this,"dirVector",new a.Vector3),jo(this,"alignVector",new a.Vector3),jo(this,"tempMatrix",new a.Matrix4),jo(this,"identityQuaternion",new a.Quaternion),jo(this,"cameraQuaternion",new a.Quaternion),jo(this,"worldPosition",new a.Vector3),jo(this,"worldQuaternion",new a.Quaternion),jo(this,"eye",new a.Vector3),jo(this,"axis",null),jo(this,"mode","translate"),jo(this,"space","world"),jo(this,"updateMatrixWorld",(()=>{let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),this.unitX.set(1,0,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0)}break;default:this.dirVector.set(0,0,0)}0===this.dirVector.length()?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()}))}}const qo=i.forwardRef((({children:e,domElement:t,onChange:n,onMouseDown:s,onMouseUp:l,onObjectChange:c,object:h,...u},d)=>{const p=["enabled","axis","mode","translationSnap","rotationSnap","scaleSnap","space","size","showX","showY","showZ"],{camera:f,...m}=u,g=to()(m,p),A=Vo()(m,p),v=(0,o.useThree)((e=>e.controls)),y=(0,o.useThree)((e=>e.gl)),x=(0,o.useThree)((e=>e.events)),b=(0,o.useThree)((e=>e.camera)),E=(0,o.useThree)((e=>e.invalidate)),_=f||b,S=t||x.connected||y.domElement,w=i.useMemo((()=>new Wo(_,S)),[_,S]),M=i.useRef();return i.useLayoutEffect((()=>(h?w.attach(h instanceof a.Object3D?h:h.current):M.current instanceof a.Object3D&&w.attach(M.current),()=>{w.detach()})),[h,e,w]),i.useEffect((()=>{if(v){const e=e=>v.enabled=!e.value;return w.addEventListener("dragging-changed",e),()=>w.removeEventListener("dragging-changed",e)}}),[w,v]),i.useEffect((()=>{const e=e=>{E(),n&&n(e)};return null==w||null==w.addEventListener||w.addEventListener("change",e),s&&(null==w||null==w.addEventListener||w.addEventListener("mouseDown",s)),l&&(null==w||null==w.addEventListener||w.addEventListener("mouseUp",l)),c&&(null==w||null==w.addEventListener||w.addEventListener("objectChange",c)),()=>{null==w||null==w.removeEventListener||w.removeEventListener("change",e),s&&(null==w||null==w.removeEventListener||w.removeEventListener("mouseDown",s)),l&&(null==w||null==w.removeEventListener||w.removeEventListener("mouseUp",l)),c&&(null==w||null==w.removeEventListener||w.removeEventListener("objectChange",c))}}),[n,s,l,c,w,E]),w?i.createElement(i.Fragment,null,i.createElement("primitive",(0,r.Z)({ref:d,dispose:void 0,object:w},g)),i.createElement("group",(0,r.Z)({ref:M},A),e)):null}));var Ko=Object.defineProperty,Jo=(e,t,n)=>(((e,t,n)=>{t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const Zo=new a.Euler(0,0,0,"YXZ"),$o=new a.Vector3,el={type:"change"},tl={type:"lock"},nl={type:"unlock"},rl=Math.PI/2;class il extends a.EventDispatcher{constructor(e,t){super(),Jo(this,"camera"),Jo(this,"domElement"),Jo(this,"isLocked"),Jo(this,"minPolarAngle"),Jo(this,"maxPolarAngle"),Jo(this,"pointerSpeed"),Jo(this,"onMouseMove",(e=>{if(!this.domElement||!1===this.isLocked)return;const t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;Zo.setFromQuaternion(this.camera.quaternion),Zo.y-=.002*t*this.pointerSpeed,Zo.x-=.002*n*this.pointerSpeed,Zo.x=Math.max(rl-this.maxPolarAngle,Math.min(rl-this.minPolarAngle,Zo.x)),this.camera.quaternion.setFromEuler(Zo),this.dispatchEvent(el)})),Jo(this,"onPointerlockChange",(()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(tl),this.isLocked=!0):(this.dispatchEvent(nl),this.isLocked=!1))})),Jo(this,"onPointerlockError",(()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")})),Jo(this,"connect",(e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))})),Jo(this,"disconnect",(()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))})),Jo(this,"dispose",(()=>{this.disconnect()})),Jo(this,"getObject",(()=>this.camera)),Jo(this,"direction",new a.Vector3(0,0,-1)),Jo(this,"getDirection",(e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion))),Jo(this,"moveForward",(e=>{$o.setFromMatrixColumn(this.camera.matrix,0),$o.crossVectors(this.camera.up,$o),this.camera.position.addScaledVector($o,e)})),Jo(this,"moveRight",(e=>{$o.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector($o,e)})),Jo(this,"lock",(()=>{this.domElement&&this.domElement.requestPointerLock()})),Jo(this,"unlock",(()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()})),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}const sl=i.forwardRef((({domElement:e,selector:t,onChange:n,onLock:s,onUnlock:a,enabled:l=!0,...c},h)=>{const{camera:u,...d}=c,p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.invalidate)),g=(0,o.useThree)((e=>e.raycaster)),A=(0,o.useThree)((e=>e.events)),v=u||f,y=e||A.connected||p.domElement,[x]=i.useState((()=>new il(v)));return i.useEffect((()=>{if(l){x.connect(y);const e=g.computeOffsets;return g.computeOffsets=e=>({offsetX:e.target.width/2,offsetY:e.target.height/2}),()=>{x.disconnect(),g.computeOffsets=e}}}),[l,x]),i.useEffect((()=>{const e=e=>{m(),n&&n(e)};x.addEventListener("change",e),s&&x.addEventListener("lock",s),a&&x.addEventListener("unlock",a);const r=()=>x.lock(),i=t?Array.from(document.querySelectorAll(t)):[document];return i.forEach((e=>e&&e.addEventListener("click",r))),()=>{x.removeEventListener("change",e),s&&x.addEventListener("lock",s),a&&x.addEventListener("unlock",a),i.forEach((e=>e?e.removeEventListener("click",r):void 0))}}),[n,s,a,t]),i.createElement("primitive",(0,r.Z)({ref:h,object:x},d))}));var al=Object.defineProperty,ol=(e,t,n)=>(((e,t,n)=>{t in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const ll=new a.Vector3;class cl extends a.EventDispatcher{constructor(e,t){super(),ol(this,"object"),ol(this,"domElement"),ol(this,"enabled",!0),ol(this,"movementSpeed",1),ol(this,"lookSpeed",.005),ol(this,"lookVertical",!0),ol(this,"autoForward",!1),ol(this,"activeLook",!0),ol(this,"heightSpeed",!1),ol(this,"heightCoef",1),ol(this,"heightMin",0),ol(this,"heightMax",1),ol(this,"constrainVertical",!1),ol(this,"verticalMin",0),ol(this,"verticalMax",Math.PI),ol(this,"mouseDragOn",!1),ol(this,"autoSpeedFactor",0),ol(this,"mouseX",0),ol(this,"mouseY",0),ol(this,"moveForward",!1),ol(this,"moveBackward",!1),ol(this,"moveLeft",!1),ol(this,"moveRight",!1),ol(this,"moveUp",!1),ol(this,"moveDown",!1),ol(this,"viewHalfX",0),ol(this,"viewHalfY",0),ol(this,"lat",0),ol(this,"lon",0),ol(this,"lookDirection",new a.Vector3),ol(this,"spherical",new a.Spherical),ol(this,"target",new a.Vector3),ol(this,"connect",(e=>{e.setAttribute("tabindex","-1"),e.style.touchAction="none",e.addEventListener("contextmenu",this.contextmenu),e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),this.domElement=e,window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.handleResize()})),ol(this,"dispose",(()=>{var e,t,n,r;null==(e=this.domElement)||e.removeEventListener("contextmenu",this.contextmenu),null==(t=this.domElement)||t.removeEventListener("mousedown",this.onMouseDown),null==(n=this.domElement)||n.removeEventListener("mousemove",this.onMouseMove),null==(r=this.domElement)||r.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)})),ol(this,"handleResize",(()=>{this.domElement&&(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)})),ol(this,"onMouseDown",(e=>{var t;if(null==(t=this.domElement)||t.focus(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0})),ol(this,"onMouseUp",(e=>{if(this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1})),ol(this,"onMouseMove",(e=>{this.domElement&&(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)})),ol(this,"onKeyDown",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!0;break;case"ArrowLeft":case"KeyA":this.moveLeft=!0;break;case"ArrowDown":case"KeyS":this.moveBackward=!0;break;case"ArrowRight":case"KeyD":this.moveRight=!0;break;case"KeyR":this.moveUp=!0;break;case"KeyF":this.moveDown=!0}})),ol(this,"onKeyUp",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!1;break;case"ArrowLeft":case"KeyA":this.moveLeft=!1;break;case"ArrowDown":case"KeyS":this.moveBackward=!1;break;case"ArrowRight":case"KeyD":this.moveRight=!1;break;case"KeyR":this.moveUp=!1;break;case"KeyF":this.moveDown=!1}})),ol(this,"lookAt",((e,t,n)=>(e instanceof a.Vector3?this.target.copy(e):t&&n&&this.target.set(e,t,n),this.object.lookAt(this.target),this.setOrientation(),this))),ol(this,"update",(e=>{if(!this.enabled)return;if(this.heightSpeed){const t=a.MathUtils.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;const t=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(t+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(t),this.moveLeft&&this.object.translateX(-t),this.moveRight&&this.object.translateX(t),this.moveUp&&this.object.translateY(t),this.moveDown&&this.object.translateY(-t);let n=e*this.lookSpeed;this.activeLook||(n=0);let r=1;this.constrainVertical&&(r=Math.PI/(this.verticalMax-this.verticalMin)),this.lon-=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*r),this.lat=Math.max(-85,Math.min(85,this.lat));let i=a.MathUtils.degToRad(90-this.lat);const s=a.MathUtils.degToRad(this.lon);this.constrainVertical&&(i=a.MathUtils.mapLinear(i,0,Math.PI,this.verticalMin,this.verticalMax));const o=this.object.position;ll.setFromSphericalCoords(1,i,s).add(o),this.object.lookAt(ll)})),ol(this,"contextmenu",(e=>e.preventDefault())),ol(this,"setOrientation",(()=>{this.lookDirection.set(0,0,-1).applyQuaternion(this.object.quaternion),this.spherical.setFromVector3(this.lookDirection),this.lat=90-a.MathUtils.radToDeg(this.spherical.phi),this.lon=a.MathUtils.radToDeg(this.spherical.theta)})),this.object=e,this.domElement=t,this.setOrientation(),t&&this.connect(t)}}const hl=i.forwardRef(((e,t)=>{const n=(0,o.useThree)((e=>e.camera)),s=(0,o.useThree)((e=>e.gl)),[a]=i.useState((()=>new cl(n,s.domElement)));return(0,o.useFrame)(((e,t)=>{a.update(t)})),a?i.createElement("primitive",(0,r.Z)({ref:t,object:a},e)):null}));function ul(e,t){const n=(0,o.useThree)((e=>e.mouse)),[r]=i.useState((()=>{const r=new a.Raycaster;return t&&(0,o.applyProps)(r,t,{}),function(t,i){r.setFromCamera(n,e instanceof a.Camera?e:e.current);const s=this.constructor.prototype.raycast.bind(this);s&&s(r,i)}}));return r}const dl=i.createContext({}),pl=()=>i.useContext(dl),fl=2*Math.PI,ml=new a.Object3D,gl=new a.Matrix4,[Al,vl]=[new a.Quaternion,new a.Quaternion],yl=new a.Vector3,xl=new a.Vector3,bl=({alignment:e="bottom-right",margin:t=[80,80],renderPriority:n=0,autoClear:r=!0,onUpdate:s,onTarget:l,children:c})=>{const h=(0,o.useThree)((({size:e})=>e)),u=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({controls:e})=>e)),p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((({scene:e})=>e)),m=(0,o.useThree)((({invalidate:e})=>e)),g=i.useRef(),A=i.useRef(),v=i.useRef(null),[y]=i.useState((()=>new a.Scene)),x=i.useRef(!1),b=i.useRef(0),E=i.useRef(new a.Vector3(0,0,0)),_=i.useCallback((e=>{x.current=!0,(d||l)&&(E.current=(null==d?void 0:d.target)||(null==l?void 0:l())),b.current=u.position.distanceTo(yl),Al.copy(u.quaternion),xl.copy(e).multiplyScalar(b.current).add(yl),ml.lookAt(xl),vl.copy(ml.quaternion),m()}),[d,u,l,m]);i.useEffect((()=>(f.background&&(g.current=f.background,f.background=null,y.background=g.current),()=>{g.current&&(f.background=g.current)})),[]),(0,o.useFrame)(((e,t)=>{if(v.current&&A.current){var n;if(x.current)if(Al.angleTo(vl)<.01)x.current=!1;else{const e=t*fl;Al.rotateTowards(vl,e),u.position.set(0,0,1).applyQuaternion(Al).multiplyScalar(b.current).add(E.current),u.up.set(0,1,0).applyQuaternion(Al).normalize(),u.quaternion.copy(Al),s?s():d&&d.update(),m()}gl.copy(u.matrix).invert(),null==(n=A.current)||n.quaternion.setFromRotationMatrix(gl),r&&(p.autoClear=!1),p.clearDepth(),p.render(y,v.current)}}),n);const S=ul(v),w=i.useMemo((()=>({tweenCamera:_,raycast:S})),[_]),[M,C]=t,T=e.endsWith("-left")?-h.width/2+M:h.width/2-M,I=e.startsWith("top-")?h.height/2-C:-h.height/2+C;return(0,o.createPortal)(i.createElement(dl.Provider,{value:w},i.createElement(io,{ref:v,position:[0,0,200]}),i.createElement("group",{ref:A,position:[T,I,0]},c)),y)},El="#f0f0f0",_l="#999",Sl="black",wl="black",Ml=["Right","Left","Top","Bottom","Front","Back"],Cl=e=>new a.Vector3(...e).multiplyScalar(.38),Tl=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]].map(Cl),Il=[.25,.25,.25],Bl=[[1,1,0],[1,0,1],[1,0,-1],[1,-1,0],[0,1,1],[0,1,-1],[0,-1,1],[0,-1,-1],[-1,1,0],[-1,0,1],[-1,0,-1],[-1,-1,0]].map(Cl),Rl=Bl.map((e=>e.toArray().map((e=>0==e?.5:.25)))),Pl=({hover:e,index:t,font:n="20px Inter var, Arial, sans-serif",faces:r=Ml,color:s=El,hoverColor:l=_l,textColor:c=Sl,strokeColor:h=wl,opacity:u=1})=>{const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const i=e.getContext("2d");return i.fillStyle=s,i.fillRect(0,0,e.width,e.height),i.strokeStyle=h,i.strokeRect(0,0,e.width,e.height),i.font=n,i.textAlign="center",i.fillStyle=c,i.fillText(r[t].toUpperCase(),64,76),new a.CanvasTexture(e)}),[t,r,n,s,c,h]);return i.createElement("meshLambertMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,attachArray:"material",color:e?l:"white",transparent:!0,opacity:u})},Dl=e=>{const{tweenCamera:t,raycast:n}=pl(),[s,a]=i.useState(null);return i.createElement("mesh",{raycast:n,onPointerOut:e=>{e.stopPropagation(),a(null)},onPointerMove:e=>{e.stopPropagation(),a(Math.floor(e.faceIndex/2))},onClick:e.onClick||(e=>{e.stopPropagation(),t(e.face.normal)})},[...Array(6)].map(((t,n)=>i.createElement(Pl,(0,r.Z)({key:n,index:n,hover:s===n},e)))),i.createElement("boxGeometry",null))},Ll=({onClick:e,dimensions:t,position:n,hoverColor:r=_l})=>{const{tweenCamera:s,raycast:a}=pl(),[o,l]=i.useState(!1);return i.createElement("mesh",{scale:1.01,position:n,raycast:a,onPointerOver:e=>{e.stopPropagation(),l(!0)},onPointerOut:e=>{e.stopPropagation(),l(!1)},onClick:e||(e=>{e.stopPropagation(),s(n)})},i.createElement("meshBasicMaterial",{color:o?r:"white",transparent:!0,opacity:.6,visible:o}),i.createElement("boxGeometry",{args:t}))},Fl=e=>i.createElement("group",{scale:[60,60,60]},i.createElement(Dl,e),Bl.map(((t,n)=>i.createElement(Ll,(0,r.Z)({key:n,position:t,dimensions:Rl[n]},e)))),Tl.map(((t,n)=>i.createElement(Ll,(0,r.Z)({key:n,position:t,dimensions:Il},e)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}));function Ul({scale:e=[.8,.05,.05],color:t,rotation:n}){return i.createElement("group",{rotation:n},i.createElement("mesh",{position:[.4,0,0]},i.createElement("boxGeometry",{args:e}),i.createElement("meshBasicMaterial",{color:t,toneMapped:!1})))}function Ol({onClick:e,font:t,disabled:n,arcStyle:s,label:l,labelColor:c,axisHeadScale:h=1,...u}){const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=64,e.height=64;const n=e.getContext("2d");return n.beginPath(),n.arc(32,32,16,0,2*Math.PI),n.closePath(),n.fillStyle=s,n.fill(),l&&(n.font=t,n.textAlign="center",n.fillStyle=c,n.fillText(l,32,41)),new a.CanvasTexture(e)}),[s,l,c,t]),[f,m]=i.useState(!1),g=(l?1:.75)*(f?1.2:1)*h;return i.createElement("sprite",(0,r.Z)({scale:g,onPointerOver:n?void 0:e=>{e.stopPropagation(),m(!0)},onPointerOut:n?void 0:e||(e=>{e.stopPropagation(),m(!1)})},u),i.createElement("spriteMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,alphaTest:.3,opacity:l?1:.75,toneMapped:!1}))}const Nl=({hideNegativeAxes:e,hideAxisHeads:t,disabled:n,font:s="18px Inter var, Arial, sans-serif",axisColors:a=["#ff3653","#0adb50","#2c8fdf"],axisHeadScale:o=1,axisScale:l,labels:c=["X","Y","Z"],labelColor:h="#000",onClick:u,...d})=>{const[p,f,m]=a,{tweenCamera:g,raycast:A}=pl(),v={font:s,disabled:n,labelColor:h,raycast:A,onClick:u,axisHeadScale:o,onPointerDown:n?void 0:e=>{g(e.object.position),e.stopPropagation()}};return i.createElement("group",(0,r.Z)({scale:40},d),i.createElement(Ul,{color:p,rotation:[0,0,0],scale:l}),i.createElement(Ul,{color:f,rotation:[0,0,Math.PI/2],scale:l}),i.createElement(Ul,{color:m,rotation:[0,-Math.PI/2,0],scale:l}),!t&&i.createElement(i.Fragment,null,i.createElement(Ol,(0,r.Z)({arcStyle:p,position:[1,0,0],label:c[0]},v)),i.createElement(Ol,(0,r.Z)({arcStyle:f,position:[0,1,0],label:c[1]},v)),i.createElement(Ol,(0,r.Z)({arcStyle:m,position:[0,0,1],label:c[2]},v)),!e&&i.createElement(i.Fragment,null,i.createElement(Ol,(0,r.Z)({arcStyle:p,position:[-1,0,0]},v)),i.createElement(Ol,(0,r.Z)({arcStyle:f,position:[0,-1,0]},v)),i.createElement(Ol,(0,r.Z)({arcStyle:m,position:[0,0,-1]},v)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}))};function kl(e,{path:t}){const[n]=(0,o.useLoader)(a.CubeTextureLoader,[e],(e=>e.setPath(t)));return n}kl.preload=(e,{path:t})=>o.useLoader.preload(a.CubeTextureLoader,[e],(e=>e.setPath(t)));var Gl=Uint8Array,zl=Uint16Array,Ql=Uint32Array,Vl=new Gl([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hl=new Gl([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jl=new Gl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Wl=function(e,t){for(var n=new zl(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Ql(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},Xl=Wl(Vl,2),Yl=Xl[0],ql=Xl[1];Yl[28]=258,ql[258]=28;for(var Kl=Wl(Hl,0),Jl=Kl[0],Zl=(Kl[1],new zl(32768)),$l=0;$l<32768;++$l){var ec=(43690&$l)>>>1|(21845&$l)<<1;ec=(61680&(ec=(52428&ec)>>>2|(13107&ec)<<2))>>>4|(3855&ec)<<4,Zl[$l]=((65280&ec)>>>8|(255&ec)<<8)>>>1}var tc=function(e,t,n){for(var r=e.length,i=0,s=new zl(t);i<r;++i)++s[e[i]-1];var a,o=new zl(t);for(i=0;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;if(n){a=new zl(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],h=t-e[i],u=o[e[i]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)a[Zl[u]>>>l]=c}else for(a=new zl(r),i=0;i<r;++i)e[i]&&(a[i]=Zl[o[e[i]-1]++]>>>15-e[i]);return a},nc=new Gl(288);for($l=0;$l<144;++$l)nc[$l]=8;for($l=144;$l<256;++$l)nc[$l]=9;for($l=256;$l<280;++$l)nc[$l]=7;for($l=280;$l<288;++$l)nc[$l]=8;var rc=new Gl(32);for($l=0;$l<32;++$l)rc[$l]=5;var ic=tc(nc,9,1),sc=tc(rc,5,1),ac=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},oc=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},lc=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},cc=function(e){return(e/8|0)+(7&e&&1)},hc=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof zl?zl:e instanceof Ql?Ql:Gl)(n-t);return r.set(e.subarray(t,n)),r},uc=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new Gl(0);var i=!t||n,s=!n||n.i;n||(n={}),t||(t=new Gl(3*r));var a=function(e){var n=t.length;if(e>n){var r=new Gl(Math.max(2*n,e));r.set(t),t=r}},o=n.f||0,l=n.p||0,c=n.b||0,h=n.l,u=n.d,d=n.m,p=n.n,f=8*r;do{if(!h){n.f=o=oc(e,l,1);var m=oc(e,l+1,3);if(l+=3,!m){var g=e[(C=cc(l)+4)-4]|e[C-3]<<8,A=C+g;if(A>r){if(s)throw"unexpected EOF";break}i&&a(c+g),t.set(e.subarray(C,A),c),n.b=c+=g,n.p=l=8*A;continue}if(1==m)h=ic,u=sc,d=9,p=5;else{if(2!=m)throw"invalid block type";var v=oc(e,l,31)+257,y=oc(e,l+10,15)+4,x=v+oc(e,l+5,31)+1;l+=14;for(var b=new Gl(x),E=new Gl(19),_=0;_<y;++_)E[jl[_]]=oc(e,l+3*_,7);l+=3*y;var S=ac(E),w=(1<<S)-1,M=tc(E,S,1);for(_=0;_<x;){var C,T=M[oc(e,l,w)];if(l+=15&T,(C=T>>>4)<16)b[_++]=C;else{var I=0,B=0;for(16==C?(B=3+oc(e,l,3),l+=2,I=b[_-1]):17==C?(B=3+oc(e,l,7),l+=3):18==C&&(B=11+oc(e,l,127),l+=7);B--;)b[_++]=I}}var R=b.subarray(0,v),P=b.subarray(v);d=ac(R),p=ac(P),h=tc(R,d,1),u=tc(P,p,1)}if(l>f){if(s)throw"unexpected EOF";break}}i&&a(c+131072);for(var D=(1<<d)-1,L=(1<<p)-1,F=l;;F=l){var U=(I=h[lc(e,l)&D])>>>4;if((l+=15&I)>f){if(s)throw"unexpected EOF";break}if(!I)throw"invalid length/literal";if(U<256)t[c++]=U;else{if(256==U){F=l,h=null;break}var O=U-254;if(U>264){var N=Vl[_=U-257];O=oc(e,l,(1<<N)-1)+Yl[_],l+=N}var k=u[lc(e,l)&L],G=k>>>4;if(!k)throw"invalid distance";l+=15&k;P=Jl[G];if(G>3){N=Hl[G];P+=lc(e,l)&(1<<N)-1,l+=N}if(l>f){if(s)throw"unexpected EOF";break}i&&a(c+131072);for(var z=c+O;c<z;c+=4)t[c]=t[c-P],t[c+1]=t[c+1-P],t[c+2]=t[c+2-P],t[c+3]=t[c+3-P];c=z}}n.l=h,n.p=F,n.b=c,h&&(o=1,n.m=d,n.d=u,n.n=p)}while(!o);return c==t.length?t:hc(t,0,c)},dc=new Gl(0),pc=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function fc(e,t){return uc((pc(e),e.subarray(2,-4)),t)}var mc="undefined"!=typeof TextDecoder&&new TextDecoder;try{mc.decode(dc,{stream:!0}),1}catch(za){}function gc(e,t,n){const r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;let i=e,s=r,a=Math.floor((i+s)/2);for(;t<n[a]||t>=n[a+1];)t<n[a]?s=a:i=a,a=Math.floor((i+s)/2);return a}function Ac(e,t,n,r){const i=[],s=[],a=[];i[0]=1;for(let o=1;o<=n;++o){s[o]=t-r[e+1-o],a[o]=r[e+o]-t;let n=0;for(let e=0;e<o;++e){const t=a[e+1],r=s[o-e],l=i[e]/(t+r);i[e]=n+t*l,n=r*l}i[o]=n}return i}function vc(e,t){let n=1;for(let i=2;i<=e;++i)n*=i;let r=1;for(let i=2;i<=t;++i)r*=i;for(let i=2;i<=e-t;++i)r*=i;return n/r}function yc(e,t,n,r,i){const s=function(e,t,n,r,i){const s=i<e?i:e,o=[],l=gc(e,r,t),c=function(e,t,n,r,i){const s=[];for(let u=0;u<=n;++u)s[u]=0;const a=[];for(let u=0;u<=r;++u)a[u]=s.slice(0);const o=[];for(let u=0;u<=n;++u)o[u]=s.slice(0);o[0][0]=1;const l=s.slice(0),c=s.slice(0);for(let u=1;u<=n;++u){l[u]=t-i[e+1-u],c[u]=i[e+u]-t;let n=0;for(let e=0;e<u;++e){const t=c[e+1],r=l[u-e];o[u][e]=t+r;const i=o[e][u-1]/o[u][e];o[e][u]=n+t*i,n=r*i}o[u][u]=n}for(let u=0;u<=n;++u)a[0][u]=o[u][n];for(let u=0;u<=n;++u){let e=0,t=1;const i=[];for(let r=0;r<=n;++r)i[r]=s.slice(0);i[0][0]=1;for(let s=1;s<=r;++s){let r=0;const l=u-s,c=n-s;u>=s&&(i[t][0]=i[e][0]/o[c+1][l],r=i[t][0]*o[l][c]);const h=u-1<=c?s-1:n-u;for(let n=l>=-1?1:-l;n<=h;++n)i[t][n]=(i[e][n]-i[e][n-1])/o[c+1][l+n],r+=i[t][n]*o[l+n][c];u<=c&&(i[t][s]=-i[e][s-1]/o[c+1][u],r+=i[t][s]*o[u][c]),a[s][u]=r;const d=e;e=t,t=d}}let h=n;for(let u=1;u<=r;++u){for(let e=0;e<=n;++e)a[u][e]*=h;h*=n-u}return a}(l,r,e,s,t),h=[];for(let a=0;a<n.length;++a){const e=n[a].clone(),t=e.w;e.x*=t,e.y*=t,e.z*=t,h[a]=e}for(let a=0;a<=s;++a){const t=h[l-e].clone().multiplyScalar(c[a][0]);for(let n=1;n<=e;++n)t.add(h[l-e+n].clone().multiplyScalar(c[a][n]));o[a]=t}for(let u=s+1;u<=i+1;++u)o[u]=new a.Vector4(0,0,0);return o}(e,t,n,r,i);return function(e){const t=e.length,n=[],r=[];for(let s=0;s<t;++s){const t=e[s];n[s]=new a.Vector3(t.x,t.y,t.z),r[s]=t.w}const i=[];for(let s=0;s<t;++s){const e=n[s].clone();for(let t=1;t<=s;++t)e.sub(i[s-t].clone().multiplyScalar(vc(s,t)*r[t]));i[s]=e.divideScalar(r[0])}return i}(s)}class xc extends a.Curve{constructor(e,t,n,r,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=r||0,this.endKnot=i||this.knots.length-1;for(let s=0;s<n.length;++s){const e=n[s];this.controlPoints[s]=new a.Vector4(e.x,e.y,e.z,e.w)}}getPoint(e,t){const n=t||new a.Vector3,r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=function(e,t,n,r){const i=gc(e,r,t),s=Ac(i,r,e,t),o=new a.Vector4(0,0,0,0);for(let a=0;a<=e;++a){const t=n[i-e+a],r=s[a],l=t.w*r;o.x+=t.x*l,o.y+=t.y*l,o.z+=t.z*l,o.w+=t.w*r}return o}(this.degree,this.knots,this.controlPoints,r);return 1!=i.w&&i.divideScalar(i.w),n.set(i.x,i.y,i.z)}getTangent(e,t){const n=t||new a.Vector3,r=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=yc(this.degree,this.knots,this.controlPoints,r,1);return n.copy(i[1]).normalize(),n}}let bc,Ec,_c;class Sc extends a.Loader{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===i.path?a.LoaderUtils.extractUrlBase(e):i.path,o=new a.FileLoader(this.manager);o.setPath(i.path),o.setResponseType("arraybuffer"),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(n,s))}catch(za){r?r(za):console.error(za),i.manager.itemError(e)}}),n,r)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===zc(e,0,t.length)}(e))bc=(new Ic).parse(e);else{const t=zc(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(t){const r=e[t-1];return e=e.slice(n+t),n++,r}for(let i=0;i<t.length;++i){if(r(1)===t[i])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(Pc(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Pc(t));bc=(new Tc).parse(t)}const n=new a.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new wc(n,this.manager).parse(bc)}}class wc{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Ec=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),i=(new Mc).parse(r);return this.parseScene(r,i,n),_c}parseConnections(){const e=new Map;if("Connections"in bc){bc.Connections.connections.forEach((function(t){const n=t[0],r=t[1],i=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:r,relationship:i};e.get(n).parents.push(s),e.has(r)||e.set(r,{parents:[],children:[]});const a={ID:n,relationship:i};e.get(r).children.push(a)}))}return e}parseImages(){const e={},t={};if("Video"in bc.Objects){const n=bc.Objects.Video;for(const r in n){const i=n[r];if(e[parseInt(r)]=i.RelativeFilename||i.Filename,"Content"in i){const e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,s="string"==typeof i.Content&&""!==i.Content;if(e||s){const e=this.parseImage(n[r]);t[i.RelativeFilename||i.Filename]=e}}}}for(const n in e){const r=e[n];void 0!==t[r]?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let i;switch(r){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof t)return"data:"+i+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in bc.Objects){const n=bc.Objects.Texture;for(const r in n){const i=this.parseTexture(n[r],e);t.set(parseInt(r),i)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const r=e.WrapModeU,i=e.WrapModeV,s=void 0!==r?r.value:0,o=void 0!==i?i.value:0;if(n.wrapS=0===s?a.RepeatWrapping:a.ClampToEdgeWrapping,n.wrapT=0===o?a.RepeatWrapping:a.ClampToEdgeWrapping,"Scaling"in e){const t=e.Scaling.value;n.repeat.x=t[0],n.repeat.y=t[1]}return n}loadTexture(e,t){let n;const r=this.textureLoader.path,i=Ec.get(e.id).children;let s;void 0!==i&&i.length>0&&void 0!==t[i[0].ID]&&(n=t[i[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const o=e.FileName.slice(-3).toLowerCase();if("tga"===o){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new a.Texture):(t.setPath(this.textureLoader.path),s=t.load(n))}else"psd"===o?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new a.Texture):s=this.textureLoader.load(n);return this.textureLoader.setPath(r),s}parseMaterials(e){const t=new Map;if("Material"in bc.Objects){const n=bc.Objects.Material;for(const r in n){const i=this.parseMaterial(n[r],e);null!==i&&t.set(parseInt(r),i)}}return t}parseMaterial(e,t){const n=e.id,r=e.attrName;let i=e.ShadingModel;if("object"==typeof i&&(i=i.value),!Ec.has(n))return null;const s=this.parseParameters(e,t,n);let o;switch(i.toLowerCase()){case"phong":o=new a.MeshPhongMaterial;break;case"lambert":o=new a.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),o=new a.MeshPhongMaterial}return o.setValues(s),o.name=r,o}parseParameters(e,t,n){const r={};e.BumpFactor&&(r.bumpScale=e.BumpFactor.value),e.Diffuse?r.color=(new a.Color).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(r.color=(new a.Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(r.displacementScale=e.DisplacementFactor.value),e.Emissive?r.emissive=(new a.Color).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(r.emissive=(new a.Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(r.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(r.opacity=parseFloat(e.Opacity.value)),r.opacity<1&&(r.transparent=!0),e.ReflectionFactor&&(r.reflectivity=e.ReflectionFactor.value),e.Shininess&&(r.shininess=e.Shininess.value),e.Specular?r.specular=(new a.Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(r.specular=(new a.Color).fromArray(e.SpecularColor.value));const i=this;return Ec.get(n).children.forEach((function(e){const n=e.relationship;switch(n){case"Bump":r.bumpMap=i.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":r.aoMap=i.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=i.getTexture(t,e.ID),void 0!==r.map&&("colorSpace"in r.map?r.map.colorSpace="srgb":r.map.encoding=3001);break;case"DisplacementColor":r.displacementMap=i.getTexture(t,e.ID);break;case"EmissiveColor":r.emissiveMap=i.getTexture(t,e.ID),void 0!==r.emissiveMap&&("colorSpace"in r.emissiveMap?r.emissiveMap.colorSpace="srgb":r.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=i.getTexture(t,e.ID);break;case"ReflectionColor":r.envMap=i.getTexture(t,e.ID),void 0!==r.envMap&&(r.envMap.mapping=a.EquirectangularReflectionMapping,"colorSpace"in r.envMap?r.envMap.colorSpace="srgb":r.envMap.encoding=3001);break;case"SpecularColor":r.specularMap=i.getTexture(t,e.ID),void 0!==r.specularMap&&("colorSpace"in r.specularMap?r.specularMap.colorSpace="srgb":r.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=i.getTexture(t,e.ID),r.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),r}getTexture(e,t){return"LayeredTexture"in bc.Objects&&t in bc.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Ec.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in bc.Objects){const n=bc.Objects.Deformer;for(const r in n){const i=n[r],s=Ec.get(parseInt(r));if("Skin"===i.attrType){const t=this.parseSkeleton(s,n);t.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=s.parents[0].ID,e[r]=t}else if("BlendShape"===i.attrType){const e={id:r};e.rawTargets=this.parseMorphTargets(s,n),e.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach((function(e){const r=t[e.ID];if("Cluster"!==r.attrType)return;const i={ID:e.ID,indices:[],weights:[],transformLink:(new a.Matrix4).fromArray(r.TransformLink.a)};"Indexes"in r&&(i.indices=r.Indexes.a,i.weights=r.Weights.a),n.push(i)})),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let r=0;r<e.children.length;r++){const i=e.children[r],s=t[i.ID],a={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;a.geoID=Ec.get(parseInt(i.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,n.push(a)}return n}parseScene(e,t,n){_c=new a.Group;const r=this.parseModels(e.skeletons,t,n),i=bc.Objects.Model,s=this;r.forEach((function(e){const t=i[e.ID];s.setLookAtProperties(e,t);Ec.get(e.ID).parents.forEach((function(t){const n=r.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&_c.add(e)})),this.bindSkeleton(e.skeletons,t,r),this.createAmbientLight(),_c.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=Nc(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const o=(new Cc).parse();1===_c.children.length&&_c.children[0].isGroup&&(_c.children[0].animations=o,_c=_c.children[0]),_c.animations=o}parseModels(e,t,n){const r=new Map,i=bc.Objects.Model;for(const s in i){const o=parseInt(s),l=i[s],c=Ec.get(o);let h=this.buildSkeleton(c,e,o,l.attrName);if(!h){switch(l.attrType){case"Camera":h=this.createCamera(c);break;case"Light":h=this.createLight(c);break;case"Mesh":h=this.createMesh(c,t,n);break;case"NurbsCurve":h=this.createCurve(c,t);break;case"LimbNode":case"Root":h=new a.Bone;break;default:h=new a.Group}h.name=l.attrName?a.PropertyBinding.sanitizeNodeName(l.attrName):"",h.ID=o}this.getTransformData(h,l),r.set(o,h)}return r}buildSkeleton(e,t,n,r){let i=null;return e.parents.forEach((function(e){for(const s in t){const o=t[s];o.rawBones.forEach((function(t,s){if(t.ID===e.ID){const e=i;i=new a.Bone,i.matrixWorld.copy(t.transformLink),i.name=r?a.PropertyBinding.sanitizeNodeName(r):"",i.ID=n,o.bones[s]=i,null!==e&&i.add(e)}}))}})),i}createCamera(e){let t,n;if(e.children.forEach((function(e){const t=bc.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new a.Object3D;else{let e=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(e=1);let r=1;void 0!==n.NearPlane&&(r=n.NearPlane.value/1e3);let i=1e3;void 0!==n.FarPlane&&(i=n.FarPlane.value/1e3);let s=window.innerWidth,o=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(s=n.AspectWidth.value,o=n.AspectHeight.value);const l=s/o;let c=45;void 0!==n.FieldOfView&&(c=n.FieldOfView.value);const h=n.FocalLength?n.FocalLength.value:null;switch(e){case 0:t=new a.PerspectiveCamera(c,l,r,i),null!==h&&t.setFocalLength(h);break;case 1:t=new a.OrthographicCamera(-s/2,s/2,o/2,-o/2,r,i);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new a.Object3D}}return t}createLight(e){let t,n;if(e.children.forEach((function(e){const t=bc.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new a.Object3D;else{let e;e=void 0===n.LightType?0:n.LightType.value;let r=16777215;void 0!==n.Color&&(r=(new a.Color).fromArray(n.Color.value));let i=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(i=0);let s=0;void 0!==n.FarAttenuationEnd&&(s=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const o=1;switch(e){case 0:t=new a.PointLight(r,i,s,o);break;case 1:t=new a.DirectionalLight(r,i);break;case 2:let e=Math.PI/3;void 0!==n.InnerAngle&&(e=a.MathUtils.degToRad(n.InnerAngle.value));let l=0;void 0!==n.OuterAngle&&(l=a.MathUtils.degToRad(n.OuterAngle.value),l=Math.max(l,1)),t=new a.SpotLight(r,i,s,e,l,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new a.PointLight(r,i)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,n){let r,i=null,s=null;const o=[];return e.children.forEach((function(e){t.has(e.ID)&&(i=t.get(e.ID)),n.has(e.ID)&&o.push(n.get(e.ID))})),o.length>1?s=o:o.length>0?s=o[0]:(s=new a.MeshPhongMaterial({color:13421772}),o.push(s)),"color"in i.attributes&&o.forEach((function(e){e.vertexColors=!0})),i.FBX_Deformer?(r=new a.SkinnedMesh(i,s),r.normalizeSkinWeights()):r=new a.Mesh(i,s),r}createCurve(e,t){const n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),r=new a.LineBasicMaterial({color:3342591,linewidth:1});return new a.Line(n,r)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?kc(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){if("LookAtProperty"in t){Ec.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const n=bc.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),_c.add(e.target)):e.lookAt((new a.Vector3).fromArray(t))}}}))}}bindSkeleton(e,t,n){const r=this.parsePoseNodes();for(const i in e){const s=e[i];Ec.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;Ec.get(t).parents.forEach((function(e){if(n.has(e.ID)){n.get(e.ID).bind(new a.Skeleton(s.bones),r[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in bc.Objects){const t=bc.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const r=t[n].PoseNode;Array.isArray(r)?r.forEach((function(t){e[t.Node]=(new a.Matrix4).fromArray(t.Matrix.a)})):e[r.Node]=(new a.Matrix4).fromArray(r.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in bc&&"AmbientColor"in bc.GlobalSettings){const e=bc.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],r=e[2];if(0!==t||0!==n||0!==r){const e=new a.Color(t,n,r);_c.add(new a.AmbientLight(e,1))}}}}class Mc{parse(e){const t=new Map;if("Geometry"in bc.Objects){const n=bc.Objects.Geometry;for(const r in n){const i=Ec.get(parseInt(r)),s=this.parseGeometry(i,n[r],e);t.set(parseInt(r),s)}}return t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const r=n.skeletons,i=[],s=e.parents.map((function(e){return bc.Objects.Model[e.ID]}));if(0===s.length)return;const a=e.children.reduce((function(e,t){return void 0!==r[t.ID]&&(e=r[t.ID]),e}),null);e.children.forEach((function(e){void 0!==n.morphTargets[e.ID]&&i.push(n.morphTargets[e.ID])}));const o=s[0],l={};"RotationOrder"in o&&(l.eulerOrder=kc(o.RotationOrder.value)),"InheritType"in o&&(l.inheritType=parseInt(o.InheritType.value)),"GeometricTranslation"in o&&(l.translation=o.GeometricTranslation.value),"GeometricRotation"in o&&(l.rotation=o.GeometricRotation.value),"GeometricScaling"in o&&(l.scale=o.GeometricScaling.value);const c=Nc(l);return this.genGeometry(t,a,i,c)}genGeometry(e,t,n,r){const i=new a.BufferGeometry;e.attrName&&(i.name=e.attrName);const s=this.parseGeoNode(e,t),o=this.genBuffers(s),l=new a.Float32BufferAttribute(o.vertex,3);if(l.applyMatrix4(r),i.setAttribute("position",l),o.colors.length>0&&i.setAttribute("color",new a.Float32BufferAttribute(o.colors,3)),t&&(i.setAttribute("skinIndex",new a.Uint16BufferAttribute(o.weightsIndices,4)),i.setAttribute("skinWeight",new a.Float32BufferAttribute(o.vertexWeights,4)),i.FBX_Deformer=t),o.normal.length>0){const e=(new a.Matrix3).getNormalMatrix(r),t=new a.Float32BufferAttribute(o.normal,3);t.applyNormalMatrix(e),i.setAttribute("normal",t)}if(o.uvs.forEach((function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),i.setAttribute(n,new a.Float32BufferAttribute(o.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=o.materialIndex[0],t=0;if(o.materialIndex.forEach((function(n,r){n!==e&&(i.addGroup(t,r-t,e),e=n,t=r)})),i.groups.length>0){const t=i.groups[i.groups.length-1],n=t.start+t.count;n!==o.materialIndex.length&&i.addGroup(n,o.materialIndex.length-n,e)}0===i.groups.length&&i.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(i,e,n,r),i}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,i){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[i]})}))}))),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,i=!1,s=[],a=[],o=[],l=[],c=[],h=[];const u=this;return e.vertexIndices.forEach((function(d,p){let f,m=!1;d<0&&(d^=-1,m=!0);let g=[],A=[];if(s.push(3*d,3*d+1,3*d+2),e.color){const t=Fc(p,n,d,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[d]&&e.weightTable[d].forEach((function(e){A.push(e.weight),g.push(e.id)})),A.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const e=[0,0,0,0],t=[0,0,0,0];A.forEach((function(n,r){let i=n,s=g[r];t.forEach((function(t,n,r){if(i>t){r[n]=i,i=t;const a=e[n];e[n]=s,s=a}}))})),g=e,A=t}for(;A.length<4;)A.push(0),g.push(0);for(let e=0;e<4;++e)c.push(A[e]),h.push(g[e])}if(e.normal){const t=Fc(p,n,d,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=Fc(p,n,d,e.material)[0]),e.uv&&e.uv.forEach((function(e,t){const r=Fc(p,n,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(r[0]),l[t].push(r[1])})),r++,m&&(u.genFace(t,e,s,f,a,o,l,c,h,r),n++,r=0,s=[],a=[],o=[],l=[],c=[],h=[])})),t}genFace(e,t,n,r,i,s,a,o,l,c){for(let h=2;h<c;h++)e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(h-1)]),e.vertexWeights.push(o[4*(h-1)+1]),e.vertexWeights.push(o[4*(h-1)+2]),e.vertexWeights.push(o[4*(h-1)+3]),e.vertexWeights.push(o[4*h]),e.vertexWeights.push(o[4*h+1]),e.vertexWeights.push(o[4*h+2]),e.vertexWeights.push(o[4*h+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(h-1)]),e.weightsIndices.push(l[4*(h-1)+1]),e.weightsIndices.push(l[4*(h-1)+2]),e.weightsIndices.push(l[4*(h-1)+3]),e.weightsIndices.push(l[4*h]),e.weightsIndices.push(l[4*h+1]),e.weightsIndices.push(l[4*h+2]),e.weightsIndices.push(l[4*h+3])),t.color&&(e.colors.push(s[0]),e.colors.push(s[1]),e.colors.push(s[2]),e.colors.push(s[3*(h-1)]),e.colors.push(s[3*(h-1)+1]),e.colors.push(s[3*(h-1)+2]),e.colors.push(s[3*h]),e.colors.push(s[3*h+1]),e.colors.push(s[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(i[0]),e.normal.push(i[1]),e.normal.push(i[2]),e.normal.push(i[3*(h-1)]),e.normal.push(i[3*(h-1)+1]),e.normal.push(i[3*(h-1)+2]),e.normal.push(i[3*h]),e.normal.push(i[3*h+1]),e.normal.push(i[3*h+2])),t.uv&&t.uv.forEach((function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(a[n][0]),e.uvs[n].push(a[n][1]),e.uvs[n].push(a[n][2*(h-1)]),e.uvs[n].push(a[n][2*(h-1)+1]),e.uvs[n].push(a[n][2*h]),e.uvs[n].push(a[n][2*h+1])}))}addMorphTargets(e,t,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const s=bc.Objects.Geometry[n.geoID];void 0!==s&&i.genMorphGeometry(e,t,s,r,n.name)}))}))}genMorphGeometry(e,t,n,r,i){const s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],o=void 0!==n.Vertices?n.Vertices.a:[],l=void 0!==n.Indexes?n.Indexes.a:[],c=3*e.attributes.position.count,h=new Float32Array(c);for(let a=0;a<l.length;a++){const e=3*l[a];h[e]=o[3*a],h[e+1]=o[3*a+1],h[e+2]=o[3*a+2]}const u={vertexIndices:s,vertexPositions:h},d=this.genBuffers(u),p=new a.Float32BufferAttribute(d.vertex,3);p.name=i||n.attrName,p.applyMatrix4(r),e.morphAttributes.position.push(p)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let i=[];return"IndexToDirect"===n&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:i,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let i=[];return"IndexToDirect"===n&&(i=e.UVIndex.a),{dataSize:2,buffer:r,indices:i,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let i=[];return"IndexToDirect"===n&&(i=e.ColorIndex.a),{dataSize:4,buffer:r,indices:i,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,i=[];for(let s=0;s<r.length;++s)i.push(s);return{dataSize:1,buffer:r,indices:i,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===xc)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new a.BufferGeometry;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new a.BufferGeometry;const n=t-1,r=e.KnotVector.a,i=[],s=e.Points.a;for(let h=0,u=s.length;h<u;h+=4)i.push((new a.Vector4).fromArray(s,h));let o,l;if("Closed"===e.Form)i.push(i[0]);else if("Periodic"===e.Form){o=n,l=r.length-1-o;for(let e=0;e<n;++e)i.push(i[e])}const c=new xc(n,r,i,o,l).getPoints(12*i.length);return(new a.BufferGeometry).setFromPoints(c)}}class Cc{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const r=t[n],i=this.addClip(r);e.push(i)}return e}parseClips(){if(void 0===bc.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=bc.Objects.AnimationCurveNode,t=new Map;for(const n in e){const r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=bc.Objects.AnimationCurve;for(const n in t){const r={id:t[n].id,times:t[n].KeyTime.a.map(Dc),values:t[n].KeyValueFloat.a},i=Ec.get(r.id);if(void 0!==i){const t=i.parents[0].ID,n=i.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=r:n.match(/Y/)?e.get(t).curves.y=r:n.match(/Z/)?e.get(t).curves.z=r:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=r)}}}parseAnimationLayers(e){const t=bc.Objects.AnimationLayer,n=new Map;for(const r in t){const t=[],i=Ec.get(parseInt(r));if(void 0!==i){i.children.forEach((function(n,r){if(e.has(n.ID)){const i=e.get(n.ID);if(void 0!==i.curves.x||void 0!==i.curves.y||void 0!==i.curves.z){if(void 0===t[r]){const e=Ec.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const i=bc.Objects.Model[e.toString()];if(void 0===i)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const s={modelName:i.attrName?a.PropertyBinding.sanitizeNodeName(i.attrName):"",ID:i.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};_c.traverse((function(e){e.ID===i.id&&(s.transform=e.matrix,e.userData.transformData&&(s.eulerOrder=e.userData.transformData.eulerOrder))})),s.transform||(s.transform=new a.Matrix4),"PreRotation"in i&&(s.preRotation=i.PreRotation.value),"PostRotation"in i&&(s.postRotation=i.PostRotation.value),t[r]=s}}t[r]&&(t[r][i.attr]=i)}else if(void 0!==i.curves.morph){if(void 0===t[r]){const e=Ec.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,i=Ec.get(e).parents[0].ID,s=Ec.get(i).parents[0].ID,o=Ec.get(s).parents[0].ID,l=bc.Objects.Model[o],c={modelName:l.attrName?a.PropertyBinding.sanitizeNodeName(l.attrName):"",morphName:bc.Objects.Deformer[e].attrName};t[r]=c}t[r][i.attr]=i}}})),n.set(parseInt(r),t)}}return n}parseAnimStacks(e){const t=bc.Objects.AnimationStack,n={};for(const r in t){const i=Ec.get(parseInt(r)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=e.get(i[0].ID);n[r]={name:t[r].attrName,layer:s}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new a.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let n=new a.Vector3,r=new a.Quaternion,i=new a.Vector3;if(e.transform&&e.transform.decompose(n,r,i),n=n.toArray(),r=(new a.Euler).setFromQuaternion(r,e.eulerOrder).toArray(),i=i.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,r,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,r){const i=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(i,t,n);return new a.VectorKeyframeTrack(e+"."+r,i,s)}generateRotationTrack(e,t,n,r,i,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(a.MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(a.MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(a.MathUtils.degToRad));const o=this.getTimesForAllAxes(t),l=this.getKeyframeTrackValues(o,t,n);void 0!==r&&((r=r.map(a.MathUtils.degToRad)).push(s),r=(new a.Euler).fromArray(r),r=(new a.Quaternion).setFromEuler(r)),void 0!==i&&((i=i.map(a.MathUtils.degToRad)).push(s),i=(new a.Euler).fromArray(i),i=(new a.Quaternion).setFromEuler(i).invert());const c=new a.Quaternion,h=new a.Euler,u=[];for(let a=0;a<l.length;a+=3)h.set(l[a],l[a+1],l[a+2],s),c.setFromEuler(h),void 0!==r&&c.premultiply(r),void 0!==i&&c.multiply(i),c.toArray(u,a/3*4);return new a.QuaternionKeyframeTrack(e+".quaternion",o,u)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map((function(e){return e/100})),r=_c.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new a.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+r+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let r=1;r<t.length;r++){const i=t[r];i!==n&&(t[e]=i,n=i,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,n){const r=n,i=[];let s=-1,a=-1,o=-1;return e.forEach((function(e){if(t.x&&(s=t.x.times.indexOf(e)),t.y&&(a=t.y.times.indexOf(e)),t.z&&(o=t.z.times.indexOf(e)),-1!==s){const e=t.x.values[s];i.push(e),r[0]=e}else i.push(r[0]);if(-1!==a){const e=t.y.values[a];i.push(e),r[1]=e}else i.push(r[1]);if(-1!==o){const e=t.z.values[o];i.push(e),r[2]=e}else i.push(r[2])})),i}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const n=e.values[t-1],r=e.values[t]-n,i=Math.abs(r);if(i>=180){const s=i/180,a=r/s;let o=n+a;const l=e.times[t-1],c=(e.times[t]-l)/s;let h=l+c;const u=[],d=[];for(;h<e.times[t];)u.push(h),h+=c,d.push(o),o+=a;e.times=Qc(e.times,t,u),e.values=Qc(e.values,t,d)}}}}class Tc{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new Rc,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach((function(e,r){const i=e.match(/^[\s\t]*;/),s=e.match(/^[\s\t]*$/);if(i||s)return;const a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,n[++r]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),i={name:n},s=this.parseNodeAttr(r),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,i):n in a?("PoseNode"===n?a.PoseNode.push(i):void 0!==a[n].id&&(a[n]={},a[n][a[n].id]=a[n]),""!==s.id&&(a[n][s.id]=i)):"number"==typeof s.id?(a[n]={},a[n][s.id]=i):"Properties70"!==n&&(a[n]="PoseNode"===n?[i]:i),"number"==typeof s.id&&(i.id=s.id),""!==s.name&&(i.attrName=s.name),""!==s.type&&(i.attrType=s.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===i&&(i=n.replace(/"/g,"").replace(/,$/,"").trim());const s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===r){const e=i.split(",").slice(1),t=parseInt(e[0]),n=parseInt(e[1]);let a=i.split(",").slice(3);a=a.map((function(e){return e.trim().replace(/^"/,"")})),r="connections",i=[t,n],function(e,t){for(let n=0,r=e.length,i=t.length;n<i;n++,r++)e[r]=t[n]}(i,a),void 0===s[r]&&(s[r]=[])}"Node"===r&&(s.id=i),r in s&&Array.isArray(s[r])?s[r].push(i):"a"!==r?s[r]=i:s.a=i,this.setCurrentProp(s,r),"a"===r&&","!==i.slice(-1)&&(s.a=Gc(i))}else this.parseNodeSpecialProperty(e,r,i)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=Gc(t.a))}parseNodeSpecialProperty(e,t,n){const r=n.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),i=r[0],s=r[1],a=r[2],o=r[3];let l=r[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=Gc(l)}this.getPrevNode()[i]={type:s,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class Ic{parse(e){const t=new Bc(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new Rc;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const s=e.getUint8(),a=e.getString(s);if(0===r)return null;const o=[];for(let u=0;u<i;u++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",h=o.length>2?o[2]:"";for(n.singleProperty=1===i&&e.getOffset()===r;r>e.getOffset();){const r=this.parseNode(e,t);null!==r&&this.parseSubNode(a,n,r)}return n.propertyList=o,"number"==typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==h&&(n.attrType=h),""!==a&&(n.name=a),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];Array.isArray(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){const e=[];n.propertyList.forEach((function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name){Object.keys(n).forEach((function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],r=n.propertyList[1];const i=n.propertyList[2],s=n.propertyList[3];let a;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),a="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===r.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:r,type2:i,flag:s,value:a}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=e.getUint32(),i=e.getUint32(),s=e.getUint32();if(0===i)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}const a=fc(new Uint8Array(e.getArrayBuffer(s))),o=new Bc(a.buffer);switch(t){case"b":case"c":return o.getBooleanArray(r);case"d":return o.getFloat64Array(r);case"f":return o.getFloat32Array(r);case"i":return o.getInt32Array(r);case"l":return o.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class Bc{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let r=0;r<e;r++)t[r]=this.getUint8();const n=t.indexOf(0);return n>=0&&(t=t.slice(0,n)),a.LoaderUtils.decodeText(new Uint8Array(t))}}class Rc{add(e,t){this[e]=t}}function Pc(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return parseInt(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Dc(e){return e/46186158e3}const Lc=[];function Fc(e,t,n,r){let i;switch(r.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=n;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(i=r.indices[i]);const s=i*r.dataSize,a=s+r.dataSize;return function(e,t,n,r){for(let i=n,s=0;i<r;i++,s++)e[s]=t[i];return e}(Lc,r.buffer,s,a)}const Uc=new a.Euler,Oc=new a.Vector3;function Nc(e){const t=new a.Matrix4,n=new a.Matrix4,r=new a.Matrix4,i=new a.Matrix4,s=new a.Matrix4,o=new a.Matrix4,l=new a.Matrix4,c=new a.Matrix4,h=new a.Matrix4,u=new a.Matrix4,d=new a.Matrix4,p=new a.Matrix4,f=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(Oc.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(a.MathUtils.degToRad);t.push(e.eulerOrder),n.makeRotationFromEuler(Uc.fromArray(t))}if(e.rotation){const t=e.rotation.map(a.MathUtils.degToRad);t.push(e.eulerOrder),r.makeRotationFromEuler(Uc.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(a.MathUtils.degToRad);t.push(e.eulerOrder),i.makeRotationFromEuler(Uc.fromArray(t)),i.invert()}e.scale&&s.scale(Oc.fromArray(e.scale)),e.scalingOffset&&l.setPosition(Oc.fromArray(e.scalingOffset)),e.scalingPivot&&o.setPosition(Oc.fromArray(e.scalingPivot)),e.rotationOffset&&c.setPosition(Oc.fromArray(e.rotationOffset)),e.rotationPivot&&h.setPosition(Oc.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(d.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));const m=n.clone().multiply(r).multiply(i),g=new a.Matrix4;g.extractRotation(u);const A=new a.Matrix4;A.copyPosition(u);const v=A.clone().invert().multiply(u),y=g.clone().invert().multiply(v),x=s,b=new a.Matrix4;if(0===f)b.copy(g).multiply(m).multiply(y).multiply(x);else if(1===f)b.copy(g).multiply(y).multiply(m).multiply(x);else{const e=(new a.Matrix4).scale((new a.Vector3).setFromMatrixScale(d)).clone().invert(),t=y.clone().multiply(e);b.copy(g).multiply(m).multiply(t).multiply(x)}const E=h.clone().invert(),_=o.clone().invert();let S=t.clone().multiply(c).multiply(h).multiply(n).multiply(r).multiply(i).multiply(E).multiply(l).multiply(o).multiply(s).multiply(_);const w=(new a.Matrix4).copyPosition(S),M=u.clone().multiply(w);return p.copyPosition(M),S=p.clone().multiply(b),S.premultiply(u.invert()),S}function kc(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function Gc(e){return e.split(",").map((function(e){return parseFloat(e)}))}function zc(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),a.LoaderUtils.decodeText(new Uint8Array(e,t,n))}function Qc(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}function Vc(e){return(0,o.useLoader)(Sc,e)}Vc.preload=e=>o.useLoader.preload(Sc,e),Vc.clear=e=>o.useLoader.clear(Sc,e);const Hc=new WeakMap;class jc extends a.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new a.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const o in t.attributeTypes){const e=t.attributeTypes[o];void 0!==e.BYTES_PER_ELEMENT&&(t.attributeTypes[o]=e.name)}const n=JSON.stringify(t);if(Hc.has(e)){const t=Hc.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,s=e.byteLength,a=this._getWorker(i,s).then((n=>(r=n,new Promise(((n,s)=>{r._callbacks[i]={resolve:n,reject:s},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return a.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),Hc.set(e,{key:n,promise:a}),a}_createGeometry(e){const t=new a.BufferGeometry;e.index&&t.setIndex(new a.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,s=r.array,o=r.itemSize;t.setAttribute(i,new a.BufferAttribute(s,o))}return t}_loadLibrary(e,t){const n=new a.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=Wc.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function Wc(){let e,t;function n(e,t,n,r,i,s){const a=s.num_components(),o=n.num_points()*a,l=o*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),h=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,s,c,l,h);const u=new i(e.HEAPF32.buffer,h,o).slice();return e._free(h),{name:r,array:u,itemSize:a}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,s=i.taskConfig;t.then((e=>{const t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const s=i.attributeIDs,a=i.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(r,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const u in s){const r=self[a[u]];let l,c;if(i.useUniqueIDs)c=s[u],l=t.GetAttributeByUniqueId(o,c);else{if(c=t.GetAttributeId(o,e[s[u]]),-1===c)continue;l=t.GetAttribute(o,c)}h.attributes.push(n(e,t,o,u,r,l))}c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const r=n.num_faces(),i=3*r,s=4*i,a=e._malloc(s);t.GetTrianglesUInt32Array(n,s,a);const o=new Uint32Array(e.HEAPF32.buffer,a,i).slice();return e._free(a),{array:o,itemSize:1}}(e,t,o));return e.destroy(o),h}(t,a,o,s),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(l){console.error(l),self.postMessage({type:"error",id:i.id,error:l.message})}finally{t.destroy(o),t.destroy(a)}}))}}}let Xc;const Yc=()=>{if(Xc)return Xc;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n,r="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(e)&&(r="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const i=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(r),{}).then((e=>{n=e.instance,n.exports.__wasm_call_ctors()}));function s(e,t,r,i,s,a){const o=n.exports.sbrk,l=r+3&-4,c=o(l*i),h=o(s.length),u=new Uint8Array(n.exports.memory.buffer);u.set(s,h);const d=e(c,r,i,h,s.length);if(0===d&&a&&a(c,l,i),t.set(u.subarray(c,c+r*i)),o(c-o(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}const a={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},o={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return Xc={ready:i,supported:!0,decodeVertexBuffer(e,t,r,i,o){s(n.exports.meshopt_decodeVertexBuffer,e,t,r,i,n.exports[a[o]])},decodeIndexBuffer(e,t,r,i){s(n.exports.meshopt_decodeIndexBuffer,e,t,r,i)},decodeIndexSequence(e,t,r,i){s(n.exports.meshopt_decodeIndexSequence,e,t,r,i)},decodeGltfBuffer(e,t,r,i,l,c){s(n.exports[o[l]],e,t,r,i,n.exports[a[c]])}},Xc};function qc(e,t){if(t===a.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===a.TriangleFanDrawMode||t===a.TriangleStripDrawMode){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(n)if(t===a.TriangleFanDrawMode)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(i),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}const Kc=parseInt(a.REVISION.replace(/\D+/g,""));class Jc extends a.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new rh(e)})),this.register((function(e){return new uh(e)})),this.register((function(e){return new dh(e)})),this.register((function(e){return new ph(e)})),this.register((function(e){return new sh(e)})),this.register((function(e){return new ah(e)})),this.register((function(e){return new oh(e)})),this.register((function(e){return new lh(e)})),this.register((function(e){return new nh(e)})),this.register((function(e){return new ch(e)})),this.register((function(e){return new ih(e)})),this.register((function(e){return new hh(e)})),this.register((function(e){return new eh(e)})),this.register((function(e){return new fh(e)})),this.register((function(e){return new mh(e)}))}load(e,t,n,r){const i=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:a.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},l=new a.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(function(n){try{i.parse(n,s,(function(n){t(n),i.manager.itemEnd(e)}),o)}catch(za){o(za)}}),n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const s={},o={};if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4)))===gh){try{s[$c.KHR_BINARY_GLTF]=new yh(e)}catch(c){return void(r&&r(c))}i=JSON.parse(s[$c.KHR_BINARY_GLTF].content)}else i=JSON.parse(a.LoaderUtils.decodeText(new Uint8Array(e)))}else i=e;if(void 0===i.asset||i.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new Hh(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let a=0;a<this.pluginCallbacks.length;a++){const e=this.pluginCallbacks[a](l);o[e.name]=e,s[e.name]=!0}if(i.extensionsUsed)for(let a=0;a<i.extensionsUsed.length;++a){const e=i.extensionsUsed[a],t=i.extensionsRequired||[];switch(e){case $c.KHR_MATERIALS_UNLIT:s[e]=new th;break;case $c.KHR_DRACO_MESH_COMPRESSION:s[e]=new xh(i,this.dracoLoader);break;case $c.KHR_TEXTURE_TRANSFORM:s[e]=new bh;break;case $c.KHR_MESH_QUANTIZATION:s[e]=new Eh;break;default:t.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function Zc(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const $c={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class eh{constructor(e){this.parser=e,this.name=$c.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,s=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let o;const l=new a.Color(16777215);void 0!==s.color&&l.fromArray(s.color);const c=void 0!==s.range?s.range:0;switch(s.type){case"directional":o=new a.DirectionalLight(l),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new a.PointLight(l),o.distance=c;break;case"spot":o=new a.SpotLight(l),o.distance=c,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,o.angle=s.spot.outerConeAngle,o.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return o.position.set(0,0,0),o.decay=2,Nh(o,s),void 0!==s.intensity&&(o.intensity=s.intensity),o.name=t.createUniqueName(s.name||"light_"+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class th{constructor(){this.name=$c.KHR_MATERIALS_UNLIT}getMaterialType(){return a.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new a.Color(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,3001))}return Promise.all(r)}}class nh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class rh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new a.Vector2(e,e)}return Promise.all(i)}}class ih{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(i)}}class sh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new a.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];return void 0!==s.sheenColorFactor&&t.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,3001)),void 0!==s.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(i)}}class ah{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(i)}}class oh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return t.attenuationColor=new a.Color(o[0],o[1],o[2]),Promise.all(i)}}class lh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class ch{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return t.specularColor=new a.Color(o[0],o[1],o[2]),void 0!==s.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,3001)),Promise.all(i)}}class hh{constructor(e){this.parser=e,this.name=$c.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.anisotropyStrength&&(t.anisotropy=s.anisotropyStrength),void 0!==s.anisotropyRotation&&(t.anisotropyRotation=s.anisotropyRotation),void 0!==s.anisotropyTexture&&i.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(i)}}class uh{constructor(e){this.parser=e,this.name=$c.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class dh{constructor(e){this.parser=e,this.name=$c.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],a=r.images[s.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class ph{constructor(e){this.parser=e,this.name=$c.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],a=r.images[s.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class fh{constructor(e){this.name=$c.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,s=e.count,a=e.byteStride,o=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,a,o,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*a);return i.decodeGltfBuffer(new Uint8Array(t),s,a,o,e.mode,e.filter),t}))}))}return null}}class mh{constructor(e){this.name=$c.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==Mh.TRIANGLES&&a.mode!==Mh.TRIANGLE_STRIP&&a.mode!==Mh.TRIANGLE_FAN&&void 0!==a.mode)return null;const i=n.extensions[this.name].attributes,s=[],o={};for(const a in i)s.push(this.parser.getDependency("accessor",i[a]).then((e=>(o[a]=e,o[a]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(const s of n){const e=new a.Matrix4,t=new a.Vector3,n=new a.Quaternion,l=new a.Vector3(1,1,1),c=new a.InstancedMesh(s.geometry,s.material,r);for(let i=0;i<r;i++)o.TRANSLATION&&t.fromBufferAttribute(o.TRANSLATION,i),o.ROTATION&&n.fromBufferAttribute(o.ROTATION,i),o.SCALE&&l.fromBufferAttribute(o.SCALE,i),c.setMatrixAt(i,e.compose(t,n,l));for(const r in o)"TRANSLATION"!==r&&"ROTATION"!==r&&"SCALE"!==r&&s.geometry.setAttribute(r,o[r]);a.Object3D.prototype.copy.call(c,s),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]})))}}const gh="glTF",Ah=1313821514,vh=5130562;class yh{constructor(e){this.name=$c.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==gh)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===Ah){const n=new Uint8Array(e,12+i,t);this.content=a.LoaderUtils.decodeText(n)}else if(n===vh){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class xh{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=$c.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,a={},o={},l={};for(const c in s){const e=Rh[c]||c.toLowerCase();a[e]=s[c]}for(const c in e.attributes){const t=Rh[c]||c.toLowerCase();if(void 0!==s[c]){const r=n.accessors[e.attributes[c]],i=Ch[r.componentType];l[t]=i.name,o[t]=!0===r.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=o[t];void 0!==r&&(n.normalized=r)}t(e)}),a,l)}))}))}}class bh{constructor(){this.name=$c.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class Eh{constructor(){this.name=$c.KHR_MESH_QUANTIZATION}}class _h extends a.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[i+s];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=r-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,A=1-m,v=g-u+h;for(let y=0;y!==a;y++){const e=s[f+y+a],t=s[f+y+o]*c,n=s[p+y+a],r=s[p+y]*c;i[y]=A*e+v*t+m*n+g*r}return i}}const Sh=new a.Quaternion;class wh extends _h{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return Sh.fromArray(i).normalize().toArray(i),i}}const Mh={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Ch={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Th={9728:a.NearestFilter,9729:a.LinearFilter,9984:a.NearestMipmapNearestFilter,9985:a.LinearMipmapNearestFilter,9986:a.NearestMipmapLinearFilter,9987:a.LinearMipmapLinearFilter},Ih={33071:a.ClampToEdgeWrapping,33648:a.MirroredRepeatWrapping,10497:a.RepeatWrapping},Bh={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rh={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...Kc>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Ph={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Dh={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},Lh="OPAQUE",Fh="MASK",Uh="BLEND";function Oh(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Nh(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function kh(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Gh(e){let t;const n=e.extensions&&e.extensions[$c.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+zh(n.attributes):e.indices+":"+zh(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,i=e.targets.length;r<i;r++)t+=":"+zh(e.targets[r]);return t}function zh(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function Qh(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const Vh=new a.Matrix4;class Hh{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Zc,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,i=-1;"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(n=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=navigator.userAgent.indexOf("Firefox")>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||n||r&&i<98?this.textureLoader=new a.TextureLoader(this.options.manager):this.textureLoader=new a.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const s={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Oh(i,s,r),Nh(s,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,i=t.length;r<i;r++){const n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let r=0,i=e.length;r<i;r++){const t=e[r];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(n[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[r,s]of e.children.entries())i(s,t.children[r])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne((function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)})),!r)throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[$c.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load(a.LoaderUtils.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){const e=Bh[r.type],t=Ch[r.componentType],n=!0===r.normalized,i=new t(r.count*e);return Promise.resolve(new a.BufferAttribute(i,e,n))}const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],s=Bh[r.type],o=Ch[r.componentType],l=o.BYTES_PER_ELEMENT,c=l*s,h=r.byteOffset||0,u=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let p,f;if(u&&u!==c){const e=Math.floor(h/u),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let c=t.cache.get(n);c||(p=new o(i,e*u,r.count*u/l),c=new a.InterleavedBuffer(p,u/l),t.cache.add(n,c)),f=new a.InterleavedBufferAttribute(c,s,h%u/l,d)}else p=null===i?new o(r.count*s):new o(i,h,r.count*s),f=new a.BufferAttribute(p,s,d);if(void 0!==r.sparse){const t=Bh.SCALAR,n=Ch[r.sparse.indices.componentType],l=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,h=new n(e[1],l,r.sparse.count*t),u=new o(e[2],c,r.sparse.count*s);null!==i&&(f=new a.BufferAttribute(f.array.slice(),f.itemSize,f.normalized));for(let e=0,r=h.length;e<r;e++){const t=h[e];if(f.setX(t,u[e*s]),s>=2&&f.setY(t,u[e*s+1]),s>=3&&f.setZ(t,u[e*s+2]),s>=4&&f.setW(t,u[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let s=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){const r=this,i=this.json,s=i.textures[e],o=i.images[t],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=s.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const n=(i.samplers||{})[s.sampler]||{};return t.magFilter=Th[n.magFilter]||a.LinearFilter,t.minFilter=Th[n.minFilter]||a.LinearMipmapLinearFilter,t.wrapS=Ih[n.wrapS]||a.RepeatWrapping,t.wrapT=Ih[n.wrapT]||a.RepeatWrapping,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const n=this,r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=r.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",c=!1;if(void 0!==s.bufferView)l=n.getDependency("bufferView",s.bufferView).then((function(e){c=!0;const t=new Blob([e],{type:s.mimeType});return l=o.createObjectURL(t),l}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then((function(e){return new Promise((function(n,r){let s=n;!0===t.isImageBitmapLoader&&(s=function(e){const t=new a.Texture(e);t.needsUpdate=!0,n(t)}),t.load(a.LoaderUtils.resolveURL(e,i.path),s,void 0,r)}))})).then((function(e){var t;return!0===c&&o.revokeObjectURL(l),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),e}));return this.sourceCache[e]=h,h}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(s){if(!s)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((s=s.clone()).channel=n.texCoord),i.extensions[$c.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[$c.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[$c.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==r&&("colorSpace"in s?s.colorSpace=3001===r?"srgb":"srgb-linear":s.encoding=r),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new a.PointsMaterial,a.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new a.LineBasicMaterial,a.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||s){let e="ClonedMaterial:"+n.uuid+":";r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),s&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return a.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let s;const o={},l=[];if((i.extensions||{})[$c.KHR_MATERIALS_UNLIT]){const e=r[$c.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else{const n=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(o,"map",n.baseColorTexture,3001)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===i.doubleSided&&(o.side=a.DoubleSide);const c=i.alphaMode||Lh;if(c===Uh?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===Fh&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&s!==a.MeshBasicMaterial&&(l.push(t.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&s!==a.MeshBasicMaterial&&(l.push(t.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&s!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&s!==a.MeshBasicMaterial&&l.push(t.assignTexture(o,"emissiveMap",i.emissiveTexture,3001)),Promise.all(l).then((function(){const n=new s(o);return i.name&&(n.name=i.name),Nh(n,i),t.associations.set(n,{materials:e}),i.extensions&&Oh(r,n,i),n}))}createUniqueName(e){const t=a.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[$c.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return jh(n,e,t)}))}const s=[];for(let o=0,l=e.length;o<l;o++){const n=e[o],l=Gh(n),c=r[l];if(c)s.push(c.promise);else{let e;e=n.extensions&&n.extensions[$c.KHR_DRACO_MESH_COMPRESSION]?i(n):jh(new a.BufferGeometry,n,t),r[l]={primitive:n,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],s=i.primitives,o=[];for(let c=0,h=s.length;c<h;c++){const e=void 0===s[c].material?(void 0===(l=this.cache).DefaultMaterial&&(l.DefaultMaterial=new a.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:a.FrontSide})),l.DefaultMaterial):this.getDependency("material",s[c].material);o.push(e)}var l;return o.push(t.loadGeometries(s)),Promise.all(o).then((function(n){const o=n.slice(0,n.length-1),l=n[n.length-1],c=[];for(let u=0,d=l.length;u<d;u++){const n=l[u],h=s[u];let d;const p=o[u];if(h.mode===Mh.TRIANGLES||h.mode===Mh.TRIANGLE_STRIP||h.mode===Mh.TRIANGLE_FAN||void 0===h.mode)d=!0===i.isSkinnedMesh?new a.SkinnedMesh(n,p):new a.Mesh(n,p),!0===d.isSkinnedMesh&&d.normalizeSkinWeights(),h.mode===Mh.TRIANGLE_STRIP?d.geometry=qc(d.geometry,a.TriangleStripDrawMode):h.mode===Mh.TRIANGLE_FAN&&(d.geometry=qc(d.geometry,a.TriangleFanDrawMode));else if(h.mode===Mh.LINES)d=new a.LineSegments(n,p);else if(h.mode===Mh.LINE_STRIP)d=new a.Line(n,p);else if(h.mode===Mh.LINE_LOOP)d=new a.LineLoop(n,p);else{if(h.mode!==Mh.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new a.Points(n,p)}Object.keys(d.geometry.morphAttributes).length>0&&kh(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),Nh(d,i),h.extensions&&Oh(r,d,h),t.assignFinalMaterial(d),c.push(d)}for(let r=0,i=c.length;r<i;r++)t.associations.set(c[r],{meshes:e,primitives:r});if(1===c.length)return i.extensions&&Oh(r,c[0],i),c[0];const h=new a.Group;i.extensions&&Oh(r,h,i),t.associations.set(h,{meshes:e});for(let e=0,t=c.length;e<t;e++)h.add(c[e]);return h}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new a.PerspectiveCamera(a.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new a.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Nh(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,i=t.joints.length;r<i;r++)n.push(this._loadNodeShallow(t.joints[r]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then((function(e){const n=e.pop(),r=e,i=[],s=[];for(let o=0,l=r.length;o<l;o++){const e=r[o];if(e){i.push(e);const t=new a.Matrix4;null!==n&&t.fromArray(n.array,16*o),s.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}return new a.Skeleton(i,s)}))}loadAnimation(e){const t=this.json.animations[e],n=t.name?t.name:"animation_"+e,r=[],i=[],s=[],o=[],l=[];for(let a=0,c=t.channels.length;a<c;a++){const e=t.channels[a],n=t.samplers[e.sampler],c=e.target,h=c.node,u=void 0!==t.parameters?t.parameters[n.input]:n.input,d=void 0!==t.parameters?t.parameters[n.output]:n.output;void 0!==c.node&&(r.push(this.getDependency("node",h)),i.push(this.getDependency("accessor",u)),s.push(this.getDependency("accessor",d)),o.push(n),l.push(c))}return Promise.all([Promise.all(r),Promise.all(i),Promise.all(s),Promise.all(o),Promise.all(l)]).then((function(e){const t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],l=[];for(let n=0,c=t.length;n<c;n++){const e=t[n],c=r[n],h=i[n],u=s[n],d=o[n];if(void 0===e)continue;let p;switch(e.updateMatrix(),Ph[d.path]){case Ph.weights:p=a.NumberKeyframeTrack;break;case Ph.rotation:p=a.QuaternionKeyframeTrack;break;default:p=a.VectorKeyframeTrack}const f=e.name?e.name:e.uuid,m=void 0!==u.interpolation?Dh[u.interpolation]:a.InterpolateLinear,g=[];Ph[d.path]===Ph.weights?e.traverse((function(e){e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)})):g.push(f);let A=h.array;if(h.normalized){const e=Qh(A.constructor),t=new Float32Array(A.length);for(let n=0,r=A.length;n<r;n++)t[n]=A[n]*e;A=t}for(let t=0,n=g.length;t<n;t++){const e=new p(g[t]+"."+Ph[d.path],c.array,A,m);"CUBICSPLINE"===u.interpolation&&(e.createInterpolant=function(e){return new(this instanceof a.QuaternionKeyframeTrack?wh:_h)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(e)}}return new a.AnimationClip(n,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this,n=this.json.nodes[e],r=t._loadNodeShallow(e),i=[],s=n.children||[];for(let o=0,l=s.length;o<l;o++)i.push(t.getDependency("node",s[o]));const a=void 0===n.skin?Promise.resolve(null):t.getDependency("skin",n.skin);return Promise.all([r,Promise.all(i),a]).then((function(e){const t=e[0],n=e[1],r=e[2];null!==r&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(r,Vh)}));for(let i=0,s=n.length;i<s;i++)t.add(n[i]);return t}))}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const i=t.nodes[e],s=i.name?r.createUniqueName(i.name):"",o=[],l=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return l&&o.push(l),void 0!==i.camera&&o.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){o.push(e)})),this.nodeCache[e]=Promise.all(o).then((function(t){let o;if(o=!0===i.isBone?new a.Bone:t.length>1?new a.Group:1===t.length?t[0]:new a.Object3D,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=s),Nh(o,i),i.extensions&&Oh(n,o,i),void 0!==i.matrix){const e=new a.Matrix4;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=e,o})),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,i=new a.Group;n.name&&(i.name=r.createUniqueName(n.name)),Nh(i,n),n.extensions&&Oh(t,i,n);const s=n.nodes||[],o=[];for(let a=0,l=s.length;a<l;a++)o.push(r.getDependency("node",s[a]));return Promise.all(o).then((function(e){for(let t=0,n=e.length;t<n;t++)i.add(e[t]);return r.associations=(e=>{const t=new Map;for(const[n,i]of r.associations)(n instanceof a.Material||n instanceof a.Texture)&&t.set(n,i);return e.traverse((e=>{const n=r.associations.get(e);null!=n&&t.set(e,n)})),t})(i),i}))}}function jh(e,t,n){const r=t.attributes,i=[];function s(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const a in r){const t=Rh[a]||a.toLowerCase();t in e.attributes||i.push(s(r[a],t))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return Nh(e,t),function(e,t,n){const r=t.attributes,i=new a.Box3;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new a.Vector3(t[0],t[1],t[2]),new a.Vector3(s[0],s[1],s[2])),e.normalized){const t=Qh(Ch[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const s=t.targets;if(void 0!==s){const e=new a.Vector3,t=new a.Vector3;for(let r=0,i=s.length;r<i;r++){const i=s[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],s=r.min,a=r.max;if(void 0!==s&&void 0!==a){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(a[2]))),r.normalized){const e=Qh(Ch[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const o=new a.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,s=!1;for(let c=0,h=t.length;c<h;c++){const e=t[c];if(void 0!==e.POSITION&&(r=!0),void 0!==e.NORMAL&&(i=!0),void 0!==e.COLOR_0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(e);const a=[],o=[],l=[];for(let c=0,h=t.length;c<h;c++){const h=t[c];if(r){const t=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position;a.push(t)}if(i){const t=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal;o.push(t)}if(s){const t=void 0!==h.COLOR_0?n.getDependency("accessor",h.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then((function(t){const n=t[0],a=t[1],o=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=a),s&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}let Wh=null;function Xh(e,t,n){return r=>{n&&n(r),e&&(Wh||(Wh=new jc),Wh.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),r.setDRACOLoader(Wh)),t&&r.setMeshoptDecoder("function"==typeof Yc?Yc():Yc)}}function Yh(e,t=!0,n=!0,r){return(0,o.useLoader)(Jc,e,Xh(t,n,r))}Yh.preload=(e,t=!0,n=!0,r)=>o.useLoader.preload(Jc,e,Xh(t,n,r)),Yh.clear=e=>o.useLoader.clear(Jc,e);class qh{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:t,msg:n,transfer:r}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(n,r)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise((n=>{const r=this._getIdleWorker();-1!==r?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})}))}dispose(){this.workers.forEach((e=>e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class Kh{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Jh{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){void 0===t&&(t=0);const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const Zh=[171,75,84,88,32,50,48,187,13,10,26,10];function $h(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}let eu,tu,nu;const ru={env:{emscripten_notify_memory_growth:function(e){nu=new Uint8Array(tu.exports.memory.buffer)}}};class iu{init(){return eu||(eu="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+su).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,ru))).then(this._init):WebAssembly.instantiate(Buffer.from(su,"base64"),ru).then(this._init),eu)}_init(e){tu=e.instance,ru.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!tu)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=tu.exports.malloc(n);nu.set(e,r),t=t||Number(tu.exports.ZSTD_findDecompressedSize(r,n));const i=tu.exports.malloc(t),s=tu.exports.ZSTD_decompress(i,t,r,n),a=nu.slice(i,i+s);return tu.exports.free(r),tu.exports.free(i),a}}const su="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";class au extends a.CompressedTexture{constructor(e,t,n,r,i,s){super(e,t,n,i,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=a.ClampToEdgeWrapping}}class ou extends a.Texture{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=a.NearestFilter,this.minFilter=a.NearestFilter,this.wrapR=a.ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}var lu=Object.defineProperty,cu=(e,t,n)=>(((e,t,n)=>{t in e?lu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const hu=new WeakMap;let uu,du=0;const pu=class extends a.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new qh,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new a.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new a.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then((([e,t])=>{const n=pu.BasisWorker.toString(),r=["/* constants */","let _EngineFormat = "+JSON.stringify(pu.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(pu.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(pu.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r])),this.transcoderBinary=t,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),du>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),du++}return this.transcoderPending}load(e,t,n,r){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new a.FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{if(hu.has(e)){return hu.get(e).promise.then(t).catch(r)}this._createTexture(e).then((e=>t?t(e):null)).catch(r)}),n,r)}_createTextureFrom(e,t){const{mipmaps:n,width:r,height:i,format:s,type:o,error:l,dfdTransferFn:c,dfdFlags:h}=e;if("error"===o)return Promise.reject(l);const u=t.layerCount>1?new au(n,r,i,t.layerCount,s,a.UnsignedByteType):new a.CompressedTexture(n,r,i,s,a.UnsignedByteType);return u.minFilter=1===n.length?a.LinearFilter:a.LinearMipmapLinearFilter,u.magFilter=a.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,"colorSpace"in u?u.colorSpace=2===c?"srgb":"srgb-linear":u.encoding=2===c?3001:3e3,u.premultiplyAlpha=!!(1&h),u}async _createTexture(e,t={}){const n=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,Zh.length);if(t[0]!==Zh[0]||t[1]!==Zh[1]||t[2]!==Zh[2]||t[3]!==Zh[3]||t[4]!==Zh[4]||t[5]!==Zh[5]||t[6]!==Zh[6]||t[7]!==Zh[7]||t[8]!==Zh[8]||t[9]!==Zh[9]||t[10]!==Zh[10]||t[11]!==Zh[11])throw new Error("Missing KTX 2.0 identifier.");const n=new Kh,r=17*Uint32Array.BYTES_PER_ELEMENT,i=new Jh(e,Zh.length,r,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const s=i._nextUint32();n.supercompressionScheme=i._nextUint32();const a=i._nextUint32(),o=i._nextUint32(),l=i._nextUint32(),c=i._nextUint32(),h=i._nextUint64(),u=i._nextUint64(),d=new Jh(e,Zh.length+r,3*s*8,!0);for(let D=0;D<s;D++)n.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Jh(e,a,o,!0),f={vendorId:p._skip(4)._nextUint16(),descriptorType:p._nextUint16(),versionNumber:p._nextUint16(),descriptorBlockSize:p._nextUint16(),colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},m=(f.descriptorBlockSize/4-6)/4;for(let D=0;D<m;D++){const e={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&e.channelType?(e.sampleLower=p._nextInt32(),e.sampleUpper=p._nextInt32()):(e.sampleLower=p._nextUint32(),e.sampleUpper=p._nextUint32()),f.samples[D]=e}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(f);const g=new Jh(e,l,c,!0);for(;g._offset<c;){const e=g._nextUint32(),t=g._scan(e),r=$h(t);if(n.keyValue[r]=g._nextUint8Array(e-t.byteLength-1),r.match(/^ktx/i)){const e=$h(n.keyValue[r]);n.keyValue[r]=e.substring(0,e.lastIndexOf("\0"))}const i=e%4?4-e%4:0;g._skip(i)}if(u<=0)return n;const A=new Jh(e,h,u,!0),v=A._nextUint16(),y=A._nextUint16(),x=A._nextUint32(),b=A._nextUint32(),E=A._nextUint32(),_=A._nextUint32(),S=[];for(let D=0;D<s;D++)S.push({imageFlags:A._nextUint32(),rgbSliceByteOffset:A._nextUint32(),rgbSliceByteLength:A._nextUint32(),alphaSliceByteOffset:A._nextUint32(),alphaSliceByteLength:A._nextUint32()});const w=h+A._offset,M=w+x,C=M+b,T=C+E,I=new Uint8Array(e.buffer,e.byteOffset+w,x),B=new Uint8Array(e.buffer,e.byteOffset+M,b),R=new Uint8Array(e.buffer,e.byteOffset+C,E),P=new Uint8Array(e.buffer,e.byteOffset+T,_);return n.globalData={endpointCount:v,selectorCount:y,imageDescs:S,endpointsData:I,selectorsData:B,tablesData:R,extendedData:P},n}(new Uint8Array(e));if(0!==n.vkFormat)return async function(e){const{vkFormat:t,pixelWidth:n,pixelHeight:r,pixelDepth:i}=e;if(void 0===mu[t])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");const s=e.levels[0];let o,l;if(0===e.supercompressionScheme)o=s.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");uu||(uu=new Promise((async e=>{const t=new iu;await t.init(),e(t)}))),o=(await uu).decode(s.levelData,s.uncompressedByteLength)}l=gu[t]===a.FloatType?new Float32Array(o.buffer,o.byteOffset,o.byteLength/Float32Array.BYTES_PER_ELEMENT):gu[t]===a.HalfFloatType?new Uint16Array(o.buffer,o.byteOffset,o.byteLength/Uint16Array.BYTES_PER_ELEMENT):o;const c=0===i?new a.DataTexture(l,n,r):new ou(l,n,r,i);return c.type=gu[t],c.format=mu[t],c.encoding=Au[t]||3e3,c.needsUpdate=!0,Promise.resolve(c)}(n);const r=t,i=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:r},[e]))).then((e=>this._createTextureFrom(e.data,n)));return hu.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),du--,this}};let fu=pu;cu(fu,"BasisFormat",{ETC1S:0,UASTC_4x4:1}),cu(fu,"TranscoderFormat",{ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16}),cu(fu,"EngineFormat",{RGBAFormat:a.RGBAFormat,RGBA_ASTC_4x4_Format:a.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:a.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:a.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:a.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:a.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:a.RGB_ETC1_Format,RGB_ETC2_Format:a.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:a.RGB_S3TC_DXT1_Format}),cu(fu,"BasisWorker",(function(){let e,t,n;const r=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(a){const u=a.data;switch(u.type){case"init":e=u.config,d=u.transcoderBinary,t=new Promise((e=>{n={wasmBinary:d,onRuntimeInitialized:e},BASIS(n)})).then((()=>{n.initializeBasis(),void 0===n.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{width:t,height:a,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g}=function(t){const a=new n.KTX2File(new Uint8Array(t));function u(){a.close(),a.delete()}if(!a.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=a.isUASTC()?s.UASTC_4x4:s.ETC1S,p=a.getWidth(),f=a.getHeight(),m=a.getLayers()||1,g=a.getLevels(),A=a.getHasAlpha(),v=a.getDFDTransferFunc(),y=a.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(t,n,a,h){let u,d;const p=t===s.ETC1S?o:l;for(let r=0;r<p.length;r++){const i=p[r];if(e[i.if]&&(i.basisFormat.includes(t)&&!(h&&i.transcoderFormat.length<2)&&(!i.needsPowerOfTwo||c(n)&&c(a))))return u=i.transcoderFormat[h?1:0],d=i.engineFormat[h?1:0],{transcoderFormat:u,engineFormat:d}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),u=i.RGBA32,d=r.RGBAFormat,{transcoderFormat:u,engineFormat:d}}(d,p,f,A);if(!p||!f||!g)throw u(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!a.startTranscoding())throw u(),new Error("THREE.KTX2Loader: .startTranscoding failed");const E=[];for(let e=0;e<g;e++){const t=[];let n,r;for(let i=0;i<m;i++){const s=a.getImageLevelInfo(e,i,0);n=s.origWidth<4?s.origWidth:s.width,r=s.origHeight<4?s.origHeight:s.height;const o=new Uint8Array(a.getImageTranscodedSizeInBytes(e,i,0,x));if(!a.transcodeImage(o,e,i,0,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");t.push(o)}E.push({data:h(t),width:n,height:r})}return u(),{width:p,height:f,hasAlpha:A,mipmaps:E,format:b,dfdTransferFn:v,dfdFlags:y}}(u.buffer),A=[];for(let e=0;e<p.length;++e)A.push(p[e].data.buffer);self.postMessage({type:"transcode",id:u.id,width:t,height:a,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g},A)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const a=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[r.RGBA_ASTC_4x4_Format,r.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[r.RGBA_BPTC_Format,r.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[r.RGB_S3TC_DXT1_Format,r.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[r.RGB_ETC2_Format,r.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[r.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[r.RGB_PVRTC_4BPPV1_Format,r.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],o=a.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=a.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||0==(e&e-1)&&0!==e}function h(e){let t=0;for(let i=0;i<e.length;i++){t+=e[i].byteLength}const n=new Uint8Array(t);let r=0;for(let i=0;i<e.length;i++){const t=e[i];n.set(t,r),r+=t.byteLength}return n}}));const mu={109:a.RGBAFormat,97:a.RGBAFormat,37:a.RGBAFormat,43:a.RGBAFormat,103:a.RGFormat,83:a.RGFormat,16:a.RGFormat,22:a.RGFormat,100:a.RedFormat,76:a.RedFormat,15:a.RedFormat,9:a.RedFormat},gu={109:a.FloatType,97:a.HalfFloatType,37:a.UnsignedByteType,43:a.UnsignedByteType,103:a.FloatType,83:a.HalfFloatType,16:a.UnsignedByteType,22:a.UnsignedByteType,100:a.FloatType,76:a.HalfFloatType,15:a.UnsignedByteType,9:a.UnsignedByteType},Au={43:3001,22:3001,15:3001};const vu="https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master";function yu(e,t=`${vu}/basis/`){const n=(0,o.useThree)((e=>e.gl)),r=(0,o.useLoader)(fu,Ua(e)?Object.values(e):e,(e=>{e.detectSupport(n),e.setTranscoderPath(t)}));if((0,i.useEffect)((()=>{(Array.isArray(r)?r:[r]).forEach(n.initTexture)}),[n,r]),Ua(e)){const t=Object.keys(e),n={};return t.forEach((e=>Object.assign(n,{[e]:r[t.indexOf(e)]}))),n}return r}yu.preload=(e,t=`${vu}/basis/`)=>o.useLoader.preload(fu,e,(e=>{e.setTranscoderPath(t)})),yu.clear=e=>o.useLoader.clear(fu,e);var xu=n(73466),bu=n.n(xu);function Eu(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function _u({showPanel:e=0,className:t,parent:n}){const r=function(e,t=[],n){const[r,s]=i.useState();return i.useLayoutEffect((()=>{const t=e();return s(t),Eu(n,t),()=>Eu(n,null)}),t),r}((()=>new(bu())),[]);return i.useEffect((()=>{if(r){const i=n&&n.current||document.body;r.showPanel(e),null==i||i.appendChild(r.dom),t&&r.dom.classList.add(...t.split(" ").filter((e=>e)));const s=(0,o.addEffect)((()=>r.begin())),a=(0,o.addAfterEffect)((()=>r.end()));return()=>{null==i||i.removeChild(r.dom),s(),a()}}}),[n,r,t,e]),null}function Su(e,t,n){const{gl:r,size:s}=(0,o.useThree)(),l=i.useMemo((()=>r.getPixelRatio()),[r]),c="number"==typeof e?e:s.width*l,h="number"==typeof t?t:s.height*l,u=("number"==typeof e?n:e)||{},{samples:d,...p}=u,f=i.useMemo((()=>{let e;return e=new a.WebGLRenderTarget(c,h,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,encoding:r.outputEncoding,type:a.HalfFloatType,...p}),e.samples=d,e}),[]);return i.useLayoutEffect((()=>{f.setSize(c,h),d&&(f.samples=d)}),[d,f,c,h]),i.useEffect((()=>()=>f.dispose()),[]),f}function wu({size:e=256,frames:t=1/0}={}){const n=(0,o.useThree)((e=>e.viewport.dpr)),{width:r,height:s}=(0,o.useThree)((e=>e.size)),l=e||r*n,c=e||s*n,h=i.useMemo((()=>{const e=new a.DepthTexture(l,c);return e.format=a.DepthFormat,e.type=a.UnsignedShortType,{depthTexture:e}}),[l,c]);let u=0;const d=Su(l,c,h);return(0,o.useFrame)((e=>{(t===1/0||u<t)&&(e.gl.setRenderTarget(d),e.gl.render(e.scene,e.camera),e.gl.setRenderTarget(null),u++)})),d.depthTexture}function Mu(e,t,n=1){const r=(0,o.useThree)((e=>e.viewport)),i=t*(r.aspect>e/t?r.width/e:r.height/t);return[e*(r.aspect>e/t?r.width/e:r.height/t)*n,i*n,1]}function Cu(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))}const Tu=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function Iu(e){return e.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const Bu="undefined"==typeof window,Ru=(()=>{if(Bu)return;const{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,r=/(iphone|ipod|ipad)/i.test(e),i="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(e)||r||i,isSafari12:/Version\/12.+Safari/.test(e)}})();const Pu=[],Du=[];function Lu(e,t){if(e===t)return 0;const n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s,a=0;for(;a<r&&e.charCodeAt(a)===t.charCodeAt(a);)a++;if(r-=a,i-=a,0===r)return i;let o,l,c=0,h=0,u=0;for(;h<r;)Du[h]=e.charCodeAt(a+h),Pu[h]=++h;for(;u<i;)for(s=t.charCodeAt(a+u),o=u++,c=u,h=0;h<r;h++)l=s===Du[h]?o:o+1,o=Pu[h],c=Pu[h]=o>c?l>c?c+1:l:l>o?o+1:l;return c}function Fu(e){return null!=e}class Uu extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const Ou=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:n={},glContext:r,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:s="https://unpkg.com/detect-gpu@4.0.50/dist/benchmarks"}={})=>Cu(void 0,void 0,void 0,(function*(){const a={};if(Bu)return{tier:0,type:"SSR"};const{isIpad:o=!!(null==Ru?void 0:Ru.isIpad),isMobile:l=!!(null==Ru?void 0:Ru.isMobile),screenSize:c=window.screen,loadBenchmarks:h=(e=>Cu(void 0,void 0,void 0,(function*(){const t=yield fetch(`${s}/${e}`).then((e=>e.json()));if(parseInt(t.shift().split(".")[0],10)<4)throw new Uu("Detect GPU benchmark data is out of date. Please update to version 4x");return t})))}=n;let{renderer:u}=n;const d=(e,t,n,r,i)=>({device:i,fps:r,gpu:n,isMobile:l,tier:e,type:t});let p,f="";if(u)u=Iu(u),p=[u];else{const e=r||function(e,t=!1){const n={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete n.powerPreference;const r=window.document.createElement("canvas"),i=r.getContext("webgl",n)||r.getContext("experimental-webgl",n);return null!=i?i:void 0}(null==Ru?void 0:Ru.isSafari12,i);if(!e)return d(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(u=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!u)return d(1,"FALLBACK");f=u,u=Iu(u),p=function(e,t,n){return"apple gpu"===t?function(e,t,n){if(!n)return[t];const r=function(e){const t=e.createShader(35633),n=e.createShader(35632),r=e.createProgram();if(!(n&&t&&r))return;e.shaderSource(t,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),e.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),e.compileShader(t),e.compileShader(n),e.attachShader(r,t),e.attachShader(r,n),e.linkProgram(r),e.detachShader(r,t),e.detachShader(r,n),e.deleteShader(t),e.deleteShader(n),e.useProgram(r);const i=e.createBuffer();e.bindBuffer(34962,i),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const s=e.getAttribLocation(r,"aPosition");e.vertexAttribPointer(s,3,5126,!1,0,0),e.enableVertexAttribArray(s),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const a=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,a),e.deleteProgram(r),e.deleteBuffer(i),a.join("")}(e),i="801621810",s="8016218135",a="80162181161",o=(null==Ru?void 0:Ru.isIpad)?[["a7",a,12],["a8",s,15],["a8x",s,15],["a9",s,15],["a9x",s,15],["a10",s,15],["a10x",s,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",a,12],["a8",s,12],["a9",s,15],["a10",s,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let l;return"80162181255"===r?l=o.filter((([,,e])=>e>=14)):(l=o.filter((([,e])=>e===r)),l.length||(l=o)),l.map((([e])=>`apple ${e} gpu`))}(e,t,n):[t]}(e,u,l)}const m=(yield Promise.all(p.map((function(e){var t;return Cu(this,void 0,void 0,(function*(){const n=(e=>{const t=l?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const n of t)if(e.includes(n))return n})(e);if(!n)return;const r=`${l?"m":"d"}-${n}${o?"-ipad":""}.json`,i=a[r]=null!==(t=a[r])&&void 0!==t?t:h(r);let s;try{s=yield i}catch(n){if(n instanceof Uu)throw n;return}const u=function(e){var t;const n=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(e);let d=s.filter((([,e])=>e===u));d.length||(d=s.filter((([t])=>t.includes(e))));const p=d.length;if(0===p)return;let f,[m,,,g]=p>1?d.map((t=>[t,Lu(e,t[0])])).sort((([,e],[,t])=>e-t))[0][0]:d[0],A=Number.MAX_VALUE;const{devicePixelRatio:v}=window,y=c.width*v*c.height*v;for(const e of g){const[t,n]=e,r=t*n,i=Math.abs(y-r);i<A&&(A=i,f=e)}if(!f)return;const[,,x,b]=f;return[A,x,m,b]}))})))).filter(Fu).sort((([e=Number.MAX_VALUE,t],[n=Number.MAX_VALUE,r])=>e===n?t-r:e-n));if(!m.length){const e=Tu.find((e=>u.includes(e)));return e?d(0,"BLOCKLISTED",e):d(1,"FALLBACK",`${u} (${f})`)}const[,g,A,v]=m[0];if(-1===g)return d(0,"BLOCKLISTED",A,g,v);const y=l?e:t;let x=0;for(let e=0;e<y.length;e++)g>=y[e]&&(x=e);return d(x,"BENCHMARK",A,g,v)})),Nu=e=>pa((()=>Ou(e)),["useDetectGPU"]);function ku(e,t,...n){const r=i.useRef(),s=(0,o.useThree)((e=>e.scene));return i.useEffect((()=>(e&&t&&null!=e&&e.current&&(r.current=new t(e.current,...n),r.current&&s.add(r.current)),!e&&r.current&&s.remove(r.current),()=>{r.current&&s.remove(r.current)})),[s,t,e,n]),(0,o.useFrame)((()=>{var e;null!=(e=r.current)&&e.update&&r.current.update()})),r}const Gu=new a.Vector3,zu=new a.Vector3,Qu=new a.Vector3,Vu=new a.Vector2,Hu=new a.Vector2,ju=new a.Vector2,Wu=new a.Vector3;function Xu(e,t,n,r,i,s,o){Gu.fromBufferAttribute(t,r),zu.fromBufferAttribute(t,i),Qu.fromBufferAttribute(t,s);const l=function(e,t,n,r,i,s){let o;return o=s===a.BackSide?e.intersectTriangle(r,n,t,!0,i):e.intersectTriangle(t,n,r,s!==a.DoubleSide,i),null===o?null:{distance:e.origin.distanceTo(i),point:i.clone()}}(e,Gu,zu,Qu,Wu,o);if(l){n&&(Vu.fromBufferAttribute(n,r),Hu.fromBufferAttribute(n,i),ju.fromBufferAttribute(n,s),l.uv=a.Triangle.getUV(Wu,Gu,zu,Qu,Vu,Hu,ju,new a.Vector2));const e={a:r,b:i,c:s,normal:new a.Vector3,materialIndex:0};a.Triangle.getNormal(Gu,zu,Qu,e.normal),l.face=e,l.faceIndex=r}return l}function Yu(e,t,n,r,i){const s=3*r,a=e.index.getX(s),o=e.index.getX(s+1),l=e.index.getX(s+2),c=Xu(n,e.attributes.position,e.attributes.uv,a,o,l,t);return c?(c.faceIndex=r,i&&i.push(c),c):null}function qu(e,t,n){return null===e?null:(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(n.ray.origin),e.object=t,e.distance<n.near||e.distance>n.far?null:e)}const Ku=0,Ju=1,Zu=2,$u=1.25,ed=1,td=65535,nd=Math.pow(2,-24);class rd{constructor(){}}function id(e,t,n){return n.min.x=t[e],n.min.y=t[e+1],n.min.z=t[e+2],n.max.x=t[e+3],n.max.y=t[e+4],n.max.z=t[e+5],n}function sd(e){let t=-1,n=-1/0;for(let r=0;r<3;r++){const i=e[r+3]-e[r];i>n&&(n=i,t=r)}return t}function ad(e,t){t.set(e)}function od(e,t,n){let r,i;for(let s=0;s<3;s++){const a=s+3;r=e[s],i=t[s],n[s]=r<i?r:i,r=e[a],i=t[a],n[a]=r>i?r:i}}function ld(e,t,n){for(let r=0;r<3;r++){const i=t[e+2*r],s=t[e+2*r+1],a=i-s,o=i+s;a<n[r]&&(n[r]=a),o>n[r+3]&&(n[r+3]=o)}}function cd(e){const t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2];return 2*(t*n+n*r+r*t)}function hd(e,t,n,r,i=null){let s=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0,u=1/0,d=1/0,p=1/0,f=-1/0,m=-1/0,g=-1/0;const A=null!==i;for(let v=6*t,y=6*(t+n);v<y;v+=6){const t=e[v+0],n=e[v+1],r=t-n,i=t+n;r<s&&(s=r),i>l&&(l=i),A&&t<u&&(u=t),A&&t>f&&(f=t);const y=e[v+2],x=e[v+3],b=y-x,E=y+x;b<a&&(a=b),E>c&&(c=E),A&&y<d&&(d=y),A&&y>m&&(m=y);const _=e[v+4],S=e[v+5],w=_-S,M=_+S;w<o&&(o=w),M>h&&(h=M),A&&_<p&&(p=_),A&&_>g&&(g=_)}r[0]=s,r[1]=a,r[2]=o,r[3]=l,r[4]=c,r[5]=h,A&&(i[0]=u,i[1]=d,i[2]=p,i[3]=f,i[4]=m,i[5]=g)}const ud=32,dd=(e,t)=>e.candidate-t.candidate,pd=new Array(ud).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),fd=new Float32Array(6);function md(e,t){function n(e){p&&p(e/f)}function r(t,i,a,p=null,f=0){if(!m&&f>=c&&(m=!0,h&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),a<=u||f>=c)return n(i+a),t.offset=i,t.count=a,t;const g=function(e,t,n,r,i,s){let a=-1,o=0;if(s===Ku)a=sd(t),-1!==a&&(o=(t[a]+t[a+3])/2);else if(s===Ju)a=sd(e),-1!==a&&(o=function(e,t,n,r){let i=0;for(let s=t,a=t+n;s<a;s++)i+=e[6*s+2*r];return i/n}(n,r,i,a));else if(s===Zu){const s=cd(e);let l=$u*i;const c=6*r,h=6*(r+i);for(let e=0;e<3;e++){const r=t[e],u=(t[e+3]-r)/ud;if(i<ud/4){const t=[...pd];t.length=i;let r=0;for(let i=c;i<h;i+=6,r++){const s=t[r];s.candidate=n[i+2*e],s.count=0;const{bounds:a,leftCacheBounds:o,rightCacheBounds:l}=s;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0,a[e]=1/0,a[e+3]=-1/0;ld(i,n,a)}t.sort(dd);let u=i;for(let e=0;e<u;e++){const n=t[e];for(;e+1<u&&t[e+1].candidate===n.candidate;)t.splice(e+1,1),u--}for(let i=c;i<h;i+=6){const r=n[i+2*e];for(let e=0;e<u;e++){const s=t[e];r>=s.candidate?ld(i,n,s.rightCacheBounds):(ld(i,n,s.leftCacheBounds),s.count++)}}for(let n=0;n<u;n++){const r=t[n],c=r.count,h=i-r.count,u=r.leftCacheBounds,d=r.rightCacheBounds;let p=0;0!==c&&(p=cd(u)/s);let f=0;0!==h&&(f=cd(d)/s);const m=ed+$u*(p*c+f*h);m<l&&(a=e,l=m,o=r.candidate)}}else{for(let e=0;e<ud;e++){const t=pd[e];t.count=0,t.candidate=r+u+e*u;const n=t.bounds;for(let e=0;e<3;e++)n[e]=1/0,n[e+3]=-1/0}for(let i=c;i<h;i+=6){let t=~~((n[i+2*e]-r)/u);t>=ud&&(t=ud-1);const s=pd[t];s.count++,ld(i,n,s.bounds)}const t=pd[ud-1];ad(t.bounds,t.rightCacheBounds);for(let e=ud-2;e>=0;e--){const t=pd[e],n=pd[e+1];od(t.bounds,n.rightCacheBounds,t.rightCacheBounds)}let d=0;for(let n=0;n<ud-1;n++){const t=pd[n],r=t.count,c=t.bounds,h=pd[n+1].rightCacheBounds;0!==r&&(0===d?ad(c,fd):od(c,fd,fd)),d+=r;let u=0,p=0;0!==d&&(u=cd(fd)/s);const f=i-d;0!==f&&(p=cd(h)/s);const m=ed+$u*(u*d+p*f);m<l&&(a=e,l=m,o=t.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:a,pos:o}}(t.boundingData,p,o,i,a,d);if(-1===g.axis)return n(i+a),t.offset=i,t.count=a,t;const A=function(e,t,n,r,i){let s=n,a=n+r-1;const o=i.pos,l=2*i.axis;for(;;){for(;s<=a&&t[6*s+l]<o;)s++;for(;s<=a&&t[6*a+l]>=o;)a--;if(!(s<a))return s;for(let n=0;n<3;n++){let r=e[3*s+n];e[3*s+n]=e[3*a+n],e[3*a+n]=r;let i=t[6*s+2*n+0];t[6*s+2*n+0]=t[6*a+2*n+0],t[6*a+2*n+0]=i;let o=t[6*s+2*n+1];t[6*s+2*n+1]=t[6*a+2*n+1],t[6*a+2*n+1]=o}s++,a--}}(l,o,i,a,g);if(A===i||A===i+a)n(i+a),t.offset=i,t.count=a;else{t.splitAxis=g.axis;const e=new rd,n=i,l=A-i;t.left=e,e.boundingData=new Float32Array(6),hd(o,n,l,e.boundingData,s),r(e,n,l,s,f+1);const c=new rd,h=A,u=a-l;t.right=c,c.boundingData=new Float32Array(6),hd(o,h,u,c.boundingData,s),r(c,h,u,s,f+1)}return t}!function(e,t){if(!e.index){const n=e.attributes.position.count,r=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let i;i=n>65535?new Uint32Array(new r(4*n)):new Uint16Array(new r(2*n)),e.setIndex(new a.BufferAttribute(i,1));for(let e=0;e<n;e++)i[e]=e}}(e,t);const i=new Float32Array(6),s=new Float32Array(6),o=function(e,t){const n=e.attributes.position,r=e.index.array,i=r.length/3,s=new Float32Array(6*i),a=n.normalized,o=n.array,l=n.offset||0;let c=3;n.isInterleavedBufferAttribute&&(c=n.data.stride);const h=["getX","getY","getZ"];for(let u=0;u<i;u++){const e=3*u,i=6*u;let d,p,f;a?(d=r[e+0],p=r[e+1],f=r[e+2]):(d=r[e+0]*c+l,p=r[e+1]*c+l,f=r[e+2]*c+l);for(let r=0;r<3;r++){let e,l,c;a?(e=n[h[r]](d),l=n[h[r]](p),c=n[h[r]](f)):(e=o[d+r],l=o[p+r],c=o[f+r]);let u=e;l<u&&(u=l),c<u&&(u=c);let m=e;l>m&&(m=l),c>m&&(m=c);const g=(m-u)/2,A=2*r;s[i+A+0]=u+g,s[i+A+1]=g+(Math.abs(u)+g)*nd,u<t[r]&&(t[r]=u),m>t[r+3]&&(t[r+3]=m)}}return s}(e,i),l=e.index.array,c=t.maxDepth,h=t.verbose,u=t.maxLeafTris,d=t.strategy,p=t.onProgress,f=e.index.count/3;let m=!1;const g=[],A=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];const t=[],n=new Set;for(const i of e.groups)n.add(i.start),n.add(i.start+i.count);const r=Array.from(n.values()).sort(((e,t)=>e-t));for(let i=0;i<r.length-1;i++){const e=r[i],n=r[i+1];t.push({offset:e/3,count:(n-e)/3})}return t}(e);if(1===A.length){const e=A[0],t=new rd;t.boundingData=i,function(e,t,n,r){let i=1/0,s=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;for(let h=6*t,u=6*(t+n);h<u;h+=6){const t=e[h+0];t<i&&(i=t),t>o&&(o=t);const n=e[h+2];n<s&&(s=n),n>l&&(l=n);const r=e[h+4];r<a&&(a=r),r>c&&(c=r)}r[0]=i,r[1]=s,r[2]=a,r[3]=o,r[4]=l,r[5]=c}(o,e.offset,e.count,s),r(t,e.offset,e.count,s),g.push(t)}else for(let a of A){const e=new rd;e.boundingData=new Float32Array(6),hd(o,a.offset,a.count,e.boundingData,s),r(e,a.offset,a.count,s),g.push(e)}return g}class gd{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,r=-1/0;for(let i=0,s=e.length;i<s;i++){const s=e[i][t];n=s<n?s:n,r=s>r?s:r}this.min=n,this.max=r}setFromPoints(e,t){let n=1/0,r=-1/0;for(let i=0,s=t.length;i<s;i++){const s=t[i],a=e.dot(s);n=a<n?a:n,r=a>r?a:r}this.min=n,this.max=r}isSeparated(e){return this.min>e.max||e.min>this.max}}gd.prototype.setFromBox=function(){const e=new a.Vector3;return function(t,n){const r=n.min,i=n.max;let s=1/0,a=-1/0;for(let o=0;o<=1;o++)for(let n=0;n<=1;n++)for(let l=0;l<=1;l++){e.x=r.x*o+i.x*(1-o),e.y=r.y*n+i.y*(1-n),e.z=r.z*l+i.z*(1-l);const c=t.dot(e);s=Math.min(c,s),a=Math.max(c,a)}this.min=s,this.max=a}}();!function(){const e=new gd}();const Ad=function(){const e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(r,i,s){const a=r.start,o=e,l=i.start,c=t;n.subVectors(a,l),e.subVectors(r.end,r.start),t.subVectors(i.end,i.start);const h=n.dot(c),u=c.dot(o),d=c.dot(c),p=n.dot(o),f=o.dot(o)*d-u*u;let m,g;m=0!==f?(h*u-p*d)/f:0,g=(h+m*u)/d,s.x=m,s.y=g}}(),vd=function(){const e=new a.Vector2,t=new a.Vector3,n=new a.Vector3;return function(r,i,s,a){Ad(r,i,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return r.at(o,s),void i.at(l,a);if(o>=0&&o<=1)return l<0?i.at(0,a):i.at(1,a),void r.closestPointToPoint(a,!0,s);if(l>=0&&l<=1)return o<0?r.at(0,s):r.at(1,s),void i.closestPointToPoint(s,!0,a);{let e,c;e=o<0?r.start:r.end,c=l<0?i.start:i.end;const h=t,u=n;return r.closestPointToPoint(c,!0,t),i.closestPointToPoint(e,!0,n),h.distanceToSquared(c)<=u.distanceToSquared(e)?(s.copy(h),void a.copy(c)):(s.copy(e),void a.copy(u))}}}(),yd=function(){const e=new a.Vector3,t=new a.Vector3,n=new a.Plane,r=new a.Line3;return function(i,s){const{radius:a,center:o}=i,{a:l,b:c,c:h}=s;r.start=l,r.end=c;if(r.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;r.start=l,r.end=h;if(r.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;r.start=c,r.end=h;if(r.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;const u=s.getPlane(n);if(Math.abs(u.distanceToPoint(o))<=a){const e=u.projectPoint(o,t);if(s.containsPoint(e))return!0}return!1}}();function xd(e){return Math.abs(e)<1e-15}class bd extends a.Triangle{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new a.Vector3)),this.satBounds=new Array(4).fill().map((()=>new gd)),this.points=[this.a,this.b,this.c],this.sphere=new a.Sphere,this.plane=new a.Plane,this.needsUpdate=!0}intersectsSphere(e){return yd(e,this)}update(){const e=this.a,t=this.b,n=this.c,r=this.points,i=this.satAxes,s=this.satBounds,a=i[0],o=s[0];this.getNormal(a),o.setFromPoints(a,r);const l=i[1],c=s[1];l.subVectors(e,t),c.setFromPoints(l,r);const h=i[2],u=s[2];h.subVectors(t,n),u.setFromPoints(h,r);const d=i[3],p=s[3];d.subVectors(n,e),p.setFromPoints(d,r),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}}bd.prototype.closestPointToSegment=function(){const e=new a.Vector3,t=new a.Vector3,n=new a.Line3;return function(r,i=null,s=null){const{start:a,end:o}=r,l=this.points;let c,h=1/0;for(let u=0;u<3;u++){const a=(u+1)%3;n.start.copy(l[u]),n.end.copy(l[a]),vd(n,r,e,t),c=e.distanceToSquared(t),c<h&&(h=c,i&&i.copy(e),s&&s.copy(t))}return this.closestPointToPoint(a,e),c=a.distanceToSquared(e),c<h&&(h=c,i&&i.copy(e),s&&s.copy(a)),this.closestPointToPoint(o,e),c=o.distanceToSquared(e),c<h&&(h=c,i&&i.copy(e),s&&s.copy(o)),Math.sqrt(h)}}(),bd.prototype.intersectsTriangle=function(){const e=new bd,t=new Array(3),n=new Array(3),r=new gd,i=new gd,s=new a.Vector3,o=new a.Vector3,l=new a.Vector3,c=new a.Vector3,h=new a.Line3,u=new a.Line3,d=new a.Line3;return function(a,p=null,f=!1){this.needsUpdate&&this.update(),a.isExtendedTriangle?a.needsUpdate&&a.update():(e.copy(a),e.update(),a=e);const m=this.plane,g=a.plane;if(Math.abs(m.normal.dot(g.normal))>1-1e-10){const e=this.satBounds,o=this.satAxes;n[0]=a.a,n[1]=a.b,n[2]=a.c;for(let t=0;t<4;t++){const i=e[t],s=o[t];if(r.setFromPoints(s,n),i.isSeparated(r))return!1}const l=a.satBounds,c=a.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let n=0;n<4;n++){const e=l[n],i=c[n];if(r.setFromPoints(i,t),e.isSeparated(r))return!1}for(let a=0;a<4;a++){const e=o[a];for(let a=0;a<4;a++){const o=c[a];if(s.crossVectors(e,o),r.setFromPoints(s,t),i.setFromPoints(s,n),r.isSeparated(i))return!1}}return p&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{const e=this.points;let t=!1,n=0;for(let a=0;a<3;a++){const r=e[a],i=e[(a+1)%3];h.start.copy(r),h.end.copy(i),h.delta(o);const s=t?u.start:u.end,l=xd(g.distanceToPoint(r));if(xd(g.normal.dot(o))&&l){u.copy(h),n=2;break}if((g.intersectLine(h,s)||l)&&!xd(s.distanceTo(i))){if(n++,t)break;t=!0}}if(1===n&&a.containsPoint(u.end))return p&&(p.start.copy(u.end),p.end.copy(u.end)),!0;if(2!==n)return!1;const r=a.points;let i=!1,s=0;for(let a=0;a<3;a++){const e=r[a],t=r[(a+1)%3];h.start.copy(e),h.end.copy(t),h.delta(l);const n=i?d.start:d.end,o=xd(m.distanceToPoint(e));if(xd(m.normal.dot(l))&&o){d.copy(h),s=2;break}if((m.intersectLine(h,n)||o)&&!xd(n.distanceTo(t))){if(s++,i)break;i=!0}}if(1===s&&this.containsPoint(d.end))return p&&(p.start.copy(d.end),p.end.copy(d.end)),!0;if(2!==s)return!1;if(u.delta(o),d.delta(l),o.dot(l)<0){let e=d.start;d.start=d.end,d.end=e}const f=u.start.dot(o),A=u.end.dot(o),v=d.start.dot(o),y=d.end.dot(o);return(f===y||v===A||A<v!==f<y)&&(p&&(c.subVectors(u.start,d.start),c.dot(o)>0?p.start.copy(u.start):p.start.copy(d.start),c.subVectors(u.end,d.end),c.dot(o)<0?p.end.copy(u.end):p.end.copy(d.end)),!0)}}}(),bd.prototype.distanceToPoint=function(){const e=new a.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),bd.prototype.distanceToTriangle=function(){const e=new a.Vector3,t=new a.Vector3,n=["a","b","c"],r=new a.Line3,i=new a.Line3;return function(s,a=null,o=null){const l=a||o?r:null;if(this.intersectsTriangle(s,l))return(a||o)&&(a&&l.getCenter(a),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let r;const i=n[t],l=s[i];this.closestPointToPoint(l,e),r=l.distanceToSquared(e),r<c&&(c=r,a&&a.copy(e),o&&o.copy(l));const h=this[i];s.closestPointToPoint(h,e),r=h.distanceToSquared(e),r<c&&(c=r,a&&a.copy(h),o&&o.copy(e))}for(let h=0;h<3;h++){const l=n[h],u=n[(h+1)%3];r.set(this[l],this[u]);for(let h=0;h<3;h++){const l=n[h],u=n[(h+1)%3];i.set(s[l],s[u]),vd(r,i,e,t);const d=e.distanceToSquared(t);d<c&&(c=d,a&&a.copy(e),o&&o.copy(t))}}return Math.sqrt(c)}}();class Ed{constructor(e,t,n){this.isOrientedBox=!0,this.min=new a.Vector3,this.max=new a.Vector3,this.matrix=new a.Matrix4,this.invMatrix=new a.Matrix4,this.points=new Array(8).fill().map((()=>new a.Vector3)),this.satAxes=new Array(3).fill().map((()=>new a.Vector3)),this.satBounds=new Array(3).fill().map((()=>new gd)),this.alignedSatBounds=new Array(3).fill().map((()=>new gd)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}function _d(e,t,n,r){const i=e.a,s=e.b,a=e.c;let o=t,l=t+1,c=t+2;n&&(o=n.getX(t),l=n.getX(t+1),c=n.getX(t+2)),i.x=r.getX(o),i.y=r.getY(o),i.z=r.getZ(o),s.x=r.getX(l),s.y=r.getY(l),s.z=r.getZ(l),a.x=r.getX(c),a.y=r.getY(c),a.z=r.getZ(c)}function Sd(e,t,n,r,i,s,a){const o=n.index,l=n.attributes.position;for(let c=e,h=t+e;c<h;c++)if(_d(a,3*c,o,l),a.needsUpdate=!0,r(a,c,i,s))return!0;return!1}Ed.prototype.update=function(){const e=this.matrix,t=this.min,n=this.max,r=this.points;for(let l=0;l<=1;l++)for(let i=0;i<=1;i++)for(let s=0;s<=1;s++){const a=r[1*l|2*i|4*s];a.x=l?n.x:t.x,a.y=i?n.y:t.y,a.z=s?n.z:t.z,a.applyMatrix4(e)}const i=this.satBounds,s=this.satAxes,a=r[0];for(let l=0;l<3;l++){const e=s[l],t=i[l],n=r[1<<l];e.subVectors(a,n),t.setFromPoints(e,r)}const o=this.alignedSatBounds;o[0].setFromPointsField(r,"x"),o[1].setFromPointsField(r,"y"),o[2].setFromPointsField(r,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1},Ed.prototype.intersectsBox=function(){const e=new gd;return function(t){this.needsUpdate&&this.update();const n=t.min,r=t.max,i=this.satBounds,s=this.satAxes,a=this.alignedSatBounds;if(e.min=n.x,e.max=r.x,a[0].isSeparated(e))return!1;if(e.min=n.y,e.max=r.y,a[1].isSeparated(e))return!1;if(e.min=n.z,e.max=r.z,a[2].isSeparated(e))return!1;for(let o=0;o<3;o++){const n=s[o],r=i[o];if(e.setFromBox(n,t),r.isSeparated(e))return!1}return!0}}(),Ed.prototype.intersectsTriangle=function(){const e=new bd,t=new Array(3),n=new gd,r=new gd,i=new a.Vector3;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(e.copy(s),e.update(),s=e);const a=this.satBounds,o=this.satAxes;t[0]=s.a,t[1]=s.b,t[2]=s.c;for(let e=0;e<3;e++){const r=a[e],i=o[e];if(n.setFromPoints(i,t),r.isSeparated(n))return!1}const l=s.satBounds,c=s.satAxes,h=this.points;for(let e=0;e<3;e++){const t=l[e],r=c[e];if(n.setFromPoints(r,h),t.isSeparated(n))return!1}for(let e=0;e<3;e++){const s=o[e];for(let e=0;e<4;e++){const a=c[e];if(i.crossVectors(s,a),n.setFromPoints(i,t),r.setFromPoints(i,h),n.isSeparated(r))return!1}}return!0}}(),Ed.prototype.closestPointToPoint=function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t},Ed.prototype.distanceToPoint=function(){const e=new a.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),Ed.prototype.distanceToBox=function(){const e=["x","y","z"],t=new Array(12).fill().map((()=>new a.Line3)),n=new Array(12).fill().map((()=>new a.Line3)),r=new a.Vector3,i=new a.Vector3;return function(s,a=0,o=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(o||l)&&(s.getCenter(i),this.closestPointToPoint(i,r),s.closestPointToPoint(r,i),o&&o.copy(r),l&&l.copy(i)),0;const c=a*a,h=s.min,u=s.max,d=this.points;let p=1/0;for(let e=0;e<8;e++){const t=d[e];i.copy(t).clamp(h,u);const n=t.distanceToSquared(i);if(n<p&&(p=n,o&&o.copy(t),l&&l.copy(i),n<c))return Math.sqrt(n)}let f=0;for(let r=0;r<3;r++)for(let i=0;i<=1;i++)for(let s=0;s<=1;s++){const a=(r+1)%3,o=(r+2)%3,l=1<<r|i<<a|s<<o,c=d[i<<a|s<<o],p=d[l];t[f].set(c,p);const m=e[r],g=e[a],A=e[o],v=n[f],y=v.start,x=v.end;y[m]=h[m],y[g]=i?h[g]:u[g],y[A]=s?h[A]:u[g],x[m]=u[m],x[g]=i?h[g]:u[g],x[A]=s?h[A]:u[g],f++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let n=0;n<=1;n++){i.x=e?u.x:h.x,i.y=t?u.y:h.y,i.z=n?u.z:h.z,this.closestPointToPoint(i,r);const s=i.distanceToSquared(r);if(s<p&&(p=s,o&&o.copy(r),l&&l.copy(i),s<c))return Math.sqrt(s)}for(let e=0;e<12;e++){const s=t[e];for(let e=0;e<12;e++){const t=n[e];vd(s,t,r,i);const a=r.distanceToSquared(i);if(a<p&&(p=a,o&&o.copy(r),l&&l.copy(i),a<c))return Math.sqrt(a)}}return Math.sqrt(p)}}();class wd{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}function Md(e,t){return 65535===t[e+15]}function Cd(e,t){return t[e+6]}function Td(e,t){return t[e+14]}function Id(e){return e+8}function Bd(e,t){return t[e+6]}const Rd=new a.Box3,Pd=new a.Vector3,Dd=["x","y","z"];function Ld(e,t,n,r,i){let s=2*e,a=zd,o=Qd,l=Vd;if(Md(s,o)){!function(e,t,n,r,i,s){for(let a=r,o=r+i;a<o;a++)Yu(e,t,n,a,s)}(t,n,r,Cd(e,l),Td(s,o),i)}else{const s=Id(e);Nd(s,a,r,Pd)&&Ld(s,t,n,r,i);const o=Bd(e,l);Nd(o,a,r,Pd)&&Ld(o,t,n,r,i)}}function Fd(e,t,n,r){let i=2*e,s=zd,a=Qd,o=Vd;if(Md(i,a)){return function(e,t,n,r,i){let s=1/0,a=null;for(let o=r,l=r+i;o<l;o++){const r=Yu(e,t,n,o);r&&r.distance<s&&(a=r,s=r.distance)}return a}(t,n,r,Cd(e,o),Td(i,a))}{const i=function(e,t){return t[e+7]}(e,o),a=Dd[i],l=r.direction[a]>=0;let c,h;l?(c=Id(e),h=Bd(e,o)):(c=Bd(e,o),h=Id(e));const u=Nd(c,s,r,Pd)?Fd(c,t,n,r):null;if(u){const e=u.point[a];if(l?e<=s[h+i]:e>=s[h+i+3])return u}const d=Nd(h,s,r,Pd)?Fd(h,t,n,r):null;return u&&d?u.distance<=d.distance?u:d:u||d||null}}const Ud=function(){let e,t;const n=[],r=new wd((()=>new a.Box3));return function(...s){e=r.getPrimitive(),t=r.getPrimitive(),n.push(e,t);const a=i(...s);r.releasePrimitive(e),r.releasePrimitive(t),n.pop(),n.pop();const o=n.length;return o>0&&(t=n[o-1],e=n[o-2]),a};function i(n,r,s,a,o=null,l=0,c=0){function h(e){let t=2*e,n=Qd,r=Vd;for(;!Md(t,n);)t=2*(e=Id(e));return Cd(e,r)}function u(e){let t=2*e,n=Qd,r=Vd;for(;!Md(t,n);)t=2*(e=Bd(e,r));return Cd(e,r)+Td(t,n)}let d=2*n,p=zd,f=Qd,m=Vd;if(Md(d,f)){const t=Cd(n,m),r=Td(d,f);return id(n,p,e),a(t,r,!1,c,l+n,e)}{const d=Id(n),g=Bd(n,m);let A,v,y,x,b=d,E=g;if(o&&(y=e,x=t,id(b,p,y),id(E,p,x),A=o(y),v=o(x),v<A)){b=g,E=d;const e=A;A=v,v=e,y=x}y||(y=e,id(b,p,y));const _=s(y,Md(2*b,f),A,c+1,l+b);let S;if(2===_){const e=h(b);S=a(e,u(b)-e,!0,c+1,l+b,y)}else S=_&&i(b,r,s,a,o,l,c+1);if(S)return!0;x=t,id(E,p,x);const w=s(x,Md(2*E,f),v,c+1,l+E);let M;if(2===w){const e=h(E);M=a(e,u(E)-e,!0,c+1,l+E,x)}else M=w&&i(E,r,s,a,o,l,c+1);return!!M}}}(),Od=function(){const e=new bd,t=new bd,n=new a.Matrix4,r=new Ed,i=new Ed;return function s(a,o,l,c,h=null){let u=2*a,d=zd,p=Qd,f=Vd;null===h&&(l.boundingBox||l.computeBoundingBox(),r.set(l.boundingBox.min,l.boundingBox.max,c),h=r);if(!Md(u,p)){const e=a+8,t=f[a+6];id(e,d,Rd);if(h.intersectsBox(Rd)&&s(e,o,l,c,h))return!0;id(t,d,Rd);return!!(h.intersectsBox(Rd)&&s(t,o,l,c,h))}{const r=o,s=r.index,h=r.attributes.position,m=l.index,g=l.attributes.position,A=Cd(a,f),v=Td(u,p);if(n.copy(c).invert(),l.boundsTree){id(a,d,i),i.matrix.copy(n),i.needsUpdate=!0;const e=l.boundsTree.shapecast({intersectsBounds:e=>i.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let n=3*A,r=3*(v+A);n<r;n+=3)if(_d(t,n,s,h),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}});return e}for(let i=3*A,a=v+3*A;i<a;i+=3){_d(e,i,s,h),e.a.applyMatrix4(n),e.b.applyMatrix4(n),e.c.applyMatrix4(n),e.needsUpdate=!0;for(let n=0,r=m.count;n<r;n+=3)if(_d(t,n,m,g),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function Nd(e,t,n,r){return id(e,t,Rd),n.intersectBox(Rd,r)}const kd=[];let Gd,zd,Qd,Vd;function Hd(e){Gd&&kd.push(Gd),Gd=e,zd=new Float32Array(e),Qd=new Uint16Array(e),Vd=new Uint32Array(e)}function jd(){Gd=null,zd=null,Qd=null,Vd=null,kd.length&&Hd(kd.pop())}const Wd=Symbol("skip tree generation"),Xd=new a.Box3,Yd=new a.Box3,qd=new a.Matrix4,Kd=new Ed,Jd=new Ed,Zd=new a.Vector3,$d=new a.Vector3,ep=new a.Vector3,tp=new a.Vector3,np=new a.Vector3,rp=new a.Box3,ip=new wd((()=>new bd));class sp{static serialize(e,t={}){if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),sp.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};const n=e.geometry,r=e._roots,i=n.getIndex();let s;return s=t.cloneBuffers?{roots:r.map((e=>e.slice())),index:i.array.slice()}:{roots:r,index:i.array},s}static deserialize(e,t,n={}){if("boolean"==typeof n)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),sp.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});n={setIndex:!0,...n};const{index:r,roots:i}=e,s=new sp(t,{...n,[Wd]:!0});if(s._roots=i,n.setIndex){const n=t.getIndex();if(null===n){const n=new a.BufferAttribute(e.index,1,!1);t.setIndex(n)}else n.array!==r&&(n.array.set(r),n.needsUpdate=!0)}return s}constructor(e,t={}){if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if((t=Object.assign({strategy:Ku,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[Wd]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[Wd]||(this._roots=function(e,t){const n=md(e,t);let r,i,s;const a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let h=0;h<n.length;h++){const e=n[h],t=new o(32*l(e));r=new Float32Array(t),i=new Uint32Array(t),s=new Uint16Array(t),c(0,e),a.push(t)}return a;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function c(e,t){const n=e/4,a=e/2,o=!!t.count,l=t.boundingData;for(let i=0;i<6;i++)r[n+i]=l[i];if(o){const r=t.offset,o=t.count;return i[n+6]=r,s[a+14]=o,s[a+15]=td,e+32}{const r=t.left,s=t.right,a=t.splitAxis;let o;if(o=c(e+32,r),o/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[n+6]=o/4,o=c(o,s),i[n+7]=a,o}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new a.Box3))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,n=t.index.array,r=t.attributes.position;let i,s,a,o,l=0;const c=this._roots;for(let u=0,d=c.length;u<d;u++)i=c[u],s=new Uint32Array(i),a=new Uint16Array(i),o=new Float32Array(i),h(0,l),l+=i.byteLength;function h(t,i,l=!1){const c=2*t;if(a[c+15]===td){const e=s[t+6];let i=1/0,l=1/0,h=1/0,u=-1/0,d=-1/0,p=-1/0;for(let t=3*e,s=3*(e+a[c+14]);t<s;t++){const e=n[t],s=r.getX(e),a=r.getY(e),o=r.getZ(e);s<i&&(i=s),s>u&&(u=s),a<l&&(l=a),a>d&&(d=a),o<h&&(h=o),o>p&&(p=o)}return(o[t+0]!==i||o[t+1]!==l||o[t+2]!==h||o[t+3]!==u||o[t+4]!==d||o[t+5]!==p)&&(o[t+0]=i,o[t+1]=l,o[t+2]=h,o[t+3]=u,o[t+4]=d,o[t+5]=p,!0)}{const n=t+8,r=s[t+6],a=n+i,c=r+i;let u=l,d=!1,p=!1;e?u||(d=e.has(a),p=e.has(c),u=!d&&!p):(d=!0,p=!0);const f=u||p;let m=!1;(u||d)&&(m=h(n,i,u));let g=!1;f&&(g=h(r,i,u));const A=m||g;if(A)for(let e=0;e<3;e++){const i=n+e,s=r+e,a=o[i],l=o[i+3],c=o[s],h=o[s+3];o[t+e]=a<c?a:c,o[t+e+3]=l>h?l:h}return A}}}traverse(e,t=0){const n=this._roots[t],r=new Uint32Array(n),i=new Uint16Array(n);!function t(s,a=0){const o=2*s,l=i[o+15]===td;if(l){const t=r[s+6],c=i[o+14];e(a,l,new Float32Array(n,4*s,6),t,c)}else{const i=s+8,o=r[s+6],c=r[s+7];e(a,l,new Float32Array(n,4*s,6),c)||(t(i,a+1),t(o,a+1))}}(0)}raycast(e,t=a.FrontSide){const n=this._roots,r=this.geometry,i=[],s=t.isMaterial,o=Array.isArray(t),l=r.groups,c=s?t.side:t;for(let a=0,h=n.length;a<h;a++){const s=o?t[l[a].materialIndex].side:c,h=i.length;if(Hd(n[a]),Ld(0,r,s,e,i),jd(),o){const e=l[a].materialIndex;for(let t=h,n=i.length;t<n;t++)i[t].face.materialIndex=e}}return i}raycastFirst(e,t=a.FrontSide){const n=this._roots,r=this.geometry,i=t.isMaterial,s=Array.isArray(t);let o=null;const l=r.groups,c=i?t.side:t;for(let a=0,h=n.length;a<h;a++){const i=s?t[l[a].materialIndex].side:c;Hd(n[a]);const h=Fd(0,r,i,e);jd(),null!=h&&(null==o||h.distance<o.distance)&&(o=h,s&&(h.face.materialIndex=l[a].materialIndex))}return o}intersectsGeometry(e,t){const n=this.geometry;let r=!1;for(const i of this._roots)if(Hd(i),r=Od(0,n,e,t),jd(),r)break;return r}shapecast(e,t,n){const r=this.geometry;if(e instanceof Function){if(t){const e=t;t=(t,n,r,i)=>{const s=3*n;return e(t,s,s+1,s+2,r,i)}}e={boundsTraverseOrder:n,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}const i=ip.getPrimitive();let{boundsTraverseOrder:s,intersectsBounds:a,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const e=o;o=(t,n,s,a,o)=>!!e(t,n,s,a,o)||Sd(t,n,r,l,s,a,i)}else o||(o=l?(e,t,n,s)=>Sd(e,t,r,l,n,s,i):(e,t,n)=>n);let c=!1,h=0;for(const u of this._roots){if(Hd(u),c=Ud(0,r,a,o,s,h),jd(),c)break;h+=u.byteLength}return ip.releasePrimitive(i),c}bvhcast(e,t,n){let{intersectsRanges:r,intersectsTriangles:i}=n;const s=this.geometry.index,a=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;qd.copy(t).invert();const c=ip.getPrimitive(),h=ip.getPrimitive();if(i){function d(e,n,r,u,d,p,f,m){for(let g=r,A=r+u;g<A;g++){_d(h,3*g,o,l),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let t=e,r=e+n;t<r;t++)if(_d(c,3*t,s,a),c.needsUpdate=!0,i(c,h,t,g,d,p,f,m))return!0}return!1}if(r){const p=r;r=function(e,t,n,r,i,s,a,o){return!!p(e,t,n,r,i,s,a,o)||d(e,t,n,r,i,s,a,o)}}else r=d}e.getBoundingBox(Yd),Yd.applyMatrix4(t);const u=this.shapecast({intersectsBounds:e=>Yd.intersectsBox(e),intersectsRange:(t,n,i,s,a,o)=>(Xd.copy(o),Xd.applyMatrix4(qd),e.shapecast({intersectsBounds:e=>Xd.intersectsBox(e),intersectsRange:(e,i,o,l,c)=>r(t,n,e,i,s,a,l,c)}))});return ip.releasePrimitive(c),ip.releasePrimitive(h),u}intersectsBox(e,t){return Kd.set(e.min,e.max,t),Kd.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Kd.intersectsBox(e),intersectsTriangle:e=>Kd.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},r={},i=0,s=1/0){e.boundingBox||e.computeBoundingBox(),Kd.set(e.boundingBox.min,e.boundingBox.max,t),Kd.needsUpdate=!0;const a=this.geometry,o=a.attributes.position,l=a.index,c=e.attributes.position,h=e.index,u=ip.getPrimitive(),d=ip.getPrimitive();let p=$d,f=ep,m=null,g=null;r&&(m=tp,g=np);let A=1/0,v=null,y=null;return qd.copy(t).invert(),Jd.matrix.copy(qd),this.shapecast({boundsTraverseOrder:e=>Kd.distanceToBox(e),intersectsBounds:(e,t,n)=>n<A&&n<s&&(t&&(Jd.min.copy(e.min),Jd.max.copy(e.max),Jd.needsUpdate=!0),!0),intersectsRange:(n,r)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Jd.distanceToBox(e),intersectsBounds:(e,t,n)=>n<A&&n<s,intersectsRange:(e,s)=>{for(let a=3*e,x=3*(e+s);a<x;a+=3){_d(d,a,h,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let e=3*n,t=3*(n+r);e<t;e+=3){_d(u,e,l,o),u.needsUpdate=!0;const t=u.distanceToTriangle(d,p,m);if(t<A&&(f.copy(p),g&&g.copy(m),A=t,v=e/3,y=a/3),t<i)return!0}}}});for(let e=0,s=h?h.count:c.count;e<s;e+=3){_d(d,e,h,c),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let t=3*n,s=3*(n+r);t<s;t+=3){_d(u,t,l,o),u.needsUpdate=!0;const n=u.distanceToTriangle(d,p,m);if(n<A&&(f.copy(p),g&&g.copy(m),A=n,v=t/3,y=e/3),n<i)return!0}}}}),ip.releasePrimitive(u),ip.releasePrimitive(d),A===1/0?null:(n.point?n.point.copy(f):n.point=f.clone(),n.distance=A,n.faceIndex=v,r&&(r.point?r.point.copy(g):r.point=g.clone(),r.point.applyMatrix4(qd),f.applyMatrix4(qd),r.distance=f.sub(r.point).length(),r.faceIndex=y),n)}closestPointToPoint(e,t={},n=0,r=1/0){const i=n*n,s=r*r;let a=1/0,o=null;if(this.shapecast({boundsTraverseOrder:t=>(Zd.copy(e).clamp(t.min,t.max),Zd.distanceToSquared(e)),intersectsBounds:(e,t,n)=>n<a&&n<s,intersectsTriangle:(t,n)=>{t.closestPointToPoint(e,Zd);const r=e.distanceToSquared(Zd);return r<a&&($d.copy(Zd),a=r,o=n),r<i}}),a===1/0)return null;const l=Math.sqrt(a);return t.point?t.point.copy($d):t.point=$d.clone(),t.distance=l,t.faceIndex=o,t}getBoundingBox(e){e.makeEmpty();return this._roots.forEach((t=>{id(0,new Float32Array(t),rp),e.union(rp)})),e}}const ap=new a.Ray,op=new a.Matrix4,lp=a.Mesh.prototype.raycast;function cp(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;op.copy(this.matrixWorld).invert(),ap.copy(e.ray).applyMatrix4(op);const n=this.geometry.boundsTree;if(!0===e.firstHitOnly){const r=qu(n.raycastFirst(ap,this.material),this,e);r&&t.push(r)}else{const r=n.raycast(ap,this.material);for(let n=0,i=r.length;n<i;n++){const i=qu(r[n],this,e);i&&t.push(i)}}}else lp.call(this,e,t)}function hp(e){return this.boundsTree=new sp(this,e),this.boundsTree}function up(){this.boundsTree=null}function dp(e,t){i.useEffect((()=>{if(e.current){e.current.raycast=cp;const n=e.current.geometry;return n.computeBoundsTree=hp,n.disposeBoundsTree=up,n.computeBoundsTree(t),()=>{n.boundsTree&&n.disposeBoundsTree()}}}),[e,t])}function pp(...e){const t=i.useRef([]);return t.current=e.map((e=>i.useContext(e))),i.useMemo((()=>({children:n})=>e.reduceRight(((e,n,r)=>i.createElement(n.Provider,{value:t.current[r],children:e})),n)),[])}function fp(e,t){const n=i.useRef(),[r]=i.useState((()=>t?t instanceof a.Object3D?{current:t}:t:n)),[s]=i.useState((()=>new a.AnimationMixer(void 0))),l=i.useRef({}),[c]=i.useState((()=>{const t={};return e.forEach((e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(r.current)return l.current[e.name]||(l.current[e.name]=s.clipAction(e,r.current))}}))),{ref:r,clips:e,actions:t,names:e.map((e=>e.name)),mixer:s}}));return(0,o.useFrame)(((e,t)=>s.update(t))),i.useEffect((()=>{const e=r.current;return()=>{l.current={},Object.values(c.actions).forEach((t=>{e&&s.uncacheAction(t,e)}))}}),[e]),c}function mp(e){const t=i.useRef(null),n=i.useRef(!1),r=i.useRef(!1);return i.useEffect((()=>{const i=t.current;if(i){const t=(0,o.addEffect)((()=>(n.current=!1,!0))),s=i.onBeforeRender;i.onBeforeRender=()=>n.current=!0;const a=(0,o.addAfterEffect)((()=>(n.current!==r.current&&e(r.current=n.current),!0)));return()=>{i.onBeforeRender=s,t(),a()}}}),[]),t}const gp="\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #ifdef BOX_PROJECTED_ENV_MAP\n vWorldPosition = worldPosition.xyz;\n #endif\n#endif\n",Ap="\n#ifdef BOX_PROJECTED_ENV_MAP\n uniform vec3 envMapSize;\n uniform vec3 envMapPosition;\n varying vec3 vWorldPosition;\n \n vec3 parallaxCorrectNormal( vec3 v, vec3 cubeSize, vec3 cubePos ) {\n vec3 nDir = normalize( v );\n vec3 rbmax = ( .5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbmin = ( -.5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbminmax;\n rbminmax.x = ( nDir.x > 0. ) ? rbmax.x : rbmin.x;\n rbminmax.y = ( nDir.y > 0. ) ? rbmax.y : rbmin.y;\n rbminmax.z = ( nDir.z > 0. ) ? rbmax.z : rbmin.z;\n float correction = min( min( rbminmax.x, rbminmax.y ), rbminmax.z );\n vec3 boxIntersection = vWorldPosition + nDir * correction; \n return boxIntersection - cubePos;\n }\n#endif\n",vp="\n#ifdef BOX_PROJECTED_ENV_MAP\n worldNormal = parallaxCorrectNormal( worldNormal, envMapSize, envMapPosition );\n#endif\n",yp="\n#ifdef BOX_PROJECTED_ENV_MAP\n reflectVec = parallaxCorrectNormal( reflectVec, envMapSize, envMapPosition );\n#endif\n";function xp(e=new a.Vector3,t=new a.Vector3){const[n]=i.useState((()=>({position:new a.Vector3,size:new a.Vector3})));(0,o.applyProps)(n,{position:e,size:t});const r=i.useRef(null),s=i.useMemo((()=>({ref:r,onBeforeCompile:e=>function(e,t,n){e.defines.BOX_PROJECTED_ENV_MAP=!0,e.uniforms.envMapPosition={value:t},e.uniforms.envMapSize={value:n},e.vertexShader=`\n varying vec3 vWorldPosition;\n ${e.vertexShader.replace("#include <worldpos_vertex>",gp)}`,e.fragmentShader=`\n ${Ap}\n ${e.fragmentShader.replace("#include <envmap_physical_pars_fragment>",a.ShaderChunk.envmap_physical_pars_fragment).replace("vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );",`vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n ${vp}\n `).replace("reflectVec = inverseTransformDirection( reflectVec, viewMatrix );",`reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n ${yp}\n `)}`}(e,n.position,n.size),customProgramCacheKey:()=>JSON.stringify(n.position.toArray())+JSON.stringify(n.size.toArray())})),[...n.position.toArray(),...n.size.toArray()]);return i.useLayoutEffect((()=>{r.current.needsUpdate=!0}),[n]),s}var bp=Object.defineProperty,Ep=(e,t,n)=>(((e,t,n)=>{t in e?bp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const _p=1024,Sp=(e,t,n,r,i,s)=>{const a=e.image,{data:o}=a,l=4096*s;o[4*t+l+0]=n,o[4*t+l+1]=r,o[4*t+l+2]=i,o[4*t+l+3]=1};class wp{constructor(e,t=1){Ep(this,"curveArray"),Ep(this,"curveLengthArray"),Ep(this,"object3D"),Ep(this,"splineTexure"),Ep(this,"uniforms");const n=e.clone(),r=((e=1)=>{const t=new Float32Array(4096*e*4),n=new a.DataTexture(t,_p,4*e,a.RGBAFormat,a.FloatType);return n.wrapS=a.RepeatWrapping,n.wrapT=a.RepeatWrapping,n.magFilter=a.NearestFilter,n.needsUpdate=!0,n})(t),i={spineTexture:{value:r},pathOffset:{type:"f",value:0},pathSegment:{type:"f",value:1},spineOffset:{type:"f",value:161},spineLength:{type:"f",value:400},flow:{type:"i",value:1}};n.traverse((e=>{(e instanceof a.Mesh||e instanceof a.InstancedMesh)&&(e.material=e.material.clone(),function(e,t,n=1){e.__ok||(e.__ok=!0,e.onBeforeCompile=e=>{if(e.__modified)return;e.__modified=!0,Object.assign(e.uniforms,t);const r=`\n\t\tuniform sampler2D spineTexture;\n\t\tuniform float pathOffset;\n\t\tuniform float pathSegment;\n\t\tuniform float spineOffset;\n\t\tuniform float spineLength;\n\t\tuniform int flow;\n\n\t\tfloat textureLayers = ${4*n}.;\n\t\tfloat textureStacks = 1.;\n\n\t\t${e.vertexShader}\n\t\t`.replace("#include <beginnormal_vertex>","").replace("#include <defaultnormal_vertex>","").replace("#include <begin_vertex>","").replace(/void\s*main\s*\(\)\s*\{/,"\n void main() {\n #include <beginnormal_vertex>\n\n vec4 worldPos = modelMatrix * vec4(position, 1.);\n\n bool bend = flow > 0;\n float xWeight = bend ? 0. : 1.;\n\n #ifdef USE_INSTANCING\n float pathOffsetFromInstanceMatrix = instanceMatrix[3][2];\n float spineLengthFromInstanceMatrix = instanceMatrix[3][0];\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLengthFromInstanceMatrix : 0.;\n float mt = (spinePortion * pathSegment + pathOffset + pathOffsetFromInstanceMatrix)*textureStacks;\n #else\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLength : 0.;\n float mt = (spinePortion * pathSegment + pathOffset)*textureStacks;\n #endif\n\n mt = mod(mt, textureStacks);\n float rowOffset = floor(mt);\n\n #ifdef USE_INSTANCING\n rowOffset += instanceMatrix[3][1] * 4.;\n #endif\n\n vec3 spinePos = texture2D(spineTexture, vec2(mt, (0. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 a = texture2D(spineTexture, vec2(mt, (1. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 b = texture2D(spineTexture, vec2(mt, (2. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 c = texture2D(spineTexture, vec2(mt, (3. + rowOffset + 0.5) / textureLayers)).xyz;\n mat3 basis = mat3(a, b, c);\n\n vec3 transformed = basis\n * vec3(worldPos.x * xWeight, worldPos.y * 1., worldPos.z * 1.)\n + spinePos;\n\n vec3 transformedNormal = normalMatrix * (basis * objectNormal);\n\t\t\t").replace("#include <project_vertex>","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;");e.vertexShader=r})}(e.material,i,t))})),this.curveArray=new Array(t),this.curveLengthArray=new Array(t),this.object3D=n,this.splineTexure=r,this.uniforms=i}updateCurve(e,t){if(e>=this.curveArray.length)throw Error("Index out of range for Flow");const n=t.getLength();this.uniforms.spineLength.value=n,this.curveLengthArray[e]=n,this.curveArray[e]=t,((e,t,n=0)=>{const r=Math.floor(1024);t.arcLengthDivisions=r/2,t.updateArcLengths();const i=t.getSpacedPoints(r),s=t.computeFrenetFrames(r,!0);for(let a=0;a<r;a++){const t=Math.floor(a/_p),r=a%_p;let o=i[a];Sp(e,r,o.x,o.y,o.z,0+t+4*n),o=s.tangents[a],Sp(e,r,o.x,o.y,o.z,1+t+4*n),o=s.normals[a],Sp(e,r,o.x,o.y,o.z,2+t+4*n),o=s.binormals[a],Sp(e,r,o.x,o.y,o.z,3+t+4*n)}e.needsUpdate=!0})(this.splineTexure,t,e)}moveAlongCurve(e){this.uniforms.pathOffset.value+=e}}new a.Matrix4;const Mp=i.forwardRef((({children:e,curve:t},n)=>{const[r]=i.useState((()=>new a.Scene)),[s,l]=i.useState(),c=i.useRef();return i.useEffect((()=>{c.current=new wp(r.children[0]),l(c.current.object3D)}),[e]),i.useEffect((()=>{var e;t&&(null==(e=c.current)||e.updateCurve(0,t))}),[t]),i.useImperativeHandle(n,(()=>({moveAlongCurve:e=>{var t;null==(t=c.current)||t.moveAlongCurve(e)}}))),i.createElement(i.Fragment,null,(0,o.createPortal)(e,r),s&&i.createElement("primitive",{object:s}))}));class Cp extends a.MeshPhysicalMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._distort={value:.4},this._radius={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.radius=this._radius,e.uniforms.distort=this._distort,e.vertexShader=`\n uniform float time;\n uniform float radius;\n uniform float distort;\n #define GLSLIFY 1\nvec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","\n float updateTime = time / 50.0;\n float noise = snoise(vec3(position / 2.0 + updateTime * 5.0));\n vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius));\n ")}get time(){return this._time.value}set time(e){this._time.value=e}get distort(){return this._distort.value}set distort(e){this._distort.value=e}get radius(){return this._radius.value}set radius(e){this._radius.value=e}}const Tp=i.forwardRef((({speed:e=1,...t},n)=>{const[s]=i.useState((()=>new Cp));return(0,o.useFrame)((t=>s&&(s.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",(0,r.Z)({dispose:void 0,object:s,ref:n,attach:"material"},t))}));class Ip extends a.MeshStandardMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=`\n uniform float time;\n uniform float factor;\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","float theta = sin( time + position.y ) / 2.0 * factor;\n float c = cos( theta );\n float s = sin( theta );\n mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c );\n vec3 transformed = vec3( position ) * m;\n vNormal = vNormal * m;")}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}}const Bp=i.forwardRef((({speed:e=1,...t},n)=>{const[s]=i.useState((()=>new Ip));return(0,o.useFrame)((t=>s&&(s.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",(0,r.Z)({dispose:void 0,object:s,ref:n,attach:"material"},t))}));class Rp extends a.ShaderMaterial{constructor(e=new a.Vector2){super({uniforms:{inputBuffer:new a.Uniform(null),depthBuffer:new a.Uniform(null),resolution:new a.Uniform(new a.Vector2),texelSize:new a.Uniform(new a.Vector2),halfTexelSize:new a.Uniform(new a.Vector2),kernel:new a.Uniform(0),scale:new a.Uniform(1),cameraNear:new a.Uniform(0),cameraFar:new a.Uniform(1),minDepthThreshold:new a.Uniform(0),maxDepthThreshold:new a.Uniform(1),depthScale:new a.Uniform(0),depthToBlurRatioBias:new a.Uniform(.25)},fragmentShader:"#include <common>\n #include <dithering_pars_fragment> \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include <dithering_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n }",vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:a.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setResolution(e){this.uniforms.resolution.value.copy(e)}}class Pp{constructor({gl:e,resolution:t,width:n=500,height:r=500,minDepthThreshold:i=0,maxDepthThreshold:s=1,depthScale:o=0,depthToBlurRatioBias:l=.25}){this.renderToScreen=!1,this.renderTargetA=new a.WebGLRenderTarget(t,t,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,stencilBuffer:!1,depthBuffer:!1,encoding:e.outputEncoding}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new Rp,this.convolutionMaterial.setTexelSize(1/n,1/r),this.convolutionMaterial.setResolution(new a.Vector2(n,r)),this.scene=new a.Scene,this.camera=new a.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=i,this.convolutionMaterial.uniforms.maxDepthThreshold.value=s,this.convolutionMaterial.uniforms.depthScale.value=o,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=l,this.convolutionMaterial.defines.USE_DEPTH=o>0;const c=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),h=new Float32Array([0,0,2,0,0,2]),u=new a.BufferGeometry;u.setAttribute("position",new a.BufferAttribute(c,3)),u.setAttribute("uv",new a.BufferAttribute(h,2)),this.screen=new a.Mesh(u,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,n){const r=this.scene,i=this.camera,s=this.renderTargetA,a=this.renderTargetB;let o=this.convolutionMaterial,l=o.uniforms;l.depthBuffer.value=t.depthTexture;const c=o.kernel;let h,u,d,p=t;for(u=0,d=c.length-1;u<d;++u)h=0==(1&u)?s:a,l.kernel.value=c[u],l.inputBuffer.value=p.texture,e.setRenderTarget(h),e.render(r,i),p=h;l.kernel.value=c[u],l.inputBuffer.value=p.texture,e.setRenderTarget(this.renderToScreen?null:n),e.render(r,i)}}class Dp extends a.MeshStandardMaterial{constructor(e={}){super(e),this._tDepth={value:null},this._distortionMap={value:null},this._tDiffuse={value:null},this._tDiffuseBlur={value:null},this._textureMatrix={value:null},this._hasBlur={value:!1},this._mirror={value:0},this._mixBlur={value:0},this._blurStrength={value:.5},this._minDepthThreshold={value:.9},this._maxDepthThreshold={value:1},this._depthScale={value:0},this._depthToBlurRatioBias={value:.25},this._distortion={value:1},this._mixContrast={value:1},this.setValues(e)}onBeforeCompile(e){var t;null!=(t=e.defines)&&t.USE_UV||(e.defines.USE_UV=""),e.uniforms.hasBlur=this._hasBlur,e.uniforms.tDiffuse=this._tDiffuse,e.uniforms.tDepth=this._tDepth,e.uniforms.distortionMap=this._distortionMap,e.uniforms.tDiffuseBlur=this._tDiffuseBlur,e.uniforms.textureMatrix=this._textureMatrix,e.uniforms.mirror=this._mirror,e.uniforms.mixBlur=this._mixBlur,e.uniforms.mixStrength=this._blurStrength,e.uniforms.minDepthThreshold=this._minDepthThreshold,e.uniforms.maxDepthThreshold=this._maxDepthThreshold,e.uniforms.depthScale=this._depthScale,e.uniforms.depthToBlurRatioBias=this._depthToBlurRatioBias,e.uniforms.distortion=this._distortion,e.uniforms.mixContrast=this._mixContrast,e.vertexShader=`\n uniform mat4 textureMatrix;\n varying vec4 my_vUv; \n ${e.vertexShader}`,e.vertexShader=e.vertexShader.replace("#include <project_vertex>","#include <project_vertex>\n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),e.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv; \n ${e.fragmentShader}`,e.fragmentShader=e.fragmentShader.replace("#include <emissivemap_fragment>","#include <emissivemap_fragment>\n \n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n \n vec4 merge = base;\n \n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n \n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n \n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}}(0,o.extend)({MeshReflectorMaterialImpl:Dp});const Lp=i.forwardRef((({mixBlur:e=0,mixStrength:t=1,resolution:n=256,blur:s=[0,0],minDepthThreshold:l=.9,maxDepthThreshold:c=1,depthScale:h=0,depthToBlurRatioBias:u=.25,mirror:d=0,distortion:p=1,mixContrast:f=1,distortionMap:m,reflectorOffset:g=0,...A},v)=>{const y=(0,o.useThree)((({gl:e})=>e)),x=(0,o.useThree)((({camera:e})=>e)),b=(0,o.useThree)((({scene:e})=>e)),E=(s=Array.isArray(s)?s:[s,s])[0]+s[1]>0,_=i.useRef(null),[S]=i.useState((()=>new a.Plane)),[w]=i.useState((()=>new a.Vector3)),[C]=i.useState((()=>new a.Vector3)),[T]=i.useState((()=>new a.Vector3)),[I]=i.useState((()=>new a.Matrix4)),[B]=i.useState((()=>new a.Vector3(0,0,-1))),[R]=i.useState((()=>new a.Vector4)),[P]=i.useState((()=>new a.Vector3)),[D]=i.useState((()=>new a.Vector3)),[L]=i.useState((()=>new a.Vector4)),[F]=i.useState((()=>new a.Matrix4)),[U]=i.useState((()=>new a.PerspectiveCamera)),O=i.useCallback((()=>{var e;const t=_.current.parent||(null==(e=_.current)?void 0:e.__r3f.parent);if(!t)return;if(C.setFromMatrixPosition(t.matrixWorld),T.setFromMatrixPosition(x.matrixWorld),I.extractRotation(t.matrixWorld),w.set(0,0,1),w.applyMatrix4(I),C.addScaledVector(w,g),P.subVectors(C,T),P.dot(w)>0)return;P.reflect(w).negate(),P.add(C),I.extractRotation(x.matrixWorld),B.set(0,0,-1),B.applyMatrix4(I),B.add(T),D.subVectors(C,B),D.reflect(w).negate(),D.add(C),U.position.copy(P),U.up.set(0,1,0),U.up.applyMatrix4(I),U.up.reflect(w),U.lookAt(D),U.far=x.far,U.updateMatrixWorld(),U.projectionMatrix.copy(x.projectionMatrix),F.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),F.multiply(U.projectionMatrix),F.multiply(U.matrixWorldInverse),F.multiply(t.matrixWorld),S.setFromNormalAndCoplanarPoint(w,C),S.applyMatrix4(U.matrixWorldInverse),R.set(S.normal.x,S.normal.y,S.normal.z,S.constant);const n=U.projectionMatrix;L.x=(Math.sign(R.x)+n.elements[8])/n.elements[0],L.y=(Math.sign(R.y)+n.elements[9])/n.elements[5],L.z=-1,L.w=(1+n.elements[10])/n.elements[14],R.multiplyScalar(2/R.dot(L)),n.elements[2]=R.x,n.elements[6]=R.y,n.elements[10]=R.z+1,n.elements[14]=R.w}),[x,g]),[N,k,G,z]=i.useMemo((()=>{const r={minFilter:a.LinearFilter,magFilter:a.LinearFilter,encoding:y.outputEncoding,type:a.HalfFloatType},i=new a.WebGLRenderTarget(n,n,r);i.depthBuffer=!0,i.depthTexture=new a.DepthTexture(n,n),i.depthTexture.format=a.DepthFormat,i.depthTexture.type=a.UnsignedShortType;const o=new a.WebGLRenderTarget(n,n,r);return[i,o,new Pp({gl:y,resolution:n,width:s[0],height:s[1],minDepthThreshold:l,maxDepthThreshold:c,depthScale:h,depthToBlurRatioBias:u}),{mirror:d,textureMatrix:F,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:E,mixStrength:t,minDepthThreshold:l,maxDepthThreshold:c,depthScale:h,depthToBlurRatioBias:u,transparent:!0,distortion:p,distortionMap:m,mixContrast:f,"defines-USE_BLUR":E?"":void 0,"defines-USE_DEPTH":h>0?"":void 0,"defines-USE_DISTORTION":m?"":void 0}]}),[y,s,F,n,d,E,e,t,l,c,h,u,p,m,f]);return(0,o.useFrame)((()=>{var e;const t=_.current.parent||(null==(e=_.current)?void 0:e.__r3f.parent);if(!t)return;t.visible=!1;const n=y.xr.enabled,r=y.shadowMap.autoUpdate;O(),y.xr.enabled=!1,y.shadowMap.autoUpdate=!1,y.setRenderTarget(N),y.state.buffers.depth.setMask(!0),y.autoClear||y.clear(),y.render(b,U),E&&G.render(y,N,k),y.xr.enabled=n,y.shadowMap.autoUpdate=r,t.visible=!0,y.setRenderTarget(null)})),i.createElement("meshReflectorMaterialImpl",(0,r.Z)({attach:"material",key:"key"+z["defines-USE_BLUR"]+z["defines-USE_DEPTH"]+z["defines-USE_DISTORTION"],ref:M([_,v])},z,A))}));class Fp extends a.PointsMaterial{constructor(e){super(e),this.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace("#include <output_fragment>","\n #include <output_fragment>\n vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n float r = dot(cxy, cxy);\n float delta = fwidth(r); \n float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\n gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a );\n ")}}}const Up=i.forwardRef(((e,t)=>{const[n]=i.useState((()=>new Fp(null)));return i.createElement("primitive",(0,r.Z)({},e,{object:n,ref:t,attach:"material"}))}));let Op=!1;const Np=e=>{if(!Op){Op=!0;let t=a.ShaderChunk.shadowmap_pars_fragment;t=t.replace("#ifdef USE_SHADOWMAP","#ifdef USE_SHADOWMAP\n"+(({frustum:e=3.75,size:t=.005,near:n=9.5,samples:r=17,rings:i=11}={})=>`#define LIGHT_WORLD_SIZE ${t}\n#define LIGHT_FRUSTUM_WIDTH ${e}\n#define LIGHT_SIZE_UV (LIGHT_WORLD_SIZE / LIGHT_FRUSTUM_WIDTH)\n#define NEAR_PLANE ${n}\n\n#define NUM_SAMPLES ${r}\n#define NUM_RINGS ${i}\n#define BLOCKER_SEARCH_NUM_SAMPLES NUM_SAMPLES\n#define PCF_NUM_SAMPLES NUM_SAMPLES\n\nvec2 poissonDisk[NUM_SAMPLES];\n\nvoid initPoissonSamples(const in vec2 randomSeed) {\n float ANGLE_STEP = PI2 * float(NUM_RINGS) / float(NUM_SAMPLES);\n float INV_NUM_SAMPLES = 1.0 / float(NUM_SAMPLES);\n float angle = rand(randomSeed) * PI2;\n float radius = INV_NUM_SAMPLES;\n float radiusStep = radius;\n for (int i = 0; i < NUM_SAMPLES; i++) {\n poissonDisk[i] = vec2(cos(angle), sin(angle)) * pow(radius, 0.75);\n radius += radiusStep;\n angle += ANGLE_STEP;\n }\n}\n\nfloat penumbraSize(const in float zReceiver, const in float zBlocker) { // Parallel plane estimation\n return (zReceiver - zBlocker) / zBlocker;\n}\n\nfloat findBlocker(sampler2D shadowMap, const in vec2 uv, const in float zReceiver) {\n float searchRadius = LIGHT_SIZE_UV * (zReceiver - NEAR_PLANE) / zReceiver;\n float blockerDepthSum = 0.0;\n int numBlockers = 0;\n for (int i = 0; i < BLOCKER_SEARCH_NUM_SAMPLES; i++) {\n float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * searchRadius));\n if (shadowMapDepth < zReceiver) {\n blockerDepthSum += shadowMapDepth;\n numBlockers++;\n }\n }\n if (numBlockers == 0) return -1.0;\n return blockerDepthSum / float(numBlockers);\n}\n\nfloat PCF_Filter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius) {\n float sum = 0.0;\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[ i ] * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + -poissonDisk[ i ].yx * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n return sum / (2.0 * float(PCF_NUM_SAMPLES));\n}\n\nfloat PCSS(sampler2D shadowMap, vec4 coords) {\n vec2 uv = coords.xy;\n float zReceiver = coords.z; // Assumed to be eye-space z in this code\n initPoissonSamples(uv);\n float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver);\n if (avgBlockerDepth == -1.0) return 1.0;\n float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);\n float filterRadius = penumbraRatio * LIGHT_SIZE_UV * NEAR_PLANE / zReceiver;\n return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);\n}`)({...e})),t=t.replace("#if defined( SHADOWMAP_TYPE_PCF )","\nreturn PCSS(shadowMap, shadowCoord);\n#if defined( SHADOWMAP_TYPE_PCF )"),a.ShaderChunk.shadowmap_pars_fragment=t}};function kp(e){const t=e+"BufferGeometry";return i.forwardRef((({args:e,children:n,...s},a)=>i.createElement("mesh",(0,r.Z)({ref:a},s),i.createElement(t,{attach:"geometry",args:e}),n)))}const Gp=kp("box"),zp=kp("circle"),Qp=kp("cone"),Vp=kp("cylinder"),Hp=kp("sphere"),jp=kp("plane"),Wp=kp("tube"),Xp=kp("torus"),Yp=kp("torusKnot"),qp=kp("tetrahedron"),Kp=kp("ring"),Jp=kp("polyhedron"),Zp=kp("icosahedron"),$p=kp("octahedron"),ef=kp("dodecahedron"),tf=kp("extrude"),nf=kp("lathe"),rf=1e-5;const sf=i.forwardRef((function({args:[e=1,t=1,n=1]=[],radius:s=.05,steps:o=1,smoothness:l=4,children:c,...h},u){const d=i.useMemo((()=>function(e,t,n){const r=new a.Shape,i=n-rf;return r.absarc(rf,rf,rf,-Math.PI/2,-Math.PI,!0),r.absarc(rf,t-2*i,rf,Math.PI,Math.PI/2,!0),r.absarc(e-2*i,t-2*i,rf,Math.PI/2,0,!0),r.absarc(e-2*i,rf,rf,0,-Math.PI/2,!0),r}(e,t,s)),[e,t,s]),p=i.useMemo((()=>({depth:n-2*s,bevelEnabled:!0,bevelSegments:2*l,steps:o,bevelSize:s-rf,bevelThickness:s,curveSegments:l})),[n,s,l]),f=i.useRef();return i.useLayoutEffect((()=>{f.current&&f.current.center()}),[d,p]),i.createElement("mesh",(0,r.Z)({ref:u},h),i.createElement("extrudeBufferGeometry",{attach:"geometry",ref:f,args:[d,p]}),c)}));function af(){const e=new a.BufferGeometry,t=new Float32Array([-1,-1,3,-1,-1,3]);return e.setAttribute("position",new a.BufferAttribute(t,2)),e}const of=i.forwardRef((function({children:e,...t},n){const s=i.useMemo(af,[]);return i.createElement("mesh",(0,r.Z)({ref:n,geometry:s,frustumCulled:!1},t),e)})),lf=i.forwardRef((function({children:e,alignTop:t,...n},s){const o=i.useRef(null),l=i.useRef(null);return i.useLayoutEffect((()=>{o.current.position.set(0,0,0),o.current.updateWorldMatrix(!0,!0);const e=(new a.Box3).setFromObject(l.current),n=new a.Vector3,r=new a.Sphere,i=e.max.y-e.min.y;e.getCenter(n),e.getBoundingSphere(r),o.current.position.set(-n.x,-n.y+(t?i/2:0),-n.z)}),[e]),i.createElement("group",(0,r.Z)({ref:s},n),i.createElement("group",{ref:o},i.createElement("group",{ref:l},e)))})),cf=e=>e&&e.isOrthographicCamera,hf=e=>e&&e.isBox3,uf=i.createContext(null);function df({children:e,damping:t=6,fit:n,clip:r,observe:s,margin:l=1.2,eps:c=.01,onFit:h}){const u=i.useRef(null),{camera:d,invalidate:p,size:f,controls:m}=(0,o.useThree)(),g=i.useRef(h);function A(e,t){return Math.abs(e.x-t.x)<c&&Math.abs(e.y-t.y)<c&&Math.abs(e.z-t.z)<c}function v(e,t,n,r){e.x=a.MathUtils.damp(e.x,t.x,n,r),e.y=a.MathUtils.damp(e.y,t.y,n,r),e.z=a.MathUtils.damp(e.z,t.z,n,r)}g.current=h;const[y]=i.useState((()=>({animating:!1,focus:new a.Vector3,camera:new a.Vector3,zoom:1}))),[x]=i.useState((()=>({focus:new a.Vector3,camera:new a.Vector3,zoom:1}))),[b]=i.useState((()=>new a.Box3)),E=i.useMemo((()=>{function e(){const e=b.getSize(new a.Vector3),t=b.getCenter(new a.Vector3),n=Math.max(e.x,e.y,e.z),r=cf(d)?4*n:n/(2*Math.atan(Math.PI*d.fov/360)),i=cf(d)?4*n:r/d.aspect,s=l*Math.max(r,i);return{box:b,size:e,center:t,distance:s}}return{getSize:e,refresh(t){if(hf(t))b.copy(t);else{const e=t||u.current;e.updateWorldMatrix(!0,!0),b.setFromObject(e)}if(b.isEmpty()){const e=d.position.length()||10;b.setFromCenterAndSize(new a.Vector3,new a.Vector3(e,e,e))}if("OrthographicTrackballControls"===(null==m?void 0:m.constructor.name)){const{distance:t}=e(),n=d.position.clone().sub(m.target).normalize().multiplyScalar(t),r=m.target.clone().add(n);d.position.copy(r)}return this},clip(){const{distance:t}=e();return m&&(m.maxDistance=10*t),d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),m&&m.update(),p(),this},fit(){y.camera.copy(d.position),m&&y.focus.copy(m.target);const{center:n,distance:r}=e(),i=n.clone().sub(d.position).normalize().multiplyScalar(r);if(x.camera.copy(n).sub(i),x.focus.copy(n),cf(d)){y.zoom=d.zoom;let e=0,r=0;const i=[new a.Vector3(b.min.x,b.min.y,b.min.z),new a.Vector3(b.min.x,b.max.y,b.min.z),new a.Vector3(b.min.x,b.min.y,b.max.z),new a.Vector3(b.min.x,b.max.y,b.max.z),new a.Vector3(b.max.x,b.max.y,b.max.z),new a.Vector3(b.max.x,b.max.y,b.min.z),new a.Vector3(b.max.x,b.min.y,b.max.z),new a.Vector3(b.max.x,b.min.y,b.min.z)];n.applyMatrix4(d.matrixWorldInverse);for(const t of i)t.applyMatrix4(d.matrixWorldInverse),e=Math.max(e,Math.abs(t.y-n.y)),r=Math.max(r,Math.abs(t.x-n.x));e*=2,r*=2;const s=(d.top-d.bottom)/e,o=(d.right-d.left)/r;x.zoom=Math.min(s,o)/l,t||(d.zoom=x.zoom,d.updateProjectionMatrix())}return t?y.animating=!0:(d.position.copy(x.camera),d.lookAt(x.focus),m&&(m.target.copy(x.focus),m.update())),g.current&&g.current(this.getSize()),p(),this}}}),[b,d,m,l,t,p]);i.useLayoutEffect((()=>{if(m){const e=()=>y.animating=!1;return m.addEventListener("start",e),()=>m.removeEventListener("start",e)}}),[m]);const _=i.useRef(0);return i.useLayoutEffect((()=>{(s||0==_.current++)&&(E.refresh(),n&&E.fit(),r&&E.clip())}),[f,r,n,s]),(0,o.useFrame)(((e,n)=>{if(y.animating){if(v(y.focus,x.focus,t,n),v(y.camera,x.camera,t,n),y.zoom=a.MathUtils.damp(y.zoom,x.zoom,t,n),d.position.copy(y.camera),cf(d)&&(d.zoom=y.zoom,d.updateProjectionMatrix()),m?(m.target.copy(y.focus),m.update()):d.lookAt(y.focus),p(),cf(d)&&!(Math.abs(y.zoom-x.zoom)<c))return;if(!cf(d)&&!A(y.camera,x.camera))return;if(m&&!A(y.focus,x.focus))return;y.animating=!1}})),i.createElement("group",{ref:u},i.createElement(uf.Provider,{value:E},e))}function pf(){return i.useContext(uf)}var ff=Object.defineProperty,mf=(e,t,n)=>(((e,t,n)=>{t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class gf{constructor(e=Math){mf(this,"grad3",[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]),mf(this,"grad4",[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]]),mf(this,"p",[]),mf(this,"perm",[]),mf(this,"simplex",[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]),mf(this,"dot",((e,t,n)=>e[0]*t+e[1]*n)),mf(this,"dot3",((e,t,n,r)=>e[0]*t+e[1]*n+e[2]*r)),mf(this,"dot4",((e,t,n,r,i)=>e[0]*t+e[1]*n+e[2]*r+e[3]*i)),mf(this,"noise",((e,t)=>{let n,r,i;const s=(e+t)*(.5*(Math.sqrt(3)-1)),a=Math.floor(e+s),o=Math.floor(t+s),l=(3-Math.sqrt(3))/6,c=(a+o)*l,h=e-(a-c),u=t-(o-c);let d=0,p=1;h>u&&(d=1,p=0);const f=h-d+l,m=u-p+l,g=h-1+2*l,A=u-1+2*l,v=255&a,y=255&o,x=this.perm[v+this.perm[y]]%12,b=this.perm[v+d+this.perm[y+p]]%12,E=this.perm[v+1+this.perm[y+1]]%12;let _=.5-h*h-u*u;_<0?n=0:(_*=_,n=_*_*this.dot(this.grad3[x],h,u));let S=.5-f*f-m*m;S<0?r=0:(S*=S,r=S*S*this.dot(this.grad3[b],f,m));let w=.5-g*g-A*A;return w<0?i=0:(w*=w,i=w*w*this.dot(this.grad3[E],g,A)),70*(n+r+i)})),mf(this,"noise3d",((e,t,n)=>{let r,i,s,a;const o=(e+t+n)*(1/3),l=Math.floor(e+o),c=Math.floor(t+o),h=Math.floor(n+o),u=1/6,d=(l+c+h)*u,p=e-(l-d),f=t-(c-d),m=n-(h-d);let g,A,v,y,x,b;p>=f?f>=m?(g=1,A=0,v=0,y=1,x=1,b=0):p>=m?(g=1,A=0,v=0,y=1,x=0,b=1):(g=0,A=0,v=1,y=1,x=0,b=1):f<m?(g=0,A=0,v=1,y=0,x=1,b=1):p<m?(g=0,A=1,v=0,y=0,x=1,b=1):(g=0,A=1,v=0,y=1,x=1,b=0);const E=p-g+u,_=f-A+u,S=m-v+u,w=p-y+2*u,M=f-x+2*u,C=m-b+2*u,T=p-1+.5,I=f-1+.5,B=m-1+.5,R=255&l,P=255&c,D=255&h,L=this.perm[R+this.perm[P+this.perm[D]]]%12,F=this.perm[R+g+this.perm[P+A+this.perm[D+v]]]%12,U=this.perm[R+y+this.perm[P+x+this.perm[D+b]]]%12,O=this.perm[R+1+this.perm[P+1+this.perm[D+1]]]%12;let N=.6-p*p-f*f-m*m;N<0?r=0:(N*=N,r=N*N*this.dot3(this.grad3[L],p,f,m));let k=.6-E*E-_*_-S*S;k<0?i=0:(k*=k,i=k*k*this.dot3(this.grad3[F],E,_,S));let G=.6-w*w-M*M-C*C;G<0?s=0:(G*=G,s=G*G*this.dot3(this.grad3[U],w,M,C));let z=.6-T*T-I*I-B*B;return z<0?a=0:(z*=z,a=z*z*this.dot3(this.grad3[O],T,I,B)),32*(r+i+s+a)})),mf(this,"noise4d",((e,t,n,r)=>{const i=this.grad4,s=this.simplex,a=this.perm,o=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20;let c,h,u,d,p;const f=(e+t+n+r)*o,m=Math.floor(e+f),g=Math.floor(t+f),A=Math.floor(n+f),v=Math.floor(r+f),y=(m+g+A+v)*l,x=e-(m-y),b=t-(g-y),E=n-(A-y),_=r-(v-y),S=(x>b?32:0)+(x>E?16:0)+(b>E?8:0)+(x>_?4:0)+(b>_?2:0)+(E>_?1:0);let w,M,C,T,I,B,R,P,D,L,F,U;w=s[S][0]>=3?1:0,M=s[S][1]>=3?1:0,C=s[S][2]>=3?1:0,T=s[S][3]>=3?1:0,I=s[S][0]>=2?1:0,B=s[S][1]>=2?1:0,R=s[S][2]>=2?1:0,P=s[S][3]>=2?1:0,D=s[S][0]>=1?1:0,L=s[S][1]>=1?1:0,F=s[S][2]>=1?1:0,U=s[S][3]>=1?1:0;const O=x-w+l,N=b-M+l,k=E-C+l,G=_-T+l,z=x-I+2*l,Q=b-B+2*l,V=E-R+2*l,H=_-P+2*l,j=x-D+3*l,W=b-L+3*l,X=E-F+3*l,Y=_-U+3*l,q=x-1+4*l,K=b-1+4*l,J=E-1+4*l,Z=_-1+4*l,$=255&m,ee=255&g,te=255&A,ne=255&v,re=a[$+a[ee+a[te+a[ne]]]]%32,ie=a[$+w+a[ee+M+a[te+C+a[ne+T]]]]%32,se=a[$+I+a[ee+B+a[te+R+a[ne+P]]]]%32,ae=a[$+D+a[ee+L+a[te+F+a[ne+U]]]]%32,oe=a[$+1+a[ee+1+a[te+1+a[ne+1]]]]%32;let le=.6-x*x-b*b-E*E-_*_;le<0?c=0:(le*=le,c=le*le*this.dot4(i[re],x,b,E,_));let ce=.6-O*O-N*N-k*k-G*G;ce<0?h=0:(ce*=ce,h=ce*ce*this.dot4(i[ie],O,N,k,G));let he=.6-z*z-Q*Q-V*V-H*H;he<0?u=0:(he*=he,u=he*he*this.dot4(i[se],z,Q,V,H));let ue=.6-j*j-W*W-X*X-Y*Y;ue<0?d=0:(ue*=ue,d=ue*ue*this.dot4(i[ae],j,W,X,Y));let de=.6-q*q-K*K-J*J-Z*Z;return de<0?p=0:(de*=de,p=de*de*this.dot4(i[oe],q,K,J,Z)),27*(c+h+u+d+p)}));for(let t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());for(let t=0;t<512;t++)this.perm[t]=this.p[255&t]}}const Af=i.forwardRef((({intensity:e=1,decay:t,decayRate:n=.65,maxYaw:r=.1,maxPitch:s=.1,maxRoll:a=.1,yawFrequency:l=.1,pitchFrequency:c=.1,rollFrequency:h=.1,controls:u},d)=>{const p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.controls)),m=i.useRef(e),g=i.useRef(p.rotation.clone()),[A]=i.useState((()=>new gf)),[v]=i.useState((()=>new gf)),[y]=i.useState((()=>new gf)),x=()=>{(m.current<0||m.current>1)&&(m.current=m.current<0?0:1)};return i.useImperativeHandle(d,(()=>({getIntensity:()=>m.current,setIntensity:e=>{m.current=e,x()}})),[]),i.useEffect((()=>{const e=f||(null==u?void 0:u.current),t=()=>{g.current=p.rotation.clone()};return null==e||e.addEventListener("change",t),()=>{null==e||e.removeEventListener("change",t)}}),[u,f]),(0,o.useFrame)((({clock:e},i)=>{const o=Math.pow(m.current,2),u=r*o*A.noise(e.elapsedTime*l,1),d=s*o*v.noise(e.elapsedTime*c,1),f=a*o*y.noise(e.elapsedTime*h,1);p.rotation.set(g.current.x+d,g.current.y+u,g.current.z+f),t&&m.current>0&&(m.current-=n*i,x())})),null})),vf=i.forwardRef((({children:e,speed:t=1,rotationIntensity:n=1,floatIntensity:r=1,...s},a)=>{const l=i.useRef(null),c=i.useRef(1e4*Math.random());return(0,o.useFrame)((e=>{const i=c.current+e.clock.getElapsedTime();l.current.rotation.x=Math.cos(i/4*t)/8*n,l.current.rotation.y=Math.sin(i/4*t)/8*n,l.current.rotation.z=Math.sin(i/4*t)/20*n,l.current.position.y=Math.sin(i/4*t)/10*r})),i.createElement("group",s,i.createElement("group",{ref:M([l,a])},e))}));class yf extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;let r=e.pos,i=-1,s=0,a="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=o.indexOf("\n"))&&s<t&&r<e.byteLength;)a+=o,s+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i&&(!1!==n&&(e.pos+=s+i+1),a+o.slice(0,i))},r=function(e,t,n,r){const i=e[t+3],s=Math.pow(2,i-128)/255;n[r+0]=e[t+0]*s,n[r+1]=e[t+1]*s,n[r+2]=e[t+2]*s,n[r+3]=1},i=function(e,t,n,r){const i=e[t+3],s=Math.pow(2,i-128)/255;n[r+0]=a.DataUtils.toHalfFloat(Math.min(e[t+0]*s,65504)),n[r+1]=a.DataUtils.toHalfFloat(Math.min(e[t+1]*s,65504)),n[r+2]=a.DataUtils.toHalfFloat(Math.min(e[t+2]*s,65504)),n[r+3]=a.DataUtils.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;const o=function(e){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,a=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;if(e.pos>=e.byteLength||!(l=n(e)))return t(1,"no header found");if(!(c=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(o.valid|=1,o.programtype=c[1],o.string+=l+"\n";l=n(e),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(r))&&(o.gamma=parseFloat(c[1])),(c=l.match(i))&&(o.exposure=parseFloat(c[1])),(c=l.match(s))&&(o.valid|=2,o.format=c[1]),(c=l.match(a))&&(o.valid|=4,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==o){const e=o.width,n=o.height,l=function(e,n,r){const i=n;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");const s=new Uint8Array(4*n*r);if(!s.length)return t(4,"unable to allocate buffer space");let a=0,o=0;const l=4*i,c=new Uint8Array(4),h=new Uint8Array(l);let u=r;for(;u>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],2!=c[0]||2!=c[1]||(c[2]<<8|c[3])!=i)return t(3,"bad rgbe scanline format");let n,r=0;for(;r<l&&o<e.byteLength;){n=e[o++];const i=n>128;if(i&&(n-=128),0===n||r+n>l)return t(3,"bad scanline data");if(i){const t=e[o++];for(let e=0;e<n;e++)h[r++]=t}else h.set(e.subarray(o,o+n),r),r+=n,o+=n}const d=i;for(let e=0;e<d;e++){let t=0;s[a]=h[e+t],t+=i,s[a+1]=h[e+t],t+=i,s[a+2]=h[e+t],t+=i,s[a+3]=h[e+t],a+=4}u--}return s}(s.subarray(s.pos),e,n);if(-1!==l){let t,s,c;switch(this.type){case a.FloatType:c=l.length/4;const e=new Float32Array(4*c);for(let t=0;t<c;t++)r(l,4*t,e,4*t);t=e,s=a.FloatType;break;case a.HalfFloatType:c=l.length/4;const n=new Uint16Array(4*c);for(let t=0;t<c;t++)i(l,4*t,n,4*t);t=n,s=a.HalfFloatType;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:n,data:t,header:o.string,gamma:o.gamma,exposure:o.exposure,type:s}}}return null}setDataType(e){return this.type=e,this}load(e,t,n,r){return super.load(e,(function(e,n){switch(e.type){case a.FloatType:case a.HalfFloatType:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=a.LinearFilter,e.magFilter=a.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),n,r)}}const xf={sunset:"venice/venice_sunset_1k.hdr",dawn:"kiara/kiara_1_dawn_1k.hdr",night:"dikhololo/dikhololo_night_1k.hdr",warehouse:"empty-wharehouse/empty_warehouse_01_1k.hdr",forest:"forrest-slope/forest_slope_1k.hdr",apartment:"lebombo/lebombo_1k.hdr",studio:"studio-small-3/studio_small_03_1k.hdr",city:"potsdamer-platz/potsdamer_platz_1k.hdr",park:"rooitou/rooitou_park_1k.hdr",lobby:"st-fagans/st_fagans_interior_1k.hdr"},bf="https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/",Ef=e=>{return(t=e).current&&t.current.isScene?e.current:e;var t};function _f(e){return e.map?i.createElement(Sf,e):e.children?i.createElement(wf,e):i.createElement(Mf,e)}function Sf({scene:e,background:t=!1,map:n}){const r=(0,o.useThree)((e=>e.scene));return i.useLayoutEffect((()=>{if(n){const i=Ef(e||r),s=i.background,a=i.environment;return"only"!==t&&(i.environment=n),t&&(i.background=n),()=>{"only"!==t&&(i.environment=a),t&&(i.background=s)}}}),[e,n]),null}function wf({children:e,near:t=1,far:n=1e3,resolution:r=256,frames:s=1,background:l=!1,scene:c,files:h,path:u,preset:d,extensions:p}){const f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.scene)),g=i.useRef(null),[A]=i.useState((()=>new a.Scene)),v=i.useMemo((()=>{const e=new a.WebGLCubeRenderTarget(r);return e.texture.type=a.HalfFloatType,e}),[r]);i.useLayoutEffect((()=>{1===s&&g.current.update(f,A);const e=Ef(c||m),t=e.background,n=e.environment;return"only"!==l&&(e.environment=v.texture),l&&(e.background=v.texture),()=>{"only"!==l&&(e.environment=n),l&&(e.background=t)}}),[e,c]);let y=1;return(0,o.useFrame)((()=>{(s===1/0||y<s)&&(g.current.update(f,A),y++)})),i.createElement(i.Fragment,null,(0,o.createPortal)(i.createElement(i.Fragment,null,e,i.createElement("cubeCamera",{ref:g,args:[t,n,v]}),(h||d)&&i.createElement(Sf,{background:!0,files:h,preset:d,path:u,extensions:p,scene:A})),A))}function Mf({background:e=!1,files:t=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:n="",preset:r,scene:s,extensions:l}){if(r){if(!(r in xf))throw new Error("Preset must be one of: "+Object.keys(xf).join(", "));t=xf[r],n=bf}const c=(0,o.useThree)((e=>e.scene)),h=Array.isArray(t),u=h?a.CubeTextureLoader:yf,d=(0,o.useLoader)(u,h?[t]:t,(e=>{e.setPath(n),null==e.setDataType||e.setDataType(a.FloatType),l&&l(e)})),p=h?d[0]:d;return p.mapping=h?a.CubeReflectionMapping:a.EquirectangularReflectionMapping,i.useLayoutEffect((()=>{const t=Ef(s||c),n=t.background,r=t.environment;return"only"!==e&&(t.environment=p),e&&(t.background=p),()=>{"only"!==e&&(t.environment=r),e&&(t.background=n)}}),[p,e,s]),null}const Cf={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "},Tf={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "},If=i.forwardRef((({scale:e,frames:t=1/0,opacity:n=1,width:s=1,height:l=1,blur:c=1,far:h=10,resolution:u=256,smooth:d=!0,color:p="#000000",...f},m)=>{const g=(0,o.useThree)((({scene:e})=>e)),A=(0,o.useThree)((({gl:e})=>e)),v=i.useRef(null);s*=Array.isArray(e)?e[0]:e||1,l*=Array.isArray(e)?e[1]:e||1;const[y,x,b,E,_,S,w]=i.useMemo((()=>{const e=new a.WebGLRenderTarget(u,u),t=new a.WebGLRenderTarget(u,u);t.texture.generateMipmaps=e.texture.generateMipmaps=!1;const n=new a.PlaneBufferGeometry(s,l).rotateX(Math.PI/2),r=new a.Mesh(n),i=new a.MeshDepthMaterial;i.depthTest=i.depthWrite=!1,i.onBeforeCompile=e=>{e.uniforms={...e.uniforms,ucolor:{value:new a.Color(p).convertSRGBToLinear()}},e.fragmentShader=e.fragmentShader.replace("void main() {","uniform vec3 ucolor;\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor, ( 1.0 - fragCoordZ ) * 1.0 );")};const o=new a.ShaderMaterial(Cf),c=new a.ShaderMaterial(Tf);return c.depthTest=o.depthTest=!1,[e,n,i,r,o,c,t]}),[u,s,l,e]),M=i.useCallback((e=>{E.visible=!0,E.material=_,_.uniforms.tDiffuse.value=y.texture,_.uniforms.h.value=1*e/256,A.setRenderTarget(w),A.render(E,v.current),E.material=S,S.uniforms.tDiffuse.value=w.texture,S.uniforms.v.value=1*e/256,A.setRenderTarget(y),A.render(E,v.current),E.visible=!1}),[]);let C=0;return(0,o.useFrame)((()=>{if(v.current&&(t===1/0||C<t)){const e=g.background;g.background=null;const t=g.overrideMaterial;g.overrideMaterial=b,A.setRenderTarget(y),A.render(g,v.current),g.overrideMaterial=t,M(c),d&&M(.4*c),A.setRenderTarget(null),g.background=e,C++}})),i.createElement("group",(0,r.Z)({"rotation-x":Math.PI/2},f,{ref:m}),i.createElement("mesh",{geometry:x,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},i.createElement("meshBasicMaterial",{map:y.texture,transparent:!0,opacity:n})),i.createElement("orthographicCamera",{ref:v,args:[-s/2,s/2,l/2,-l/2,0,h]}))})),Bf={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function Rf({children:e,controls:t,shadows:n=!0,adjustCamera:s=!0,environment:l="city",intensity:c=1,preset:h="rembrandt",shadowBias:u=0,contactShadow:d={blur:2,opacity:.5,position:[0,0,0]},...p}){const f=Bf[h],m=(0,o.useThree)((e=>e.camera)),g=(0,o.useThree)((e=>e.controls)),A=i.useRef(null),v=i.useRef(null),[{radius:y,width:x,height:b},E]=i.useState({radius:0,width:0,height:0});return i.useLayoutEffect((()=>{A.current.position.set(0,0,0),A.current.updateWorldMatrix(!0,!0);const e=(new a.Box3).setFromObject(v.current),t=new a.Vector3,n=new a.Sphere,r=e.max.y-e.min.y,i=e.max.x-e.min.x;e.getCenter(t),e.getBoundingSphere(n),E({radius:n.radius,width:i,height:r}),A.current.position.set(-t.x,-t.y+r/2,-t.z)}),[e]),i.useLayoutEffect((()=>{if(s){const e=y/(b>x?1.5:2.5);m.position.set(0,.5*y,2.5*y),m.near=.1,m.far=Math.max(5e3,4*y),m.lookAt(0,e,0);const n=g||(null==t?void 0:t.current);n&&(n.target.set(0,e,0),n.update())}}),[g,y,b,x,s]),i.createElement("group",p,i.createElement("group",{ref:A},i.createElement("group",{ref:v},e)),d&&i.createElement(If,(0,r.Z)({scale:2*y,far:y/2},d)),l&&i.createElement(_f,{preset:l}),i.createElement("ambientLight",{intensity:c/3}),i.createElement("spotLight",{penumbra:1,position:[f.main[0]*y,f.main[1]*y,f.main[2]*y],intensity:2*c,castShadow:n,"shadow-bias":u}),i.createElement("pointLight",{position:[f.fill[0]*y,f.fill[1]*y,f.fill[2]*y],intensity:c}))}const Pf=e=>0===e?0:Math.pow(2,10*e-10);function Df({children:e,floor:t=.25,segments:n=20,receiveShadow:r,...s}){const a=i.useRef(null);return i.useLayoutEffect((()=>{let e=0;const r=n/n/2,i=a.current.attributes.position;for(let s=0;s<n+1;s++)for(let a=0;a<n+1;a++)i.setXYZ(e++,s/n-r+(0===s?-t:0),a/n-r,Pf(s/n));i.needsUpdate=!0,a.current.computeVertexNormals()}),[n,t]),i.createElement("group",s,i.createElement("mesh",{receiveShadow:r,rotation:[-Math.PI/2,0,Math.PI/2]},i.createElement("planeGeometry",{ref:a,args:[1,1,n,n]}),e))}const Lf=i.forwardRef((({fog:e=!1,colorStop:t=0,color:n="black",opacity:s=.5,...o},l)=>{const c=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const r=e.getContext("2d"),i=r.createRadialGradient(e.width/2,e.height/2,0,e.width/2,e.height/2,e.width/2);return i.addColorStop(t,new a.Color(n).getStyle()),i.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=i,r.fillRect(0,0,e.width,e.height),e}),[n,t]);return i.createElement("mesh",(0,r.Z)({ref:l},o),i.createElement("planeBufferGeometry",{attach:"geometry",args:[1,1]}),i.createElement("meshBasicMaterial",{attach:"material",transparent:!0,opacity:s,fog:e},i.createElement("canvasTexture",{attach:"map",args:[c]})))}));(0,o.extend)({MeshReflectorMaterial:Dp});const Ff=i.forwardRef((({mixBlur:e=0,mixStrength:t=.5,resolution:n=256,blur:s=[0,0],args:l=[1,1],minDepthThreshold:c=.9,maxDepthThreshold:h=1,depthScale:u=0,depthToBlurRatioBias:d=.25,mirror:p=0,children:f,debug:m=0,distortion:g=1,mixContrast:A=1,distortionMap:v,...y},x)=>{i.useEffect((()=>{console.warn("Reflector has been deprecated and will be removed next major. Replace it with <MeshReflectorMaterial />!")}),[]);const b=(0,o.useThree)((({gl:e})=>e)),E=(0,o.useThree)((({camera:e})=>e)),_=(0,o.useThree)((({scene:e})=>e)),S=(s=Array.isArray(s)?s:[s,s])[0]+s[1]>0,w=i.useRef(null),[C]=i.useState((()=>new a.Plane)),[T]=i.useState((()=>new a.Vector3)),[I]=i.useState((()=>new a.Vector3)),[B]=i.useState((()=>new a.Vector3)),[R]=i.useState((()=>new a.Matrix4)),[P]=i.useState((()=>new a.Vector3(0,0,-1))),[D]=i.useState((()=>new a.Vector4)),[L]=i.useState((()=>new a.Vector3)),[F]=i.useState((()=>new a.Vector3)),[U]=i.useState((()=>new a.Vector4)),[O]=i.useState((()=>new a.Matrix4)),[N]=i.useState((()=>new a.PerspectiveCamera)),k=i.useCallback((()=>{if(I.setFromMatrixPosition(w.current.matrixWorld),B.setFromMatrixPosition(E.matrixWorld),R.extractRotation(w.current.matrixWorld),T.set(0,0,1),T.applyMatrix4(R),L.subVectors(I,B),L.dot(T)>0)return;L.reflect(T).negate(),L.add(I),R.extractRotation(E.matrixWorld),P.set(0,0,-1),P.applyMatrix4(R),P.add(B),F.subVectors(I,P),F.reflect(T).negate(),F.add(I),N.position.copy(L),N.up.set(0,1,0),N.up.applyMatrix4(R),N.up.reflect(T),N.lookAt(F),N.far=E.far,N.updateMatrixWorld(),N.projectionMatrix.copy(E.projectionMatrix),O.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),O.multiply(N.projectionMatrix),O.multiply(N.matrixWorldInverse),O.multiply(w.current.matrixWorld),C.setFromNormalAndCoplanarPoint(T,I),C.applyMatrix4(N.matrixWorldInverse),D.set(C.normal.x,C.normal.y,C.normal.z,C.constant);const e=N.projectionMatrix;U.x=(Math.sign(D.x)+e.elements[8])/e.elements[0],U.y=(Math.sign(D.y)+e.elements[9])/e.elements[5],U.z=-1,U.w=(1+e.elements[10])/e.elements[14],D.multiplyScalar(2/D.dot(U)),e.elements[2]=D.x,e.elements[6]=D.y,e.elements[10]=D.z+1,e.elements[14]=D.w}),[]),[G,z,Q,V]=i.useMemo((()=>{const r={minFilter:a.LinearFilter,magFilter:a.LinearFilter,encoding:b.outputEncoding},i=new a.WebGLRenderTarget(n,n,r);i.depthBuffer=!0,i.depthTexture=new a.DepthTexture(n,n),i.depthTexture.format=a.DepthFormat,i.depthTexture.type=a.UnsignedShortType;const o=new a.WebGLRenderTarget(n,n,r);return[i,o,new Pp({gl:b,resolution:n,width:s[0],height:s[1],minDepthThreshold:c,maxDepthThreshold:h,depthScale:u,depthToBlurRatioBias:d}),{mirror:p,textureMatrix:O,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:S,mixStrength:t,minDepthThreshold:c,maxDepthThreshold:h,depthScale:u,depthToBlurRatioBias:d,transparent:!0,debug:m,distortion:g,distortionMap:v,mixContrast:A,"defines-USE_BLUR":S?"":void 0,"defines-USE_DEPTH":u>0?"":void 0,"defines-USE_DISTORTION":v?"":void 0}]}),[b,s,O,n,p,S,e,t,c,h,u,d,m,g,v,A]);return(0,o.useFrame)((()=>{if(null==w||!w.current)return;w.current.visible=!1;const e=b.xr.enabled,t=b.shadowMap.autoUpdate;k(),b.xr.enabled=!1,b.shadowMap.autoUpdate=!1,b.setRenderTarget(G),b.state.buffers.depth.setMask(!0),b.autoClear||b.clear(),b.render(_,N),S&&Q.render(b,G,z),b.xr.enabled=e,b.shadowMap.autoUpdate=t,w.current.visible=!0,b.setRenderTarget(null)})),i.createElement("mesh",(0,r.Z)({ref:M([w,x])},y),i.createElement("planeBufferGeometry",{args:l}),f?f("meshReflectorMaterial",V):i.createElement("meshReflectorMaterial",V))}));class Uf extends a.ShaderMaterial{constructor(){super({uniforms:{depth:{value:null},opacity:{value:1},attenuation:{value:2.5},anglePower:{value:12},spotPosition:{value:new a.Vector3(0,0,0)},lightColor:{value:new a.Color("white")},cameraNear:{value:0},cameraFar:{value:1},resolution:{value:new a.Vector2(0,0)}},transparent:!0,depthWrite:!1,vertexShader:"\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n varying float vViewZ;\n varying float vIntensity;\n uniform vec3 spotPosition;\n uniform float attenuation; \n\n void main() {\n // compute intensity\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition\t= modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vec4 viewPosition = viewMatrix * worldPosition;\n vViewZ = viewPosition.z;\n float intensity\t= distance(worldPosition.xyz, spotPosition) / attenuation;\n intensity\t= 1.0 - clamp(intensity, 0.0, 1.0);\n vIntensity = intensity; \n // set gl_Position\n gl_Position\t= projectionMatrix * viewPosition;\n\n }",fragmentShader:"\n #include <packing>\n\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n uniform vec3 lightColor;\n uniform vec3 spotPosition;\n uniform float attenuation;\n uniform float anglePower;\n uniform sampler2D depth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n varying float vViewZ;\n varying float vIntensity;\n uniform float opacity;\n\n float readDepth( sampler2D depthSampler, vec2 coord ) {\n float fragCoordZ = texture2D( depthSampler, coord ).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZ;\n }\n\n void main() {\n float d = 1.0;\n bool isSoft = resolution[0] > 0.0 && resolution[1] > 0.0;\n if (isSoft) {\n vec2 sUv = gl_FragCoord.xy / resolution;\n d = readDepth(depth, sUv);\n }\n float intensity = vIntensity;\n vec3 normal\t= vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity\t= pow( dot(normal, vec3(0.0, 0.0, 1.0)), anglePower );\n intensity\t*= angleIntensity;\n // fades when z is close to sampled depth, meaning the cone is intersecting existing geometry\n if (isSoft) {\n intensity\t*= smoothstep(0., 1., vViewZ - d);\n }\n gl_FragColor = vec4(lightColor, intensity * opacity);\n\n #include <tonemapping_fragment>\n\t #include <encodings_fragment>\n }"})}}const Of=new a.Vector3,Nf=i.forwardRef((({opacity:e=1,radiusTop:t,radiusBottom:n,depthBuffer:s,color:l="white",distance:c=5,angle:h=.15,attenuation:u=5,anglePower:d=5,...p},f)=>{const m=i.useRef(null),g=(0,o.useThree)((e=>e.size)),A=(0,o.useThree)((e=>e.camera)),v=(0,o.useThree)((e=>e.viewport.dpr)),[y]=i.useState((()=>new Uf));t=void 0===t?.1:t,n=void 0===n?7*h:n,(0,o.useFrame)((()=>{y.uniforms.spotPosition.value.copy(m.current.getWorldPosition(Of)),m.current.lookAt(m.current.parent.target.getWorldPosition(Of))}));const x=i.useMemo((()=>{const e=new a.CylinderGeometry(t,n,c,128,64,!0);return e.applyMatrix4((new a.Matrix4).makeTranslation(0,-c/2,0)),e.applyMatrix4((new a.Matrix4).makeRotationX(-Math.PI/2)),e}),[h,c,t,n]);return i.createElement("spotLight",(0,r.Z)({ref:f,angle:h,color:l,distance:c},p),i.createElement("mesh",{ref:m,geometry:x,raycast:()=>null},i.createElement("primitive",{object:y,attach:"material","uniforms-opacity-value":e,"uniforms-lightColor-value":l,"uniforms-attenuation-value":u,"uniforms-anglePower-value":d,"uniforms-depth-value":s,"uniforms-cameraNear-value":A.near,"uniforms-cameraFar-value":A.far,"uniforms-resolution-value":s?[g.width*v,g.height*v]:[0,0]})))})),kf=i.forwardRef((({args:e,map:t,toneMapped:n=!1,color:s="white",form:l="rect",intensity:c=1,scale:h=1,target:u,children:d,...p},f)=>{const m=i.useRef(null);return i.useLayoutEffect((()=>{d||p.material||((0,o.applyProps)(m.current.material,{color:s}),m.current.material.color.multiplyScalar(c))}),[s,c,d,p.material]),i.useLayoutEffect((()=>{u&&m.current.lookAt(Array.isArray(u)?new a.Vector3(...u):u)}),[u]),h=Array.isArray(h)&&2===h.length?[h[0],h[1],1]:h,i.createElement("mesh",(0,r.Z)({ref:M([m,f]),scale:h},p),"circle"===l?i.createElement("ringGeometry",{args:[0,1,64]}):"ring"===l?i.createElement("ringGeometry",{args:[.5,1,64]}):"rect"===l?i.createElement("planeGeometry",null):i.createElement(l,{args:e}),d||(p.material?null:i.createElement("meshBasicMaterial",{toneMapped:n,map:t,side:a.DoubleSide})))}));var Gf=Object.defineProperty,zf=(e,t,n)=>(((e,t,n)=>{t in e?Gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);const Qf={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new a.Vector3},up:{value:new a.Vector3(0,1,0)}},vertexShader:"\n uniform vec3 sunPosition;\n uniform float rayleigh;\n uniform float turbidity;\n uniform float mieCoefficient;\n uniform vec3 up;\n\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n // constants for atmospheric scattering\n const float e = 2.71828182845904523536028747135266249775724709369995957;\n const float pi = 3.141592653589793238462643383279502884197169;\n\n // wavelength of used primaries, according to preetham\n const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n // mie stuff\n // K coefficient for the primaries\n const float v = 4.0;\n const vec3 K = vec3( 0.686, 0.678, 0.666 );\n // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n // earth shadow hack\n // cutoffAngle = pi / 1.95;\n const float cutoffAngle = 1.6110731556870734;\n const float steepness = 1.5;\n const float EE = 1000.0;\n\n float sunIntensity( float zenithAngleCos ) {\n zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n }\n\n vec3 totalMie( float T ) {\n float c = ( 0.2 * T ) * 10E-18;\n return 0.434 * c * MieConst;\n }\n\n void main() {\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position.z = gl_Position.w; // set z to camera.far\n\n vSunDirection = normalize( sunPosition );\n\n vSunE = sunIntensity( dot( vSunDirection, up ) );\n\n vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n // extinction (absorbtion + out scattering)\n // rayleigh coefficients\n vBetaR = totalRayleigh * rayleighCoefficient;\n\n // mie coefficients\n vBetaM = totalMie( turbidity ) * mieCoefficient;\n\n }\n ",fragmentShader:`\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n uniform float mieDirectionalG;\n uniform vec3 up;\n\n const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n // constants for atmospheric scattering\n const float pi = 3.141592653589793238462643383279502884197169;\n\n const float n = 1.0003; // refractive index of air\n const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n // optical length at zenith for molecules\n const float rayleighZenithLength = 8.4E3;\n const float mieZenithLength = 1.25E3;\n // 66 arc seconds -> degrees, and the cosine of that\n const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n // 3.0 / ( 16.0 * pi )\n const float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n // 1.0 / ( 4.0 * pi )\n const float ONE_OVER_FOURPI = 0.07957747154594767;\n\n float rayleighPhase( float cosTheta ) {\n return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n }\n\n float hgPhase( float cosTheta, float g ) {\n float g2 = pow( g, 2.0 );\n float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n }\n\n void main() {\n\n vec3 direction = normalize( vWorldPosition - cameraPos );\n\n // optical length\n // cutoff angle at 90 to avoid singularity in next formula.\n float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n float sR = rayleighZenithLength * inverse;\n float sM = mieZenithLength * inverse;\n\n // combined extinction factor\n vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n // in scattering\n float cosTheta = dot( direction, vSunDirection );\n\n float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n vec3 betaRTheta = vBetaR * rPhase;\n\n float mPhase = hgPhase( cosTheta, mieDirectionalG );\n vec3 betaMTheta = vBetaM * mPhase;\n\n vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n // nightsky\n float theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n float phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n vec3 L0 = vec3( 0.1 ) * Fex;\n\n // composition + solar disc\n float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n L0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n gl_FragColor = vec4( retColor, 1.0 );\n\n #include <tonemapping_fragment>\n #include <${Kc>=154?"colorspace_fragment":"encodings_fragment"}>\n\n }\n `},Vf=new a.ShaderMaterial({name:"SkyShader",fragmentShader:Qf.fragmentShader,vertexShader:Qf.vertexShader,uniforms:a.UniformsUtils.clone(Qf.uniforms),side:a.BackSide,depthWrite:!1});class Hf extends a.Mesh{constructor(){super(new a.BoxGeometry(1,1,1),Vf)}}function jf(e,t,n=new a.Vector3){const r=Math.PI*(e-.5),i=2*Math.PI*(t-.5);return n.x=Math.cos(i),n.y=Math.sin(r),n.z=Math.sin(i),n}zf(Hf,"SkyShader",Qf),zf(Hf,"material",Vf);const Wf=i.forwardRef((({inclination:e=.6,azimuth:t=.1,distance:n=1e3,mieCoefficient:s=.005,mieDirectionalG:o=.8,rayleigh:l=.5,turbidity:c=10,sunPosition:h=jf(e,t),...u},d)=>{const p=i.useMemo((()=>(new a.Vector3).setScalar(n)),[n]),[f]=i.useState((()=>new Hf));return i.createElement("primitive",(0,r.Z)({dispose:void 0,object:f,ref:d,"material-uniforms-mieCoefficient-value":s,"material-uniforms-mieDirectionalG-value":o,"material-uniforms-rayleigh-value":l,"material-uniforms-sunPosition-value":h,"material-uniforms-turbidity-value":c,scale:p},u))}));class Xf extends a.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:"\n uniform float time;\n attribute float size;\n varying vec3 vColor;\n void main() {\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);\n gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(mvPosition.x + 2.0 * time + 100.0));\n gl_Position = projectionMatrix * mvPosition;\n }",fragmentShader:"\n uniform sampler2D pointTexture;\n uniform float fade;\n varying vec3 vColor;\n void main() {\n float opacity = 1.0;\n if (fade == 1.0) {\n float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));\n }\n gl_FragColor = vec4(vColor, opacity);\n\n #include <tonemapping_fragment>\n\t #include <encodings_fragment>\n }"})}}const Yf=e=>(new a.Vector3).setFromSpherical(new a.Spherical(e,Math.acos(1-2*Math.random()),2*Math.random()*Math.PI)),qf=i.forwardRef((({radius:e=100,depth:t=50,count:n=5e3,saturation:r=0,factor:s=4,fade:l=!1},c)=>{const h=i.useRef(),[u,d,p]=i.useMemo((()=>{const i=[],o=[],l=Array.from({length:n},(()=>(.5+.5*Math.random())*s)),c=new a.Color;let h=e+t;const u=t/n;for(let e=0;e<n;e++)h-=u*Math.random(),i.push(...Yf(h).toArray()),c.setHSL(e/n,r,.9),o.push(c.r,c.g,c.b);return[new Float32Array(i),new Float32Array(o),new Float32Array(l)]}),[n,t,s,e,r]);(0,o.useFrame)((e=>h.current&&(h.current.uniforms.time.value=e.clock.getElapsedTime())));const[f]=i.useState((()=>new Xf));return i.createElement("points",{ref:c},i.createElement("bufferGeometry",{attach:"geometry"},i.createElement("bufferAttribute",{attachObject:["attributes","position"],args:[u,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],args:[d,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],args:[p,1]})),i.createElement("primitive",{dispose:void 0,ref:h,object:f,attach:"material",blending:a.AdditiveBlending,"uniforms-fade-value":l,transparent:!0,vertexColors:!0}))})),Kf="https://rawcdn.githack.com/pmndrs/drei-assets/9225a9f1fbd449d9411125c2f419b843d0308c9f/cloud.png";function Jf({opacity:e=.5,speed:t=.4,width:n=10,depth:r=1.5,segments:s=20,texture:a=Kf,color:l="#ffffff",depthTest:c=!0,...h}){const u=i.useRef(),d=Oa(a),p=i.useMemo((()=>[...new Array(s)].map(((e,r)=>({x:n/2-Math.random()*n,y:n/2-Math.random()*n,scale:.4+Math.sin((r+1)/s*Math.PI)*(10*(.2+Math.random())),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*t})))),[n,s,t]);return(0,o.useFrame)((e=>{var t;return null==(t=u.current)?void 0:t.children.forEach(((t,n)=>{t.children[0].rotation.z+=p[n].rotation,t.children[0].scale.setScalar(p[n].scale+(1+Math.sin(e.clock.getElapsedTime()/10))/2*n/10)}))})),i.createElement("group",h,i.createElement("group",{position:[0,0,s/2*r],ref:u},p.map((({x:t,y:n,scale:s,density:a},o)=>i.createElement(Oi,{key:o,position:[t,n,-o*r]},i.createElement(jp,{scale:s,rotation:[0,0,0]},i.createElement("meshStandardMaterial",{map:d,transparent:!0,opacity:s/6*a*e,depthTest:c,color:l})))))))}const Zf="https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/matcaps.json",$f="https://rawcdn.githack.com/emmelleppi/matcaps/9b36ccaaf0a24881a39062d05566c9e92be4aa0d";function em(e=0,t=1024){const n=pa((()=>fetch(Zf).then((e=>e.json()))),["matcapList"]),r=n[0],s=i.useMemo((()=>Object.keys(n).length),[]),a=`${i.useMemo((()=>"string"==typeof e?e:"number"==typeof e?n[e]:null),[e])||r}${function(e){switch(e){case 64:return"-64px";case 128:return"-128px";case 256:return"-256px";case 512:return"-512px";default:return""}}(t)}.png`,o=`${$f}/${t}/${a}`;return[Oa(o),o,s]}const tm="https://rawcdn.githack.com/pmndrs/drei-assets/7a3104997e1576f83472829815b00880d88b32fb",nm="https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/normals/normals.json";function rm(e=0,t={}){const{repeat:n=[1,1],anisotropy:r=1,offset:s=[0,0]}=t,o=pa((()=>fetch(nm).then((e=>e.json()))),["normalsList"]),l=i.useMemo((()=>Object.keys(o).length),[]),c=o[0],h=o[e]||c,u=`${tm}/normals/${h}`,d=Oa(u);return i.useLayoutEffect((()=>{d&&(d.wrapS=d.wrapT=a.RepeatWrapping,d.repeat=new a.Vector2(n[0],n[1]),d.offset=new a.Vector2(s[0],s[1]),d.anisotropy=r)}),[d,r,n,s]),[d,u,l]}const im=new a.Matrix4,sm=new a.Matrix4,am=[],om=new a.Mesh;class lm extends a.Group{constructor(){super(),this.color=new a.Color("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return null==(e=this.instance.current)?void 0:e.geometry}raycast(e,t){const n=this.instance.current;if(!n)return;if(!n.geometry||!n.material)return;om.geometry=n.geometry;const r=n.matrixWorld;let i=n.userData.instances.indexOf(this.instanceKey);if(!(-1===i||i>n.count)){n.getMatrixAt(i,im),sm.multiplyMatrices(r,im),om.matrixWorld=sm,om.raycast(e,am);for(let e=0,n=am.length;e<n;e++){const n=am[e];n.instanceId=i,n.object=this,t.push(n)}am.length=0}}}let cm,hm;const um=i.createContext(null),dm=new a.Matrix4,pm=new a.Vector3;new a.Color;const fm=i.forwardRef((({children:e,range:t,limit:n=1e3,...s},l)=>{const c=i.useRef(null),[h,u]=i.useState([]),[[d,p,f]]=i.useState((()=>[new Float32Array(3*n),Float32Array.from({length:3*n},(()=>1)),Float32Array.from({length:n},(()=>1))]));i.useLayoutEffect((()=>{c.current.geometry.drawRange.count=Math.min(n,void 0!==t?t:n,h.length)}),[h,t]),i.useEffect((()=>{c.current.geometry.attributes.position.needsUpdate=!0})),(0,o.useFrame)((()=>{for(c.current.updateMatrix(),c.current.updateMatrixWorld(),dm.copy(c.current.matrixWorld).invert(),cm=0;cm<h.length;cm++)hm=h[cm].current,pm.toArray(d,3*cm),c.current.geometry.attributes.position.needsUpdate=!0,hm.matrixWorldNeedsUpdate=!0,hm.color.toArray(p,3*cm),c.current.geometry.attributes.color.needsUpdate=!0,f.set([hm.size],cm),c.current.geometry.attributes.size.needsUpdate=!0}));const m=i.useMemo((()=>{const e={};for(cm=0;cm<h.length;cm++){var t;Object.assign(e,null==(t=h[cm].current)?void 0:t.__r3f.handlers)}return Object.keys(e).reduce(((e,t)=>({...e,[t]:e=>{var n,r,i;const s=null==(n=h[e.index])?void 0:n.current;return null==s||null==(r=s.__r3f)||null==(i=r.handlers)?void 0:i[t]({...e,object:s})}})),{})}),[e,h]),g=i.useMemo((()=>({subscribe:e=>(u((t=>[...t,e])),()=>u((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("points",(0,r.Z)({matrixAutoUpdate:!1,ref:M([l,c])},m,s),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:d.length/3,array:d,itemSize:3,usage:a.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:p.length/3,array:p,itemSize:3,usage:a.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:f.length,array:f,itemSize:1,usage:a.DynamicDrawUsage})),i.createElement(um.Provider,{value:g},e))})),mm=i.forwardRef((({children:e,...t},n)=>{i.useMemo((()=>(0,o.extend)({Position:lm})),[]);const s=i.useRef(),{subscribe:a}=i.useContext(um);return i.useLayoutEffect((()=>a(s)),[]),i.createElement("position",(0,r.Z)({ref:M([n,s])},t),e)})),gm=i.forwardRef((({children:e,positions:t,colors:n,sizes:s,stride:l=3,...c},h)=>{const u=i.useRef(null);return(0,o.useFrame)((()=>{const e=u.current.geometry.attributes;e.position.needsUpdate=!0,n&&(e.color.needsUpdate=!0),s&&(e.size.needsUpdate=!0)})),i.createElement("points",(0,r.Z)({ref:M([h,u])},c),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:t.length/l,array:t,itemSize:l,usage:a.DynamicDrawUsage}),n&&i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:n.length/l,array:n,itemSize:3,usage:a.DynamicDrawUsage}),s&&i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:s.length/l,array:s,itemSize:1,usage:a.DynamicDrawUsage})),e)})),Am=i.forwardRef(((e,t)=>e.positions instanceof Float32Array?i.createElement(gm,(0,r.Z)({},e,{ref:t})):i.createElement(fm,(0,r.Z)({},e,{ref:t}))));var vm=n(45697),ym=n.n(vm);function xm(e){return bm(e.children,e.components)}function bm(e,t,n){if(n=n||[],!t[0])return e(n);function r(r){return bm(e,t.slice(1),n.concat([r]))}return"function"==typeof t[0]?t[0]({results:n,render:r}):(0,i.cloneElement)(t[0],{children:r})}let Em,_m;xm.propTypes={children:ym().func.isRequired,components:ym().arrayOf(ym().oneOfType([ym().element,ym().func])).isRequired};const Sm=i.createContext(null),wm=new a.Matrix4,Mm=new a.Matrix4,Cm=new a.Matrix4;new a.Color;const Tm=new a.Vector3,Im=new a.Quaternion,Bm=new a.Vector3,Rm=i.forwardRef((({context:e,children:t,...n},s)=>{i.useMemo((()=>(0,o.extend)({Position:lm})),[]);const a=i.useRef(),{subscribe:l,getParent:c}=i.useContext(e||Sm);return i.useLayoutEffect((()=>l(a)),[]),i.createElement("position",(0,r.Z)({instance:c(),instanceKey:a,ref:M([s,a])},n),t)})),Pm=i.forwardRef((({children:e,range:t,limit:n=1e3,frames:s=1/0,...l},c)=>{const[{context:h,instance:u}]=i.useState((()=>{const e=i.createContext(null);return{context:e,instance:i.forwardRef(((t,n)=>i.createElement(Rm,(0,r.Z)({context:e},t,{ref:n}))))}})),d=i.useRef(null),[p,f]=i.useState([]),[[m,g]]=i.useState((()=>{const e=new Float32Array(16*n);for(Em=0;Em<n;Em++)Cm.identity().toArray(e,16*Em);return[e,new Float32Array([...new Array(3*n)].map((()=>1)))]}));i.useLayoutEffect((()=>{d.current.count=d.current.instanceMatrix.updateRange.count=d.current.instanceColor.updateRange.count=Math.min(n,void 0!==t?t:n,p.length)}),[p,t]),i.useEffect((()=>{d.current.instanceMatrix.needsUpdate=!0}));let A=0;(0,o.useFrame)((()=>{if(s===1/0||A<s){for(d.current.updateMatrix(),d.current.updateMatrixWorld(),wm.copy(d.current.matrixWorld).invert(),Em=0;Em<p.length;Em++)_m=p[Em].current,_m.matrixWorld.decompose(Tm,Im,Bm),Mm.compose(Tm,Im,Bm).premultiply(wm),Mm.toArray(m,16*Em),d.current.instanceMatrix.needsUpdate=!0,_m.color.toArray(g,3*Em),d.current.instanceColor.needsUpdate=!0;A++}}));const v=i.useMemo((()=>({getParent:()=>d,subscribe:e=>(f((t=>[...t,e])),()=>f((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("instancedMesh",(0,r.Z)({userData:{instances:p},matrixAutoUpdate:!1,ref:M([c,d]),args:[null,null,0],raycast:()=>null},l),i.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:m.length/16,array:m,itemSize:16,usage:a.DynamicDrawUsage}),i.createElement("instancedBufferAttribute",{attach:"instanceColor",count:g.length/3,array:g,itemSize:3,usage:a.DynamicDrawUsage}),"function"==typeof e?i.createElement(h.Provider,{value:v},e(u)):i.createElement(Sm.Provider,{value:v},e))}));function Dm({meshes:e,children:t,...n}){const s=Array.isArray(e);if(!s)for(const r of Object.keys(e))e[r].isMesh||delete e[r];return i.createElement(xm,{components:(s?e:Object.values(e)).map((({geometry:e,material:t})=>i.createElement(Pm,(0,r.Z)({key:e.uuid,geometry:e,material:t},n))))},(n=>s?t(...n):t(Object.keys(e).filter((t=>e[t].isMesh)).reduce(((e,t,r)=>({...e,[t]:n[r]})),{}))))}const Lm=i.createContext(null),Fm=e=>e instanceof a.Vector3?e.toArray():e,Um=i.forwardRef(((e,t)=>{const{limit:n=1e3,lineWidth:s=1,children:l,...c}=e,[h,u]=i.useState([]),[d]=i.useState((()=>new os)),[p]=i.useState((()=>new zi)),[f]=i.useState((()=>new Gi)),[m]=i.useState((()=>new a.Vector2(512,512))),[g]=i.useState((()=>Array(6*n).fill(0))),[A]=i.useState((()=>Array(6*n).fill(0))),v=i.useMemo((()=>({subscribe:e=>(u((t=>[...t,e])),()=>u((t=>t.filter((t=>t.current!==e.current)))))})),[]);return(0,o.useFrame)((()=>{for(let i=0;i<n;i++){var e;const n=null==(e=h[i])?void 0:e.current,s=n?Fm(n.start):[0,0,0],o=n?Fm(n.end):[0,0,0],l=n?(r=n.color)instanceof a.Color?r.toArray():r:[1,1,1];for(var t=0;t<3;t++)g[6*i+t]=s[t],g[6*i+t+3]=o[t],A[6*i+t]=l[t],A[6*i+t+3]=l[t]}var r;f.setColors(A),f.setPositions(g),d.computeLineDistances()})),i.createElement("primitive",{object:d,ref:t},i.createElement("primitive",{object:f,attach:"geometry"}),i.createElement("primitive",(0,r.Z)({object:p,attach:"material",vertexColors:!0,resolution:m,linewidth:s},c)),i.createElement(Lm.Provider,{value:v},l))}));class Om{constructor(){this.color=new a.Color("white"),this.start=new a.Vector3(0,0,0),this.end=new a.Vector3(0,0,0)}}const Nm=i.forwardRef(((e,t)=>{const n=i.useContext(Lm);if(!n)throw"Segment must used inside Segments component.";const s=i.useRef();return i.useMemo((()=>(0,o.extend)({SegmentObject:Om})),[]),i.useLayoutEffect((()=>n.subscribe(s)),[]),i.createElement("segmentObject",(0,r.Z)({ref:M([s,t])},e))})),km=i.forwardRef((({children:e,distances:t,...n},s)=>{const a=i.useRef(null);return i.useLayoutEffect((()=>{const{current:e}=a;e.levels.length=0,e.children.forEach(((n,r)=>e.levels.push({object:n,distance:t[r]})))})),(0,o.useFrame)((e=>{var t;return null==(t=a.current)?void 0:t.update(e.camera)})),i.createElement("lOD",(0,r.Z)({ref:M([a,s])},n),e)}));function Gm({all:e,scene:t,camera:n}){const r=(0,o.useThree)((({gl:e})=>e)),s=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({scene:e})=>e));return i.useLayoutEffect((()=>{const i=[];e&&(t||l).traverse((e=>{!1===e.visible&&(i.push(e),e.visible=!0)})),r.compile(t||l,n||s);const o=new a.WebGLCubeRenderTarget(128);new a.CubeCamera(.01,1e5,o).update(r,t||l),o.dispose(),i.forEach((e=>e.visible=!1))}),[]),null}function zm(){const e=(0,o.useThree)((e=>e.gl));return(0,i.useEffect)((()=>(e.shadowMap.autoUpdate=!1,e.shadowMap.needsUpdate=!0,()=>{e.shadowMap.autoUpdate=e.shadowMap.needsUpdate=!0})),[e.shadowMap]),null}const Qm=new a.Matrix4,Vm=new a.Ray,Hm=new a.Sphere,jm=new a.Vector3;function Wm(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),Hm.copy(n.boundingSphere),Hm.applyMatrix4(i),!1!==e.ray.intersectsSphere(Hm)&&(Qm.copy(i).invert(),Vm.copy(e.ray).applyMatrix4(Qm),null!==n.boundingBox&&null===Vm.intersectBox(n.boundingBox,jm)||t.push({distance:jm.distanceTo(e.ray.origin),point:jm.clone(),object:this})))}function Xm({pixelated:e}){const t=(0,o.useThree)((e=>e.gl)),n=(0,o.useThree)((e=>e.internal.active)),r=(0,o.useThree)((e=>e.performance.current)),s=(0,o.useThree)((e=>e.viewport.initialDpr)),a=(0,o.useThree)((e=>e.setDpr));return i.useEffect((()=>{const r=t.domElement;return()=>{n&&a(s),e&&r&&(r.style.imageRendering="auto")}}),[]),i.useEffect((()=>{a(r*s),e&&t.domElement&&(t.domElement.style.imageRendering=1===r?"auto":"pixelated")}),[r]),null}function Ym(){const e=(0,o.useThree)((e=>e.get)),t=(0,o.useThree)((e=>e.performance.current));return i.useEffect((()=>{const t=e().raycaster.enabled;return()=>{e().raycaster.enabled=t}}),[]),i.useEffect((()=>{e().raycaster.enabled=1===t}),[t]),null}},64232:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Canvas:()=>J,ReactThreeFiber:()=>E,_roots:()=>ie,act:()=>me,addAfterEffect:()=>V,addEffect:()=>Q,addTail:()=>H,advance:()=>oe,applyProps:()=>ce,context:()=>F,createPortal:()=>Ae,dispose:()=>fe,events:()=>X,extend:()=>P,invalidate:()=>ae,reconciler:()=>le,render:()=>ue,unmountComponentAtNode:()=>pe,useFrame:()=>$,useGraph:()=>te,useLoader:()=>re,useThree:()=>Z});var r=n(99477),i=n(67294),s=n(14671),a=n(60374),o=n(76525),l=n.n(o),c=n(63840),h=n(64063),u=n.n(h);const d=[];function p(e,t,n,r=0,i=!1){for(const a of t)if(u()(n,a.args)){if(i)return;if(a.error)throw a.error;if(a.response)return a.response;throw a.promise}const s={args:n,promise:e(...n).then((e=>s.response=null==e||e)).catch((e=>s.error=null!=e?e:"unknown error")).then((()=>{r>0&&setTimeout((()=>{const e=t.indexOf(s);-1!==e&&t.splice(e,1)}),r)}))};if(t.push(s),!i)throw s.promise}function f(e,...t){if(void 0===t||0===t.length)e.splice(0,e.length);else{const n=e.find((e=>u()(t,e.args)));if(n){const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}}function m(e,...t){return p(e,d,t,m.lifespan)}m.lifespan=0,m.clear=(...e)=>f(d,...e),m.preload=(e,...t)=>{p(e,d,t,m.lifespan,!0)},m.peek=(...e)=>{var t;return null==(t=d.find((t=>u()(e,t.args))))?void 0:t.response};var g=n(20296),A=n.n(g);function v(e){let{debounce:t,scroll:n,polyfill:r,offsetSize:s}=void 0===e?{debounce:0,scroll:!1,offsetSize:!1}:e;const a=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,l]=(0,i.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,i.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),h=t?"number"==typeof t?t:t.scroll:null,u=t?"number"==typeof t?t:t.resize:null,d=(0,i.useRef)(!1);(0,i.useEffect)((()=>(d.current=!0,()=>{d.current=!1})));const[p,f,m]=(0,i.useMemo)((()=>{const e=()=>{if(!c.current.element)return;const{left:e,top:t,width:n,height:r,bottom:i,right:a,x:o,y:h}=c.current.element.getBoundingClientRect(),u={left:e,top:t,width:n,height:r,bottom:i,right:a,x:o,y:h};c.current.element instanceof HTMLElement&&s&&(u.height=c.current.element.offsetHeight,u.width=c.current.element.offsetWidth),Object.freeze(u),d.current&&!b(c.current.lastBounds,u)&&l(c.current.lastBounds=u)};return[e,u?A()(e,u):e,h?A()(e,h):e]}),[l,s,h,u]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach((e=>e.removeEventListener("scroll",m,!0))),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function v(){c.current.element&&(c.current.resizeObserver=new a(m),c.current.resizeObserver.observe(c.current.element),n&&c.current.scrollContainers&&c.current.scrollContainers.forEach((e=>e.addEventListener("scroll",m,{capture:!0,passive:!0}))))}var x;return function(e,t){(0,i.useEffect)((()=>{if(t){const t=e;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",t,!0)}}}),[e,t])}(m,Boolean(n)),x=f,(0,i.useEffect)((()=>{const e=x;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[x]),(0,i.useEffect)((()=>{g(),v()}),[n,m,f]),(0,i.useEffect)((()=>g),[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=y(e),v())},o,p]}function y(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some((e=>"auto"===e||"scroll"===e))&&t.push(e),[...t,...y(e.parentElement)]}const x=["x","y","top","bottom","left","right","width","height"],b=(e,t)=>x.every((n=>e[n]===t[n]));var E=Object.freeze({__proto__:null});const _={obj:e=>e===Object(e)&&!_.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,arr:e=>Array.isArray(e),equ(e,t){if(typeof e!=typeof t||!!e!=!!t)return!1;if(_.str(e)||_.num(e)||_.obj(e))return e===t;if(_.arr(e)&&e==t)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!_.und(n)||e===t}};function S(e){return(e.eventObject||e.object).uuid+"/"+e.index}function w(e){const t=new r.Vector3;function n(t){const{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}function i(e){return e.filter((e=>["Move","Over","Enter","Out","Leave"].some((t=>{var n;return null==(n=e.__r3f.handlers)?void 0:n["onPointer"+t]}))))}function s(t){const{internal:n}=e.getState();Array.from(n.hovered.values()).forEach((e=>{if(!t.length||!t.find((t=>t.object===e.object&&t.index===e.index))){const r=e.eventObject.__r3f.handlers;if(n.hovered.delete(S(e)),r){const n={...e,intersections:t||[]};null==r.onPointerOut||r.onPointerOut(n),null==r.onPointerLeave||r.onPointerLeave(n)}}}))}function a(e,t){t.forEach((t=>{var n;return null==(n=t.__r3f.handlers)||null==n.onPointerMissed?void 0:n.onPointerMissed(e)}))}return{handlePointer:r=>{switch(r){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return t=>{"pointerId"in t&&e.getState().internal.capturedMap.delete(t.pointerId),s([])}}return o=>{const{onPointerMissed:l,internal:c}=e.getState();!function(t){var n;const r=e.getState(),{raycaster:i,mouse:s,camera:a,size:o}=r,{offsetX:l,offsetY:c}=null!=(n=null==i.computeOffsets?void 0:i.computeOffsets(t,r))?n:t,{width:h,height:u}=o;s.set(l/h*2-1,-c/u*2+1),i.setFromCamera(s,a)}(o);const h="onPointerMove"===r,u=function(t,n){const{internal:r}=e.getState();return"pointerId"in n&&r.capturedMap.has(n.pointerId)&&t.push(...r.capturedMap.get(n.pointerId).values()),t}(function(t){const n=e.getState(),{raycaster:r,internal:i}=n;if(!r.enabled)return[];const s=new Set,a=[],o=t?t(i.interaction):i.interaction;let l=r.intersectObjects(o,!0).filter((e=>{const t=S(e);return!s.has(t)&&(s.add(t),!0)}));r.filter&&(l=r.filter(l,n));for(const e of l){let t=e.object;for(;t;){var c;(null==(c=t.__r3f)?void 0:c.handlers)&&a.push({...e,eventObject:t}),t=t.parent}}return a}(h?i:void 0),o);h&&s(u),function(r,i,a){const{raycaster:o,mouse:l,camera:c,internal:h}=e.getState();if(r.length){const e=t.set(l.x,l.y,0).unproject(c),u="click"===i.type?n(i):0,d=e=>i.target.releasePointerCapture(e),p={stopped:!1};for(const t of r){const n=e=>{var n,r;return null!=(n=null==(r=h.capturedMap.get(e))?void 0:r.has(t.eventObject))&&n},f=e=>{h.capturedMap.has(e)?h.capturedMap.get(e).set(t.eventObject,t):h.capturedMap.set(e,new Map([[t.eventObject,t]])),i.target.setPointerCapture(e)};let m={};for(let e in Object.getPrototypeOf(i)){let t=i[e];"function"!=typeof t&&(m[e]=t)}let g={...t,...m,spaceX:l.x,spaceY:l.y,intersections:r,stopped:p.stopped,delta:u,unprojectedPoint:e,ray:o.ray,camera:c,stopPropagation:()=>{const e="pointerId"in i&&h.capturedMap.get(i.pointerId);(!e||e.has(t.eventObject))&&(g.stopped=p.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find((e=>e.eventObject===t.eventObject)))&&s([...r.slice(0,r.indexOf(t)),t])},target:{hasPointerCapture:n,setPointerCapture:f,releasePointerCapture:d},currentTarget:{hasPointerCapture:n,setPointerCapture:f,releasePointerCapture:d},sourceEvent:i,nativeEvent:i};if(a(g),!0===p.stopped)break}}}(u,o,(e=>{const t=e.eventObject,n=t.__r3f.handlers;if(n)if(h){if(n.onPointerOver||n.onPointerEnter||n.onPointerOut||n.onPointerLeave){const t=S(e),r=c.hovered.get(t);r?r.stopped&&e.stopPropagation():(c.hovered.set(t,e),null==n.onPointerOver||n.onPointerOver(e),null==n.onPointerEnter||n.onPointerEnter(e))}null==n.onPointerMove||n.onPointerMove(e)}else{const i=null==n?void 0:n[r];i&&("onClick"!==r&&"onContextMenu"!==r&&"onDoubleClick"!==r||c.initialHits.includes(t))&&(i(e),a(o,c.interaction.filter((e=>e!==t))))}})),"onPointerDown"===r&&(c.initialClick=[o.offsetX,o.offsetY],c.initialHits=u.map((e=>e.eventObject))),"onClick"!==r&&"onContextMenu"!==r&&"onDoubleClick"!==r||u.length||n(o)<=2&&(a(o,c.interaction),l&&l(o))}}}}const M=e=>e&&!!e.getState,C=(e,t)=>{var n,r;return{root:M(e)?e:null!=(n=null==(r=e.__r3f)?void 0:r.root)?n:t.__r3f.root,container:M(e)?e.getState().scene:e}},T="__default",I={},B=["children","key","ref"];let R={},P=e=>{R={...R,...e}};function D(e,t){const n=e;return(null!=t&&t.instance||!n.__r3f)&&(n.__r3f={root:null,memoizedProps:{},objects:[],...t}),e}const L=e=>e&&e.isOrthographicCamera,F=i.createContext(null),U=(e,t,n,i)=>{const{gl:o,size:l,shadows:c=!1,linear:h=!1,flat:u=!1,vr:d=!1,orthographic:p=!1,frameloop:f="always",dpr:m=1,performance:g,clock:A=new r.Clock,raycaster:v,camera:y,onPointerMissed:x}=i;c&&(o.shadowMap.enabled=!0,"object"==typeof c?Object.assign(o.shadowMap,c):o.shadowMap.type=r.PCFSoftShadowMap),h||(u||(o.toneMapping=r.ACESFilmicToneMapping),o.outputEncoding=r.sRGBEncoding),"never"===f&&(A.stop(),A.elapsedTime=0);const b=(0,s.Z)(((s,a)=>{const l=new r.Raycaster,{params:c,...b}=v||{};e(l,{enabled:!0,...b,params:{...l.params,...c}},{});const E=y instanceof r.Camera,_=E?y:p?new r.OrthographicCamera(0,0,0,0,.1,1e3):new r.PerspectiveCamera(75,0,.1,1e3);function S(e){return Array.isArray(e)?Math.min(Math.max(e[0],window.devicePixelRatio),e[1]):e}E||(_.position.z=5,y&&e(_,y,{}),_.lookAt(0,0,0));const w=S(m),M=new r.Vector3,C=new r.Vector3;function T(e=a().camera,t=C,n=a().size){const{width:r,height:i}=n,s=r/i,o=e.getWorldPosition(M).distanceTo(t);if(L(e))return{width:r/e.zoom,height:i/e.zoom,factor:1,distance:o,aspect:s};{const t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*o,a=n*(r/i);return{width:a,height:n,factor:r/a,distance:o,aspect:s}}}let I;const B=e=>s((t=>({performance:{...t.performance,current:e}})));return{gl:o,set:s,get:a,invalidate:()=>t(a()),advance:(e,t)=>n(e,t,a()),linear:h,flat:u,scene:D(new r.Scene),camera:_,raycaster:l,clock:A,mouse:new r.Vector2,vr:d,frameloop:f,onPointerMissed:x,performance:{current:1,min:.5,max:1,debounce:200,...g,regress:()=>{const e=a();I&&clearTimeout(I),e.performance.current!==e.performance.min&&B(e.performance.min),I=setTimeout((()=>B(a().performance.max)),e.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:w,dpr:w,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:T},setSize:(e,t)=>{const n={width:e,height:t};s((e=>({size:n,viewport:{...e.viewport,...T(_,C,n)}})))},setDpr:e=>s((t=>({viewport:{...t.viewport,dpr:S(e)}}))),events:{connected:!1},internal:{active:!1,priority:0,frames:0,lastProps:i,interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(e,t=0)=>(s((({internal:n})=>({internal:{...n,priority:n.priority+(t?1:0),subscribers:[...n.subscribers,{ref:e,priority:t}].sort(((e,t)=>e.priority-t.priority))}}))),()=>{s((({internal:n})=>({internal:{...n,priority:n.priority-(t?1:0),subscribers:n.subscribers.filter((t=>t.ref!==e))}})))})}}}));b.subscribe((()=>{const{camera:e,size:t,viewport:n,internal:i}=b.getState();i.lastProps.camera instanceof r.Camera||(L(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix(),e.updateMatrixWorld()),o.setPixelRatio(n.dpr),o.setSize(t.width,t.height)}),(e=>[e.viewport.dpr,e.size]),a.Z);const E=b.getState();return l&&E.setSize(l.width,l.height),b.subscribe((e=>t(e))),b};function O(e,t){const n=t.length;return t.push(e),()=>{t.splice(n,1)}}let N,k=[],G=[],z=[];const Q=e=>O(e,k),V=e=>O(e,G),H=e=>O(e,z);function j(e,t){for(N=0;N<e.length;N++)e[N](t)}function W(e,t){let n=t.clock.getDelta();for("never"===t.frameloop&&"number"==typeof e&&(n=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),N=0;N<t.internal.subscribers.length;N++)t.internal.subscribers[N].ref.current(t,n);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}function X(e){const{handlePointer:t}=w(e),n={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};return{connected:!1,handlers:Object.keys(n).reduce(((e,n)=>({...e,[n]:t(n)})),{}),connect:t=>{var r;const{set:i,events:s}=e.getState();null==s.disconnect||s.disconnect(),i((e=>({events:{...e.events,connected:t}}))),Object.entries(null!=(r=null==s?void 0:s.handlers)?r:[]).forEach((([e,r])=>{const[i,s]=n[e];t.addEventListener(i,r,{passive:s})}))},disconnect:()=>{const{set:t,events:r}=e.getState();var i;r.connected&&(Object.entries(null!=(i=r.handlers)?i:[]).forEach((([e,t])=>{if(r&&r.connected instanceof HTMLElement){const[i]=n[e];r.connected.removeEventListener(i,t)}})),t((e=>({events:{...e.events,connected:!1}}))))}}}const Y="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function q({set:e}){return Y((()=>(e(new Promise((()=>null))),()=>e(!1))),[]),null}class K extends i.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}function J({children:e,fallback:t,tabIndex:n,resize:r,id:s,style:a,className:o,events:l,...c}){const[h,u]=v({scroll:!0,debounce:{scroll:50,resize:0},...r}),d=i.useRef(null),[p,f]=i.useState(!1),[m,g]=i.useState(!1);if(p)throw p;if(m)throw m;return Y((()=>{u.width>0&&u.height>0&&ue(i.createElement(K,{set:g},i.createElement(i.Suspense,{fallback:i.createElement(q,{set:f})},e)),d.current,{...c,size:u,events:l||X})}),[u,e]),Y((()=>{const e=d.current;return()=>pe(e)}),[]),i.createElement("div",{ref:h,id:s,className:o,tabIndex:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...a}},i.createElement("canvas",{ref:d,style:{display:"block"}},t))}function Z(e=(e=>e),t){const n=i.useContext(F);if(!n)throw"R3F hooks can only be used within the Canvas component!";return n(e,t)}function $(e,t=0){const{subscribe:n}=i.useContext(F).getState().internal,r=i.useRef(e);return i.useLayoutEffect((()=>{r.current=e}),[e]),i.useLayoutEffect((()=>{const e=n(r,t);return()=>e()}),[t,n]),null}function ee(e){const t={nodes:{},materials:{}};return e&&e.traverse((e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function te(e){return i.useMemo((()=>ee(e)),[e])}function ne(e,t){return function(n,...r){const i=new n;return e&&e(i),Promise.all(r.map((e=>new Promise(((n,r)=>i.load(e,(e=>{e.scene&&Object.assign(e,ee(e.scene)),n(e)}),t,(t=>r(`Could not load ${e}: ${t.message}`))))))))}}function re(e,t,n,r){const i=Array.isArray(t)?t:[t],s=m(ne(n,r),e,...i);return Array.isArray(t)?s:s[0]}K.getDerivedStateFromError=()=>({error:!0}),re.preload=function(e,t,n){const r=Array.isArray(t)?t:[t];return m.preload(ne(n),e,...r)};const ie=new Map,se=["legacy","blocking","concurrent"],{invalidate:ae,advance:oe}=function(e){let t,n=!1;function r(i){if(n=!0,t=0,j(k,i),e.forEach((e=>{const n=e.store.getState();n.internal.active&&("always"===n.frameloop||n.internal.frames>0)&&(t+=W(i,n))})),j(G,i),t>0)return requestAnimationFrame(r);j(z,i),n=!1}return{loop:r,invalidate:function t(i){if(!i)return e.forEach((e=>t(e.store.getState())));!i.vr&&i.internal.active&&"never"!==i.frameloop&&(i.internal.frames=Math.min(60,i.internal.frames+1),n||(n=!0,requestAnimationFrame(r)))},advance:function(t,n=!0,r){n&&j(k,t),r?W(t,r):e.forEach((e=>W(t,e.store.getState()))),n&&j(G,t)}}}(ie),{reconciler:le,applyProps:ce}=function(e){function t(e,t,s={},a=!1){var o,l,c;const h=null!=(o=null==e?void 0:e.__r3f)?o:{},u=h.root,d=null!=(l=null==u||null==u.getState?void 0:u.getState())?l:{},p=[],f=[],m={};let g=0;Object.entries(t).forEach((([e,t])=>{-1===B.indexOf(e)&&(m[e]=t)})),h.memoizedProps&&h.memoizedProps.args&&(m.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(m.attach=h.memoizedProps.attach),e.__r3f&&(e.__r3f.memoizedProps=m);let A=Object.keys(t);for(g=0;g<A.length;g++)_.equ(t[A[g]],s[A[g]])&&p.push(A[g]),_.fun(t[A[g]])&&/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(A[g])&&f.push(A[g]);const v=[];if(a)for(A=Object.keys(s),g=0;g<A.length;g++)t.hasOwnProperty(A[g])||v.push(A[g]);const y=[...p,...B];null!=(c=e.__r3f)&&c.instance&&y.push("object");const x={...t};for(A=Object.keys(x),g=0;g<A.length;g++)y.indexOf(A[g])>-1&&delete x[A[g]];const b=Object.entries(x);for(g=0;g<v.length;g++)"children"!==v[g]&&b.unshift([v[g],T+"remove"]);if(b.length>0){if(b.forEach((([t,i])=>{if(!f.includes(t)){let s=e,a=s[t];if(t.includes("-")){const n=t.split("-");if(a=n.reduce(((e,t)=>e[t]),e),!a||!a.set){const[r,...i]=n.reverse();s=i.reverse().reduce(((e,t)=>e[t]),e),t=r}}if(i===T+"remove")if(a&&a.constructor)i=new a.constructor(m.args);else if(s.constructor){const e=new s.constructor(s.__r3f.memoizedProps.args);i=e[a],e.dispose&&e.dispose()}else i=0;if(a&&a.set&&(a.copy||a instanceof r.Layers)){if(Array.isArray(i))a.fromArray?a.fromArray(i):a.set(...i);else if(a.copy&&i&&i.constructor&&a.constructor.name===i.constructor.name)a.copy(i);else if(void 0!==i){const e=a instanceof r.Color;!e&&a.setScalar?a.setScalar(i):a instanceof r.Layers&&i instanceof r.Layers?a.mask=i.mask:a.set(i),!d.linear&&e&&a.convertSRGBToLinear()}}else s[t]=i,!d.linear&&s[t]instanceof r.Texture&&(s[t].encoding=r.sRGBEncoding);n(e)}})),a&&u&&e.raycast&&h.handlers){h.handlers=void 0;const t=d.internal.interaction.indexOf(e);t>-1&&d.internal.interaction.splice(t,1)}f.length&&(a&&u&&e.raycast&&d.internal.interaction.push(e),h.handlers=f.reduce(((e,n)=>({...e,[n]:t[n]})),{})),e.parent&&i(e)}}function n(e){var t,n;const r=null==(t=e.__r3f)||null==(n=t.root)||null==n.getState?void 0:n.getState();r&&0===r.internal.frames&&r.invalidate()}function i(e){null==e.onUpdate||e.onUpdate(e)}function s(e,{args:n=[],...i},s,a,o){let l,c=`${e[0].toUpperCase()}${e.slice(1)}`;if(!M(s)&&o){const e=t=>t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo;s=e(o)}if(!s||!M(s))throw`No valid root for ${c}!`;if("primitive"===e){if(void 0===i.object)throw"Primitives without 'object' are invalid!";l=D(i.object,{root:s,instance:!0})}else{const e=R[c]||r[c];if(!e)throw`${c} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;const t=_.arr(n);l=D(t?new e(...n):new e(n),{root:s,memoizedProps:{args:t&&0===n.length?null:n}})}return c.endsWith("Geometry")?i={attach:"geometry",...i}:c.endsWith("Material")&&(i={attach:"material",...i}),t(l,i,{}),l}function a(e,t){let r=!1;t&&(t.attachArray?(_.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject?(_.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t):t.attach&&!_.fun(t.attach)?e[t.attach]=t:t.isObject3D&&(e.add(t),r=!0),r||(e.__r3f.objects.push(t),t.parent=e),i(t),n(t))}function o(e,t,r){let s=!1;if(t){if(t.attachArray){const n=e[t.attachArray];_.arr(n)||(e[t.attachArray]=[]),n.splice(n.indexOf(r),0,t)}else{if(t.attachObject||t.attach&&!_.fun(t.attach))return s=!0,a(e,t);if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});const n=e.children.filter((e=>e!==t)),i=n.indexOf(r);e.children=[...n.slice(0,i),t,...n.slice(i)],s=!0}}s||(e.__r3f.objects.push(t),t.parent=e),i(t),n(t)}}function h(e,t,n=!1){e&&[...e].forEach((e=>u(t,e,n)))}function u(e,t,r){if(t){var i;if(e.__r3f.objects){const n=e.__r3f.objects.length;e.__r3f.objects=e.__r3f.objects.filter((e=>e!==t));e.__r3f.objects.length<n&&(t.parent=null)}if(t.attachArray)e[t.attachArray]=e[t.attachArray].filter((e=>e!==t));else if(t.attachObject)delete e[t.attachObject[0]][t.attachObject[1]];else if(t.attach&&!_.fun(t.attach))e[t.attach]=null;else if(t.isObject3D){var s;e.remove(t),null!=(s=t.__r3f)&&s.root&&function(e,t){const{internal:n}=e.getState();n.interaction=n.interaction.filter((e=>e!==t)),n.initialHits=n.initialHits.filter((e=>e!==t)),n.hovered.forEach(((e,r)=>{e.eventObject!==t&&e.object!==t||n.hovered.delete(r)}))}(t.__r3f.root,t)}const o=null==(i=t.__r3f)?void 0:i.instance,l=void 0===r?null!==t.dispose&&!o:r;var a;if(!o)h(null==(a=t.__r3f)?void 0:a.objects,t,l),h(t.children,t,l);t.__r3f&&(delete t.__r3f.root,delete t.__r3f.objects,delete t.__r3f.handlers,delete t.__r3f.memoizedProps,o||delete t.__r3f),l&&t.dispose&&"Scene"!==t.type&&(0,c.unstable_runWithPriority)(c.unstable_IdlePriority,(()=>t.dispose())),n(e)}}function d(e,t,n,r){const i=e.parent;if(!i)return;const o=s(t,n,e.__r3f.root);e.children&&(e.children.forEach((e=>a(o,e))),e.children=[]),e.__r3f.objects.forEach((e=>a(o,e))),e.__r3f.objects=[],u(i,e),a(i,o),[r,r.alternate].forEach((e=>{null!==e&&(e.stateNode=o,e.ref&&("function"==typeof e.ref?e.ref(o):e.ref.current=o))}))}return{reconciler:l()({now:c.unstable_now,createInstance:s,removeChild:u,appendChild:a,appendInitialChild:a,insertBefore:o,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:_.fun(setTimeout)?setTimeout:void 0,cancelTimeout:_.fun(clearTimeout)?clearTimeout:void 0,setTimeout:_.fun(setTimeout)?setTimeout:void 0,clearTimeout:_.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:(e,t)=>{const{container:n,root:r}=C(e,t);n.__r3f.root=r,a(n,t)},removeChildFromContainer:(e,t)=>{const{container:n}=C(e,t);u(n,t)},insertInContainerBefore:(e,t,n)=>{const{container:r}=C(e,t);o(r,t,n)},commitUpdate(e,n,r,i,s,a){if(e.__r3f.instance&&s.object&&s.object!==e)d(e,r,s,a);else{const{args:n=[],...o}=s,{args:l=[],...c}=i;n.some(((e,t)=>_.obj(e)?Object.entries(e).some((([e,n])=>n!==l[t][e])):e!==l[t]))?d(e,r,s,a):t(e,o,c,!0)}},hideInstance(e){e.isObject3D&&(e.visible=!1,n(e))},unhideInstance(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,n(e))},hideTextInstance(){throw new Error("Text is not allowed in the R3F tree.")},getPublicInstance:e=>e,getRootHostContext:e=>I,getChildHostContext:e=>I,createTextInstance(){},finalizeInitialChildren:e=>!!e.__r3f.handlers,commitMount(e){e.raycast&&e.__r3f.handlers&&e.__r3f.root.getState().internal.interaction.push(e)},prepareUpdate:()=>I,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount(...e){},resetAfterCommit(){},shouldSetTextContent:()=>!1,clearContainer:()=>!1}),applyProps:t}}(),he=(e,t)=>{return(n=e)&&n.render?e:new r.WebGLRenderer({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...e});var n};function ue(e,t,{gl:n,size:r,mode:s=se[1],events:a,onCreated:o,...l}={}){var c,h,u,d,p;r||(r={width:null!=(h=null==(u=t.parentElement)?void 0:u.clientWidth)?h:0,height:null!=(d=null==(p=t.parentElement)?void 0:p.clientHeight)?d:0});let f=ie.get(t),m=null==f?void 0:f.fiber,g=null==f?void 0:f.store,A=null==(c=g)?void 0:c.getState();if(m&&A){const e=A.internal.lastProps;void 0===l.dpr||_.equ(e.dpr,l.dpr)||A.setDpr(l.dpr),void 0===r||_.equ(e.size,r)||A.setSize(r.width,r.height);l.linear!==e.linear&&(pe(t),m=void 0)}if(!m){const e=he(n,t);l.vr&&(e.xr.enabled=!0,e.setAnimationLoop((e=>oe(e,!0)))),g=U(ce,ae,oe,{gl:e,size:r,...l});const i=g.getState();i.get,m=le.createContainer(g,se.indexOf(s),!1,null),ie.set(t,{fiber:m,store:g}),a&&i.set({events:a(g)})}if(g&&m)return le.updateContainer(i.createElement(de,{store:g,element:e,onCreated:o,target:t}),m,null,(()=>{})),g;throw"Error creating root!"}function de({store:e,element:t,onCreated:n,target:r}){return i.useEffect((()=>{const t=e.getState();t.set((e=>({internal:{...e.internal,active:!0}}))),null==t.events.connect||t.events.connect(r),n&&n(t)}),[]),i.createElement(F.Provider,{value:e},t)}function pe(e,t){const n=ie.get(e),r=null==n?void 0:n.fiber;if(r){const i=null==n?void 0:n.store.getState();i&&(i.internal.active=!1),le.updateContainer(null,r,null,(()=>{i&&setTimeout((()=>{var n,r,s;null==i.events.disconnect||i.events.disconnect(),null==(n=i.gl)||null==(r=n.renderLists)||null==r.dispose||r.dispose(),null==(s=i.gl)||null==s.forceContextLoss||s.forceContextLoss(),fe(i),ie.delete(e),t&&t(e)}),500)}))}}function fe(e){e.dispose&&"Scene"!==e.type&&e.dispose();for(const r in e){var t,n;null==(t=(n=r).dispose)||t.call(n),delete e[r]}}const me=le.act,ge=_.fun(Symbol)&&Symbol.for?Symbol.for("react.portal"):60106;function Ae(e,t,n,r=null){return{$$typeof:ge,key:null==r?null:""+r,children:e,containerInfo:D(t),implementation:n}}le.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"17.0.2"})},27460:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeepRatio=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=r.__importDefault(n(58147));t.KeepRatio=e=>{let{children:t,width:n,height:r,fullHeight:o=!1,fullWidth:l=!0,rootProps:c,contentProps:h,containerWidth:u,containerHeight:d,keep:p=!0}=e;const f=!o&&l,m=!f,g=100*(m?r/n:n/r);return s.default.createElement("div",{...c??{},className:(0,i.default)(a.default.root,f&&a.default.fullWidth,m&&a.default.fullHeight,p&&a.default.keep,c?.className)},s.default.createElement("div",{...h??{},className:(0,i.default)(a.default.content,h?.className)},t),p&&s.default.createElement("svg",{style:{pointerEvents:"none",height:m?"100%":d?`calc(${r} / ${n} * ${u})`:"auto",width:f?"100%":d?`calc(${n} / ${r} * ${d})`:"auto"},viewBox:`0 0 ${f?g:100} ${m?g:100}`}))}},94428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(27460),t)},44323:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccordionItem=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importStar(n(67294));n(11403);const a=n(31665),o=n(78870),l=r.__importDefault(n(73955));t.AccordionItem=e=>{let{open:t,onToggle:n,title:r,className:c,children:h,...u}=e;const d=(0,l.default)("accordion-item-"),[p,f]=(0,s.useState)(t??!1);void 0!==t&&t!==p&&f(t);return s.default.createElement("div",{className:(0,i.default)(c,"mdx-accordion-item",p&&"mdx-accordion-item--open"),...u},s.default.createElement("input",{type:"checkbox",id:d,checked:p}),s.default.createElement("div",{role:"button",className:"mdx-accordion-item__header",onClick:()=>{void 0!==t?n&&n(!p):f((e=>!e))}},s.default.createElement(a.Typography,{className:"mdx-accordion-item__title",variant:"h5",component:"label",htmlFor:d},r),s.default.createElement("div",{className:"mdx-accordion-item__icon"},p?s.default.createElement(o.IconRemove,null):s.default.createElement(o.IconAdd,null))),s.default.createElement("div",{className:"mdx-accordion-item__content-wrapper"},s.default.createElement("div",{className:"mdx-accordion-item__content"},h)))}},56027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(44323),t)},80584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(50941)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294));n(93255);t.AppCard=e=>{let{logoSrc:t,logoSrcDark:n,name:r,description:l,link:c,linkLabel:h,...u}=e;return o.default.createElement("div",{...u,className:(0,a.default)(u.className,"mdx-app-card")},(t||n)&&o.default.createElement(s.default,{sources:{dark:n??t??"",light:t??n??""},alt:"string"==typeof r?r:"",className:"mdx-app-card__logo"}),o.default.createElement(i.Typography,{component:"span",variant:"h5",className:"mdx-app-card__name"},r),o.default.createElement(i.Typography,{variant:"subtitle1",className:"mdx-app-card__description"},l),c&&o.default.createElement("a",{href:c,target:"_blank",className:"mdx-app-card__link"},o.default.createElement(i.Button,{size:"large",variant:"outlined"},o.default.createElement(i.Typography,{variant:"label1",component:"span"},h??o.default.createElement(o.default.Fragment,null,"Visit ",r)),o.default.createElement("span",null,o.default.createElement(i.PickIcon,{color:"primary"})))))}},45138:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(80584),t)},53997:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssetCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(78870),l=n(94428);n(77877);t.AssetCard=e=>{let{title:t,previewSrc:n,downloadable:r,forceDownload:c=!1,...h}=e;const u=r&&r.length>0;return a.default.createElement("div",{...h,className:(0,s.default)(h.className,"mdx-asset-card",u&&"mdx-asset-card--downloadable")},a.default.createElement("div",{className:"mdx-asset-card__inner"},t&&a.default.createElement(i.Typography,{component:"div",variant:"subtitle2",className:"mdx-asset-card__title"},t),a.default.createElement(l.KeepRatio,{width:16,height:9,fullWidth:!0,rootProps:{className:"mdx-asset-card__image"}},a.default.createElement("img",{src:n,alt:"string"==typeof t&&t||"asset image"}))),u&&a.default.createElement("div",{className:"mdx-asset-card__downloadables"},r.map(((e,n)=>a.default.createElement("a",{href:e.src,target:"_blank",download:!0,onClick:n=>((e,n)=>{if(!c)return;e.preventDefault();const{src:r,filename:i}=n,s=document.createElement("a");s.download=i||"string"==typeof t&&t||"",fetch(r).then((e=>e.blob())).then((e=>{const t=window.URL.createObjectURL(e);s.href=t,window.document.body.appendChild(s),s.click(),window.document.body.removeChild(s)})).catch((e=>{console.error("failed to download asset:"+e),s.href=r,s.target="_blank",window.document.body.appendChild(s),s.click(),window.document.body.removeChild(s)}))})(n,e)},a.default.createElement(i.Button,{key:n,variant:"outlined",size:"small",icon:a.default.createElement(o.IconDownload,null)},e.title))))))}},11734:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(53997),t)},84481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Box=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(39320);function o(e,t,n,r){const i="string"==typeof t||"number"==typeof t?{xs:t}:t,s=[],a=e=>"number"==typeof e&&r?`${e}${r}`:`${e}`;return["xs","sm","md","lg","xl"].forEach(((t,r)=>{const o=i[t];if(o)s.push([`${e}-${t}`,a(o)]);else{const i=s[r-1]?.[1];s.push([`${e}-${t}`,i||a(n)])}})),Object.fromEntries(s)}n(56216);t.Box=e=>{let{top:t=0,bottom:n=0,className:r,style:l={},children:c,...h}=e;return s.default.createElement("div",{className:(0,i.default)(r,"mdx-box"),style:(0,a.makeStyle)({...l},{...o("mdx-box-top",t,0,"px"),...o("mdx-box-bottom",n,0,"px")}),...h},c)}},84777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(84481),t)},81992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionButton=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(39960)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294));n(51928);t.CallToActionButton=e=>{let{className:t,variant:n="filled",size:r="large",children:l,...c}=e;return o.default.createElement(s.default,{className:(0,a.default)("mdx-cta-button",t),...c},o.default.createElement(i.Typography,{component:"span",variant:"large"===r?"label1":"label2"},o.default.createElement(i.Button,{size:r,variant:n},l)))}},16607:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(81992),t)},4666:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionSection=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(83639);n(8981);t.CallToActionSection=e=>{let{label:t,href:n,title:r,columns:l=1,description:c,list:h=[],target:u,className:d,children:p,variant:f="outlined",...m}=e;const g=!!c,A=h.length>0,v=!!n,y=!r||g||v||A?r&&!c&&!A&&v?"title-button":r&&c&&2===l?"full-width":r&&c&&h.length>0?"list":"simple":"title-only";return a.default.createElement("div",{className:(0,s.default)(d,"mdx-cta-section",`mdx-cta-section--${y}`),...m},a.default.createElement("div",{className:"mdx-cta-section__container"},a.default.createElement(i.Typography,{component:"h2",className:"mdx-cta-section__title"},r),a.default.createElement(i.Typography,{component:"h3",className:"mdx-cta-section__description"},c),n&&a.default.createElement(o.CallToActionButton,{target:u,href:n,className:"mdx-cta-section__link",variant:f},t)),h.length>0&&a.default.createElement("div",{className:"mdx-cta-section__list"},h.map(((e,t)=>a.default.createElement("div",{key:t},a.default.createElement(i.Typography,{variant:"subtitle2",component:"div"},e.title),a.default.createElement(i.Typography,{variant:"h2",component:"p"},e.description))))))}},3447:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(4666),t)},83113:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocMetadata=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(39960)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294)),l=n(54400);n(46774);const c=n(94294);t.DocMetadata=e=>{let{className:t,children:n,...r}=e;const{date:h,authors:u}=(0,c.useDocMetadata)(),{content:{authorPage:d}={}}=(0,l.useDocThemeOptions)();return o.default.createElement("div",{className:(0,a.default)(t,"mdx-doc-metadata"),...r},h&&o.default.createElement(i.Typography,{variant:"body2"},h),u&&u.length>0&&o.default.createElement(o.default.Fragment,null,o.default.createElement(i.Typography,{variant:"body2"},"by"," ",u.map(((e,t)=>o.default.createElement(o.default.Fragment,{key:e.key},d?o.default.createElement(s.default,{to:`author/${e.key}`},e.name):e.name,t<u.length-1&&", "))))))}},9110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(83113),t)},94294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocMetadata=void 0;const r=n(97582),i=n(53458),s=n(54400),a=r.__importDefault(n(8260));t.useDocMetadata=()=>{const e=(0,s.useDocThemeOptions)(),{content:{authors:t=[]}={}}=e,{frontMatter:n={}}=(0,i.useDoc)(),{author:r=[],date:o}=n,l=(Array.isArray(r)?r:[r]).map((e=>t.find((t=>e===t.key)))).filter((e=>!!e));return{date:o?(0,a.default)(new Date(o),"MMM d yyyy"):"",authors:l}}},56398:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalResourceCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(50941)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294)),l=n(78870);n(84238);const c=n(94428);t.ExternalResourceCard=e=>{let{title:t,logoSrc:n,logoSrcDark:r,description:h,previewSrc:u,previewSrcDark:d,...p}=e;const f=!(!u&&!d);return o.default.createElement("a",{target:"_blank",...p,className:(0,a.default)(p.className,"mdx-erc",f&&"mdx-erc--with-preview")},f&&o.default.createElement(c.KeepRatio,{width:16,height:9,fullWidth:!0},o.default.createElement(s.default,{sources:{dark:d??u??"",light:u??d??""},alt:"string"==typeof t&&t||"preview image",className:"mdx-erc__preview-image"})),o.default.createElement("div",{className:"mdx-erc__inner"},(n||r)&&o.default.createElement(s.default,{sources:{dark:r??n??"",light:n??r??""},alt:"string"==typeof t&&t||"logo",className:"mdx-erc__logo"}),o.default.createElement(i.Typography,{variant:"body1",component:"div",className:"mdx-erc__title"},t),h&&o.default.createElement(i.Typography,{variant:"label2",component:"div",className:"mdx-erc__description"},h)),o.default.createElement("div",{className:"mdx-erc__icon"},o.default.createElement(l.IconExternalLink,{className:"mdx-erc__external-link"})))}},44385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(56398),t)},95482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureList=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294));n(69774);t.FeatureList=e=>{let{title:t="Features",alignment:n="bottom",features:r=[],className:o,ctaPosition:l="bottom",children:c,...h}=e;return a.default.createElement("div",{className:(0,s.default)(o,"mdx-feature-list",`mdx-feature-list--${n}-aligned`,`mdx-feature-list--cta-${l}`),...h},a.default.createElement("div",{className:"mdx-feature-list__header"},a.default.createElement(i.Typography,{variant:"h5",component:"h1",className:"mdx-feature-list__title"},t),c&&"top"===l&&a.default.createElement("div",{className:"mdx-feature-list__extra"},c)),a.default.createElement("div",{className:"mdx-feature-list__list"},r.map(((e,t)=>a.default.createElement("div",{key:t,className:(0,s.default)("mdx-feature-list__feature")},a.default.createElement("div",{className:"mdx-feature-list__feature-inner"},a.default.createElement(i.Typography,{variant:"subtitle1",component:"div",className:"mdx-feature-list__feature-index"},t+1),a.default.createElement(i.Typography,{variant:"h2",component:"h2",className:"mdx-feature-list__feature-title"},e.title),a.default.createElement(i.Typography,{variant:"h5",component:"h3",className:"mdx-feature-list__feature-description"},a.default.createElement("span",null,e.description))),a.default.createElement("div",{className:"mdx-feature-list__feature-border"}))))),c&&"bottom"===l&&a.default.createElement("div",{className:"mdx-feature-list__extra"},c))}},88819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(95482),t)},58994:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GithubChallenges=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(67294)),a=n(39939),o=n(27747),l=e=>{let{message:t}=e;return s.default.createElement(s.default.Fragment,null,s.default.createElement(i.Typography,{variant:"h1",className:"mdx-ghc__header"},"Open challenges"),!!t&&s.default.createElement(i.Typography,{variant:"body1"},t))};t.GithubChallenges=e=>{let{challengesData:t,useDummyData:n,subheaderText:r,filterByName:c,...h}=e,u=n?[a.dummyGithubIssue]:(e=>{let t=[];return Object.keys(e).forEach((n=>{if(!isNaN(Number(n))){const r=Object.values(e[n])[0];Array.isArray(r)&&(t=t.concat(r))}})),t})(t);if(!u||(d=u,!Array.isArray(d)||!d.length))return s.default.createElement(l,{message:"No challenges to show"});var d;if(c)try{const e=new RegExp(c,"i");u=u?.filter((t=>e.test(t.title)))}catch(p){console.error("Invalid regex pattern:",p)}return s.default.createElement("div",{...h},s.default.createElement(l,null),!!r&&s.default.createElement(i.Typography,{variant:"body1",className:"mdx-ghc-subheader-text",component:"div"},r),u.map((e=>s.default.createElement(o.SingleGithubChallenge,{key:e.id,issue:e}))))}},27747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleGithubChallenge=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(67294)),a=n(78870);n(58918);const o=r.__importDefault(n(39960));function l(e,t){void 0===t&&(t=24);const n=new URL(e),r=new URLSearchParams(n.search);return r.set("s",t.toString()),n.search=Array.from(r.entries()).map((e=>{let[t,n]=e;return`${t}=${n}`})).join("&"),n.toString()}t.SingleGithubChallenge=e=>{let{issue:t}=e;const n=(e=>{const t=new Map;return t.set(e.user.login,{name:e.user.login,avatarUrl:e.user.avatarUrl}),e.assignees.forEach((e=>{t.set(e.login,{name:e.login,avatarUrl:e.avatarUrl})})),e.comments.forEach((e=>{t.set(e.author.login,{name:e.author.login,avatarUrl:e.author.avatarUrl})})),Array.from(t.values())})(t),r=(e=>{const t=e.projects.map((e=>e.name));return 0===t.length?"":Array.from(new Set(t)).join(", ")})(t),c=""!==r,h=!!t.milestone,u=[];return c&&u.push(s.default.createElement(s.default.Fragment,null,s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__label"},r.includes(", ")?"Projects":"Project"),s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__project-name"},r))),h&&u.push(s.default.createElement(s.default.Fragment,null,s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__label"},"Milestone"),s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__milestone-text"},t.milestone))),s.default.createElement("div",{className:"mdx-ghc__container"},s.default.createElement(o.default,{href:t.url,className:"mdx-ghc__issue-title-link"},s.default.createElement(i.Typography,{variant:"h5",className:"mdx-ghc__issue-title"},t.title)),s.default.createElement("div",{className:"mdx-ghc__challenge-labels"},t.labels.map(((e,t)=>s.default.createElement(i.Typography,{variant:"body3",key:t,className:"mdx-ghc__challenge-label"},e)))),s.default.createElement("div",{className:"mdx-ghc__issue-content-grid"},s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__label"},"Participants"),s.default.createElement("div",{className:"mdx-ghc__participant-photo-container"},s.default.createElement(i.Typography,{variant:"body3",className:"mdx-ghc__comment-count",component:"div"},n.length),n.map(((e,t)=>s.default.createElement("img",{key:t,className:"mdx-ghc__participant-photo",src:l(e.avatarUrl),alt:e.name})))),u.map(((e,t)=>s.default.createElement(s.default.Fragment,{key:t},e)))),s.default.createElement(o.default,{href:t.url,className:"mdx-ghc__view-on-github-link"},s.default.createElement(i.Button,{className:"mdx-ghc__view-on-github-button",icon:s.default.createElement(a.IconExternalLink,null)},"View on GitHub")))}},39939:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dummyGithubIssue=void 0,t.dummyGithubIssue={id:"12345",title:"Bug in pagination",body:"When navigating to the second page, the first item repeats.",url:"https://github.com/user/repo/issues/12345",user:{login:"user123",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"},labels:["bug","frontend"],commentCount:3,comments:[{id:"c1",author:{login:"alice123",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"},body:"I have also noticed this issue. Working on a fix now.",createdAt:"2021-01-01T12:00:00Z"},{id:"c2",author:{login:"bob456",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"},body:"Any updates on this?",createdAt:"2021-01-02T15:30:00Z"},{id:"c3",author:{login:"jaquim",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"},body:"I like turtles.",createdAt:"2021-01-03T09:45:00Z"}],assignees:[{login:"alice123",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"},{login:"bob456",avatarUrl:"https://avatars.githubusercontent.com/u/8811422?v=4"}],milestone:"v1.0.0",created_at:"2020-12-31T11:00:00Z",updated_at:"2021-01-04T13:00:00Z",projects:[{name:"Awesome Project"}]}},2561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(58994),t)},11907:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Grid=void 0;const r=n(97582),i=n(31665),s=n(70917),a=r.__importDefault(n(16829)),o=r.__importDefault(n(86010)),l=r.__importStar(n(67294)),c=n(98823),h=n(38915),u=n(21723);t.Grid=e=>{let{actions:t,leftLabel:n="",rightLabel:r="",spacingButtons:i=!1,children:s,...a}=e;const c=(0,l.useRef)(null);return l.default.createElement(d,{...a,className:(0,o.default)(a.className,"mdx-grid")},l.default.createElement("div",{className:"mdx-grid__actions"},t,l.default.createElement(h.ScrollButtons,{containerRef:c,className:"mdx-grid__scroll",leftLabel:n,rightLabel:r,spacing:i?"spaced":"grouped"})),l.default.createElement("div",{ref:c,className:(0,o.default)("mdx-grid__content","hidden-scrollbar")},s))},t.Grid.Item=u.GridItem;const d=a.default.div`
width: 100%;
.mdx-grid__scroll {
display: flex;
}
.mdx-grid__content {
display: grid;
gap: var(--grid-gap);
grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
overflow: hidden;
}
.mdx-grid__actions {
display: flex;
flex-direction: row;
align-items: center;
gap: 1rem;
& > * {
margin-bottom: 3rem;
}
}
${e=>i.THEME_BREAKPOINTS.map((t=>{if(!e[t])return null;const n=e[t];return c.lsdUtils.responsive(e.theme,t,"up")(s.css`
${void 0!==n.cols&&`\n --grid-cols: ${n.cols};\n `}
${void 0!==n.gap&&`\n --grid-gap: ${n.gap};\n `}
${(void 0===n.wrap||!0===n.wrap)&&s.css`
.mdx-grid__scroll {
display: none;
}
.mdx-grid__content {
display: grid;
flex-wrap: unset;
overflow-x: unset;
overflow-y: unset;
scroll-snap-type: unset;
}
`}
${void 0!==n.wrap&&!1===n.wrap&&s.css`
.mdx-grid__scroll {
display: flex;
}
.mdx-grid__content {
display: flex;
flex-wrap: nowrap;
overflow-x: scroll;
overflow-y: hidden;
scroll-snap-type: x mandatory;
}
`}
${!1===n.scrollButtons&&s.css`
.mdx-grid__scroll {
display: none;
}
`}
`)}))}
`},21723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridItem=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=r.__importDefault(n(16829)),o=n(31665),l=n(98823),c=n(70917);t.GridItem=e=>{let{children:t,...n}=e;return s.default.createElement(h,{...n,className:(0,i.default)(n.className)},t)};const h=a.default.div`
${e=>o.THEME_BREAKPOINTS.map((t=>{if(!e[t])return null;const n=e[t];return l.lsdUtils.responsive(e.theme,t,"up")(c.css`
grid-column: span ${n};
flex-basis: calc(100% / var(--grid-cols) * ${n});
`)}))}
`},7757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(97582);r.__exportStar(n(11907),t),r.__exportStar(n(21723),t)},42265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useHero=t.HeroContext=void 0;const r=n(97582).__importStar(n(67294));t.HeroContext=r.default.createContext({size:"medium"});t.useHero=()=>(0,r.useContext)(t.HeroContext)},28789:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hero=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(42265);n(91786);t.Hero=e=>{let{size:t="medium",className:n,children:r,...o}=e;return s.default.createElement(a.HeroContext.Provider,{value:{size:t}},s.default.createElement("div",{className:(0,i.default)(n,"mdx-hero",`mdx-hero--${t}`),...o},r))}},24834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(28789),t)},96417:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroAction=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(39960)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294));n(85661);t.HeroAction=e=>{let{size:t="large",variant:n="outlined",className:r,children:l,...c}=e;return o.default.createElement(s.default,{className:(0,a.default)(r,"mdx-hero-action",`mdx-hero-action--${t}`),...c},o.default.createElement(i.Button,{variant:n,size:t},o.default.createElement(i.Typography,{component:"span",variant:"label1",style:{color:"inherit"}},l)))}},83398:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(96417),t)},70906:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroActions=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294));n(57255);t.HeroActions=e=>{let{className:t,children:n,...r}=e;return s.default.createElement("div",{className:(0,i.default)(t,"mdx-hero-actions"),...r},n)}},31889:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(70906),t)},65031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroDescription=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(42265);n(30204);t.HeroDescription=e=>{let{size:t,className:n,uppercase:r=!1,children:l,...c}=e;const h=(0,o.useHero)(),u=t??(h?h.size:"medium");return a.default.createElement(i.Typography,{variant:"h4",className:(0,s.default)(n,"mdx-hero-description",`mdx-hero-description--${u}`,r?"mdx-hero-description--uppercase":""),...c},l)}},18355:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(65031),t)},9757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroInfo=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(96507),o=n(42265),l=n(83639);n(6460);t.HeroInfo=e=>{let{size:t,className:n,children:r,...c}=e;const h=(0,o.useHero)(),u=(0,a.useHydrated)(),d=t||(h?h.size:"medium");return s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:(0,i.default)(n,"mdx-hero-info",`mdx-hero-info--${d}`),...c},r),u&&s.default.createElement(l.ScrollToBottom,null))}},32922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(9757),t)},74067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsciiRenderer=void 0;const r=n(97582),i=n(46008),s=n(64232),a=r.__importStar(n(67294)),o=n(56475),l=n(37805);t.AsciiRenderer=e=>(function(e){void 0===e&&(e={});const{renderIndex:t=i.defaultAsciiConfigs.renderIndex,characters:n=i.defaultAsciiConfigs.characters,invert:r=i.defaultAsciiConfigs.invert,color:c=i.defaultAsciiConfigs.color,resolution:h=i.defaultAsciiConfigs.resolution,bgColor:u=i.defaultAsciiConfigs.bgColor,fgColor:d=i.defaultAsciiConfigs.fgColor,textShadowSize:p=i.defaultAsciiConfigs.textShadowSize,withTextShadow:f=!1}=e,{gl:m,size:g,scene:A,camera:v,viewport:y}=(0,s.useThree)(),x=(0,a.useMemo)((()=>{const e=new o.AsciiEffect(m,n,{invert:r,color:c,resolution:h});return e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.left="0px",e.domElement.style.pointerEvents="none",e}),[n,r,c,h]);(0,a.useLayoutEffect)((()=>{x.domElement.style.color=d}),[d,u]),(0,a.useEffect)((()=>{if(m.domElement.style.opacity="0",m.domElement.parentNode.appendChild(x.domElement),f){const e=document.createElement("style");e.innerHTML=`table *{text-shadow: ${(0,l.generateTextShadow)(p)};`,x.domElement.appendChild(e)}return()=>{m.domElement.style.opacity="1",m.domElement.parentNode.removeChild(x.domElement)}}),[x]),(0,a.useEffect)((()=>{x.setSize(g.width,g.height)}),[x,g]),(0,s.useFrame)((e=>{x.render(A,v)}),t)}(e),a.default.createElement(a.default.Fragment,null))},21945:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Controls=void 0;const r=n(97582),i=n(46008),s=r.__importStar(n(67294)),a=n(46439),o=n(64232),l=n(96979),c=n(37805),h=(e,t,n)=>(1-n)*e+n*t;function u(e,t,n,r){const i=Math.min(e,t)/t,s=[0,0,0];for(let a=0;a<3;a++)s[a]=h(n[a],r[a],i);return s}t.Controls=e=>{let{rotateSpeed:t=i.ROTATE_SPEED,enableZoom:n=!0,enableRotateOnScroll:r=!0,preset:h,targetPreset:d,children:p,...f}=e;const m=(0,s.useRef)(),g=(0,a.useScrollY)(),{camera:A,size:v}=(0,o.useThree)(),y=(0,s.useRef)(),[x,b]=s.default.useState(!1),[E,_]=s.default.useState(1),[S,w]=s.default.useState(0);return(0,o.useFrame)(((e,n)=>{m.current.rotation.y-=n*((0,c.isMobile)()?.6*t:t)})),(0,s.useEffect)((()=>{const e=()=>{console.log(JSON.stringify({cameraPos:A.position.toArray(),cameraRot:A.rotation.toArray().slice(0,3),controlsTarget:y.current.target.toArray()},null,2))};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[A]),(0,s.useEffect)((()=>{(0,c.isTouchDevice)()&&(y.current.minPolarAngle=Math.PI/2,y.current.maxPolarAngle=Math.PI/2,setTimeout((()=>{b(!0)}),1e3))}),[]),(0,s.useEffect)((()=>{(0,c.isMobile)()&&(_((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),1,.65)),w((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),0,.35)))}),[g]),(0,s.useEffect)((()=>{if(!n)return;if(!d)return;const e=u(g,400,h.cameraPos,d.cameraPos),t=u(g,400,h.cameraRot,d.cameraRot),r=u(g,400,h.controlsTarget,d.controlsTarget);A.position.set(...e),A.rotation.set(...t),y.current.target.set(...r),A.updateProjectionMatrix()}),[g,A]),s.default.createElement("group",{ref:m,...f,scale:E,"position-y":S},p,s.default.createElement(l.OrbitControls,{ref:y,enableZoom:!1,target:y.current?y.current.target:h.controlsTarget,enabled:!x}))}},46008:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OBJECTS_PRESETS=t.defaultPresets=t.defaultAsciiConfigs=t.INITIAL_ZOOM=t.RESIZE_SPEED_FACTOR=t.MIN_ZOOM=t.MAX_ROTATE_SPEED=t.MIN_ROTATE_SPEED=t.ROTATE_SPEED=void 0,t.ROTATE_SPEED=.1,t.MIN_ROTATE_SPEED=0,t.MAX_ROTATE_SPEED=1,t.MIN_ZOOM=.22,t.RESIZE_SPEED_FACTOR=.9,t.INITIAL_ZOOM=3,t.defaultAsciiConfigs={renderIndex:1,bgColor:"rgb(var(--lsd-surface-primary))",fgColor:"rgb(var(--lsd-text-primary))",characters:" l.o.g.o.s ",invert:!1,color:!1,resolution:.21,textShadowSize:15},t.defaultPresets={modelId:"default",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[-2.733342169570335,1.127956558492365,2.7690180385429666],controlsTarget:[-.2185887974027981,3.4320197290105474,-.08409377618890646]},abstract:{cameraPos:[-1.4826176635786852,4.021180061821954,-1.5929058418153597],cameraRot:[-2.9244096935808908,-.8625529112689497,-2.9755407843387185],controlsTarget:[-.3236695017538898,3.8072918272567,-.6236093222013962]}},t.OBJECTS_PRESETS=[t.defaultPresets,{modelId:"architecture01",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture02",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture04",simple:{cameraPos:[2.263701079468784,.6448855513810133,-1.1446840846564066],cameraRot:[-2.3314571674867457,.984733935216302,2.422537357648925],controlsTarget:[.6593539926170827,-.1266335925222026,-.4104215479626598]},abstract:{cameraPos:[1.8397825927313005,.5006635210357668,-.7112749496103248],cameraRot:[-2.0637769654190388,.941591559117755,2.1572780914058356],controlsTarget:[.7525282128865571,-.19650999135957886,-.33673737792715125]},targetLook:{cameraPos:[1.2775067913826557,1.3342390202957728,-3.123518037652026],cameraRot:[-2.6905895797482686,.32826936260575107,2.9867046984290964],controlsTarget:[.27965301570358253,.05724884619536415,-.48670374558576035]}},{modelId:"architecture05",simple:{cameraPos:[2.783916402572475,.8560027544276005,2.7596737879252995],cameraRot:[-.16075199314229247,.8310730403125255,.11920589473418516],controlsTarget:[-.13283501637059433,.4299574965789378,.13221598116033606]},abstract:{cameraPos:[-.5465903796360435,.8773980794748312,.08538618930043433],cameraRot:[-.26855166005001807,-1.1713993239674987,-.24830772343977955],controlsTarget:[-.0544632211815667,.8222830795164463,-.1148867151943581]},targetLook:{cameraPos:[-.08633866196975185,1.065498410363367,3.299441795447572],cameraRot:[-.30705338387773307,-.04232616594886318,-.01341603621000156],controlsTarget:[.057360484222938594,.03995565554668334,.06512362298065871]}},{modelId:"architecture06",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture07",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"atlas",simple:{cameraPos:[-.05747471409961126,1.1561369169508278,.2934743027588207],cameraRot:[.13523803197626882,-.45004875426349367,.05912213357583956],controlsTarget:[-.03052411570622545,1.1636581998026059,.23819862568800665]},abstract:{cameraPos:[-.18886266143333627,1.0759713173211645,.49472614307040697],cameraRot:[.11827338438455919,-.49355424749746096,.056236459481599846],controlsTarget:[-.03586918676122722,1.1095292429426495,.21231853618809665]},targetLook:{cameraPos:[-.6194495673706852,.6791728914823414,1.1145248759455844],cameraRot:[.08253419059538356,-.589296072042965,.045942607479927136],controlsTarget:[.09058057232790886,.7667301800204325,.05607398084523753]}},{modelId:"bust01",simple:{cameraPos:[-.6865425525854476,.9101267370893742,.6192780523604176],cameraRot:[-.39660492694232563,-.962317303218196,-.3309893133032883],controlsTarget:[.008888669206507317,.7229784900626205,.17240700391361993]},abstract:{cameraPos:[.025758408225725123,.9432728632646389,.5085343068565109],cameraRot:[-.016796160047877214,.23199352927595504,.003862085219634371],controlsTarget:[-.04849025797636223,.9379943498483801,.19429480114059927]},targetLook:{cameraPos:[-.0995637601904456,.9905193985583883,1.2844592429465957],cameraRot:[-.21489715158374015,-.011908392248228742,-.002599147273856083],controlsTarget:[-.08519853311178426,.7332893758986562,.10595091334036527]}},{modelId:"bust02",simple:{cameraPos:[-1.4566842350476759,1.3228318382357354,.3529107224325513],cameraRot:[-.7212161402570414,-1.161345100016008,-.6787189972933454],controlsTarget:[.13759890903780844,.8659810364239205,-.1666973840261623]},abstract:{cameraPos:[-.3488062269042841,1.3111379960412364,.033354968216059155],cameraRot:[-.7212161402570405,-1.1613451000160089,-.6787189972933446],controlsTarget:[.2227218365835886,1.147363414950647,-.15291722311874764]}},{modelId:"bust03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"discobolus",simple:{cameraPos:[.9321278495515372,1.1243517299151449,1.0437243089401456],cameraRot:[-.05449607597993083,.5948614803388417,.030560026854436973],controlsTarget:[.17851738112859908,1.0636847191934362,-.06840974825492452]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"hand",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"vase01",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"venus",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[.19165735697369993,-.4160172409280952,.07825504508386714],controlsTarget:[.1766806722765915,1.595709756901872,-.5627979418735829]},abstract:{cameraPos:[-.2543046264127692,1.591894996466899,.21161310295797725],cameraRot:[.17078534527374745,-.637502107706861,.10229142114685894],controlsTarget:[.2766995177502174,1.7137410300309837,-.49488235116491014]}},{modelId:"flower",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}}]},35020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const r=n(97582),i=n(96979),s=n(64232),a=r.__importDefault(n(86010)),o=r.__importStar(n(67294)),l=n(46008),c=n(37805),h=n(74067),u=n(21945);n(61588);const d=n(46439);function p(e){let{url:t,onMount:n=(()=>{}),...r}=e;const{scene:s}=(0,i.useGLTF)(t,"/scripts/draco-1.4.3/");return(0,o.useEffect)((()=>{n()}),[]),o.default.createElement("primitive",{object:s,...r})}t.HeroModel=e=>{const{modelId:t,preset:n,mode:r="simple",className:i,children:f,asciiConfig:m,rotateSpeed:g=l.ROTATE_SPEED,enableZoom:A,enableRotateOnScroll:v,withParallelEffect:y=!0,startY:x="bottom",...b}=e,E=((e,t,n)=>(0,o.useMemo)((()=>{if(t)return{...l.defaultPresets,[e]:t};if(!n)return l.defaultPresets;return l.OBJECTS_PRESETS.find((e=>e.modelId===n))||l.defaultPresets}),[t,n]))(r,n,t),_=(0,d.useScrollY)();return o.default.createElement("div",{className:(0,a.default)(i,"mdx-hero-model","mdx-hero-model--ascii",`mdx-hero-model--${r}`,`mdx-hero-model--${x}`),...b},o.default.createElement("div",{className:"mdx-hero-model--inner",style:{...y?{transform:"translateY(0px) scale(var(--mdx-hero-model-wrapper-scale))"}:{}}},o.default.createElement(o.Suspense,{fallback:o.default.createElement("span",null," ")},o.default.createElement(s.Canvas,{dpr:[1,2],style:{height:"100vh"},camera:{fov:50,position:E[r].cameraPos,rotation:E[r].cameraRot}},o.default.createElement("directionalLight",{position:[-10,10,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[-10,10,5],intensity:.3}),o.default.createElement("directionalLight",{position:[-10,20,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[100,-10,0],intensity:.25}),o.default.createElement(u.Controls,{rotateSpeed:g,preset:E[r],targetPreset:E.targetLook,enableZoom:"simple"!==r},o.default.createElement(o.Suspense,{fallback:o.default.createElement(p,{url:`/hero/${E.modelId}/lo.glb`})},o.default.createElement(p,{url:`/hero/${E.modelId}/hi.glb`}),o.default.createElement(h.AsciiRenderer,{...m})))))),o.default.createElement("div",{className:"mdx-hero-model--shade",style:{opacity:(0,c.mapFloat)(_,0,(0,c.calcScrollThreshold)()*l.RESIZE_SPEED_FACTOR,0,1)}}))}},10052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const r=n(97582).__importDefault(n(67294)),i=n(37805),s=n(46439),a=n(35020);t.HeroModel=e=>{if("undefined"==typeof window)return null;const t=(0,s.useScrollY)();(0,i.mapFloat)(t,0,(0,i.calcScrollThreshold)(),0,.1*window.innerHeight);return r.default.createElement("div",{style:{position:"absolute",top:0,left:0}},r.default.createElement(a.HeroModel,{...e}))}},75289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroTitle=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(42265);n(92751);t.HeroTitle=e=>{let{size:t,uppercase:n,className:r,children:l,...c}=e;const h=(0,o.useHero)(),u=t||(h?h.size:"medium"),d=void 0!==n?n:"large"===h?.size;return a.default.createElement(i.Typography,{variant:"h1",component:"h1",className:(0,s.default)(r,"mdx-hero-title",`mdx-hero-title--${u}`,d&&"mdx-hero-title--uppercase"),...c},l)}},69562:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(75289),t)},59879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroVideo=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importStar(n(67294)),a=n(39320),o=n(89321),l=n(96507),c=n(42265);n(53175);t.HeroVideo=e=>{let{placeholderSrc:t,desktop:n,mobile:r,className:h,style:u={},children:d,...p}=e;(0,c.useHero)();const f=(0,l.useHydrated)(),m=(0,s.useRef)(null),[g,A]=(0,s.useState)(!0),v=async()=>{const e=m.current;if(!e)return;e.muted=!0,e.defaultMuted=!0;const[t,n]=await(0,o.settle)((()=>e.play()));n||A(!1)};return(0,s.useEffect)((()=>{const e=document.querySelector(".col > article");if(e)return e.classList.add("overflow-hidden"),()=>{e.classList.remove("overflow-hidden")}}),[]),s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:(0,i.default)(h,"mdx-hero-video",g&&"mdx-hero-video--loading"),style:(0,a.makeStyle)({...u},{"hero-video-scale":n?.scale??"1.70951586","hero-video-offset-y":n?.offsetY??"-150px","hero-video-height":n?.height??"100%","hero-video-min-height":n?.minHeight??"min(100vh, var(--hero-max-height))","hero-video-scale-mobile":r?.scale??"1.70951586","hero-video-offset-y-mobile":r?.offsetY??"-50px","hero-video-height-mobile":r?.height??"120%","hero-video-min-height-mobile":r?.minHeight??"100vh"}),...p},s.default.createElement("div",{className:"mdx-hero-video__placeholder"},s.default.createElement("img",{src:t,alt:""})),s.default.createElement("div",{className:"mdx-hero-video__video"},f&&s.default.createElement("video",{ref:m,loop:!0,muted:!0,autoPlay:!0,playsInline:!0,onCanPlay:v,onLoadedMetadata:v},d))))}},13526:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(59879),t)},94386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JobsPerDepartment=void 0;const r=n(97582),i=n(31665),s=n(74676),a=r.__importDefault(n(67294)),o=n(68193),l=e=>{let{message:t}=e;return a.default.createElement(a.default.Fragment,null,a.default.createElement(i.Typography,{variant:"h1",className:"mdx-jpd__header"},"Current job openings"),!!t&&a.default.createElement(i.Typography,{variant:"body1"},t))};t.JobsPerDepartment=e=>{let{jobData:t,titleFilter:n="",useDummyData:r=!1,...i}=e,c=r?o.jobsPerDepartmentDummyData:t?.departments;return c&&(h=c)&&h.some((e=>e.jobs&&e.jobs.length>0))?(c&&n&&(c=c.map((e=>({...e,jobs:e.jobs.filter((e=>e.title.includes(n)))})))),a.default.createElement("div",{...i},a.default.createElement(l,null),c.map((e=>a.default.createElement(s.SingleDepartmentJobs,{key:e.name,department:e}))))):a.default.createElement(l,{message:"No job openings to show"});var h}},74676:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleDepartmentJobs=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(67294)),a=n(78870);n(37477);const o=r.__importDefault(n(39960));t.SingleDepartmentJobs=e=>{let{department:t}=e;return t.jobs&&0!==t.jobs.length?s.default.createElement("div",{className:"mdx-jpd__single-job-department-container"},s.default.createElement(i.Typography,{variant:"subtitle2",className:"mdx-jpd__department-title"},t.name),s.default.createElement("ul",{className:"mdx-jpd__job-list"},t.jobs.map(((e,t)=>s.default.createElement("li",{key:t,className:"mdx-jpd__job-list-item"},s.default.createElement(o.default,{href:e.absolute_url,target:"_blank",className:"mdx-jpd__job-link"},s.default.createElement("div",{className:"mdx-jpd__job-title-container"},s.default.createElement(i.Typography,{variant:"h5",className:"mdx-jpd__job-title"},e.title),s.default.createElement(a.IconExternalLink,{className:"mdx-jpd__external-link-icon"})),!!e.location?.name&&s.default.createElement(i.Typography,{variant:"subtitle2",component:"div"},e.location.name))))))):null}},75686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(94386),t)},68193:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jobsPerDepartmentDummyData=void 0,t.jobsPerDepartmentDummyData=[{id:87842,name:"App",parent_id:43806,child_ids:[87847,87852,87850,87848,45530,87849],jobs:[]},{id:54504,name:"Brand Design Studio",parent_id:null,child_ids:[],jobs:[]},{id:45532,name:"Business Development",parent_id:null,child_ids:[],jobs:[]},{id:87841,name:"Codex",parent_id:43806,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5329400",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2662332,location:{name:"Remote (Worldwide)"},metadata:null,id:5329400,updated_at:"2023-10-13T09:40:03-04:00",requisition_id:"Cod-6",title:"Technical Business Development Lead [Codex]"}]},{id:84549,name:"Communications",parent_id:null,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5276254",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2645076,location:{name:"Remote (Worldwide)"},metadata:null,id:5276254,updated_at:"2023-10-19T03:08:59-04:00",requisition_id:"PROV-Com-16",title:"Motion Designer"}]},{id:45531,name:"Design",parent_id:null,child_ids:[],jobs:[]},{id:87847,name:"Desktop",parent_id:87842,child_ids:[],jobs:[]},{id:87852,name:"Documentation",parent_id:87842,child_ids:[],jobs:[]},{id:45547,name:"Engineering ",parent_id:null,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5419957",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2693761,location:{name:"Remote (Worldwide)"},metadata:null,id:5419957,updated_at:"2023-10-24T07:30:00-04:00",requisition_id:"APP-QA-2",title:"Desktop QA Engineer "},{absolute_url:"https://jobs.status.im/?gh_jid=3694379",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2055210,location:{name:"Remote (Worldwide)"},metadata:null,id:3694379,updated_at:"2023-10-24T16:23:12-04:00",requisition_id:"BACK-1050",title:"Senior C++ Qt/QML developer for blockchain app"},{absolute_url:"https://jobs.status.im/?gh_jid=3702173",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2058858,location:{name:"Remote (Worldwide)"},metadata:null,id:3702173,updated_at:"2023-10-24T16:21:54-04:00",requisition_id:"93",title:"Senior Mobile ClojureScript UI Developer "}]},{id:49925,name:"Finance",parent_id:87845,child_ids:[],jobs:[]},{id:87854,name:"Infrastructure",parent_id:43806,child_ids:[],jobs:[]},{id:87853,name:"Insights",parent_id:87845,child_ids:[],jobs:[]},{id:87850,name:"Keycard",parent_id:87842,child_ids:[],jobs:[]},{id:145838,name:"Leadership",parent_id:null,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5447463",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2704948,location:{name:"Remote (Worldwide)"},metadata:null,id:5447463,updated_at:"2023-10-24T09:07:22-04:00",requisition_id:"LEAD-1",title:"Chief of Staff [whole ecosystem]"}]},{id:74156,name:"Legal",parent_id:87845,child_ids:[],jobs:[]},{id:91698,name:"Logos",parent_id:null,child_ids:[],jobs:[]},{id:43807,name:"Marketing",parent_id:null,child_ids:[],jobs:[]},{id:87848,name:"Mobile",parent_id:87842,child_ids:[],jobs:[]},{id:87843,name:"Nimbus",parent_id:43806,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5370820",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2679527,location:{name:"Remote (Worldwide)"},metadata:null,id:5370820,updated_at:"2023-10-19T03:05:07-04:00",requisition_id:"LIDO-1",title:"Senior DevOps Engineer (Blockchain)"}]},{id:144866,name:"Nomos",parent_id:43806,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5433423",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2315608,location:{name:"Remote (Worldwide)"},metadata:null,id:5433423,updated_at:"2023-10-12T11:20:52-04:00",requisition_id:"PROV-Nom-5",title:"Applied Network Researcher"}]},{id:45548,name:"People Operations",parent_id:87845,child_ids:[],jobs:[]},{id:45530,name:"Product Design",parent_id:87842,child_ids:[],jobs:[]},{id:90941,name:"Program Management",parent_id:null,child_ids:[],jobs:[]},{id:43806,name:"Research & Development",parent_id:null,child_ids:[87842,87841,87854,87843,144866,87846,87981,87847,87852,87850,87848,45530,87849],jobs:[]},{id:87851,name:"Security",parent_id:87845,child_ids:[],jobs:[]},{id:87845,name:"Services",parent_id:null,child_ids:[49925,87853,74156,45548,87851],jobs:[]},{id:91697,name:"Status App ",parent_id:null,child_ids:[],jobs:[]},{id:54783,name:"Technical Writing ",parent_id:null,child_ids:[],jobs:[]},{id:87846,name:"Vac",parent_id:43806,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=4460860",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2331302,location:{name:"Remote (Worldwide)"},metadata:null,id:4460860,updated_at:"2023-10-04T05:13:53-04:00",requisition_id:"PROV-zkV-1",title:"Zero Knowledge Research Engineer "}]},{id:87981,name:"Waku",parent_id:43806,child_ids:[],jobs:[{absolute_url:"https://jobs.status.im/?gh_jid=5456032",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2707470,location:{name:"Remote (Worldwide)"},metadata:null,id:5456032,updated_at:"2023-10-23T11:40:19-04:00",requisition_id:"WAK-GL-1",title:"Growth Lead"},{absolute_url:"https://jobs.status.im/?gh_jid=3693623",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2055187,location:{name:"Remote (Worldwide)"},metadata:null,id:3693623,updated_at:"2023-10-04T05:13:53-04:00",requisition_id:"PROV-Sec-2",title:"Protocol Engineer"},{absolute_url:"https://jobs.status.im/?gh_jid=3157908",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:1830496,location:{name:"Remote, Worldwide"},metadata:null,id:3157908,updated_at:"2023-10-04T05:13:53-04:00",requisition_id:"PROV-Sec-3",title:"Protocol Researcher (Distributed Systems)"},{absolute_url:"https://jobs.status.im/?gh_jid=5175038",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2584916,location:{name:"Remote (Worldwide)"},metadata:null,id:5175038,updated_at:"2023-10-09T05:53:53-04:00",requisition_id:"SDK-2",title:"Software Engineer (Chat SDK)"},{absolute_url:"https://jobs.status.im/?gh_jid=5310503",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2656108,location:{name:"Remote (Worldwide)"},metadata:null,id:5310503,updated_at:"2023-10-19T03:12:53-04:00",requisition_id:"PROV-Wak-13",title:"Software Engineer Distributed Systems Testing"},{absolute_url:"https://jobs.status.im/?gh_jid=5423094",data_compliance:[{type:"gdpr",requires_consent:!1,requires_processing_consent:!1,requires_retention_consent:!1,retention_period:null}],internal_job_id:2694724,location:{name:"Remote (Worldwide)"},metadata:null,id:5423094,updated_at:"2023-10-24T12:39:05-04:00",requisition_id:"WAK-BD-1",title:"Technical Business Development Lead "}]},{id:87849,name:"Web",parent_id:87842,child_ids:[],jobs:[]},{id:0,name:"No Department",parent_id:null,child_ids:[],jobs:[]}]},3223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogoCarousel=void 0;const r=n(97582),i=r.__importDefault(n(50941)),s=r.__importDefault(n(86010)),a=r.__importStar(n(67294));n(11620);const o=n(83639),l=n(38915),c=n(96507);t.LogoCarousel=e=>{let{title:t,className:n,items:r=[],children:h,...u}=e;const d=(0,c.useHydrated)(),p=(0,a.useRef)(null),f=(0,a.useRef)(null);return"undefined"!=typeof window&&d&&!f.current&&(f.current=p.current?.querySelector(".mdx-grid__content")??null,console.log(f.current,p.current)),a.default.createElement("div",{ref:p,className:(0,s.default)(n,"mdx-logo-carousel"),...u},a.default.createElement(o.SectionHeader,{title:t},a.default.createElement(l.ScrollButtons,{containerRef:f})),a.default.createElement(o.Grid,{className:"mdx-logo-carousel__inner",xs:{wrap:!1,gap:"96px",scrollButtons:!1}},r.map((e=>a.default.createElement(o.Grid.Item,{className:"mdx-logo-carousel__item"},a.default.createElement(i.default,{className:"mdx-logo-carousel__logo",title:e.title,sources:{dark:e.logoSrcDark??e.logoSrc??"",light:e.logoSrc??e.logoSrcDark??""}}))))))}},28466:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(3223),t)},40031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NewsletterSubscription=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(83639),l=n(39617),c=n(54400);n(58287);t.NewsletterSubscription=e=>{let{title:t,description:n,mailingListId:r,...h}=e;const u=(0,c.useThemeOptions)()?.newsletterSubscription?.mailingListId??0,d=r??u,p=(0,l.useNewsletterApi)(),f=!p.message||p.error,m=t??"Newsletter",g=n??a.default.createElement(a.default.Fragment,null,"Subscribe",a.default.createElement("br",null),"to our newsletter");return a.default.createElement(o.CallToActionSection,{className:"mdx-ns",title:a.default.createElement("span",{className:"mdx-ns__title"},m),description:a.default.createElement("div",{className:"mdx-ns__inner"},a.default.createElement("span",{className:"mdx-ns__description"},g),a.default.createElement("form",{onSubmit:e=>{e.preventDefault();const t=e.target,n=t.elements.namedItem("name").value,r=t.elements.namedItem("email").value;p.subscribe(d,r,n)}},p.message&&a.default.createElement(i.Toast,{title:p.message,className:"mdx-ns__toast",icon:p.error?i.ErrorIcon:i.CheckIcon}),a.default.createElement("div",{className:(0,s.default)("mdx-ns__inputs",!f&&"hidden")},a.default.createElement(i.TextField,{inputProps:{type:"text",name:"name"},variant:"underlined",placeholder:"First name or pseudonym"}),a.default.createElement(i.TextField,{inputProps:{type:"email",name:"email",required:!0},variant:"underlined",placeholder:"Email address (required)"})),a.default.createElement(i.Button,{size:"large",color:"primary",variant:"outlined",className:(0,s.default)("mdx-ns__submit-button",!f&&"hidden"),disabled:p.busy},"Subscribe"))),columns:2})}},46287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(40031),t)},69702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PoweredBy=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(83639);n(63428);t.PoweredBy=e=>{let{items:t=[],className:n,...r}=e;return s.default.createElement(a.Grid,{className:(0,i.default)(n,"mdx-powered-by"),xs:{cols:1,wrap:!0,gap:"0 1rem"},lg:{cols:2},...r},t.map(((e,t)=>s.default.createElement(a.Grid.Item,{key:t,xs:1},s.default.createElement(a.AppCard,{...e})))))}},91089:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(69702),t)},4816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(39960)),a=r.__importDefault(n(67294)),o=n(78870);n(36489);const l=r.__importDefault(n(86010));t.ProfileCard=e=>{let{imgSrc:t,name:n,githubUsername:r,githubLink:c,discordUsername:h,discordLink:u,...d}=e;return a.default.createElement("div",{...d,className:(0,l.default)("mdx-profile-card",d.className)},a.default.createElement("div",{className:"mdx-profile-card__profile"},void 0===t?a.default.createElement(o.IconAvatar,{className:"mdx-profile-card__avatar"}):a.default.createElement("img",{alt:"string"==typeof n?n:"",className:"mdx-profile-card__avatar",src:t}),a.default.createElement(i.Typography,{className:"mdx-profile-card__name",variant:"h3",component:"h4"},n)),a.default.createElement("div",{className:"mdx-profile-card__buttons"},r&&c&&a.default.createElement(s.default,{href:c,target:"_blank",className:"mdx-profile-card__link"},a.default.createElement(i.Button,{size:"small",variant:"outlined",className:"mdx-profile-card__button"},a.default.createElement(o.IconGithub,null),a.default.createElement(i.Typography,{variant:"body2",className:"mdx-profile-card__link__label"},r))),h&&u&&a.default.createElement(s.default,{href:u,target:"_blank",className:"mdx-profile-card__link"},a.default.createElement(i.Button,{size:"small",variant:"outlined",className:"mdx-profile-card__button"},a.default.createElement(o.IconDiscordWhite,null),a.default.createElement(i.Typography,{variant:"body2",className:"mdx-profile-card__link__label"},h)))))}},50922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(4816),t)},6306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Roadmap=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(83639),o=n(40851);n(74166);t.Roadmap=e=>{let{title:t,description:n,timeline:r=[],className:l,children:c,...h}=e;const u=(new Date).getFullYear(),d=(e,t,n)=>{if(t===n.length-1)return"none";return e.period[0]===n[t+1].period[0]?"solid":"dashed"},p=e=>{const t=(new Date).getFullYear(),n=(()=>{const e=(new Date).getMonth();return"Q"+Math.ceil((e+1)/3)})();let r,i;return Array.isArray(e)?[r,i]=e:r=e,r<t?"filled":r>t?"transparent":i&&"+"!==i?i<=n?"filled":"transparent":"filled"};return s.default.createElement("div",{className:(0,i.default)(l,"mdx-roadmap"),...h},s.default.createElement(a.SectionHeader,{className:"mdx-roadmap__header",title:t,description:n},c),r.length>0&&s.default.createElement(a.Grid,{className:"mdx-roadmap__timeline",xs:{cols:6,wrap:!1,gap:"0 1rem",scrollButtons:!0},spacingButtons:!0,leftLabel:"Past",rightLabel:"Future"},r.map(((e,t)=>s.default.createElement(a.Grid.Item,{key:t,xs:1},s.default.createElement(o.TimelineItem,{...e,index:t,period:e.period??u,description:e.description,borderStyle:d(e,t,r),periodStyle:p(e?.period??u),className:(0,i.default)("mdx-roadmap__timeline-item",e.className)}))))))}},57890:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(6306),t)},81367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollButtons=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294));n(79832);t.ScrollButtons=e=>{let{leftLabel:t,rightLabel:n,containerRef:r,containerId:o,spacing:l="grouped",...c}=e;const h=e=>{const t=r?r.current:document.querySelector(`#${o}`);if(!t)return;const n=t.children[0]?.getBoundingClientRect?.()?.width??236;t.scrollTo({behavior:"smooth",left:t.scrollLeft+(t.getBoundingClientRect()?.width-n)*e})};return a.default.createElement("div",{...c,className:(0,s.default)(c.className,"mdx-scroll-buttons","spaced"===l&&"mdx-scroll-buttons--spaced")},a.default.createElement(i.IconButtonGroup,{size:"small",color:"primary"},a.default.createElement(i.IconButton,{className:(0,s.default)("mdx-scroll-buttons__button",t&&t.length>0&&"mdx-scroll-buttons__button--with-label"),size:"small",onClick:h.bind(null,-1)},a.default.createElement(i.ChevronLeftIcon,null),t&&t.length>0&&a.default.createElement("span",{className:"mdx-scroll-buttons__label"},t)),a.default.createElement(i.IconButton,{className:(0,s.default)("mdx-scroll-buttons__button",n&&n.length&&"mdx-scroll-buttons__button--with-label"),size:"small",onClick:h.bind(null,1)},n&&n.length>0&&a.default.createElement("span",{className:"mdx-scroll-buttons__label"},n),a.default.createElement(i.ChevronRightIcon,null))))}},38915:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(81367),t)},24728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollToBottom=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importStar(n(67294)),o=n(89164),l=n(39320),c=n(53708),h=n(46439),u=r.__importDefault(n(49933));t.ScrollToBottom=e=>{const{children:t,className:n,style:r,...d}=e,p=(0,h.useScrollY)(),f=(0,c.useIsMobile)(),m=(0,o.useWindowSize)(),g=(0,a.useMemo)((()=>(document.querySelector(".mdx-hero")?.getBoundingClientRect()?.bottom??0)+window.scrollY),[m.height]);return a.default.createElement(i.IconButton,{onClick:()=>{const e=document.querySelector(".main-wrapper article"),t=e?.children?.[1];if(t)return window.scrollTo({left:0,top:t.getBoundingClientRect().top-(f?200:0),behavior:"smooth"});window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},size:f?"small":"large",className:(0,s.default)(u.default.scrollToBottom,n,p>20&&u.default.hide),style:(0,l.makeStyle)({...r??{}},{vh:m.height/100+"px",maxTop:g+"px"}),...d},a.default.createElement(i.ChevronDownIcon,{color:"primary"}))}},42073:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(24728),t)},56533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SectionHeader=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294)),o=n(83639);n(92476);t.SectionHeader=e=>{let{title:t,description:n,className:r,children:l,...c}=e;const h=!!n;return a.default.createElement(o.Box,{className:(0,s.default)(r,"mdx-section-header",h&&"mdx-section-header--with-description"),...c},a.default.createElement(i.Typography,{className:"mdx-section-header__title",component:"h2",variant:"h5"},t,!h&&l&&a.default.createElement("div",{className:"mdx-section-header__extra"},l)),n&&a.default.createElement(i.Typography,{className:"mdx-section-header__description",component:"p",variant:"h3"},n,a.default.createElement("div",{className:"mdx-section-header__extra"},l)))}},68151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(56533),t)},39439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Showcase=void 0;const r=n(97582),i=r.__importDefault(n(86010)),s=r.__importDefault(n(67294)),a=n(83639);n(13344);t.Showcase=e=>{let{items:t=[],className:n,...r}=e;return s.default.createElement(a.Grid,{className:(0,i.default)(n,"mdx-showcase"),xs:{cols:2,wrap:!0,gap:"1.5rem 1em"},lg:{cols:3,gap:"1rem"},...r},t.map(((e,t)=>s.default.createElement(a.Grid.Item,{key:t,className:"mdx-showcase__item",xs:1},s.default.createElement(a.ShowcaseCard,{...e})))))}},8760:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(39439),t)},96909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowcaseCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(50941)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294));n(29188);t.ShowcaseCard=e=>{let{index:t,name:n,logoSrc:r,logoSrcDark:l,description:c,className:h,size:u="large",borderStyle:d="solid",children:p,...f}=e;return o.default.createElement("div",{className:(0,a.default)(h,"mdx-showcase-card",`mdx-showcase-card--${u}`,`mdx-showcase-card--border-${d}`),...f},o.default.createElement("div",{className:"mdx-showcase-card__inner"},t&&o.default.createElement(i.Typography,{className:"mdx-showcase-card__index",variant:"subtitle2",component:"div"},t),(r||l)&&o.default.createElement(s.default,{sources:{dark:l??r??"",light:r??l??""},alt:"string"==typeof n?n:"",className:"mdx-showcase-card__logo"}),n&&o.default.createElement(i.Typography,{variant:"h2",component:"h2",className:"mdx-showcase-card__name"},n),c&&o.default.createElement(i.Typography,{variant:"body1",component:"p",className:"mdx-showcase-card__description"},c)))}},4385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(96909),t)},9847:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocialCard=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(50941)),a=r.__importDefault(n(86010)),o=r.__importDefault(n(67294)),l=n(78870);n(63933);t.SocialCard=e=>{let{title:t,logoSrc:n,logoSrcDark:r,description:c,...h}=e;return o.default.createElement("a",{target:"_blank",...h,className:(0,a.default)(h.className,"mdx-social-card")},o.default.createElement("div",{className:"mdx-social-card__row"},(n||r)&&o.default.createElement(s.default,{sources:{dark:r??n??"",light:n??r??""},alt:t??"social card logo",className:"mdx-social-card__logo"}),o.default.createElement(l.IconExternalLink,{className:"mdx-social-card__external-link"})),o.default.createElement(i.Typography,{variant:"body1",component:"span",className:"mdx-social-card__description"},c))}},26325:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(9847),t)},56732:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimelineItem=void 0;const r=n(97582),i=n(31665),s=r.__importDefault(n(86010)),a=r.__importDefault(n(67294));n(86782);t.TimelineItem=e=>{let{index:t,period:n,description:r,borderStyle:o,periodStyle:l,className:c,children:h,...u}=e;return a.default.createElement("div",{className:(0,s.default)(c,"mdx-timeline-item","dashed"===o&&"mdx-timeline-item--border-dashed"),...u},a.default.createElement("div",{className:"mdx-timeline-item__header"},a.default.createElement("div",{className:"mdx-timeline-item__period-container"},"none"!==o&&a.default.createElement("div",{className:(0,s.default)("mdx-timeline-item__border")}),a.default.createElement(i.Typography,{variant:"subtitle2",component:"span",className:(0,s.default)("mdx-timeline-item__period",`mdx-timeline-item__period--${l}`)},(e=>{if(Array.isArray(e)&&e.length>0){let t=e[0].toString();return e.length>1&&("+"===e[1]?t+="+":t+=" "+e[1]),t}return""})(n))),a.default.createElement(i.Typography,{variant:"h2",component:"span",className:"mdx-timeline-item__index"},"number"==typeof t?`${t<9?"0":""}${t+1}`:t)),a.default.createElement(i.Typography,{variant:"h5",component:"p",className:"mdx-timeline-item__description"},r))}},40851:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(97582).__exportStar(n(56732),t)},83639:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(97582);r.__exportStar(n(56027),t),r.__exportStar(n(45138),t),r.__exportStar(n(11734),t),r.__exportStar(n(84777),t),r.__exportStar(n(16607),t),r.__exportStar(n(3447),t),r.__exportStar(n(9110),t),r.__exportStar(n(44385),t),r.__exportStar(n(88819),t),r.__exportStar(n(2561),t),r.__exportStar(n(7757),t),r.__exportStar(n(24834),t),r.__exportStar(n(83398),t),r.__exportStar(n(31889),t),r.__exportStar(n(18355),t),r.__exportStar(n(32922),t),r.__exportStar(n(10052),t),r.__exportStar(n(69562),t),r.__exportStar(n(13526),t),r.__exportStar(n(75686),t),r.__exportStar(n(28466),t),r.__exportStar(n(46287),t),r.__exportStar(n(91089),t),r.__exportStar(n(50922),t),r.__exportStar(n(57890),t),r.__exportStar(n(42073),t),r.__exportStar(n(68151),t),r.__exportStar(n(8760),t),r.__exportStar(n(4385),t),r.__exportStar(n(26325),t),r.__exportStar(n(40851),t)},98823:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsdUtils=t.LsdUtils=void 0;const r=n(31665),i=n(70917);class s{_breakpoints={};getBreakpoints=e=>{if(this._breakpoints[e.name])return this._breakpoints[e.name];const t={};for(let n=0;n<r.THEME_BREAKPOINTS.length;n++){const i=r.THEME_BREAKPOINTS[n],s=e.breakpoints[i],a=e.breakpoints[r.THEME_BREAKPOINTS[n+1]],o=s.width,l=a?a.width-1:Number.MAX_SAFE_INTEGER;t[i]={min:o,max:l}}return this._breakpoints[e.name]=t,t};getBreakpoint=(e,t)=>this.getBreakpoints(e)[t];breakpoints=(()=>function(e){return void 0===e&&(e=[]),r.THEME_BREAKPOINTS.filter((t=>!e.find((e=>e===t))))})();typography=function(e,t){return void 0===t&&(t=!1),"subtitle3"===e?"\n font-size: 12px !important;\n font-weight: 400 !important;\n line-height: 16px !important;\n ":`\n font-size: var(--lsd-${e}-fontSize)${t?"!important":""};\n font-weight: var(--lsd-${e}-fontWeight)${t?"!important":""};\n line-height: var(--lsd-${e}-lineHeight)${t?"!important":""};\n `};breakpoint=(()=>{var e=this;return function(t,n,r,i){void 0===r&&(r="up");const{min:s,max:a}=e.getBreakpoint(t,n);let o="@media ";if("up"===r)o+=`(min-width: ${s}px)`;else if("down"===r)o+=`(max-width: ${a}px)`;else if("between"===r&&i){o+=`(min-width: ${s}px) and (max-width: ${e.getBreakpoint(t,i).min-1}px)`}else o+=`(min-width: ${s}px) and (max-width: ${a}px)`;return`${o}`}})();responsive=(()=>function(e,n,r){void 0===r&&(r="up");const s=t.lsdUtils.breakpoint(e,n,r);return e=>i.css`
${s} {
${e}
}
`})()}t.LsdUtils=s,t.lsdUtils=new s},39320:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeStyle=void 0;t.makeStyle=function(e,t){return void 0===t&&(t={}),{...e,...Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return{...e,[`--${n}`]:r}}),{})}}},37805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcHeroInfoMb=t.isMobile=t.generateTextShadow=t.isTouchDevice=t.calcScrollThreshold=t.mapFloat=t.random=void 0;t.random=(e,t)=>Math.random()*(t-e)+e;t.mapFloat=(e,t,n,r,i)=>(e-t)*(i-r)/(n-t)+r;t.calcScrollThreshold=()=>.4*window.innerHeight;t.isTouchDevice=()=>"undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>0);t.generateTextShadow=e=>{let t="";for(let n=0;n<e;n++){let r=Math.floor(n/(e-1)*255);t+=(0===n?"":", ")+`${5*-n}px ${5*-n}px 0px rgb(${r}, ${r}, ${r})`}return t};t.isMobile=()=>"undefined"!=typeof window&&window.innerWidth<997;t.calcHeroInfoMb=e=>(0,t.mapFloat)(scrollY,0,(0,t.calcScrollThreshold)(),0,100)},39617:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useNewsletterApi=void 0;const r=n(67294);t.useNewsletterApi=()=>{const[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)({error:!1,message:""});return{busy:e,error:n.error,message:n.message,subscribe:async(e,n,r)=>{t(!0);try{const t=await fetch("https://odoo.logos.co/website_mass_mailing/subscribe2",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"call",params:{name:r,value:n,list_id:e,subscription_type:"email"}})}),s=await t.json();i({error:!1,message:s.result.message})}catch(s){i({error:!0,message:"Something went wrong!"})}t(!1)}}}},46439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useScrollY=void 0;const r=n(521),i=n(67294);t.useScrollY=()=>{const[e,t]=(0,i.useState)(0);return(0,r.useWindowEventListener)("scroll",(()=>{t(window.scrollY)})),e}},8260:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function s(e){i(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===r(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function a(e){if(i(1,arguments),!function(e){return i(1,arguments),e instanceof Date||"object"===r(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=s(e);return!isNaN(Number(t))}function o(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function l(e,t){return i(2,arguments),function(e,t){i(2,arguments);var n=s(e).getTime(),r=o(t);return new Date(n+r)}(e,-o(t))}n.r(t),n.d(t,{default:()=>J});function c(e){i(1,arguments);var t=s(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function h(e){i(1,arguments);var t=s(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=c(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var l=c(o);return t.getTime()>=a.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function u(e){i(1,arguments);var t=s(e),n=c(t).getTime()-function(e){i(1,arguments);var t=h(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),c(n)}(t).getTime();return Math.round(n/6048e5)+1}var d={};function p(){return d}function f(e,t){var n,r,a,l,c,h,u,d;i(1,arguments);var f=p(),m=o(null!==(n=null!==(r=null!==(a=null!==(l=null==t?void 0:t.weekStartsOn)&&void 0!==l?l:null==t||null===(c=t.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==a?a:f.weekStartsOn)&&void 0!==r?r:null===(u=f.locale)||void 0===u||null===(d=u.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==n?n:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=s(e),A=g.getUTCDay(),v=(A<m?7:0)+A-m;return g.setUTCDate(g.getUTCDate()-v),g.setUTCHours(0,0,0,0),g}function m(e,t){var n,r,a,l,c,h,u,d;i(1,arguments);var m=s(e),g=m.getUTCFullYear(),A=p(),v=o(null!==(n=null!==(r=null!==(a=null!==(l=null==t?void 0:t.firstWeekContainsDate)&&void 0!==l?l:null==t||null===(c=t.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==a?a:A.firstWeekContainsDate)&&void 0!==r?r:null===(u=A.locale)||void 0===u||null===(d=u.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==n?n:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,v),y.setUTCHours(0,0,0,0);var x=f(y,t),b=new Date(0);b.setUTCFullYear(g,0,v),b.setUTCHours(0,0,0,0);var E=f(b,t);return m.getTime()>=x.getTime()?g+1:m.getTime()>=E.getTime()?g:g-1}function g(e,t){i(1,arguments);var n=s(e),r=f(n,t).getTime()-function(e,t){var n,r,s,a,l,c,h,u;i(1,arguments);var d=p(),g=o(null!==(n=null!==(r=null!==(s=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(l=t.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:d.firstWeekContainsDate)&&void 0!==r?r:null===(h=d.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),A=m(e,t),v=new Date(0);return v.setUTCFullYear(A,0,g),v.setUTCHours(0,0,0,0),f(v,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function A(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}const v={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return A("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):A(n+1,2)},d:function(e,t){return A(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return A(e.getUTCHours()%12||12,t.length)},H:function(e,t){return A(e.getUTCHours(),t.length)},m:function(e,t){return A(e.getUTCMinutes(),t.length)},s:function(e,t){return A(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return A(Math.floor(r*Math.pow(10,n-3)),t.length)}};var y="midnight",x="noon",b="morning",E="afternoon",_="evening",S="night",w={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return v.y(e,t)},Y:function(e,t,n,r){var i=m(e,r),s=i>0?i:1-i;return"YY"===t?A(s%100,2):"Yo"===t?n.ordinalNumber(s,{unit:"year"}):A(s,t.length)},R:function(e,t){return A(h(e),t.length)},u:function(e,t){return A(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return A(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return A(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return v.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return A(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=g(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):A(i,t.length)},I:function(e,t,n){var r=u(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):A(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):v.d(e,t)},D:function(e,t,n){var r=function(e){i(1,arguments);var t=s(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):A(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return A(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return A(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return A(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?x:0===i?y:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?_:i>=12?E:i>=4?b:S,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return v.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):v.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):v.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):v.s(e,t)},S:function(e,t){return v.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return C(i);case"XXXX":case"XX":return T(i);default:return T(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return C(i);case"xxxx":case"xx":return T(i);default:return T(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+M(i,":");default:return"GMT"+T(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+M(i,":");default:return"GMT"+T(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return A(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return A((r._originalDate||e).getTime(),t.length)}};function M(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(0===s)return n+String(i);var a=t||"";return n+String(i)+a+A(s,2)}function C(e,t){return e%60==0?(e>0?"-":"+")+A(Math.abs(e)/60,2):T(e,t)}function T(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+A(Math.floor(i/60),2)+n+A(i%60,2)}const I=w;var B=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},R=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},P={p:R,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],i=r[1],s=r[2];if(!s)return B(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",B(i,t)).replace("{{time}}",R(s,t))}};const D=P;var L=["D","DD"],F=["YY","YYYY"];function U(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var O={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const N=function(e,t,n){var r,i=O[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function k(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var G={date:k({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:k({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:k({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Q(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=null!=n&&n.width?String(n.width):i;r=e.formattingValues[s]||e.formattingValues[i]}else{var a=e.defaultWidth,o=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function V(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a,o=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(function(e){return e.test(o)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,(function(e){return e.test(o)}));return a=e.valueCallback?e.valueCallback(c):c,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(o.length)}}}var H;const j={code:"en-US",formatDistance:N,formatLong:G,formatRelative:function(e,t,n,r){return z[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(H={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(H.matchPattern);if(!n)return null;var r=n[0],i=e.match(H.parsePattern);if(!i)return null;var s=H.valueCallback?H.valueCallback(i[0]):i[0];return{value:s=t.valueCallback?t.valueCallback(s):s,rest:e.slice(r.length)}}),era:V({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:V({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:V({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var W=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,X=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Y=/^'([^]*?)'?$/,q=/''/g,K=/[a-zA-Z]/;function J(e,t,n){var r,c,h,u,d,f,m,g,A,v,y,x,b,E,_,S,w,M;i(2,arguments);var C=String(t),T=p(),B=null!==(r=null!==(c=null==n?void 0:n.locale)&&void 0!==c?c:T.locale)&&void 0!==r?r:j,R=o(null!==(h=null!==(u=null!==(d=null!==(f=null==n?void 0:n.firstWeekContainsDate)&&void 0!==f?f:null==n||null===(m=n.locale)||void 0===m||null===(g=m.options)||void 0===g?void 0:g.firstWeekContainsDate)&&void 0!==d?d:T.firstWeekContainsDate)&&void 0!==u?u:null===(A=T.locale)||void 0===A||null===(v=A.options)||void 0===v?void 0:v.firstWeekContainsDate)&&void 0!==h?h:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=o(null!==(y=null!==(x=null!==(b=null!==(E=null==n?void 0:n.weekStartsOn)&&void 0!==E?E:null==n||null===(_=n.locale)||void 0===_||null===(S=_.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==b?b:T.weekStartsOn)&&void 0!==x?x:null===(w=T.locale)||void 0===w||null===(M=w.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==y?y:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!B.localize)throw new RangeError("locale must contain localize property");if(!B.formatLong)throw new RangeError("locale must contain formatLong property");var O=s(e);if(!a(O))throw new RangeError("Invalid time value");var N=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}(O),k=l(O,N),G={firstWeekContainsDate:R,weekStartsOn:P,locale:B,_originalDate:O};return C.match(X).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,D[t])(e,B.formatLong):e})).join("").match(W).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(e){var t=e.match(Y);if(!t)return e;return t[1].replace(q,"'")}(r);var s,a=I[i];if(a)return null!=n&&n.useAdditionalWeekYearTokens||(s=r,-1===F.indexOf(s))||U(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==L.indexOf(e)}(r)||U(r,t,String(e)),a(k,r,B.localize,G);if(i.match(K))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}},20296:e=>{function t(e,t,n){var r,i,s,a,o;function l(){var c=Date.now()-a;c<t&&c>=0?r=setTimeout(l,t-c):(r=null,n||(o=e.apply(s,i),s=i=null))}null==t&&(t=100);var c=function(){s=this,i=arguments,a=Date.now();var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(o=e.apply(s,i),s=i=null),o};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(o=e.apply(s,i),s=i=null,clearTimeout(r),r=null)},c}t.debounce=t,e.exports=t},64063:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;0!=i--;){var a=s[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},76427:(e,t,n)=>{var r="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",l="[object Symbol]",c=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=u||d||Function("return this")();function f(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n,r){var i=e.length,s=n+(r?1:-1);for(;r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,v,n);var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function m(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function g(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function A(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function v(e){return e!=e}function y(e,t){return e.has(t)}function x(e,t){return function(n){return e(t(n))}}var b,E=Array.prototype,_=Function.prototype,S=Object.prototype,w=p["__core-js_shared__"],M=(b=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",C=_.toString,T=S.hasOwnProperty,I=S.toString,B=RegExp("^"+C.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=p.Symbol,P=x(Object.getPrototypeOf,Object),D=S.propertyIsEnumerable,L=E.splice,F=R?R.isConcatSpreadable:void 0,U=Object.getOwnPropertySymbols,O=Math.max,N=J(p,"Map"),k=J(Object,"create");function G(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e?e.length:0;for(this.__data__=new Q;++t<n;)this.add(e[t])}function H(e,t){var n=ie(e)||re(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var s in e)!t&&!T.call(e,s)||i&&("length"==s||te(s,r))||n.push(s);return n}function j(e,t){for(var n,r,i=e.length;i--;)if((n=e[i][0])===(r=t)||n!=n&&r!=r)return i;return-1}function W(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=ee),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?W(o,t-1,n,r,i):A(i,o):r||(i[i.length]=o)}return i}function X(e){if(!oe(e)||(t=e,M&&M in t))return!1;var t,n=ae(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?B:c;return n.test(function(e){if(null!=e){try{return C.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function Y(e){if(!oe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t,n,r,i=(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||S,t===r),s=[];for(var a in e)("constructor"!=a||!i&&T.call(e,a))&&s.push(a);return s}function q(e){return function(e,t,n){var r=t(e);return ie(e)?r:A(r,n(e))}(e,ce,$)}function K(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function J(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return X(n)?n:void 0}G.prototype.clear=function(){this.__data__=k?k(null):{}},G.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},G.prototype.get=function(e){var t=this.__data__;if(k){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return k?void 0!==t[e]:T.call(t,e)},G.prototype.set=function(e,t){return this.__data__[e]=k&&void 0===t?r:t,this},z.prototype.clear=function(){this.__data__=[]},z.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():L.call(t,n,1),!0)},z.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},z.prototype.has=function(e){return j(this.__data__,e)>-1},z.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Q.prototype.clear=function(){this.__data__={hash:new G,map:new(N||z),string:new G}},Q.prototype.delete=function(e){return K(this,e).delete(e)},Q.prototype.get=function(e){return K(this,e).get(e)},Q.prototype.has=function(e){return K(this,e).has(e)},Q.prototype.set=function(e,t){return K(this,e).set(e,t),this},V.prototype.add=V.prototype.push=function(e){return this.__data__.set(e,r),this},V.prototype.has=function(e){return this.__data__.has(e)};var Z=U?x(U,Object):pe,$=U?function(e){for(var t=[];e;)A(t,Z(e)),e=P(e);return t}:pe;function ee(e){return ie(e)||re(e)||!!(F&&e&&e[F])}function te(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||h.test(e))&&e>-1&&e%1==0&&e<t}function ne(e){if("string"==typeof e||function(e){return"symbol"==typeof e||le(e)&&I.call(e)==l}(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function re(e){return function(e){return le(e)&&se(e)}(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||I.call(e)==s)}var ie=Array.isArray;function se(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!ae(e)}function ae(e){var t=oe(e)?I.call(e):"";return t==a||t==o}function oe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function le(e){return!!e&&"object"==typeof e}function ce(e){return se(e)?H(e,!0):Y(e)}var he,ue,de=(he=function(e,t){return null==e?{}:(t=g(W(t,1),ne),function(e,t){return function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=e[a];n(o,a)&&(s[a]=o)}return s}(e=Object(e),t,(function(t,n){return n in e}))}(e,function(e,t,n,r){var i,s=-1,a=f,o=!0,l=e.length,c=[],h=t.length;if(!l)return c;n&&(t=g(t,(i=n,function(e){return i(e)}))),r?(a=m,o=!1):t.length>=200&&(a=y,o=!1,t=new V(t));e:for(;++s<l;){var u=e[s],d=n?n(u):u;if(u=r||0!==u?u:0,o&&d==d){for(var p=h;p--;)if(t[p]===d)continue e;c.push(u)}else a(t,d,r)||c.push(u)}return c}(q(e),t)))},ue=O(void 0===ue?he.length-1:ue,0),function(){for(var e=arguments,t=-1,n=O(e.length-ue,0),r=Array(n);++t<n;)r[t]=e[ue+t];t=-1;for(var i=Array(ue+1);++t<ue;)i[t]=e[t];return i[ue]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(he,this,i)});function pe(){return[]}e.exports=de},25030:(e,t,n)=>{var r=9007199254740991,i="[object Arguments]",s="[object Function]",a="[object GeneratorFunction]",o="[object Symbol]",l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,h=l||c||Function("return this")();function u(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var d=Object.prototype,p=d.hasOwnProperty,f=d.toString,m=h.Symbol,g=d.propertyIsEnumerable,A=m?m.isConcatSpreadable:void 0,v=Math.max;function y(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=x),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?y(o,t-1,n,r,i):u(i,o):r||(i[i.length]=o)}return i}function x(e){return E(e)||function(e){return function(e){return _(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?f.call(e):"";return t==s||t==a}(e)}(e)}(e)&&p.call(e,"callee")&&(!g.call(e,"callee")||f.call(e)==i)}(e)||!!(A&&e&&e[A])}function b(e){if("string"==typeof e||function(e){return"symbol"==typeof e||_(e)&&f.call(e)==o}(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}var E=Array.isArray;function _(e){return!!e&&"object"==typeof e}var S,w,M=(S=function(e,t){return null==e?{}:function(e,t){return function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=e[a];n(o,a)&&(s[a]=o)}return s}(e=Object(e),t,(function(t,n){return n in e}))}(e,function(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(y(t,1),b))},w=v(void 0===w?S.length-1:w,0),function(){for(var e=arguments,t=-1,n=v(e.length-w,0),r=Array(n);++t<n;)r[t]=e[w+t];t=-1;for(var i=Array(w+1);++t<w;)i[t]=e[t];return i[w]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(S,this,i)});e.exports=M},73955:(e,t,n)=>{var r=n(79833),i=0;e.exports=function(e){var t=++i;return r(e)+t}},58147:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={root:"root_TTsz",fullWidth:"fullWidth_HBtH",fullHeight:"fullHeight_ls1u",content:"content_feMR",keep:"keep_Y9Ea"}},49933:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={scrollToBottom:"scrollToBottom_NE5w",hide:"hide_q_kn"}},11403:(e,t,n)=>{"use strict";n.r(t)},93255:(e,t,n)=>{"use strict";n.r(t)},77877:(e,t,n)=>{"use strict";n.r(t)},56216:(e,t,n)=>{"use strict";n.r(t)},51928:(e,t,n)=>{"use strict";n.r(t)},8981:(e,t,n)=>{"use strict";n.r(t)},46774:(e,t,n)=>{"use strict";n.r(t)},84238:(e,t,n)=>{"use strict";n.r(t)},69774:(e,t,n)=>{"use strict";n.r(t)},58918:(e,t,n)=>{"use strict";n.r(t)},91786:(e,t,n)=>{"use strict";n.r(t)},85661:(e,t,n)=>{"use strict";n.r(t)},57255:(e,t,n)=>{"use strict";n.r(t)},30204:(e,t,n)=>{"use strict";n.r(t)},6460:(e,t,n)=>{"use strict";n.r(t)},61588:(e,t,n)=>{"use strict";n.r(t)},92751:(e,t,n)=>{"use strict";n.r(t)},53175:(e,t,n)=>{"use strict";n.r(t)},37477:(e,t,n)=>{"use strict";n.r(t)},11620:(e,t,n)=>{"use strict";n.r(t)},58287:(e,t,n)=>{"use strict";n.r(t)},63428:(e,t,n)=>{"use strict";n.r(t)},36489:(e,t,n)=>{"use strict";n.r(t)},74166:(e,t,n)=>{"use strict";n.r(t)},79832:(e,t,n)=>{"use strict";n.r(t)},92476:(e,t,n)=>{"use strict";n.r(t)},13344:(e,t,n)=>{"use strict";n.r(t)},29188:(e,t,n)=>{"use strict";n.r(t)},63933:(e,t,n)=>{"use strict";n.r(t)},86782:(e,t,n)=>{"use strict";n.r(t)},67287:(e,t,n)=>{(e=n.nmd(e)).exports=function(t){var r={},i=n(27418),s=n(67294),a=n(63840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=60103,h=60106,u=60107,d=60108,p=60114,f=60109,m=60110,g=60112,A=60113,v=60120,y=60115,x=60116,b=60121,E=60129,_=60130,S=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;c=w("react.element"),h=w("react.portal"),u=w("react.fragment"),d=w("react.strict_mode"),p=w("react.profiler"),f=w("react.provider"),m=w("react.context"),g=w("react.forward_ref"),A=w("react.suspense"),v=w("react.suspense_list"),y=w("react.memo"),x=w("react.lazy"),b=w("react.block"),w("react.scope"),E=w("react.debug_trace_mode"),_=w("react.offscreen"),S=w("react.legacy_hidden")}var M="function"==typeof Symbol&&Symbol.iterator;function C(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=M&&e[M]||e["@@iterator"])?e:null}function T(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case u:return"Fragment";case h:return"Portal";case p:return"Profiler";case d:return"StrictMode";case A:return"Suspense";case v:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case m:return(e.displayName||"Context")+".Consumer";case f:return(e._context.displayName||"Context")+".Provider";case g:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case y:return T(e.type);case b:return T(e._render);case x:t=e._payload,e=e._init;try{return T(e(t))}catch(n){}}return null}function I(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function B(e){if(I(e)!==e)throw Error(o(188))}function R(e){var t=e.alternate;if(!t){if(null===(t=I(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return B(i),e;if(s===r)return B(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}function P(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function D(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var L,F=t.getPublicInstance,U=t.getRootHostContext,O=t.getChildHostContext,N=t.prepareForCommit,k=t.resetAfterCommit,G=t.createInstance,z=t.appendInitialChild,Q=t.finalizeInitialChildren,V=t.prepareUpdate,H=t.shouldSetTextContent,j=t.createTextInstance,W=t.scheduleTimeout,X=t.cancelTimeout,Y=t.noTimeout,q=t.isPrimaryRenderer,K=t.supportsMutation,J=t.supportsPersistence,Z=t.supportsHydration,$=t.getInstanceFromNode,ee=t.makeOpaqueHydratingObject,te=t.makeClientId,ne=t.beforeActiveInstanceBlur,re=t.afterActiveInstanceBlur,ie=t.preparePortalMount,se=t.supportsTestSelectors,ae=t.findFiberRoot,oe=t.getBoundingRect,le=t.getTextContent,ce=t.isHiddenSubtree,he=t.matchAccessibilityRole,ue=t.setFocusIfFocusable,de=t.setupIntersectionObserver,pe=t.appendChild,fe=t.appendChildToContainer,me=t.commitTextUpdate,ge=t.commitMount,Ae=t.commitUpdate,ve=t.insertBefore,ye=t.insertInContainerBefore,xe=t.removeChild,be=t.removeChildFromContainer,Ee=t.resetTextContent,_e=t.hideInstance,Se=t.hideTextInstance,we=t.unhideInstance,Me=t.unhideTextInstance,Ce=t.clearContainer,Te=t.cloneInstance,Ie=t.createContainerChildSet,Be=t.appendChildToContainerChildSet,Re=t.finalizeContainerChildren,Pe=t.replaceContainerChildren,De=t.cloneHiddenInstance,Le=t.cloneHiddenTextInstance,Fe=t.canHydrateInstance,Ue=t.canHydrateTextInstance,Oe=t.isSuspenseInstancePending,Ne=t.isSuspenseInstanceFallback,ke=t.getNextHydratableSibling,Ge=t.getFirstHydratableChild,ze=t.hydrateInstance,Qe=t.hydrateTextInstance,Ve=t.getNextHydratableInstanceAfterSuspenseInstance,He=t.commitHydratedContainer,je=t.commitHydratedSuspenseInstance;function We(e){if(void 0===L)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var Xe=!1;function Ye(e,t){if(!e||Xe)return"";Xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"==typeof l.stack){for(var i=l.stack.split("\n"),s=r.stack.split("\n"),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||i[a]!==s[o])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=o);break}}}finally{Xe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?We(e):""}var qe=[],Ke=-1;function Je(e){return{current:e}}function Ze(e){0>Ke||(e.current=qe[Ke],qe[Ke]=null,Ke--)}function $e(e,t){Ke++,qe[Ke]=e.current,e.current=t}var et={},tt=Je(et),nt=Je(!1),rt=et;function it(e,t){var n=e.type.contextTypes;if(!n)return et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function st(e){return null!=(e=e.childContextTypes)}function at(){Ze(nt),Ze(tt)}function ot(e,t,n){if(tt.current!==et)throw Error(o(168));$e(tt,t),$e(nt,n)}function lt(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var s in r=r.getChildContext())if(!(s in e))throw Error(o(108,T(t)||"Unknown",s));return i({},n,r)}function ct(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||et,rt=tt.current,$e(tt,e),$e(nt,nt.current),!0}function ht(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=lt(e,t,rt),r.__reactInternalMemoizedMergedChildContext=e,Ze(nt),Ze(tt),$e(tt,e)):Ze(nt),$e(nt,n)}var ut=null,dt=null;(0,a.unstable_now)();var pt=0,ft=8;function mt(e){if(0!=(1&e))return ft=15,1;if(0!=(2&e))return ft=14,2;if(0!=(4&e))return ft=13,4;var t=24&e;return 0!==t?(ft=12,t):0!=(32&e)?(ft=11,32):0!==(t=192&e)?(ft=10,t):0!=(256&e)?(ft=9,256):0!==(t=3584&e)?(ft=8,t):0!=(4096&e)?(ft=7,4096):0!==(t=4186112&e)?(ft=6,t):0!==(t=62914560&e)?(ft=5,t):67108864&e?(ft=4,67108864):0!=(134217728&e)?(ft=3,134217728):0!==(t=805306368&e)?(ft=2,t):0!=(1073741824&e)?(ft=1,1073741824):(ft=8,e)}function gt(e,t){var n=e.pendingLanes;if(0===n)return ft=0;var r=0,i=0,s=e.expiredLanes,a=e.suspendedLanes,o=e.pingedLanes;if(0!==s)r=s,i=ft=15;else if(0!==(s=134217727&n)){var l=s&~a;0!==l?(r=mt(l),i=ft):0!==(o&=s)&&(r=mt(o),i=ft)}else 0!==(s=n&~a)?(r=mt(s),i=ft):0!==o&&(r=mt(o),i=ft);if(0===r)return 0;if(r=n&((0>(r=31-Et(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(mt(t),i<=ft)return t;ft=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Et(t)),r|=e[n],t&=~i;return r}function At(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function vt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=yt(24&~t))?vt(10,t):e;case 10:return 0===(e=yt(192&~t))?vt(8,t):e;case 8:return 0===(e=yt(3584&~t))&&(0===(e=yt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=yt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function yt(e){return e&-e}function xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Et(t)]=n}var Et=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(_t(e)/St|0)|0},_t=Math.log,St=Math.LN2;var wt=a.unstable_runWithPriority,Mt=a.unstable_scheduleCallback,Ct=a.unstable_cancelCallback,Tt=a.unstable_shouldYield,It=a.unstable_requestPaint,Bt=a.unstable_now,Rt=a.unstable_getCurrentPriorityLevel,Pt=a.unstable_ImmediatePriority,Dt=a.unstable_UserBlockingPriority,Lt=a.unstable_NormalPriority,Ft=a.unstable_LowPriority,Ut=a.unstable_IdlePriority,Ot={},Nt=void 0!==It?It:function(){},kt=null,Gt=null,zt=!1,Qt=Bt(),Vt=1e4>Qt?Bt:function(){return Bt()-Qt};function Ht(){switch(Rt()){case Pt:return 99;case Dt:return 98;case Lt:return 97;case Ft:return 96;case Ut:return 95;default:throw Error(o(332))}}function jt(e){switch(e){case 99:return Pt;case 98:return Dt;case 97:return Lt;case 96:return Ft;case 95:return Ut;default:throw Error(o(332))}}function Wt(e,t){return e=jt(e),wt(e,t)}function Xt(e,t,n){return e=jt(e),Mt(e,t,n)}function Yt(){if(null!==Gt){var e=Gt;Gt=null,Ct(e)}qt()}function qt(){if(!zt&&null!==kt){zt=!0;var e=0;try{var t=kt;Wt(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),kt=null}catch(n){throw null!==kt&&(kt=kt.slice(e+1)),Mt(Pt,Yt),n}finally{zt=!1}}}var Kt=l.ReactCurrentBatchConfig;var Jt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Zt=Object.prototype.hasOwnProperty;function $t(e,t){if(Jt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Zt.call(t,n[r])||!Jt(e[n[r]],t[n[r]]))return!1;return!0}function en(e){switch(e.tag){case 5:return We(e.type);case 16:return We("Lazy");case 13:return We("Suspense");case 19:return We("SuspenseList");case 0:case 2:case 15:return e=Ye(e.type,!1);case 11:return e=Ye(e.type.render,!1);case 22:return e=Ye(e.type._render,!1);case 1:return e=Ye(e.type,!0);default:return""}}function tn(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var nn=Je(null),rn=null,sn=null,an=null;function on(){an=sn=rn=null}function ln(e,t){e=e.type._context,q?($e(nn,e._currentValue),e._currentValue=t):($e(nn,e._currentValue2),e._currentValue2=t)}function cn(e){var t=nn.current;Ze(nn),e=e.type._context,q?e._currentValue=t:e._currentValue2=t}function hn(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function un(e,t){rn=e,an=sn=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Qr=!0),e.firstContext=null)}function dn(e,t){if(an!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(an=e,t=1073741823),t={context:e,observedBits:t,next:null},null===sn){if(null===rn)throw Error(o(308));sn=t,rn.dependencies={lanes:0,firstContext:t,responders:null}}else sn=sn.next=t;return q?e._currentValue:e._currentValue2}var pn=!1;function fn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function mn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function vn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=a:s=s.next=a,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yn(e,t,n,r){var s=e.updateQueue;pn=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(null!==l){s.shared.pending=null;var c=l,h=c.next;c.next=null,null===o?a=h:o.next=h,o=c;var u=e.alternate;if(null!==u){var d=(u=u.updateQueue).lastBaseUpdate;d!==o&&(null===d?u.firstBaseUpdate=h:d.next=h,u.lastBaseUpdate=c)}}if(null!==a){for(d=s.baseState,o=0,u=h=c=null;;){l=a.lane;var p=a.eventTime;if((r&l)===l){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,m=a;switch(l=t,p=n,m.tag){case 1:if("function"==typeof(f=m.payload)){d=f.call(p,d,l);break e}d=f;break e;case 3:f.flags=-4097&f.flags|64;case 0:if(null==(l="function"==typeof(f=m.payload)?f.call(p,d,l):f))break e;d=i({},d,l);break e;case 2:pn=!0}}null!==a.callback&&(e.flags|=32,null===(l=s.effects)?s.effects=[a]:l.push(a))}else p={eventTime:p,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(h=u=p,c=d):u=u.next=p,o|=l;if(null===(a=a.next)){if(null===(l=s.shared.pending))break;a=l.next,l.next=null,s.lastBaseUpdate=l,s.shared.pending=null}}null===u&&(c=d),s.baseState=c,s.firstBaseUpdate=h,s.lastBaseUpdate=u,us|=o,e.lanes=o,e.memoizedState=d}}function xn(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var bn=(new s.Component).refs;function En(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var _n={isMounted:function(e){return!!(e=e._reactInternals)&&I(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Us(),i=Os(e),s=gn(r,i);s.payload=t,null!=n&&(s.callback=n),An(e,s),Ns(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Us(),i=Os(e),s=gn(r,i);s.tag=1,s.payload=t,null!=n&&(s.callback=n),An(e,s),Ns(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Us(),r=Os(e),i=gn(n,r);i.tag=2,null!=t&&(i.callback=t),An(e,i),Ns(e,r,n)}};function Sn(e,t,n,r,i,s,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!$t(n,r)||!$t(i,s))}function wn(e,t,n){var r=!1,i=et,s=t.contextType;return"object"==typeof s&&null!==s?s=dn(s):(i=st(t)?rt:tt.current,s=(r=null!=(r=t.contextTypes))?it(e,i):et),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=_n,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Mn(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_n.enqueueReplaceState(t,t.state,null)}function Cn(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=bn,fn(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=dn(s):(s=st(t)?rt:tt.current,i.context=it(e,s)),yn(e,n,i,r),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(En(e,t,s,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&_n.enqueueReplaceState(i,i.state,null),yn(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Tn=Array.isArray;function In(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===bn&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Bn(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Rn(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=_a(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ca(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=In(e,t,n),r.return=e,r):((r=Sa(n.type,n.key,n.props,null,e.mode,r)).ref=In(e,t,n),r.return=e,r)}function p(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ta(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,s){return null===t||7!==t.tag?((t=wa(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ca(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case c:return(n=Sa(t.type,t.key,t.props,null,e.mode,n)).ref=In(e,null,t),n.return=e,n;case h:return(t=Ta(t,e.mode,n)).return=e,t}if(Tn(t)||C(t))return(t=wa(t,e.mode,n,null)).return=e,t;Bn(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case c:return n.key===i?n.type===u?f(e,t,n.props.children,r,i):d(e,t,n,r):null;case h:return n.key===i?p(e,t,n,r):null}if(Tn(n)||C(n))return null!==i?null:f(e,t,n,r,null);Bn(e,n)}return null}function A(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case c:return e=e.get(null===r.key?n:r.key)||null,r.type===u?f(t,e,r.props.children,i,r.key):d(t,e,r,i);case h:return p(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(Tn(r)||C(r))return f(t,e=e.get(n)||null,r,i,null);Bn(t,r)}return null}function v(i,a,o,l){for(var c=null,h=null,u=a,d=a=0,p=null;null!==u&&d<o.length;d++){u.index>d?(p=u,u=null):p=u.sibling;var f=g(i,u,o[d],l);if(null===f){null===u&&(u=p);break}e&&u&&null===f.alternate&&t(i,u),a=s(f,a,d),null===h?c=f:h.sibling=f,h=f,u=p}if(d===o.length)return n(i,u),c;if(null===u){for(;d<o.length;d++)null!==(u=m(i,o[d],l))&&(a=s(u,a,d),null===h?c=u:h.sibling=u,h=u);return c}for(u=r(i,u);d<o.length;d++)null!==(p=A(u,i,d,o[d],l))&&(e&&null!==p.alternate&&u.delete(null===p.key?d:p.key),a=s(p,a,d),null===h?c=p:h.sibling=p,h=p);return e&&u.forEach((function(e){return t(i,e)})),c}function y(i,a,l,c){var h=C(l);if("function"!=typeof h)throw Error(o(150));if(null==(l=h.call(l)))throw Error(o(151));for(var u=h=null,d=a,p=a=0,f=null,v=l.next();null!==d&&!v.done;p++,v=l.next()){d.index>p?(f=d,d=null):f=d.sibling;var y=g(i,d,v.value,c);if(null===y){null===d&&(d=f);break}e&&d&&null===y.alternate&&t(i,d),a=s(y,a,p),null===u?h=y:u.sibling=y,u=y,d=f}if(v.done)return n(i,d),h;if(null===d){for(;!v.done;p++,v=l.next())null!==(v=m(i,v.value,c))&&(a=s(v,a,p),null===u?h=v:u.sibling=v,u=v);return h}for(d=r(i,d);!v.done;p++,v=l.next())null!==(v=A(d,i,p,v.value,c))&&(e&&null!==v.alternate&&d.delete(null===v.key?p:v.key),a=s(v,a,p),null===u?h=v:u.sibling=v,u=v);return e&&d.forEach((function(e){return t(i,e)})),h}return function(e,r,s,l){var d="object"==typeof s&&null!==s&&s.type===u&&null===s.key;d&&(s=s.props.children);var p="object"==typeof s&&null!==s;if(p)switch(s.$$typeof){case c:e:{for(p=s.key,d=r;null!==d;){if(d.key===p){if(7===d.tag){if(s.type===u){n(e,d.sibling),(r=i(d,s.props.children)).return=e,e=r;break e}}else if(d.elementType===s.type){n(e,d.sibling),(r=i(d,s.props)).ref=In(e,d,s),r.return=e,e=r;break e}n(e,d);break}t(e,d),d=d.sibling}s.type===u?((r=wa(s.props.children,e.mode,l,s.key)).return=e,e=r):((l=Sa(s.type,s.key,s.props,null,e.mode,l)).ref=In(e,r,s),l.return=e,e=l)}return a(e);case h:e:{for(d=s.key;null!==r;){if(r.key===d){if(4===r.tag&&r.stateNode.containerInfo===s.containerInfo&&r.stateNode.implementation===s.implementation){n(e,r.sibling),(r=i(r,s.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ta(s,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof s||"number"==typeof s)return s=""+s,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,s)).return=e,e=r):(n(e,r),(r=Ca(s,e.mode,l)).return=e,e=r),a(e);if(Tn(s))return v(e,r,s,l);if(C(s))return y(e,r,s,l);if(p&&Bn(e,s),void 0===s&&!d)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,T(e.type)||"Component"))}return n(e,r)}}var Pn=Rn(!0),Dn=Rn(!1),Ln={},Fn=Je(Ln),Un=Je(Ln),On=Je(Ln);function Nn(e){if(e===Ln)throw Error(o(174));return e}function kn(e,t){$e(On,t),$e(Un,e),$e(Fn,Ln),e=U(t),Ze(Fn),$e(Fn,e)}function Gn(){Ze(Fn),Ze(Un),Ze(On)}function zn(e){var t=Nn(On.current),n=Nn(Fn.current);n!==(t=O(n,e.type,t))&&($e(Un,e),$e(Fn,t))}function Qn(e){Un.current===e&&(Ze(Fn),Ze(Un))}var Vn=Je(0);function Hn(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Oe(n)||Ne(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jn=null,Wn=null,Xn=!1;function Yn(e,t){var n=ba(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function qn(e,t){switch(e.tag){case 5:return null!==(t=Fe(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=Ue(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function Kn(e){if(Xn){var t=Wn;if(t){var n=t;if(!qn(e,t)){if(!(t=ke(n))||!qn(e,t))return e.flags=-1025&e.flags|2,Xn=!1,void(jn=e);Yn(jn,n)}jn=e,Wn=Ge(t)}else e.flags=-1025&e.flags|2,Xn=!1,jn=e}}function Jn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;jn=e}function Zn(e){if(!Z||e!==jn)return!1;if(!Xn)return Jn(e),Xn=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!H(t,e.memoizedProps))for(t=Wn;t;)Yn(e,t),t=ke(t);if(Jn(e),13===e.tag){if(!Z)throw Error(o(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));Wn=Ve(e)}else Wn=jn?ke(e.stateNode):null;return!0}function $n(){Z&&(Wn=jn=null,Xn=!1)}var er=[];function tr(){for(var e=0;e<er.length;e++){var t=er[e];q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}er.length=0}var nr=l.ReactCurrentDispatcher,rr=l.ReactCurrentBatchConfig,ir=0,sr=null,ar=null,or=null,lr=!1,cr=!1;function hr(){throw Error(o(321))}function ur(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jt(e[n],t[n]))return!1;return!0}function dr(e,t,n,r,i,s){if(ir=s,sr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nr.current=null===e||null===e.memoizedState?Nr:kr,e=n(r,i),cr){s=0;do{if(cr=!1,!(25>s))throw Error(o(301));s+=1,or=ar=null,t.updateQueue=null,nr.current=Gr,e=n(r,i)}while(cr)}if(nr.current=Or,t=null!==ar&&null!==ar.next,ir=0,or=ar=sr=null,lr=!1,t)throw Error(o(300));return e}function pr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===or?sr.memoizedState=or=e:or=or.next=e,or}function fr(){if(null===ar){var e=sr.alternate;e=null!==e?e.memoizedState:null}else e=ar.next;var t=null===or?sr.memoizedState:or.next;if(null!==t)or=t,ar=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ar=e).memoizedState,baseState:ar.baseState,baseQueue:ar.baseQueue,queue:ar.queue,next:null},null===or?sr.memoizedState=or=e:or=or.next=e}return or}function mr(e,t){return"function"==typeof t?t(e):t}function gr(e){var t=fr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=ar,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=a=s=null,c=i;do{var h=c.lane;if((ir&h)===h)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var u={lane:h,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=u,s=r):l=l.next=u,sr.lanes|=h,us|=h}c=c.next}while(null!==c&&c!==i);null===l?s=r:l.next=a,Jt(r,t.memoizedState)||(Qr=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ar(e){var t=fr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);Jt(s,t.memoizedState)||(Qr=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function vr(e,t,n){var r=t._getVersion;r=r(t._source);var i=q?t._workInProgressVersionPrimary:t._workInProgressVersionSecondary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(ir&e)===e)&&(q?t._workInProgressVersionPrimary=r:t._workInProgressVersionSecondary=r,er.push(t))),e)return n(t._source);throw er.push(t),Error(o(350))}function yr(e,t,n,r){var i=rs;if(null===i)throw Error(o(349));var s=t._getVersion,a=s(t._source),l=nr.current,c=l.useState((function(){return vr(i,t,n)})),h=c[1],u=c[0];c=or;var d=e.memoizedState,p=d.refs,f=p.getSnapshot,m=d.source;d=d.subscribe;var g=sr;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=h;var e=s(t._source);if(!Jt(a,e)){e=n(t._source),Jt(u,e)||(h(e),e=Os(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var l=31-Et(o),c=1<<l;r[l]|=e,o&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=Os(g);i.mutableReadLanes|=r&i.pendingLanes}catch(s){n((function(){throw s}))}}))}),[t,r]),Jt(f,n)&&Jt(m,t)&&Jt(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:u}).dispatch=h=Ur.bind(null,sr,e),c.queue=e,c.baseQueue=null,u=vr(i,t,n),c.memoizedState=c.baseState=u),u}function xr(e,t,n){return yr(fr(),e,t,n)}function br(e){var t=pr();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:e}).dispatch=Ur.bind(null,sr,e),[t.memoizedState,e]}function Er(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=sr.updateQueue)?(t={lastEffect:null},sr.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function _r(e){return e={current:e},pr().memoizedState=e}function Sr(){return fr().memoizedState}function wr(e,t,n,r){var i=pr();sr.flags|=e,i.memoizedState=Er(1|t,n,void 0,void 0===r?null:r)}function Mr(e,t,n,r){var i=fr();r=void 0===r?null:r;var s=void 0;if(null!==ar){var a=ar.memoizedState;if(s=a.destroy,null!==r&&ur(r,a.deps))return void Er(t,n,s,r)}sr.flags|=e,i.memoizedState=Er(1|t,n,s,r)}function Cr(e,t){return wr(516,4,e,t)}function Tr(e,t){return Mr(516,4,e,t)}function Ir(e,t){return Mr(4,2,e,t)}function Br(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Rr(e,t,n){return n=null!=n?n.concat([e]):null,Mr(4,2,Br.bind(null,t,e),n)}function Pr(){}function Dr(e,t){var n=fr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ur(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Lr(e,t){var n=fr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ur(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Fr(e,t){var n=Ht();Wt(98>n?98:n,(function(){e(!0)})),Wt(97<n?97:n,(function(){var n=rr.transition;rr.transition=1;try{e(!1),t()}finally{rr.transition=n}}))}function Ur(e,t,n){var r=Us(),i=Os(e),s={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?s.next=s:(s.next=a.next,a.next=s),t.pending=s,a=e.alternate,e===sr||null!==a&&a===sr)cr=lr=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,l=a(o,n);if(s.eagerReducer=a,s.eagerState=l,Jt(l,o))return}catch(c){}Ns(e,i,r)}}var Or={readContext:dn,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useOpaqueIdentifier:hr,unstable_isNewReconciler:!1},Nr={readContext:dn,useCallback:function(e,t){return pr().memoizedState=[e,void 0===t?null:t],e},useContext:dn,useEffect:Cr,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,wr(4,2,Br.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wr(4,2,e,t)},useMemo:function(e,t){var n=pr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ur.bind(null,sr,e),[r.memoizedState,e]},useRef:_r,useState:br,useDebugValue:Pr,useDeferredValue:function(e){var t=br(e),n=t[0],r=t[1];return Cr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=br(!1),t=e[0];return _r(e=Fr.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=pr();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},yr(r,e,t,n)},useOpaqueIdentifier:function(){if(Xn){var e=!1,t=ee((function(){throw e||(e=!0,n(te())),Error(o(355))})),n=br(t)[1];return 0==(2&sr.mode)&&(sr.flags|=516,Er(5,(function(){n(te())}),void 0,null)),t}return br(t=te()),t},unstable_isNewReconciler:!1},kr={readContext:dn,useCallback:Dr,useContext:dn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Lr,useReducer:gr,useRef:Sr,useState:function(){return gr(mr)},useDebugValue:Pr,useDeferredValue:function(e){var t=gr(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=gr(mr)[0];return[Sr().current,e]},useMutableSource:xr,useOpaqueIdentifier:function(){return gr(mr)[0]},unstable_isNewReconciler:!1},Gr={readContext:dn,useCallback:Dr,useContext:dn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Lr,useReducer:Ar,useRef:Sr,useState:function(){return Ar(mr)},useDebugValue:Pr,useDeferredValue:function(e){var t=Ar(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=Ar(mr)[0];return[Sr().current,e]},useMutableSource:xr,useOpaqueIdentifier:function(){return Ar(mr)[0]},unstable_isNewReconciler:!1},zr=l.ReactCurrentOwner,Qr=!1;function Vr(e,t,n,r){t.child=null===e?Dn(t,null,n,r):Pn(t,e.child,n,r)}function Hr(e,t,n,r,i){n=n.render;var s=t.ref;return un(t,i),r=dr(e,t,n,r,s,i),null===e||Qr?(t.flags|=1,Vr(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ui(e,t,i))}function jr(e,t,n,r,i,s){if(null===e){var a=n.type;return"function"!=typeof a||Ea(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Sa(n.type,null,r,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Wr(e,t,a,r,i,s))}return a=e.child,0==(i&s)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:$t)(i,r)&&e.ref===t.ref)?ui(e,t,s):(t.flags|=1,(e=_a(a,r)).ref=t.ref,e.return=t,t.child=e)}function Wr(e,t,n,r,i,s){if(null!==e&&$t(e.memoizedProps,r)&&e.ref===t.ref){if(Qr=!1,0==(s&i))return t.lanes=e.lanes,ui(e,t,s);0!=(16384&e.flags)&&(Qr=!0)}return qr(e,t,n,r,s)}function Xr(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Ws(t,n);else{if(0==(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Ws(t,e),null;t.memoizedState={baseLanes:0},Ws(t,null!==s?s.baseLanes:n)}else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ws(t,r);return Vr(e,t,i,n),t.child}function Yr(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function qr(e,t,n,r,i){var s=st(n)?rt:tt.current;return s=it(t,s),un(t,i),n=dr(e,t,n,r,s,i),null===e||Qr?(t.flags|=1,Vr(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ui(e,t,i))}function Kr(e,t,n,r,i){if(st(n)){var s=!0;ct(t)}else s=!1;if(un(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),wn(t,n,r),Cn(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=dn(c):c=it(t,c=st(n)?rt:tt.current);var h=n.getDerivedStateFromProps,u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate;u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==r||l!==c)&&Mn(t,a,r,c),pn=!1;var d=t.memoizedState;a.state=d,yn(t,r,a,i),l=t.memoizedState,o!==r||d!==l||nt.current||pn?("function"==typeof h&&(En(t,n,h,r),l=t.memoizedState),(o=pn||Sn(t,n,o,r,d,l,c))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=o):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,mn(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:tn(t.type,o),a.props=c,u=t.pendingProps,d=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=dn(l):l=it(t,l=st(n)?rt:tt.current);var p=n.getDerivedStateFromProps;(h="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==u||d!==l)&&Mn(t,a,r,l),pn=!1,d=t.memoizedState,a.state=d,yn(t,r,a,i);var f=t.memoizedState;o!==u||d!==f||nt.current||pn?("function"==typeof p&&(En(t,n,p,r),f=t.memoizedState),(c=pn||Sn(t,n,c,r,d,f,l))?(h||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return Jr(e,t,n,r,s,i)}function Jr(e,t,n,r,i,s){Yr(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&ht(t,n,!1),ui(e,t,s);r=t.stateNode,zr.current=t;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Pn(t,e.child,null,s),t.child=Pn(t,null,o,s)):Vr(e,t,o,s),t.memoizedState=r.state,i&&ht(t,n,!0),t.child}function Zr(e){var t=e.stateNode;t.pendingContext?ot(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ot(0,t.context,!1),kn(e,t.containerInfo)}var $r,ei,ti,ni,ri={dehydrated:null,retryLane:0};function ii(e,t,n){var r,i=t.pendingProps,s=Vn.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&s)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(s|=1),$e(Vn,1&s),null===e?(void 0!==i.fallback&&Kn(t),e=i.children,s=i.fallback,a?(e=si(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,e):"number"==typeof i.unstable_expectedLoadTime?(e=si(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,t.lanes=33554432,e):((n=Ma({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=oi(e,t,i.children,i.fallback,n),a=t.child,s=e.child.memoizedState,a.memoizedState=null===s?{baseLanes:n}:{baseLanes:s.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=ri,i):(n=ai(e,t,i.children,n),t.memoizedState=null,n))}function si(e,t,n,r){var i=e.mode,s=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==s?(s.childLanes=0,s.pendingProps=t):s=Ma(t,i,0,null),n=wa(n,i,r,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n}function ai(e,t,n,r){var i=e.child;return e=i.sibling,n=_a(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function oi(e,t,n,r,i){var s=t.mode,a=e.child;e=a.sibling;var o={mode:"hidden",children:n};return 0==(2&s)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=o,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=_a(a,o),null!==e?r=_a(e,r):(r=wa(r,s,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function li(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),hn(e.return,t)}function ci(e,t,n,r,i,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=s)}function hi(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Vr(e,t,r.children,n),0!=(2&(r=Vn.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&li(e,n);else if(19===e.tag)li(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($e(Vn,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Hn(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ci(t,!1,i,n,s,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Hn(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ci(t,!0,n,null,s,t.lastEffect);break;case"together":ci(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ui(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),us|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=_a(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=_a(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function di(e){e.flags|=4}if(K)$r=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)z(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ei=function(){},ti=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var s=t.stateNode,a=Nn(Fn.current);n=V(s,n,e,r,i,a),(t.updateQueue=n)&&di(t)}},ni=function(e,t,n,r){n!==r&&di(t)};else if(J){$r=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var s=i.stateNode;n&&r&&(s=De(s,i.type,i.memoizedProps,i)),z(e,s)}else if(6===i.tag)s=i.stateNode,n&&r&&(s=Le(s,i.memoizedProps,i)),z(e,s);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(s=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,$r(e,a,!0,s)),null!==(s=a.sibling))){s.return=i,i=s;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var pi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var s=i.stateNode;n&&r&&(s=De(s,i.type,i.memoizedProps,i)),Be(e,s)}else if(6===i.tag)s=i.stateNode,n&&r&&(s=Le(s,i.memoizedProps,i)),Be(e,s);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(s=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,pi(e,a,!0,s)),null!==(s=a.sibling))){s.return=i,i=s;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ei=function(e){var t=e.stateNode;if(null!==e.firstEffect){var n=t.containerInfo,r=Ie(n);pi(r,e,!1,!1),t.pendingChildren=r,di(e),Re(n,r)}},ti=function(e,t,n,r,i){var s=e.stateNode,a=e.memoizedProps;if((e=null===t.firstEffect)&&a===r)t.stateNode=s;else{var o=t.stateNode,l=Nn(Fn.current),c=null;a!==r&&(c=V(o,n,a,r,i,l)),e&&null===c?t.stateNode=s:(s=Te(s,c,n,a,r,t,e,o),Q(s,n,r,i,l)&&di(t),t.stateNode=s,e?di(t):$r(s,t,!1,!1))}},ni=function(e,t,n,r){n!==r?(e=Nn(On.current),n=Nn(Fn.current),t.stateNode=j(r,e,n,t),di(t)):t.stateNode=e.stateNode}}else ei=function(){},ti=function(){},ni=function(){};function fi(e,t){if(!Xn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mi(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return st(t.type)&&at(),null;case 3:return Gn(),Ze(nt),Ze(tt),tr(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Zn(t)?di(t):r.hydrate||(t.flags|=256)),ei(t),null;case 5:Qn(t);var i=Nn(On.current);if(n=t.type,null!==e&&null!=t.stateNode)ti(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Nn(Fn.current),Zn(t)){if(!Z)throw Error(o(175));e=ze(t.stateNode,t.type,t.memoizedProps,i,e,t),t.updateQueue=e,null!==e&&di(t)}else{var s=G(n,r,i,e,t);$r(s,t,!1,!1),t.stateNode=s,Q(s,n,r,i,e)&&di(t)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)ni(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=Nn(On.current),i=Nn(Fn.current),Zn(t)){if(!Z)throw Error(o(176));Qe(t.stateNode,t.memoizedProps,t)&&di(t)}else t.stateNode=j(r,e,i,t)}return null;case 13:return Ze(Vn),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,i=!1,null===e?void 0!==t.memoizedProps.fallback&&Zn(t):i=null!==e.memoizedState,r&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Vn.current)?0===ls&&(ls=3):(0!==ls&&3!==ls||(ls=4),null===rs||0==(134217727&us)&&0==(134217727&ds)||Qs(rs,ss))),J&&r&&(t.flags|=4),K&&(r||i)&&(t.flags|=4),null);case 4:return Gn(),ei(t),null===e&&ie(t.stateNode.containerInfo),null;case 10:return cn(t),null;case 19:if(Ze(Vn),null===(r=t.memoizedState))return null;if(i=0!=(64&t.flags),null===(s=r.rendering))if(i)fi(r,!1);else{if(0!==ls||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(s=Hn(e))){for(t.flags|=64,fi(r,!1),null!==(e=s.updateQueue)&&(t.updateQueue=e,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,e=n,r=t.child;null!==r;)n=e,(i=r).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(s=i.alternate)?(i.childLanes=0,i.lanes=n,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,n=s.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext}),r=r.sibling;return $e(Vn,1&Vn.current|2),t.child}e=e.sibling}null!==r.tail&&Vt()>gs&&(t.flags|=64,i=!0,fi(r,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Hn(s))){if(t.flags|=64,i=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),fi(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!Xn)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Vt()-r.renderingStartTime>gs&&1073741824!==n&&(t.flags|=64,i=!0,fi(r,!1),t.lanes=33554432);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Vt(),e.sibling=null,t=Vn.current,$e(Vn,i?1&t|2:1&t),e):null;case 23:case 24:return Xs(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function gi(e){switch(e.tag){case 1:st(e.type)&&at();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Gn(),Ze(nt),Ze(tt),tr(),0!=(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Qn(e),null;case 13:return Ze(Vn),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return Ze(Vn),null;case 4:return Gn(),null;case 10:return cn(e),null;case 23:case 24:return Xs(),null;default:return null}}function Ai(e,t){try{var n="",r=t;do{n+=en(r),r=r.return}while(r);var i=n}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i}}function vi(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var yi="function"==typeof WeakMap?WeakMap:Map;function xi(e,t,n){(n=gn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xs||(xs=!0,bs=r),vi(0,t)},n}function bi(e,t,n){(n=gn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return vi(0,t),r(i)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Es?Es=new Set([this]):Es.add(this),vi(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var Ei="function"==typeof WeakSet?WeakSet:Set;function _i(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){ha(e,n)}else t.current=null}function Si(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:tn(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(K&&256&t.flags&&Ce(t.stateNode.containerInfo))}throw Error(o(163))}function wi(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function Mi(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(oa(n,e),aa(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:tn(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&xn(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=F(n.child.stateNode);break;case 1:e=n.child.stateNode}xn(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&ge(e,n.type,n.memoizedProps,n));case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(Z&&null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&je(n)))))}throw Error(o(163))}function Ci(e,t){if(K)for(var n=e;;){if(5===n.tag){var r=n.stateNode;t?_e(r):we(n.stateNode,n.memoizedProps)}else if(6===n.tag)r=n.stateNode,t?Se(r):Me(r,n.memoizedProps);else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function Ti(e,t){if(dt&&"function"==typeof dt.onCommitFiberUnmount)try{dt.onCommitFiberUnmount(ut,t)}catch(s){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))oa(t,n);else{r=t;try{i()}catch(s){ha(r,s)}}n=n.next}while(n!==e)}break;case 1:if(_i(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(s){ha(t,s)}break;case 5:_i(t);break;case 4:K?Fi(e,t):J&&J&&(t=t.stateNode.containerInfo,e=Ie(t),Pe(t,e))}}function Ii(e,t){for(var n=t;;)if(Ti(e,n),null===n.child||K&&4===n.tag){if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else n.child.return=n,n=n.child}function Bi(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Ri(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){if(K){e:{for(var t=e.return;null!==t;){if(Ri(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(Ee(t),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Ri(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Di(e,n,t):Li(e,n,t)}}function Di(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?ye(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Di(e,t,n),e=e.sibling;null!==e;)Di(e,t,n),e=e.sibling}function Li(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?ve(n,e,t):pe(n,e);else if(4!==r&&null!==(e=e.child))for(Li(e,t,n),e=e.sibling;null!==e;)Li(e,t,n),e=e.sibling}function Fi(e,t){for(var n,r,i=t,s=!1;;){if(!s){s=i.return;e:for(;;){if(null===s)throw Error(o(160));switch(n=s.stateNode,s.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}s=s.return}s=!0}if(5===i.tag||6===i.tag)Ii(e,i),r?be(n,i.stateNode):xe(n,i.stateNode);else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(Ti(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(s=!1)}i.sibling.return=i.return,i=i.sibling}}function Ui(e,t){if(K){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void wi(3,t);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,s=t.updateQueue;t.updateQueue=null,null!==s&&Ae(n,s,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(o(162));return n=t.memoizedProps,void me(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(Z&&(t=t.stateNode,t.hydrate&&(t.hydrate=!1,He(t.containerInfo))));case 13:return Oi(t),void Ni(t);case 19:return void Ni(t);case 23:case 24:return void Ci(t,null!==t.memoizedState)}throw Error(o(163))}switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void wi(3,t);case 12:case 23:case 24:return;case 13:return Oi(t),void Ni(t);case 19:return void Ni(t);case 3:Z&&((n=t.stateNode).hydrate&&(n.hydrate=!1,He(n.containerInfo)))}e:if(J){switch(t.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:t=t.stateNode,Pe(t.containerInfo,t.pendingChildren);break e}throw Error(o(163))}}function Oi(e){null!==e.memoizedState&&(ms=Vt(),K&&Ci(e.child,!0))}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ei),t.forEach((function(t){var r=da.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function ki(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Gi=0,zi=1,Qi=2,Vi=3,Hi=4;if("function"==typeof Symbol&&Symbol.for){var ji=Symbol.for;Gi=ji("selector.component"),zi=ji("selector.has_pseudo_class"),Qi=ji("selector.role"),Vi=ji("selector.test_id"),Hi=ji("selector.text")}function Wi(e){var t=$(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(o(364));return t}if(null===(e=ae(e)))throw Error(o(362));return e.stateNode.current}function Xi(e,t){switch(t.$$typeof){case Gi:if(e.type===t.value)return!0;break;case zi:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],s=t[i];if(5!==r.tag||!ce(r)){for(;null!=s&&Xi(r,s);)s=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case Qi:if(5===e.tag&&he(e.stateNode,t.value))return!0;break;case Hi:if((5===e.tag||6===e.tag)&&(null!==(e=le(e))&&0<=e.indexOf(t.value)))return!0;break;case Vi:if(5===e.tag&&("string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(o(365,t))}return!1}function Yi(e){switch(e.$$typeof){case Gi:return"<"+(T(e.value)||"Unknown")+">";case zi:return":has("+(Yi(e)||"")+")";case Qi:return'[role="'+e.value+'"]';case Hi:return'"'+e.value+'"';case Vi:return'[data-testname="'+e.value+'"]';default:throw Error(o(365,e))}}function qi(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],s=e[r++],a=t[s];if(5!==i.tag||!ce(i)){for(;null!=a&&Xi(i,a);)a=t[++s];if(s===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,s),i=i.sibling}}return n}function Ki(e,t){if(!se)throw Error(o(363));e=qi(e=Wi(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)ce(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var Ji=null;var Zi=Math.ceil,$i=l.ReactCurrentDispatcher,es=l.ReactCurrentOwner,ts=l.IsSomeRendererActing,ns=0,rs=null,is=null,ss=0,as=0,os=Je(0),ls=0,cs=null,hs=0,us=0,ds=0,ps=0,fs=null,ms=0,gs=1/0;function As(){gs=Vt()+500}var vs,ys=null,xs=!1,bs=null,Es=null,_s=!1,Ss=null,ws=90,Ms=[],Cs=[],Ts=null,Is=0,Bs=null,Rs=-1,Ps=0,Ds=0,Ls=null,Fs=!1;function Us(){return 0!=(48&ns)?Vt():-1!==Rs?Rs:Rs=Vt()}function Os(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Ht()?1:2;if(0===Ps&&(Ps=hs),0!==Kt.transition){0!==Ds&&(Ds=null!==fs?fs.pendingLanes:0),e=Ps;var t=4186112&~Ds;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Ht(),0!=(4&ns)&&98===e?e=vt(12,Ps):e=vt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),Ps),e}function Ns(e,t,n){if(50<Is)throw Is=0,Bs=null,Error(o(185));if(null===(e=ks(e,t)))return null;bt(e,t,n),e===rs&&(ds|=t,4===ls&&Qs(e,ss));var r=Ht();1===t?0!=(8&ns)&&0==(48&ns)?Vs(e):(Gs(e,n),0===ns&&(As(),Yt())):(0==(4&ns)||98!==r&&99!==r||(null===Ts?Ts=new Set([e]):Ts.add(e)),Gs(e,n)),fs=e}function ks(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function Gs(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Et(a),c=1<<l,h=s[l];if(-1===h){if(0==(c&r)||0!=(c&i)){h=t,mt(c);var u=ft;s[l]=10<=u?h+250:6<=u?h+5e3:-1}}else h<=t&&(e.expiredLanes|=c);a&=~c}if(r=gt(e,e===rs?ss:0),t=ft,0===r)null!==n&&(n!==Ot&&Ct(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ot&&Ct(n)}15===t?(n=Vs.bind(null,e),null===kt?(kt=[n],Gt=Mt(Pt,qt)):kt.push(n),n=Ot):14===t?n=Xt(99,Vs.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=Xt(n,zs.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function zs(e){if(Rs=-1,Ds=Ps=0,0!=(48&ns))throw Error(o(327));var t=e.callbackNode;if(sa()&&e.callbackNode!==t)return null;var n=gt(e,e===rs?ss:0);if(0===n)return null;var r=n,i=ns;ns|=16;var s=Ks();for(rs===e&&ss===r||(As(),Ys(e,r));;)try{$s();break}catch(l){qs(e,l)}if(on(),$i.current=s,ns=i,null!==is?r=0:(rs=null,ss=0,r=ls),0!=(hs&ds))Ys(e,0);else if(0!==r){if(2===r&&(ns|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(n=At(e))&&(r=Js(e,n))),1===r)throw t=cs,Ys(e,0),Qs(e,n),Gs(e,Vt()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:na(e);break;case 3:if(Qs(e,n),(62914560&n)===n&&10<(r=ms+500-Vt())){if(0!==gt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){Us(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=W(na.bind(null,e),r);break}na(e);break;case 4:if(Qs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var a=31-Et(n);s=1<<a,(a=r[a])>i&&(i=a),n&=~s}if(n=i,10<(n=(120>(n=Vt()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Zi(n/1960))-n)){e.timeoutHandle=W(na.bind(null,e),n);break}na(e);break;default:throw Error(o(329))}}return Gs(e,Vt()),e.callbackNode===t?zs.bind(null,e):null}function Qs(e,t){for(t&=~ps,t&=~ds,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Et(t),r=1<<n;e[n]=-1,t&=~r}}function Vs(e){if(0!=(48&ns))throw Error(o(327));if(sa(),e===rs&&0!=(e.expiredLanes&ss)){var t=ss,n=Js(e,t);0!=(hs&ds)&&(n=Js(e,t=gt(e,t)))}else n=Js(e,t=gt(e,0));if(0!==e.tag&&2===n&&(ns|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(t=At(e))&&(n=Js(e,t))),1===n)throw n=cs,Ys(e,0),Qs(e,t),Gs(e,Vt()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,na(e),Gs(e,Vt()),null}function Hs(e,t){var n=ns;ns|=1;try{return e(t)}finally{0===(ns=n)&&(As(),Yt())}}function js(e,t){var n=ns;if(0!=(48&n))return e(t);ns|=1;try{if(e)return Wt(99,e.bind(null,t))}finally{ns=n,Yt()}}function Ws(e,t){$e(os,as),as|=t,hs|=t}function Xs(){as=os.current,Ze(os)}function Ys(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==Y&&(e.timeoutHandle=Y,X(n)),null!==is)for(n=is.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&at();break;case 3:Gn(),Ze(nt),Ze(tt),tr();break;case 5:Qn(r);break;case 4:Gn();break;case 13:case 19:Ze(Vn);break;case 10:cn(r);break;case 23:case 24:Xs()}n=n.return}rs=e,is=_a(e.current,null),ss=as=hs=t,ls=0,cs=null,ps=ds=us=0}function qs(e,t){for(;;){var n=is;try{if(on(),nr.current=Or,lr){for(var r=sr.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}lr=!1}if(ir=0,or=ar=sr=null,cr=!1,es.current=null,null===n||null===n.return){ls=1,cs=t,is=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=ss,o.flags|=2048,o.firstEffect=o.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&o.mode)){var h=o.alternate;h?(o.updateQueue=h.updateQueue,o.memoizedState=h.memoizedState,o.lanes=h.lanes):(o.updateQueue=null,o.memoizedState=null)}var u=0!=(1&Vn.current),d=a;do{var p;if(p=13===d.tag){var f=d.memoizedState;if(null!==f)p=null!==f.dehydrated;else{var m=d.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!u)}}if(p){var g=d.updateQueue;if(null===g){var A=new Set;A.add(c),d.updateQueue=A}else g.add(c);if(0==(2&d.mode)){if(d.flags|=64,o.flags|=16384,o.flags&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var v=gn(-1,1);v.tag=2,An(o,v)}o.lanes|=1;break e}l=void 0,o=t;var y=s.pingCache;if(null===y?(y=s.pingCache=new yi,l=new Set,y.set(c,l)):void 0===(l=y.get(c))&&(l=new Set,y.set(c,l)),!l.has(o)){l.add(o);var x=ua.bind(null,s,c,o);c.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((T(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==ls&&(ls=2),l=Ai(l,o),d=a;do{switch(d.tag){case 3:s=l,d.flags|=4096,t&=-t,d.lanes|=t,vn(d,xi(0,s,t));break e;case 1:s=l;var b=d.type,E=d.stateNode;if(0==(64&d.flags)&&("function"==typeof b.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Es||!Es.has(E)))){d.flags|=4096,t&=-t,d.lanes|=t,vn(d,bi(d,s,t));break e}}d=d.return}while(null!==d)}ta(n)}catch(_){t=_,is===n&&null!==n&&(is=n=n.return);continue}break}}function Ks(){var e=$i.current;return $i.current=Or,null===e?Or:e}function Js(e,t){var n=ns;ns|=16;var r=Ks();for(rs===e&&ss===t||Ys(e,t);;)try{Zs();break}catch(i){qs(e,i)}if(on(),ns=n,$i.current=r,null!==is)throw Error(o(261));return rs=null,ss=0,ls}function Zs(){for(;null!==is;)ea(is)}function $s(){for(;null!==is&&!Tt();)ea(is)}function ea(e){var t=vs(e.alternate,e,as);e.memoizedProps=e.pendingProps,null===t?ta(e):is=t,es.current=null}function ta(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=mi(n,t,as)))return void(is=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&as)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=gi(t)))return n.flags&=2047,void(is=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(is=t);is=t=e}while(null!==t);0===ls&&(ls=5)}function na(e){var t=Ht();return Wt(99,ra.bind(null,e,t)),null}function ra(e,t){do{sa()}while(null!==Ss);if(0!=(48&ns))throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<s;){var c=31-Et(s),h=1<<c;i[c]=0,a[c]=-1,l[c]=-1,s&=~h}if(null!==Ts&&0==(24&r)&&Ts.has(e)&&Ts.delete(e),e===rs&&(is=rs=null,ss=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){i=ns,ns|=32,es.current=null,Ls=N(e.containerInfo),Fs=!1,ys=r;do{try{ia()}catch(v){if(null===ys)throw Error(o(330));ha(ys,v),ys=ys.nextEffect}}while(null!==ys);Ls=null,ys=r;do{try{for(a=e;null!==ys;){var u=ys.flags;if(16&u&&K&&Ee(ys.stateNode),128&u){var d=ys.alternate;if(null!==d){var p=d.ref;null!==p&&("function"==typeof p?p(null):p.current=null)}}switch(1038&u){case 2:Pi(ys),ys.flags&=-3;break;case 6:Pi(ys),ys.flags&=-3,Ui(ys.alternate,ys);break;case 1024:ys.flags&=-1025;break;case 1028:ys.flags&=-1025,Ui(ys.alternate,ys);break;case 4:Ui(ys.alternate,ys);break;case 8:l=a,s=ys,K?Fi(l,s):Ii(l,s);var f=s.alternate;Bi(s),null!==f&&Bi(f)}ys=ys.nextEffect}}catch(v){if(null===ys)throw Error(o(330));ha(ys,v),ys=ys.nextEffect}}while(null!==ys);Fs&&re(),k(e.containerInfo),e.current=n,ys=r;do{try{for(u=e;null!==ys;){var m=ys.flags;if(36&m&&Mi(u,ys.alternate,ys),128&m){d=void 0;var g=ys.ref;if(null!==g){var A=ys.stateNode;if(5===ys.tag)d=F(A);else d=A;"function"==typeof g?g(d):g.current=d}}ys=ys.nextEffect}}catch(v){if(null===ys)throw Error(o(330));ha(ys,v),ys=ys.nextEffect}}while(null!==ys);ys=null,Nt(),ns=i}else e.current=n;if(_s)_s=!1,Ss=e,ws=t;else for(ys=r;null!==ys;)t=ys.nextEffect,ys.nextEffect=null,8&ys.flags&&((m=ys).sibling=null,m.stateNode=null),ys=t;if(0===(r=e.pendingLanes)&&(Es=null),1===r?e===Bs?Is++:(Is=0,Bs=e):Is=0,n=n.stateNode,dt&&"function"==typeof dt.onCommitFiberRoot)try{dt.onCommitFiberRoot(ut,n,void 0,64==(64&n.current.flags))}catch(v){}if(Gs(e,Vt()),xs)throw xs=!1,e=bs,bs=null,e;return 0!=(8&ns)||Yt(),null}function ia(){for(;null!==ys;){var e=ys.alternate;Fs||null===Ls||(0!=(8&ys.flags)?D(ys,Ls)&&(Fs=!0,ne()):13===ys.tag&&ki(e,ys)&&D(ys,Ls)&&(Fs=!0,ne()));var t=ys.flags;0!=(256&t)&&Si(e,ys),0==(512&t)||_s||(_s=!0,Xt(97,(function(){return sa(),null}))),ys=ys.nextEffect}}function sa(){if(90!==ws){var e=97<ws?97:ws;return ws=90,Wt(e,la)}return!1}function aa(e,t){Ms.push(t,e),_s||(_s=!0,Xt(97,(function(){return sa(),null})))}function oa(e,t){Cs.push(t,e),_s||(_s=!0,Xt(97,(function(){return sa(),null})))}function la(){if(null===Ss)return!1;var e=Ss;if(Ss=null,0!=(48&ns))throw Error(o(331));var t=ns;ns|=32;var n=Cs;Cs=[];for(var r=0;r<n.length;r+=2){var i=n[r],s=n[r+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(c){if(null===s)throw Error(o(330));ha(s,c)}}for(n=Ms,Ms=[],r=0;r<n.length;r+=2){i=n[r],s=n[r+1];try{var l=i.create;i.destroy=l()}catch(c){if(null===s)throw Error(o(330));ha(s,c)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return ns=t,Yt(),!0}function ca(e,t,n){An(e,t=xi(0,t=Ai(n,t),1)),t=Us(),null!==(e=ks(e,1))&&(bt(e,1,t),Gs(e,t))}function ha(e,t){if(3===e.tag)ca(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){ca(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Es||!Es.has(r))){var i=bi(n,e=Ai(t,e),1);if(An(n,i),i=Us(),null!==(n=ks(n,1)))bt(n,1,i),Gs(n,i);else if("function"==typeof r.componentDidCatch&&(null===Es||!Es.has(r)))try{r.componentDidCatch(t,e)}catch(s){}break}}n=n.return}}function ua(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Us(),e.pingedLanes|=e.suspendedLanes&n,rs===e&&(ss&n)===n&&(4===ls||3===ls&&(62914560&ss)===ss&&500>Vt()-ms?Ys(e,0):ps|=n),Gs(e,t)}function da(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Ht()?1:2:(0===Ps&&(Ps=hs),0===(t=yt(62914560&~Ps))&&(t=4194304))),n=Us(),null!==(e=ks(e,t))&&(bt(e,t,n),Gs(e,n))}vs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||nt.current)Qr=!0;else{if(0==(n&r)){switch(Qr=!1,t.tag){case 3:Zr(t),$n();break;case 5:zn(t);break;case 1:st(t.type)&&ct(t);break;case 4:kn(t,t.stateNode.containerInfo);break;case 10:ln(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?ii(e,t,n):($e(Vn,1&Vn.current),null!==(t=ui(e,t,n))?t.sibling:null);$e(Vn,1&Vn.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return hi(e,t,n);t.flags|=64}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Vn,Vn.current),r)break;return null;case 23:case 24:return t.lanes=0,Xr(e,t,n)}return ui(e,t,n)}Qr=0!=(16384&e.flags)}else Qr=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=it(t,tt.current),un(t,n),i=dr(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)){var s=!0;ct(t)}else s=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,fn(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&En(t,r,a,e),i.updater=_n,t.stateNode=i,i._reactInternals=t,Cn(t,r,e,n),t=Jr(null,t,r,!0,s,n)}else t.tag=0,Vr(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(s=i._init)(i._payload),t.type=i,s=t.tag=function(e){if("function"==typeof e)return Ea(e)?1:0;if(null!=e){if((e=e.$$typeof)===g)return 11;if(e===y)return 14}return 2}(i),e=tn(i,e),s){case 0:t=qr(null,t,i,e,n);break e;case 1:t=Kr(null,t,i,e,n);break e;case 11:t=Hr(null,t,i,e,n);break e;case 14:t=jr(null,t,i,tn(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,qr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 1:return r=t.type,i=t.pendingProps,Kr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 3:if(Zr(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,mn(e,t),yn(t,r,null,n),(r=t.memoizedState.element)===i)$n(),t=ui(e,t,n);else{if((s=(i=t.stateNode).hydrate)&&(Z?(Wn=Ge(t.stateNode.containerInfo),jn=t,s=Xn=!0):s=!1),s){if(Z&&null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)s=e[i],a=e[i+1],q?s._workInProgressVersionPrimary=a:s._workInProgressVersionSecondary=a,er.push(s);for(n=Dn(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Vr(e,t,r,n),$n();t=t.child}return t;case 5:return zn(t),null===e&&Kn(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,H(r,i)?a=null:null!==s&&H(r,s)&&(t.flags|=16),Yr(e,t),Vr(e,t,a,n),t.child;case 6:return null===e&&Kn(t),null;case 13:return ii(e,t,n);case 4:return kn(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Pn(t,null,r,n):Vr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Hr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 7:return Vr(e,t,t.pendingProps,n),t.child;case 8:case 12:return Vr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,ln(t,s=i.value),null!==a){var l=a.value;if(0===(s=Jt(l,s)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,s):1073741823))){if(a.children===i.children&&!nt.current){t=ui(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var h=c.firstContext;null!==h;){if(h.context===r&&0!=(h.observedBits&s)){1===l.tag&&((h=gn(-1,n&-n)).tag=2,An(l,h)),l.lanes|=n,null!==(h=l.alternate)&&(h.lanes|=n),hn(l.return,n),c.lanes|=n;break}h=h.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}}Vr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(s=t.pendingProps).children,un(t,n),r=r(i=dn(i,s.unstable_observedBits)),t.flags|=1,Vr(e,t,r,n),t.child;case 14:return s=tn(i=t.type,t.pendingProps),jr(e,t,i,s=tn(i.type,s),r,n);case 15:return Wr(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tn(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,st(r)?(e=!0,ct(t)):e=!1,un(t,n),wn(t,r,i),Cn(t,r,i,n),Jr(null,t,r,!0,e,n);case 19:return hi(e,t,n);case 23:case 24:return Xr(e,t,n)}throw Error(o(156,t.tag))};var pa={current:!1},fa=a.unstable_flushAllWithoutAsserting,ma="function"==typeof fa;function ga(){if(void 0!==fa)return fa();for(var e=!1;sa();)e=!0;return e}function Aa(t){try{ga(),function(t){if(null===Ji)try{var n=("require"+Math.random()).slice(0,7);Ji=(e&&e[n]).call(e,"timers").setImmediate}catch(r){Ji=function(e){var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ji(t)}((function(){ga()?Aa(t):t()}))}catch(n){t(n)}}var va=0,ya=!1;function xa(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(e,t,n,r){return new xa(e,t,n,r)}function Ea(e){return!(!(e=e.prototype)||!e.isReactComponent)}function _a(e,t){var n=e.alternate;return null===n?((n=ba(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sa(e,t,n,r,i,s){var a=2;if(r=e,"function"==typeof e)Ea(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case u:return wa(n.children,i,s,t);case E:a=8,i|=16;break;case d:a=8,i|=1;break;case p:return(e=ba(12,n,t,8|i)).elementType=p,e.type=p,e.lanes=s,e;case A:return(e=ba(13,n,t,i)).type=A,e.elementType=A,e.lanes=s,e;case v:return(e=ba(19,n,t,i)).elementType=v,e.lanes=s,e;case _:return Ma(n,i,s,t);case S:return(e=ba(24,n,t,i)).elementType=S,e.lanes=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:a=10;break e;case m:a=9;break e;case g:a=11;break e;case y:a=14;break e;case x:a=16,r=null;break e;case b:a=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=ba(a,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function wa(e,t,n,r){return(e=ba(7,e,r,t)).lanes=n,e}function Ma(e,t,n,r){return(e=ba(23,e,r,t)).elementType=_,e.lanes=n,e}function Ca(e,t,n){return(e=ba(6,e,null,t)).lanes=n,e}function Ta(e,t,n){return(t=ba(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ia(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Y,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=xt(0),this.expirationTimes=xt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xt(0),Z&&(this.mutableSourceEagerHydrationData=null)}function Ba(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return null===(e=P(t))?null:e.stateNode}function Ra(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Pa(e,t){Ra(e,t),(e=e.alternate)&&Ra(e,t)}function Da(e){return null===(e=P(e))?null:e.stateNode}function La(){return null}return r.IsThisRendererActing=pa,r.act=function(e){function t(){va--,ts.current=n,pa.current=r}!1===ya&&(ya=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),va++;var n=ts.current,r=pa.current;ts.current=!0,pa.current=!0;try{var i=Hs(e)}catch(s){throw t(),s}if(null!==i&&"object"==typeof i&&"function"==typeof i.then)return{then:function(e,r){i.then((function(){1<va||!0===ma&&!0===n?(t(),e()):Aa((function(n){t(),n?r(n):e()}))}),(function(e){t(),r(e)}))}};try{1!==va||!1!==ma&&!1!==n||ga(),t()}catch(s){throw t(),s}return{then:function(e){e()}}},r.attemptContinuousHydration=function(e){13===e.tag&&(Ns(e,67108864,Us()),Pa(e,67108864))},r.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=Us(),n=Os(e);Ns(e,n,t),Pa(e,n)}},r.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.hydrate){var n=mt(t.pendingLanes);t.expiredLanes|=n&t.pendingLanes,Gs(t,Vt()),0==(48&ns)&&(As(),Yt())}break;case 13:var r=Us();js((function(){return Ns(e,1,r)})),Pa(e,4)}},r.attemptUserBlockingHydration=function(e){13===e.tag&&(Ns(e,4,Us()),Pa(e,4))},r.batchedEventUpdates=function(e,t){var n=ns;ns|=2;try{return e(t)}finally{0===(ns=n)&&(As(),Yt())}},r.batchedUpdates=Hs,r.createComponentSelector=function(e){return{$$typeof:Gi,value:e}},r.createContainer=function(e,t,n){return e=new Ia(e,t,n),t=ba(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e,fn(t),e},r.createHasPsuedoClassSelector=function(e){return{$$typeof:zi,value:e}},r.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:h,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},r.createRoleSelector=function(e){return{$$typeof:Qi,value:e}},r.createTestNameSelector=function(e){return{$$typeof:Vi,value:e}},r.createTextSelector=function(e){return{$$typeof:Hi,value:e}},r.deferredUpdates=function(e){return Wt(97,e)},r.discreteUpdates=function(e,t,n,r,i){var s=ns;ns|=4;try{return Wt(98,e.bind(null,t,n,r,i))}finally{0===(ns=s)&&(As(),Yt())}},r.findAllNodes=Ki,r.findBoundingRects=function(e,t){if(!se)throw Error(o(363));t=Ki(e,t),e=[];for(var n=0;n<t.length;n++)e.push(oe(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,i=r+n.width,s=n.y,a=s+n.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],h=c.x,u=h+c.width,d=c.y,p=d+c.height;if(r>=h&&s>=d&&i<=u&&a<=p){e.splice(t,1);break}if(!(r!==h||n.width!==c.width||p<s||d>a)){d>s&&(c.height+=d-s,c.y=s),p<a&&(c.height=a-d),e.splice(t,1);break}if(!(s!==d||n.height!==c.height||u<r||h>i)){h>r&&(c.width+=h-r,c.x=r),u<i&&(c.width=i-h),e.splice(t,1);break}}return e},r.findHostInstance=Ba,r.findHostInstanceWithNoPortals=function(e){return null===(e=function(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}(e))?null:20===e.tag?e.stateNode.instance:e.stateNode},r.findHostInstanceWithWarning=function(e){return Ba(e)},r.flushControlled=function(e){var t=ns;ns|=1;try{Wt(99,e)}finally{0===(ns=t)&&(As(),Yt())}},r.flushDiscreteUpdates=function(){0==(49&ns)&&(function(){if(null!==Ts){var e=Ts;Ts=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,Gs(e,Vt())}))}Yt()}(),sa())},r.flushPassiveEffects=sa,r.flushSync=js,r.focusWithin=function(e,t){if(!se)throw Error(o(363));for(t=qi(e=Wi(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!ce(n)){if(5===n.tag&&ue(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},r.getCurrentUpdateLanePriority=function(){return pt},r.getFindAllNodesFailureDescription=function(e,t){if(!se)throw Error(o(363));var n=0,r=[];e=[Wi(e),0];for(var i=0;i<e.length;){var s=e[i++],a=e[i++],l=t[a];if((5!==s.tag||!ce(s))&&(Xi(s,l)&&(r.push(Yi(l)),++a>n&&(n=a)),a<t.length))for(s=s.child;null!==s;)e.push(s,a),s=s.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(Yi(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},r.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?F(e.child.stateNode):e.child.stateNode:null},r.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Da,findFiberByHostInstance:e.findFiberByHostInstance||La,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.isDisabled&&t.supportsFiber)try{ut=t.inject(e),dt=t}catch(n){}e=!0}return e},r.observeVisibleRects=function(e,t,n,r){if(!se)throw Error(o(363));e=Ki(e,t);var i=de(e,n,r).disconnect;return{disconnect:function(){i()}}},r.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},r.runWithPriority=function(e,t){var n=pt;try{return pt=e,t()}finally{pt=n}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(e,t){var n=ns;ns&=-2,ns|=8;try{return e(t)}finally{0===(ns=n)&&(As(),Yt())}},r.updateContainer=function(e,t,n,r){var i=t.current,s=Us(),a=Os(i);e:if(n){t:{if(I(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(st(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===n.tag){var c=n.type;if(st(c)){n=lt(n,c,l);break e}}n=l}else n=et;return null===t.context?t.context=n:t.pendingContext=n,(t=gn(s,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),An(i,t),Ns(i,a,s),a},r}},76525:(e,t,n)=>{"use strict";e.exports=n(67287)},73466:function(e){var t;e.exports=((t=function(){function e(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";r=e}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",(function(e){e.preventDefault(),n(++r%i.children.length)}),!1);var s=(performance||Date).now(),a=s,o=0,l=e(new t.Panel("FPS","#0ff","#002")),c=e(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=e(new t.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:i,addPanel:e,showPanel:n,begin:function(){s=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(c.update(e-s,200),e>a+1e3&&(l.update(1e3*o/(e-a),100),a=e,o=0,h)){var t=performance.memory;h.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){s=this.end()},domElement:i,setMode:n}}).Panel=function(e,t,n){var r=1/0,i=0,s=Math.round,a=s(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,h=2*a,u=3*a,d=15*a,p=74*a,f=30*a,m=document.createElement("canvas");m.width=o,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=n,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,c,h),g.fillRect(u,d,p,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(u,d,p,f),{dom:m,update:function(l,A){r=Math.min(r,l),i=Math.max(i,l),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=t,g.fillText(s(l)+" "+e+" ("+s(r)+"-"+s(i)+")",c,h),g.drawImage(m,u+a,d,p-a,f,u,d,p-a,f),g.fillRect(u+p-a,d,a,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(u+p-a,d,a,s((1-l/A)*f))}}},t)},14671:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(67294);function i(e){let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(i!==t){const e=t;t=r?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,s={setState:r,getState:i,subscribe:(e,r,s)=>r||s?((e,r=i,s=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let a=r(t);function o(){const n=r(t);if(!s(a,n)){const t=a;e(a=n,t)}}return n.add(o),()=>n.delete(o)})(e,r,s):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,s),s}const s="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?r.useEffect:r.useLayoutEffect;function a(e){const t="function"==typeof e?i(e):e,n=(e=t.getState,n=Object.is)=>{const[,i]=(0,r.useReducer)((e=>e+1),0),a=t.getState(),o=(0,r.useRef)(a),l=(0,r.useRef)(e),c=(0,r.useRef)(n),h=(0,r.useRef)(!1),u=(0,r.useRef)();let d;void 0===u.current&&(u.current=e(a));let p=!1;(o.current!==a||l.current!==e||c.current!==n||h.current)&&(d=e(a),p=!n(u.current,d)),s((()=>{p&&(u.current=d),o.current=a,l.current=e,c.current=n,h.current=!1}));const f=(0,r.useRef)(a);s((()=>{const e=()=>{try{const e=t.getState(),n=l.current(e);c.current(u.current,n)||(o.current=e,u.current=n,i())}catch(e){h.current=!0,i()}},n=t.subscribe(e);return t.getState()!==f.current&&e(),n}),[]);const m=p?d:u.current;return(0,r.useDebugValue)(m),m};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const e=[n,t];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},n}},60374:(e,t,n)=>{"use strict";function r(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}n.d(t,{Z:()=>r})},8083:(e,t,n)=>{"use strict";var r=n(45928),i=Uint8Array,s=Uint16Array,a=Uint32Array,o=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),h=function(e,t){for(var n=new s(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new a(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},u=h(o,2),d=u[0],p=u[1];d[28]=258,p[258]=28;for(var f=h(l,0),m=f[0],g=f[1],A=new s(32768),v=0;v<32768;++v){var y=(43690&v)>>>1|(21845&v)<<1;y=(61680&(y=(52428&y)>>>2|(13107&y)<<2))>>>4|(3855&y)<<4,A[v]=((65280&y)>>>8|(255&y)<<8)>>>1}var x=function(e,t,n){for(var r=e.length,i=0,a=new s(t);i<r;++i)++a[e[i]-1];var o,l=new s(t);for(i=0;i<t;++i)l[i]=l[i-1]+a[i-1]<<1;if(n){o=new s(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var h=i<<4|e[i],u=t-e[i],d=l[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[A[d]>>>c]=h}else for(o=new s(r),i=0;i<r;++i)e[i]&&(o[i]=A[l[e[i]-1]++]>>>15-e[i]);return o},b=new i(288);for(v=0;v<144;++v)b[v]=8;for(v=144;v<256;++v)b[v]=9;for(v=256;v<280;++v)b[v]=7;for(v=280;v<288;++v)b[v]=8;var E=new i(32);for(v=0;v<32;++v)E[v]=5;var _=x(b,9,0),S=x(b,9,1),w=x(E,5,0),M=x(E,5,1),C=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},T=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},I=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},B=function(e){return(e/8|0)+(7&e&&1)},R=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof s?s:e instanceof a?a:i)(n-t);return r.set(e.subarray(t,n)),r},P=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new i(0);var s=!t||n,a=!n||n.i;n||(n={}),t||(t=new i(3*r));var h=function(e){var n=t.length;if(e>n){var r=new i(Math.max(2*n,e));r.set(t),t=r}},u=n.f||0,p=n.p||0,f=n.b||0,g=n.l,A=n.d,v=n.m,y=n.n,b=8*r;do{if(!g){n.f=u=T(e,p,1);var E=T(e,p+1,3);if(p+=3,!E){var _=e[(z=B(p)+4)-4]|e[z-3]<<8,w=z+_;if(w>r){if(a)throw"unexpected EOF";break}s&&h(f+_),t.set(e.subarray(z,w),f),n.b=f+=_,n.p=p=8*w;continue}if(1==E)g=S,A=M,v=9,y=5;else{if(2!=E)throw"invalid block type";var P=T(e,p,31)+257,D=T(e,p+10,15)+4,L=P+T(e,p+5,31)+1;p+=14;for(var F=new i(L),U=new i(19),O=0;O<D;++O)U[c[O]]=T(e,p+3*O,7);p+=3*D;var N=C(U),k=(1<<N)-1,G=x(U,N,1);for(O=0;O<L;){var z,Q=G[T(e,p,k)];if(p+=15&Q,(z=Q>>>4)<16)F[O++]=z;else{var V=0,H=0;for(16==z?(H=3+T(e,p,3),p+=2,V=F[O-1]):17==z?(H=3+T(e,p,7),p+=3):18==z&&(H=11+T(e,p,127),p+=7);H--;)F[O++]=V}}var j=F.subarray(0,P),W=F.subarray(P);v=C(j),y=C(W),g=x(j,v,1),A=x(W,y,1)}if(p>b){if(a)throw"unexpected EOF";break}}s&&h(f+131072);for(var X=(1<<v)-1,Y=(1<<y)-1,q=p;;q=p){var K=(V=g[I(e,p)&X])>>>4;if((p+=15&V)>b){if(a)throw"unexpected EOF";break}if(!V)throw"invalid length/literal";if(K<256)t[f++]=K;else{if(256==K){q=p,g=null;break}var J=K-254;if(K>264){var Z=o[O=K-257];J=T(e,p,(1<<Z)-1)+d[O],p+=Z}var $=A[I(e,p)&Y],ee=$>>>4;if(!$)throw"invalid distance";p+=15&$;W=m[ee];if(ee>3){Z=l[ee];W+=I(e,p)&(1<<Z)-1,p+=Z}if(p>b){if(a)throw"unexpected EOF";break}s&&h(f+131072);for(var te=f+J;f<te;f+=4)t[f]=t[f-W],t[f+1]=t[f+1-W],t[f+2]=t[f+2-W],t[f+3]=t[f+3-W];f=te}}n.l=g,n.p=q,n.b=f,g&&(u=1,n.m=v,n.d=A,n.n=y)}while(!u);return f==t.length?t:R(t,0,f)},D=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},L=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},F=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return[Q,0];if(1==a){var l=new i(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var c=n[0],h=n[1],u=0,d=1,p=2;for(n[0]={s:-1,f:c.f+h.f,l:c,r:h};d!=a-1;)c=n[n[u].f<n[p].f?u++:p++],h=n[u!=d&&n[u].f<n[p].f?u++:p++],n[d++]={s:-1,f:c.f+h.f,l:c,r:h};var f=o[0].s;for(r=1;r<a;++r)o[r].s>f&&(f=o[r].s);var m=new s(f+1),g=U(n[d-1],m,0);if(g>t){r=0;var A=0,v=g-t,y=1<<v;for(o.sort((function(e,t){return m[t.s]-m[e.s]||e.f-t.f}));r<a;++r){var x=o[r].s;if(!(m[x]>t))break;A+=y-(1<<g-m[x]),m[x]=t}for(A>>>=v;A>0;){var b=o[r].s;m[b]<t?A-=1<<t-m[b]++-1:++r}for(;r>=0&&A;--r){var E=o[r].s;m[E]==t&&(--m[E],++A)}g=t}return[new i(m),g]},U=function(e,t,n){return-1==e.s?Math.max(U(e.l,t,n+1),U(e.r,t,n+1)):t[e.s]=n},O=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new s(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},l=1;l<=t;++l)if(e[l]==i&&l!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[l]}return[n.subarray(0,r),t]},N=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},k=function(e,t,n){var r=n.length,i=B(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},G=function(e,t,n,r,i,a,h,u,d,p,f){D(t,f++,n),++i[256];for(var m=F(i,15),g=m[0],A=m[1],v=F(a,15),y=v[0],S=v[1],M=O(g),C=M[0],T=M[1],I=O(y),B=I[0],R=I[1],P=new s(19),U=0;U<C.length;++U)P[31&C[U]]++;for(U=0;U<B.length;++U)P[31&B[U]]++;for(var G=F(P,7),z=G[0],Q=G[1],V=19;V>4&&!z[c[V-1]];--V);var H,j,W,X,Y=p+5<<3,q=N(i,b)+N(a,E)+h,K=N(i,g)+N(a,y)+h+14+3*V+N(P,z)+(2*P[16]+3*P[17]+7*P[18]);if(Y<=q&&Y<=K)return k(t,f,e.subarray(d,d+p));if(D(t,f,1+(K<q)),f+=2,K<q){H=x(g,A,0),j=g,W=x(y,S,0),X=y;var J=x(z,Q,0);D(t,f,T-257),D(t,f+5,R-1),D(t,f+10,V-4),f+=14;for(U=0;U<V;++U)D(t,f+3*U,z[c[U]]);f+=3*V;for(var Z=[C,B],$=0;$<2;++$){var ee=Z[$];for(U=0;U<ee.length;++U){var te=31&ee[U];D(t,f,J[te]),f+=z[te],te>15&&(D(t,f,ee[U]>>>5&127),f+=ee[U]>>>12)}}}else H=_,j=b,W=w,X=E;for(U=0;U<u;++U)if(r[U]>255){te=r[U]>>>18&31;L(t,f,H[te+257]),f+=j[te+257],te>7&&(D(t,f,r[U]>>>23&31),f+=o[te]);var ne=31&r[U];L(t,f,W[ne]),f+=X[ne],ne>3&&(L(t,f,r[U]>>>5&8191),f+=l[ne])}else L(t,f,H[r[U]]),f+=j[r[U]];return L(t,f,H[256]),f+j[256]},z=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Q=new i(0),V=function(e,t,n,r,c,h){var u=e.length,d=new i(r+u+5*(1+Math.ceil(u/7e3))+c),f=d.subarray(r,d.length-c),m=0;if(!t||u<8)for(var A=0;A<=u;A+=65535){var v=A+65535;v<u?m=k(f,m,e.subarray(A,v)):(f[A]=h,m=k(f,m,e.subarray(A,u)))}else{for(var y=z[t-1],x=y>>>13,b=8191&y,E=(1<<n)-1,_=new s(32768),S=new s(E+1),w=Math.ceil(n/3),M=2*w,C=function(t){return(e[t]^e[t+1]<<w^e[t+2]<<M)&E},T=new a(25e3),I=new s(288),P=new s(32),D=0,L=0,F=(A=0,0),U=0,O=0;A<u;++A){var N=C(A),V=32767&A,H=S[N];if(_[V]=H,S[N]=V,U<=A){var j=u-A;if((D>7e3||F>24576)&&j>423){m=G(e,f,0,T,I,P,L,F,O,A-O,m),F=D=L=0,O=A;for(var W=0;W<286;++W)I[W]=0;for(W=0;W<30;++W)P[W]=0}var X=2,Y=0,q=b,K=V-H&32767;if(j>2&&N==C(A-K))for(var J=Math.min(x,j)-1,Z=Math.min(32767,A),$=Math.min(258,j);K<=Z&&--q&&V!=H;){if(e[A+X]==e[A+X-K]){for(var ee=0;ee<$&&e[A+ee]==e[A+ee-K];++ee);if(ee>X){if(X=ee,Y=K,ee>J)break;var te=Math.min(K,ee-2),ne=0;for(W=0;W<te;++W){var re=A-K+W+32768&32767,ie=re-_[re]+32768&32767;ie>ne&&(ne=ie,H=re)}}}K+=(V=H)-(H=_[V])+32768&32767}if(Y){T[F++]=268435456|p[X]<<18|g[Y];var se=31&p[X],ae=31&g[Y];L+=o[se]+l[ae],++I[257+se],++P[ae],U=A+X,++D}else T[F++]=e[A],++I[e[A]]}}m=G(e,f,h,T,I,P,L,F,O,A-O,m),!h&&7&m&&(m=k(f,m+1,Q))}return R(d,0,r+B(m)+c)},H=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),j=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=H[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},W=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},X=function(e,t,n,r,i){return V(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Y=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},q=function(e,t,n){for(var r=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/ /g,"").split(","),a=0;a<r.length;++a){var o=r[a],l=s[a];if("function"==typeof o){t+=";"+l+"=";var c=o.toString();if(o.prototype)if(-1!=c.indexOf("[native code]")){var h=c.indexOf(" ",8)+1;t+=c.slice(h,c.indexOf("(",h))}else for(var u in t+=c,o.prototype)t+=";"+l+".prototype."+u+"="+o.prototype[u].toString();else t+=c}else n[l]=o}return[t,n]},K=[],J=function(e,t,n,o){var l;if(!K[n]){for(var c="",h={},u=e.length-1,d=0;d<u;++d)c=(l=q(e[d],c,h))[0],h=l[1];K[n]=q(e[u],c,h)}var p=Y({},K[n][1]);return r.default(K[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,p,function(e){var t=[];for(var n in e)(e[n]instanceof i||e[n]instanceof s||e[n]instanceof a)&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(p),o)},Z=function(){return[i,s,a,o,l,c,d,m,S,M,A,x,C,T,I,B,R,P,Ce,ie,se]},$=function(){return[i,s,a,o,l,c,p,g,_,b,w,E,A,z,Q,x,D,L,F,U,O,N,k,G,B,R,V,X,_e,ie]},ee=function(){return[pe,ge,de,j,H]},te=function(){return[fe,me]},ne=function(){return[Ae,de,W]},re=function(){return[ve]},ie=function(e){return postMessage(e,[e.buffer])},se=function(e){return e&&e.size&&new i(e.size)},ae=function(e,t,n,r,i,s){var a=J(n,r,i,(function(e,t){a.terminate(),s(e,t)}));return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},oe=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},le=function(e,t,n,r,i){var s,a=J(e,r,i,(function(e,n){e?(a.terminate(),t.ondata.call(t,e)):(n[1]&&a.terminate(),t.ondata.call(t,e,n[0],n[1]))}));a.postMessage(n),t.push=function(e,n){if(s)throw"stream finished";if(!t.ondata)throw"no stream handler";a.postMessage([e,s=n],[e.buffer])},t.terminate=function(){a.terminate()}},ce=function(e,t){return e[t]|e[t+1]<<8},he=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ue=function(e,t){return he(e,t)+4294967296*he(e,t+4)},de=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},pe=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&de(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},fe=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},me=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ge=function(e){return 10+(e.filename&&e.filename.length+1||0)},Ae=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},ve=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function ye(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var xe=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(X(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}();t.Deflate=xe;var be=function(){return function(e,t){le([$,function(){return[oe,xe]}],this,ye.call(this,e,t),(function(e){var t=new xe(e.data);onmessage=oe(t)}),6)}}();function Ee(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[$],(function(e){return ie(_e(e.data[0],e.data[1]))}),0,n)}function _e(e,t){return X(e,t||{},0,0)}t.AsyncDeflate=be,t.deflate=Ee,t.deflateSync=_e;var Se=function(){function e(e){this.s={},this.p=new i(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,n=new i(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=P(this.p,this.o,this.s);this.ondata(R(n,t,this.s.b),this.d),this.o=R(n,this.s.b-32768),this.s.b=this.o.length,this.p=R(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}();t.Inflate=Se;var we=function(){return function(e){this.ondata=e,le([Z,function(){return[oe,Se]}],this,0,(function(){var e=new Se;onmessage=oe(e)}),7)}}();function Me(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[Z],(function(e){return ie(Ce(e.data[0],se(e.data[1])))}),1,n)}function Ce(e,t){return P(e,t)}t.AsyncInflate=we,t.inflate=Me,t.inflateSync=Ce;var Te=function(){function e(e,t){this.c=j(),this.l=0,this.v=1,xe.call(this,e,t)}return e.prototype.push=function(e,t){xe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=X(e,this.o,this.v&&ge(this.o),t&&8,!t);this.v&&(pe(n,this.o),this.v=0),t&&(de(n,n.length-8,this.c.d()),de(n,n.length-4,this.l)),this.ondata(n,t)},e}();t.Gzip=Te,t.Compress=Te;var Ie=function(){return function(e,t){le([$,ee,function(){return[oe,xe,Te]}],this,ye.call(this,e,t),(function(e){var t=new Te(e.data);onmessage=oe(t)}),8)}}();function Be(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[$,ee,function(){return[Re]}],(function(e){return ie(Re(e.data[0],e.data[1]))}),2,n)}function Re(e,t){t||(t={});var n=j(),r=e.length;n.p(e);var i=X(e,t,ge(t),8),s=i.length;return pe(i,t),de(i,s-8,n.d()),de(i,s-4,r),i}t.AsyncGzip=Ie,t.AsyncCompress=Ie,t.gzip=Be,t.compress=Be,t.gzipSync=Re,t.compressSync=Re;var Pe=function(){function e(e){this.v=1,Se.call(this,e)}return e.prototype.push=function(e,t){if(Se.prototype.e.call(this,e),this.v){var n=this.p.length>3?fe(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Se.prototype.c.call(this,t)},e}();t.Gunzip=Pe;var De=function(){return function(e){this.ondata=e,le([Z,te,function(){return[oe,Se,Pe]}],this,0,(function(){var e=new Pe;onmessage=oe(e)}),9)}}();function Le(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[Z,te,function(){return[Fe]}],(function(e){return ie(Fe(e.data[0]))}),3,n)}function Fe(e,t){return P(e.subarray(fe(e),-8),t||new i(me(e)))}t.AsyncGunzip=De,t.gunzip=Le,t.gunzipSync=Fe;var Ue=function(){function e(e,t){this.c=W(),this.v=1,xe.call(this,e,t)}return e.prototype.push=function(e,t){xe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=X(e,this.o,this.v&&2,t&&4,!t);this.v&&(Ae(n,this.o),this.v=0),t&&de(n,n.length-4,this.c.d()),this.ondata(n,t)},e}();t.Zlib=Ue;var Oe=function(){return function(e,t){le([$,ne,function(){return[oe,xe,Ue]}],this,ye.call(this,e,t),(function(e){var t=new Ue(e.data);onmessage=oe(t)}),10)}}();function Ne(e,t){t||(t={});var n=W();n.p(e);var r=X(e,t,2,4);return Ae(r,t),de(r,r.length-4,n.d()),r}t.AsyncZlib=Oe,t.zlib=function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[$,ne,function(){return[Ne]}],(function(e){return ie(Ne(e.data[0],e.data[1]))}),4,n)},t.zlibSync=Ne;var ke=function(){function e(e){this.v=1,Se.call(this,e)}return e.prototype.push=function(e,t){if(Se.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Se.prototype.c.call(this,t)},e}();t.Unzlib=ke;var Ge=function(){return function(e){this.ondata=e,le([Z,re,function(){return[oe,Se,ke]}],this,0,(function(){var e=new ke;onmessage=oe(e)}),11)}}();function ze(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ae(e,t,[Z,re,function(){return[Qe]}],(function(e){return ie(Qe(e.data[0],se(e.data[1])))}),5,n)}function Qe(e,t){return P((ve(e),e.subarray(2,-4)),t)}t.AsyncUnzlib=Ge,t.unzlib=ze,t.unzlibSync=Qe;var Ve=function(){function e(e){this.G=Pe,this.I=Se,this.Z=ke,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new i(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,s=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(s):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(s):new this.Z(s),this.s.push(this.p,t),this.p=null}}},e}();t.Decompress=Ve;var He=function(){function e(e){this.G=De,this.I=we,this.Z=Ge,this.ondata=e}return e.prototype.push=function(e,t){Ve.prototype.push.call(this,e,t)},e}();t.AsyncDecompress=He,t.decompress=function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?Le(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Me(e,t,n):ze(e,t,n)},t.decompressSync=function(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Fe(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Ce(e,t):Qe(e,t)};var je=function(e,t,n,r){for(var s in e){var a=e[s],o=t+s;a instanceof i?n[o]=[a,r]:Array.isArray(a)?n[o]=[a[0],Y(r,a[1])]:je(a,o+"/",n,r)}},We="undefined"!=typeof TextEncoder&&new TextEncoder,Xe="undefined"!=typeof TextDecoder&&new TextDecoder,Ye=0;try{Xe.decode(Q,{stream:!0}),Ye=1}catch(mt){}var qe=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,R(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},Ke=function(){function e(e){this.ondata=e,Ye?this.t=new TextDecoder:this.p=Q}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new i(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=qe(n),s=r[0],a=r[1];if(t){if(a.length)throw"invalid utf-8 data";this.p=null}else this.p=a;this.ondata(s,t)}},e}();t.DecodeUTF8=Ke;var Je=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(Ze(e),this.d=t||!1)},e}();function Ze(e,t){if(t){for(var n=new i(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(We)return We.encode(e);var s=e.length,a=new i(e.length+(e.length>>1)),o=0,l=function(e){a[o++]=e};for(r=0;r<s;++r){if(o+5>a.length){var c=new i(o+8+(s-r<<1));c.set(a),a=c}var h=e.charCodeAt(r);h<128||t?l(h):h<2048?(l(192|h>>6),l(128|63&h)):h>55295&&h<57344?(l(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++r))>>18),l(128|h>>12&63),l(128|h>>6&63),l(128|63&h)):(l(224|h>>12),l(128|h>>6&63),l(128|63&h))}return R(a,0,o)}function $e(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(Xe)return Xe.decode(e);var i=qe(e),s=i[0];if(i[1].length)throw"invalid utf-8 data";return s}t.EncodeUTF8=Je,t.strToU8=Ze,t.strFromU8=$e;var et=function(e){return 1==e?3:e<6?2:9==e?1:0},tt=function(e,t){return t+30+ce(e,t+26)+ce(e,t+28)},nt=function(e,t,n){var r=ce(e,t+28),i=$e(e.subarray(t+46,t+46+r),!(2048&ce(e,t+8))),s=t+46+r,a=he(e,t+20),o=n&&4294967295==a?rt(e,s):[a,he(e,t+24),he(e,t+42)],l=o[0],c=o[1],h=o[2];return[ce(e,t+10),l,c,i,s+ce(e,t+30)+ce(e,t+32),h]},rt=function(e,t){for(;1!=ce(e,t);t+=4+ce(e,t+2));return[ue(e,t+12),ue(e,t+4),ue(e,t+20)]},it=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;if(r>65535)throw"extra field too long";t+=r+4}return t},st=function(e,t,n,r,i,s,a,o){var l=r.length,c=n.extra,h=o&&o.length,u=it(c);de(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==s&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),p=d.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(de(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=s&&(de(e,t,n.crc),de(e,t+4,s),de(e,t+8,n.size)),de(e,t+12,l),de(e,t+14,u),t+=16,null!=a&&(de(e,t,h),de(e,t+6,n.attrs),de(e,t+10,a),t+=14),e.set(r,t),t+=l,u)for(var f in c){var m=c[f],g=m.length;de(e,t,+f),de(e,t+2,g),e.set(m,t+4),t+=4+g}return h&&(e.set(o,t),t+=h),t},at=function(e,t,n,r,i){de(e,t,101010256),de(e,t+8,n),de(e,t+10,n),de(e,t+12,r),de(e,t+16,i)},ot=function(){function e(e){this.filename=e,this.c=j(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();t.ZipPassThrough=ot;var lt=function(){function e(e,t){var n=this;t||(t={}),ot.call(this,e),this.d=new xe(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=et(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(mt){this.ondata(mt,null,t)}},e.prototype.push=function(e,t){ot.prototype.push.call(this,e,t)},e}();t.ZipDeflate=lt;var ct=function(){function e(e,t){var n=this;t||(t={}),ot.call(this,e),this.d=new be(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=et(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){ot.prototype.push.call(this,e,t)},e}();t.AsyncZipDeflate=ct;var ht=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var n=Ze(e.filename),r=n.length,s=e.comment,a=s&&Ze(s),o=r!=e.filename.length||a&&s.length!=a.length,l=r+it(e.extra)+30;if(r>65535)throw"filename too long";var c=new i(l);st(c,0,e,n,o);var h=[c],u=function(){for(var e=0,n=h;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}h=[]},d=this.d;this.d=0;var p=this.u.length,f=Y(e,{f:n,u:o,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),d){var e=t.u[p+1];e?e.r():t.d=1}d=1}}),m=0;e.ondata=function(n,r,s){if(n)t.ondata(n,r,s),t.terminate();else if(m+=r.length,h.push(r),s){var a=new i(16);de(a,0,134695760),de(a,4,e.crc),de(a,8,m),de(a,12,e.size),h.push(a),f.c=m,f.b=l+m+16,f.crc=e.crc,f.size=e.size,d&&f.r(),d=1}else d&&u()},this.u.push(f)},e.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,s=this.u;r<s.length;r++){n+=46+(c=s[r]).f.length+it(c.extra)+(c.o?c.o.length:0)}for(var a=new i(n+22),o=0,l=this.u;o<l.length;o++){var c=l[o];st(a,e,c,c.f,c.u,c.c,t,c.o),e+=46+c.f.length+it(c.extra)+(c.o?c.o.length:0),t+=c.b}at(a,e,this.u.length,n,t),this.ondata(null,a,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}();t.Zip=ht,t.zip=function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";var r={};je(e,"",r,t);var s=Object.keys(r),a=s.length,o=0,l=0,c=a,h=new Array(a),u=[],d=function(){for(var e=0;e<u.length;++e)u[e]()},p=function(){var e=new i(l+22),t=o,r=l-o;l=0;for(var s=0;s<c;++s){var a=h[s];try{var u=a.c.length;st(e,l,a,a.f,a.u,u);var d=30+a.f.length+it(a.extra),p=l+d;e.set(a.c,p),st(e,o,a,a.f,a.u,u,l,a.m),o+=16+d+(a.m?a.m.length:0),l=p+u}catch(mt){return n(mt,null)}}at(e,o,h.length,r,t),n(null,e)};a||p();for(var f=function(e){var t=s[e],i=r[t],c=i[0],f=i[1],m=j(),g=c.length;m.p(c);var A=Ze(t),v=A.length,y=f.comment,x=y&&Ze(y),b=x&&x.length,E=it(f.extra),_=0==f.level?0:8,S=function(r,i){if(r)d(),n(r,null);else{var s=i.length;h[e]=Y(f,{size:g,crc:m.d(),c:i,f:A,m:x,u:v!=t.length||x&&y.length!=b,compression:_}),o+=30+v+E+s,l+=76+2*(v+E)+(b||0)+s,--a||p()}};if(v>65535&&S("filename too long",null),_)if(g<16e4)try{S(null,_e(c,f))}catch(mt){S(mt,null)}else u.push(Ee(c,f,S));else S(null,c)},m=0;m<c;++m)f(m);return d},t.zipSync=function(e,t){t||(t={});var n={},r=[];je(e,"",n,t);var s=0,a=0;for(var o in n){var l=n[o],c=l[0],h=l[1],u=0==h.level?0:8,d=(S=Ze(o)).length,p=h.comment,f=p&&Ze(p),m=f&&f.length,g=it(h.extra);if(d>65535)throw"filename too long";var A=u?_e(c,h):c,v=A.length,y=j();y.p(c),r.push(Y(h,{size:c.length,crc:y.d(),c:A,f:S,m:f,u:d!=o.length||f&&p.length!=m,o:s,compression:u})),s+=30+d+g+v,a+=76+2*(d+g)+(m||0)+v}for(var x=new i(a+22),b=s,E=a-s,_=0;_<r.length;++_){var S=r[_];st(x,S.o,S,S.f,S.u,S.c.length);var w=30+S.f.length+it(S.extra);x.set(S.c,S.o+w),st(x,s,S,S.f,S.u,S.c.length,S.o,S.m),s+=16+w+(S.m?S.m.length:0)}return at(x,s,r.length,E,b),x};var ut=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}();t.UnzipPassThrough=ut;var dt=function(){function e(){var e=this;this.i=new Se((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(mt){this.ondata(mt,e,t)}},e.compression=8,e}();t.UnzipInflate=dt;var pt=function(){function e(e,t){var n=this;t<32e4?this.i=new Se((function(e,t){n.ondata(null,e,t)})):(this.i=new we((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=R(e,0)),this.i.push(e,t)},e.compression=8,e}();t.AsyncUnzipInflate=pt;var ft=function(){function e(e){this.onfile=e,this.k=[],this.o={0:ut},this.p=Q}return e.prototype.push=function(e,t){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var r=Math.min(this.c,e.length),s=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(s,!this.c):this.k[0].push(s),(e=e.subarray(r)).length)return this.push(e,t)}else{var a=0,o=0,l=void 0,c=void 0;this.p.length?e.length?((c=new i(this.p.length+e.length)).set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var h=c.length,u=this.c,d=u&&this.d,p=function(){var e,t=he(c,o);if(67324752==t){a=1,l=o,f.d=null,f.c=0;var r=ce(c,o+6),i=ce(c,o+8),s=2048&r,d=8&r,p=ce(c,o+26),m=ce(c,o+28);if(h>o+30+p+m){var g=[];f.k.unshift(g),a=2;var A,v=he(c,o+18),y=he(c,o+22),x=$e(c.subarray(o+30,o+=30+p),!s);4294967295==v?(e=d?[-2]:rt(c,o),v=e[0],y=e[1]):d&&(v=-1),o+=m,f.c=v;var b={name:x,compression:i,start:function(){if(!b.ondata)throw"no callback";if(v){var e=n.o[i];if(!e)throw"unknown compression type "+i;(A=v<0?new e(x):new e(x,v,y)).ondata=function(e,t,n){b.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var s=r[t];A.push(s,!1)}n.k[0]==g&&n.c?n.d=A:A.push(Q,!0)}else b.ondata(null,Q,!0)},terminate:function(){A&&A.terminate&&A.terminate()}};v>=0&&(b.size=v,b.originalSize=y),f.onfile(b)}return"break"}if(u){if(134695760==t)return l=o+=12+(-2==u&&8),a=3,f.c=0,"break";if(33639248==t)return l=o-=4,a=3,f.c=0,"break"}},f=this;o<h-4;++o){if("break"===p())break}if(this.p=Q,u<0){var m=a?c.subarray(0,l-12-(-2==u&&8)-(134695760==he(c,l-16)&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(2==a)].push(m)}if(2&a)return this.push(c.subarray(o),t);this.p=c.subarray(o)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e.prototype.register=function(e){this.o[e.compression]=e},e}();t.Unzip=ft,t.unzip=function(e,t){if("function"!=typeof t)throw"no callback";for(var n=[],r=function(){for(var e=0;e<n.length;++e)n[e]()},s={},a=e.length-22;101010256!=he(e,a);--a)if(!a||e.length-a>65558)return void t("invalid zip file",null);var o=ce(e,a+8);o||t(null,{});var l=o,c=he(e,a+16),h=4294967295==c;if(h){if(a=he(e,a-12),101075792!=he(e,a))return void t("invalid zip file",null);l=o=he(e,a+32),c=he(e,a+48)}for(var u=function(l){var u=nt(e,c,h),d=u[0],p=u[1],f=u[2],m=u[3],g=u[4],A=u[5],v=tt(e,A);c=g;var y=function(e,n){e?(r(),t(e,null)):(s[m]=n,--o||t(null,s))};if(d)if(8==d){var x=e.subarray(v,v+p);if(p<32e4)try{y(null,Ce(x,new i(f)))}catch(a){y(a,null)}else n.push(Me(x,{size:f},y))}else y("unknown compression type "+d,null);else y(null,R(e,v,v+p))},d=0;d<l;++d)u();return r},t.unzipSync=function(e){for(var t={},n=e.length-22;101010256!=he(e,n);--n)if(!n||e.length-n>65558)throw"invalid zip file";var r=ce(e,n+8);if(!r)return{};var s=he(e,n+16),a=4294967295==s;if(a){if(n=he(e,n-12),101075792!=he(e,n))throw"invalid zip file";r=he(e,n+32),s=he(e,n+48)}for(var o=0;o<r;++o){var l=nt(e,s,a),c=l[0],h=l[1],u=l[2],d=l[3],p=l[4],f=l[5],m=tt(e,f);if(s=p,c){if(8!=c)throw"unknown compression type "+c;t[d]=Ce(e.subarray(m,m+h),new i(u))}else t[d]=R(e,m,m+h)}return t}},45928:(e,t)=>{"use strict";var n={};t.default=function(e,t,r,i,s){var a=new Worker(n[t]||(n[t]=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))));return a.onerror=function(e){return s(e.error,null)},a.onmessage=function(e){return s(null,e.data)},a.postMessage(r,i),a}},31649:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.LatheGeometry{constructor(e=1,t=1,n=4,i=8){const s=new r.Path;s.absarc(0,-t/2,e,1.5*Math.PI,0),s.absarc(0,t/2,e,0,.5*Math.PI),super(s.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new i(e.radius,e.length,e.capSegments,e.radialSegments)}}t.CapsuleGeometry=i},84951:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.CompressedTexture{constructor(e,t,n,i,s,a){super(e,t,n,s,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=r.ClampToEdgeWrapping}}t.CompressedArrayTexture=i},79836:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Texture{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=r.NearestFilter,this.minFilter=r.NearestFilter,this.wrapR=r.ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}t.Data3DTexture=i},65236:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=parseInt(r.REVISION.replace(/\D+/g,""));t.version=i},83713:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.AnimationClipCreator=class{static CreateRotationAnimation(e,t="x"){const n=[0,e],i=".rotation["+t+"]",s=new r.NumberKeyframeTrack(i,n,[0,360]);return new r.AnimationClip(null,e,[s])}static CreateScaleAxisAnimation(e,t="x"){const n=[0,e],i=".scale["+t+"]",s=new r.NumberKeyframeTrack(i,n,[0,1]);return new r.AnimationClip(null,e,[s])}static CreateShakeAnimation(e,t){const n=[],i=[],s=new r.Vector3;for(let r=0;r<10*e;r++)n.push(r/10),s.set(2*Math.random()-1,2*Math.random()-1,2*Math.random()-1).multiply(t).toArray(i,i.length);const a=new r.VectorKeyframeTrack(".position",n,i);return new r.AnimationClip(null,e,[a])}static CreatePulsationAnimation(e,t){const n=[],i=[],s=new r.Vector3;for(let r=0;r<10*e;r++){n.push(r/10);const e=Math.random()*t;s.set(e,e,e).toArray(i,i.length)}const a=new r.VectorKeyframeTrack(".scale",n,i);return new r.AnimationClip(null,e,[a])}static CreateVisibilityAnimation(e){const t=[0,e/2,e],n=new r.BooleanKeyframeTrack(".visible",t,[!0,!1,!0]);return new r.AnimationClip(null,e,[n])}static CreateMaterialColorAnimation(e,t){const n=[],i=[],s=e/t.length;for(let r=0;r<t.length;r++){n.push(r*s);const e=t[r];i.push(e.r,e.g,e.b)}const a=new r.ColorKeyframeTrack(".material.color",n,i);return new r.AnimationClip(null,e,[a])}}},69457:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Quaternion,s=new r.Vector3,a=new r.Vector3,o=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=new r.Quaternion,u=new r.Vector3,d=new r.Vector3,p=new r.Vector3,f=new r.Matrix4;function m(e,t){return p.setFromMatrixPosition(e.matrixWorld).applyMatrix4(t)}function g(e,t,n,r){const i=m(n,r);e[3*t+0]=i.x,e[3*t+1]=i.y,e[3*t+2]=i.z}class A extends r.Object3D{constructor(e,t=[],n=.25){super(),this.root=e,this.iks=t,this.matrix.copy(e.matrixWorld),this.matrixAutoUpdate=!1,this.sphereGeometry=new r.SphereGeometry(n,16,8),this.targetSphereMaterial=new r.MeshBasicMaterial({color:new r.Color(16746632),depthTest:!1,depthWrite:!1,transparent:!0}),this.effectorSphereMaterial=new r.MeshBasicMaterial({color:new r.Color(8978312),depthTest:!1,depthWrite:!1,transparent:!0}),this.linkSphereMaterial=new r.MeshBasicMaterial({color:new r.Color(8947967),depthTest:!1,depthWrite:!1,transparent:!0}),this.lineMaterial=new r.LineBasicMaterial({color:new r.Color(16711680),depthTest:!1,depthWrite:!1,transparent:!0}),this._init()}updateMatrixWorld(e){const t=this.root;if(this.visible){let e=0;const n=this.iks,r=t.skeleton.bones;f.copy(t.matrixWorld).invert();for(let t=0,i=n.length;t<i;t++){const i=n[t],s=r[i.target],a=r[i.effector],o=this.children[e++],l=this.children[e++];o.position.copy(m(s,f)),l.position.copy(m(a,f));for(let t=0,n=i.links.length;t<n;t++){const n=r[i.links[t].index];this.children[e++].position.copy(m(n,f))}const c=this.children[e++],h=c.geometry.attributes.position.array;g(h,0,s,f),g(h,1,a,f);for(let e=0,t=i.links.length;e<t;e++){g(h,e+2,r[i.links[e].index],f)}c.geometry.attributes.position.needsUpdate=!0}}this.matrix.copy(t.matrixWorld),super.updateMatrixWorld(e)}dispose(){this.sphereGeometry.dispose(),this.targetSphereMaterial.dispose(),this.effectorSphereMaterial.dispose(),this.linkSphereMaterial.dispose(),this.lineMaterial.dispose();const e=this.children;for(let t=0;t<e.length;t++){const n=e[t];n.isLine&&n.geometry.dispose()}}_init(){const e=this,t=this.iks;function n(t){return new r.Line(function(e){const t=new r.BufferGeometry,n=new Float32Array(3*(2+e.links.length));return t.setAttribute("position",new r.BufferAttribute(n,3)),t}(t),e.lineMaterial)}for(let i=0,s=t.length;i<s;i++){const s=t[i];this.add(new r.Mesh(e.sphereGeometry,e.targetSphereMaterial)),this.add(new r.Mesh(e.sphereGeometry,e.effectorSphereMaterial));for(let t=0,n=s.links.length;t<n;t++)this.add(new r.Mesh(e.sphereGeometry,e.linkSphereMaterial));this.add(n(s))}}}t.CCDIKHelper=A,t.CCDIKSolver=class{constructor(e,t=[]){this.mesh=e,this.iks=t,this._valid()}update(){const e=this.iks;for(let t=0,n=e.length;t<n;t++)this.updateOne(e[t]);return this}updateOne(e){const t=this.mesh.skeleton.bones,n=Math,r=t[e.effector],f=t[e.target];s.setFromMatrixPosition(f.matrixWorld);const m=e.links,g=void 0!==e.iteration?e.iteration:1;for(let A=0;A<g;A++){let f=!1;for(let g=0,A=m.length;g<A;g++){const A=t[m[g].index];if(!1===m[g].enabled)break;const v=m[g].limitation,y=m[g].rotationMin,x=m[g].rotationMax;A.matrixWorld.decompose(c,h,u),h.invert(),o.setFromMatrixPosition(r.matrixWorld),l.subVectors(o,c),l.applyQuaternion(h),l.normalize(),a.subVectors(s,c),a.applyQuaternion(h),a.normalize();let b=a.dot(l);if(b>1?b=1:b<-1&&(b=-1),b=n.acos(b),!(b<1e-5)){if(void 0!==e.minAngle&&b<e.minAngle&&(b=e.minAngle),void 0!==e.maxAngle&&b>e.maxAngle&&(b=e.maxAngle),d.crossVectors(l,a),d.normalize(),i.setFromAxisAngle(d,b),A.quaternion.multiply(i),void 0!==v){let e=A.quaternion.w;e>1&&(e=1);const t=n.sqrt(1-e*e);A.quaternion.set(v.x*t,v.y*t,v.z*t,e)}void 0!==y&&A.rotation.setFromVector3(p.setFromEuler(A.rotation).max(y)),void 0!==x&&A.rotation.setFromVector3(p.setFromEuler(A.rotation).min(x)),A.updateMatrixWorld(!0),f=!0}}if(!f)break}return this}createHelper(){return new A(this.mesh,this.iks)}_valid(){const e=this.iks,t=this.mesh.skeleton.bones;for(let n=0,r=e.length;n<r;n++){const r=e[n],i=t[r.effector],s=r.links;let a,o;a=i;for(let e=0,n=s.length;e<n;e++)o=t[s[e].index],a.parent!==o&&console.warn("THREE.CCDIKSolver: bone "+a.name+" is not the child of bone "+o.name),a=o}}}},77224:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(69457),s=n(36217);const a=[];let o=0;const l=new Map;function c(e,t,n,i){const s=e.skeleton.bones,h=e.geometry.userData.MMD.bones[t],u=s[t];if(l.has(t))return;const d=(o>=a.length&&a.push(new r.Quaternion),a[o++]);if(l.set(t,d.copy(u.quaternion)),i&&h.grant&&!h.grant.isLocal&&h.grant.affectRotation){const t=h.grant.parentIndex,r=h.grant.ratio;l.has(t)||c(e,t,n,i),i.addGrantRotation(u,l.get(t),r)}if(n&&h.ik){e.updateMatrixWorld(!0),n.updateOne(h.ik);const t=h.ik.links;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!1===n.enabled)continue;const r=n.index;l.has(r)&&l.set(r,l.get(r).copy(s[r].quaternion))}}d.copy(u.quaternion)}class h{constructor(e,t={}){this.audio=e,this.elapsedTime=0,this.currentTime=0,this.delayTime=void 0!==t.delayTime?t.delayTime:0,this.audioDuration=this.audio.buffer.duration,this.duration=this.audioDuration+this.delayTime}control(e){return this.elapsed+=e,this.currentTime+=e,this._shouldStopAudio()&&this.audio.stop(),this._shouldStartAudio()&&this.audio.play(),this}_shouldStartAudio(){if(this.audio.isPlaying)return!1;for(;this.currentTime>=this.duration;)this.currentTime-=this.duration;return!(this.currentTime<this.delayTime)&&!(this.currentTime-this.delayTime>this.audioDuration)}_shouldStopAudio(){return this.audio.isPlaying&&this.currentTime>=this.duration}}const u=new r.Quaternion;class d{constructor(e,t=[]){this.mesh=e,this.grants=t}update(){const e=this.grants;for(let t=0,n=e.length;t<n;t++)this.updateOne(e[t]);return this}updateOne(e){const t=this.mesh.skeleton.bones,n=t[e.index],r=t[e.parentIndex];return e.isLocal?(e.affectPosition,e.affectRotation):(e.affectPosition,e.affectRotation&&this.addGrantRotation(n,r.quaternion,e.ratio)),this}addGrantRotation(e,t,n){return u.set(0,0,0,1),u.slerp(t,n),e.quaternion.multiply(u),this}}t.MMDAnimationHelper=class{constructor(e={}){this.meshes=[],this.camera=null,this.cameraTarget=new r.Object3D,this.cameraTarget.name="target",this.audio=null,this.audioManager=null,this.objects=new WeakMap,this.configuration={sync:void 0===e.sync||e.sync,afterglow:void 0!==e.afterglow?e.afterglow:0,resetPhysicsOnLoop:void 0===e.resetPhysicsOnLoop||e.resetPhysicsOnLoop,pmxAnimation:void 0!==e.pmxAnimation&&e.pmxAnimation},this.enabled={animation:!0,ik:!0,grant:!0,physics:!0,cameraAnimation:!0},this.onBeforePhysics=function(){},this.sharedPhysics=!1,this.masterPhysics=null}add(e,t={}){if(e.isSkinnedMesh)this._addMesh(e,t);else if(e.isCamera)this._setupCamera(e,t);else{if("Audio"!==e.type)throw new Error("THREE.MMDAnimationHelper.add: accepts only THREE.SkinnedMesh or THREE.Camera or THREE.Audio instance.");this._setupAudio(e,t)}return this.configuration.sync&&this._syncDuration(),this}remove(e){if(e.isSkinnedMesh)this._removeMesh(e);else if(e.isCamera)this._clearCamera(e);else{if("Audio"!==e.type)throw new Error("THREE.MMDAnimationHelper.remove: accepts only THREE.SkinnedMesh or THREE.Camera or THREE.Audio instance.");this._clearAudio(e)}return this.configuration.sync&&this._syncDuration(),this}update(e){null!==this.audioManager&&this.audioManager.control(e);for(let t=0;t<this.meshes.length;t++)this._animateMesh(this.meshes[t],e);return this.sharedPhysics&&this._updateSharedPhysics(e),null!==this.camera&&this._animateCamera(this.camera,e),this}pose(e,t,n={}){!1!==n.resetPose&&e.pose();const i=e.skeleton.bones,s=t.bones,a={};for(let r=0,c=i.length;r<c;r++)a[i[r].name]=r;const o=new r.Vector3,l=new r.Quaternion;for(let r=0,c=s.length;r<c;r++){const e=s[r],t=a[e.name];if(void 0===t)continue;const n=i[t];n.position.add(o.fromArray(e.translation)),n.quaternion.multiply(l.fromArray(e.quaternion))}if(e.updateMatrixWorld(!0),this.configuration.pmxAnimation&&e.geometry.userData.MMD&&"pmx"===e.geometry.userData.MMD.format){const t=this._sortBoneDataArray(e.geometry.userData.MMD.bones.slice()),r=!1!==n.ik?this._createCCDIKSolver(e):null,i=!1!==n.grant?this.createGrantSolver(e):null;this._animatePMXMesh(e,t,r,i)}else!1!==n.ik&&this._createCCDIKSolver(e).update(),!1!==n.grant&&this.createGrantSolver(e).update();return this}enable(e,t){if(void 0===this.enabled[e])throw new Error("THREE.MMDAnimationHelper.enable: unknown key "+e);if(this.enabled[e]=t,"physics"===e)for(let n=0,r=this.meshes.length;n<r;n++)this._optimizeIK(this.meshes[n],t);return this}createGrantSolver(e){return new d(e,e.geometry.userData.MMD.grants)}_addMesh(e,t){if(this.meshes.indexOf(e)>=0)throw new Error("THREE.MMDAnimationHelper._addMesh: SkinnedMesh '"+e.name+"' has already been added.");return this.meshes.push(e),this.objects.set(e,{looped:!1}),this._setupMeshAnimation(e,t.animation),!1!==t.physics&&this._setupMeshPhysics(e,t),this}_setupCamera(e,t){if(this.camera===e)throw new Error("THREE.MMDAnimationHelper._setupCamera: Camera '"+e.name+"' has already been set.");return this.camera&&this.clearCamera(this.camera),this.camera=e,e.add(this.cameraTarget),this.objects.set(e,{}),void 0!==t.animation&&this._setupCameraAnimation(e,t.animation),this}_setupAudio(e,t){if(this.audio===e)throw new Error("THREE.MMDAnimationHelper._setupAudio: Audio '"+e.name+"' has already been set.");return this.audio&&this.clearAudio(this.audio),this.audio=e,this.audioManager=new h(e,t),this.objects.set(this.audioManager,{duration:this.audioManager.duration}),this}_removeMesh(e){let t=!1,n=0;for(let r=0,i=this.meshes.length;r<i;r++)this.meshes[r]!==e?this.meshes[n++]=this.meshes[r]:(this.objects.delete(e),t=!0);if(!t)throw new Error("THREE.MMDAnimationHelper._removeMesh: SkinnedMesh '"+e.name+"' has not been added yet.");return this.meshes.length=n,this}_clearCamera(e){if(e!==this.camera)throw new Error("THREE.MMDAnimationHelper._clearCamera: Camera '"+e.name+"' has not been set yet.");return this.camera.remove(this.cameraTarget),this.objects.delete(this.camera),this.camera=null,this}_clearAudio(e){if(e!==this.audio)throw new Error("THREE.MMDAnimationHelper._clearAudio: Audio '"+e.name+"' has not been set yet.");return this.objects.delete(this.audioManager),this.audio=null,this.audioManager=null,this}_setupMeshAnimation(e,t){const n=this.objects.get(e);if(void 0!==t){const i=Array.isArray(t)?t:[t];n.mixer=new r.AnimationMixer(e);for(let e=0,t=i.length;e<t;e++)n.mixer.clipAction(i[e]).play();n.mixer.addEventListener("loop",(function(e){const t=e.action._clip.tracks;t.length>0&&".bones"!==t[0].name.slice(0,6)||(n.looped=!0)}))}return n.ikSolver=this._createCCDIKSolver(e),n.grantSolver=this.createGrantSolver(e),this}_setupCameraAnimation(e,t){const n=Array.isArray(t)?t:[t],i=this.objects.get(e);i.mixer=new r.AnimationMixer(e);for(let r=0,s=n.length;r<s;r++)i.mixer.clipAction(n[r]).play()}_setupMeshPhysics(e,t){const n=this.objects.get(e);if(void 0===t.world&&this.sharedPhysics){const e=this._getMasterPhysics();null!==e&&(world=e.world)}n.physics=this._createMMDPhysics(e,t),n.mixer&&!1!==t.animationWarmup&&(this._animateMesh(e,0),n.physics.reset()),n.physics.warmup(void 0!==t.warmup?t.warmup:60),this._optimizeIK(e,!0)}_animateMesh(e,t){const n=this.objects.get(e),r=n.mixer,i=n.ikSolver,s=n.grantSolver,a=n.physics,o=n.looped;r&&this.enabled.animation&&(this._restoreBones(e),r.update(t),this._saveBones(e),this.configuration.pmxAnimation&&e.geometry.userData.MMD&&"pmx"===e.geometry.userData.MMD.format?(n.sortedBonesData||(n.sortedBonesData=this._sortBoneDataArray(e.geometry.userData.MMD.bones.slice())),this._animatePMXMesh(e,n.sortedBonesData,i&&this.enabled.ik?i:null,s&&this.enabled.grant?s:null)):(i&&this.enabled.ik&&(e.updateMatrixWorld(!0),i.update()),s&&this.enabled.grant&&s.update())),!0===o&&this.enabled.physics&&(a&&this.configuration.resetPhysicsOnLoop&&a.reset(),n.looped=!1),a&&this.enabled.physics&&!this.sharedPhysics&&(this.onBeforePhysics(e),a.update(t))}_sortBoneDataArray(e){return e.sort((function(e,t){return e.transformationClass!==t.transformationClass?e.transformationClass-t.transformationClass:e.index-t.index}))}_animatePMXMesh(e,t,n,r){o=0,l.clear();for(let i=0,s=t.length;i<s;i++)c(e,t[i].index,n,r);return e.updateMatrixWorld(!0),this}_animateCamera(e,t){const n=this.objects.get(e).mixer;n&&this.enabled.cameraAnimation&&(n.update(t),e.updateProjectionMatrix(),e.up.set(0,1,0),e.up.applyQuaternion(e.quaternion),e.lookAt(this.cameraTarget.position))}_optimizeIK(e,t){const n=e.geometry.userData.MMD.iks,r=e.geometry.userData.MMD.bones;for(let i=0,s=n.length;i<s;i++){const e=n[i].links;for(let n=0,i=e.length;n<i;n++){const i=e[n];i.enabled=!0!==t||!(r[i.index].rigidBodyType>0)}}}_createCCDIKSolver(e){if(void 0===i.CCDIKSolver)throw new Error("THREE.MMDAnimationHelper: Import CCDIKSolver.");return new i.CCDIKSolver(e,e.geometry.userData.MMD.iks)}_createMMDPhysics(e,t){if(void 0===s.MMDPhysics)throw new Error("THREE.MMDPhysics: Import MMDPhysics.");return new s.MMDPhysics(e,e.geometry.userData.MMD.rigidBodies,e.geometry.userData.MMD.constraints,t)}_syncDuration(){let e=0;const t=this.objects,n=this.meshes,r=this.camera,i=this.audioManager;for(let s=0,a=n.length;s<a;s++){const r=this.objects.get(n[s]).mixer;if(void 0!==r)for(let n=0;n<r._actions.length;n++){const i=r._actions[n]._clip;t.has(i)||t.set(i,{duration:i.duration}),e=Math.max(e,t.get(i).duration)}}if(null!==r){const n=this.objects.get(r).mixer;if(void 0!==n)for(let r=0,i=n._actions.length;r<i;r++){const i=n._actions[r]._clip;t.has(i)||t.set(i,{duration:i.duration}),e=Math.max(e,t.get(i).duration)}}null!==i&&(e=Math.max(e,t.get(i).duration)),e+=this.configuration.afterglow;for(let s=0,a=this.meshes.length;s<a;s++){const t=this.objects.get(this.meshes[s]).mixer;if(void 0!==t)for(let n=0,r=t._actions.length;n<r;n++)t._actions[n]._clip.duration=e}if(null!==r){const t=this.objects.get(r).mixer;if(void 0!==t)for(let n=0,r=t._actions.length;n<r;n++)t._actions[n]._clip.duration=e}null!==i&&(i.duration=e)}_updatePropertyMixersBuffer(e){const t=this.objects.get(e).mixer,n=t._bindings,r=t._accuIndex;for(let i=0,s=n.length;i<s;i++){const e=n[i],t=e.buffer,s=(r+1)*e.valueSize;e.binding.getValue(t,s)}}_saveBones(e){const t=this.objects.get(e),n=e.skeleton.bones;let r=t.backupBones;void 0===r&&(r=new Float32Array(7*n.length),t.backupBones=r);for(let i=0,s=n.length;i<s;i++){const e=n[i];e.position.toArray(r,7*i),e.quaternion.toArray(r,7*i+3)}}_restoreBones(e){const t=this.objects.get(e).backupBones;if(void 0===t)return;const n=e.skeleton.bones;for(let r=0,i=n.length;r<i;r++){const e=n[r];e.position.fromArray(t,7*r),e.quaternion.fromArray(t,7*r+3)}}_getMasterPhysics(){if(null!==this.masterPhysics)return this.masterPhysics;for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;if(null!=t)return this.masterPhysics=t,this.masterPhysics}return null}_updateSharedPhysics(e){if(0===this.meshes.length||!this.enabled.physics||!this.sharedPhysics)return;const t=this._getMasterPhysics();if(null!==t){for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;null!=t&&t.updateRigidBodies()}t.stepSimulation(e);for(let e=0,t=this.meshes.length;e<t;e++){const t=this.meshes[e].physics;null!=t&&t.updateBones()}}}}},36217:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(31649);class s{constructor(){this.threeVector3s=[],this.threeMatrix4s=[],this.threeQuaternions=[],this.threeEulers=[],this.transforms=[],this.quaternions=[],this.vector3s=[]}allocThreeVector3(){return this.threeVector3s.length>0?this.threeVector3s.pop():new r.Vector3}freeThreeVector3(e){this.threeVector3s.push(e)}allocThreeMatrix4(){return this.threeMatrix4s.length>0?this.threeMatrix4s.pop():new r.Matrix4}freeThreeMatrix4(e){this.threeMatrix4s.push(e)}allocThreeQuaternion(){return this.threeQuaternions.length>0?this.threeQuaternions.pop():new r.Quaternion}freeThreeQuaternion(e){this.threeQuaternions.push(e)}allocThreeEuler(){return this.threeEulers.length>0?this.threeEulers.pop():new r.Euler}freeThreeEuler(e){this.threeEulers.push(e)}allocTransform(){return this.transforms.length>0?this.transforms.pop():new Ammo.btTransform}freeTransform(e){this.transforms.push(e)}allocQuaternion(){return this.quaternions.length>0?this.quaternions.pop():new Ammo.btQuaternion}freeQuaternion(e){this.quaternions.push(e)}allocVector3(){return this.vector3s.length>0?this.vector3s.pop():new Ammo.btVector3}freeVector3(e){this.vector3s.push(e)}setIdentity(e){e.setIdentity()}getBasis(e){var t=this.allocQuaternion();return e.getBasis().getRotation(t),t}getBasisAsMatrix3(e){var t=this.getBasis(e),n=this.quaternionToMatrix3(t);return this.freeQuaternion(t),n}getOrigin(e){return e.getOrigin()}setOrigin(e,t){e.getOrigin().setValue(t.x(),t.y(),t.z())}copyOrigin(e,t){var n=t.getOrigin();this.setOrigin(e,n)}setBasis(e,t){e.setRotation(t)}setBasisFromMatrix3(e,t){var n=this.matrix3ToQuaternion(t);this.setBasis(e,n),this.freeQuaternion(n)}setOriginFromArray3(e,t){e.getOrigin().setValue(t[0],t[1],t[2])}setOriginFromThreeVector3(e,t){e.getOrigin().setValue(t.x,t.y,t.z)}setBasisFromArray3(e,t){var n=this.allocThreeQuaternion(),r=this.allocThreeEuler();r.set(t[0],t[1],t[2]),this.setBasisFromThreeQuaternion(e,n.setFromEuler(r)),this.freeThreeEuler(r),this.freeThreeQuaternion(n)}setBasisFromThreeQuaternion(e,t){var n=this.allocQuaternion();n.setX(t.x),n.setY(t.y),n.setZ(t.z),n.setW(t.w),this.setBasis(e,n),this.freeQuaternion(n)}multiplyTransforms(e,t){var n=this.allocTransform();this.setIdentity(n);var r=this.getBasisAsMatrix3(e),i=this.getBasisAsMatrix3(t),s=this.getOrigin(e),a=this.getOrigin(t),o=this.multiplyMatrix3ByVector3(r,a),l=this.addVector3(o,s);this.setOrigin(n,l);var c=this.multiplyMatrices3(r,i);return this.setBasisFromMatrix3(n,c),this.freeVector3(o),this.freeVector3(l),n}inverseTransform(e){var t=this.allocTransform(),n=this.getBasisAsMatrix3(e),r=this.getOrigin(e),i=this.transposeMatrix3(n),s=this.negativeVector3(r),a=this.multiplyMatrix3ByVector3(i,s);return this.setOrigin(t,a),this.setBasisFromMatrix3(t,i),this.freeVector3(s),this.freeVector3(a),t}multiplyMatrices3(e,t){var n=[],r=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),s=this.rowOfMatrix3(e,2),a=this.columnOfMatrix3(t,0),o=this.columnOfMatrix3(t,1),l=this.columnOfMatrix3(t,2);return n[0]=this.dotVectors3(r,a),n[1]=this.dotVectors3(r,o),n[2]=this.dotVectors3(r,l),n[3]=this.dotVectors3(i,a),n[4]=this.dotVectors3(i,o),n[5]=this.dotVectors3(i,l),n[6]=this.dotVectors3(s,a),n[7]=this.dotVectors3(s,o),n[8]=this.dotVectors3(s,l),this.freeVector3(r),this.freeVector3(i),this.freeVector3(s),this.freeVector3(a),this.freeVector3(o),this.freeVector3(l),n}addVector3(e,t){var n=this.allocVector3();return n.setValue(e.x()+t.x(),e.y()+t.y(),e.z()+t.z()),n}dotVectors3(e,t){return e.x()*t.x()+e.y()*t.y()+e.z()*t.z()}rowOfMatrix3(e,t){var n=this.allocVector3();return n.setValue(e[3*t+0],e[3*t+1],e[3*t+2]),n}columnOfMatrix3(e,t){var n=this.allocVector3();return n.setValue(e[t+0],e[t+3],e[t+6]),n}negativeVector3(e){var t=this.allocVector3();return t.setValue(-e.x(),-e.y(),-e.z()),t}multiplyMatrix3ByVector3(e,t){var n=this.allocVector3(),r=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),s=this.rowOfMatrix3(e,2),a=this.dotVectors3(r,t),o=this.dotVectors3(i,t),l=this.dotVectors3(s,t);return n.setValue(a,o,l),this.freeVector3(r),this.freeVector3(i),this.freeVector3(s),n}transposeMatrix3(e){var t=[];return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t}quaternionToMatrix3(e){var t=[],n=e.x(),r=e.y(),i=e.z(),s=e.w(),a=n*n,o=r*r,l=i*i,c=n*r,h=r*i,u=i*n,d=n*s,p=r*s,f=i*s;return t[0]=1-2*(o+l),t[1]=2*(c-f),t[2]=2*(u+p),t[3]=2*(c+f),t[4]=1-2*(l+a),t[5]=2*(h-d),t[6]=2*(u-p),t[7]=2*(h+d),t[8]=1-2*(a+o),t}matrix3ToQuaternion(e){var t,n,r,i,s,a=e[0]+e[4]+e[8];a>0?(s=.25*(t=2*Math.sqrt(a+1)),n=(e[7]-e[5])/t,r=(e[2]-e[6])/t,i=(e[3]-e[1])/t):e[0]>e[4]&&e[0]>e[8]?(t=2*Math.sqrt(1+e[0]-e[4]-e[8]),s=(e[7]-e[5])/t,n=.25*t,r=(e[1]+e[3])/t,i=(e[2]+e[6])/t):e[4]>e[8]?(t=2*Math.sqrt(1+e[4]-e[0]-e[8]),s=(e[2]-e[6])/t,n=(e[1]+e[3])/t,r=.25*t,i=(e[5]+e[7])/t):(t=2*Math.sqrt(1+e[8]-e[0]-e[4]),s=(e[3]-e[1])/t,n=(e[2]+e[6])/t,r=(e[5]+e[7])/t,i=.25*t);var o=this.allocQuaternion();return o.setX(n),o.setY(r),o.setZ(i),o.setW(s),o}}class a{constructor(e,t,n,r){this.mesh=e,this.world=t,this.params=n,this.manager=r,this.body=null,this.bone=null,this.boneOffsetForm=null,this.boneOffsetFormInverse=null,this._init()}reset(){return this._setTransformFromBone(),this}updateFromBone(){return-1!==this.params.boneIndex&&0===this.params.type&&this._setTransformFromBone(),this}updateBone(){return 0===this.params.type||-1===this.params.boneIndex||(this._updateBoneRotation(),1===this.params.type&&this._updateBonePosition(),this.bone.updateMatrixWorld(!0),2===this.params.type&&this._setPositionFromBone()),this}_init(){const e=this.manager,t=this.params,n=this.mesh.skeleton.bones,i=-1===t.boneIndex?new r.Bone:n[t.boneIndex],s=function(e){switch(e.shapeType){case 0:return new Ammo.btSphereShape(e.width);case 1:return new Ammo.btBoxShape(new Ammo.btVector3(e.width,e.height,e.depth));case 2:return new Ammo.btCapsuleShape(e.width,e.height);default:throw new Error("unknown shape type "+e.shapeType)}}(t),a=0===t.type?0:t.weight,o=e.allocVector3();o.setValue(0,0,0),0!==a&&s.calculateLocalInertia(a,o);const l=e.allocTransform();e.setIdentity(l),e.setOriginFromArray3(l,t.position),e.setBasisFromArray3(l,t.rotation);const c=e.allocThreeVector3(),h=e.allocTransform();e.setIdentity(h),e.setOriginFromThreeVector3(h,i.getWorldPosition(c));const u=e.multiplyTransforms(h,l),d=new Ammo.btDefaultMotionState(u),p=new Ammo.btRigidBodyConstructionInfo(a,d,s,o);p.set_m_friction(t.friction),p.set_m_restitution(t.restitution);const f=new Ammo.btRigidBody(p);0===t.type&&(f.setCollisionFlags(2|f.getCollisionFlags()),f.setActivationState(4)),f.setDamping(t.positionDamping,t.rotationDamping),f.setSleepingThresholds(0,0),this.world.addRigidBody(f,1<<t.groupIndex,t.groupTarget),this.body=f,this.bone=i,this.boneOffsetForm=l,this.boneOffsetFormInverse=e.inverseTransform(l),e.freeVector3(o),e.freeTransform(u),e.freeTransform(h),e.freeThreeVector3(c)}_getBoneTransform(){const e=this.manager,t=e.allocThreeVector3(),n=e.allocThreeQuaternion(),r=e.allocThreeVector3();this.bone.matrixWorld.decompose(t,n,r);const i=e.allocTransform();e.setOriginFromThreeVector3(i,t),e.setBasisFromThreeQuaternion(i,n);const s=e.multiplyTransforms(i,this.boneOffsetForm);return e.freeTransform(i),e.freeThreeVector3(r),e.freeThreeQuaternion(n),e.freeThreeVector3(t),s}_getWorldTransformForBone(){const e=this.manager,t=this.body.getCenterOfMassTransform();return e.multiplyTransforms(t,this.boneOffsetFormInverse)}_setTransformFromBone(){const e=this.manager,t=this._getBoneTransform();this.body.setCenterOfMassTransform(t),this.body.getMotionState().setWorldTransform(t),e.freeTransform(t)}_setPositionFromBone(){const e=this.manager,t=this._getBoneTransform(),n=e.allocTransform();this.body.getMotionState().getWorldTransform(n),e.copyOrigin(n,t),this.body.setCenterOfMassTransform(n),this.body.getMotionState().setWorldTransform(n),e.freeTransform(n),e.freeTransform(t)}_updateBoneRotation(){const e=this.manager,t=this._getWorldTransformForBone(),n=e.getBasis(t),r=e.allocThreeQuaternion(),i=e.allocThreeQuaternion(),s=e.allocThreeQuaternion();r.set(n.x(),n.y(),n.z(),n.w()),i.setFromRotationMatrix(this.bone.matrixWorld),i.conjugate(),i.multiply(r),s.setFromRotationMatrix(this.bone.matrix),this.bone.quaternion.copy(i.multiply(s).normalize()),e.freeThreeQuaternion(r),e.freeThreeQuaternion(i),e.freeThreeQuaternion(s),e.freeQuaternion(n),e.freeTransform(t)}_updateBonePosition(){const e=this.manager,t=this._getWorldTransformForBone(),n=e.allocThreeVector3(),r=e.getOrigin(t);n.set(r.x(),r.y(),r.z()),this.bone.parent&&this.bone.parent.worldToLocal(n),this.bone.position.copy(n),e.freeThreeVector3(n),e.freeTransform(t)}}class o{constructor(e,t,n,r,i,s){this.mesh=e,this.world=t,this.bodyA=n,this.bodyB=r,this.params=i,this.manager=s,this.constraint=null,this._init()}_init(){const e=this.manager,t=this.params,n=this.bodyA,r=this.bodyB,i=e.allocTransform();e.setIdentity(i),e.setOriginFromArray3(i,t.position),e.setBasisFromArray3(i,t.rotation);const s=e.allocTransform(),a=e.allocTransform();n.body.getMotionState().getWorldTransform(s),r.body.getMotionState().getWorldTransform(a);const o=e.inverseTransform(s),l=e.inverseTransform(a),c=e.multiplyTransforms(o,i),h=e.multiplyTransforms(l,i),u=new Ammo.btGeneric6DofSpringConstraint(n.body,r.body,c,h,!0),d=e.allocVector3(),p=e.allocVector3(),f=e.allocVector3(),m=e.allocVector3();d.setValue(t.translationLimitation1[0],t.translationLimitation1[1],t.translationLimitation1[2]),p.setValue(t.translationLimitation2[0],t.translationLimitation2[1],t.translationLimitation2[2]),f.setValue(t.rotationLimitation1[0],t.rotationLimitation1[1],t.rotationLimitation1[2]),m.setValue(t.rotationLimitation2[0],t.rotationLimitation2[1],t.rotationLimitation2[2]),u.setLinearLowerLimit(d),u.setLinearUpperLimit(p),u.setAngularLowerLimit(f),u.setAngularUpperLimit(m);for(let g=0;g<3;g++)0!==t.springPosition[g]&&(u.enableSpring(g,!0),u.setStiffness(g,t.springPosition[g]));for(let g=0;g<3;g++)0!==t.springRotation[g]&&(u.enableSpring(g+3,!0),u.setStiffness(g+3,t.springRotation[g]));if(void 0!==u.setParam)for(let g=0;g<6;g++)u.setParam(2,.475,g);this.world.addConstraint(u,!0),this.constraint=u,e.freeTransform(i),e.freeTransform(s),e.freeTransform(a),e.freeTransform(o),e.freeTransform(l),e.freeTransform(c),e.freeTransform(h),e.freeVector3(d),e.freeVector3(p),e.freeVector3(f),e.freeVector3(m)}}const l=new r.Vector3,c=new r.Quaternion,h=new r.Vector3,u=new r.Matrix4;class d extends r.Object3D{constructor(e,t){super(),this.root=e,this.physics=t,this.matrix.copy(e.matrixWorld),this.matrixAutoUpdate=!1,this.materials=[],this.materials.push(new r.MeshBasicMaterial({color:new r.Color(16746632),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new r.MeshBasicMaterial({color:new r.Color(8978312),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new r.MeshBasicMaterial({color:new r.Color(8947967),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this._init()}dispose(){const e=this.materials,t=this.children;for(let n=0;n<e.length;n++)e[n].dispose();for(let n=0;n<t.length;n++){const e=t[n];e.isMesh&&e.geometry.dispose()}}updateMatrixWorld(e){var t=this.root;if(this.visible){var n=this.physics.bodies;u.copy(t.matrixWorld).decompose(l,c,h).compose(l,c,h.set(1,1,1)).invert();for(var r=0,i=n.length;r<i;r++){var s=n[r].body,a=this.children[r],o=s.getCenterOfMassTransform(),d=o.getOrigin(),p=o.getRotation();a.position.set(d.x(),d.y(),d.z()).applyMatrix4(u),a.quaternion.setFromRotationMatrix(u).multiply(c.set(p.x(),p.y(),p.z(),p.w()))}}this.matrix.copy(t.matrixWorld).decompose(l,c,h).compose(l,c,h.set(1,1,1)),super.updateMatrixWorld(e)}_init(){var e=this.physics.bodies;function t(e){switch(e.shapeType){case 0:return new r.SphereGeometry(e.width,16,8);case 1:return new r.BoxGeometry(2*e.width,2*e.height,2*e.depth,8,8,8);case 2:return new i.CapsuleGeometry(e.width,e.height,8,16);default:return null}}for(var n=0,s=e.length;n<s;n++){var a=e[n].params;this.add(new r.Mesh(t(a),this.materials[a.type]))}}}t.MMDPhysics=class{constructor(e,t,n=[],i={}){if("undefined"==typeof Ammo)throw new Error("THREE.MMDPhysics: Import ammo.js https://github.com/kripken/ammo.js");this.manager=new s,this.mesh=e,this.unitStep=void 0!==i.unitStep?i.unitStep:1/65,this.maxStepNum=void 0!==i.maxStepNum?i.maxStepNum:3,this.gravity=new r.Vector3(0,-98,0),void 0!==i.gravity&&this.gravity.copy(i.gravity),this.world=void 0!==i.world?i.world:null,this.bodies=[],this.constraints=[],this._init(e,t,n)}update(e){const t=this.manager,n=this.mesh;let r=!1;const i=t.allocThreeVector3(),s=t.allocThreeQuaternion(),a=t.allocThreeVector3();let o;return n.matrixWorld.decompose(i,s,a),1===a.x&&1===a.y&&1===a.z||(r=!0),r&&(o=n.parent,null!==o&&(n.parent=null),a.copy(this.mesh.scale),n.scale.set(1,1,1),n.updateMatrixWorld(!0)),this._updateRigidBodies(),this._stepSimulation(e),this._updateBones(),r&&(null!==o&&(n.parent=o),n.scale.copy(a)),t.freeThreeVector3(a),t.freeThreeQuaternion(s),t.freeThreeVector3(i),this}reset(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].reset();return this}warmup(e){for(let t=0;t<e;t++)this.update(1/60);return this}setGravity(e){return this.world.setGravity(new Ammo.btVector3(e.x,e.y,e.z)),this.gravity.copy(e),this}createHelper(){return new d(this.mesh,this)}_init(e,t,n){const r=this.manager,i=e.parent;null!==i&&(e.parent=null);const s=r.allocThreeVector3(),a=r.allocThreeQuaternion(),o=r.allocThreeVector3();s.copy(e.position),a.copy(e.quaternion),o.copy(e.scale),e.position.set(0,0,0),e.quaternion.set(0,0,0,1),e.scale.set(1,1,1),e.updateMatrixWorld(!0),null===this.world&&(this.world=this._createWorld(),this.setGravity(this.gravity)),this._initRigidBodies(t),this._initConstraints(n),null!==i&&(e.parent=i),e.position.copy(s),e.quaternion.copy(a),e.scale.copy(o),e.updateMatrixWorld(!0),this.reset(),r.freeThreeVector3(s),r.freeThreeQuaternion(a),r.freeThreeVector3(o)}_createWorld(){const e=new Ammo.btDefaultCollisionConfiguration,t=new Ammo.btCollisionDispatcher(e),n=new Ammo.btDbvtBroadphase,r=new Ammo.btSequentialImpulseConstraintSolver;return new Ammo.btDiscreteDynamicsWorld(t,n,r,e)}_initRigidBodies(e){for(let t=0,n=e.length;t<n;t++)this.bodies.push(new a(this.mesh,this.world,e[t],this.manager))}_initConstraints(e){for(let t=0,n=e.length;t<n;t++){const n=e[t],r=this.bodies[n.rigidBodyIndex1],i=this.bodies[n.rigidBodyIndex2];this.constraints.push(new o(this.mesh,this.world,r,i,n,this.manager))}}_stepSimulation(e){const t=this.unitStep;let n=e,r=1+(e/t|0);n<t&&(n=t,r=1),r>this.maxStepNum&&(r=this.maxStepNum),this.world.stepSimulation(n,r,t)}_updateRigidBodies(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].updateFromBone()}_updateBones(){for(let e=0,t=this.bodies.length;e<t;e++)this.bodies[e].updateBone()}}},34903:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(67971);class s extends r.PerspectiveCamera{constructor(e,t,n,s){super(e,t,n,s),this.type="CinematicCamera",this.postprocessing={enabled:!0},this.shaderSettings={rings:3,samples:4};const a=i.BokehDepthShader;this.materialDepth=new r.ShaderMaterial({uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),this.materialDepth.uniforms.mNear.value=n,this.materialDepth.uniforms.mFar.value=s,this.setLens(),this.initPostProcessing()}setLens(e,t,n,r){void 0===e&&(e=35),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e),void 0===n&&(n=8),void 0===r&&(r=.019),this.fNumber=n,this.coc=r,this.aperture=e/this.fNumber,this.hyperFocal=e*e/(this.aperture*this.coc)}linearize(e){const t=this.far,n=this.near;return-t*n/(e*(t-n)-t)}smoothstep(e,t,n){const r=this.saturate((n-e)/(t-e));return r*r*(3-2*r)}saturate(e){return Math.max(0,Math.min(1,e))}focusAt(e){void 0===e&&(e=20);const t=this.getFocalLength();this.focus=e,this.nearPoint=this.hyperFocal*this.focus/(this.hyperFocal+(this.focus-t)),this.farPoint=this.hyperFocal*this.focus/(this.hyperFocal-(this.focus-t)),this.depthOfField=this.farPoint-this.nearPoint,this.depthOfField<0&&(this.depthOfField=0),this.sdistance=this.smoothstep(this.near,this.far,this.focus),this.ldistance=this.linearize(1-this.sdistance),this.postprocessing.bokeh_uniforms.focalDepth.value=this.ldistance}initPostProcessing(){if(this.postprocessing.enabled){this.postprocessing.scene=new r.Scene,this.postprocessing.camera=new r.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,-1e4,1e4),this.postprocessing.scene.add(this.postprocessing.camera),this.postprocessing.rtTextureDepth=new r.WebGLRenderTarget(window.innerWidth,window.innerHeight),this.postprocessing.rtTextureColor=new r.WebGLRenderTarget(window.innerWidth,window.innerHeight);const e=i.BokehShader2;this.postprocessing.bokeh_uniforms=r.UniformsUtils.clone(e.uniforms),this.postprocessing.bokeh_uniforms.tColor.value=this.postprocessing.rtTextureColor.texture,this.postprocessing.bokeh_uniforms.tDepth.value=this.postprocessing.rtTextureDepth.texture,this.postprocessing.bokeh_uniforms.manualdof.value=0,this.postprocessing.bokeh_uniforms.shaderFocus.value=0,this.postprocessing.bokeh_uniforms.fstop.value=2.8,this.postprocessing.bokeh_uniforms.showFocus.value=1,this.postprocessing.bokeh_uniforms.focalDepth.value=.1,this.postprocessing.bokeh_uniforms.znear.value=this.near,this.postprocessing.bokeh_uniforms.zfar.value=this.near,this.postprocessing.bokeh_uniforms.textureWidth.value=window.innerWidth,this.postprocessing.bokeh_uniforms.textureHeight.value=window.innerHeight,this.postprocessing.materialBokeh=new r.ShaderMaterial({uniforms:this.postprocessing.bokeh_uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,defines:{RINGS:this.shaderSettings.rings,SAMPLES:this.shaderSettings.samples,DEPTH_PACKING:1}}),this.postprocessing.quad=new r.Mesh(new r.PlaneGeometry(window.innerWidth,window.innerHeight),this.postprocessing.materialBokeh),this.postprocessing.quad.position.z=-500,this.postprocessing.scene.add(this.postprocessing.quad)}}renderCinematic(e,t){if(this.postprocessing.enabled){const n=t.getRenderTarget();t.clear(),e.overrideMaterial=null,t.setRenderTarget(this.postprocessing.rtTextureColor),t.clear(),t.render(e,this),e.overrideMaterial=this.materialDepth,t.setRenderTarget(this.postprocessing.rtTextureDepth),t.clear(),t.render(e,this),t.setRenderTarget(null),t.render(this.postprocessing.scene,this.postprocessing.camera),t.setRenderTarget(n)}}}t.CinematicCamera=s},22845:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a={IDLE:Symbol(),ROTATE:Symbol(),PAN:Symbol(),SCALE:Symbol(),FOV:Symbol(),FOCUS:Symbol(),ZROTATE:Symbol(),TOUCH_MULTI:Symbol(),ANIMATION_FOCUS:Symbol(),ANIMATION_ROTATE:Symbol()},o={NONE:Symbol(),ONE_FINGER:Symbol(),ONE_FINGER_SWITCHED:Symbol(),TWO_FINGER:Symbol(),MULT_FINGER:Symbol(),CURSOR:Symbol()},l={x:0,y:0},c={camera:new s.Matrix4,gizmos:new s.Matrix4},h={type:"change"},u={type:"start"},d={type:"end"};class p extends s.EventDispatcher{constructor(e,t=null,n=null){super(),i(this,"camera"),i(this,"domElement"),i(this,"scene"),i(this,"mouseActions"),i(this,"_mouseOp"),i(this,"_v2_1"),i(this,"_v3_1"),i(this,"_v3_2"),i(this,"_m4_1"),i(this,"_m4_2"),i(this,"_quat"),i(this,"_translationMatrix"),i(this,"_rotationMatrix"),i(this,"_scaleMatrix"),i(this,"_rotationAxis"),i(this,"_cameraMatrixState"),i(this,"_cameraProjectionState"),i(this,"_fovState"),i(this,"_upState"),i(this,"_zoomState"),i(this,"_nearPos"),i(this,"_farPos"),i(this,"_gizmoMatrixState"),i(this,"_up0"),i(this,"_zoom0"),i(this,"_fov0"),i(this,"_initialNear"),i(this,"_nearPos0"),i(this,"_initialFar"),i(this,"_farPos0"),i(this,"_cameraMatrixState0"),i(this,"_gizmoMatrixState0"),i(this,"_button"),i(this,"_touchStart"),i(this,"_touchCurrent"),i(this,"_input"),i(this,"_switchSensibility"),i(this,"_startFingerDistance"),i(this,"_currentFingerDistance"),i(this,"_startFingerRotation"),i(this,"_currentFingerRotation"),i(this,"_devPxRatio"),i(this,"_downValid"),i(this,"_nclicks"),i(this,"_downEvents"),i(this,"_clickStart"),i(this,"_maxDownTime"),i(this,"_maxInterval"),i(this,"_posThreshold"),i(this,"_movementThreshold"),i(this,"_currentCursorPosition"),i(this,"_startCursorPosition"),i(this,"_grid"),i(this,"_gridPosition"),i(this,"_gizmos"),i(this,"_curvePts"),i(this,"_timeStart"),i(this,"_animationId"),i(this,"focusAnimationTime"),i(this,"_timePrev"),i(this,"_timeCurrent"),i(this,"_anglePrev"),i(this,"_angleCurrent"),i(this,"_cursorPosPrev"),i(this,"_cursorPosCurr"),i(this,"_wPrev"),i(this,"_wCurr"),i(this,"adjustNearFar"),i(this,"scaleFactor"),i(this,"dampingFactor"),i(this,"wMax"),i(this,"enableAnimations"),i(this,"enableGrid"),i(this,"cursorZoom"),i(this,"minFov"),i(this,"maxFov"),i(this,"enabled"),i(this,"enablePan"),i(this,"enableRotate"),i(this,"enableZoom"),i(this,"minDistance"),i(this,"maxDistance"),i(this,"minZoom"),i(this,"maxZoom"),i(this,"target"),i(this,"_currentTarget"),i(this,"_tbRadius"),i(this,"_state"),i(this,"onWindowResize",(()=>{const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3;if(this.camera){const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e)}const t=this._tbRadius/e,n=new s.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new s.BufferGeometry).setFromPoints(n);for(const i in this._gizmos.children){this._gizmos.children[i].geometry=r}this.dispatchEvent(h)})),i(this,"onContextMenu",(e=>{if(this.enabled)for(let t=0;t<this.mouseActions.length;t++)if(2==this.mouseActions[t].mouse){e.preventDefault();break}})),i(this,"onPointerCancel",(()=>{this._touchStart.splice(0,this._touchStart.length),this._touchCurrent.splice(0,this._touchCurrent.length),this._input=o.NONE})),i(this,"onPointerDown",(e=>{if(0==e.button&&e.isPrimary?(this._downValid=!0,this._downEvents.push(e)):this._downValid=!1,"touch"==e.pointerType&&this._input!=o.CURSOR)switch(this._touchStart.push(e),this._touchCurrent.push(e),this._input){case o.NONE:this._input=o.ONE_FINGER,this.onSinglePanStart(e,"ROTATE"),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp);break;case o.ONE_FINGER:case o.ONE_FINGER_SWITCHED:this._input=o.TWO_FINGER,this.onRotateStart(),this.onPinchStart(),this.onDoublePanStart();break;case o.TWO_FINGER:this._input=o.MULT_FINGER,this.onTriplePanStart()}else if("touch"!=e.pointerType&&this._input==o.NONE){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT"),this._mouseOp=this.getOpFromAction(e.button,t),this._mouseOp&&(window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),this._input=o.CURSOR,this._button=e.button,this.onSinglePanStart(e,this._mouseOp))}})),i(this,"onPointerMove",(e=>{if("touch"==e.pointerType&&this._input!=o.CURSOR)switch(this._input){case o.ONE_FINGER:this.updateTouchEvent(e),this.onSinglePanMove(e,a.ROTATE);break;case o.ONE_FINGER_SWITCHED:if(this.calculatePointersDistance(this._touchCurrent[0],e)*this._devPxRatio>=this._switchSensibility){this._input=o.ONE_FINGER,this.updateTouchEvent(e),this.onSinglePanStart(e,"ROTATE");break}break;case o.TWO_FINGER:this.updateTouchEvent(e),this.onRotateMove(),this.onPinchMove(),this.onDoublePanMove();break;case o.MULT_FINGER:this.updateTouchEvent(e),this.onTriplePanMove()}else if("touch"!=e.pointerType&&this._input==o.CURSOR){let t=null;e.ctrlKey||e.metaKey?t="CTRL":e.shiftKey&&(t="SHIFT");const n=this.getOpStateFromAction(this._button,t);n&&this.onSinglePanMove(e,n)}if(this._downValid){this.calculatePointersDistance(this._downEvents[this._downEvents.length-1],e)*this._devPxRatio>this._movementThreshold&&(this._downValid=!1)}})),i(this,"onPointerUp",(e=>{if("touch"==e.pointerType&&this._input!=o.CURSOR){const t=this._touchCurrent.length;for(let n=0;n<t;n++)if(this._touchCurrent[n].pointerId==e.pointerId){this._touchCurrent.splice(n,1),this._touchStart.splice(n,1);break}switch(this._input){case o.ONE_FINGER:case o.ONE_FINGER_SWITCHED:window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onSinglePanEnd();break;case o.TWO_FINGER:this.onDoublePanEnd(),this.onPinchEnd(),this.onRotateEnd(),this._input=o.ONE_FINGER_SWITCHED;break;case o.MULT_FINGER:0==this._touchCurrent.length&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onTriplePanEnd())}}else"touch"!=e.pointerType&&this._input==o.CURSOR&&(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this._input=o.NONE,this.onSinglePanEnd(),this._button=-1);if(e.isPrimary)if(this._downValid){if(e.timeStamp-this._downEvents[this._downEvents.length-1].timeStamp<=this._maxDownTime)if(0==this._nclicks)this._nclicks=1,this._clickStart=performance.now();else{const t=e.timeStamp-this._clickStart,n=this.calculatePointersDistance(this._downEvents[1],this._downEvents[0])*this._devPxRatio;t<=this._maxInterval&&n<=this._posThreshold?(this._nclicks=0,this._downEvents.splice(0,this._downEvents.length),this.onDoubleTap(e)):(this._nclicks=1,this._downEvents.shift(),this._clickStart=performance.now())}else this._downValid=!1,this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)}else this._nclicks=0,this._downEvents.splice(0,this._downEvents.length)})),i(this,"onWheel",(e=>{var t,n;if(this.enabled&&this.enableZoom&&this.domElement){let r=null;e.ctrlKey||e.metaKey?r="CTRL":e.shiftKey&&(r="SHIFT");const i=this.getOpFromAction("WHEEL",r);if(i){e.preventDefault(),this.dispatchEvent(u);const r=125;let o=e.deltaY/r,l=1;switch(o>0?l=1/this.scaleFactor:o<0&&(l=this.scaleFactor),i){case"ZOOM":if(this.updateTbState(a.SCALE,!0),o>0?l=1/Math.pow(this.scaleFactor,o):o<0&&(l=Math.pow(this.scaleFactor,-o)),this.cursorZoom&&this.enablePan){let r;this.camera instanceof s.OrthographicCamera&&(r=null==(t=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position)),this.camera instanceof s.PerspectiveCamera&&(r=null==(n=this.unprojectOnTbPlane(this.camera,e.clientX,e.clientY,this.domElement))?void 0:n.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)),void 0!==r&&this.applyTransformMatrix(this.applyScale(l,r))}else this.applyTransformMatrix(this.applyScale(l,this._gizmos.position));this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(a.IDLE,!1),this.dispatchEvent(h),this.dispatchEvent(d);break;case"FOV":if(this.camera instanceof s.PerspectiveCamera){this.updateTbState(a.FOV,!0),0!=e.deltaX&&(o=e.deltaX/r,l=1,o>0?l=1/Math.pow(this.scaleFactor,o):o<0&&(l=Math.pow(this.scaleFactor,-o))),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const t=this._v3_1.distanceTo(this._gizmos.position);let n=t/l;n=s.MathUtils.clamp(n,this.minDistance,this.maxDistance);const i=t*Math.tan(s.MathUtils.DEG2RAD*this.camera.fov*.5);let c=s.MathUtils.RAD2DEG*(2*Math.atan(i/n));c>this.maxFov?c=this.maxFov:c<this.minFov&&(c=this.minFov);l=t/(i/Math.tan(s.MathUtils.DEG2RAD*(c/2))),this.setFov(c),this.applyTransformMatrix(this.applyScale(l,this._gizmos.position,!1))}this._grid&&(this.disposeGrid(),this.drawGrid()),this.updateTbState(a.IDLE,!1),this.dispatchEvent(h),this.dispatchEvent(d)}}}})),i(this,"onSinglePanStart",((e,t)=>{if(this.enabled&&this.domElement)switch(this.dispatchEvent(u),this.setCenter(e.clientX,e.clientY),t){case"PAN":if(!this.enablePan)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(h)),this.camera){this.updateTbState(a.PAN,!0);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&(this.drawGrid(),this.dispatchEvent(h))}break;case"ROTATE":if(!this.enableRotate)return;if(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1),this.camera){this.updateTbState(a.ROTATE,!0);const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.activateGizmos(!0),this.enableAnimations&&(this._timePrev=this._timeCurrent=performance.now(),this._angleCurrent=this._anglePrev=0,this._cursorPosPrev.copy(this._startCursorPosition),this._cursorPosCurr.copy(this._cursorPosPrev),this._wCurr=0,this._wPrev=this._wCurr)}this.dispatchEvent(h);break;case"FOV":if(!this.enableZoom)return;this.camera instanceof s.PerspectiveCamera&&(-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(h)),this.updateTbState(a.FOV,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition));break;case"ZOOM":if(!this.enableZoom)return;-1!=this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=-1,this._timeStart=-1,this.activateGizmos(!1),this.dispatchEvent(h)),this.updateTbState(a.SCALE,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),i(this,"onSinglePanMove",((e,t)=>{if(this.enabled&&this.domElement){const n=t!=this._state;switch(this.setCenter(e.clientX,e.clientY),t){case a.PAN:if(this.enablePan&&this.camera)if(n){this.dispatchEvent(d),this.dispatchEvent(u),this.updateTbState(t,!0);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.drawGrid(),this.activateGizmos(!1)}else{const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition))}break;case a.ROTATE:if(this.enableRotate&&this.camera)if(n){this.dispatchEvent(d),this.dispatchEvent(u),this.updateTbState(t,!0);const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._startCursorPosition.copy(e),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!0)}else{const e=this.unprojectOnTbSurface(this.camera,l.x,l.y,this.domElement,this._tbRadius);void 0!==e&&this._currentCursorPosition.copy(e);const t=this._startCursorPosition.distanceTo(this._currentCursorPosition),n=this._startCursorPosition.angleTo(this._currentCursorPosition),r=Math.max(t/this._tbRadius,n);this.applyTransformMatrix(this.rotate(this.calculateRotationAxis(this._startCursorPosition,this._currentCursorPosition),r)),this.enableAnimations&&(this._timePrev=this._timeCurrent,this._timeCurrent=performance.now(),this._anglePrev=this._angleCurrent,this._angleCurrent=r,this._cursorPosPrev.copy(this._cursorPosCurr),this._cursorPosCurr.copy(this._currentCursorPosition),this._wPrev=this._wCurr,this._wCurr=this.calculateAngularSpeed(this._anglePrev,this._angleCurrent,this._timePrev,this._timeCurrent))}break;case a.SCALE:if(this.enableZoom)if(n)this.dispatchEvent(d),this.dispatchEvent(u),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let n=1;t<0?n=1/Math.pow(this.scaleFactor,-t*e):t>0&&(n=Math.pow(this.scaleFactor,t*e)),this.applyTransformMatrix(this.applyScale(n,this._gizmos.position))}break;case a.FOV:if(this.enableZoom&&this.camera instanceof s.PerspectiveCamera)if(n)this.dispatchEvent(d),this.dispatchEvent(u),this.updateTbState(t,!0),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1);else{const e=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const t=this._currentCursorPosition.y-this._startCursorPosition.y;let n=1;t<0?n=1/Math.pow(this.scaleFactor,-t*e):t>0&&(n=Math.pow(this.scaleFactor,t*e)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const r=this._v3_1.distanceTo(this._gizmos.position);let i=r/n;i=s.MathUtils.clamp(i,this.minDistance,this.maxDistance);const a=r*Math.tan(s.MathUtils.DEG2RAD*this._fovState*.5);let o=s.MathUtils.RAD2DEG*(2*Math.atan(a/i));o=s.MathUtils.clamp(o,this.minFov,this.maxFov);const c=a/Math.tan(s.MathUtils.DEG2RAD*(o/2));n=r/c,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(o),this.applyTransformMatrix(this.applyScale(n,this._v3_2,!1));const h=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(c/r);this._m4_1.makeTranslation(h.x,h.y,h.z)}}this.dispatchEvent(h)}})),i(this,"onSinglePanEnd",(()=>{if(this._state==a.ROTATE){if(!this.enableRotate)return;if(this.enableAnimations){if(performance.now()-this._timeCurrent<120){const e=Math.abs((this._wPrev+this._wCurr)/2),t=this;this._animationId=window.requestAnimationFrame((function(n){t.updateTbState(a.ANIMATION_ROTATE,!0);const r=t.calculateRotationAxis(t._cursorPosPrev,t._cursorPosCurr);t.onRotationAnim(n,r,Math.min(e,t.wMax))}))}else this.updateTbState(a.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(h)}else this.updateTbState(a.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(h)}else this._state!=a.PAN&&this._state!=a.IDLE||(this.updateTbState(a.IDLE,!1),this.enableGrid&&this.disposeGrid(),this.activateGizmos(!1),this.dispatchEvent(h));this.dispatchEvent(d)})),i(this,"onDoubleTap",(e=>{if(this.enabled&&this.enablePan&&this.scene&&this.camera&&this.domElement){this.dispatchEvent(u),this.setCenter(e.clientX,e.clientY);const t=this.unprojectOnObj(this.getCursorNDC(l.x,l.y,this.domElement),this.camera);if(t&&this.enableAnimations){const e=this;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),this._timeStart=-1,this._animationId=window.requestAnimationFrame((function(n){e.updateTbState(a.ANIMATION_FOCUS,!0),e.onFocusAnim(n,t,e._cameraMatrixState,e._gizmoMatrixState)}))}else t&&!this.enableAnimations&&(this.updateTbState(a.FOCUS,!0),this.focus(t,this.scaleFactor),this.updateTbState(a.IDLE,!1),this.dispatchEvent(h))}this.dispatchEvent(d)})),i(this,"onDoublePanStart",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.dispatchEvent(u),this.updateTbState(a.PAN,!0),this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement,!0);void 0!==e&&this._startCursorPosition.copy(e),this._currentCursorPosition.copy(this._startCursorPosition),this.activateGizmos(!1)}})),i(this,"onDoublePanMove",(()=>{if(this.enabled&&this.enablePan&&this.camera&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=a.PAN&&(this.updateTbState(a.PAN,!0),this._startCursorPosition.copy(this._currentCursorPosition));const e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement,!0);void 0!==e&&this._currentCursorPosition.copy(e),this.applyTransformMatrix(this.pan(this._startCursorPosition,this._currentCursorPosition,!0)),this.dispatchEvent(h)}})),i(this,"onDoublePanEnd",(()=>{this.updateTbState(a.IDLE,!1),this.dispatchEvent(d)})),i(this,"onRotateStart",(()=>{var e;this.enabled&&this.enableRotate&&(this.dispatchEvent(u),this.updateTbState(a.ZROTATE,!0),this._startFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this._currentFingerRotation=this._startFingerRotation,null==(e=this.camera)||e.getWorldDirection(this._rotationAxis),this.enablePan||this.enableZoom||this.activateGizmos(!0))})),i(this,"onRotateMove",(()=>{var e;if(this.enabled&&this.enableRotate&&this.camera&&this.domElement){let t;this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2),this._state!=a.ZROTATE&&(this.updateTbState(a.ZROTATE,!0),this._startFingerRotation=this._currentFingerRotation),this._currentFingerRotation=this.getAngle(this._touchCurrent[1],this._touchCurrent[0])+this.getAngle(this._touchStart[1],this._touchStart[0]),this.enablePan?this.camera&&(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),t=null==(e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._v3_2)):t=(new s.Vector3).setFromMatrixPosition(this._gizmoMatrixState);const n=s.MathUtils.DEG2RAD*(this._startFingerRotation-this._currentFingerRotation);void 0!==t&&this.applyTransformMatrix(this.zRotate(t,n)),this.dispatchEvent(h)}})),i(this,"onRotateEnd",(()=>{this.updateTbState(a.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(d)})),i(this,"onPinchStart",(()=>{this.enabled&&this.enableZoom&&(this.dispatchEvent(u),this.updateTbState(a.SCALE,!0),this._startFingerDistance=this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),this._currentFingerDistance=this._startFingerDistance,this.activateGizmos(!1))})),i(this,"onPinchMove",(()=>{var e,t;if(this.enabled&&this.enableZoom&&this.domElement){this.setCenter((this._touchCurrent[0].clientX+this._touchCurrent[1].clientX)/2,(this._touchCurrent[0].clientY+this._touchCurrent[1].clientY)/2);const n=12;this._state!=a.SCALE&&(this._startFingerDistance=this._currentFingerDistance,this.updateTbState(a.SCALE,!0)),this._currentFingerDistance=Math.max(this.calculatePointersDistance(this._touchCurrent[0],this._touchCurrent[1]),n*this._devPxRatio);const r=this._currentFingerDistance/this._startFingerDistance;let i;this.enablePan?this.camera instanceof s.OrthographicCamera?i=null==(e=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:e.applyQuaternion(this.camera.quaternion).multiplyScalar(1/this.camera.zoom).add(this._gizmos.position):this.camera instanceof s.PerspectiveCamera&&(i=null==(t=this.unprojectOnTbPlane(this.camera,l.x,l.y,this.domElement))?void 0:t.applyQuaternion(this.camera.quaternion).add(this._gizmos.position)):i=this._gizmos.position,void 0!==i&&this.applyTransformMatrix(this.applyScale(r,i)),this.dispatchEvent(h)}})),i(this,"onPinchEnd",(()=>{this.updateTbState(a.IDLE,!1),this.dispatchEvent(d)})),i(this,"onTriplePanStart",(()=>{if(this.enabled&&this.enableZoom&&this.domElement){this.dispatchEvent(u),this.updateTbState(a.SCALE,!0);let e=0,t=0;const n=this._touchCurrent.length;for(let r=0;r<n;r++)e+=this._touchCurrent[r].clientX,t+=this._touchCurrent[r].clientY;this.setCenter(e/n,t/n),this._startCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y),this._currentCursorPosition.copy(this._startCursorPosition)}})),i(this,"onTriplePanMove",(()=>{if(this.enabled&&this.enableZoom&&this.camera&&this.domElement){let e=0,t=0;const n=this._touchCurrent.length;for(let s=0;s<n;s++)e+=this._touchCurrent[s].clientX,t+=this._touchCurrent[s].clientY;this.setCenter(e/n,t/n);const r=8;this._currentCursorPosition.setY(.5*this.getCursorNDC(l.x,l.y,this.domElement).y);const i=this._currentCursorPosition.y-this._startCursorPosition.y;let a=1;i<0?a=1/Math.pow(this.scaleFactor,-i*r):i>0&&(a=Math.pow(this.scaleFactor,i*r)),this._v3_1.setFromMatrixPosition(this._cameraMatrixState);const o=this._v3_1.distanceTo(this._gizmos.position);let c=o/a;c=s.MathUtils.clamp(c,this.minDistance,this.maxDistance);const u=o*Math.tan(s.MathUtils.DEG2RAD*this._fovState*.5);let d=s.MathUtils.RAD2DEG*(2*Math.atan(u/c));d=s.MathUtils.clamp(d,this.minFov,this.maxFov);const p=u/Math.tan(s.MathUtils.DEG2RAD*(d/2));a=o/p,this._v3_2.setFromMatrixPosition(this._gizmoMatrixState),this.setFov(d),this.applyTransformMatrix(this.applyScale(a,this._v3_2,!1));const f=this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(p/o);this._m4_1.makeTranslation(f.x,f.y,f.z),this.dispatchEvent(h)}})),i(this,"onTriplePanEnd",(()=>{this.updateTbState(a.IDLE,!1),this.dispatchEvent(d)})),i(this,"setCenter",((e,t)=>{l.x=e,l.y=t})),i(this,"initializeMouseActions",(()=>{this.setMouseAction("PAN",0,"CTRL"),this.setMouseAction("PAN",2),this.setMouseAction("ROTATE",0),this.setMouseAction("ZOOM","WHEEL"),this.setMouseAction("ZOOM",1),this.setMouseAction("FOV","WHEEL","SHIFT"),this.setMouseAction("FOV",1,"SHIFT")})),i(this,"setMouseAction",((e,t,n=null)=>{let r;if(!["PAN","ROTATE","ZOOM","FOV"].includes(e)||![0,1,2,"WHEEL"].includes(t)||!["CTRL","SHIFT",null].includes(n))return!1;if("WHEEL"==t&&"ZOOM"!=e&&"FOV"!=e)return!1;switch(e){case"PAN":r=a.PAN;break;case"ROTATE":r=a.ROTATE;break;case"ZOOM":r=a.SCALE;break;case"FOV":r=a.FOV}const i={operation:e,mouse:t,key:n,state:r};for(let s=0;s<this.mouseActions.length;s++)if(this.mouseActions[s].mouse==i.mouse&&this.mouseActions[s].key==i.key)return this.mouseActions.splice(s,1,i),!0;return this.mouseActions.push(i),!0})),i(this,"getOpFromAction",((e,t)=>{let n;for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&n.key==t)return n.operation;if(t)for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&null==n.key)return n.operation;return null})),i(this,"getOpStateFromAction",((e,t)=>{let n;for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&n.key==t)return n.state;if(t)for(let r=0;r<this.mouseActions.length;r++)if(n=this.mouseActions[r],n.mouse==e&&null==n.key)return n.state;return null})),i(this,"getAngle",((e,t)=>180*Math.atan2(t.clientY-e.clientY,t.clientX-e.clientX)/Math.PI)),i(this,"updateTouchEvent",(e=>{for(let t=0;t<this._touchCurrent.length;t++)if(this._touchCurrent[t].pointerId==e.pointerId){this._touchCurrent.splice(t,1,e);break}})),i(this,"calculateAngularSpeed",((e,t,n,r)=>{const i=(r-n)/1e3;return 0==i?0:(t-e)/i})),i(this,"calculatePointersDistance",((e,t)=>Math.sqrt(Math.pow(t.clientX-e.clientX,2)+Math.pow(t.clientY-e.clientY,2)))),i(this,"calculateRotationAxis",((e,t)=>(this._rotationMatrix.extractRotation(this._cameraMatrixState),this._quat.setFromRotationMatrix(this._rotationMatrix),this._rotationAxis.crossVectors(e,t).applyQuaternion(this._quat),this._rotationAxis.normalize().clone()))),i(this,"calculateTbRadius",(e=>{const t=e.position.distanceTo(this._gizmos.position);if(e instanceof s.PerspectiveCamera){const n=s.MathUtils.DEG2RAD*e.fov*.5,r=Math.atan(e.aspect*Math.tan(n));return Math.tan(Math.min(n,r))*t*.67}if(e instanceof s.OrthographicCamera)return.67*Math.min(e.top,e.right)})),i(this,"focus",((e,t,n=1)=>{if(this.camera){const r=e.clone();r.sub(this._gizmos.position).multiplyScalar(n),this._translationMatrix.makeTranslation(r.x,r.y,r.z);const i=this._gizmoMatrixState.clone();this._gizmoMatrixState.premultiply(this._translationMatrix),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale);const s=this._cameraMatrixState.clone();this._cameraMatrixState.premultiply(this._translationMatrix),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.enableZoom&&this.applyTransformMatrix(this.applyScale(t,this._gizmos.position)),this._gizmoMatrixState.copy(i),this._cameraMatrixState.copy(s)}})),i(this,"drawGrid",(()=>{if(this.scene){const e=8947848,t=3;let n,r,i,a;if(this.camera instanceof s.OrthographicCamera){const e=this.camera.right-this.camera.left,s=this.camera.bottom-this.camera.top;i=Math.max(e,s),a=i/20,n=i/this.camera.zoom*t,r=n/a*this.camera.zoom}else if(this.camera instanceof s.PerspectiveCamera){const e=this.camera.position.distanceTo(this._gizmos.position),o=s.MathUtils.DEG2RAD*this.camera.fov*.5,l=Math.atan(this.camera.aspect*Math.tan(o));i=Math.tan(Math.max(o,l))*e*2,a=i/20,n=i*t,r=n/a}null==this._grid&&this.camera&&(this._grid=new s.GridHelper(n,r,e,e),this._grid.position.copy(this._gizmos.position),this._gridPosition.copy(this._grid.position),this._grid.quaternion.copy(this.camera.quaternion),this._grid.rotateX(.5*Math.PI),this.scene.add(this._grid))}})),i(this,"connect",(e=>{e===document&&console.error('THREE.ArcballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.style.touchAction="none",this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointercancel",this.onPointerCancel),this.domElement.addEventListener("wheel",this.onWheel)})),i(this,"dispose",(()=>{var e,t,n,r,i;-1!=this._animationId&&window.cancelAnimationFrame(this._animationId),null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointercancel",this.onPointerCancel),null==(n=this.domElement)||n.removeEventListener("wheel",this.onWheel),null==(r=this.domElement)||r.removeEventListener("contextmenu",this.onContextMenu),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),null==(i=this.scene)||i.remove(this._gizmos),this.disposeGrid()})),i(this,"disposeGrid",(()=>{this._grid&&this.scene&&(this.scene.remove(this._grid),this._grid=null)})),i(this,"easeOutCubic",(e=>1-Math.pow(1-e,3))),i(this,"activateGizmos",(e=>{for(const t of this._gizmos.children)t.material.setValues({opacity:e?1:.6})})),i(this,"getCursorNDC",((e,t,n)=>{const r=n.getBoundingClientRect();return this._v2_1.setX((e-r.left)/r.width*2-1),this._v2_1.setY((r.bottom-t)/r.height*2-1),this._v2_1.clone()})),i(this,"getCursorPosition",((e,t,n)=>(this._v2_1.copy(this.getCursorNDC(e,t,n)),this.camera instanceof s.OrthographicCamera&&(this._v2_1.x*=.5*(this.camera.right-this.camera.left),this._v2_1.y*=.5*(this.camera.top-this.camera.bottom)),this._v2_1.clone()))),i(this,"setCamera",(e=>{if(e){e.lookAt(this.target),e.updateMatrix(),e instanceof s.PerspectiveCamera&&(this._fov0=e.fov,this._fovState=e.fov),this._cameraMatrixState0.copy(e.matrix),this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraProjectionState.copy(e.projectionMatrix),this._zoom0=e.zoom,this._zoomState=this._zoom0,this._initialNear=e.near,this._nearPos0=e.position.distanceTo(this.target)-e.near,this._nearPos=this._initialNear,this._initialFar=e.far,this._farPos0=e.position.distanceTo(this.target)-e.far,this._farPos=this._initialFar,this._up0.copy(e.up),this._upState.copy(e.up),this.camera=e,this.camera.updateProjectionMatrix();const t=this.calculateTbRadius(e);void 0!==t&&(this._tbRadius=t),this.makeGizmos(this.target,this._tbRadius)}})),i(this,"makeGizmos",((e,t)=>{const n=new s.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new s.BufferGeometry).setFromPoints(n),i=new s.LineBasicMaterial({color:16744576,fog:!1,transparent:!0,opacity:.6}),a=new s.LineBasicMaterial({color:8454016,fog:!1,transparent:!0,opacity:.6}),o=new s.LineBasicMaterial({color:8421631,fog:!1,transparent:!0,opacity:.6}),l=new s.Line(r,i),c=new s.Line(r,a),h=new s.Line(r,o),u=.5*Math.PI;if(l.rotation.x=u,c.rotation.y=u,this._gizmoMatrixState0.identity().setPosition(e),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this.camera&&1!=this.camera.zoom){const t=1/this.camera.zoom;this._scaleMatrix.makeScale(t,t,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._gizmoMatrixState.premultiply(this._translationMatrix).premultiply(this._scaleMatrix),this._translationMatrix.makeTranslation(e.x,e.y,e.z),this._gizmoMatrixState.premultiply(this._translationMatrix)}this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.clear(),this._gizmos.add(l),this._gizmos.add(c),this._gizmos.add(h)})),i(this,"onFocusAnim",((e,t,n,r)=>{if(-1==this._timeStart&&(this._timeStart=e),this._state==a.ANIMATION_FOCUS){const i=(e-this._timeStart)/this.focusAnimationTime;if(this._gizmoMatrixState.copy(r),i>=1)this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,this.scaleFactor),this._timeStart=-1,this.updateTbState(a.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(h);else{const e=this.easeOutCubic(i),s=1-e+this.scaleFactor*e;this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.focus(t,s,e),this.dispatchEvent(h);const a=this;this._animationId=window.requestAnimationFrame((function(e){a.onFocusAnim(e,t,n,r.clone())}))}}else this._animationId=-1,this._timeStart=-1})),i(this,"onRotationAnim",((e,t,n)=>{if(-1==this._timeStart&&(this._anglePrev=0,this._angleCurrent=0,this._timeStart=e),this._state==a.ANIMATION_ROTATE){const r=(e-this._timeStart)/1e3;if(n+-this.dampingFactor*r>0){this._angleCurrent=.5*-this.dampingFactor*Math.pow(r,2)+n*r+0,this.applyTransformMatrix(this.rotate(t,this._angleCurrent)),this.dispatchEvent(h);const e=this;this._animationId=window.requestAnimationFrame((function(r){e.onRotationAnim(r,t,n)}))}else this._animationId=-1,this._timeStart=-1,this.updateTbState(a.IDLE,!1),this.activateGizmos(!1),this.dispatchEvent(h)}else this._animationId=-1,this._timeStart=-1,this._state!=a.ROTATE&&(this.activateGizmos(!1),this.dispatchEvent(h))})),i(this,"pan",((e,t,n=!1)=>{if(this.camera){const r=e.clone().sub(t);if(this.camera instanceof s.OrthographicCamera&&r.multiplyScalar(1/this.camera.zoom),this.camera instanceof s.PerspectiveCamera&&n){this._v3_1.setFromMatrixPosition(this._cameraMatrixState0),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);const e=this._v3_1.distanceTo(this._v3_2)/this.camera.position.distanceTo(this._gizmos.position);r.multiplyScalar(1/e)}this._v3_1.set(r.x,r.y,0).applyQuaternion(this.camera.quaternion),this._m4_1.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z),this.setTransformationMatrices(this._m4_1,this._m4_1)}return c})),i(this,"reset",(()=>{if(this.camera){this.camera.zoom=this._zoom0,this.camera instanceof s.PerspectiveCamera&&(this.camera.fov=this._fov0),this.camera.near=this._nearPos,this.camera.far=this._farPos,this._cameraMatrixState.copy(this._cameraMatrixState0),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(this._up0),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmoMatrixState.copy(this._gizmoMatrixState0),this._gizmoMatrixState0.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this._gizmos.position,this._tbRadius),this.camera.lookAt(this._gizmos.position),this.updateTbState(a.IDLE,!1),this.dispatchEvent(h)}})),i(this,"rotate",((e,t)=>{const n=this._gizmos.position;return this._translationMatrix.makeTranslation(-n.x,-n.y,-n.z),this._rotationMatrix.makeRotationAxis(e,-t),this._m4_1.makeTranslation(n.x,n.y,n.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1),c})),i(this,"copyState",(()=>{if(this.camera){const e=JSON.stringify(this.camera instanceof s.OrthographicCamera?{arcballState:{cameraFar:this.camera.far,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}}:{arcballState:{cameraFar:this.camera.far,cameraFov:this.camera.fov,cameraMatrix:this.camera.matrix,cameraNear:this.camera.near,cameraUp:this.camera.up,cameraZoom:this.camera.zoom,gizmoMatrix:this._gizmos.matrix}});navigator.clipboard.writeText(e)}})),i(this,"pasteState",(()=>{const e=this;navigator.clipboard.readText().then((function(t){e.setStateFromJSON(t)}))})),i(this,"saveState",(()=>{this.camera&&(this._cameraMatrixState0.copy(this.camera.matrix),this._gizmoMatrixState0.copy(this._gizmos.matrix),this._nearPos=this.camera.near,this._farPos=this.camera.far,this._zoom0=this.camera.zoom,this._up0.copy(this.camera.up),this.camera instanceof s.PerspectiveCamera&&(this._fov0=this.camera.fov))})),i(this,"applyScale",((e,t,n=!0)=>{if(!this.camera)return;const r=t.clone();let i=1/e;if(this.camera instanceof s.OrthographicCamera){this.camera.zoom=this._zoomState,this.camera.zoom*=e,this.camera.zoom>this.maxZoom?(this.camera.zoom=this.maxZoom,i=this._zoomState/this.maxZoom):this.camera.zoom<this.minZoom&&(this.camera.zoom=this.minZoom,i=this._zoomState/this.minZoom),this.camera.updateProjectionMatrix(),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState),this._scaleMatrix.makeScale(i,i,i),this._translationMatrix.makeTranslation(-this._v3_1.x,-this._v3_1.y,-this._v3_1.z),this._m4_2.makeTranslation(this._v3_1.x,this._v3_1.y,this._v3_1.z).multiply(this._scaleMatrix),this._m4_2.multiply(this._translationMatrix),r.sub(this._v3_1);const t=r.clone().multiplyScalar(i);return r.sub(t),this._m4_1.makeTranslation(r.x,r.y,r.z),this._m4_2.premultiply(this._m4_1),this.setTransformationMatrices(this._m4_1,this._m4_2),c}if(this.camera instanceof s.PerspectiveCamera){this._v3_1.setFromMatrixPosition(this._cameraMatrixState),this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);let e=this._v3_1.distanceTo(r),t=e-e*i;const s=e-t;s<this.minDistance?(i=this.minDistance/e,t=e-e*i):s>this.maxDistance&&(i=this.maxDistance/e,t=e-e*i);let a=r.clone().sub(this._v3_1).normalize().multiplyScalar(t);if(this._m4_1.makeTranslation(a.x,a.y,a.z),n){const n=this._v3_2;e=n.distanceTo(r),t=e-e*i,a=r.clone().sub(this._v3_2).normalize().multiplyScalar(t),this._translationMatrix.makeTranslation(n.x,n.y,n.z),this._scaleMatrix.makeScale(i,i,i),this._m4_2.makeTranslation(a.x,a.y,a.z).multiply(this._translationMatrix),this._m4_2.multiply(this._scaleMatrix),this._translationMatrix.makeTranslation(-n.x,-n.y,-n.z),this._m4_2.multiply(this._translationMatrix),this.setTransformationMatrices(this._m4_1,this._m4_2)}else this.setTransformationMatrices(this._m4_1);return c}})),i(this,"setFov",(e=>{this.camera instanceof s.PerspectiveCamera&&(this.camera.fov=s.MathUtils.clamp(e,this.minFov,this.maxFov),this.camera.updateProjectionMatrix())})),i(this,"setTarget",((e,t,n)=>{if(this.camera){this.target.set(e,t,n),this._gizmos.position.set(e,t,n);const r=this.calculateTbRadius(this.camera);void 0!==r&&(this._tbRadius=r),this.makeGizmos(this.target,this._tbRadius),this.camera.lookAt(this.target)}})),i(this,"zRotate",((e,t)=>(this._rotationMatrix.makeRotationAxis(this._rotationAxis,t),this._translationMatrix.makeTranslation(-e.x,-e.y,-e.z),this._m4_1.makeTranslation(e.x,e.y,e.z),this._m4_1.multiply(this._rotationMatrix),this._m4_1.multiply(this._translationMatrix),this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(e),this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis,t),this._v3_2.sub(this._v3_1),this._m4_2.makeTranslation(this._v3_2.x,this._v3_2.y,this._v3_2.z),this.setTransformationMatrices(this._m4_1,this._m4_2),c))),i(this,"unprojectOnObj",((e,t)=>{if(!this.scene)return null;const n=new s.Raycaster;n.near=t.near,n.far=t.far,n.setFromCamera(e,t);const r=n.intersectObjects(this.scene.children,!0);for(let i=0;i<r.length;i++)if(r[i].object.uuid!=this._gizmos.uuid&&r[i].face)return r[i].point.clone();return null})),i(this,"unprojectOnTbSurface",((e,t,n,r,i)=>{if(e instanceof s.OrthographicCamera){this._v2_1.copy(this.getCursorPosition(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0);const e=Math.pow(this._v2_1.x,2),i=Math.pow(this._v2_1.y,2),s=Math.pow(this._tbRadius,2);return e+i<=.5*s?this._v3_1.setZ(Math.sqrt(s-(e+i))):this._v3_1.setZ(.5*s/Math.sqrt(e+i)),this._v3_1}if(e instanceof s.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const a=this._v3_1.clone().normalize(),o=e.position.distanceTo(this._gizmos.position),l=Math.pow(i,2),c=this._v3_1.z,h=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));if(0==h)return a.set(this._v3_1.x,this._v3_1.y,i),a;const u=c/h,d=o;let p=Math.pow(u,2)+1,f=2*u*d,m=Math.pow(d,2)-l,g=Math.pow(f,2)-4*p*m;if(g>=0){this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(u*this._v2_1.x+d);if(s.MathUtils.RAD2DEG*this._v2_1.angle()>=45){const e=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return a.multiplyScalar(e),a.z+=o,a}}p=u,f=d,m=.5*-l,g=Math.pow(f,2)-4*p*m,this._v2_1.setX((-f-Math.sqrt(g))/(2*p)),this._v2_1.setY(u*this._v2_1.x+d);const A=Math.sqrt(Math.pow(this._v2_1.x,2)+Math.pow(o-this._v2_1.y,2));return a.multiplyScalar(A),a.z+=o,a}})),i(this,"unprojectOnTbPlane",((e,t,n,r,i=!1)=>{if(e instanceof s.OrthographicCamera)return this._v2_1.copy(this.getCursorPosition(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,0),this._v3_1.clone();if(e instanceof s.PerspectiveCamera){this._v2_1.copy(this.getCursorNDC(t,n,r)),this._v3_1.set(this._v2_1.x,this._v2_1.y,-1),this._v3_1.applyMatrix4(e.projectionMatrixInverse);const s=this._v3_1.clone().normalize(),a=this._v3_1.z,o=Math.sqrt(Math.pow(this._v3_1.x,2)+Math.pow(this._v3_1.y,2));let l;if(l=i?this._v3_1.setFromMatrixPosition(this._cameraMatrixState0).distanceTo(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0)):e.position.distanceTo(this._gizmos.position),0==o)return s.set(0,0,0),s;const c=l,h=-c/(a/o),u=Math.sqrt(Math.pow(c,2)+Math.pow(h,2));return s.multiplyScalar(u),s.z=0,s}})),i(this,"updateMatrixState",(()=>{this.camera&&(this._cameraMatrixState.copy(this.camera.matrix),this._gizmoMatrixState.copy(this._gizmos.matrix),this.camera instanceof s.OrthographicCamera&&(this._cameraProjectionState.copy(this.camera.projectionMatrix),this.camera.updateProjectionMatrix(),this._zoomState=this.camera.zoom),this.camera instanceof s.PerspectiveCamera&&(this._fovState=this.camera.fov))})),i(this,"updateTbState",((e,t)=>{this._state=e,t&&this.updateMatrixState()})),i(this,"update",(()=>{const e=1e-6;if(!this.target.equals(this._currentTarget)&&this.camera){this._gizmos.position.set(this.target.x,this.target.y,this.target.z);const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e),this.makeGizmos(this.target,this._tbRadius),this._currentTarget.copy(this.target)}if(this.camera){if(this.camera instanceof s.OrthographicCamera&&(this.camera.zoom>this.maxZoom||this.camera.zoom<this.minZoom)){const e=s.MathUtils.clamp(this.camera.zoom,this.minZoom,this.maxZoom);this.applyTransformMatrix(this.applyScale(e/this.camera.zoom,this._gizmos.position,!0))}if(this.camera instanceof s.PerspectiveCamera){const t=this.camera.position.distanceTo(this._gizmos.position);if(t>this.maxDistance+e||t<this.minDistance-e){const e=s.MathUtils.clamp(t,this.minDistance,this.maxDistance);this.applyTransformMatrix(this.applyScale(e/t,this._gizmos.position)),this.updateMatrixState()}(this.camera.fov<this.minFov||this.camera.fov>this.maxFov)&&(this.camera.fov=s.MathUtils.clamp(this.camera.fov,this.minFov,this.maxFov),this.camera.updateProjectionMatrix());const n=this._tbRadius,r=this.calculateTbRadius(this.camera);if(void 0!==r&&(this._tbRadius=r),n<this._tbRadius-e||n>this._tbRadius+e){const e=(this._gizmos.scale.x+this._gizmos.scale.y+this._gizmos.scale.z)/3,t=this._tbRadius/e,n=new s.EllipseCurve(0,0,t,t).getPoints(this._curvePts),r=(new s.BufferGeometry).setFromPoints(n);for(const i in this._gizmos.children){this._gizmos.children[i].geometry=r}}}this.camera.lookAt(this._gizmos.position)}})),i(this,"setStateFromJSON",(e=>{const t=JSON.parse(e);if(t.arcballState&&this.camera){this._cameraMatrixState.fromArray(t.arcballState.cameraMatrix.elements),this._cameraMatrixState.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.up.copy(t.arcballState.cameraUp),this.camera.near=t.arcballState.cameraNear,this.camera.far=t.arcballState.cameraFar,this.camera.zoom=t.arcballState.cameraZoom,this.camera instanceof s.PerspectiveCamera&&(this.camera.fov=t.arcballState.cameraFov),this._gizmoMatrixState.fromArray(t.arcballState.gizmoMatrix.elements),this._gizmoMatrixState.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this.camera.updateMatrix(),this.camera.updateProjectionMatrix(),this._gizmos.updateMatrix();const e=this.calculateTbRadius(this.camera);void 0!==e&&(this._tbRadius=e);const n=(new s.Matrix4).copy(this._gizmoMatrixState0);this.makeGizmos(this._gizmos.position,this._tbRadius),this._gizmoMatrixState0.copy(n),this.camera.lookAt(this._gizmos.position),this.updateTbState(a.IDLE,!1),this.dispatchEvent(h)}})),this.camera=null,this.domElement=t,this.scene=n,this.mouseActions=[],this._mouseOp=null,this._v2_1=new s.Vector2,this._v3_1=new s.Vector3,this._v3_2=new s.Vector3,this._m4_1=new s.Matrix4,this._m4_2=new s.Matrix4,this._quat=new s.Quaternion,this._translationMatrix=new s.Matrix4,this._rotationMatrix=new s.Matrix4,this._scaleMatrix=new s.Matrix4,this._rotationAxis=new s.Vector3,this._cameraMatrixState=new s.Matrix4,this._cameraProjectionState=new s.Matrix4,this._fovState=1,this._upState=new s.Vector3,this._zoomState=1,this._nearPos=0,this._farPos=0,this._gizmoMatrixState=new s.Matrix4,this._up0=new s.Vector3,this._zoom0=1,this._fov0=0,this._initialNear=0,this._nearPos0=0,this._initialFar=0,this._farPos0=0,this._cameraMatrixState0=new s.Matrix4,this._gizmoMatrixState0=new s.Matrix4,this._button=-1,this._touchStart=[],this._touchCurrent=[],this._input=o.NONE,this._switchSensibility=32,this._startFingerDistance=0,this._currentFingerDistance=0,this._startFingerRotation=0,this._currentFingerRotation=0,this._devPxRatio=0,this._downValid=!0,this._nclicks=0,this._downEvents=[],this._clickStart=0,this._maxDownTime=250,this._maxInterval=300,this._posThreshold=24,this._movementThreshold=24,this._currentCursorPosition=new s.Vector3,this._startCursorPosition=new s.Vector3,this._grid=null,this._gridPosition=new s.Vector3,this._gizmos=new s.Group,this._curvePts=128,this._timeStart=-1,this._animationId=-1,this.focusAnimationTime=500,this._timePrev=0,this._timeCurrent=0,this._anglePrev=0,this._angleCurrent=0,this._cursorPosPrev=new s.Vector3,this._cursorPosCurr=new s.Vector3,this._wPrev=0,this._wCurr=0,this.adjustNearFar=!1,this.scaleFactor=1.1,this.dampingFactor=25,this.wMax=20,this.enableAnimations=!0,this.enableGrid=!1,this.cursorZoom=!1,this.minFov=5,this.maxFov=90,this.enabled=!0,this.enablePan=!0,this.enableRotate=!0,this.enableZoom=!0,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.target=new s.Vector3(0,0,0),this._currentTarget=new s.Vector3(0,0,0),this._tbRadius=1,this._state=a.IDLE,this.setCamera(e),this.scene&&this.scene.add(this._gizmos),this._devPxRatio=window.devicePixelRatio,this.initializeMouseActions(),this.domElement&&this.connect(this.domElement),window.addEventListener("resize",this.onWindowResize)}applyTransformMatrix(e){if((null==e?void 0:e.camera)&&this.camera&&(this._m4_1.copy(this._cameraMatrixState).premultiply(e.camera),this._m4_1.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.updateMatrix(),this._state!=a.ROTATE&&this._state!=a.ZROTATE&&this._state!=a.ANIMATION_ROTATE||this.camera.up.copy(this._upState).applyQuaternion(this.camera.quaternion)),(null==e?void 0:e.gizmos)&&(this._m4_1.copy(this._gizmoMatrixState).premultiply(e.gizmos),this._m4_1.decompose(this._gizmos.position,this._gizmos.quaternion,this._gizmos.scale),this._gizmos.updateMatrix()),(this._state==a.SCALE||this._state==a.FOCUS||this._state==a.ANIMATION_FOCUS)&&this.camera){const e=this.calculateTbRadius(this.camera);if(void 0!==e&&(this._tbRadius=e),this.adjustNearFar){const e=this.camera.position.distanceTo(this._gizmos.position),t=new s.Box3;t.setFromObject(this._gizmos);const n=new s.Sphere;t.getBoundingSphere(n);const r=Math.max(this._nearPos0,n.radius+n.center.length()),i=e-this._initialNear,a=Math.min(r,i);this.camera.near=e-a;const o=Math.min(this._farPos0,-n.radius+n.center.length()),l=e-this._initialFar,c=Math.min(o,l);this.camera.far=e-c,this.camera.updateProjectionMatrix()}else{let e=!1;this.camera.near!=this._initialNear&&(this.camera.near=this._initialNear,e=!0),this.camera.far!=this._initialFar&&(this.camera.far=this._initialFar,e=!0),e&&this.camera.updateProjectionMatrix()}}}setGizmosVisible(e){this._gizmos.visible=e,this.dispatchEvent(h)}setTransformationMatrices(e=null,t=null){e?c.camera?c.camera.copy(e):c.camera=e.clone():c.camera=null,t?c.gizmos?c.gizmos.copy(t):c.gizmos=t.clone():c.gizmos=null}}t.ArcballControls=p},97573:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);class a extends s.EventDispatcher{constructor(e){super(),i(this,"object"),i(this,"changeEvent",{type:"change"}),i(this,"EPS",1e-6),i(this,"enabled",!0),i(this,"deviceOrientation",{alpha:0,beta:0,gamma:0}),i(this,"screenOrientation",0),i(this,"alphaOffset",0),i(this,"onDeviceOrientationChangeEvent",(e=>{this.deviceOrientation=e})),i(this,"onScreenOrientationChangeEvent",(()=>{this.screenOrientation=window.orientation||0})),i(this,"zee",new s.Vector3(0,0,1)),i(this,"euler",new s.Euler),i(this,"q0",new s.Quaternion),i(this,"q1",new s.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5))),i(this,"setObjectQuaternion",((e,t,n,r,i)=>{this.euler.set(n,t,-r,"YXZ"),e.setFromEuler(this.euler),e.multiply(this.q1),e.multiply(this.q0.setFromAxisAngle(this.zee,-i))})),i(this,"connect",(()=>{this.onScreenOrientationChangeEvent(),void 0!==window.DeviceOrientationEvent&&"function"==typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then((e=>{"granted"==e&&(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent))})).catch((e=>{console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",e)})):(window.addEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.addEventListener("deviceorientation",this.onDeviceOrientationChangeEvent)),this.enabled=!0})),i(this,"disconnect",(()=>{window.removeEventListener("orientationchange",this.onScreenOrientationChangeEvent),window.removeEventListener("deviceorientation",this.onDeviceOrientationChangeEvent),this.enabled=!1})),i(this,"lastQuaternion",new s.Quaternion),i(this,"update",(()=>{if(!1===this.enabled)return;const e=this.deviceOrientation;if(e){const t=e.alpha?s.MathUtils.degToRad(e.alpha)+this.alphaOffset:0,n=e.beta?s.MathUtils.degToRad(e.beta):0,r=e.gamma?s.MathUtils.degToRad(e.gamma):0,i=this.screenOrientation?s.MathUtils.degToRad(this.screenOrientation):0;this.setObjectQuaternion(this.object.quaternion,t,n,r,i),8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS&&(this.lastQuaternion.copy(this.object.quaternion),this.dispatchEvent(this.changeEvent))}})),i(this,"dispose",(()=>this.disconnect())),this.object=e,this.object.rotation.reorder("YXZ"),this.connect()}}t.DeviceOrientationControls=a},45830:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);class a extends s.EventDispatcher{constructor(e,t,n){super(),i(this,"enabled",!0),i(this,"transformGroup",!1),i(this,"_objects"),i(this,"_camera"),i(this,"_domElement"),i(this,"_plane",new s.Plane),i(this,"_raycaster",new s.Raycaster),i(this,"_mouse",new s.Vector2),i(this,"_offset",new s.Vector3),i(this,"_intersection",new s.Vector3),i(this,"_worldPosition",new s.Vector3),i(this,"_inverseMatrix",new s.Matrix4),i(this,"_intersections",[]),i(this,"_selected",null),i(this,"_hovered",null),i(this,"activate",(()=>{this._domElement.addEventListener("pointermove",this.onPointerMove),this._domElement.addEventListener("pointerdown",this.onPointerDown),this._domElement.addEventListener("pointerup",this.onPointerCancel),this._domElement.addEventListener("pointerleave",this.onPointerCancel),this._domElement.addEventListener("touchmove",this.onTouchMove),this._domElement.addEventListener("touchstart",this.onTouchStart),this._domElement.addEventListener("touchend",this.onTouchEnd)})),i(this,"deactivate",(()=>{this._domElement.removeEventListener("pointermove",this.onPointerMove),this._domElement.removeEventListener("pointerdown",this.onPointerDown),this._domElement.removeEventListener("pointerup",this.onPointerCancel),this._domElement.removeEventListener("pointerleave",this.onPointerCancel),this._domElement.removeEventListener("touchmove",this.onTouchMove),this._domElement.removeEventListener("touchstart",this.onTouchStart),this._domElement.removeEventListener("touchend",this.onTouchEnd),this._domElement.style.cursor=""})),i(this,"dispose",(()=>this.deactivate())),i(this,"getObjects",(()=>this._objects)),i(this,"getRaycaster",(()=>this._raycaster)),i(this,"onMouseMove",(e=>{const t=this._domElement.getBoundingClientRect();if(this._mouse.x=(e.clientX-t.left)/t.width*2-1,this._mouse.y=-(e.clientY-t.top)/t.height*2+1,this._raycaster.setFromCamera(this._mouse,this._camera),this._selected&&this.enabled)return this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.position.copy(this._intersection.sub(this._offset).applyMatrix4(this._inverseMatrix)),void this.dispatchEvent({type:"drag",object:this._selected});if(this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0){const e=this._intersections[0].object;this._plane.setFromNormalAndCoplanarPoint(this._camera.getWorldDirection(this._plane.normal),this._worldPosition.setFromMatrixPosition(e.matrixWorld)),this._hovered!==e&&(this.dispatchEvent({type:"hoveron",object:e}),this._domElement.style.cursor="pointer",this._hovered=e)}else null!==this._hovered&&(this.dispatchEvent({type:"hoveroff",object:this._hovered}),this._domElement.style.cursor="auto",this._hovered=null)})),i(this,"onMouseDown",(()=>{this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0&&(this._selected=!0===this.transformGroup?this._objects[0]:this._intersections[0].object,this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.parent&&(this._inverseMatrix.copy(this._selected.parent.matrixWorld).invert(),this._offset.copy(this._intersection).sub(this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld))),this._domElement.style.cursor="move",this.dispatchEvent({type:"dragstart",object:this._selected}))})),i(this,"onMouseCancel",(()=>{this._selected&&(this.dispatchEvent({type:"dragend",object:this._selected}),this._selected=null),this._domElement.style.cursor=this._hovered?"pointer":"auto"})),i(this,"onPointerMove",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseMove(e)}})),i(this,"onPointerDown",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseDown()}})),i(this,"onPointerCancel",(e=>{switch(e.pointerType){case"mouse":case"pen":this.onMouseCancel()}})),i(this,"onTouchMove",(e=>{e.preventDefault();const t=e.changedTouches[0],n=this._domElement.getBoundingClientRect();if(this._mouse.x=(t.clientX-n.left)/n.width*2-1,this._mouse.y=-(t.clientY-n.top)/n.height*2+1,this._raycaster.setFromCamera(this._mouse,this._camera),this._selected&&this.enabled)return this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.position.copy(this._intersection.sub(this._offset).applyMatrix4(this._inverseMatrix)),void this.dispatchEvent({type:"drag",object:this._selected})})),i(this,"onTouchStart",(e=>{e.preventDefault();const t=e.changedTouches[0],n=this._domElement.getBoundingClientRect();this._mouse.x=(t.clientX-n.left)/n.width*2-1,this._mouse.y=-(t.clientY-n.top)/n.height*2+1,this._intersections.length=0,this._raycaster.setFromCamera(this._mouse,this._camera),this._raycaster.intersectObjects(this._objects,!0,this._intersections),this._intersections.length>0&&(this._selected=!0===this.transformGroup?this._objects[0]:this._intersections[0].object,this._plane.setFromNormalAndCoplanarPoint(this._camera.getWorldDirection(this._plane.normal),this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld)),this._raycaster.ray.intersectPlane(this._plane,this._intersection)&&this._selected.parent&&(this._inverseMatrix.copy(this._selected.parent.matrixWorld).invert(),this._offset.copy(this._intersection).sub(this._worldPosition.setFromMatrixPosition(this._selected.matrixWorld))),this._domElement.style.cursor="move",this.dispatchEvent({type:"dragstart",object:this._selected}))})),i(this,"onTouchEnd",(e=>{e.preventDefault(),this._selected&&(this.dispatchEvent({type:"dragend",object:this._selected}),this._selected=null),this._domElement.style.cursor="auto"})),this._objects=e,this._camera=t,this._domElement=n,this.activate()}}t.DragControls=a},53667:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=new s.Vector3;class o extends s.EventDispatcher{constructor(e,t){super(),i(this,"object"),i(this,"domElement"),i(this,"enabled",!0),i(this,"movementSpeed",1),i(this,"lookSpeed",.005),i(this,"lookVertical",!0),i(this,"autoForward",!1),i(this,"activeLook",!0),i(this,"heightSpeed",!1),i(this,"heightCoef",1),i(this,"heightMin",0),i(this,"heightMax",1),i(this,"constrainVertical",!1),i(this,"verticalMin",0),i(this,"verticalMax",Math.PI),i(this,"mouseDragOn",!1),i(this,"autoSpeedFactor",0),i(this,"mouseX",0),i(this,"mouseY",0),i(this,"moveForward",!1),i(this,"moveBackward",!1),i(this,"moveLeft",!1),i(this,"moveRight",!1),i(this,"moveUp",!1),i(this,"moveDown",!1),i(this,"viewHalfX",0),i(this,"viewHalfY",0),i(this,"lat",0),i(this,"lon",0),i(this,"lookDirection",new s.Vector3),i(this,"spherical",new s.Spherical),i(this,"target",new s.Vector3),i(this,"connect",(e=>{e.setAttribute("tabindex","-1"),e.style.touchAction="none",e.addEventListener("contextmenu",this.contextmenu),e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),this.domElement=e,window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.handleResize()})),i(this,"dispose",(()=>{var e,t,n,r;null==(e=this.domElement)||e.removeEventListener("contextmenu",this.contextmenu),null==(t=this.domElement)||t.removeEventListener("mousedown",this.onMouseDown),null==(n=this.domElement)||n.removeEventListener("mousemove",this.onMouseMove),null==(r=this.domElement)||r.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)})),i(this,"handleResize",(()=>{this.domElement&&(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)})),i(this,"onMouseDown",(e=>{var t;if(null==(t=this.domElement)||t.focus(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0})),i(this,"onMouseUp",(e=>{if(this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1})),i(this,"onMouseMove",(e=>{this.domElement&&(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)})),i(this,"onKeyDown",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!0;break;case"ArrowLeft":case"KeyA":this.moveLeft=!0;break;case"ArrowDown":case"KeyS":this.moveBackward=!0;break;case"ArrowRight":case"KeyD":this.moveRight=!0;break;case"KeyR":this.moveUp=!0;break;case"KeyF":this.moveDown=!0}})),i(this,"onKeyUp",(e=>{switch(e.code){case"ArrowUp":case"KeyW":this.moveForward=!1;break;case"ArrowLeft":case"KeyA":this.moveLeft=!1;break;case"ArrowDown":case"KeyS":this.moveBackward=!1;break;case"ArrowRight":case"KeyD":this.moveRight=!1;break;case"KeyR":this.moveUp=!1;break;case"KeyF":this.moveDown=!1}})),i(this,"lookAt",((e,t,n)=>(e instanceof s.Vector3?this.target.copy(e):t&&n&&this.target.set(e,t,n),this.object.lookAt(this.target),this.setOrientation(),this))),i(this,"update",(e=>{if(!this.enabled)return;if(this.heightSpeed){const t=s.MathUtils.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;const t=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(t+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(t),this.moveLeft&&this.object.translateX(-t),this.moveRight&&this.object.translateX(t),this.moveUp&&this.object.translateY(t),this.moveDown&&this.object.translateY(-t);let n=e*this.lookSpeed;this.activeLook||(n=0);let r=1;this.constrainVertical&&(r=Math.PI/(this.verticalMax-this.verticalMin)),this.lon-=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*r),this.lat=Math.max(-85,Math.min(85,this.lat));let i=s.MathUtils.degToRad(90-this.lat);const o=s.MathUtils.degToRad(this.lon);this.constrainVertical&&(i=s.MathUtils.mapLinear(i,0,Math.PI,this.verticalMin,this.verticalMax));const l=this.object.position;a.setFromSphericalCoords(1,i,o).add(l),this.object.lookAt(a)})),i(this,"contextmenu",(e=>e.preventDefault())),i(this,"setOrientation",(()=>{this.lookDirection.set(0,0,-1).applyQuaternion(this.object.quaternion),this.spherical.setFromVector3(this.lookDirection),this.lat=90-s.MathUtils.radToDeg(this.spherical.phi),this.lon=s.MathUtils.radToDeg(this.spherical.theta)})),this.object=e,this.domElement=t,this.setOrientation(),t&&this.connect(t)}}t.FirstPersonControls=o},49888:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);function a(e){e.preventDefault()}class o extends s.EventDispatcher{constructor(e,t){super(),i(this,"object"),i(this,"domElement",null),i(this,"movementSpeed",1),i(this,"rollSpeed",.005),i(this,"dragToLook",!1),i(this,"autoForward",!1),i(this,"changeEvent",{type:"change"}),i(this,"EPS",1e-6),i(this,"tmpQuaternion",new s.Quaternion),i(this,"mouseStatus",0),i(this,"movementSpeedMultiplier",1),i(this,"moveState",{up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0}),i(this,"moveVector",new s.Vector3(0,0,0)),i(this,"rotationVector",new s.Vector3(0,0,0)),i(this,"keydown",(e=>{if(!e.altKey){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}})),i(this,"keyup",(e=>{switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()})),i(this,"pointerdown",(e=>{if(this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}})),i(this,"pointermove",(e=>{if(!this.dragToLook||this.mouseStatus>0){const t=this.getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this.updateRotationVector()}})),i(this,"pointerup",(e=>{if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()})),i(this,"lastQuaternion",new s.Quaternion),i(this,"lastPosition",new s.Vector3),i(this,"update",(e=>{const t=e*this.movementSpeed,n=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*n,this.rotationVector.y*n,this.rotationVector.z*n,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS)&&(this.dispatchEvent(this.changeEvent),this.lastQuaternion.copy(this.object.quaternion),this.lastPosition.copy(this.object.position))})),i(this,"updateMovementVector",(()=>{const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back})),i(this,"updateRotationVector",(()=>{this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft})),i(this,"getContainerDimensions",(()=>this.domElement==document||this.domElement instanceof Document?{size:[window.innerWidth,window.innerHeight],offset:[0,0]}:{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]})),i(this,"connect",(e=>{this.domElement=e,!e||e instanceof Document||e.setAttribute("tabindex",-1),this.domElement.addEventListener("contextmenu",a),this.domElement.addEventListener("pointermove",this.pointermove),this.domElement.addEventListener("pointerdown",this.pointerdown),this.domElement.addEventListener("pointerup",this.pointerup),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup)})),i(this,"dispose",(()=>{this.domElement.removeEventListener("contextmenu",a),this.domElement.removeEventListener("pointermove",this.pointermove),this.domElement.removeEventListener("pointerdown",this.pointerdown),this.domElement.removeEventListener("pointerup",this.pointerup),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup)})),this.object=e,void 0!==t&&this.connect(t),this.updateMovementVector(),this.updateRotationVector()}}t.FlyControls=o},78122:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=new s.Ray,o=new s.Plane,l=Math.cos(Math.PI/180*70),c=(e,t)=>(e%t+t)%t;class h extends s.EventDispatcher{constructor(e,t){super(),i(this,"object"),i(this,"domElement"),i(this,"enabled",!0),i(this,"target",new s.Vector3),i(this,"minDistance",0),i(this,"maxDistance",1/0),i(this,"minZoom",0),i(this,"maxZoom",1/0),i(this,"minPolarAngle",0),i(this,"maxPolarAngle",Math.PI),i(this,"minAzimuthAngle",-1/0),i(this,"maxAzimuthAngle",1/0),i(this,"enableDamping",!1),i(this,"dampingFactor",.05),i(this,"enableZoom",!0),i(this,"zoomSpeed",1),i(this,"enableRotate",!0),i(this,"rotateSpeed",1),i(this,"enablePan",!0),i(this,"panSpeed",1),i(this,"screenSpacePanning",!0),i(this,"keyPanSpeed",7),i(this,"zoomToCursor",!1),i(this,"autoRotate",!1),i(this,"autoRotateSpeed",2),i(this,"reverseOrbit",!1),i(this,"reverseHorizontalOrbit",!1),i(this,"reverseVerticalOrbit",!1),i(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),i(this,"mouseButtons",{LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN}),i(this,"touches",{ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN}),i(this,"target0"),i(this,"position0"),i(this,"zoom0"),i(this,"_domElementKeyEvents",null),i(this,"getPolarAngle"),i(this,"getAzimuthalAngle"),i(this,"setPolarAngle"),i(this,"setAzimuthalAngle"),i(this,"getDistance"),i(this,"listenToKeyEvents"),i(this,"stopListenToKeyEvents"),i(this,"saveState"),i(this,"reset"),i(this,"update"),i(this,"connect"),i(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>m.phi,this.getAzimuthalAngle=()=>m.theta,this.setPolarAngle=e=>{let t=c(e,2*Math.PI),r=m.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),g.phi=t-r,n.update()},this.setAzimuthalAngle=e=>{let t=c(e,2*Math.PI),r=m.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),g.theta=t-r,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",ne),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),p=d.NONE},this.update=(()=>{const t=new s.Vector3,i=new s.Vector3(0,1,0),c=(new s.Quaternion).setFromUnitVectors(e.up,i),h=c.clone().invert(),u=new s.Vector3,y=new s.Quaternion,x=2*Math.PI;return function(){const b=n.object.position;c.setFromUnitVectors(e.up,i),h.copy(c).invert(),t.copy(b).sub(n.target),t.applyQuaternion(c),m.setFromVector3(t),n.autoRotate&&p===d.NONE&&L(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(m.theta+=g.theta*n.dampingFactor,m.phi+=g.phi*n.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi);let E=n.minAzimuthAngle,_=n.maxAzimuthAngle;isFinite(E)&&isFinite(_)&&(E<-Math.PI?E+=x:E>Math.PI&&(E-=x),_<-Math.PI?_+=x:_>Math.PI&&(_-=x),m.theta=E<=_?Math.max(E,Math.min(_,m.theta)):m.theta>(E+_)/2?Math.max(E,m.theta):Math.min(_,m.theta)),m.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,m.phi)),m.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(v,n.dampingFactor):n.target.add(v),n.zoomToCursor&&B||n.object.isOrthographicCamera?m.radius=Q(m.radius):m.radius=Q(m.radius*A),t.setFromSpherical(m),t.applyQuaternion(h),b.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(g.theta*=1-n.dampingFactor,g.phi*=1-n.dampingFactor,v.multiplyScalar(1-n.dampingFactor)):(g.set(0,0,0),v.set(0,0,0));let S=!1;if(n.zoomToCursor&&B){let r=null;if(n.object instanceof s.PerspectiveCamera&&n.object.isPerspectiveCamera){const e=t.length();r=Q(e*A);const i=e-r;n.object.position.addScaledVector(T,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const e=new s.Vector3(I.x,I.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/A)),n.object.updateProjectionMatrix(),S=!0;const i=new s.Vector3(I.x,I.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(a.origin.copy(n.object.position),a.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(a.direction))<l?e.lookAt(n.target):(o.setFromNormalAndCoplanarPoint(n.object.up,n.target),a.intersectPlane(o,n.target))))}else n.object instanceof s.OrthographicCamera&&n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/A)),n.object.updateProjectionMatrix(),S=!0);return A=1,B=!1,!!(S||u.distanceToSquared(n.object.position)>f||8*(1-y.dot(n.object.quaternion))>f)&&(n.dispatchEvent(r),u.copy(n.object.position),y.copy(n.object.quaternion),S=!1,!0)}})(),this.connect=e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",re),n.domElement.addEventListener("pointerdown",J),n.domElement.addEventListener("pointercancel",ee),n.domElement.addEventListener("wheel",te)},this.dispose=()=>{var e,t,r,i,s,a;null==(e=n.domElement)||e.removeEventListener("contextmenu",re),null==(t=n.domElement)||t.removeEventListener("pointerdown",J),null==(r=n.domElement)||r.removeEventListener("pointercancel",ee),null==(i=n.domElement)||i.removeEventListener("wheel",te),null==(s=n.domElement)||s.ownerDocument.removeEventListener("pointermove",Z),null==(a=n.domElement)||a.ownerDocument.removeEventListener("pointerup",$),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",ne)};const n=this,r={type:"change"},h={type:"start"},u={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let p=d.NONE;const f=1e-6,m=new s.Spherical,g=new s.Spherical;let A=1;const v=new s.Vector3,y=new s.Vector2,x=new s.Vector2,b=new s.Vector2,E=new s.Vector2,_=new s.Vector2,S=new s.Vector2,w=new s.Vector2,M=new s.Vector2,C=new s.Vector2,T=new s.Vector3,I=new s.Vector2;let B=!1;const R=[],P={};function D(){return Math.pow(.95,n.zoomSpeed)}function L(e){n.reverseOrbit||n.reverseHorizontalOrbit?g.theta+=e:g.theta-=e}function F(e){n.reverseOrbit||n.reverseVerticalOrbit?g.phi+=e:g.phi-=e}const U=(()=>{const e=new s.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),v.add(e)}})(),O=(()=>{const e=new s.Vector3;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),v.add(e)}})(),N=(()=>{const e=new s.Vector3;return function(t,r){const i=n.domElement;if(i&&n.object instanceof s.PerspectiveCamera&&n.object.isPerspectiveCamera){const s=n.object.position;e.copy(s).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),U(2*t*a/i.clientHeight,n.object.matrix),O(2*r*a/i.clientHeight,n.object.matrix)}else i&&n.object instanceof s.OrthographicCamera&&n.object.isOrthographicCamera?(U(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),O(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function k(e){n.object instanceof s.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof s.OrthographicCamera&&n.object.isOrthographicCamera?A/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function G(e){n.object instanceof s.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof s.OrthographicCamera&&n.object.isOrthographicCamera?A*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function z(e){if(!n.zoomToCursor||!n.domElement)return;B=!0;const t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,s=t.width,a=t.height;I.x=r/s*2-1,I.y=-i/a*2+1,T.set(I.x,I.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function V(e){y.set(e.clientX,e.clientY)}function H(e){E.set(e.clientX,e.clientY)}function j(){if(1==R.length)y.set(R[0].pageX,R[0].pageY);else{const e=.5*(R[0].pageX+R[1].pageX),t=.5*(R[0].pageY+R[1].pageY);y.set(e,t)}}function W(){if(1==R.length)E.set(R[0].pageX,R[0].pageY);else{const e=.5*(R[0].pageX+R[1].pageX),t=.5*(R[0].pageY+R[1].pageY);E.set(e,t)}}function X(){const e=R[0].pageX-R[1].pageX,t=R[0].pageY-R[1].pageY,n=Math.sqrt(e*e+t*t);w.set(0,n)}function Y(e){if(1==R.length)x.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);x.set(n,r)}b.subVectors(x,y).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(L(2*Math.PI*b.x/t.clientHeight),F(2*Math.PI*b.y/t.clientHeight)),y.copy(x)}function q(e){if(1==R.length)_.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);_.set(n,r)}S.subVectors(_,E).multiplyScalar(n.panSpeed),N(S.x,S.y),E.copy(_)}function K(e){const t=ae(e),r=e.pageX-t.x,i=e.pageY-t.y,s=Math.sqrt(r*r+i*i);M.set(0,s),C.set(0,Math.pow(M.y/w.y,n.zoomSpeed)),k(C.y),w.copy(M)}function J(e){var t,r;!1!==n.enabled&&(0===R.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",Z),null==(r=n.domElement)||r.ownerDocument.addEventListener("pointerup",$)),function(e){R.push(e)}(e),"touch"===e.pointerType?function(e){switch(se(e),R.length){case 1:switch(n.touches.ONE){case s.TOUCH.ROTATE:if(!1===n.enableRotate)return;j(),p=d.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(!1===n.enablePan)return;W(),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(n.touches.TWO){case s.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&X(),n.enablePan&&W(),p=d.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&X(),n.enableRotate&&j(),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}p!==d.NONE&&n.dispatchEvent(h)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(!1===n.enableZoom)return;!function(e){z(e),w.set(e.clientX,e.clientY)}(e),p=d.DOLLY;break;case s.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;H(e),p=d.PAN}else{if(!1===n.enableRotate)return;V(e),p=d.ROTATE}break;case s.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;V(e),p=d.ROTATE}else{if(!1===n.enablePan)return;H(e),p=d.PAN}break;default:p=d.NONE}p!==d.NONE&&n.dispatchEvent(h)}(e))}function Z(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(se(e),p){case d.TOUCH_ROTATE:if(!1===n.enableRotate)return;Y(e),n.update();break;case d.TOUCH_PAN:if(!1===n.enablePan)return;q(e),n.update();break;case d.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&K(e),n.enablePan&&q(e)}(e),n.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&K(e),n.enableRotate&&Y(e)}(e),n.update();break;default:p=d.NONE}}(e):function(e){if(!1===n.enabled)return;switch(p){case d.ROTATE:if(!1===n.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),b.subVectors(x,y).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(L(2*Math.PI*b.x/t.clientHeight),F(2*Math.PI*b.y/t.clientHeight)),y.copy(x),n.update()}(e);break;case d.DOLLY:if(!1===n.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),C.subVectors(M,w),C.y>0?k(D()):C.y<0&&G(D()),w.copy(M),n.update()}(e);break;case d.PAN:if(!1===n.enablePan)return;!function(e){_.set(e.clientX,e.clientY),S.subVectors(_,E).multiplyScalar(n.panSpeed),N(S.x,S.y),E.copy(_),n.update()}(e)}}(e))}function $(e){var t,r,i;ie(e),0===R.length&&(null==(t=n.domElement)||t.releasePointerCapture(e.pointerId),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",Z),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",$)),n.dispatchEvent(u),p=d.NONE}function ee(e){ie(e)}function te(e){!1===n.enabled||!1===n.enableZoom||p!==d.NONE&&p!==d.ROTATE||(e.preventDefault(),n.dispatchEvent(h),function(e){z(e),e.deltaY<0?G(D()):e.deltaY>0&&k(D()),n.update()}(e),n.dispatchEvent(u))}function ne(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:N(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:N(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:N(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:N(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function re(e){!1!==n.enabled&&e.preventDefault()}function ie(e){delete P[e.pointerId];for(let t=0;t<R.length;t++)if(R[t].pointerId==e.pointerId)return void R.splice(t,1)}function se(e){let t=P[e.pointerId];void 0===t&&(t=new s.Vector2,P[e.pointerId]=t),t.set(e.pageX,e.pageY)}function ae(e){const t=e.pointerId===R[0].pointerId?R[1]:R[0];return P[t.pointerId]}void 0!==t&&this.connect(t),this.update()}}t.MapControls=class extends h{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=s.MOUSE.PAN,this.mouseButtons.RIGHT=s.MOUSE.ROTATE,this.touches.ONE=s.TOUCH.PAN,this.touches.TWO=s.TOUCH.DOLLY_ROTATE}},t.OrbitControls=h},17412:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=new s.Euler(0,0,0,"YXZ"),o=new s.Vector3,l={type:"change"},c={type:"lock"},h={type:"unlock"},u=Math.PI/2;class d extends s.EventDispatcher{constructor(e,t){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",(e=>{if(!this.domElement||!1===this.isLocked)return;const t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;a.setFromQuaternion(this.camera.quaternion),a.y-=.002*t*this.pointerSpeed,a.x-=.002*n*this.pointerSpeed,a.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,a.x)),this.camera.quaternion.setFromEuler(a),this.dispatchEvent(l)})),i(this,"onPointerlockChange",(()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(c),this.isLocked=!0):(this.dispatchEvent(h),this.isLocked=!1))})),i(this,"onPointerlockError",(()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")})),i(this,"connect",(e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))})),i(this,"disconnect",(()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))})),i(this,"dispose",(()=>{this.disconnect()})),i(this,"getObject",(()=>this.camera)),i(this,"direction",new s.Vector3(0,0,-1)),i(this,"getDirection",(e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion))),i(this,"moveForward",(e=>{o.setFromMatrixColumn(this.camera.matrix,0),o.crossVectors(this.camera.up,o),this.camera.position.addScaledVector(o,e)})),i(this,"moveRight",(e=>{o.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(o,e)})),i(this,"lock",(()=>{this.domElement&&this.domElement.requestPointerLock()})),i(this,"unlock",(()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()})),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}t.PointerLockControls=d},46603:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);class a extends s.EventDispatcher{constructor(e,t){super(),i(this,"enabled",!0),i(this,"screen",{left:0,top:0,width:0,height:0}),i(this,"rotateSpeed",1),i(this,"zoomSpeed",1.2),i(this,"panSpeed",.3),i(this,"noRotate",!1),i(this,"noZoom",!1),i(this,"noPan",!1),i(this,"staticMoving",!1),i(this,"dynamicDampingFactor",.2),i(this,"minDistance",0),i(this,"maxDistance",1/0),i(this,"keys",["KeyA","KeyS","KeyD"]),i(this,"mouseButtons",{LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN}),i(this,"object"),i(this,"domElement"),i(this,"cursorZoom",!1),i(this,"target",new s.Vector3),i(this,"mousePosition",new s.Vector2),i(this,"STATE",{NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4}),i(this,"EPS",1e-6),i(this,"lastZoom",1),i(this,"lastPosition",new s.Vector3),i(this,"cursorVector",new s.Vector3),i(this,"targetVector",new s.Vector3),i(this,"_state",this.STATE.NONE),i(this,"_keyState",this.STATE.NONE),i(this,"_eye",new s.Vector3),i(this,"_movePrev",new s.Vector2),i(this,"_moveCurr",new s.Vector2),i(this,"_lastAxis",new s.Vector3),i(this,"_lastAngle",0),i(this,"_zoomStart",new s.Vector2),i(this,"_zoomEnd",new s.Vector2),i(this,"_touchZoomDistanceStart",0),i(this,"_touchZoomDistanceEnd",0),i(this,"_panStart",new s.Vector2),i(this,"_panEnd",new s.Vector2),i(this,"target0"),i(this,"position0"),i(this,"up0"),i(this,"zoom0"),i(this,"changeEvent",{type:"change"}),i(this,"startEvent",{type:"start"}),i(this,"endEvent",{type:"end"}),i(this,"onScreenVector",new s.Vector2),i(this,"getMouseOnScreen",((e,t)=>(this.onScreenVector.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),this.onScreenVector))),i(this,"onCircleVector",new s.Vector2),i(this,"getMouseOnCircle",((e,t)=>(this.onCircleVector.set((e-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-t))/this.screen.width),this.onCircleVector))),i(this,"axis",new s.Vector3),i(this,"quaternion",new s.Quaternion),i(this,"eyeDirection",new s.Vector3),i(this,"objectUpDirection",new s.Vector3),i(this,"objectSidewaysDirection",new s.Vector3),i(this,"moveDirection",new s.Vector3),i(this,"angle",0),i(this,"rotateCamera",(()=>{this.moveDirection.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0),this.angle=this.moveDirection.length(),this.angle?(this._eye.copy(this.object.position).sub(this.target),this.eyeDirection.copy(this._eye).normalize(),this.objectUpDirection.copy(this.object.up).normalize(),this.objectSidewaysDirection.crossVectors(this.objectUpDirection,this.eyeDirection).normalize(),this.objectUpDirection.setLength(this._moveCurr.y-this._movePrev.y),this.objectSidewaysDirection.setLength(this._moveCurr.x-this._movePrev.x),this.moveDirection.copy(this.objectUpDirection.add(this.objectSidewaysDirection)),this.axis.crossVectors(this.moveDirection,this._eye).normalize(),this.angle*=this.rotateSpeed,this.quaternion.setFromAxisAngle(this.axis,this.angle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion),this._lastAxis.copy(this.axis),this._lastAngle=this.angle):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),this.quaternion.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(this.quaternion),this.object.up.applyQuaternion(this.quaternion)),this._movePrev.copy(this._moveCurr)})),i(this,"zoomCamera",(()=>{let e;if(this._state===this.STATE.TOUCH_ZOOM_PAN)e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom/=e,this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type");else{if(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,Math.abs(e-1)>this.EPS&&e>0&&(this.object.isPerspectiveCamera?(e>1&&this._eye.length()>=this.maxDistance-this.EPS&&(e=1),this._eye.multiplyScalar(e)):this.object.isOrthographicCamera?(e>1&&this.object.zoom<this.maxDistance*this.maxDistance&&(e=1),this.object.zoom/=e):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor,this.cursorZoom){this.targetVector.copy(this.target).project(this.object);let t=this.cursorVector.set(this.mousePosition.x,this.mousePosition.y,this.targetVector.z).unproject(this.object);this.target.lerpVectors(t,this.target,e)}this.object.isOrthographicCamera&&this.object.updateProjectionMatrix()}})),i(this,"mouseChange",new s.Vector2),i(this,"objectUp",new s.Vector3),i(this,"pan",new s.Vector3),i(this,"panCamera",(()=>{if(this.domElement&&(this.mouseChange.copy(this._panEnd).sub(this._panStart),this.mouseChange.lengthSq()>this.EPS)){if(this.object.isOrthographicCamera){const e=this.object,t=(e.right-e.left)/this.object.zoom,n=(e.top-e.bottom)/this.object.zoom;this.mouseChange.x*=t,this.mouseChange.y*=n}else this.mouseChange.multiplyScalar(this._eye.length()*this.panSpeed);this.pan.copy(this._eye).cross(this.object.up).setLength(this.mouseChange.x),this.pan.add(this.objectUp.copy(this.object.up).setLength(this.mouseChange.y)),this.object.position.add(this.pan),this.target.add(this.pan),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(this.mouseChange.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}})),i(this,"checkDistances",(()=>{this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))})),i(this,"handleResize",(()=>{if(!this.domElement)return;const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height})),i(this,"update",(()=>{this._eye.subVectors(this.object.position,this.target),this.noRotate||this.rotateCamera(),this.noZoom||this.zoomCamera(),this.noPan||this.panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this.checkDistances(),this.object.lookAt(this.target),this.lastPosition.distanceToSquared(this.object.position)>this.EPS&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this.lastPosition.distanceToSquared(this.object.position)>this.EPS||this.lastZoom!==this.object.zoom)&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")})),i(this,"reset",(()=>{this._state=this.STATE.NONE,this._keyState=this.STATE.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.up.copy(this.up0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastZoom=this.object.zoom})),i(this,"keydown",(e=>{!1!==this.enabled&&(window.removeEventListener("keydown",this.keydown),this._keyState===this.STATE.NONE&&(e.code!==this.keys[this.STATE.ROTATE]||this.noRotate?e.code!==this.keys[this.STATE.ZOOM]||this.noZoom?e.code!==this.keys[this.STATE.PAN]||this.noPan||(this._keyState=this.STATE.PAN):this._keyState=this.STATE.ZOOM:this._keyState=this.STATE.ROTATE))})),i(this,"onPointerDown",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseDown(e)}})),i(this,"onPointerMove",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseMove(e)}})),i(this,"onPointerUp",(e=>{if(!1!==this.enabled)switch(e.pointerType){case"mouse":case"pen":this.onMouseUp()}})),i(this,"keyup",(()=>{!1!==this.enabled&&(this._keyState=this.STATE.NONE,window.addEventListener("keydown",this.keydown))})),i(this,"onMouseDown",(e=>{if(!this.domElement)return;if(this._state===this.STATE.NONE)switch(e.button){case this.mouseButtons.LEFT:this._state=this.STATE.ROTATE;break;case this.mouseButtons.MIDDLE:this._state=this.STATE.ZOOM;break;case this.mouseButtons.RIGHT:this._state=this.STATE.PAN;break;default:this._state=this.STATE.NONE}const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||(this._panStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this.getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.startEvent)})),i(this,"onMouseMove",(e=>{if(!1===this.enabled)return;const t=this._keyState!==this.STATE.NONE?this._keyState:this._state;t!==this.STATE.ROTATE||this.noRotate?t!==this.STATE.ZOOM||this.noZoom?t!==this.STATE.PAN||this.noPan||this._panEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):this._zoomEnd.copy(this.getMouseOnScreen(e.pageX,e.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.pageX,e.pageY)))})),i(this,"onMouseUp",(()=>{this.domElement&&!1!==this.enabled&&(this._state=this.STATE.NONE,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),this.dispatchEvent(this.endEvent))})),i(this,"mousewheel",(e=>{if(!1!==this.enabled&&!0!==this.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=.025*e.deltaY;break;case 1:this._zoomStart.y-=.01*e.deltaY;break;default:this._zoomStart.y-=25e-5*e.deltaY}this.mousePosition.x=e.offsetX/this.screen.width*2-1,this.mousePosition.y=-e.offsetY/this.screen.height*2+1,this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}})),i(this,"touchstart",(e=>{if(!1!==this.enabled){if(e.preventDefault(),1===e.touches.length)this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr);else{this._state=this.STATE.TOUCH_ZOOM_PAN;const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+n*n);const r=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panStart.copy(this.getMouseOnScreen(r,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(this.startEvent)}})),i(this,"touchmove",(e=>{if(!1!==this.enabled)if(e.preventDefault(),1===e.touches.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY));else{const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;this._touchZoomDistanceEnd=Math.sqrt(t*t+n*n);const r=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;this._panEnd.copy(this.getMouseOnScreen(r,i))}})),i(this,"touchend",(e=>{if(!1!==this.enabled){switch(e.touches.length){case 0:this._state=this.STATE.NONE;break;case 1:this._state=this.STATE.TOUCH_ROTATE,this._moveCurr.copy(this.getMouseOnCircle(e.touches[0].pageX,e.touches[0].pageY)),this._movePrev.copy(this._moveCurr)}this.dispatchEvent(this.endEvent)}})),i(this,"contextmenu",(e=>{!1!==this.enabled&&e.preventDefault()})),i(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("contextmenu",this.contextmenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.mousewheel),this.domElement.addEventListener("touchstart",this.touchstart),this.domElement.addEventListener("touchend",this.touchend),this.domElement.addEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),window.addEventListener("keydown",this.keydown),window.addEventListener("keyup",this.keyup),this.handleResize()})),i(this,"dispose",(()=>{this.domElement&&(this.domElement.removeEventListener("contextmenu",this.contextmenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.mousewheel),this.domElement.removeEventListener("touchstart",this.touchstart),this.domElement.removeEventListener("touchend",this.touchend),this.domElement.removeEventListener("touchmove",this.touchmove),this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("keydown",this.keydown),window.removeEventListener("keyup",this.keyup))})),this.object=e,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,void 0!==t&&this.connect(t),this.update()}}t.TrackballControls=a},3442:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);class a extends s.Object3D{constructor(e,t){super(),i(this,"isTransformControls",!0),i(this,"visible",!1),i(this,"domElement"),i(this,"raycaster",new s.Raycaster),i(this,"gizmo"),i(this,"plane"),i(this,"tempVector",new s.Vector3),i(this,"tempVector2",new s.Vector3),i(this,"tempQuaternion",new s.Quaternion),i(this,"unit",{X:new s.Vector3(1,0,0),Y:new s.Vector3(0,1,0),Z:new s.Vector3(0,0,1)}),i(this,"pointStart",new s.Vector3),i(this,"pointEnd",new s.Vector3),i(this,"offset",new s.Vector3),i(this,"rotationAxis",new s.Vector3),i(this,"startNorm",new s.Vector3),i(this,"endNorm",new s.Vector3),i(this,"rotationAngle",0),i(this,"cameraPosition",new s.Vector3),i(this,"cameraQuaternion",new s.Quaternion),i(this,"cameraScale",new s.Vector3),i(this,"parentPosition",new s.Vector3),i(this,"parentQuaternion",new s.Quaternion),i(this,"parentQuaternionInv",new s.Quaternion),i(this,"parentScale",new s.Vector3),i(this,"worldPositionStart",new s.Vector3),i(this,"worldQuaternionStart",new s.Quaternion),i(this,"worldScaleStart",new s.Vector3),i(this,"worldPosition",new s.Vector3),i(this,"worldQuaternion",new s.Quaternion),i(this,"worldQuaternionInv",new s.Quaternion),i(this,"worldScale",new s.Vector3),i(this,"eye",new s.Vector3),i(this,"positionStart",new s.Vector3),i(this,"quaternionStart",new s.Quaternion),i(this,"scaleStart",new s.Vector3),i(this,"camera"),i(this,"object"),i(this,"enabled",!0),i(this,"axis",null),i(this,"mode","translate"),i(this,"translationSnap",null),i(this,"rotationSnap",null),i(this,"scaleSnap",null),i(this,"space","world"),i(this,"size",1),i(this,"dragging",!1),i(this,"showX",!0),i(this,"showY",!0),i(this,"showZ",!0),i(this,"changeEvent",{type:"change"}),i(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),i(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),i(this,"objectChangeEvent",{type:"objectChange"}),i(this,"intersectObjectWithRay",((e,t,n)=>{const r=t.intersectObject(e,!0);for(let i=0;i<r.length;i++)if(r[i].object.visible||n)return r[i];return!1})),i(this,"attach",(e=>(this.object=e,this.visible=!0,this))),i(this,"detach",(()=>(this.object=void 0,this.visible=!1,this.axis=null,this))),i(this,"reset",(()=>this.enabled?(this.dragging&&void 0!==this.object&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this)),i(this,"updateMatrixWorld",(()=>{void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()})),i(this,"pointerHover",(e=>{if(void 0===this.object||!0===this.dragging)return;this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);this.axis=t?t.object.name:null})),i(this,"pointerDown",(e=>{if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){this.raycaster.setFromCamera(e,this.camera);const t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if("scale"===this.mode?e="local":"E"!==this.axis&&"XYZE"!==this.axis&&"XYZ"!==this.axis||(e="world"),"local"===e&&"rotate"===this.mode){const e=this.rotationSnap;"X"===this.axis&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),"Y"===this.axis&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),"Z"===this.axis&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}})),i(this,"pointerMove",(e=>{const t=this.axis,n=this.mode,r=this.object;let i=this.space;if("scale"===n?i="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(i="world"),void 0===r||null===t||!1===this.dragging||-1!==e.button)return;this.raycaster.setFromCamera(e,this.camera);const s=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===n)this.offset.copy(this.pointEnd).sub(this.pointStart),"local"===i&&"XYZ"!==t&&this.offset.applyQuaternion(this.worldQuaternionInv),-1===t.indexOf("X")&&(this.offset.x=0),-1===t.indexOf("Y")&&(this.offset.y=0),-1===t.indexOf("Z")&&(this.offset.z=0),"local"===i&&"XYZ"!==t?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&("local"===i&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),"world"===i&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),-1===t.search("X")&&(this.tempVector2.x=1),-1===t.search("Y")&&(this.tempVector2.y=1),-1===t.search("Z")&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(-1!==t.search("X")&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this.offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),"local"===i&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===i&&"E"!==t&&"XYZE"!==t?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}})),i(this,"pointerUp",(e=>{0===e.button&&(this.dragging&&null!==this.axis&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)})),i(this,"getPointer",(e=>{var t,n;if(this.domElement&&(null==(t=this.domElement.ownerDocument)?void 0:t.pointerLockElement))return{x:0,y:0,button:e.button};{const t=e.changedTouches?e.changedTouches[0]:e,r=null==(n=this.domElement)?void 0:n.getBoundingClientRect();return{x:(t.clientX-r.left)/r.width*2-1,y:-(t.clientY-r.top)/r.height*2+1,button:e.button}}})),i(this,"onPointerHover",(e=>{if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(e))}})),i(this,"onPointerDown",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))})),i(this,"onPointerMove",(e=>{this.enabled&&this.pointerMove(this.getPointer(e))})),i(this,"onPointerUp",(e=>{this.enabled&&this.domElement&&(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(e)))})),i(this,"getMode",(()=>this.mode)),i(this,"setMode",(e=>{this.mode=e})),i(this,"setTranslationSnap",(e=>{this.translationSnap=e})),i(this,"setRotationSnap",(e=>{this.rotationSnap=e})),i(this,"setScaleSnap",(e=>{this.scaleSnap=e})),i(this,"setSize",(e=>{this.size=e})),i(this,"setSpace",(e=>{this.space=e})),i(this,"update",(()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")})),i(this,"connect",(e=>{e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=e,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)})),i(this,"dispose",(()=>{var e,t,n,r,i,s;null==(e=this.domElement)||e.removeEventListener("pointerdown",this.onPointerDown),null==(t=this.domElement)||t.removeEventListener("pointermove",this.onPointerHover),null==(r=null==(n=this.domElement)?void 0:n.ownerDocument)||r.removeEventListener("pointermove",this.onPointerMove),null==(s=null==(i=this.domElement)?void 0:i.ownerDocument)||s.removeEventListener("pointerup",this.onPointerUp),this.traverse((e=>{const t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))})),this.domElement=t,this.camera=e,this.gizmo=new o,this.add(this.gizmo),this.plane=new l,this.add(this.plane);const n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return void 0!==n?n:t},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+"-changed",value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n("camera",this.camera),n("object",this.object),n("enabled",this.enabled),n("axis",this.axis),n("mode",this.mode),n("translationSnap",this.translationSnap),n("rotationSnap",this.rotationSnap),n("scaleSnap",this.scaleSnap),n("space",this.space),n("size",this.size),n("dragging",this.dragging),n("showX",this.showX),n("showY",this.showY),n("showZ",this.showZ),n("worldPosition",this.worldPosition),n("worldPositionStart",this.worldPositionStart),n("worldQuaternion",this.worldQuaternion),n("worldQuaternionStart",this.worldQuaternionStart),n("cameraPosition",this.cameraPosition),n("cameraQuaternion",this.cameraQuaternion),n("pointStart",this.pointStart),n("pointEnd",this.pointEnd),n("rotationAxis",this.rotationAxis),n("rotationAngle",this.rotationAngle),n("eye",this.eye),void 0!==t&&this.connect(t)}}class o extends s.Object3D{constructor(){super(),i(this,"isTransformControlsGizmo",!0),i(this,"type","TransformControlsGizmo"),i(this,"tempVector",new s.Vector3(0,0,0)),i(this,"tempEuler",new s.Euler),i(this,"alignVector",new s.Vector3(0,1,0)),i(this,"zeroVector",new s.Vector3(0,0,0)),i(this,"lookAtMatrix",new s.Matrix4),i(this,"tempQuaternion",new s.Quaternion),i(this,"tempQuaternion2",new s.Quaternion),i(this,"identityQuaternion",new s.Quaternion),i(this,"unitX",new s.Vector3(1,0,0)),i(this,"unitY",new s.Vector3(0,1,0)),i(this,"unitZ",new s.Vector3(0,0,1)),i(this,"gizmo"),i(this,"picker"),i(this,"helper"),i(this,"rotationAxis",new s.Vector3),i(this,"cameraPosition",new s.Vector3),i(this,"worldPositionStart",new s.Vector3),i(this,"worldQuaternionStart",new s.Quaternion),i(this,"worldPosition",new s.Vector3),i(this,"worldQuaternion",new s.Quaternion),i(this,"eye",new s.Vector3),i(this,"camera",null),i(this,"enabled",!0),i(this,"axis",null),i(this,"mode","translate"),i(this,"space","world"),i(this,"size",1),i(this,"dragging",!1),i(this,"showX",!0),i(this,"showY",!0),i(this,"showZ",!0),i(this,"updateMatrixWorld",(()=>{let e=this.space;"scale"===this.mode&&(e="local");const t="local"===e?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let r=0;r<n.length;r++){const e=n[r];let i;if(e.visible=!0,e.rotation.set(0,0,0),e.position.copy(this.worldPosition),i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),e.scale.set(1,1,1).multiplyScalar(i*this.size/7),"helper"!==e.tag){if(e.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const n=.99,r=.2,i=0;"X"!==e.name&&"XYZX"!==e.name||Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Y"!==e.name&&"XYZY"!==e.name||Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"Z"!==e.name&&"XYZZ"!==e.name||Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>n&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XY"===e.name&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"YZ"===e.name&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),"XZ"===e.name&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<r&&(e.scale.set(1e-10,1e-10,1e-10),e.visible=!1),-1!==e.name.search("X")&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.x*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Y")&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.y*=-1:"bwd"===e.tag&&(e.visible=!1)),-1!==e.name.search("Z")&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<i?"fwd"===e.tag?e.visible=!1:e.scale.z*=-1:"bwd"===e.tag&&(e.visible=!1))}else"rotate"===this.mode&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),-1!==e.name.search("E")&&e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),"X"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Y"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)),"Z"===e.name&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),e.quaternion.copy(this.tempQuaternion)));e.visible=e.visible&&(-1===e.name.indexOf("X")||this.showX),e.visible=e.visible&&(-1===e.name.indexOf("Y")||this.showY),e.visible=e.visible&&(-1===e.name.indexOf("Z")||this.showZ),e.visible=e.visible&&(-1===e.name.indexOf("E")||this.showX&&this.showY&&this.showZ),e.material.tempOpacity=e.material.tempOpacity||e.material.opacity,e.material.tempColor=e.material.tempColor||e.material.color.clone(),e.material.color.copy(e.material.tempColor),e.material.opacity=e.material.tempOpacity,this.enabled?this.axis&&(e.name===this.axis||this.axis.split("").some((function(t){return e.name===t}))?(e.material.opacity=1,e.material.color.lerp(new s.Color(1,1,1),.5)):(e.material.opacity*=.25,e.material.color.lerp(new s.Color(1,1,1),.5))):(e.material.opacity*=.5,e.material.color.lerp(new s.Color(1,1,1),.5))}else e.visible=!1,"AXIS"===e.name?(e.position.copy(this.worldPositionStart),e.visible=!!this.axis,"X"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Y"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"Z"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),e.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(e.visible=!1)),"XYZE"===this.axis&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),e.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),e.quaternion.multiply(this.tempQuaternion),e.visible=this.dragging),"E"===this.axis&&(e.visible=!1)):"START"===e.name?(e.position.copy(this.worldPositionStart),e.visible=this.dragging):"END"===e.name?(e.position.copy(this.worldPosition),e.visible=this.dragging):"DELTA"===e.name?(e.position.copy(this.worldPositionStart),e.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),e.scale.copy(this.tempVector),e.visible=this.dragging):(e.quaternion.copy(t),this.dragging?e.position.copy(this.worldPositionStart):e.position.copy(this.worldPosition),this.axis&&(e.visible=-1!==this.axis.search(e.name)))}super.updateMatrixWorld()}));const e=new s.MeshBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,side:s.DoubleSide,fog:!1,toneMapped:!1}),t=new s.LineBasicMaterial({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;const r=e.clone();r.opacity=.33;const a=e.clone();a.color.set(16711680);const o=e.clone();o.color.set(65280);const l=e.clone();l.color.set(255);const c=e.clone();c.opacity=.25;const h=c.clone();h.color.set(16776960);const u=c.clone();u.color.set(65535);const d=c.clone();d.color.set(16711935);e.clone().color.set(16776960);const p=t.clone();p.color.set(16711680);const f=t.clone();f.color.set(65280);const m=t.clone();m.color.set(255);const g=t.clone();g.color.set(65535);const A=t.clone();A.color.set(16711935);const v=t.clone();v.color.set(16776960);const y=t.clone();y.color.set(7895160);const x=v.clone();x.opacity=.25;const b=new s.CylinderGeometry(0,.05,.2,12,1,!1),E=new s.BoxGeometry(.125,.125,.125),_=new s.BufferGeometry;_.setAttribute("position",new s.Float32BufferAttribute([0,0,0,1,0,0],3));const S=(e,t)=>{const n=new s.BufferGeometry,r=[];for(let i=0;i<=64*t;++i)r.push(0,Math.cos(i/32*Math.PI)*e,Math.sin(i/32*Math.PI)*e);return n.setAttribute("position",new s.Float32BufferAttribute(r,3)),n},w={X:[[new s.Mesh(b,a),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new s.Mesh(b,a),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new s.Line(_,p)]],Y:[[new s.Mesh(b,o),[0,1,0],null,null,"fwd"],[new s.Mesh(b,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new s.Line(_,f),null,[0,0,Math.PI/2]]],Z:[[new s.Mesh(b,l),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new s.Mesh(b,l),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new s.Line(_,m),null,[0,-Math.PI/2,0]]],XYZ:[[new s.Mesh(new s.OctahedronGeometry(.1,0),c.clone()),[0,0,0],[0,0,0]]],XY:[[new s.Mesh(new s.PlaneGeometry(.295,.295),h.clone()),[.15,.15,0]],[new s.Line(_,v),[.18,.3,0],null,[.125,1,1]],[new s.Line(_,v),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new s.Mesh(new s.PlaneGeometry(.295,.295),u.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new s.Line(_,g),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new s.Line(_,g),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new s.Mesh(new s.PlaneGeometry(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new s.Line(_,A),[.18,0,.3],null,[.125,1,1]],[new s.Line(_,A),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},M={X:[[new s.Mesh(new s.CylinderGeometry(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new s.Mesh(new s.CylinderGeometry(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new s.Mesh(new s.CylinderGeometry(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new s.Mesh(new s.OctahedronGeometry(.2,0),n)]],XY:[[new s.Mesh(new s.PlaneGeometry(.4,.4),n),[.2,.2,0]]],YZ:[[new s.Mesh(new s.PlaneGeometry(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new s.Mesh(new s.PlaneGeometry(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},C={START:[[new s.Mesh(new s.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],END:[[new s.Mesh(new s.OctahedronGeometry(.01,2),r),null,null,null,"helper"]],DELTA:[[new s.Line((()=>{const e=new s.BufferGeometry;return e.setAttribute("position",new s.Float32BufferAttribute([0,0,0,1,1,1],3)),e})(),r),null,null,null,"helper"]],X:[[new s.Line(_,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new s.Line(_,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new s.Line(_,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={X:[[new s.Line(S(1,.5),p)],[new s.Mesh(new s.OctahedronGeometry(.04,0),a),[0,0,.99],null,[1,3,1]]],Y:[[new s.Line(S(1,.5),f),null,[0,0,-Math.PI/2]],[new s.Mesh(new s.OctahedronGeometry(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new s.Line(S(1,.5),m),null,[0,Math.PI/2,0]],[new s.Mesh(new s.OctahedronGeometry(.04,0),l),[.99,0,0],null,[1,3,1]]],E:[[new s.Line(S(1.25,1),x),null,[0,Math.PI/2,0]],[new s.Mesh(new s.CylinderGeometry(.03,0,.15,4,1,!1),x),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new s.Mesh(new s.CylinderGeometry(.03,0,.15,4,1,!1),x),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new s.Mesh(new s.CylinderGeometry(.03,0,.15,4,1,!1),x),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new s.Mesh(new s.CylinderGeometry(.03,0,.15,4,1,!1),x),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new s.Line(S(1,1),y),null,[0,Math.PI/2,0]]]},I={AXIS:[[new s.Line(_,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},B={X:[[new s.Mesh(new s.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new s.Mesh(new s.TorusGeometry(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new s.Mesh(new s.TorusGeometry(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new s.Mesh(new s.TorusGeometry(1.25,.1,2,24),n)]],XYZE:[[new s.Mesh(new s.SphereGeometry(.7,10,8),n)]]},R={X:[[new s.Mesh(E,a),[.8,0,0],[0,0,-Math.PI/2]],[new s.Line(_,p),null,null,[.8,1,1]]],Y:[[new s.Mesh(E,o),[0,.8,0]],[new s.Line(_,f),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new s.Mesh(E,l),[0,0,.8],[Math.PI/2,0,0]],[new s.Line(_,m),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new s.Mesh(E,h),[.85,.85,0],null,[2,2,.2]],[new s.Line(_,v),[.855,.98,0],null,[.125,1,1]],[new s.Line(_,v),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new s.Mesh(E,u),[0,.85,.85],null,[.2,2,2]],[new s.Line(_,g),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new s.Line(_,g),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new s.Mesh(E,d),[.85,0,.85],null,[2,.2,2]],[new s.Line(_,A),[.855,0,.98],null,[.125,1,1]],[new s.Line(_,A),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new s.Mesh(new s.BoxGeometry(.125,.125,.125),c.clone()),[1.1,0,0]]],XYZY:[[new s.Mesh(new s.BoxGeometry(.125,.125,.125),c.clone()),[0,1.1,0]]],XYZZ:[[new s.Mesh(new s.BoxGeometry(.125,.125,.125),c.clone()),[0,0,1.1]]]},P={X:[[new s.Mesh(new s.CylinderGeometry(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new s.Mesh(new s.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new s.Mesh(new s.CylinderGeometry(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new s.Mesh(E,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new s.Mesh(E,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new s.Mesh(E,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new s.Mesh(new s.BoxGeometry(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new s.Mesh(new s.BoxGeometry(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new s.Mesh(new s.BoxGeometry(.2,.2,.2),n),[0,0,1.1]]]},D={X:[[new s.Line(_,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new s.Line(_,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new s.Line(_,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},L=e=>{const t=new s.Object3D;for(let n in e)for(let r=e[n].length;r--;){const i=e[n][r][0].clone(),s=e[n][r][1],a=e[n][r][2],o=e[n][r][3],l=e[n][r][4];i.name=n,i.tag=l,s&&i.position.set(s[0],s[1],s[2]),a&&i.rotation.set(a[0],a[1],a[2]),o&&i.scale.set(o[0],o[1],o[2]),i.updateMatrix();const c=i.geometry.clone();c.applyMatrix4(i.matrix),i.geometry=c,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=L(w)),this.add(this.gizmo.rotate=L(T)),this.add(this.gizmo.scale=L(R)),this.add(this.picker.translate=L(M)),this.add(this.picker.rotate=L(B)),this.add(this.picker.scale=L(P)),this.add(this.helper.translate=L(C)),this.add(this.helper.rotate=L(I)),this.add(this.helper.scale=L(D)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class l extends s.Mesh{constructor(){super(new s.PlaneGeometry(1e5,1e5,2,2),new s.MeshBasicMaterial({visible:!1,wireframe:!0,side:s.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),i(this,"isTransformControlsPlane",!0),i(this,"type","TransformControlsPlane"),i(this,"unitX",new s.Vector3(1,0,0)),i(this,"unitY",new s.Vector3(0,1,0)),i(this,"unitZ",new s.Vector3(0,0,1)),i(this,"tempVector",new s.Vector3),i(this,"dirVector",new s.Vector3),i(this,"alignVector",new s.Vector3),i(this,"tempMatrix",new s.Matrix4),i(this,"identityQuaternion",new s.Quaternion),i(this,"cameraQuaternion",new s.Quaternion),i(this,"worldPosition",new s.Vector3),i(this,"worldQuaternion",new s.Quaternion),i(this,"eye",new s.Vector3),i(this,"axis",null),i(this,"mode","translate"),i(this,"space","world"),i(this,"updateMatrixWorld",(()=>{let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),this.unitX.set(1,0,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion("local"===e?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0)}break;default:this.dirVector.set(0,0,0)}0===this.dirVector.length()?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()}))}}t.TransformControls=a,t.TransformControlsGizmo=o,t.TransformControlsPlane=l},60173:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};class o extends s.EventDispatcher{constructor(e,t){super(),i(this,"object"),i(this,"domElement"),i(this,"enabled",!0),i(this,"target",new s.Vector3),i(this,"trackball",!1),i(this,"minDistance",0),i(this,"maxDistance",1/0),i(this,"minZoom",0),i(this,"maxZoom",1/0),i(this,"minPolarAngle",0),i(this,"maxPolarAngle",Math.PI),i(this,"minAzimuthAngle",-1/0),i(this,"maxAzimuthAngle",1/0),i(this,"enableDamping",!1),i(this,"dampingFactor",.05),i(this,"enableZoom",!0),i(this,"zoomSpeed",1),i(this,"enableRotate",!0),i(this,"rotateSpeed",1),i(this,"enablePan",!0),i(this,"panSpeed",1),i(this,"screenSpacePanning",!1),i(this,"keyPanSpeed",7),i(this,"autoRotate",!1),i(this,"autoRotateSpeed",2),i(this,"enableKeys",!0),i(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),i(this,"mouseButtons"),i(this,"touches",{ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN}),i(this,"target0"),i(this,"position0"),i(this,"quaternion0"),i(this,"zoom0"),i(this,"spherical",new s.Spherical),i(this,"sphericalDelta",new s.Spherical),i(this,"changeEvent",{type:"change"}),i(this,"startEvent",{type:"start"}),i(this,"endEvent",{type:"end"}),i(this,"state",a.NONE),i(this,"EPS",1e-6),i(this,"scale",1),i(this,"panOffset",new s.Vector3),i(this,"zoomChanged",!1),i(this,"rotateStart",new s.Vector2),i(this,"rotateEnd",new s.Vector2),i(this,"rotateDelta",new s.Vector2),i(this,"panStart",new s.Vector2),i(this,"panEnd",new s.Vector2),i(this,"panDelta",new s.Vector2),i(this,"dollyStart",new s.Vector2),i(this,"dollyEnd",new s.Vector2),i(this,"dollyDelta",new s.Vector2),i(this,"offset",new s.Vector3),i(this,"lastPosition",new s.Vector3),i(this,"lastQuaternion",new s.Quaternion),i(this,"q",new s.Quaternion),i(this,"v",new s.Vector3),i(this,"vec",new s.Vector3),i(this,"quat"),i(this,"quatInverse"),i(this,"getPolarAngle",(()=>this.spherical.phi)),i(this,"getAzimuthalAngle",(()=>this.spherical.theta)),i(this,"saveState",(()=>{this.target0.copy(this.target),this.position0.copy(this.object.position),this.quaternion0.copy(this.object.quaternion),this.zoom0=this.object.zoom})),i(this,"reset",(()=>{this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.quaternion.copy(this.quaternion0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(this.changeEvent),this.update(),this.state=a.NONE})),i(this,"dispose",(()=>{this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.domElement.removeEventListener("keydown",this.onKeyDown,!1)})),i(this,"update",(()=>{const e=this.object.position;if(this.offset.copy(e).sub(this.target),this.trackball){if(this.sphericalDelta.theta){this.vec.set(0,1,0).applyQuaternion(this.object.quaternion);const e=this.enableDamping?this.dampingFactor:1;this.q.setFromAxisAngle(this.vec,this.sphericalDelta.theta*e),this.object.quaternion.premultiply(this.q),this.offset.applyQuaternion(this.q)}if(this.sphericalDelta.phi){this.vec.set(1,0,0).applyQuaternion(this.object.quaternion);const e=this.enableDamping?this.dampingFactor:1;this.q.setFromAxisAngle(this.vec,this.sphericalDelta.phi*e),this.object.quaternion.premultiply(this.q),this.offset.applyQuaternion(this.q)}this.offset.multiplyScalar(this.scale),this.offset.clampLength(this.minDistance,this.maxDistance)}else this.offset.applyQuaternion(this.quat),this.autoRotate&&this.state===a.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.setFromVector3(this.offset),this.enableDamping?(this.spherical.theta+=this.sphericalDelta.theta*this.dampingFactor,this.spherical.phi+=this.sphericalDelta.phi*this.dampingFactor):(this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi),this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.offset.setFromSpherical(this.spherical),this.offset.applyQuaternion(this.quatInverse);return!0===this.enableDamping?this.target.addScaledVector(this.panOffset,this.dampingFactor):this.target.add(this.panOffset),e.copy(this.target).add(this.offset),!1===this.trackball&&this.object.lookAt(this.target),!0===this.enableDamping?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor,this.panOffset.multiplyScalar(1-this.dampingFactor)):(this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0)),this.scale=1,!!(this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.quaternion))>this.EPS)&&(this.dispatchEvent(this.changeEvent),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0)})),i(this,"getAutoRotationAngle",(()=>2*Math.PI/60/60*this.autoRotateSpeed)),i(this,"getZoomScale",(()=>Math.pow(.95,this.zoomSpeed))),i(this,"rotateLeft",(e=>{this.sphericalDelta.theta-=e})),i(this,"rotateUp",(e=>{this.sphericalDelta.phi-=e})),i(this,"panLeft",((e,t)=>{this.v.setFromMatrixColumn(t,0),this.v.multiplyScalar(-e),this.panOffset.add(this.v)})),i(this,"panUp",((e,t)=>{!0===this.screenSpacePanning?this.v.setFromMatrixColumn(t,1):(this.v.setFromMatrixColumn(t,0),this.v.crossVectors(this.object.up,this.v)),this.v.multiplyScalar(e),this.panOffset.add(this.v)})),i(this,"pan",((e,t)=>{const n=this.domElement;if(this.object instanceof s.PerspectiveCamera){const r=this.object.position;this.offset.copy(r).sub(this.target);let i=this.offset.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*e*i/n.clientHeight,this.object.matrix),this.panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this.panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)})),i(this,"dollyIn",(e=>{this.object instanceof s.PerspectiveCamera?this.scale/=e:this.object instanceof s.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)})),i(this,"dollyOut",(e=>{this.object instanceof s.PerspectiveCamera?this.scale*=e:this.object instanceof s.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/e)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: CameraControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)})),i(this,"handleMouseDownRotate",(e=>{this.rotateStart.set(e.clientX,e.clientY)})),i(this,"handleMouseDownDolly",(e=>{this.dollyStart.set(e.clientX,e.clientY)})),i(this,"handleMouseDownPan",(e=>{this.panStart.set(e.clientX,e.clientY)})),i(this,"handleMouseMoveRotate",(e=>{this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/t.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/t.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()})),i(this,"handleMouseMoveDolly",(e=>{this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyIn(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyOut(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()})),i(this,"handleMouseMovePan",(e=>{this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.update()})),i(this,"handleMouseWheel",(e=>{e.deltaY<0?this.dollyOut(this.getZoomScale()):e.deltaY>0&&this.dollyIn(this.getZoomScale()),this.update()})),i(this,"handleKeyDown",(e=>{let t=!1;switch(e.code){case this.keys.UP:this.pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:this.pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:this.pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:this.pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())})),i(this,"handleTouchStartRotate",(e=>{if(1==e.touches.length)this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateStart.set(t,n)}})),i(this,"handleTouchStartPan",(e=>{if(1==e.touches.length)this.panStart.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.panStart.set(t,n)}})),i(this,"handleTouchStartDolly",(e=>{const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyStart.set(0,r)})),i(this,"handleTouchStartDollyPan",(e=>{this.enableZoom&&this.handleTouchStartDolly(e),this.enablePan&&this.handleTouchStartPan(e)})),i(this,"handleTouchStartDollyRotate",(e=>{this.enableZoom&&this.handleTouchStartDolly(e),this.enableRotate&&this.handleTouchStartRotate(e)})),i(this,"handleTouchMoveRotate",(e=>{if(1==e.touches.length)this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateEnd.set(t,n)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this.rotateLeft(2*Math.PI*this.rotateDelta.x/t.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/t.clientHeight),this.rotateStart.copy(this.rotateEnd)})),i(this,"handleTouchMovePan",(e=>{if(1==e.touches.length)this.panEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.panEnd.set(t,n)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)})),i(this,"handleTouchMoveDolly",(e=>{const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyEnd.set(0,r),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyIn(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)})),i(this,"handleTouchMoveDollyPan",(e=>{this.enableZoom&&this.handleTouchMoveDolly(e),this.enablePan&&this.handleTouchMovePan(e)})),i(this,"handleTouchMoveDollyRotate",(e=>{this.enableZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)})),i(this,"onMouseDown",(e=>{if(!1===this.enabled)return;let t;switch(e.preventDefault(),this.domElement.focus?this.domElement.focus():window.focus(),e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=a.DOLLY;break;case s.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=a.PAN}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=a.ROTATE}break;case s.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=a.ROTATE}else{if(!1===this.enablePan)return;this.handleMouseDownPan(e),this.state=a.PAN}break;default:this.state=a.NONE}this.state!==a.NONE&&(document.addEventListener("mousemove",this.onMouseMove,!1),document.addEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(this.startEvent))})),i(this,"onMouseMove",(e=>{if(!1!==this.enabled)switch(e.preventDefault(),this.state){case a.ROTATE:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case a.DOLLY:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e);break;case a.PAN:if(!1===this.enablePan)return;this.handleMouseMovePan(e)}})),i(this,"onMouseUp",(()=>{!1!==this.enabled&&(document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(this.endEvent),this.state=a.NONE)})),i(this,"onMouseWheel",(e=>{!1===this.enabled||!1===this.enableZoom||this.state!==a.NONE&&this.state!==a.ROTATE||(e.preventDefault(),this.dispatchEvent(this.startEvent),this.handleMouseWheel(e),this.dispatchEvent(this.endEvent))})),i(this,"onKeyDown",(e=>{!1!==this.enabled&&!1!==this.enableKeys&&!1!==this.enablePan&&this.handleKeyDown(e)})),i(this,"onTouchStart",(e=>{if(!1!==this.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(!1===this.enableRotate)return;this.handleTouchStartRotate(e),this.state=a.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(!1===this.enablePan)return;this.handleTouchStartPan(e),this.state=a.TOUCH_PAN;break;default:this.state=a.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(e),this.state=a.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(e),this.state=a.TOUCH_DOLLY_ROTATE;break;default:this.state=a.NONE}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(this.startEvent)}})),i(this,"onTouchMove",(e=>{if(!1!==this.enabled)switch(e.preventDefault(),this.state){case a.TOUCH_ROTATE:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e),this.update();break;case a.TOUCH_PAN:if(!1===this.enablePan)return;this.handleTouchMovePan(e),this.update();break;case a.TOUCH_DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(e),this.update();break;case a.TOUCH_DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(e),this.update();break;default:this.state=a.NONE}})),i(this,"onTouchEnd",(()=>{!1!==this.enabled&&(this.dispatchEvent(this.endEvent),this.state=a.NONE)})),i(this,"onContextMenu",(e=>{!1!==this.enabled&&e.preventDefault()})),void 0===t&&console.warn('THREE.CameraControls: The second parameter "domElement" is now mandatory.'),t instanceof Document&&console.error('THREE.CameraControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.quaternion0=this.object.quaternion.clone(),this.zoom0=this.object.zoom,this.quat=(new s.Quaternion).setFromUnitVectors(this.object.up,new s.Vector3(0,1,0)),this.quatInverse=this.quat.clone().invert(),this.lastPosition=new s.Vector3,this.lastQuaternion=new s.Quaternion,this.domElement.addEventListener("contextmenu",this.onContextMenu,!1),this.domElement.addEventListener("mousedown",this.onMouseDown,!1),this.domElement.addEventListener("wheel",this.onMouseWheel,!1),this.domElement.addEventListener("touchstart",this.onTouchStart,!1),this.domElement.addEventListener("touchend",this.onTouchEnd,!1),this.domElement.addEventListener("touchmove",this.onTouchMove,!1),this.domElement.addEventListener("keydown",this.onKeyDown,!1),-1===this.domElement.tabIndex&&(this.domElement.tabIndex=0),this.object.lookAt(this.target),this.update(),this.saveState()}handleMouseUp(){}handleTouchEnd(){}}t.CameraControls=o,t.MapControlsExp=class extends o{constructor(e,t){super(e,t),i(this,"mouseButtons"),i(this,"touches"),this.mouseButtons={LEFT:s.MOUSE.PAN,RIGHT:s.MOUSE.ROTATE},this.touches={ONE:s.TOUCH.PAN,TWO:s.TOUCH.DOLLY_ROTATE}}},t.OrbitControlsExp=class extends o{constructor(e,t){super(e,t),i(this,"mouseButtons"),i(this,"touches"),this.mouseButtons={LEFT:s.MOUSE.ROTATE,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN}}},t.STATE=a,t.TrackballControlsExp=class extends o{constructor(e,t){super(e,t),i(this,"trackball"),i(this,"screenSpacePanning"),i(this,"autoRotate"),i(this,"mouseButtons"),i(this,"touches"),this.trackball=!0,this.screenSpacePanning=!0,this.autoRotate=!1,this.mouseButtons={LEFT:s.MOUSE.ROTATE,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN}}}},30824:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(95703),s=n(62602),a=new r.Matrix4,o=new i.CSMFrustum,l=new r.Vector3,c=new r.Box3,h=[],u=[];t.CSM=class{constructor(e){e=e||{},this.camera=e.camera,this.parent=e.parent,this.cascades=e.cascades||3,this.maxFar=e.maxFar||1e5,this.mode=e.mode||"practical",this.shadowMapSize=e.shadowMapSize||2048,this.shadowBias=e.shadowBias||1e-6,this.lightDirection=e.lightDirection||new r.Vector3(1,-1,1).normalize(),this.lightIntensity=e.lightIntensity||1,this.lightNear=e.lightNear||1,this.lightFar=e.lightFar||2e3,this.lightMargin=e.lightMargin||200,this.customSplitsCallback=e.customSplitsCallback,this.fade=!1,this.mainFrustum=new i.CSMFrustum,this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this.createLights(),this.updateFrustums(),this.injectInclude()}createLights(){for(let e=0;e<this.cascades;e++){const e=new r.DirectionalLight(16777215,this.lightIntensity);e.castShadow=!0,e.shadow.mapSize.width=this.shadowMapSize,e.shadow.mapSize.height=this.shadowMapSize,e.shadow.camera.near=this.lightNear,e.shadow.camera.far=this.lightFar,e.shadow.bias=this.shadowBias,this.parent.add(e),this.parent.add(e.target),this.lights.push(e)}}initCascades(){const e=this.camera;e.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}updateShadowBounds(){const e=this.frustums;for(let t=0;t<e.length;t++){const e=this.lights[t].shadow.camera,n=this.frustums[t],r=n.vertices.near,i=n.vertices.far,s=i[0];let a;a=s.distanceTo(i[2])>s.distanceTo(r[2])?i[2]:r[2];let o=s.distanceTo(a);if(this.fade){const e=this.camera,t=Math.max(e.far,this.maxFar),r=n.vertices.far[0].z/(t-e.near);o+=.25*Math.pow(r,2)*(t-e.near)}e.left=-o/2,e.right=o/2,e.top=o/2,e.bottom=-o/2,e.updateProjectionMatrix()}}getBreaks(){const e=this.camera,t=Math.min(e.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":n(this.cascades,e.near,t,this.breaks);break;case"logarithmic":i(this.cascades,e.near,t,this.breaks);break;case"practical":!function(e,t,s,a,o){h.length=0,u.length=0,i(e,t,s,u),n(e,t,s,h);for(let n=1;n<e;n++)o.push(r.MathUtils.lerp(h[n-1],u[n-1],a));o.push(1)}(this.cascades,e.near,t,.5,this.breaks);break;case"custom":void 0===this.customSplitsCallback&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,e.near,t,this.breaks)}function n(e,t,n,r){for(let i=1;i<e;i++)r.push((t+(n-t)*i/e)/n);r.push(1)}function i(e,t,n,r){for(let i=1;i<e;i++)r.push(t*(n/t)**(i/e)/n);r.push(1)}}update(){const e=this.camera,t=this.frustums;for(let n=0;n<t.length;n++){const r=this.lights[n],i=r.shadow.camera,s=(i.right-i.left)/this.shadowMapSize,h=(i.top-i.bottom)/this.shadowMapSize;r.shadow.camera.updateMatrixWorld(!0),a.multiplyMatrices(r.shadow.camera.matrixWorldInverse,e.matrixWorld),t[n].toSpace(a,o);const u=o.vertices.near,d=o.vertices.far;c.makeEmpty();for(let e=0;e<4;e++)c.expandByPoint(u[e]),c.expandByPoint(d[e]);c.getCenter(l),l.z=c.max.z+this.lightMargin,l.x=Math.floor(l.x/s)*s,l.y=Math.floor(l.y/h)*h,l.applyMatrix4(r.shadow.camera.matrixWorld),r.position.copy(l),r.target.position.copy(l),r.target.position.x+=this.lightDirection.x,r.target.position.y+=this.lightDirection.y,r.target.position.z+=this.lightDirection.z}}injectInclude(){r.ShaderChunk.lights_fragment_begin=s.CSMShader.lights_fragment_begin,r.ShaderChunk.lights_pars_begin=s.CSMShader.lights_pars_begin}setupMaterial(e){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.cascades,this.fade&&(e.defines.CSM_FADE="");const t=[],n=this,r=this.shaders;e.onBeforeCompile=function(i){const s=Math.min(n.camera.far,n.maxFar);n.getExtendedBreaks(t),i.uniforms.CSM_cascades={value:t},i.uniforms.cameraNear={value:n.camera.near},i.uniforms.shadowFar={value:s},r.set(e,i)},r.set(e,null)}updateUniforms(){const e=Math.min(this.camera.far,this.maxFar);this.shaders.forEach((function(t,n){if(null!==t){const n=t.uniforms;this.getExtendedBreaks(n.CSM_cascades.value),n.cameraNear.value=this.camera.near,n.shadowFar.value=e}!this.fade&&"CSM_FADE"in n.defines?(delete n.defines.CSM_FADE,n.needsUpdate=!0):this.fade&&!("CSM_FADE"in n.defines)&&(n.defines.CSM_FADE="",n.needsUpdate=!0)}),this)}getExtendedBreaks(e){for(;e.length<this.breaks.length;)e.push(new r.Vector2);e.length=this.breaks.length;for(let t=0;t<this.cascades;t++){const n=this.breaks[t],r=this.breaks[t-1]||0;e[t].x=r,e[t].y=n}}updateFrustums(){this.getBreaks(),this.initCascades(),this.updateShadowBounds(),this.updateUniforms()}remove(){for(let e=0;e<this.lights.length;e++)this.parent.remove(this.lights[e])}dispose(){const e=this.shaders;e.forEach((function(e,t){delete t.onBeforeCompile,delete t.defines.USE_CSM,delete t.defines.CSM_CASCADES,delete t.defines.CSM_FADE,null!==e&&(delete e.uniforms.CSM_cascades,delete e.uniforms.cameraNear,delete e.uniforms.shadowFar),t.needsUpdate=!0})),e.clear()}}},95703:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Matrix4;class s{constructor(e){e=e||{},this.vertices={near:[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3],far:[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3]},void 0!==e.projectionMatrix&&this.setFromProjectionMatrix(e.projectionMatrix,e.maxFar||1e4)}setFromProjectionMatrix(e,t){const n=0===e.elements[11];return i.copy(e).invert(),this.vertices.near[0].set(1,1,-1),this.vertices.near[1].set(1,-1,-1),this.vertices.near[2].set(-1,-1,-1),this.vertices.near[3].set(-1,1,-1),this.vertices.near.forEach((function(e){e.applyMatrix4(i)})),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach((function(e){e.applyMatrix4(i);const r=Math.abs(e.z);n?e.z*=Math.min(t/r,1):e.multiplyScalar(Math.min(t/r,1))})),this.vertices}split(e,t){for(;e.length>t.length;)t.push(new s);t.length=e.length;for(let n=0;n<e.length;n++){const r=t[n];if(0===n)for(let e=0;e<4;e++)r.vertices.near[e].copy(this.vertices.near[e]);else for(let t=0;t<4;t++)r.vertices.near[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[n-1]);if(n===e.length-1)for(let e=0;e<4;e++)r.vertices.far[e].copy(this.vertices.far[e]);else for(let t=0;t<4;t++)r.vertices.far[t].lerpVectors(this.vertices.near[t],this.vertices.far[t],e[n])}}toSpace(e,t){for(let n=0;n<4;n++)t.vertices.near[n].copy(this.vertices.near[n]).applyMatrix4(e),t.vertices.far[n].copy(this.vertices.far[n]).applyMatrix4(e)}}t.CSMFrustum=s},41959:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Group{constructor(e){super(),this.csm=e,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),i=new r.BufferGeometry;i.setIndex(new r.BufferAttribute(t,1)),i.setAttribute("position",new r.BufferAttribute(n,3,!1));const s=new r.LineSegments(i,new r.LineBasicMaterial);this.add(s),this.frustumLines=s,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const e=this.displayFrustum,t=this.displayPlanes,n=this.displayShadowBounds,r=this.frustumLines,i=this.cascadeLines,s=this.cascadePlanes,a=this.shadowLines;for(let o=0,l=i.length;o<l;o++){const r=i[o],l=s[o],c=a[o];r.visible=e,l.visible=e&&t,c.visible=n}r.visible=e}update(){const e=this.csm,t=e.camera,n=e.cascades,i=e.mainFrustum,s=e.frustums,a=e.lights,o=this.frustumLines.geometry.getAttribute("position"),l=this.cascadeLines,c=this.cascadePlanes,h=this.shadowLines;for(this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.updateMatrixWorld(!0);l.length>n;)this.remove(l.pop()),this.remove(c.pop()),this.remove(h.pop());for(;l.length<n;){const e=new r.Box3Helper(new r.Box3,16777215),t=new r.MeshBasicMaterial({transparent:!0,opacity:.1,depthWrite:!1,side:r.DoubleSide}),n=new r.Mesh(new r.PlaneGeometry,t),i=new r.Group,s=new r.Box3Helper(new r.Box3,16776960);i.add(s),this.add(e),this.add(n),this.add(i),l.push(e),c.push(n),h.push(i)}for(let r=0;r<n;r++){const e=s[r],t=a[r].shadow.camera,n=e.vertices.far,i=l[r],o=c[r],u=h[r],d=u.children[0];i.box.min.copy(n[2]),i.box.max.copy(n[0]),i.box.max.z+=1e-4,o.position.addVectors(n[0],n[2]),o.position.multiplyScalar(.5),o.scale.subVectors(n[0],n[2]),o.scale.z=1e-4,this.remove(u),u.position.copy(t.position),u.quaternion.copy(t.quaternion),u.scale.copy(t.scale),u.updateMatrixWorld(!0),this.attach(u),d.box.min.set(t.bottom,t.left,-t.far),d.box.max.set(t.top,t.right,-t.near)}const u=i.vertices.near,d=i.vertices.far;o.setXYZ(0,d[0].x,d[0].y,d[0].z),o.setXYZ(1,d[3].x,d[3].y,d[3].z),o.setXYZ(2,d[2].x,d[2].y,d[2].z),o.setXYZ(3,d[1].x,d[1].y,d[1].z),o.setXYZ(4,u[0].x,u[0].y,u[0].z),o.setXYZ(5,u[3].x,u[3].y,u[3].z),o.setXYZ(6,u[2].x,u[2].y,u[2].z),o.setXYZ(7,u[1].x,u[1].y,u[1].z),o.needsUpdate=!0}}t.CSMHelper=i},62602:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={lights_fragment_begin:"\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( 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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\tvec2 cascade;\n\tfloat cascadeCenter;\n\tfloat closestEdge;\n\tfloat margin;\n\tfloat csmx;\n\tfloat csmy;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t \t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\t\t// NOTE: Depth gets larger away from the camera.\n\t\t\t// cascade.x is closer, cascade.y is further\n\t\t\tcascade = CSM_cascades[ i ];\n\t\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\t\tcsmx = cascade.x - margin / 2.0;\n\t\t\tcsmy = cascade.y + margin / 2.0;\n\t\t\tif( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\n\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t\t}\n\t \t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\t#else\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)\n\t\t// compute the lights not casting shadows (if any)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",getlights_pars_begin:()=>`\n\t\t\t#if defined( USE_CSM ) && defined( CSM_CASCADES )\n\t\t\tuniform vec2 CSM_cascades[CSM_CASCADES];\n\t\t\tuniform float cameraNear;\n\t\t\tuniform float shadowFar;\n\t\t\t#endif\n\n\t\t\t${r.ShaderChunk.lights_pars_begin}\n\t\t`};t.CSMShader=i},4668:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Curve{getPoint(e,t=new r.Vector3){const n=t;e=2*Math.PI*e;const i=-.22*Math.cos(e)-1.28*Math.sin(e)-.44*Math.cos(3*e)-.78*Math.sin(3*e),s=-.1*Math.cos(2*e)-.27*Math.sin(2*e)+.38*Math.cos(4*e)+.46*Math.sin(4*e),a=.7*Math.cos(3*e)-.4*Math.sin(3*e);return n.set(i,s,a).multiplyScalar(20)}}class s extends r.Curve{constructor(e=5){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=16*Math.pow(Math.sin(e),3),s=13*Math.cos(e)-5*Math.cos(2*e)-2*Math.cos(3*e)-Math.cos(4*e);return n.set(i,s,0).multiplyScalar(this.scale)}}class a extends r.Curve{constructor(e=70){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e=4*e*Math.PI;const i=this.scale/2,s=i*(1+Math.cos(e)),a=i*Math.sin(e),o=2*i*Math.sin(e/2);return n.set(s,a,o)}}class o extends r.Curve{getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=50*Math.sin(e),s=Math.cos(e)*(10+50*Math.cos(e)),a=Math.sin(e)*(10+50*Math.cos(e));return n.set(i,s,a)}}class l extends r.Curve{getPoint(e,t=new r.Vector3){const n=t,i=2*Math.PI*e*150/30,s=30*Math.cos(i),a=30*Math.sin(i),o=150*e;return n.set(s,a,o)}}class c extends r.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=(2+Math.cos(3*e))*Math.cos(2*e),s=(2+Math.cos(3*e))*Math.sin(2*e),a=Math.sin(3*e);return n.set(i,s,a).multiplyScalar(this.scale)}}class h extends r.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=(2+Math.cos(4*e))*Math.cos(3*e),s=(2+Math.cos(4*e))*Math.sin(3*e),a=Math.sin(4*e);return n.set(i,s,a).multiplyScalar(this.scale)}}class u extends r.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=(2+Math.cos(5*e))*Math.cos(2*e),s=(2+Math.cos(5*e))*Math.sin(2*e),a=Math.sin(5*e);return n.set(i,s,a).multiplyScalar(this.scale)}}class d extends r.Curve{constructor(e=10){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e=4*e-2;const i=Math.pow(e,3)-3*e,s=Math.pow(e,4)-4*e*e,a=.2*Math.pow(e,5)-2*e;return n.set(i,s,a).multiplyScalar(this.scale)}}class p extends r.Curve{constructor(e=1){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e=function(e,t,n){return n*(t-e)+e}(-4,4,e);const i=.4*e*(e*e-7)*(e*e-10),s=Math.pow(e,4)-13*e*e,a=.1*e*(e*e-4)*(e*e-9)*(e*e-12);return n.set(i,s,a).multiplyScalar(this.scale)}}class f extends r.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t;e*=2*Math.PI;const i=Math.cos(2*e)*(1+.6*(Math.cos(5*e)+.75*Math.cos(10*e))),s=Math.sin(2*e)*(1+.6*(Math.cos(5*e)+.75*Math.cos(10*e))),a=.35*Math.sin(5*e);return n.set(i,s,a).multiplyScalar(this.scale)}}class m extends r.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t,i=e*Math.PI*2,s=Math.cos(2*i)*(1+.45*Math.cos(3*i)+.4*Math.cos(9*i)),a=Math.sin(2*i)*(1+.45*Math.cos(3*i)+.4*Math.cos(9*i)),o=.2*Math.sin(9*i);return n.set(s,a,o).multiplyScalar(this.scale)}}class g extends r.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t,i=e*Math.PI*2,s=Math.cos(3*i)*(1+.3*Math.cos(5*i)+.5*Math.cos(10*i)),a=Math.sin(3*i)*(1+.3*Math.cos(5*i)+.5*Math.cos(10*i)),o=.2*Math.sin(20*i);return n.set(s,a,o).multiplyScalar(this.scale)}}class A extends r.Curve{constructor(e=40){super(),this.scale=e}getPoint(e,t=new r.Vector3){const n=t,i=e*Math.PI*2,s=Math.cos(4*i)*(1+.5*(Math.cos(5*i)+.4*Math.cos(20*i))),a=Math.sin(4*i)*(1+.5*(Math.cos(5*i)+.4*Math.cos(20*i))),o=.35*Math.sin(15*i);return n.set(s,a,o).multiplyScalar(this.scale)}}t.CinquefoilKnot=u,t.DecoratedTorusKnot4a=f,t.DecoratedTorusKnot4b=m,t.DecoratedTorusKnot5a=g,t.DecoratedTorusKnot5c=A,t.FigureEightPolynomialKnot=p,t.GrannyKnot=i,t.HeartCurve=s,t.HelixCurve=l,t.KnotCurve=o,t.TorusKnot=h,t.TrefoilKnot=c,t.TrefoilPolynomialKnot=d,t.VivianiCurve=a},98001:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(11576);class s extends r.Curve{constructor(e,t,n,i,s){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=i||0,this.endKnot=s||this.knots.length-1;for(let a=0;a<n.length;++a){const e=n[a];this.controlPoints[a]=new r.Vector4(e.x,e.y,e.z,e.w)}}getPoint(e,t){const n=t||new r.Vector3,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),a=i.calcBSplinePoint(this.degree,this.knots,this.controlPoints,s);return 1!=a.w&&a.divideScalar(a.w),n.set(a.x,a.y,a.z)}getTangent(e,t){const n=t||new r.Vector3,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),a=i.calcNURBSDerivatives(this.degree,this.knots,this.controlPoints,s,1);return n.copy(a[1]).normalize(),n}}t.NURBSCurve=s},81587:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(11576);t.NURBSSurface=class{constructor(e,t,n,i,s){this.degree1=e,this.degree2=t,this.knots1=n,this.knots2=i,this.controlPoints=[];const a=n.length-e-1,o=i.length-t-1;for(let l=0;l<a;++l){this.controlPoints[l]=[];for(let e=0;e<o;++e){const t=s[l][e];this.controlPoints[l][e]=new r.Vector4(t.x,t.y,t.z,t.w)}}}getPoint(e,t,n){const r=this.knots1[0]+e*(this.knots1[this.knots1.length-1]-this.knots1[0]),s=this.knots2[0]+t*(this.knots2[this.knots2.length-1]-this.knots2[0]);i.calcSurfacePoint(this.degree1,this.degree2,this.knots1,this.knots2,this.controlPoints,r,s,n)}}},11576:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);function i(e,t,n){const r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;let i=e,s=r,a=Math.floor((i+s)/2);for(;t<n[a]||t>=n[a+1];)t<n[a]?s=a:i=a,a=Math.floor((i+s)/2);return a}function s(e,t,n,r){const i=[],s=[],a=[];i[0]=1;for(let o=1;o<=n;++o){s[o]=t-r[e+1-o],a[o]=r[e+o]-t;let n=0;for(let e=0;e<o;++e){const t=a[e+1],r=s[o-e],l=i[e]/(t+r);i[e]=n+t*l,n=r*l}i[o]=n}return i}function a(e,t,n,r,i){const s=[];for(let u=0;u<=n;++u)s[u]=0;const a=[];for(let u=0;u<=r;++u)a[u]=s.slice(0);const o=[];for(let u=0;u<=n;++u)o[u]=s.slice(0);o[0][0]=1;const l=s.slice(0),c=s.slice(0);for(let u=1;u<=n;++u){l[u]=t-i[e+1-u],c[u]=i[e+u]-t;let n=0;for(let e=0;e<u;++e){const t=c[e+1],r=l[u-e];o[u][e]=t+r;const i=o[e][u-1]/o[u][e];o[e][u]=n+t*i,n=r*i}o[u][u]=n}for(let u=0;u<=n;++u)a[0][u]=o[u][n];for(let u=0;u<=n;++u){let e=0,t=1;const i=[];for(let r=0;r<=n;++r)i[r]=s.slice(0);i[0][0]=1;for(let s=1;s<=r;++s){let r=0;const l=u-s,c=n-s;u>=s&&(i[t][0]=i[e][0]/o[c+1][l],r=i[t][0]*o[l][c]);const h=u-1<=c?s-1:n-u;for(let n=l>=-1?1:-l;n<=h;++n)i[t][n]=(i[e][n]-i[e][n-1])/o[c+1][l+n],r+=i[t][n]*o[l+n][c];u<=c&&(i[t][s]=-i[e][s-1]/o[c+1][u],r+=i[t][s]*o[u][c]),a[s][u]=r;const d=e;e=t,t=d}}let h=n;for(let u=1;u<=r;++u){for(let e=0;e<=n;++e)a[u][e]*=h;h*=n-u}return a}function o(e,t,n,s,o){const l=o<e?o:e,c=[],h=i(e,s,t),u=a(h,s,e,l,t),d=[];for(let r=0;r<n.length;++r){const e=n[r].clone(),t=e.w;e.x*=t,e.y*=t,e.z*=t,d[r]=e}for(let r=0;r<=l;++r){const t=d[h-e].clone().multiplyScalar(u[r][0]);for(let n=1;n<=e;++n)t.add(d[h-e+n].clone().multiplyScalar(u[r][n]));c[r]=t}for(let i=l+1;i<=o+1;++i)c[i]=new r.Vector4(0,0,0);return c}function l(e,t){let n=1;for(let i=2;i<=e;++i)n*=i;let r=1;for(let i=2;i<=t;++i)r*=i;for(let i=2;i<=e-t;++i)r*=i;return n/r}function c(e){const t=e.length,n=[],i=[];for(let a=0;a<t;++a){const t=e[a];n[a]=new r.Vector3(t.x,t.y,t.z),i[a]=t.w}const s=[];for(let r=0;r<t;++r){const e=n[r].clone();for(let t=1;t<=r;++t)e.sub(s[r-t].clone().multiplyScalar(l(r,t)*i[t]));s[r]=e.divideScalar(i[0])}return s}t.calcBSplineDerivatives=o,t.calcBSplinePoint=function(e,t,n,a){const o=i(e,a,t),l=s(o,a,e,t),c=new r.Vector4(0,0,0,0);for(let r=0;r<=e;++r){const t=n[o-e+r],i=l[r],s=t.w*i;c.x+=t.x*s,c.y+=t.y*s,c.z+=t.z*s,c.w+=t.w*i}return c},t.calcBasisFunctionDerivatives=a,t.calcBasisFunctions=s,t.calcKoverI=l,t.calcNURBSDerivatives=function(e,t,n,r,i){return c(o(e,t,n,r,i))},t.calcRationalCurveDerivatives=c,t.calcSurfacePoint=function(e,t,n,a,o,l,c,h){const u=i(e,l,n),d=i(t,c,a),p=s(u,l,e,n),f=s(d,c,t,a),m=[];for(let i=0;i<=t;++i){m[i]=new r.Vector4(0,0,0,0);for(let n=0;n<=e;++n){const r=o[u-e+n][d-t+i].clone(),s=r.w;r.x*=s,r.y*=s,r.z*=s,m[i].add(r.multiplyScalar(p[n]))}}const g=new r.Vector4(0,0,0,0);for(let r=0;r<=t;++r)g.add(m[r].multiplyScalar(f[r]));g.divideScalar(g.w),h.set(g.x,g.y,g.z)},t.findSpan=i},75668:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Matrix4,s=new r.Object3D,a=new r.Vector3;class o extends r.EventDispatcher{static createBufferGeometryFromObject(e){let t=new r.BufferGeometry;const n=e.geometry;if(e.isPoints||e.isLine){const e=new r.Float32BufferAttribute(3*n.vertices.length,3),i=new r.Float32BufferAttribute(3*n.colors.length,3);if(t.setAttribute("position",e.copyVector3sArray(n.vertices)),t.setAttribute("color",i.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){const e=new r.Float32BufferAttribute(n.lineDistances.length,1);t.setAttribute("lineDistance",e.copyArray(n.lineDistances))}null!==n.boundingSphere&&(t.boundingSphere=n.boundingSphere.clone()),null!==n.boundingBox&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}constructor(){super(),this.isGeometry=!0,this.uuid=r.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){const t=(new r.Matrix3).getNormalMatrix(e);for(let n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(let n=0,r=this.faces.length;n<r;n++){const e=this.faces[n];e.normal.applyMatrix3(t).normalize();for(let n=0,r=e.vertexNormals.length;n<r;n++)e.vertexNormals[n].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(e){return i.makeRotationX(e),this.applyMatrix4(i),this}rotateY(e){return i.makeRotationY(e),this.applyMatrix4(i),this}rotateZ(e){return i.makeRotationZ(e),this.applyMatrix4(i),this}translate(e,t,n){return i.makeTranslation(e,t,n),this.applyMatrix4(i),this}scale(e,t,n){return i.makeScale(e,t,n),this.applyMatrix4(i),this}lookAt(e){return s.lookAt(e),s.updateMatrix(),this.applyMatrix4(s.matrix),this}fromBufferGeometry(e){const t=this,n=null!==e.index?e.index:void 0,i=e.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const s=i.position,a=i.normal,o=i.color,l=i.uv,h=i.uv2;void 0!==h&&(this.faceVertexUvs[1]=[]);for(let c=0;c<s.count;c++)t.vertices.push((new r.Vector3).fromBufferAttribute(s,c)),void 0!==o&&t.colors.push((new r.Color).fromBufferAttribute(o,c));function u(e,n,i,s){const u=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()],d=void 0===a?[]:[(new r.Vector3).fromBufferAttribute(a,e),(new r.Vector3).fromBufferAttribute(a,n),(new r.Vector3).fromBufferAttribute(a,i)],p=new c(e,n,i,d,u,s);t.faces.push(p),void 0!==l&&t.faceVertexUvs[0].push([(new r.Vector2).fromBufferAttribute(l,e),(new r.Vector2).fromBufferAttribute(l,n),(new r.Vector2).fromBufferAttribute(l,i)]),void 0!==h&&t.faceVertexUvs[1].push([(new r.Vector2).fromBufferAttribute(h,e),(new r.Vector2).fromBufferAttribute(h,n),(new r.Vector2).fromBufferAttribute(h,i)])}const d=e.groups;if(d.length>0)for(let r=0;r<d.length;r++){const e=d[r],t=e.start;for(let r=t,i=t+e.count;r<i;r+=3)void 0!==n?u(n.getX(r),n.getX(r+1),n.getX(r+2),e.materialIndex):u(r,r+1,r+2,e.materialIndex)}else if(void 0!==n)for(let r=0;r<n.count;r+=3)u(n.getX(r),n.getX(r+1),n.getX(r+2));else for(let r=0;r<s.count;r+=3)u(r,r+1,r+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(a).negate(),this.translate(a.x,a.y,a.z),this}normalize(){this.computeBoundingSphere();const e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new r.Matrix4;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(i),this}computeFaceNormals(){const e=new r.Vector3,t=new r.Vector3;for(let n=0,r=this.faces.length;n<r;n++){const r=this.faces[n],i=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];e.subVectors(a,s),t.subVectors(i,s),e.cross(t),e.normalize(),r.normal.copy(e)}}computeVertexNormals(e=!0){const t=new Array(this.vertices.length);for(let n=0,i=this.vertices.length;n<i;n++)t[n]=new r.Vector3;if(e){const e=new r.Vector3,n=new r.Vector3;for(let r=0,i=this.faces.length;r<i;r++){const i=this.faces[r],s=this.vertices[i.a],a=this.vertices[i.b],o=this.vertices[i.c];e.subVectors(o,a),n.subVectors(s,a),e.cross(n),t[i.a].add(e),t[i.b].add(e),t[i.c].add(e)}}else{this.computeFaceNormals();for(let e=0,n=this.faces.length;e<n;e++){const n=this.faces[e];t[n.a].add(n.normal),t[n.b].add(n.normal),t[n.c].add(n.normal)}}for(let n=0,r=this.vertices.length;n<r;n++)t[n].normalize();for(let n=0,r=this.faces.length;n<r;n++){const e=this.faces[n],r=e.vertexNormals;3===r.length?(r[0].copy(t[e.a]),r[1].copy(t[e.b]),r[2].copy(t[e.c])):(r[0]=t[e.a].clone(),r[1]=t[e.b].clone(),r[2]=t[e.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e<t;e++){const t=this.faces[e],n=t.vertexNormals;3===n.length?(n[0].copy(t.normal),n[1].copy(t.normal),n[2].copy(t.normal)):(n[0]=t.normal.clone(),n[1]=t.normal.clone(),n[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t<n;t++){const e=this.faces[t];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]);for(let t=0,n=e.vertexNormals.length;t<n;t++)e.__originalVertexNormals[t]?e.__originalVertexNormals[t].copy(e.vertexNormals[t]):e.__originalVertexNormals[t]=e.vertexNormals[t].clone()}const e=new o;e.faces=this.faces;for(let t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];const e=this.morphNormals[t].faceNormals,n=this.morphNormals[t].vertexNormals;for(let t=0,i=this.faces.length;t<i;t++){const t=new r.Vector3,i={a:new r.Vector3,b:new r.Vector3,c:new r.Vector3};e.push(t),n.push(i)}}const n=this.morphNormals[t];e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals();for(let e=0,t=this.faces.length;e<t;e++){const t=this.faces[e],r=n.faceNormals[e],i=n.vertexNormals[e];r.copy(t.normal),i.a.copy(t.vertexNormals[0]),i.b.copy(t.vertexNormals[1]),i.c.copy(t.vertexNormals[2])}}for(let t=0,n=this.faces.length;t<n;t++){const e=this.faces[t];e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals}}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new r.Box3),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),this.boundingSphere.setFromPoints(this.vertices)}merge(e,t,n=0){if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);let i;const s=this.vertices.length,a=this.vertices,o=e.vertices,l=this.faces,h=e.faces,u=this.colors,d=e.colors;void 0!==t&&(i=(new r.Matrix3).getNormalMatrix(t));for(let r=0,c=o.length;r<c;r++){const e=o[r].clone();void 0!==t&&e.applyMatrix4(t),a.push(e)}for(let r=0,c=d.length;r<c;r++)u.push(d[r].clone());for(let r=0,p=h.length;r<p;r++){const e=h[r];let t,a;const o=e.vertexNormals,u=e.vertexColors,d=new c(e.a+s,e.b+s,e.c+s);d.normal.copy(e.normal),void 0!==i&&d.normal.applyMatrix3(i).normalize();for(let n=0,r=o.length;n<r;n++)t=o[n].clone(),void 0!==i&&t.applyMatrix3(i).normalize(),d.vertexNormals.push(t);d.color.copy(e.color);for(let n=0,r=u.length;n<r;n++)a=u[n],d.vertexColors.push(a.clone());d.materialIndex=e.materialIndex+n,l.push(d)}for(let r=0,c=e.faceVertexUvs.length;r<c;r++){const t=e.faceVertexUvs[r];void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]);for(let e=0,n=t.length;e<n;e++){const n=t[e],i=[];for(let e=0,t=n.length;e<t;e++)i.push(n[e].clone());this.faceVertexUvs[r].push(i)}}}mergeMesh(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)}mergeVertices(e=4){const t={},n=[],r=[],i=Math.pow(10,e);for(let o=0,l=this.vertices.length;o<l;o++){const e=this.vertices[o],s=`${Math.round(e.x*i)}_${Math.round(e.y*i)}_${Math.round(e.z*i)}`;void 0===t[s]?(t[s]=o,n.push(this.vertices[o]),r[o]=n.length-1):r[o]=r[t[s]]}const s=[];for(let o=0,l=this.faces.length;o<l;o++){const e=this.faces[o];e.a=r[e.a],e.b=r[e.b],e.c=r[e.c];const t=[e.a,e.b,e.c];for(let n=0;n<3;n++)if(t[n]===t[(n+1)%3]){s.push(o);break}}for(let o=s.length-1;o>=0;o--){const e=s[o];this.faces.splice(e,1);for(let t=0,n=this.faceVertexUvs.length;t<n;t++)this.faceVertexUvs[t].splice(e,1)}const a=this.vertices.length-n.length;return this.vertices=n,a}setFromPoints(e){this.vertices=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];this.vertices.push(new r.Vector3(n.x,n.y,n.z||0))}return this}sortFacesByMaterialIndex(){const e=this.faces,t=e.length;for(let a=0;a<t;a++)e[a]._id=a;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));const n=this.faceVertexUvs[0],r=this.faceVertexUvs[1];let i,s;n&&n.length===t&&(i=[]),r&&r.length===t&&(s=[]);for(let a=0;a<t;a++){const t=e[a]._id;i&&i.push(n[t]),s&&s.push(r[t])}i&&(this.faceVertexUvs[0]=i),s&&(this.faceVertexUvs[1]=s)}toJSON(){const e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){const t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}const t=[];for(let p=0;p<this.vertices.length;p++){const e=this.vertices[p];t.push(e.x,e.y,e.z)}const n=[],r=[],i={},s=[],a={},o=[],l={};for(let p=0;p<this.faces.length;p++){const e=this.faces[p],t=!0,r=!1,i=void 0!==this.faceVertexUvs[0][p],s=e.normal.length()>0,a=e.vertexNormals.length>0,o=1!==e.color.r||1!==e.color.g||1!==e.color.b,l=e.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,t),f=c(f,2,r),f=c(f,3,i),f=c(f,4,s),f=c(f,5,a),f=c(f,6,o),f=c(f,7,l),n.push(f),n.push(e.a,e.b,e.c),n.push(e.materialIndex),i){const e=this.faceVertexUvs[0][p];n.push(d(e[0]),d(e[1]),d(e[2]))}if(s&&n.push(h(e.normal)),a){const t=e.vertexNormals;n.push(h(t[0]),h(t[1]),h(t[2]))}if(o&&n.push(u(e.color)),l){const t=e.vertexColors;n.push(u(t[0]),u(t[1]),u(t[2]))}}function c(e,t,n){return n?e|1<<t:e&~(1<<t)}function h(e){const t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==i[t]||(i[t]=r.length/3,r.push(e.x,e.y,e.z)),i[t]}function u(e){const t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==a[t]||(a[t]=s.length,s.push(e.getHex())),a[t]}function d(e){const t=e.x.toString()+e.y.toString();return void 0!==l[t]||(l[t]=o.length/2,o.push(e.x,e.y)),l[t]}return e.data={},e.data.vertices=t,e.data.normals=r,s.length>0&&(e.data.colors=s),o.length>0&&(e.data.uvs=[o]),e.data.faces=n,e}clone(){return(new o).copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;const t=e.vertices;for(let u=0,d=t.length;u<d;u++)this.vertices.push(t[u].clone());const n=e.colors;for(let u=0,d=n.length;u<d;u++)this.colors.push(n[u].clone());const r=e.faces;for(let u=0,d=r.length;u<d;u++)this.faces.push(r[u].clone());for(let u=0,d=e.faceVertexUvs.length;u<d;u++){const t=e.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let e=0,n=t.length;e<n;e++){const n=t[e],r=[];for(let e=0,t=n.length;e<t;e++){const t=n[e];r.push(t.clone())}this.faceVertexUvs[u].push(r)}}const i=e.morphTargets;for(let u=0,d=i.length;u<d;u++){const e={};if(e.name=i[u].name,void 0!==i[u].vertices){e.vertices=[];for(let t=0,n=i[u].vertices.length;t<n;t++)e.vertices.push(i[u].vertices[t].clone())}if(void 0!==i[u].normals){e.normals=[];for(let t=0,n=i[u].normals.length;t<n;t++)e.normals.push(i[u].normals[t].clone())}this.morphTargets.push(e)}const s=e.morphNormals;for(let u=0,d=s.length;u<d;u++){const e={};if(void 0!==s[u].vertexNormals){e.vertexNormals=[];for(let t=0,n=s[u].vertexNormals.length;t<n;t++){const n=s[u].vertexNormals[t],r={};r.a=n.a.clone(),r.b=n.b.clone(),r.c=n.c.clone(),e.vertexNormals.push(r)}}if(void 0!==s[u].faceNormals){e.faceNormals=[];for(let t=0,n=s[u].faceNormals.length;t<n;t++)e.faceNormals.push(s[u].faceNormals[t].clone())}this.morphNormals.push(e)}const a=e.skinWeights;for(let u=0,d=a.length;u<d;u++)this.skinWeights.push(a[u].clone());const o=e.skinIndices;for(let u=0,d=o.length;u<d;u++)this.skinIndices.push(o[u].clone());const l=e.lineDistances;for(let u=0,d=l.length;u<d;u++)this.lineDistances.push(l[u]);const c=e.boundingBox;null!==c&&(this.boundingBox=c.clone());const h=e.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}toBufferGeometry(){const e=(new l).fromGeometry(this),t=new r.BufferGeometry,n=new Float32Array(3*e.vertices.length);if(t.setAttribute("position",new r.BufferAttribute(n,3).copyVector3sArray(e.vertices)),e.normals.length>0){const n=new Float32Array(3*e.normals.length);t.setAttribute("normal",new r.BufferAttribute(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const n=new Float32Array(3*e.colors.length);t.setAttribute("color",new r.BufferAttribute(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const n=new Float32Array(2*e.uvs.length);t.setAttribute("uv",new r.BufferAttribute(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const n=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",new r.BufferAttribute(n,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){const n=[],s=e.morphTargets[i];for(let e=0,t=s.length;e<t;e++){const t=s[e],i=new r.Float32BufferAttribute(3*t.data.length,3);i.name=t.name,n.push(i.copyVector3sArray(t.data))}t.morphAttributes[i]=n}if(e.skinIndices.length>0){const n=new r.Float32BufferAttribute(4*e.skinIndices.length,4);t.setAttribute("skinIndex",n.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const n=new r.Float32BufferAttribute(4*e.skinWeights.length,4);t.setAttribute("skinWeight",n.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}}class l{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){const t=[];let n,r,i;const s=e.faces;for(r=0;r<s.length;r++){const e=s[r];e.materialIndex!==i&&(i=e.materialIndex,void 0!==n&&(n.count=3*r-n.start,t.push(n)),n={start:3*r,materialIndex:i})}void 0!==n&&(n.count=3*r-n.start,t.push(n)),this.groups=t}fromGeometry(e){const t=e.faces,n=e.vertices,i=e.faceVertexUvs,s=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,o=e.morphTargets,l=o.length;let c;if(l>0){c=[];for(let e=0;e<l;e++)c[e]={name:o[e].name,data:[]};this.morphTargets.position=c}const h=e.morphNormals,u=h.length;let d;if(u>0){d=[];for(let e=0;e<u;e++)d[e]={name:h[e].name,data:[]};this.morphTargets.normal=d}const p=e.skinIndices,f=e.skinWeights,m=p.length===n.length,g=f.length===n.length;n.length>0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let A=0;A<t.length;A++){const e=t[A];this.vertices.push(n[e.a],n[e.b],n[e.c]);const v=e.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{const t=e.normal;this.normals.push(t,t,t)}const y=e.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const t=e.color;this.colors.push(t,t,t)}if(!0===s){const e=i[0][A];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",A),this.uvs.push(new r.Vector2,new r.Vector2,new r.Vector2))}if(!0===a){const e=i[1][A];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",A),this.uvs2.push(new r.Vector2,new r.Vector2,new r.Vector2))}for(let t=0;t<l;t++){const n=o[t].vertices;c[t].data.push(n[e.a],n[e.b],n[e.c])}for(let t=0;t<u;t++){const e=h[t].vertexNormals[A];d[t].data.push(e.a,e.b,e.c)}m&&this.skinIndices.push(p[e.a],p[e.b],p[e.c]),g&&this.skinWeights.push(f[e.a],f[e.b],f[e.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}}class c{constructor(e,t,n,i,s,a=0){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new r.Vector3,this.vertexNormals=Array.isArray(i)?i:[],this.color=s&&s.isColor?s:new r.Color,this.vertexColors=Array.isArray(s)?s:[],this.materialIndex=a}clone(){return(new this.constructor).copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(let t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}}t.Face3=c,t.Geometry=o},30675:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.AnaglyphEffect=class{constructor(e,t=512,n=512){this.colorMatrixLeft=(new r.Matrix3).fromArray([.4561,-.0400822,-.0152161,.500484,-.0378246,-.0205971,.176381,-.0157589,-.00546856]),this.colorMatrixRight=(new r.Matrix3).fromArray([-.0434706,.378476,-.0721527,-.0879388,.73364,-.112961,-.00155529,-.0184503,1.2264]);const i=new r.OrthographicCamera(-1,1,1,-1,0,1),s=new r.Scene,a=new r.StereoCamera,o={minFilter:r.LinearFilter,magFilter:r.NearestFilter,format:r.RGBAFormat},l=new r.WebGLRenderTarget(t,n,o),c=new r.WebGLRenderTarget(t,n,o),h=new r.ShaderMaterial({uniforms:{mapLeft:{value:l.texture},mapRight:{value:c.texture},colorMatrixLeft:{value:this.colorMatrixLeft},colorMatrixRight:{value:this.colorMatrixRight}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = vec2( uv.x, uv.y );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","uniform mat3 colorMatrixLeft;","uniform mat3 colorMatrixRight;","void main() {","\tvec2 uv = vUv;","\tvec4 colorL = texture2D( mapLeft, uv );","\tvec4 colorR = texture2D( mapRight, uv );","\tvec3 color = clamp(","\t\t\tcolorMatrixLeft * colorL.rgb +","\t\t\tcolorMatrixRight * colorR.rgb, 0., 1. );","\tgl_FragColor = vec4(","\t\t\tcolor.r, color.g, color.b,","\t\t\tmax( colorL.a, colorR.a ) );","\t#include <tonemapping_fragment>",`\t#include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>`,"}"].join("\n")}),u=new r.Mesh(new r.PlaneGeometry(2,2),h);s.add(u),this.setSize=function(t,n){e.setSize(t,n);const r=e.getPixelRatio();l.setSize(t*r,n*r),c.setSize(t*r,n*r)},this.render=function(t,n){const r=e.getRenderTarget();!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===n.parent&&!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),a.update(n),e.setRenderTarget(l),e.clear(),e.render(t,a.cameraL),e.setRenderTarget(c),e.clear(),e.render(t,a.cameraR),e.setRenderTarget(null),e.render(s,i),e.setRenderTarget(r)},this.dispose=function(){l.dispose(),c.dispose(),u.geometry.dispose(),u.material.dispose()}}}},19574:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.AsciiEffect=class{constructor(e,t=" .:-=+*#%@",n={}){const r=n.resolution||.15,i=n.scale||1,s=n.color||!1,a=n.alpha||!1,o=n.block||!1,l=n.invert||!1,c=n.strResolution||"low";let h,u;const d=document.createElement("div");d.style.cursor="default";const p=document.createElement("table");let f,m,g;d.appendChild(p),this.setSize=function(t,n){h=t,u=n,e.setSize(t,n),function(){f=Math.floor(h*r),m=Math.floor(u*r),b.width=f,b.height=m,g=e.domElement,g.style.backgroundColor&&(p.rows[0].cells[0].style.backgroundColor=g.style.backgroundColor,p.rows[0].cells[0].style.color=g.style.color);p.cellSpacing=0,p.cellPadding=0;const t=p.style;t.whiteSpace="pre",t.margin="0px",t.padding="0px",t.letterSpacing=M+"px",t.fontFamily=y,t.fontSize=S+"px",t.lineHeight=w+"px",t.textAlign="left",t.textDecoration="none"}()},this.render=function(t,n){e.render(t,n),function(e){E.clearRect(0,0,f,m),E.drawImage(x,0,0,f,m);const t=E.getImageData(0,0,f,m).data;let n="";for(let r=0;r<m;r+=2){for(let e=0;e<f;e++){const i=4*(r*f+e),c=t[i],h=t[i+1],u=t[i+2],d=t[i+3];let p,m;m=(.3*c+.59*h+.11*u)/255,0==d&&(m=1),p=Math.floor((1-m)*(_.length-1)),l&&(p=_.length-p-1);let g=_[p];void 0!==g&&" "!=g||(g="&nbsp;"),n+=s?"<span style='color:rgb("+c+","+h+","+u+");"+(o?"background-color:rgb("+c+","+h+","+u+");":"")+(a?"opacity:"+d/255+";":"")+"'>"+g+"</span>":g}n+="<br/>"}e.innerHTML=`<tr><td style="display:block;width:${h}px;height:${u}px;overflow:hidden">${n}</td></tr>`}(p)},this.domElement=d;const A=" .,:;i1tfLCG08@".split(""),v=" CGO08@".split(""),y="courier new, monospace",x=e.domElement,b=document.createElement("canvas");if(!b.getContext)return;const E=b.getContext("2d");if(!E.getImageData)return;let _=s?v:A;t&&(_=t);const S=2/r*i,w=2/r*i;let M=0;if("low"==c)switch(i){case 1:M=-1;break;case 2:case 3:M=-2.1;break;case 4:M=-3.1;break;case 5:M=-4.15}if("medium"==c)switch(i){case 1:M=0;break;case 2:M=-1;break;case 3:M=-1.04;break;case 4:case 5:M=-2.1}if("high"==c)switch(i){case 1:case 2:M=0;break;case 3:case 4:case 5:M=-1}}}},71253:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.OutlineEffect=class{constructor(e,t={}){this.enabled=!0;const n=void 0!==t.defaultThickness?t.defaultThickness:.003,i=(new r.Color).fromArray(void 0!==t.defaultColor?t.defaultColor:[0,0,0]),s=void 0!==t.defaultAlpha?t.defaultAlpha:1,a=void 0!==t.defaultKeepAlive&&t.defaultKeepAlive,o={},l={},c={},h={outlineThickness:{value:n},outlineColor:{value:i},outlineAlpha:{value:s}},u=["#include <common>","#include <uv_pars_vertex>","#include <displacementmap_pars_vertex>","#include <fog_pars_vertex>","#include <morphtarget_pars_vertex>","#include <skinning_pars_vertex>","#include <logdepthbuf_pars_vertex>","#include <clipping_planes_pars_vertex>","uniform float outlineThickness;","vec4 calculateOutline( vec4 pos, vec3 normal, vec4 skinned ) {","\tfloat thickness = outlineThickness;","\tconst float ratio = 1.0;","\tvec4 pos2 = projectionMatrix * modelViewMatrix * vec4( skinned.xyz + normal, 1.0 );","\tvec4 norm = normalize( pos - pos2 );","\treturn pos + norm * thickness * pos.w * ratio;","}","void main() {","\t#include <uv_vertex>","\t#include <beginnormal_vertex>","\t#include <morphnormal_vertex>","\t#include <skinbase_vertex>","\t#include <skinnormal_vertex>","\t#include <begin_vertex>","\t#include <morphtarget_vertex>","\t#include <skinning_vertex>","\t#include <displacementmap_vertex>","\t#include <project_vertex>","\tvec3 outlineNormal = - objectNormal;","\tgl_Position = calculateOutline( gl_Position, outlineNormal, vec4( transformed, 1.0 ) );","\t#include <logdepthbuf_vertex>","\t#include <clipping_planes_vertex>","\t#include <fog_vertex>","}"].join("\n"),d=["#include <common>","#include <fog_pars_fragment>","#include <logdepthbuf_pars_fragment>","#include <clipping_planes_pars_fragment>","uniform vec3 outlineColor;","uniform float outlineAlpha;","void main() {","\t#include <clipping_planes_fragment>","\t#include <logdepthbuf_fragment>","\tgl_FragColor = vec4( outlineColor, outlineAlpha );","\t#include <tonemapping_fragment>",`\t#include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>`,"\t#include <fog_fragment>","\t#include <premultiplied_alpha_fragment>","}"].join("\n");function p(e){const t=function(e){let t=o[e.uuid];return void 0===t&&(t={material:new r.ShaderMaterial({type:"OutlineEffect",uniforms:r.UniformsUtils.merge([r.UniformsLib.fog,r.UniformsLib.displacementmap,h]),vertexShader:u,fragmentShader:d,side:r.BackSide}),used:!0,keepAlive:a,count:0},o[e.uuid]=t),t.used=!0,t.material}(e);return l[t.uuid]=e,function(e,t){if("invisible"===e.name)return;const n=t.userData.outlineParameters;e.fog=t.fog,e.toneMapped=t.toneMapped,e.premultipliedAlpha=t.premultipliedAlpha,e.displacementMap=t.displacementMap,void 0!==n?(!1===t.visible?e.visible=!1:e.visible=void 0===n.visible||n.visible,e.transparent=void 0!==n.alpha&&n.alpha<1||t.transparent,void 0!==n.keepAlive&&(o[t.uuid].keepAlive=n.keepAlive)):(e.transparent=t.transparent,e.visible=t.visible);!0!==t.wireframe&&!1!==t.depthTest||(e.visible=!1);t.clippingPlanes&&(e.clipping=!0,e.clippingPlanes=t.clippingPlanes,e.clipIntersection=t.clipIntersection,e.clipShadows=t.clipShadows);e.version=t.version}(t,e),t}function f(e){const t=e.geometry,n=void 0!==t&&void 0!==t.attributes.normal;return!0===e.isMesh&&void 0!==e.material&&!0===n}function m(e){if(!1!==f(e)){if(Array.isArray(e.material))for(let t=0,n=e.material.length;t<n;t++)e.material[t]=p(e.material[t]);else e.material=p(e.material);c[e.uuid]=e.onBeforeRender,e.onBeforeRender=A}}function g(e){if(!1!==f(e)){if(Array.isArray(e.material))for(let t=0,n=e.material.length;t<n;t++)e.material[t]=l[e.material[t].uuid];else e.material=l[e.material.uuid];e.onBeforeRender=c[e.uuid]}}function A(e,t,n,r,i){const s=l[i.uuid];void 0!==s&&function(e,t){const n=t.userData.outlineParameters;e.uniforms.outlineAlpha.value=t.opacity,void 0!==n&&(void 0!==n.thickness&&(e.uniforms.outlineThickness.value=n.thickness),void 0!==n.color&&e.uniforms.outlineColor.value.fromArray(n.color),void 0!==n.alpha&&(e.uniforms.outlineAlpha.value=n.alpha));t.displacementMap&&(e.uniforms.displacementMap.value=t.displacementMap,e.uniforms.displacementScale.value=t.displacementScale,e.uniforms.displacementBias.value=t.displacementBias)}(i,s)}this.render=function(t,n){if(!1===this.enabled)return void e.render(t,n);const r=e.autoClear;e.autoClear=this.autoClear,e.render(t,n),e.autoClear=r,this.renderOutline(t,n)},this.renderOutline=function(t,n){const r=e.autoClear,i=t.matrixWorldAutoUpdate,s=t.background,a=e.shadowMap.enabled;t.matrixWorldAutoUpdate=!1,t.background=null,e.autoClear=!1,e.shadowMap.enabled=!1,t.traverse(m),e.render(t,n),t.traverse(g),function(){let e;e=Object.keys(l);for(let t=0,n=e.length;t<n;t++)l[e[t]]=void 0;e=Object.keys(c);for(let t=0,n=e.length;t<n;t++)c[e[t]]=void 0;e=Object.keys(o);for(let t=0,n=e.length;t<n;t++){const n=e[t];!1===o[n].used?(o[n].count++,!1===o[n].keepAlive&&o[n].count>60&&delete o[n]):(o[n].used=!1,o[n].count=0)}}(),t.matrixWorldAutoUpdate=i,t.background=s,e.autoClear=r,e.shadowMap.enabled=a},this.autoClear=e.autoClear,this.domElement=e.domElement,this.shadowMap=e.shadowMap,this.clear=function(t,n,r){e.clear(t,n,r)},this.getPixelRatio=function(){return e.getPixelRatio()},this.setPixelRatio=function(t){e.setPixelRatio(t)},this.getSize=function(t){return e.getSize(t)},this.setSize=function(t,n,r){e.setSize(t,n,r)},this.setViewport=function(t,n,r,i){e.setViewport(t,n,r,i)},this.setScissor=function(t,n,r,i){e.setScissor(t,n,r,i)},this.setScissorTest=function(t){e.setScissorTest(t)},this.setRenderTarget=function(t){e.setRenderTarget(t)}}}},24826:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.ParallaxBarrierEffect=class{constructor(e){const t=new r.OrthographicCamera(-1,1,1,-1,0,1),n=new r.Scene,i=new r.StereoCamera,s={minFilter:r.LinearFilter,magFilter:r.NearestFilter,format:r.RGBAFormat},a=new r.WebGLRenderTarget(512,512,s),o=new r.WebGLRenderTarget(512,512,s),l=new r.ShaderMaterial({uniforms:{mapLeft:{value:a.texture},mapRight:{value:o.texture}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = vec2( uv.x, uv.y );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","void main() {","\tvec2 uv = vUv;","\tif ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {","\t\tgl_FragColor = texture2D( mapLeft, uv );","\t} else {","\t\tgl_FragColor = texture2D( mapRight, uv );","\t}","\t#include <tonemapping_fragment>",`\t#include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>`,"}"].join("\n")}),c=new r.Mesh(new r.PlaneGeometry(2,2),l);n.add(c),this.setSize=function(t,n){e.setSize(t,n);const r=e.getPixelRatio();a.setSize(t*r,n*r),o.setSize(t*r,n*r)},this.render=function(r,s){!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),null===s.parent&&!0===s.matrixWorldAutoUpdate&&s.updateMatrixWorld(),i.update(s),e.setRenderTarget(a),e.clear(),e.render(r,i.cameraL),e.setRenderTarget(o),e.clear(),e.render(r,i.cameraR),e.setRenderTarget(null),e.render(n,t)}}}},18233:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.PeppersGhostEffect=class{constructor(e){const t=this;let n,i,s;t.cameraDistance=15,t.reflectFromAbove=!1;const a=new r.PerspectiveCamera,o=new r.PerspectiveCamera,l=new r.PerspectiveCamera,c=new r.PerspectiveCamera,h=new r.Vector3,u=new r.Quaternion,d=new r.Vector3;e.autoClear=!1,this.setSize=function(t,r){n=t/2,t<r?(i=t/3,s=t/3):(i=r/3,s=r/3),e.setSize(t,r)},this.render=function(r,p){!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),null===p.parent&&!0===p.matrixWorldAutoUpdate&&p.updateMatrixWorld(),p.matrixWorld.decompose(h,u,d),a.position.copy(h),a.quaternion.copy(u),a.translateZ(t.cameraDistance),a.lookAt(r.position),o.position.copy(h),o.quaternion.copy(u),o.translateZ(-t.cameraDistance),o.lookAt(r.position),o.rotation.z+=Math.PI/180*180,l.position.copy(h),l.quaternion.copy(u),l.translateX(-t.cameraDistance),l.lookAt(r.position),l.rotation.x+=Math.PI/180*90,c.position.copy(h),c.quaternion.copy(u),c.translateX(t.cameraDistance),c.lookAt(r.position),c.rotation.x+=Math.PI/180*90,e.clear(),e.setScissorTest(!0),e.setScissor(n-i/2,2*s,i,s),e.setViewport(n-i/2,2*s,i,s),t.reflectFromAbove?e.render(r,o):e.render(r,a),e.setScissor(n-i/2,0,i,s),e.setViewport(n-i/2,0,i,s),t.reflectFromAbove?e.render(r,a):e.render(r,o),e.setScissor(n-i/2-i,s,i,s),e.setViewport(n-i/2-i,s,i,s),t.reflectFromAbove?e.render(r,c):e.render(r,l),e.setScissor(n+i/2,s,i,s),e.setViewport(n+i/2,s,i,s),t.reflectFromAbove?e.render(r,l):e.render(r,c),e.setScissorTest(!1)}}}},92701:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.StereoEffect=class{constructor(e){const t=new r.StereoCamera;t.aspect=.5;const n=new r.Vector2;this.setEyeSeparation=function(e){t.eyeSep=e},this.setSize=function(t,n){e.setSize(t,n)},this.render=function(r,i){!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),null===i.parent&&!0===i.matrixWorldAutoUpdate&&i.updateMatrixWorld(),t.update(i),e.getSize(n),e.autoClear&&e.clear(),e.setScissorTest(!0),e.setScissor(0,0,n.width/2,n.height),e.setViewport(0,0,n.width/2,n.height),e.render(r,t.cameraL),e.setScissor(n.width/2,0,n.width/2,n.height),e.setViewport(n.width/2,0,n.width/2,n.height),e.render(r,t.cameraR),e.setScissorTest(!1)}}}},53374:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const i=r(n(85232));t.RoomEnvironment=function(){const e=new i.Scene,t=new i.BoxGeometry;t.deleteAttribute("uv");const n=new i.MeshStandardMaterial({side:i.BackSide}),r=new i.MeshStandardMaterial,s=new i.PointLight(16777215,5,28,2);s.position.set(.418,16.199,.3),e.add(s);const a=new i.Mesh(t,n);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),e.add(a);const o=new i.Mesh(t,r);o.position.set(-10.906,2.009,1.846),o.rotation.set(0,-.195,0),o.scale.set(2.328,7.905,4.651),e.add(o);const l=new i.Mesh(t,r);l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),e.add(l);const c=new i.Mesh(t,r);c.position.set(6.167,.857,7.803),c.rotation.set(0,.561,0),c.scale.set(3.927,6.285,3.687),e.add(c);const h=new i.Mesh(t,r);h.position.set(-2.017,.018,6.124),h.rotation.set(0,.333,0),h.scale.set(2.002,4.566,2.064),e.add(h);const u=new i.Mesh(t,r);u.position.set(2.291,-.756,-2.621),u.rotation.set(0,-.286,0),u.scale.set(1.546,1.552,1.496),e.add(u);const d=new i.Mesh(t,r);d.position.set(-2.193,-.369,-5.547),d.rotation.set(0,.516,0),d.scale.set(3.875,3.487,2.986),e.add(d);const p=new i.Mesh(t,y(50));p.position.set(-16.116,14.37,8.208),p.scale.set(.1,2.428,2.739),e.add(p);const f=new i.Mesh(t,y(50));f.position.set(-16.109,18.021,-8.207),f.scale.set(.1,2.425,2.751),e.add(f);const m=new i.Mesh(t,y(17));m.position.set(14.904,12.198,-1.832),m.scale.set(.15,4.265,6.331),e.add(m);const g=new i.Mesh(t,y(43));g.position.set(-.462,8.89,14.52),g.scale.set(4.38,5.441,.088),e.add(g);const A=new i.Mesh(t,y(20));A.position.set(3.235,11.486,-12.541),A.scale.set(2.5,2,.1),e.add(A);const v=new i.Mesh(t,y(100));function y(e){const t=new i.MeshBasicMaterial;return t.color.setScalar(e),t}return v.position.set(0,20,0),v.scale.set(1,.1,1),e.add(v),e}},19338:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);t.ColladaExporter=class{constructor(){i(this,"options"),i(this,"geometryInfo"),i(this,"materialMap"),i(this,"imageMap"),i(this,"textures"),i(this,"libraryImages"),i(this,"libraryGeometries"),i(this,"libraryEffects"),i(this,"libraryMaterials"),i(this,"canvas"),i(this,"ctx"),i(this,"transMat"),i(this,"getFuncs",["getX","getY","getZ","getW"]),this.options={version:"1.4.1",author:null,textureDirectory:"",upAxis:"Y_UP",unitName:null,unitMeter:null},this.geometryInfo=new WeakMap,this.materialMap=new WeakMap,this.imageMap=new WeakMap,this.textures=[],this.libraryImages=[],this.libraryGeometries=[],this.libraryEffects=[],this.libraryMaterials=[],this.canvas=null,this.ctx=null,this.transMat=null}parse(e,t,n={}){if(this.options={...this.options,...n},null===this.options.upAxis.match(/^[XYZ]_UP$/))return console.error("ColladaExporter: Invalid upAxis: valid values are X_UP, Y_UP or Z_UP."),null;if(null!==this.options.unitName&&null===this.options.unitMeter)return console.error("ColladaExporter: unitMeter needs to be specified if unitName is specified."),null;if(null!==this.options.unitMeter&&null===this.options.unitName)return console.error("ColladaExporter: unitName needs to be specified if unitMeter is specified."),null;if(""!==this.options.textureDirectory&&(this.options.textureDirectory=`${this.options.textureDirectory}/`.replace(/\\/g,"/").replace(/\/+/g,"/")),"1.4.1"!==this.options.version&&"1.5.0"!==this.options.version)return console.warn(`ColladaExporter : Version ${this.options.version} not supported for export. Only 1.4.1 and 1.5.0.`),null;const r=this.processObject(e);let i=`<?xml version="1.0" encoding="UTF-8" standalone="no" ?><COLLADA xmlns="${"1.4.1"===this.options.version?"http://www.collada.org/2005/11/COLLADASchema":"https://www.khronos.org/collada/"}" version="${this.options.version}"><asset><contributor><authoring_tool>three.js Collada Exporter</authoring_tool>${null!==this.options.author?`<author>${this.options.author}</author>`:""}</contributor><created>${(new Date).toISOString()}</created><modified>${(new Date).toISOString()}</modified><up_axis>Y_UP</up_axis></asset>`;i+=`<library_images>${this.libraryImages.join("")}</library_images>`,i+=`<library_effects>${this.libraryEffects.join("")}</library_effects>`,i+=`<library_materials>${this.libraryMaterials.join("")}</library_materials>`,i+=`<library_geometries>${this.libraryGeometries.join("")}</library_geometries>`,i+=`<library_visual_scenes><visual_scene id="Scene" name="scene">${r}</visual_scene></library_visual_scenes>`,i+='<scene><instance_visual_scene url="#Scene"/></scene>',i+="</COLLADA>";const s={data:this.format(i),textures:this.textures};return"function"==typeof t&&requestAnimationFrame((()=>t(s))),s}format(e){var t,n;const r=/^<\//,i=/(\?>$)|(\/>$)/,s=/<[^>]+>[^<]*<\/[^<]+>/,a=(e,t)=>t>0?e+a(e,t-1):"";let o=0;return null!=(n=null==(t=e.match(/(<[^>]+>[^<]+<\/[^<]+>)|(<[^>]+>)/g))?void 0:t.map((e=>{s.test(e)||i.test(e)||!r.test(e)||o--;const t=`${a(" ",o)}${e}`;return s.test(e)||i.test(e)||r.test(e)||o++,t})).join("\n"))?n:""}base64ToBuffer(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0,i=n.length;r<i;r++)n[r]=t.charCodeAt(r);return n}imageToData(e,t){var n;this.canvas=this.canvas||document.createElement("canvas"),this.ctx=this.ctx||this.canvas.getContext("2d"),this.canvas.width=e.width instanceof SVGAnimatedLength?0:e.width,this.canvas.height=e.height instanceof SVGAnimatedLength?0:e.height,null==(n=this.ctx)||n.drawImage(e,0,0);const r=this.canvas.toDataURL(`image/${t}`,1).replace(/^data:image\/(png|jpg);base64,/,"");return this.base64ToBuffer(r)}attrBufferToArray(e){if(e instanceof s.InterleavedBufferAttribute&&e.isInterleavedBufferAttribute){const t=new(0,e.array.constructor)(e.count*e.itemSize),n=e.itemSize;for(let r=0,i=e.count;r<i;r++)for(let s=0;s<n;s++)t[r*n+s]=e[this.getFuncs[s]](r);return t}return e.array}subArray(e,t,n){if(Array.isArray(e))return e.slice(t,t+n);return new(0,e.constructor)(e.buffer,t*e.BYTES_PER_ELEMENT,n)}getAttribute(e,t,n,r){const i=this.attrBufferToArray(e);return Array.isArray(i)?`${`<source id="${t}"><float_array id="${t}-array" count="${i.length}">`+i.join(" ")}</float_array><technique_common><accessor source="#${t}-array" count="${Math.floor(i.length/e.itemSize)}" stride="${e.itemSize}">${n.map((e=>`<param name="${e}" type="${r}" />`)).join("")}</accessor></technique_common></source>`:""}getTransform(e){return e.updateMatrix(),this.transMat=this.transMat||new s.Matrix4,this.transMat.copy(e.matrix),this.transMat.transpose(),`<matrix>${this.transMat.toArray().join(" ")}</matrix>`}processGeometry(e){let t=this.geometryInfo.get(e);if(!t){const n=e;if(!n.isBufferGeometry)throw new Error("THREE.ColladaExporter: Geometry is not of type THREE.BufferGeometry.");const r=`Mesh${this.libraryGeometries.length+1}`,i=n.index?n.index.count*n.index.itemSize:n.attributes.position.count,s=null!=n.groups&&0!==n.groups.length?n.groups:[{start:0,count:i,materialIndex:0}];let a=`<geometry id="${r}"${e.name?` name="${e.name}"`:""}><mesh>`;const o=`${r}-position`,l=`${r}-vertices`;a+=this.getAttribute(n.attributes.position,o,["X","Y","Z"],"float"),a+=`<vertices id="${l}"><input semantic="POSITION" source="#${o}" /></vertices>`;let c=`<input semantic="VERTEX" source="#${l}" offset="0" />`;if("normal"in n.attributes){const e=`${r}-normal`;a+=this.getAttribute(n.attributes.normal,e,["X","Y","Z"],"float"),c+=`<input semantic="NORMAL" source="#${e}" offset="0" />`}if("uv"in n.attributes){const e=`${r}-texcoord`;a+=this.getAttribute(n.attributes.uv,e,["S","T"],"float"),c+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="0" />`}if("uv2"in n.attributes){const e=`${r}-texcoord2`;a+=this.getAttribute(n.attributes.uv2,e,["S","T"],"float"),c+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="1" />`}if("color"in n.attributes){const e=`${r}-color`;a+=this.getAttribute(n.attributes.color,e,["X","Y","Z"],"uint8"),c+=`<input semantic="COLOR" source="#${e}" offset="0" />`}let h=null;if(n.index)h=this.attrBufferToArray(n.index);else{h=new Array(i);for(let e=0,t=h.length;e<t&&Array.isArray(h);e++)h[e]=e}for(let e=0,t=s.length;e<t;e++){const t=s[e],n=this.subArray(h,t.start,t.count),r=n.length/3;a+=`<triangles material="MESH_MATERIAL_${t.materialIndex}" count="${r}">`,a+=c,a+=`<p>${n.join(" ")}</p>`,a+="</triangles>"}a+="</mesh></geometry>",this.libraryGeometries.push(a),t={meshid:r,bufferGeometry:n},this.geometryInfo.set(e,t)}return t}processTexture(e){let t=this.imageMap.get(e);if(null==t){t=`image-${this.libraryImages.length+1}`;const n="png",r=e.name||t;let i=`<image id="${t}" name="${r}">`;"1.5.0"===this.options.version?i+=`<init_from><ref>${this.options.textureDirectory}${r}.${n}</ref></init_from>`:i+=`<init_from>${this.options.textureDirectory}${r}.${n}</init_from>`,i+="</image>",this.libraryImages.push(i),this.imageMap.set(e,t),this.textures.push({directory:this.options.textureDirectory,name:r,ext:n,data:this.imageToData(e.image,n),original:e})}return t}processMaterial(e){let t=this.materialMap.get(e);if(null==t){t=`Mat${this.libraryEffects.length+1}`;let n="phong";if(e instanceof s.MeshLambertMaterial?n="lambert":e instanceof s.MeshBasicMaterial&&(n="constant",null!==e.map&&console.warn("ColladaExporter: Texture maps not supported with MeshBasicMaterial.")),e instanceof s.MeshPhongMaterial){const r=e.emissive?e.emissive:new s.Color(0,0,0),i=e.color?e.color:new s.Color(0,0,0),a=e.specular?e.specular:new s.Color(1,1,1),o=e.shininess||0,l=e.reflectivity||0;let c="";e.transparent&&(c+=`<transparent>${e.map?'<texture texture="diffuse-sampler"></texture>':"<float>1</float>"}</transparent>`,e.opacity<1&&(c+=`<transparency><float>${e.opacity}</float></transparency>`));const h=`<technique sid="common"><${n}><emission>${e.emissiveMap?'<texture texture="emissive-sampler" texcoord="TEXCOORD" />':`<color sid="emission">${r.r} ${r.g} ${r.b} 1</color>`}</emission>${"constant"!==n?`<diffuse>${e.map?'<texture texture="diffuse-sampler" texcoord="TEXCOORD" />':`<color sid="diffuse">${i.r} ${i.g} ${i.b} 1</color>`}</diffuse>`:""}${"constant"!==n?`<bump>${e.normalMap?'<texture texture="bump-sampler" texcoord="TEXCOORD" />':""}</bump>`:""}${"phong"===n?`<specular><color sid="specular">${a.r} ${a.g} ${a.b} 1</color></specular><shininess>${e.specularMap?'<texture texture="specular-sampler" texcoord="TEXCOORD" />':`<float sid="shininess">${o}</float>`}</shininess>`:""}<reflective><color>${i.r} ${i.g} ${i.b} 1</color></reflective><reflectivity><float>${l}</float></reflectivity>${c}</${n}></technique>`,u=`<effect id="${t}-effect"><profile_COMMON>${e.map?`<newparam sid="diffuse-surface"><surface type="2D"><init_from>${this.processTexture(e.map)}</init_from></surface></newparam><newparam sid="diffuse-sampler"><sampler2D><source>diffuse-surface</source></sampler2D></newparam>`:""}${e.specularMap?`<newparam sid="specular-surface"><surface type="2D"><init_from>${this.processTexture(e.specularMap)}</init_from></surface></newparam><newparam sid="specular-sampler"><sampler2D><source>specular-surface</source></sampler2D></newparam>`:""}${e.emissiveMap?`<newparam sid="emissive-surface"><surface type="2D"><init_from>${this.processTexture(e.emissiveMap)}</init_from></surface></newparam><newparam sid="emissive-sampler"><sampler2D><source>emissive-surface</source></sampler2D></newparam>`:""}${e.normalMap?`<newparam sid="bump-surface"><surface type="2D"><init_from>${this.processTexture(e.normalMap)}</init_from></surface></newparam><newparam sid="bump-sampler"><sampler2D><source>bump-surface</source></sampler2D></newparam>`:""}${h}${e.side===s.DoubleSide?'<extra><technique profile="THREEJS"><double_sided sid="double_sided" type="int">1</double_sided></technique></extra>':""}</profile_COMMON></effect>`,d=`<material id="${t}"${e.name?` name="${e.name}"`:""}><instance_effect url="#${t}-effect" /></material>`;this.libraryMaterials.push(d),this.libraryEffects.push(u),this.materialMap.set(e,t)}}return t}processObject(e){let t=`<node name="${e.name}">`;t+=this.getTransform(e);if((new s.Mesh).geometry,e instanceof s.Mesh&&e.isMesh&&null!==e.geometry){const n=this.processGeometry(e.geometry),r=n.meshid,i=n.bufferGeometry;let a,o=null;const l=e.material||new s.MeshBasicMaterial,c=Array.isArray(l)?l:[l];a=i.groups.length>c.length?new Array(i.groups.length):new Array(c.length),o=a.fill(null).map(((e,t)=>this.processMaterial(c[t%c.length]))),t+=`<instance_geometry url="#${r}">`+(null!=o?`<bind_material><technique_common>${o.map(((e,t)=>`<instance_material symbol="MESH_MATERIAL_${t}" target="#${e}" ><bind_vertex_input semantic="TEXCOORD" input_semantic="TEXCOORD" input_set="0" /></instance_material>`)).join("")}</technique_common></bind_material>`:"")+"</instance_geometry>"}return e.children.forEach((e=>t+=this.processObject(e))),t+="</node>",t}}},74918:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=class{parse(e,t={decodeSpeed:5,encodeSpeed:5,encoderMethod:a.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1}){if(e instanceof s.BufferGeometry&&e.isBufferGeometry)throw new Error("DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.");if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");const n=e.geometry,r=DracoEncoderModule(),i=new r.Encoder;let o,l;if(!n.isBufferGeometry)throw new Error("THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.");if(e instanceof s.Mesh&&e.isMesh){o=new r.MeshBuilder,l=new r.Mesh;const e=n.getAttribute("position");o.AddFloatAttributeToMesh(l,r.POSITION,e.count,e.itemSize,e.array);const i=n.getIndex();if(null!==i)o.AddFacesToMesh(l,i.count/3,i.array);else{const t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e<t.length;e++)t[e]=e;o.AddFacesToMesh(l,e.count,t)}if(t.exportNormals){const e=n.getAttribute("normal");void 0!==e&&o.AddFloatAttributeToMesh(l,r.NORMAL,e.count,e.itemSize,e.array)}if(t.exportUvs){const e=n.getAttribute("uv");void 0!==e&&o.AddFloatAttributeToMesh(l,r.TEX_COORD,e.count,e.itemSize,e.array)}if(t.exportColor){const e=n.getAttribute("color");void 0!==e&&o.AddFloatAttributeToMesh(l,r.COLOR,e.count,e.itemSize,e.array)}}else{if(!(e instanceof s.Points&&e.isPoints))throw new Error("DRACOExporter: Unsupported object type.");{o=new r.PointCloudBuilder,l=new r.PointCloud;const e=n.getAttribute("position");if(o.AddFloatAttribute(l,r.POSITION,e.count,e.itemSize,e.array),t.exportColor){const e=n.getAttribute("color");void 0!==e&&o.AddFloatAttribute(l,r.COLOR,e.count,e.itemSize,e.array)}}}const c=new r.DracoInt8Array,h=void 0!==t.encodeSpeed?t.encodeSpeed:5,u=void 0!==t.decodeSpeed?t.decodeSpeed:5;if(i.SetSpeedOptions(h,u),void 0!==t.encoderMethod&&i.SetEncodingMethod(t.encoderMethod),void 0!==t.quantization)for(let s=0;s<5;s++)void 0!==t.quantization[s]&&i.SetAttributeQuantization(s,t.quantization[s]);let d;if(d=e instanceof s.Mesh&&e.isMesh?i.EncodeMeshToDracoBuffer(l,c):i.EncodePointCloudToDracoBuffer(l,!0,c),r.destroy(l),0===d)throw new Error("THREE.DRACOExporter: Draco encoding failed.");const p=new Int8Array(new ArrayBuffer(d));for(let s=0;s<d;s++)p[s]=c.GetValue(s);return r.destroy(c),r.destroy(i),r.destroy(o),p}};let o=a;i(o,"MESH_EDGEBREAKER_ENCODING",1),i(o,"MESH_SEQUENTIAL_ENCODING",0),i(o,"POINT_CLOUD",0),i(o,"TRIANGULAR_MESH",1),i(o,"INVALID",-1),i(o,"POSITION",0),i(o,"NORMAL",1),i(o,"COLOR",2),i(o,"TEX_COORD",3),i(o,"GENERIC",4),t.DRACOExporter=o},83920:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(65236);async function a(e){const t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||""};base64,${n}`}let o,l,c,h;function u(e,t=1/0,n=null){l||(l=new i.PlaneGeometry(2,2,1,1)),c||(c=new i.ShaderMaterial({uniforms:{blitTexture:new i.Uniform(e)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }\n ",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }\n "})),c.uniforms.blitTexture.value=e,c.defines.IS_SRGB="colorSpace"in e?"srgb"===e.colorSpace:3001===e.encoding,c.needsUpdate=!0,h||(h=new i.Mesh(l,c),h.frustrumCulled=!1);const r=new i.PerspectiveCamera,s=new i.Scene;s.add(h),n||(n=o=new i.WebGLRenderer({antialias:!1})),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(s,r);const a=new i.Texture(n.domElement);return a.minFilter=e.minFilter,a.magFilter=e.magFilter,a.wrapS=e.wrapS,a.wrapT=e.wrapT,a.name=e.name,o&&(o.dispose(),o=null),a}const d={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class p{constructor(){this.pluginCallbacks=[],this.register((function(e){return new Y(e)})),this.register((function(e){return new q(e)})),this.register((function(e){return new Z(e)})),this.register((function(e){return new $(e)})),this.register((function(e){return new ee(e)})),this.register((function(e){return new te(e)})),this.register((function(e){return new K(e)})),this.register((function(e){return new J(e)})),this.register((function(e){return new ne(e)})),this.register((function(e){return new re(e)})),this.register((function(e){return new ie(e)}))}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){const i=new X,s=[];for(let a=0,o=this.pluginCallbacks.length;a<o;a++)s.push(this.pluginCallbacks[a](i));i.setPlugins(s),i.write(e,t,r).catch(n)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,r,i,t)}))}}var f;((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(p,"symbol"!=typeof(f="Utils")?f+"":f,{insertKeyframe:function(e,t){const n=.001,r=e.getValueSize(),i=new e.TimeBufferType(e.times.length+1),s=new e.ValueBufferType(e.values.length+r),a=e.createInterpolant(new e.ValueBufferType(r));let o;if(0===e.times.length){i[0]=t;for(let e=0;e<r;e++)s[e]=0;o=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<n)return 0;i[0]=t,i.set(e.times,1),s.set(a.evaluate(t),0),s.set(e.values,r),o=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<n)return e.times.length-1;i[i.length-1]=t,i.set(e.times,0),s.set(e.values,0),s.set(a.evaluate(t),e.values.length),o=i.length-1}else for(let l=0;l<e.times.length;l++){if(Math.abs(e.times[l]-t)<n)return l;if(e.times[l]<t&&e.times[l+1]>t){i.set(e.times.slice(0,l+1),0),i[l+1]=t,i.set(e.times.slice(l+1),l+2),s.set(e.values.slice(0,(l+1)*r),0),s.set(a.evaluate(t),(l+1)*r),s.set(e.values.slice((l+1)*r),(l+2)*r),o=l+1;break}}return e.times=i,e.values=s,o},mergeMorphTargetTracks:function(e,t){const n=[],r={},s=e.tracks;for(let a=0;a<s.length;++a){let e=s[a];const o=i.PropertyBinding.parseTrackName(e.name),l=i.PropertyBinding.findNode(t,o.nodeName);if("morphTargetInfluences"!==o.propertyName||void 0===o.propertyIndex){n.push(e);continue}if(e.createInterpolant!==e.InterpolantFactoryMethodDiscrete&&e.createInterpolant!==e.InterpolantFactoryMethodLinear){if(e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),e=e.clone(),e.setInterpolation(i.InterpolateLinear)}const c=l.morphTargetInfluences.length,h=l.morphTargetDictionary[o.propertyIndex];if(void 0===h)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let u;if(void 0===r[l.uuid]){u=e.clone();const t=new u.ValueBufferType(c*u.times.length);for(let e=0;e<u.times.length;e++)t[e*c+h]=u.values[e];u.name=(o.nodeName||"")+".morphTargetInfluences",u.values=t,r[l.uuid]=u,n.push(u);continue}const d=e.createInterpolant(new e.ValueBufferType(1));u=r[l.uuid];for(let t=0;t<u.times.length;t++)u.values[t*c+h]=d.evaluate(u.times[t]);for(let t=0;t<e.times.length;t++){const n=this.insertKeyframe(u,e.times[t]);u.values[n*c+h]=e.values[t]}}return e.tracks=n,e}});const m=0,g=1,A=2,v=3,y=4,x=5120,b=5121,E=5122,_=5123,S=5124,w=5125,M=5126,C=34962,T=34963,I=9728,B=9729,R=9984,P=9985,D=9986,L=9987,F=33071,U=33648,O=10497,N="KHR_mesh_quantization",k={};k[i.NearestFilter]=I,k[i.NearestMipmapNearestFilter]=R,k[i.NearestMipmapLinearFilter]=D,k[i.LinearFilter]=B,k[i.LinearMipmapNearestFilter]=P,k[i.LinearMipmapLinearFilter]=L,k[i.ClampToEdgeWrapping]=F,k[i.RepeatWrapping]=O,k[i.MirroredRepeatWrapping]=U;const G={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},z=new i.Color;function Q(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))}function V(e){return 4*Math.ceil(e/4)}function H(e,t=0){const n=V(e.byteLength);if(n!==e.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(e)),0!==t)for(let i=e.byteLength;i<n;i++)r[i]=t;return r.buffer}return e}function j(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function W(e,t){if(void 0!==e.toBlob)return new Promise((n=>e.toBlob(n,t)));let n;return"image/jpeg"===t?n=.92:"image/webp"===t&&(n=.8),e.convertToBlob({type:t,quality:n})}class X{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const r=this,i=r.buffers,s=r.json;n=r.options;const o=r.extensionsUsed,l=r.extensionsRequired,c=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(o),u=Object.keys(l);h.length>0&&(s.extensionsUsed=h),u.length>0&&(s.extensionsRequired=u),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=c.size),!0===n.binary?c.arrayBuffer().then((e=>{const n=H(e),r=new DataView(new ArrayBuffer(8));r.setUint32(0,n.byteLength,!0),r.setUint32(4,5130562,!0);const i=H((a=JSON.stringify(s),(new TextEncoder).encode(a).buffer),32);var a;const o=new DataView(new ArrayBuffer(8));o.setUint32(0,i.byteLength,!0),o.setUint32(4,1313821514,!0);const l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,1179937895,!0),c.setUint32(4,2,!0);const h=12+o.byteLength+i.byteLength+r.byteLength+n.byteLength;c.setUint32(8,h,!0);new Blob([l,o,i,r,n],{type:"application/octet-stream"}).arrayBuffer().then(t)})):s.buffers&&s.buffers.length>0?a(c).then((e=>{s.buffers[0].uri=e,t(s)})):t(s)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;const n=this.options,r=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],r[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){const t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new i.Vector3;for(let n=0,r=e.count;n<r;n++)if(Math.abs(t.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const n=e.clone(),r=new i.Vector3;for(let i=0,s=n.count;i<s;i++)r.fromBufferAttribute(n,i),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),n.setXYZ(i,r.x,r.y,r.z);return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1;const r={};0===t.offset.x&&0===t.offset.y||(r.offset=t.offset.toArray(),n=!0),0!==t.rotation&&(r.rotation=t.rotation,n=!0),1===t.repeat.x&&1===t.repeat.y||(r.scale=t.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=r,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function n(e){return("colorSpace"in e?"srgb"===e.colorSpace:3001===e.encoding)?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof i.CompressedTexture&&(e=u(e)),t instanceof i.CompressedTexture&&(t=u(t));const r=e?e.image:null,s=t?t.image:null,a=Math.max(r?r.width:0,s?s.width:0),o=Math.max(r?r.height:0,s?s.height:0),l=j();l.width=a,l.height=o;const c=l.getContext("2d");c.fillStyle="#00ffff",c.fillRect(0,0,a,o);const h=c.getImageData(0,0,a,o);if(r){c.drawImage(r,0,0,a,o);const t=n(e),i=c.getImageData(0,0,a,o).data;for(let e=2;e<i.length;e+=4)h.data[e]=256*t(i[e]/256)}if(s){c.drawImage(s,0,0,a,o);const e=n(t),r=c.getImageData(0,0,a,o).data;for(let t=1;t<r.length;t+=4)h.data[t]=256*e(r[t]/256)}c.putImageData(h,0,0);const d=(e||t).clone();return d.source=new i.Texture(l).source,"colorSpace"in d?d.colorSpace="":d.encoding=3e3,d.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),d}processBuffer(e){const t=this.json,n=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,t,n,r,s){const a=this.json;let o;switch(a.bufferViews||(a.bufferViews=[]),t){case x:case b:o=1;break;case E:case _:o=2;break;default:o=4}const l=V(r*e.itemSize*o),c=new DataView(new ArrayBuffer(l));let h=0;for(let d=n;d<n+r;d++)for(let n=0;n<e.itemSize;n++){let r;e.itemSize>4?r=e.array[d*e.itemSize+n]:(0===n?r=e.getX(d):1===n?r=e.getY(d):2===n?r=e.getZ(d):3===n&&(r=e.getW(d)),!0===e.normalized&&(r=i.MathUtils.normalize(r,e.array))),t===M?c.setFloat32(h,r,!0):t===S?c.setInt32(h,r,!0):t===w?c.setUint32(h,r,!0):t===E?c.setInt16(h,r,!0):t===_?c.setUint16(h,r,!0):t===x?c.setInt8(h,r):t===b&&c.setUint8(h,r),h+=o}const u={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};void 0!==s&&(u.target=s),s===C&&(u.byteStride=e.itemSize*o),this.byteOffset+=l,a.bufferViews.push(u);return{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),e.arrayBuffer().then((e=>{const r=H(e),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1}))}processAccessor(e,t,n,r){const s=this.json;let a;if(e.array.constructor===Float32Array)a=M;else if(e.array.constructor===Int32Array)a=S;else if(e.array.constructor===Uint32Array)a=w;else if(e.array.constructor===Int16Array)a=E;else if(e.array.constructor===Uint16Array)a=_;else if(e.array.constructor===Int8Array)a=x;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);a=b}if(void 0===n&&(n=0),void 0===r&&(r=e.count),0===r)return null;const o=function(e,t,n){const r={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=t;s<t+n;s++)for(let t=0;t<e.itemSize;t++){let n;e.itemSize>4?n=e.array[s*e.itemSize+t]:(0===t?n=e.getX(s):1===t?n=e.getY(s):2===t?n=e.getZ(s):3===t&&(n=e.getW(s)),!0===e.normalized&&(n=i.MathUtils.normalize(n,e.array))),r.min[t]=Math.min(r.min[t],n),r.max[t]=Math.max(r.max[t],n)}return r}(e,n,r);let l;void 0!==t&&(l=e===t.index?T:C);const c=this.processBufferView(e,a,n,r,l),h={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:r,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(h.normalized=!0),s.accessors||(s.accessors=[]),s.accessors.push(h)-1}processImage(e,t,n,r="image/png"){if(null!==e){const s=this,o=s.cache,l=s.json,c=s.options,h=s.pending;o.images.has(e)||o.images.set(e,{});const u=o.images.get(e),d=r+":flipY/"+n.toString();if(void 0!==u[d])return u[d];l.images||(l.images=[]);const p={mimeType:r},f=j();f.width=Math.min(e.width,c.maxTextureSize),f.height=Math.min(e.height,c.maxTextureSize);const m=f.getContext("2d");if(!0===n&&(m.translate(0,f.height),m.scale(1,-1)),void 0!==e.data){t!==i.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>c.maxTextureSize||e.height>c.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<n.length;t+=4)n[t+0]=e.data[t+0],n[t+1]=e.data[t+1],n[t+2]=e.data[t+2],n[t+3]=e.data[t+3];m.putImageData(new ImageData(n,e.width,e.height),0,0)}else m.drawImage(e,0,0,f.width,f.height);!0===c.binary?h.push(W(f,r).then((e=>s.processBufferViewImage(e))).then((e=>{p.bufferView=e}))):void 0!==f.toDataURL?p.uri=f.toDataURL(r):h.push(W(f,r).then(a).then((e=>{p.uri=e})));const g=l.images.push(p)-1;return u[d]=g,g}throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const n={magFilter:k[e.magFilter],minFilter:k[e.minFilter],wrapS:k[e.wrapS],wrapT:k[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){const t=this.options,n=this.cache,r=this.json;if(n.textures.has(e))return n.textures.get(e);r.textures||(r.textures=[]),e instanceof i.CompressedTexture&&(e=u(e,t.maxTextureSize));let s=e.userData.mimeType;"image/webp"===s&&(s="image/png");const a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,s)};e.name&&(a.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,a)}));const o=r.textures.push(a)-1;return n.textures.set(e,o),o}processMaterial(e){const t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const s=e.color.toArray().concat([e.opacity]);if(Q(s,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=s),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(n,t),r.pbrMetallicRoughness.metallicRoughnessTexture=n}if(e.map){const t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){const t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){const t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===i.DoubleSide&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,r)}));const a=n.materials.push(r)-1;return t.materials.set(e,a),a}processMesh(e){const t=this.cache,n=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let i=0,s=e.material.length;i<s;i++)r.push(e.material[i].uuid);else r.push(e.material.uuid);const a=r.join(":");if(t.meshes.has(a))return t.meshes.get(a);const o=e.geometry;let l;l=e.isLineSegments?g:e.isLineLoop?A:e.isLine?v:e.isPoints?m:e.material.wireframe?g:y;const c={},h={},u=[],d=[],p={...s.version>=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=o.getAttribute("normal");void 0===f||this.isNormalizedNormalAttribute(f)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),o.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let x=null;for(let s in o.attributes){if("morph"===s.slice(0,5))continue;const e=o.attributes[s];s=p[s]||s.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(s)||(s="_"+s),t.attributes.has(this.getUID(e))){h[s]=t.attributes.get(this.getUID(e));continue}x=null;const n=e.array;"JOINTS_0"!==s||n instanceof Uint16Array||n instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),x=new i.BufferAttribute(new Uint16Array(n),e.itemSize,e.normalized));const r=this.processAccessor(x||e,o);null!==r&&(s.startsWith("_")||this.detectMeshQuantization(s,e),h[s]=r,t.attributes.set(this.getUID(e),r))}if(void 0!==f&&o.setAttribute("normal",f),0===Object.keys(h).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){const n=[],r=[],i={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let s=0;s<e.morphTargetInfluences.length;++s){const a={};let l=!1;for(const e in o.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}const n=o.morphAttributes[e][s],r=e.toUpperCase(),i=o.attributes[e];if(t.attributes.has(this.getUID(n,!0))){a[r]=t.attributes.get(this.getUID(n,!0));continue}const c=n.clone();if(!o.morphTargetsRelative)for(let e=0,t=n.count;e<t;e++)for(let r=0;r<n.itemSize;r++)0===r&&c.setX(e,n.getX(e)-i.getX(e)),1===r&&c.setY(e,n.getY(e)-i.getY(e)),2===r&&c.setZ(e,n.getZ(e)-i.getZ(e)),3===r&&c.setW(e,n.getW(e)-i.getW(e));a[r]=this.processAccessor(c,o),t.attributes.set(this.getUID(i,!0),a[r])}d.push(a),n.push(e.morphTargetInfluences[s]),void 0!==e.morphTargetDictionary&&r.push(i[s])}c.weights=n,r.length>0&&(c.extras={},c.extras.targetNames=r)}const b=Array.isArray(e.material);if(b&&0===o.groups.length)return null;const E=b?e.material:[e.material],_=b?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let i=0,s=_.length;i<s;i++){const e={mode:l,attributes:h};if(this.serializeUserData(o,e),d.length>0&&(e.targets=d),null!==o.index){let n=this.getUID(o.index);void 0===_[i].start&&void 0===_[i].count||(n+=":"+_[i].start+":"+_[i].count),t.attributes.has(n)?e.indices=t.attributes.get(n):(e.indices=this.processAccessor(o.index,o,_[i].start,_[i].count),t.attributes.set(n,e.indices)),null===e.indices&&delete e.indices}const n=this.processMaterial(E[_[i].materialIndex]);null!==n&&(e.material=n),u.push(e)}c.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,c)}));const S=n.meshes.push(c)-1;return t.meshes.set(a,S),S}detectMeshQuantization(e,t){if(this.extensionsUsed[N])return;let n;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}t.normalized&&(n+=" normalized");const r=e.split("_",1)[0];d[r]&&d[r].includes(n)&&(this.extensionsUsed[N]=!0,this.extensionsRequired[N]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const n=e.isOrthographicCamera,r={type:n?"orthographic":"perspective"};return n?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:i.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){const n=this.json,r=this.nodeMap;n.animations||(n.animations=[]);const s=(e=p.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,a=[],o=[];for(let l=0;l<s.length;++l){const e=s[l],n=i.PropertyBinding.parseTrackName(e.name);let c=i.PropertyBinding.findNode(t,n.nodeName);const h=G[n.propertyName];if("bones"===n.objectName&&(c=!0===c.isSkinnedMesh?c.skeleton.getBoneByName(n.objectIndex):void 0),!c||!h)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',e.name),null;const u=1;let d,p=e.values.length/e.times.length;h===G.morphTargetInfluences&&(p/=c.morphTargetInfluences.length),!0===e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(d="CUBICSPLINE",p/=3):d=e.getInterpolation()===i.InterpolateDiscrete?"STEP":"LINEAR",o.push({input:this.processAccessor(new i.BufferAttribute(e.times,u)),output:this.processAccessor(new i.BufferAttribute(e.values,p)),interpolation:d}),a.push({sampler:o.length-1,target:{node:r.get(c),path:h}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:o,channels:a}),n.animations.length-1}processSkin(e){const t=this.json,n=this.nodeMap,r=t.nodes[n.get(e)],s=e.skeleton;if(void 0===s)return null;const a=e.skeleton.bones[0];if(void 0===a)return null;const o=[],l=new Float32Array(16*s.bones.length),c=new i.Matrix4;for(let i=0;i<s.bones.length;++i)o.push(n.get(s.bones[i])),c.copy(s.boneInverses[i]),c.multiply(e.bindMatrix).toArray(l,16*i);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new i.BufferAttribute(l,16)),joints:o,skeleton:n.get(a)});return r.skin=t.skins.length-1}processNode(e){const t=this.json,n=this.options,r=this.nodeMap;t.nodes||(t.nodes=[]);const i={};if(n.trs){const t=e.quaternion.toArray(),n=e.position.toArray(),r=e.scale.toArray();Q(t,[0,0,0,1])||(i.rotation=t),Q(n,[0,0,0])||(i.translation=n),Q(r,[1,1,1])||(i.scale=r)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===Q(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(i.matrix=e.matrix.elements);if(""!==e.name&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){const t=this.processMesh(e);null!==t&&(i.mesh=t)}else e.isCamera&&(i.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const t=[];for(let r=0,i=e.children.length;r<i;r++){const i=e.children[r];if(i.visible||!1===n.onlyVisible){const e=this.processNode(i);null!==e&&t.push(e)}}t.length>0&&(i.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,i)}));const s=t.nodes.push(i)-1;return r.set(e,s),s}processScene(e){const t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);const r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);const i=[];for(let s=0,a=e.children.length;s<a;s++){const t=e.children[s];if(t.visible||!1===n.onlyVisible){const e=this.processNode(t);null!==e&&i.push(e)}}i.length>0&&(r.nodes=i),this.serializeUserData(e,r)}processObjects(e){const t=new i.Scene;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const n=[];for(let r=0;r<e.length;r++)e[r]instanceof i.Scene?this.processScene(e[r]):n.push(e[r]);n.length>0&&this.processObjects(n);for(let r=0;r<this.skins.length;++r)this.processSkin(this.skins[r]);for(let r=0;r<t.animations.length;++r)this.processAnimation(t.animations[r],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class Y{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);const n=this.writer,r=n.json,i=n.extensionsUsed,s={};e.name&&(s.name=e.name),s.color=e.color.toArray(),s.intensity=e.intensity,e.isDirectionalLight?s.type="directional":e.isPointLight?(s.type="point",e.distance>0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);const a=r.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}class q{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class K{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const t={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const t={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){const t={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class J{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const t={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const t={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class Z{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const t={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class ${constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const t={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class ee{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;const n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}}class te{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(z)&&!e.specularIntensityMap&&!e.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){const t={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(t,e.specularIntensityMap),i.specularTexture=t}if(e.specularColorMap){const t={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(t,e.specularColorMap),i.specularColorTexture=t}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class ne{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){const t={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(t,e.sheenRoughnessMap),i.sheenRoughnessTexture=t}if(e.sheenColorMap){const t={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(t,e.sheenColorMap),i.sheenColorTexture=t}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class re{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;const n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){const t={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(t,e.anisotropyMap),i.anisotropyTexture=t}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}class ie{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}}t.GLTFExporter=p},17351:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(62717);t.MMDExporter=class{constructor(){i(this,"u2sTable")}parseVpd(e,t,n){if(!0!==e.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function r(e){Math.abs(e)<1e-6&&(e=0);let t=e.toString();-1===t.indexOf(".")&&(t+="."),t+="000000";const n=t.indexOf(".");return t.slice(0,n)+"."+t.slice(n+1,n+7)}function i(e){const t=[];for(let n=0,i=e.length;n<i;n++)t.push(r(e[n]));return t.join(",")}e.updateMatrixWorld(!0);const a=e.skeleton.bones,o=this.getBindBones(e),l=new s.Vector3,c=new s.Quaternion,h=new s.Quaternion,u=new s.Matrix4,d=[];d.push("Vocaloid Pose Data file"),d.push(""),d.push((""!==e.name?e.name.replace(/\s/g,"_"):"skin")+".osm;"),d.push(a.length+";"),d.push("");for(let s=0,f=a.length;s<f;s++){const e=a[s],t=o[s];!0===n&&void 0!==e.userData.ik&&void 0!==e.userData.ik.originalMatrix?u.fromArray(e.userData.ik.originalMatrix):u.copy(e.matrix),l.setFromMatrixPosition(u),c.setFromRotationMatrix(u);const r=l.sub(t.position).toArray(),p=h.copy(t.quaternion).conjugate().multiply(c).toArray();r[2]=-r[2],p[0]=-p[0],p[1]=-p[1],d.push("Bone"+s+"{"+e.name),d.push(" "+i(r)+";"),d.push(" "+i(p)+";"),d.push("}"),d.push("")}d.push("");const p=d.join("\n");return!0===t?this.unicodeToShiftjis(p):p}unicodeToShiftjis(e){if(void 0===this.u2sTable){const e=(new a.CharsetEncoder).s2uTable;this.u2sTable={};const t=Object.keys(e);for(let n=0,r=t.length;n<r;n++){let r=t[n];const i=e[r];this.u2sTable[i]=parseInt(r)}}const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n),i=this.u2sTable[r];if(void 0===i)throw"cannot convert charcode 0x"+r.toString(16);i>255?(t.push(i>>8&255),t.push(255&i)):t.push(255&i)}return new Uint8Array(t)}getBindBones(e){const t=e.clone();return t.pose(),t.skeleton.bones}}},32434:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);t.OBJExporter=class{constructor(){i(this,"output"),i(this,"indexVertex"),i(this,"indexVertexUvs"),i(this,"indexNormals"),i(this,"vertex"),i(this,"color"),i(this,"normal"),i(this,"uv"),i(this,"face"),this.output="",this.indexVertex=0,this.indexVertexUvs=0,this.indexNormals=0,this.vertex=new s.Vector3,this.color=new s.Color,this.normal=new s.Vector3,this.uv=new s.Vector2,this.face=[]}parse(e){return e.traverse((e=>{e instanceof s.Mesh&&e.isMesh&&this.parseMesh(e),e instanceof s.Line&&e.isLine&&this.parseLine(e),e instanceof s.Points&&e.isPoints&&this.parsePoints(e)})),this.output}parseMesh(e){let t=0,n=0,r=0;const i=e.geometry,a=new s.Matrix3;if(!i.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const o=i.getAttribute("position"),l=i.getAttribute("normal"),c=i.getAttribute("uv"),h=i.getIndex();if(this.output+=`o ${e.name}\n`,e.material&&!Array.isArray(e.material)&&e.material.name&&(this.output+=`usemtl ${e.material.name}\n`),void 0!==o)for(let s=0,u=o.count;s<u;s++,t++)this.vertex.x=o.getX(s),this.vertex.y=o.getY(s),this.vertex.z=o.getZ(s),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if(void 0!==c)for(let s=0,u=c.count;s<u;s++,r++)this.uv.x=c.getX(s),this.uv.y=c.getY(s),this.output+=`vt ${this.uv.x} ${this.uv.y}\n`;if(void 0!==l){a.getNormalMatrix(e.matrixWorld);for(let e=0,t=l.count;e<t;e++,n++)this.normal.x=l.getX(e),this.normal.y=l.getY(e),this.normal.z=l.getZ(e),this.normal.applyMatrix3(a).normalize(),this.output+=`vn ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`}if(null!==h)for(let s=0,u=h.count;s<u;s+=3){for(let e=0;e<3;e++){const t=h.getX(s+e)+1;this.face[e]=this.indexVertex+t+(l||c?`/${c?this.indexVertexUvs+t:""}${l?`/${this.indexNormals+t}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}else for(let s=0,u=o.count;s<u;s+=3){for(let e=0;e<3;e++){const t=s+e+1;this.face[e]=this.indexVertex+t+(l||c?`/${c?this.indexVertexUvs+t:""}${l?`/${this.indexNormals+t}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}this.indexVertex+=t,this.indexVertexUvs+=r,this.indexNormals+=n}parseLine(e){let t=0;const n=e.geometry,r=e.type;if(n.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const i=n.getAttribute("position");if(this.output+=`o ${e.name}\n`,void 0!==i)for(let s=0,a=i.count;s<a;s++,t++)this.vertex.x=i.getX(s),this.vertex.y=i.getY(s),this.vertex.z=i.getZ(s),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if("Line"===r){this.output+="l ";for(let e=1,t=i.count;e<=t;e++)this.output+=`${this.indexVertex+e} `;this.output+="\n"}if("LineSegments"===r)for(let s=1,a=s+1,o=i.count;s<o;s+=2,a=s+1)this.output+=`l ${this.indexVertex+s} ${this.indexVertex+a}\n`;this.indexVertex+=t}parsePoints(e){let t=0;const n=e.geometry;if(!n.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const r=n.getAttribute("position"),i=n.getAttribute("color");if(this.output+=`o ${e.name}\n`,void 0!==r)for(let a=0,o=r.count;a<o;a++,t++)this.vertex.fromBufferAttribute(r,a),this.vertex.applyMatrix4(e.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}`,void 0!==i&&i instanceof s.BufferAttribute&&(this.color.fromBufferAttribute(i,a),this.output+=` ${this.color.r} ${this.color.g} ${this.color.b}`),this.output+="\n";this.output+="p ";for(let s=1,a=r.count;s<=a;s++)this.output+=`${this.indexVertex+s} `;this.output+="\n",this.indexVertex+=t}}},22195:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.PLYExporter=class{parse(e,t,n){t&&"object"==typeof t&&(console.warn('THREE.PLYExporter: The options parameter is now the third argument to the "parse" function. See the documentation for the new API.'),n=t,t=void 0);const i=(n=Object.assign({binary:!1,excludeAttributes:[],littleEndian:!1},n)).excludeAttributes;let s=!1,a=!1,o=!1,l=0,c=0;e.traverse((function(e){if(e instanceof r.Mesh&&e.isMesh){const t=e.geometry;if(!t.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");const n=t.getAttribute("position"),r=t.getAttribute("normal"),i=t.getAttribute("uv"),h=t.getAttribute("color"),u=t.getIndex();if(void 0===n)return;l+=n.count,c+=u?u.count/3:n.count/3,void 0!==r&&(s=!0),void 0!==i&&(o=!0),void 0!==h&&(a=!0)}}));const h=-1===(null==i?void 0:i.indexOf("index"));if(s=s&&-1===(null==i?void 0:i.indexOf("normal")),a=a&&-1===(null==i?void 0:i.indexOf("color")),o=o&&-1===(null==i?void 0:i.indexOf("uv")),h&&c!==Math.floor(c))return console.error("PLYExporter: Failed to generate a valid PLY file with triangle indices because the number of indices is not divisible by 3."),null;let u=`ply\nformat ${n.binary?n.littleEndian?"binary_little_endian":"binary_big_endian":"ascii"} 1.0\nelement vertex ${l}\nproperty float x\nproperty float y\nproperty float z\n`;s&&(u+="property float nx\nproperty float ny\nproperty float nz\n"),o&&(u+="property float s\nproperty float t\n"),a&&(u+="property uchar red\nproperty uchar green\nproperty uchar blue\n"),h&&(u+=`element face ${c}\nproperty list uchar int vertex_index\n`),u+="end_header\n";const d=new r.Vector3,p=new r.Matrix3;let f=null;if(n.binary){const t=(new TextEncoder).encode(u),r=l*(12+(s?12:0)+(a?3:0)+(o?8:0)),i=h?13*c:0,m=new DataView(new ArrayBuffer(t.length+r+i));new Uint8Array(m.buffer).set(t,0);let g=t.length,A=t.length+r,v=0;this.traverseMeshes(e,(function(e,t){const r=t.getAttribute("position"),i=t.getAttribute("normal"),l=t.getAttribute("uv"),c=t.getAttribute("color"),u=t.getIndex();p.getNormalMatrix(e.matrixWorld);for(let h=0,f=r.count;h<f;h++)d.x=r.getX(h),d.y=r.getY(h),d.z=r.getZ(h),d.applyMatrix4(e.matrixWorld),m.setFloat32(g,d.x,n.littleEndian),g+=4,m.setFloat32(g,d.y,n.littleEndian),g+=4,m.setFloat32(g,d.z,n.littleEndian),g+=4,s&&(null!=i?(d.x=i.getX(h),d.y=i.getY(h),d.z=i.getZ(h),d.applyMatrix3(p).normalize(),m.setFloat32(g,d.x,n.littleEndian),g+=4,m.setFloat32(g,d.y,n.littleEndian),g+=4,m.setFloat32(g,d.z,n.littleEndian),g+=4):(m.setFloat32(g,0,n.littleEndian),g+=4,m.setFloat32(g,0,n.littleEndian),g+=4,m.setFloat32(g,0,n.littleEndian),g+=4)),o&&(null!=l?(m.setFloat32(g,l.getX(h),n.littleEndian),g+=4,m.setFloat32(g,l.getY(h),n.littleEndian),g+=4):o||(m.setFloat32(g,0,n.littleEndian),g+=4,m.setFloat32(g,0,n.littleEndian),g+=4)),a&&(null!=c?(m.setUint8(g,Math.floor(255*c.getX(h))),g+=1,m.setUint8(g,Math.floor(255*c.getY(h))),g+=1,m.setUint8(g,Math.floor(255*c.getZ(h))),g+=1):(m.setUint8(g,255),g+=1,m.setUint8(g,255),g+=1,m.setUint8(g,255),g+=1));if(h)if(null!==u)for(let s=0,a=u.count;s<a;s+=3)m.setUint8(A,3),A+=1,m.setUint32(A,u.getX(s+0)+v,n.littleEndian),A+=4,m.setUint32(A,u.getX(s+1)+v,n.littleEndian),A+=4,m.setUint32(A,u.getX(s+2)+v,n.littleEndian),A+=4;else for(let s=0,a=r.count;s<a;s+=3)m.setUint8(A,3),A+=1,m.setUint32(A,v+s,n.littleEndian),A+=4,m.setUint32(A,v+s+1,n.littleEndian),A+=4,m.setUint32(A,v+s+2,n.littleEndian),A+=4;v+=r.count})),f=m.buffer}else{let t=0,n="",r="";this.traverseMeshes(e,(function(e,i){const l=i.getAttribute("position"),u=i.getAttribute("normal"),f=i.getAttribute("uv"),m=i.getAttribute("color"),g=i.getIndex();p.getNormalMatrix(e.matrixWorld);for(let t=0,r=l.count;t<r;t++){d.x=l.getX(t),d.y=l.getY(t),d.z=l.getZ(t),d.applyMatrix4(e.matrixWorld);let r=d.x+" "+d.y+" "+d.z;s&&(null!=u?(d.x=u.getX(t),d.y=u.getY(t),d.z=u.getZ(t),d.applyMatrix3(p).normalize(),r+=" "+d.x+" "+d.y+" "+d.z):r+=" 0 0 0"),o&&(null!=f?r+=" "+f.getX(t)+" "+f.getY(t):o&&(r+=" 0 0")),a&&(r+=null!=m?" "+Math.floor(255*m.getX(t))+" "+Math.floor(255*m.getY(t))+" "+Math.floor(255*m.getZ(t)):" 255 255 255"),n+=r+"\n"}if(h){if(null!==g)for(let e=0,n=g.count;e<n;e+=3)r+=`3 ${g.getX(e+0)+t}`,r+=` ${g.getX(e+1)+t}`,r+=` ${g.getX(e+2)+t}\n`;else for(let e=0,n=l.count;e<n;e+=3)r+=`3 ${t+e} ${t+e+1} ${t+e+2}\n`;c+=g?g.count/3:l.count/3}t+=l.count})),f=`${u}${n}${h?`${r}\n`:"\n"}`}return"function"==typeof t&&requestAnimationFrame((()=>t&&t("string"==typeof f?f:""))),f}traverseMeshes(e,t){e.traverse((function(e){if(e instanceof r.Mesh&&e.isMesh){const n=e,r=n.geometry;if(!r.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");r.hasAttribute("position")&&t(n,r)}}))}}},37181:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);t.STLExporter=class{constructor(){i(this,"binary"),i(this,"output"),i(this,"offset"),i(this,"objects"),i(this,"triangles"),i(this,"vA"),i(this,"vB"),i(this,"vC"),i(this,"cb"),i(this,"ab"),i(this,"normal"),this.binary=!1,this.output="",this.offset=80,this.objects=[],this.triangles=0,this.vA=new s.Vector3,this.vB=new s.Vector3,this.vC=new s.Vector3,this.cb=new s.Vector3,this.ab=new s.Vector3,this.normal=new s.Vector3}parse(e,t){if(this.binary=void 0!==t.binary&&t.binary,e.traverse((e=>{if(e instanceof s.Mesh&&e.isMesh){const t=e.geometry;if(!t.isBufferGeometry)throw new Error("THREE.STLExporter: Geometry is not of type THREE.BufferGeometry.");const n=t.index,r=t.getAttribute("position");this.triangles+=null!==n?n.count/3:r.count/3,this.objects.push({object3d:e,geometry:t})}})),this.binary){const e=2*this.triangles+3*this.triangles*4*4+80+4,t=new ArrayBuffer(e);this.output=new DataView(t),this.output.setUint32(this.offset,this.triangles,!0),this.offset+=4}else this.output="",this.output+="solid exported\n";for(let n=0,r=this.objects.length;n<r;n++){const e=this.objects[n].object3d,t=this.objects[n].geometry,r=t.index,i=t.getAttribute("position");if(e instanceof s.SkinnedMesh)if(null!==r)for(let n=0;n<r.count;n+=3){const t=r.getX(n+0),s=r.getX(n+1),a=r.getX(n+2);this.writeFace(t,s,a,i,e)}else for(let n=0;n<i.count;n+=3){const t=n+0,r=n+1,s=n+2;this.writeFace(t,r,s,i,e)}}return this.binary||(this.output+="endsolid exported\n"),this.output}writeFace(e,t,n,r,i){this.vA.fromBufferAttribute(r,e),this.vB.fromBufferAttribute(r,t),this.vC.fromBufferAttribute(r,n),i.isSkinnedMesh&&(i.boneTransform(e,this.vA),i.boneTransform(t,this.vB),i.boneTransform(n,this.vC)),this.vA.applyMatrix4(i.matrixWorld),this.vB.applyMatrix4(i.matrixWorld),this.vC.applyMatrix4(i.matrixWorld),this.writeNormal(this.vA,this.vB,this.vC),this.writeVertex(this.vA),this.writeVertex(this.vB),this.writeVertex(this.vC),this.binary&&this.output instanceof DataView?(this.output.setUint16(this.offset,0,!0),this.offset+=2):(this.output+="\t\tendloop\n",this.output+="\tendfacet\n")}writeNormal(e,t,n){this.cb.subVectors(n,t),this.ab.subVectors(e,t),this.cb.cross(this.ab).normalize(),this.normal.copy(this.cb).normalize(),this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,this.normal.x,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.y,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.z,!0),this.offset+=4):(this.output+=`\tfacet normal ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`,this.output+="\t\touter loop\n")}writeVertex(e){this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,e.x,!0),this.offset+=4,this.output.setFloat32(this.offset,e.y,!0),this.offset+=4,this.output.setFloat32(this.offset,e.z,!0),this.offset+=4):this.output+="\t\t\tvertex vertex.x vertex.y vertex.z\n"}}},588:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(8083),a=n(85232);t.USDZExporter=class{constructor(){i(this,"PRECISION",7),i(this,"materials"),i(this,"textures"),i(this,"files"),this.materials={},this.textures={},this.files={}}async parse(e){const t="model.usda";this.files[t]=null;let n=this.buildHeader();e.traverseVisible((e=>{if(e instanceof a.Mesh&&e.isMesh&&e.material.isMeshStandardMaterial){const t=e.geometry,r=e.material,i="geometries/Geometry_"+t.id+".usd";if(!(i in this.files)){const e=this.buildMeshObject(t);this.files[i]=this.buildUSDFileAsString(e)}r.uuid in this.materials||(this.materials[r.uuid]=r),n+=this.buildXform(e,t,r)}})),n+=this.buildMaterials(this.materials),this.files[t]=s.strToU8(n),n=null;for(const i in this.textures){const e=this.textures[i],t=i.split("_")[1],n=1023===e.format,r=this.imageToCanvas(e.image,t),s=await new Promise((e=>null==r?void 0:r.toBlob(e,n?"image/png":"image/jpeg",1)));s&&(this.files[`textures/Texture_${i}.${n?"png":"jpg"}`]=new Uint8Array(await s.arrayBuffer()))}let r=0;for(const i in this.files){const e=this.files[i];r+=34+i.length;const t=63&r;if(4!==t&&null!==e&&e instanceof Uint8Array){const n=new Uint8Array(64-t);this.files[i]=[e,{extra:{12345:n}}]}e&&"number"==typeof e.length&&(r=e.length)}return s.zipSync(this.files,{level:0})}imageToCanvas(e,t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=1024/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=e.width*Math.min(1,n),r.height=e.height*Math.min(1,n);const i=r.getContext("2d");if(null==i||i.drawImage(e,0,0,r.width,r.height),void 0!==t){const e=parseInt(t,16),n=(e>>16&255)/255,s=(e>>8&255)/255,a=(255&e)/255,o=null==i?void 0:i.getImageData(0,0,r.width,r.height);if(o){const e=null==o?void 0:o.data;for(let t=0;t<e.length;t+=4)e[t+0]=e[t+0]*n,e[t+1]=e[t+1]*s,e[t+2]=e[t+2]*a;null==i||i.putImageData(o,0,0)}}return r}}buildHeader(){return'#usda 1.0\n(\n customLayerData = {\n string creator = "Three.js USDZExporter"\n }\n metersPerUnit = 1\n upAxis = "Y"\n)\n'}buildUSDFileAsString(e){let t=this.buildHeader();return t+=e,s.strToU8(t)}buildXform(e,t,n){const r="Object_"+e.id,i=this.buildMatrix(e.matrixWorld);return e.matrixWorld.determinant()<0&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),`def Xform "${r}" (\n prepend references = @./geometries/Geometry_${t.id}.usd@</Geometry>\n)\n{\n matrix4d xformOp:transform = ${i}\n uniform token[] xformOpOrder = ["xformOp:transform"]\n rel material:binding = </Materials/Material_${n.id}>\n}\n`}buildMatrix(e){const t=e.elements;return`( ${this.buildMatrixRow(t,0)}, ${this.buildMatrixRow(t,4)}, ${this.buildMatrixRow(t,8)}, ${this.buildMatrixRow(t,12)} )`}buildMatrixRow(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}buildMeshObject(e){return`\ndef "Geometry"\n{\n ${this.buildMesh(e)}\n}\n`}buildMesh(e){const t=e.attributes,n=t.position.count;return`\n def Mesh "Geometry"\n {\n int[] faceVertexCounts = [${this.buildMeshVertexCount(e)}]\n int[] faceVertexIndices = [${this.buildMeshVertexIndices(e)}]\n normal3f[] normals = [${this.buildVector3Array(t.normal,n)}] (\n interpolation = "vertex"\n )\n point3f[] points = [${this.buildVector3Array(t.position,n)}]\n float2[] primvars:st = [${this.buildVector2Array(t.uv,n)}] (\n interpolation = "vertex"\n )\n uniform token subdivisionScheme = "none"\n }\n`}buildMeshVertexCount(e){const t=null!==e.index?e.index.array.length:e.attributes.position.count;return Array(t/3).fill(3).join(", ")}buildMeshVertexIndices(e){if(null!==e.index)return e.index.array.join(", ");const t=[],n=e.attributes.position.count;for(let r=0;r<n;r++)t.push(r);return t.join(", ")}buildVector3Array(e,t){if(void 0===e)return console.warn("USDZExporter: Normals missing."),Array(t).fill("(0, 0, 0)").join(", ");const n=[],r=e.array;for(let i=0;i<r.length;i+=3)n.push(`(${r[i+0].toPrecision(this.PRECISION)}, ${r[i+1].toPrecision(this.PRECISION)}, ${r[i+2].toPrecision(this.PRECISION)})`);return n.join(", ")}buildVector2Array(e,t){if(void 0===e)return console.warn("USDZExporter: UVs missing."),Array(t).fill("(0, 0)").join(", ");const n=[],r=e.array;for(let i=0;i<r.length;i+=2)n.push(`(${r[i+0].toPrecision(this.PRECISION)}, ${1-r[i+1].toPrecision(this.PRECISION)})`);return n.join(", ")}buildMaterials(e){const t=[];for(const n in e){const r=e[n];t.push(this.buildMaterial(r))}return`def "Materials"\n{\n${t.join("")}\n}\n`}buildMaterial(e){const t=" ",n=[],r=[];return null!==e.map?(n.push(`${t}color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),r.push(this.buildTexture(e,e.map,"diffuse",e.color))):n.push(`${t}color3f inputs:diffuseColor = ${this.buildColor(e.color)}`),null!==e.emissiveMap?(n.push(`${t}color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`),r.push(this.buildTexture(e,e.emissiveMap,"emissive"))):e.emissive.getHex()>0&&n.push(`${t}color3f inputs:emissiveColor = ${this.buildColor(e.emissive)}`),null!==e.normalMap&&(n.push(`${t}normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),r.push(this.buildTexture(e,e.normalMap,"normal"))),null!==e.aoMap&&(n.push(`${t}float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`),r.push(this.buildTexture(e,e.aoMap,"occlusion"))),null!==e.roughnessMap&&1===e.roughness?(n.push(`${t}float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`),r.push(this.buildTexture(e,e.roughnessMap,"roughness"))):n.push(`${t}float inputs:roughness = ${e.roughness}`),null!==e.metalnessMap&&1===e.metalness?(n.push(`${t}float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`),r.push(this.buildTexture(e,e.metalnessMap,"metallic"))):n.push(`${t}float inputs:metallic = ${e.metalness}`),n.push(`${t}float inputs:opacity = ${e.opacity}`),e instanceof a.MeshPhysicalMaterial&&(n.push(`${t}float inputs:clearcoat = ${e.clearcoat}`),n.push(`${t}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`),n.push(`${t}float inputs:ior = ${e.ior}`)),`\n def Material "Material_${e.id}"\n {\n def Shader "PreviewSurface"\n {\n uniform token info:id = "UsdPreviewSurface"\n${n.join("\n")}\n int inputs:useSpecularWorkflow = 0\n token outputs:surface\n }\n token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface>\n token inputs:frame:stPrimvarName = "st"\n def Shader "uvReader_st"\n {\n uniform token info:id = "UsdPrimvarReader_float2"\n token inputs:varname.connect = </Materials/Material_${e.id}.inputs:frame:stPrimvarName>\n float2 inputs:fallback = (0.0, 0.0)\n float2 outputs:result\n }\n${r.join("\n")}\n }\n`}buildTexture(e,t,n,r){const i=t.id+(r?"_"+r.getHexString():""),s=1023===t.format;return this.textures[i]=t,`\n def Shader "Transform2d_${n}" (\n sdrMetadata = {\n string role = "math"\n }\n )\n {\n uniform token info:id = "UsdTransform2d"\n float2 inputs:in.connect = </Materials/Material_${e.id}/uvReader_st.outputs:result>\n float2 inputs:scale = ${this.buildVector2(t.repeat)}\n float2 inputs:translation = ${this.buildVector2(t.offset)}\n float2 outputs:result\n }\n def Shader "Texture_${t.id}_${n}"\n {\n uniform token info:id = "UsdUVTexture"\n asset inputs:file = @textures/Texture_${i}.${s?"png":"jpg"}@\n float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${n}.outputs:result>\n token inputs:wrapS = "repeat"\n token inputs:wrapT = "repeat"\n float outputs:r\n float outputs:g\n float outputs:b\n float3 outputs:rgb\n }`}buildColor(e){return`(${e.r}, ${e.g}, ${e.b})`}buildVector2(e){return`(${e.x}, ${e.y})`}}},86584:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.BufferGeometry{constructor(e,t,n,i,s,a){super();const o=(e=e||1)/2,l=(t=t||1)/2,c=(n=n||1)/2,h=e/(i=Math.floor(i)||1),u=t/(s=Math.floor(s)||1),d=n/(a=Math.floor(a)||1),p=[];let f=-o,m=-l,g=-c;for(let r=0;r<=i;r++)p.push(f,-l,-c,f,l,-c),p.push(f,l,-c,f,l,c),p.push(f,l,c,f,-l,c),p.push(f,-l,c,f,-l,-c),f+=h;for(let r=0;r<=s;r++)p.push(-o,m,-c,o,m,-c),p.push(o,m,-c,o,m,c),p.push(o,m,c,-o,m,c),p.push(-o,m,c,-o,m,-c),m+=u;for(let r=0;r<=a;r++)p.push(-o,-l,g,-o,l,g),p.push(-o,l,g,o,l,g),p.push(o,l,g,o,-l,g),p.push(o,-l,g,-o,-l,g),g+=d;this.setAttribute("position",new r.Float32BufferAttribute(p,3))}}t.BoxLineGeometry=i},92018:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(90515);class s extends r.BufferGeometry{constructor(e=[]){super();const t=[],n=[],s=(new i.ConvexHull).setFromPoints(e).faces;for(let r=0;r<s.length;r++){const e=s[r];let i=e.edge;do{const r=i.head().point;t.push(r.x,r.y,r.z),n.push(e.normal.x,e.normal.y,e.normal.z),i=i.next}while(i!==e.edge)}this.setAttribute("position",new r.Float32BufferAttribute(t,3)),this.setAttribute("normal",new r.Float32BufferAttribute(n,3))}}t.ConvexGeometry=s},41694:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.BufferGeometry{constructor(e,t,n,i){super();const a=[],o=[],l=[],c=new r.Vector3,h=new r.Matrix4;h.makeRotationFromEuler(n),h.setPosition(t);const u=new r.Matrix4;function d(t,n,r){n.applyMatrix4(e.matrixWorld),n.applyMatrix4(u),r.transformDirection(e.matrixWorld),t.push(new s(n.clone(),r.clone()))}function p(e,t){const n=[],r=.5*Math.abs(i.dot(t));for(let i=0;i<e.length;i+=3){let s,a,o,l,c,h,u,d=0;switch(s=e[i+0].position.dot(t)-r>0,a=e[i+1].position.dot(t)-r>0,o=e[i+2].position.dot(t)-r>0,d=(s?1:0)+(a?1:0)+(o?1:0),d){case 0:n.push(e[i]),n.push(e[i+1]),n.push(e[i+2]);break;case 1:if(s&&(l=e[i+1],c=e[i+2],h=f(e[i],l,t,r),u=f(e[i],c,t,r)),a){l=e[i],c=e[i+2],h=f(e[i+1],l,t,r),u=f(e[i+1],c,t,r),n.push(h),n.push(c.clone()),n.push(l.clone()),n.push(c.clone()),n.push(h.clone()),n.push(u);break}o&&(l=e[i],c=e[i+1],h=f(e[i+2],l,t,r),u=f(e[i+2],c,t,r)),n.push(l.clone()),n.push(c.clone()),n.push(h),n.push(u),n.push(h.clone()),n.push(c.clone());break;case 2:s||(l=e[i].clone(),c=f(l,e[i+1],t,r),h=f(l,e[i+2],t,r),n.push(l),n.push(c),n.push(h)),a||(l=e[i+1].clone(),c=f(l,e[i+2],t,r),h=f(l,e[i],t,r),n.push(l),n.push(c),n.push(h)),o||(l=e[i+2].clone(),c=f(l,e[i],t,r),h=f(l,e[i+1],t,r),n.push(l),n.push(c),n.push(h))}}return n}function f(e,t,n,i){const a=e.position.dot(n)-i,o=a/(a-(t.position.dot(n)-i));return new s(new r.Vector3(e.position.x+o*(t.position.x-e.position.x),e.position.y+o*(t.position.y-e.position.y),e.position.z+o*(t.position.z-e.position.z)),new r.Vector3(e.normal.x+o*(t.normal.x-e.normal.x),e.normal.y+o*(t.normal.y-e.normal.y),e.normal.z+o*(t.normal.z-e.normal.z)))}u.copy(h).invert(),function(){let t,n=[];const s=new r.Vector3,u=new r.Vector3;if(!0===e.geometry.isGeometry)return void console.error("THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.");const f=e.geometry,m=f.attributes.position,g=f.attributes.normal;if(null!==f.index){const e=f.index;for(t=0;t<e.count;t++)s.fromBufferAttribute(m,e.getX(t)),u.fromBufferAttribute(g,e.getX(t)),d(n,s,u)}else for(t=0;t<m.count;t++)s.fromBufferAttribute(m,t),u.fromBufferAttribute(g,t),d(n,s,u);for(n=p(n,c.set(1,0,0)),n=p(n,c.set(-1,0,0)),n=p(n,c.set(0,1,0)),n=p(n,c.set(0,-1,0)),n=p(n,c.set(0,0,1)),n=p(n,c.set(0,0,-1)),t=0;t<n.length;t++){const e=n[t];l.push(.5+e.position.x/i.x,.5+e.position.y/i.y),e.position.applyMatrix4(h),a.push(e.position.x,e.position.y,e.position.z),o.push(e.normal.x,e.normal.y,e.normal.z)}}(),this.setAttribute("position",new r.Float32BufferAttribute(a,3)),this.setAttribute("normal",new r.Float32BufferAttribute(o,3)),this.setAttribute("uv",new r.Float32BufferAttribute(l,2))}}class s{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}t.DecalGeometry=i,t.DecalVertex=s},42095:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(84181),o=class extends s.BufferGeometry{constructor(e={}){super(),this.isLightningStrike=!0,this.type="LightningStrike",this.init(o.copyParameters(e,e)),this.createMesh()}static createRandomGenerator(){const e=2053,t=[];for(let r=0;r<e;r++)t.push(Math.random());const n={currentSeed:0,random:function(){const r=t[n.currentSeed];return n.currentSeed=(n.currentSeed+1)%e,r},getSeed:function(){return n.currentSeed/e},setSeed:function(t){n.currentSeed=Math.floor(t*e)%e}};return n}static copyParameters(e={},t={}){const n=function(n){return t===e?n:n.clone()};return e.sourceOffset=void 0!==t.sourceOffset?n(t.sourceOffset):new s.Vector3(0,100,0),e.destOffset=void 0!==t.destOffset?n(t.destOffset):new s.Vector3(0,0,0),e.timeScale=void 0!==t.timeScale?t.timeScale:1,e.roughness=void 0!==t.roughness?t.roughness:.9,e.straightness=void 0!==t.straightness?t.straightness:.7,e.up0=void 0!==t.up0?n(t.up0):new s.Vector3(0,0,1),e.up1=void 0!==t.up1?n(t.up1):new s.Vector3(0,0,1),e.radius0=void 0!==t.radius0?t.radius0:1,e.radius1=void 0!==t.radius1?t.radius1:1,e.radius0Factor=void 0!==t.radius0Factor?t.radius0Factor:.5,e.radius1Factor=void 0!==t.radius1Factor?t.radius1Factor:.2,e.minRadius=void 0!==t.minRadius?t.minRadius:.2,e.isEternal=void 0!==t.isEternal?t.isEternal:void 0===t.birthTime||void 0===t.deathTime,e.birthTime=t.birthTime,e.deathTime=t.deathTime,e.propagationTimeFactor=void 0!==t.propagationTimeFactor?t.propagationTimeFactor:.1,e.vanishingTimeFactor=void 0!==t.vanishingTimeFactor?t.vanishingTimeFactor:.9,e.subrayPeriod=void 0!==t.subrayPeriod?t.subrayPeriod:4,e.subrayDutyCycle=void 0!==t.subrayDutyCycle?t.subrayDutyCycle:.6,e.maxIterations=void 0!==t.maxIterations?t.maxIterations:9,e.isStatic=void 0!==t.isStatic&&t.isStatic,e.ramification=void 0!==t.ramification?t.ramification:5,e.maxSubrayRecursion=void 0!==t.maxSubrayRecursion?t.maxSubrayRecursion:3,e.recursionProbability=void 0!==t.recursionProbability?t.recursionProbability:.6,e.generateUVs=void 0!==t.generateUVs&&t.generateUVs,e.randomGenerator=t.randomGenerator,e.noiseSeed=t.noiseSeed,e.onDecideSubrayCreation=t.onDecideSubrayCreation,e.onSubrayCreation=t.onSubrayCreation,e}update(e){this.isStatic||(this.rayParameters.isEternal||this.rayParameters.birthTime<=e&&e<=this.rayParameters.deathTime?(this.updateMesh(e),e<this.subrays[0].endPropagationTime?this.state=o.RAY_PROPAGATING:e>this.subrays[0].beginVanishingTime?this.state=o.RAY_VANISHING:this.state=o.RAY_STEADY,this.visible=!0):(this.visible=!1,e<this.rayParameters.birthTime?this.state=o.RAY_UNBORN:this.state=o.RAY_EXTINGUISHED))}init(e){this.rayParameters=e,this.maxIterations=void 0!==e.maxIterations?Math.floor(e.maxIterations):9,e.maxIterations=this.maxIterations,this.isStatic=void 0!==e.isStatic&&e.isStatic,e.isStatic=this.isStatic,this.ramification=void 0!==e.ramification?Math.floor(e.ramification):5,e.ramification=this.ramification,this.maxSubrayRecursion=void 0!==e.maxSubrayRecursion?Math.floor(e.maxSubrayRecursion):3,e.maxSubrayRecursion=this.maxSubrayRecursion,this.recursionProbability=void 0!==e.recursionProbability?e.recursionProbability:.6,e.recursionProbability=this.recursionProbability,this.generateUVs=void 0!==e.generateUVs&&e.generateUVs,e.generateUVs=this.generateUVs,void 0!==e.randomGenerator?(this.randomGenerator=e.randomGenerator,this.seedGenerator=e.randomGenerator,void 0!==e.noiseSeed&&this.seedGenerator.setSeed(e.noiseSeed)):(this.randomGenerator=o.createRandomGenerator(),this.seedGenerator=Math),void 0!==e.onDecideSubrayCreation?this.onDecideSubrayCreation=e.onDecideSubrayCreation:(this.createDefaultSubrayCreationCallbacks(),void 0!==e.onSubrayCreation&&(this.onSubrayCreation=e.onSubrayCreation)),this.state=o.RAY_INITIALIZED,this.maxSubrays=Math.ceil(1+Math.pow(this.ramification,Math.max(0,this.maxSubrayRecursion-1))),e.maxSubrays=this.maxSubrays,this.maxRaySegments=2*(1<<this.maxIterations),this.subrays=[];for(let t=0;t<this.maxSubrays;t++)this.subrays.push(this.createSubray());this.raySegments=[];for(let t=0;t<this.maxRaySegments;t++)this.raySegments.push(this.createSegment());this.time=0,this.timeFraction=0,this.currentSegmentCallback=null,this.currentCreateTriangleVertices=this.generateUVs?this.createTriangleVerticesWithUVs:this.createTriangleVerticesWithoutUVs,this.numSubrays=0,this.currentSubray=null,this.currentSegmentIndex=0,this.isInitialSegment=!1,this.subrayProbability=0,this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.vertices=null,this.uvs=null,this.indices=null,this.positionAttribute=null,this.uvsAttribute=null,this.simplexX=new a.SimplexNoise(this.seedGenerator),this.simplexY=new a.SimplexNoise(this.seedGenerator),this.simplexZ=new a.SimplexNoise(this.seedGenerator),this.forwards=new s.Vector3,this.forwardsFill=new s.Vector3,this.side=new s.Vector3,this.down=new s.Vector3,this.middlePos=new s.Vector3,this.middleLinPos=new s.Vector3,this.newPos=new s.Vector3,this.vPos=new s.Vector3,this.cross1=new s.Vector3}createMesh(){const e=1<<this.maxIterations,t=3*(e+1)*this.maxSubrays,n=18*e*this.maxSubrays;this.vertices=new Float32Array(3*t),this.indices=new Uint32Array(n),this.generateUVs&&(this.uvs=new Float32Array(2*t)),this.fillMesh(0),this.setIndex(new s.Uint32BufferAttribute(this.indices,1)),this.positionAttribute=new s.Float32BufferAttribute(this.vertices,3),this.setAttribute("position",this.positionAttribute),this.generateUVs&&(this.uvsAttribute=new s.Float32BufferAttribute(new Float32Array(this.uvs),2),this.setAttribute("uv",this.uvsAttribute)),this.isStatic||(this.index.usage=s.DynamicDrawUsage,this.positionAttribute.usage=s.DynamicDrawUsage,this.generateUVs&&(this.uvsAttribute.usage=s.DynamicDrawUsage)),this.vertices=this.positionAttribute.array,this.indices=this.index.array,this.generateUVs&&(this.uvs=this.uvsAttribute.array)}updateMesh(e){this.fillMesh(e),this.drawRange.count=this.currentIndex,this.index.needsUpdate=!0,this.positionAttribute.needsUpdate=!0,this.generateUVs&&(this.uvsAttribute.needsUpdate=!0)}fillMesh(e){const t=this;this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.fractalRay(e,(function(n){const r=t.currentSubray;e<r.birthTime||(this.rayParameters.isEternal&&0==t.currentSubray.recursion?(t.createPrism(n),t.onDecideSubrayCreation(n,t)):e<r.endPropagationTime?t.timeFraction>=n.fraction0*r.propagationTimeFactor&&(t.createPrism(n),t.onDecideSubrayCreation(n,t)):e<r.beginVanishingTime?(t.createPrism(n),t.onDecideSubrayCreation(n,t)):(t.timeFraction<=r.vanishingTimeFactor+n.fraction1*(1-r.vanishingTimeFactor)&&t.createPrism(n),t.onDecideSubrayCreation(n,t)))}))}addNewSubray(){return this.subrays[this.numSubrays++]}initSubray(e,t){e.pos0.copy(t.sourceOffset),e.pos1.copy(t.destOffset),e.up0.copy(t.up0),e.up1.copy(t.up1),e.radius0=t.radius0,e.radius1=t.radius1,e.birthTime=t.birthTime,e.deathTime=t.deathTime,e.timeScale=t.timeScale,e.roughness=t.roughness,e.straightness=t.straightness,e.propagationTimeFactor=t.propagationTimeFactor,e.vanishingTimeFactor=t.vanishingTimeFactor,e.maxIterations=this.maxIterations,e.seed=void 0!==t.noiseSeed?t.noiseSeed:0,e.recursion=0}fractalRay(e,t){this.time=e,this.currentSegmentCallback=t,this.numSubrays=0,this.initSubray(this.addNewSubray(),this.rayParameters);for(let n=0;n<this.numSubrays;n++){const t=this.subrays[n];this.currentSubray=t,this.randomGenerator.setSeed(t.seed),t.endPropagationTime=s.MathUtils.lerp(t.birthTime,t.deathTime,t.propagationTimeFactor),t.beginVanishingTime=s.MathUtils.lerp(t.deathTime,t.birthTime,1-t.vanishingTimeFactor);const r=this.randomGenerator.random;t.linPos0.set(r(),r(),r()).multiplyScalar(1e3),t.linPos1.set(r(),r(),r()).multiplyScalar(1e3),this.timeFraction=(e-t.birthTime)/(t.deathTime-t.birthTime),this.currentSegmentIndex=0,this.isInitialSegment=!0;const i=this.getNewSegment();i.iteration=0,i.pos0.copy(t.pos0),i.pos1.copy(t.pos1),i.linPos0.copy(t.linPos0),i.linPos1.copy(t.linPos1),i.up0.copy(t.up0),i.up1.copy(t.up1),i.radius0=t.radius0,i.radius1=t.radius1,i.fraction0=0,i.fraction1=1,i.positionVariationFactor=1-t.straightness,this.subrayProbability=this.ramification*Math.pow(this.recursionProbability,t.recursion)/(1<<t.maxIterations),this.fractalRayRecursive(i)}this.currentSegmentCallback=null,this.currentSubray=null}fractalRayRecursive(e){if(e.iteration>=this.currentSubray.maxIterations)return void this.currentSegmentCallback(e);this.forwards.subVectors(e.pos1,e.pos0);let t=this.forwards.length();t<1e-6&&(this.forwards.set(0,0,.01),t=this.forwards.length());const n=.5*(e.radius0+e.radius1),r=.5*(e.fraction0+e.fraction1),i=this.time*this.currentSubray.timeScale*Math.pow(2,e.iteration);this.middlePos.lerpVectors(e.pos0,e.pos1,.5),this.middleLinPos.lerpVectors(e.linPos0,e.linPos1,.5);const s=this.middleLinPos;this.newPos.set(this.simplexX.noise4d(s.x,s.y,s.z,i),this.simplexY.noise4d(s.x,s.y,s.z,i),this.simplexZ.noise4d(s.x,s.y,s.z,i)),this.newPos.multiplyScalar(e.positionVariationFactor*t),this.newPos.add(this.middlePos);const a=this.getNewSegment();a.pos0.copy(e.pos0),a.pos1.copy(this.newPos),a.linPos0.copy(e.linPos0),a.linPos1.copy(this.middleLinPos),a.up0.copy(e.up0),a.up1.copy(e.up1),a.radius0=e.radius0,a.radius1=n,a.fraction0=e.fraction0,a.fraction1=r,a.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,a.iteration=e.iteration+1;const o=this.getNewSegment();o.pos0.copy(this.newPos),o.pos1.copy(e.pos1),o.linPos0.copy(this.middleLinPos),o.linPos1.copy(e.linPos1),this.cross1.crossVectors(e.up0,this.forwards.normalize()),o.up0.crossVectors(this.forwards,this.cross1).normalize(),o.up1.copy(e.up1),o.radius0=n,o.radius1=e.radius1,o.fraction0=r,o.fraction1=e.fraction1,o.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,o.iteration=e.iteration+1,this.fractalRayRecursive(a),this.fractalRayRecursive(o)}createPrism(e){this.forwardsFill.subVectors(e.pos1,e.pos0).normalize(),this.isInitialSegment&&(this.currentCreateTriangleVertices(e.pos0,e.up0,this.forwardsFill,e.radius0,0),this.isInitialSegment=!1),this.currentCreateTriangleVertices(e.pos1,e.up0,this.forwardsFill,e.radius1,e.fraction1),this.createPrismFaces()}createTriangleVerticesWithoutUVs(e,t,n,r){this.side.crossVectors(t,n).multiplyScalar(r*o.COS30DEG),this.down.copy(t).multiplyScalar(-r*o.SIN30DEG);const i=this.vPos,s=this.vertices;i.copy(e).sub(this.side).add(this.down),s[this.currentCoordinate++]=i.x,s[this.currentCoordinate++]=i.y,s[this.currentCoordinate++]=i.z,i.copy(e).add(this.side).add(this.down),s[this.currentCoordinate++]=i.x,s[this.currentCoordinate++]=i.y,s[this.currentCoordinate++]=i.z,i.copy(t).multiplyScalar(r).add(e),s[this.currentCoordinate++]=i.x,s[this.currentCoordinate++]=i.y,s[this.currentCoordinate++]=i.z,this.currentVertex+=3}createTriangleVerticesWithUVs(e,t,n,r,i){this.side.crossVectors(t,n).multiplyScalar(r*o.COS30DEG),this.down.copy(t).multiplyScalar(-r*o.SIN30DEG);const s=this.vPos,a=this.vertices,l=this.uvs;s.copy(e).sub(this.side).add(this.down),a[this.currentCoordinate++]=s.x,a[this.currentCoordinate++]=s.y,a[this.currentCoordinate++]=s.z,l[this.currentUVCoordinate++]=i,l[this.currentUVCoordinate++]=0,s.copy(e).add(this.side).add(this.down),a[this.currentCoordinate++]=s.x,a[this.currentCoordinate++]=s.y,a[this.currentCoordinate++]=s.z,l[this.currentUVCoordinate++]=i,l[this.currentUVCoordinate++]=.5,s.copy(t).multiplyScalar(r).add(e),a[this.currentCoordinate++]=s.x,a[this.currentCoordinate++]=s.y,a[this.currentCoordinate++]=s.z,l[this.currentUVCoordinate++]=i,l[this.currentUVCoordinate++]=1,this.currentVertex+=3}createPrismFaces(e){const t=this.indices;e=this.currentVertex-6,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+5}createDefaultSubrayCreationCallbacks(){const e=this.randomGenerator.random;this.onDecideSubrayCreation=function(t,n){const r=n.currentSubray,i=n.rayParameters.subrayPeriod,a=n.rayParameters.subrayDutyCycle,o=n.rayParameters.isEternal&&0==r.recursion?-e()*i:s.MathUtils.lerp(r.birthTime,r.endPropagationTime,t.fraction0)-e()*i,l=n.time-o,c=Math.floor(l/i),h=e()*(c+1);let u=0;if(l%i<=a*i&&(u=n.subrayProbability),r.recursion<n.maxSubrayRecursion&&n.numSubrays<n.maxSubrays&&e()<u){const s=n.addNewSubray(),l=n.randomGenerator.getSeed();s.seed=h,n.randomGenerator.setSeed(h),s.recursion=r.recursion+1,s.maxIterations=Math.max(1,r.maxIterations-1),s.linPos0.set(e(),e(),e()).multiplyScalar(1e3),s.linPos1.set(e(),e(),e()).multiplyScalar(1e3),s.up0.copy(r.up0),s.up1.copy(r.up1),s.radius0=t.radius0*n.rayParameters.radius0Factor,s.radius1=Math.min(n.rayParameters.minRadius,t.radius1*n.rayParameters.radius1Factor),s.birthTime=o+c*i,s.deathTime=s.birthTime+i*a,n.rayParameters.isEternal||0!=r.recursion||(s.birthTime=Math.max(s.birthTime,r.birthTime),s.deathTime=Math.min(s.deathTime,r.deathTime)),s.timeScale=2*r.timeScale,s.roughness=r.roughness,s.straightness=r.straightness,s.propagationTimeFactor=r.propagationTimeFactor,s.vanishingTimeFactor=r.vanishingTimeFactor,n.onSubrayCreation(t,r,s,n),n.randomGenerator.setSeed(l)}};const t=new s.Vector3,n=new s.Vector3,r=new s.Vector3,i=new s.Vector3;this.onSubrayCreation=function(e,t,n,r){r.subrayCylinderPosition(e,t,n,.5,.6,.2)},this.subrayConePosition=function(s,a,o,l,c,h){o.pos0.copy(s.pos0),t.subVectors(a.pos1,a.pos0),n.copy(t).normalize(),t.multiplyScalar(s.fraction0+(1-s.fraction0)*(e()*l));const u=t.length();r.crossVectors(a.up0,n);const d=2*Math.PI*e();r.multiplyScalar(Math.cos(d)),i.copy(a.up0).multiplyScalar(Math.sin(d)),o.pos1.copy(r).add(i).multiplyScalar(u*c*(h+e()*(1-h))).add(t).add(a.pos0)},this.subrayCylinderPosition=function(s,a,o,l,c,h){o.pos0.copy(s.pos0),t.subVectors(a.pos1,a.pos0),n.copy(t).normalize(),t.multiplyScalar(s.fraction0+(1-s.fraction0)*((2*e()-1)*l));const u=t.length();r.crossVectors(a.up0,n);const d=2*Math.PI*e();r.multiplyScalar(Math.cos(d)),i.copy(a.up0).multiplyScalar(Math.sin(d)),o.pos1.copy(r).add(i).multiplyScalar(u*c*(h+e()*(1-h))).add(t).add(a.pos0)}}createSubray(){return{seed:0,maxIterations:0,recursion:0,pos0:new s.Vector3,pos1:new s.Vector3,linPos0:new s.Vector3,linPos1:new s.Vector3,up0:new s.Vector3,up1:new s.Vector3,radius0:0,radius1:0,birthTime:0,deathTime:0,timeScale:0,roughness:0,straightness:0,propagationTimeFactor:0,vanishingTimeFactor:0,endPropagationTime:0,beginVanishingTime:0}}createSegment(){return{iteration:0,pos0:new s.Vector3,pos1:new s.Vector3,linPos0:new s.Vector3,linPos1:new s.Vector3,up0:new s.Vector3,up1:new s.Vector3,radius0:0,radius1:0,fraction0:0,fraction1:0,positionVariationFactor:0}}getNewSegment(){return this.raySegments[this.currentSegmentIndex++]}copy(e){return super.copy(e),this.init(o.copyParameters({},e.rayParameters)),this}clone(){return new this.constructor(o.copyParameters({},this.rayParameters))}};let l=o;i(l,"RAY_INITIALIZED",0),i(l,"RAY_UNBORN",1),i(l,"RAY_PROPAGATING",2),i(l,"RAY_STEADY",3),i(l,"RAY_VANISHING",4),i(l,"RAY_EXTINGUISHED",5),i(l,"COS30DEG",Math.cos(30*Math.PI/180)),i(l,"SIN30DEG",Math.sin(30*Math.PI/180)),t.LightningStrike=l},12333:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(41019);class s extends i.ParametricGeometry{constructor(e,t=64,n=1,i=8,s=!1){const a=t+1,o=e.computeFrenetFrames(t,s),l=o.tangents,c=o.normals,h=o.binormals,u=new r.Vector3;super((function(t,r,i){r*=2*Math.PI;const s=Math.floor(t*(a-1));e.getPointAt(t,u);const o=c[s],l=h[s],d=-n*Math.cos(r),p=n*Math.sin(r);u.x+=d*o.x+p*l.x,u.y+=d*o.y+p*l.y,u.z+=d*o.z+p*l.z,i.copy(u)}),t,i),this.tangents=l,this.normals=c,this.binormals=h,this.path=e,this.segments=t,this.radius=n,this.segmentsRadius=i,this.closed=s}}const a={klein:function(e,t,n){let r,i;t*=Math.PI,e*=2*Math.PI,(t*=2)<Math.PI?(r=3*Math.cos(t)*(1+Math.sin(t))+2*(1-Math.cos(t)/2)*Math.cos(t)*Math.cos(e),i=-8*Math.sin(t)-2*(1-Math.cos(t)/2)*Math.sin(t)*Math.cos(e)):(r=3*Math.cos(t)*(1+Math.sin(t))+2*(1-Math.cos(t)/2)*Math.cos(e+Math.PI),i=-8*Math.sin(t));const s=-2*(1-Math.cos(t)/2)*Math.sin(e);n.set(r,s,i)},plane:function(e,t){return function(n,r,i){const s=n*e,a=r*t;i.set(s,0,a)}},mobius:function(e,t,n){e-=.5;const r=2*Math.PI*t,i=Math.cos(r)*(2+e*Math.cos(r/2)),s=Math.sin(r)*(2+e*Math.cos(r/2)),a=e*Math.sin(r/2);n.set(i,s,a)},mobius3d:function(e,t,n){e*=Math.PI,t*=2*Math.PI;const r=(e*=2)/2;let i=.125*Math.cos(t)*Math.cos(r)-.65*Math.sin(t)*Math.sin(r);const s=.125*Math.cos(t)*Math.sin(r)+.65*Math.sin(t)*Math.cos(r),a=(2.25+i)*Math.sin(e);i=(2.25+i)*Math.cos(e),n.set(i,a,s)},TubeGeometry:s,TorusKnotGeometry:class extends s{constructor(e=200,t=40,n=64,i=8,s=2,a=3){class o extends r.Curve{getPoint(t,n=new r.Vector3){const i=n;t*=2*Math.PI;const o=(1+.5*Math.cos(a*t))*Math.cos(s*t),l=(1+.5*Math.cos(a*t))*Math.sin(s*t),c=.5*Math.sin(a*t);return i.set(o,l,c).multiplyScalar(e)}}const l=n,c=i;super(new o,l,t,c,!0,!1),this.radius=e,this.tube=t,this.segmentsT=n,this.segmentsR=i,this.p=s,this.q=a}},SphereGeometry:class extends i.ParametricGeometry{constructor(e,t,n){super((function(t,n,r){t*=Math.PI,n*=2*Math.PI;const i=e*Math.sin(t)*Math.cos(n),s=e*Math.sin(t)*Math.sin(n),a=e*Math.cos(t);r.set(i,s,a)}),t,n)}},PlaneGeometry:class extends i.ParametricGeometry{constructor(e,t,n,r){super((function(n,r,i){const s=n*e,a=r*t;i.set(s,0,a)}),n,r)}}};t.ParametricGeometries=a},41019:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.BufferGeometry{constructor(e=((e,t,n)=>n.set(e,t,Math.cos(e)*Math.sin(t))),t=8,n=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const i=[],s=[],a=[],o=[],l=1e-5,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Vector3,p=new r.Vector3,f=t+1;for(let r=0;r<=n;r++){const i=r/n;for(let n=0;n<=t;n++){const r=n/t;e(r,i,h),s.push(h.x,h.y,h.z),r-l>=0?(e(r-l,i,u),d.subVectors(h,u)):(e(r+l,i,u),d.subVectors(u,h)),i-l>=0?(e(r,i-l,u),p.subVectors(h,u)):(e(r,i+l,u),p.subVectors(u,h)),c.crossVectors(d,p).normalize(),a.push(c.x,c.y,c.z),o.push(r,i)}}for(let r=0;r<n;r++)for(let e=0;e<t;e++){const t=r*f+e,n=r*f+e+1,s=(r+1)*f+e+1,a=(r+1)*f+e;i.push(t,n,a),i.push(n,s,a)}this.setIndex(i),this.setAttribute("position",new r.Float32BufferAttribute(s,3)),this.setAttribute("normal",new r.Float32BufferAttribute(a,3)),this.setAttribute("uv",new r.Float32BufferAttribute(o,2))}}t.ParametricGeometry=i},23723:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3;function s(e,t,n,r,s,a){const o=2*Math.PI*s/4,l=Math.max(a-2*s,0),c=Math.PI/4;i.copy(t),i[r]=0,i.normalize();const h=.5*o/(o+l),u=1-i.angleTo(e)/c;if(1===Math.sign(i[n]))return u*h;return l/(o+l)+h+h*(1-u)}class a extends r.BoxGeometry{constructor(e=1,t=1,n=1,i=2,a=.1){if(i=2*i+1,a=Math.min(e/2,t/2,n/2,a),super(1,1,1,i,i,i),1===i)return;const o=this.toNonIndexed();this.index=null,this.attributes.position=o.attributes.position,this.attributes.normal=o.attributes.normal,this.attributes.uv=o.attributes.uv;const l=new r.Vector3,c=new r.Vector3,h=new r.Vector3(e,t,n).divideScalar(2).subScalar(a),u=this.attributes.position.array,d=this.attributes.normal.array,p=this.attributes.uv.array,f=u.length/6,m=new r.Vector3,g=.5/i;for(let r=0,A=0;r<u.length;r+=3,A+=2){l.fromArray(u,r),c.copy(l),c.x-=Math.sign(c.x)*g,c.y-=Math.sign(c.y)*g,c.z-=Math.sign(c.z)*g,c.normalize(),u[r+0]=h.x*Math.sign(l.x)+c.x*a,u[r+1]=h.y*Math.sign(l.y)+c.y*a,u[r+2]=h.z*Math.sign(l.z)+c.z*a,d[r+0]=c.x,d[r+1]=c.y,d[r+2]=c.z;switch(Math.floor(r/f)){case 0:m.set(1,0,0),p[A+0]=s(m,c,"z","y",a,n),p[A+1]=1-s(m,c,"y","z",a,t);break;case 1:m.set(-1,0,0),p[A+0]=1-s(m,c,"z","y",a,n),p[A+1]=1-s(m,c,"y","z",a,t);break;case 2:m.set(0,1,0),p[A+0]=1-s(m,c,"x","z",a,e),p[A+1]=s(m,c,"z","x",a,n);break;case 3:m.set(0,-1,0),p[A+0]=1-s(m,c,"x","z",a,e),p[A+1]=1-s(m,c,"z","x",a,n);break;case 4:m.set(0,0,1),p[A+0]=1-s(m,c,"x","y",a,e),p[A+1]=1-s(m,c,"y","x",a,t);break;case 5:m.set(0,0,-1),p[A+0]=s(m,c,"x","y",a,e),p[A+1]=1-s(m,c,"y","x",a,t)}}}}t.RoundedBoxGeometry=a},24858:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.BufferGeometry{constructor(e,t,n,i,s,a,o){const l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,3,16,17,18,7,19,20,21,11,22,23,24,15,25,26,27,18,28,29,30,21,31,32,33,24,34,35,36,27,37,38,39,30,40,41,0,33,42,43,4,36,44,45,8,39,46,47,12,12,13,14,15,48,49,50,51,52,53,54,55,56,57,58,59,15,25,26,27,51,60,61,62,55,63,64,65,59,66,67,68,27,37,38,39,62,69,70,71,65,72,73,74,68,75,76,77,39,46,47,12,71,78,79,48,74,80,81,52,77,82,83,56,56,57,58,59,84,85,86,87,88,89,90,91,92,93,94,95,59,66,67,68,87,96,97,98,91,99,100,101,95,102,103,104,68,75,76,77,98,105,106,107,101,108,109,110,104,111,112,113,77,82,83,56,107,114,115,84,110,116,117,88,113,118,119,92,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,123,136,137,120,127,138,139,124,131,140,141,128,135,142,143,132,132,133,134,135,144,145,146,147,148,149,150,151,68,152,153,154,135,142,143,132,147,155,156,144,151,157,158,148,154,159,160,68,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,164,177,178,161,168,179,180,165,172,181,182,169,176,183,184,173,173,174,175,176,185,186,187,188,189,190,191,192,193,194,195,196,176,183,184,173,188,197,198,185,192,199,200,189,196,201,202,193,203,203,203,203,204,205,206,207,208,208,208,208,209,210,211,212,203,203,203,203,207,213,214,215,208,208,208,208,212,216,217,218,203,203,203,203,215,219,220,221,208,208,208,208,218,222,223,224,203,203,203,203,221,225,226,204,208,208,208,208,224,227,228,209,209,210,211,212,229,230,231,232,233,234,235,236,237,238,239,240,212,216,217,218,232,241,242,243,236,244,245,246,240,247,248,249,218,222,223,224,243,250,251,252,246,253,254,255,249,256,257,258,224,227,228,209,252,259,260,229,255,261,262,233,258,263,264,237,265,265,265,265,266,267,268,269,270,271,272,273,92,119,118,113,265,265,265,265,269,274,275,276,273,277,278,279,113,112,111,104,265,265,265,265,276,280,281,282,279,283,284,285,104,103,102,95,265,265,265,265,282,286,287,266,285,288,289,270,95,94,93,92],c=[1.4,0,2.4,1.4,-.784,2.4,.784,-1.4,2.4,0,-1.4,2.4,1.3375,0,2.53125,1.3375,-.749,2.53125,.749,-1.3375,2.53125,0,-1.3375,2.53125,1.4375,0,2.53125,1.4375,-.805,2.53125,.805,-1.4375,2.53125,0,-1.4375,2.53125,1.5,0,2.4,1.5,-.84,2.4,.84,-1.5,2.4,0,-1.5,2.4,-.784,-1.4,2.4,-1.4,-.784,2.4,-1.4,0,2.4,-.749,-1.3375,2.53125,-1.3375,-.749,2.53125,-1.3375,0,2.53125,-.805,-1.4375,2.53125,-1.4375,-.805,2.53125,-1.4375,0,2.53125,-.84,-1.5,2.4,-1.5,-.84,2.4,-1.5,0,2.4,-1.4,.784,2.4,-.784,1.4,2.4,0,1.4,2.4,-1.3375,.749,2.53125,-.749,1.3375,2.53125,0,1.3375,2.53125,-1.4375,.805,2.53125,-.805,1.4375,2.53125,0,1.4375,2.53125,-1.5,.84,2.4,-.84,1.5,2.4,0,1.5,2.4,.784,1.4,2.4,1.4,.784,2.4,.749,1.3375,2.53125,1.3375,.749,2.53125,.805,1.4375,2.53125,1.4375,.805,2.53125,.84,1.5,2.4,1.5,.84,2.4,1.75,0,1.875,1.75,-.98,1.875,.98,-1.75,1.875,0,-1.75,1.875,2,0,1.35,2,-1.12,1.35,1.12,-2,1.35,0,-2,1.35,2,0,.9,2,-1.12,.9,1.12,-2,.9,0,-2,.9,-.98,-1.75,1.875,-1.75,-.98,1.875,-1.75,0,1.875,-1.12,-2,1.35,-2,-1.12,1.35,-2,0,1.35,-1.12,-2,.9,-2,-1.12,.9,-2,0,.9,-1.75,.98,1.875,-.98,1.75,1.875,0,1.75,1.875,-2,1.12,1.35,-1.12,2,1.35,0,2,1.35,-2,1.12,.9,-1.12,2,.9,0,2,.9,.98,1.75,1.875,1.75,.98,1.875,1.12,2,1.35,2,1.12,1.35,1.12,2,.9,2,1.12,.9,2,0,.45,2,-1.12,.45,1.12,-2,.45,0,-2,.45,1.5,0,.225,1.5,-.84,.225,.84,-1.5,.225,0,-1.5,.225,1.5,0,.15,1.5,-.84,.15,.84,-1.5,.15,0,-1.5,.15,-1.12,-2,.45,-2,-1.12,.45,-2,0,.45,-.84,-1.5,.225,-1.5,-.84,.225,-1.5,0,.225,-.84,-1.5,.15,-1.5,-.84,.15,-1.5,0,.15,-2,1.12,.45,-1.12,2,.45,0,2,.45,-1.5,.84,.225,-.84,1.5,.225,0,1.5,.225,-1.5,.84,.15,-.84,1.5,.15,0,1.5,.15,1.12,2,.45,2,1.12,.45,.84,1.5,.225,1.5,.84,.225,.84,1.5,.15,1.5,.84,.15,-1.6,0,2.025,-1.6,-.3,2.025,-1.5,-.3,2.25,-1.5,0,2.25,-2.3,0,2.025,-2.3,-.3,2.025,-2.5,-.3,2.25,-2.5,0,2.25,-2.7,0,2.025,-2.7,-.3,2.025,-3,-.3,2.25,-3,0,2.25,-2.7,0,1.8,-2.7,-.3,1.8,-3,-.3,1.8,-3,0,1.8,-1.5,.3,2.25,-1.6,.3,2.025,-2.5,.3,2.25,-2.3,.3,2.025,-3,.3,2.25,-2.7,.3,2.025,-3,.3,1.8,-2.7,.3,1.8,-2.7,0,1.575,-2.7,-.3,1.575,-3,-.3,1.35,-3,0,1.35,-2.5,0,1.125,-2.5,-.3,1.125,-2.65,-.3,.9375,-2.65,0,.9375,-2,-.3,.9,-1.9,-.3,.6,-1.9,0,.6,-3,.3,1.35,-2.7,.3,1.575,-2.65,.3,.9375,-2.5,.3,1.125,-1.9,.3,.6,-2,.3,.9,1.7,0,1.425,1.7,-.66,1.425,1.7,-.66,.6,1.7,0,.6,2.6,0,1.425,2.6,-.66,1.425,3.1,-.66,.825,3.1,0,.825,2.3,0,2.1,2.3,-.25,2.1,2.4,-.25,2.025,2.4,0,2.025,2.7,0,2.4,2.7,-.25,2.4,3.3,-.25,2.4,3.3,0,2.4,1.7,.66,.6,1.7,.66,1.425,3.1,.66,.825,2.6,.66,1.425,2.4,.25,2.025,2.3,.25,2.1,3.3,.25,2.4,2.7,.25,2.4,2.8,0,2.475,2.8,-.25,2.475,3.525,-.25,2.49375,3.525,0,2.49375,2.9,0,2.475,2.9,-.15,2.475,3.45,-.15,2.5125,3.45,0,2.5125,2.8,0,2.4,2.8,-.15,2.4,3.2,-.15,2.4,3.2,0,2.4,3.525,.25,2.49375,2.8,.25,2.475,3.45,.15,2.5125,2.9,.15,2.475,3.2,.15,2.4,2.8,.15,2.4,0,0,3.15,.8,0,3.15,.8,-.45,3.15,.45,-.8,3.15,0,-.8,3.15,0,0,2.85,.2,0,2.7,.2,-.112,2.7,.112,-.2,2.7,0,-.2,2.7,-.45,-.8,3.15,-.8,-.45,3.15,-.8,0,3.15,-.112,-.2,2.7,-.2,-.112,2.7,-.2,0,2.7,-.8,.45,3.15,-.45,.8,3.15,0,.8,3.15,-.2,.112,2.7,-.112,.2,2.7,0,.2,2.7,.45,.8,3.15,.8,.45,3.15,.112,.2,2.7,.2,.112,2.7,.4,0,2.55,.4,-.224,2.55,.224,-.4,2.55,0,-.4,2.55,1.3,0,2.55,1.3,-.728,2.55,.728,-1.3,2.55,0,-1.3,2.55,1.3,0,2.4,1.3,-.728,2.4,.728,-1.3,2.4,0,-1.3,2.4,-.224,-.4,2.55,-.4,-.224,2.55,-.4,0,2.55,-.728,-1.3,2.55,-1.3,-.728,2.55,-1.3,0,2.55,-.728,-1.3,2.4,-1.3,-.728,2.4,-1.3,0,2.4,-.4,.224,2.55,-.224,.4,2.55,0,.4,2.55,-1.3,.728,2.55,-.728,1.3,2.55,0,1.3,2.55,-1.3,.728,2.4,-.728,1.3,2.4,0,1.3,2.4,.224,.4,2.55,.4,.224,2.55,.728,1.3,2.55,1.3,.728,2.55,.728,1.3,2.4,1.3,.728,2.4,0,0,0,1.425,0,0,1.425,.798,0,.798,1.425,0,0,1.425,0,1.5,0,.075,1.5,.84,.075,.84,1.5,.075,0,1.5,.075,-.798,1.425,0,-1.425,.798,0,-1.425,0,0,-.84,1.5,.075,-1.5,.84,.075,-1.5,0,.075,-1.425,-.798,0,-.798,-1.425,0,0,-1.425,0,-1.5,-.84,.075,-.84,-1.5,.075,0,-1.5,.075,.798,-1.425,0,1.425,-.798,0,.84,-1.5,.075,1.5,-.84,.075];super(),e=e||50,t=void 0!==t?Math.max(2,Math.floor(t)||10):10,a=void 0===a||a;const h=3.15*((o=void 0===o||o)?1:1.3)/2,u=e/h;let d=(n=void 0===n||n)?(8*t-4)*t:0;d+=(i=void 0===i||i)?(16*t-4)*t:0,d+=(s=void 0===s||s)?40*t*t:0;const p=new Uint32Array(3*d);let f=n?4:0;f+=i?8:0,f+=s?20:0,f*=(t+1)*(t+1);const m=new Float32Array(3*f),g=new Float32Array(3*f),A=new Float32Array(2*f),v=new r.Matrix4;v.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);const y=[];let x,b,E;const _=[],S=[],w=[],M=[],C=[],T=[],I=[],B=[],R=new r.Vector3;let P,D,L,F,U,O,N,k,G,z=0,Q=0;const V=new r.Vector3;let H,j,W,X;const Y=new r.Matrix4,q=new r.Matrix4,K=new r.Vector4,J=new r.Vector4,Z=new r.Vector4,$=new r.Vector4,ee=new r.Vector3,te=new r.Vector3,ne=v.clone();ne.transpose();const re=(e,t,n)=>!(m[3*e]===m[3*t]&&m[3*e+1]===m[3*t+1]&&m[3*e+2]===m[3*t+2]||m[3*e]===m[3*n]&&m[3*e+1]===m[3*n+1]&&m[3*e+2]===m[3*n+2]||m[3*t]===m[3*n]&&m[3*t+1]===m[3*n+1]&&m[3*t+2]===m[3*n+2]);for(x=0;x<3;x++)C[x]=new r.Matrix4;const ie=n?32:28;F=t+1;let se=0,ae=0,oe=0,le=0,ce=0;for(let r=s?0:20;r<ie;r++)if(i||r<20||r>=28){for(x=0;x<3;x++){for(b=0;b<4;b++)for(E=0;E<4;E++)y[4*E+b]=c[3*l[16*r+4*b+E]+x],a&&r>=20&&r<28&&2!==x&&(y[4*E+b]*=1.077),o||2!==x||(y[4*E+b]*=1.3);Y.set(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),q.multiplyMatrices(Y,v),C[x].multiplyMatrices(ne,q)}for(D=0;D<=t;D++)for(U=D/t,L=0;L<=t;L++){for(O=L/t,G=4,N=k=1;G--;)_[G]=N,S[G]=k,N*=U,k*=O,3===G?(w[G]=M[G]=0,z=Q=1):(w[G]=z*(3-G),M[G]=Q*(3-G),z*=U,Q*=O);for(K.fromArray(_),J.fromArray(S),Z.fromArray(w),$.fromArray(M),x=0;x<3;x++)P=K.clone(),P.applyMatrix4(C[x]),T[x]=P.dot(J),P=Z.clone(),P.applyMatrix4(C[x]),I[x]=P.dot(J),P=K.clone(),P.applyMatrix4(C[x]),B[x]=P.dot($);ee.fromArray(I),te.fromArray(B),R.crossVectors(te,ee),R.normalize(),0===T[0]&&0===T[1]?V.set(0,T[2]>h?1:-1,0):V.set(R.x,R.z,-R.y),m[ae++]=u*T[0],m[ae++]=u*(T[2]-h),m[ae++]=-u*T[1],g[oe++]=V.x,g[oe++]=V.y,g[oe++]=V.z,A[le++]=1-O,A[le++]=1-U}for(D=0;D<t;D++)for(L=0;L<t;L++)H=se*F*F+D*F+L,j=H+1,W=j+F,X=H+F,re(H,j,W)&&(p[ce++]=H,p[ce++]=j,p[ce++]=W),re(H,W,X)&&(p[ce++]=H,p[ce++]=W,p[ce++]=X);se++}this.setIndex(new r.BufferAttribute(p,1)),this.setAttribute("position",new r.BufferAttribute(m,3)),this.setAttribute("normal",new r.BufferAttribute(g,3)),this.setAttribute("uv",new r.BufferAttribute(A,2)),this.computeBoundingSphere()}}t.TeapotGeometry=i},66038:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.ExtrudeGeometry{constructor(e,t={}){const{bevelEnabled:n=!1,bevelSize:r=8,bevelThickness:i=10,font:s,height:a=50,size:o=100,lineHeight:l=1,letterSpacing:c=0,...h}=t;if(void 0===s)super();else{super(s.generateShapes(e,o,{lineHeight:l,letterSpacing:c}),{...h,bevelEnabled:n,bevelSize:r,bevelThickness:i,depth:a})}this.type="TextGeometry"}}t.TextBufferGeometry=i,t.TextGeometry=i},3614:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t){const n=new r.ShaderMaterial({type:"LightProbeHelperMaterial",uniforms:{sh:{value:e.sh.coefficients},intensity:{value:e.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\tgl_FragColor = linearToOutputTexel( vec4( outgoingLight, 1.0 ) );","}"].join("\n")});super(new r.SphereGeometry(1,32,16),n),this.lightProbe=e,this.size=t,this.type="LightProbeHelper",this.onBeforeRender()}dispose(){this.geometry.dispose(),this.material.dispose()}onBeforeRender(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity}}t.LightProbeHelper=i},48117:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Line{constructor(e,t=1,n=16,i=2){const s=new r.BufferGeometry,a=new Float32Array(3*(3*(n+2*i)+3));s.setAttribute("position",new r.BufferAttribute(a,3));const o=new r.LineBasicMaterial({color:65280});super(s,[new r.LineBasicMaterial({color:16776960}),o]),this.type="PositionalAudioHelper",this.audio=e,this.range=t,this.divisionsInnerAngle=n,this.divisionsOuterAngle=i,this.update()}update(){const e=this.audio,t=this.range,n=this.divisionsInnerAngle,i=this.divisionsOuterAngle,s=r.MathUtils.degToRad(e.panner.coneInnerAngle),a=r.MathUtils.degToRad(e.panner.coneOuterAngle),o=s/2,l=a/2;let c,h,u=0,d=0;const p=this.geometry,f=p.attributes.position;function m(e,n,r,i){const s=(n-e)/r;for(f.setXYZ(u,0,0,0),d++,c=e;c<n;c+=s)h=u+d,f.setXYZ(h,Math.sin(c)*t,0,Math.cos(c)*t),f.setXYZ(h+1,Math.sin(Math.min(c+s,n))*t,0,Math.cos(Math.min(c+s,n))*t),f.setXYZ(h+2,0,0,0),d+=3;p.addGroup(u,d,i),u+=d,d=0}p.clearGroups(),m(-l,-o,i,0),m(-o,o,n,1),m(o,l,i,0),f.needsUpdate=!0,s===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}t.PositionalAudioHelper=i},19301:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Line{constructor(e,t){const n=new r.BufferGeometry;n.setAttribute("position",new r.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();super(n,new r.LineBasicMaterial({fog:!1})),this.light=e,this.color=t,this.type="RectAreaLightHelper";const i=new r.BufferGeometry;i.setAttribute("position",new r.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new r.Mesh(i,new r.MeshBasicMaterial({side:r.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}t.RectAreaLightHelper=i},67376:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Vector3,a=new r.Matrix3;class o extends r.LineSegments{constructor(e,t=1,n=16711680){const i=new r.BufferGeometry,s=e.geometry.attributes.normal.count,a=new r.Float32BufferAttribute(2*s*3,3);i.setAttribute("position",a),super(i,new r.LineBasicMaterial({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),a.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const r=n.attributes.position,o=n.attributes.normal;let l=0;for(let n=0,c=r.count;n<c;n++)i.fromBufferAttribute(r,n).applyMatrix4(e),s.fromBufferAttribute(o,n),s.applyMatrix3(a).normalize().multiplyScalar(this.size).add(i),t.setXYZ(l,i.x,i.y,i.z),l+=1,t.setXYZ(l,s.x,s.y,s.z),l+=1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}t.VertexNormalsHelper=o},59308:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Vector3;class a extends r.LineSegments{constructor(e,t=1,n=65535){const i=new r.BufferGeometry,s=e.geometry.attributes.tangent.count,a=new r.Float32BufferAttribute(2*s*3,3);i.setAttribute("position",a),super(i,new r.LineBasicMaterial({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexTangentsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry,r=n.attributes.position,a=n.attributes.tangent;let o=0;for(let l=0,c=r.count;l<c;l++)i.fromBufferAttribute(r,l).applyMatrix4(e),s.fromBufferAttribute(a,l),s.transformDirection(e).multiplyScalar(this.size).add(i),t.setXYZ(o,i.x,i.y,i.z),o+=1,t.setXYZ(o,s.x,s.y,s.z),o+=1;t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}t.VertexTangentsHelper=a},56475:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(36455),i=n(30864),s=n(46863),a=n(58532),o=n(37753),l=n(73653),c=n(91248),h=n(90648),u=n(17101),d=n(4618),p=n(94117),f=n(70599),m=n(61350),g=n(29667),A=n(58688),v=n(16429),y=n(35404),x=n(77600),b=n(99100),E=n(29022),_=n(25386),S=n(80101),w=n(80466),M=n(83920),C=n(588),T=n(22195),I=n(74918),B=n(19338),R=n(17351),P=n(37181),D=n(32434),L=n(53374),F=n(83713),U=n(69457),O=n(36217),N=n(77224),k=n(89930),G=n(75488),z=n(86307),Q=n(16558),V=n(17564),H=n(52359),j=n(14514),W=n(8294),X=n(91909),Y=n(92664),q=n(79047),K=n(95034),J=n(29888),Z=n(63833),$=n(13979),ee=n(83912),te=n(60995),ne=n(14024),re=n(96244),ie=n(66552),se=n(69651),ae=n(34903),oe=n(90515),le=n(17570),ce=n(84181),he=n(17458),ue=n(84145),de=n(79888),pe=n(57829),fe=n(30252),me=n(83828),ge=n(60173),Ae=n(53667),ve=n(3442),ye=n(45830),xe=n(17412),be=n(97573),Ee=n(46603),_e=n(78122),Se=n(22845),we=n(49888),Me=n(834),Ce=n(51761),Te=n(88511),Ie=n(5050),Be=n(7679),Re=n(20591),Pe=n(79666),De=n(44441),Le=n(64753),Fe=n(98263),Ue=n(49190),Oe=n(70866),Ne=n(69265),ke=n(24064),Ge=n(72449),ze=n(96665),Qe=n(23918),Ve=n(81362),He=n(1258),je=n(17214),We=n(18526),Xe=n(98060),Ye=n(18921),qe=n(44652),Ke=n(27251),Je=n(17497),Ze=n(62788),$e=n(4437),et=n(57382),tt=n(73162),nt=n(65483),rt=n(79752),it=n(93177),st=n(28265),at=n(2327),ot=n(19453),lt=n(11225),ct=n(12888),ht=n(12333),ut=n(41019),dt=n(92018),pt=n(42095),ft=n(23723),mt=n(86584),gt=n(41694),At=n(24858),vt=n(66038),yt=n(30824),xt=n(95703),bt=n(41959),Et=n(62602),_t=n(42333),St=n(70382),wt=n(17853),Mt=n(18260),Ct=n(69556),Tt=n(73500),It=n(67971),Bt=n(49890),Rt=n(67618),Pt=n(2474),Dt=n(59564),Lt=n(83453),Ft=n(55175),Ut=n(86170),Ot=n(59305),Nt=n(15479),kt=n(85832),Gt=n(29076),zt=n(13855),Qt=n(37272),Vt=n(29839),Ht=n(85402),jt=n(50044),Wt=n(79169),Xt=n(37211),Yt=n(39032),qt=n(43098),Kt=n(29983),Jt=n(78440),Zt=n(48123),$t=n(69277),en=n(29176),tn=n(94640),nn=n(79203),rn=n(16025),sn=n(24730),an=n(27407),on=n(48463),ln=n(30424),cn=n(83222),hn=n(66155),un=n(61621),dn=n(60206),pn=n(51867),fn=n(55658),mn=n(60310),gn=n(65149),An=n(94989),vn=n(19076),yn=n(74354),xn=n(16832),bn=n(169),En=n(96851),_n=n(24820),Sn=n(37037),wn=n(72134),Mn=n(49693),Cn=n(24826),Tn=n(18233),In=n(71253),Bn=n(30675),Rn=n(19574),Pn=n(92701),Dn=n(27619),Ln=n(74758),Fn=n(2545),Un=n(76193),On=n(78798),Nn=n(4246),kn=n(79140),Gn=n(56668),zn=n(4951),Qn=n(96334),Vn=n(7955),Hn=n(41163),jn=n(8117),Wn=n(57659),Xn=n(60716),Yn=n(31150),qn=n(66910),Kn=n(16354),Jn=n(74181),Zn=n(13785),$n=n(88799),er=n(25452),tr=n(39142),nr=n(7472),rr=n(79872),ir=n(91004),sr=n(77750),ar=n(85569),or=n(78929),lr=n(23940),cr=n(20614),hr=n(49935),ur=n(37425),dr=n(13446),pr=n(37343),fr=n(77741),mr=n(28057),gr=n(6258),Ar=n(59198),vr=n(88909),yr=n(22996),xr=n(67071),br=n(28491),Er=n(70658),_r=n(21847),Sr=n(26386),wr=n(18113),Mr=n(80353),Cr=n(5440),Tr=n(13235),Ir=n(77723),Br=n(8052),Rr=n(27575),Pr=n(45051),Dr=n(39867),Lr=n(3614),Fr=n(59308),Ur=n(48117),Or=n(67376),Nr=n(19301),kr=n(60762),Gr=n(94418),zr=n(11576),Qr=n(98001),Vr=n(81587),Hr=n(4668),jr=n(75668),Wr=n(15527),Xr=n(48490);t.MD2CharacterComplex=r.MD2CharacterComplex,t.ConvexObjectBreaker=i.ConvexObjectBreaker,t.MorphBlendMesh=s.MorphBlendMesh,t.GPUComputationRenderer=a.GPUComputationRenderer,t.Gyroscope=o.Gyroscope,t.MorphAnimMesh=l.MorphAnimMesh,t.RollerCoasterGeometry=c.RollerCoasterGeometry,t.RollerCoasterLiftersGeometry=c.RollerCoasterLiftersGeometry,t.RollerCoasterShadowGeometry=c.RollerCoasterShadowGeometry,t.SkyGeometry=c.SkyGeometry,t.TreesGeometry=c.TreesGeometry,t.Timer=h.Timer,t.getErrorMessage=u.getErrorMessage,t.getWebGL2ErrorMessage=u.getWebGL2ErrorMessage,t.getWebGLErrorMessage=u.getWebGLErrorMessage,t.isWebGL2Available=u.isWebGL2Available,t.isWebGLAvailable=u.isWebGLAvailable,t.MD2Character=d.MD2Character,t.VolumeSlice=p.VolumeSlice,t.TubePainter=f.TubePainter,t.Volume=m.Volume,t.ProgressiveLightMap=g.ProgressiveLightMap,t.CSS2DObject=A.CSS2DObject,t.CSS2DRenderer=A.CSS2DRenderer,t.CSS3DObject=v.CSS3DObject,t.CSS3DRenderer=v.CSS3DRenderer,t.CSS3DSprite=v.CSS3DSprite,t.Projector=y.Projector,t.RenderableFace=y.RenderableFace,t.RenderableLine=y.RenderableLine,t.RenderableObject=y.RenderableObject,t.RenderableSprite=y.RenderableSprite,t.RenderableVertex=y.RenderableVertex,t.SVGObject=x.SVGObject,t.SVGRenderer=x.SVGRenderer,t.FlakesTexture=b.FlakesTexture,t.Flow=E.Flow,t.InstancedFlow=E.InstancedFlow,t.getUniforms=E.getUniforms,t.initSplineTexture=E.initSplineTexture,t.modifyShader=E.modifyShader,t.updateSplineTexture=E.updateSplineTexture,t.SimplifyModifier=_.SimplifyModifier,t.EdgeSplitModifier=S.EdgeSplitModifier,t.TessellateModifier=w.TessellateModifier,t.GLTFExporter=M.GLTFExporter,t.USDZExporter=C.USDZExporter,t.PLYExporter=T.PLYExporter,t.DRACOExporter=I.DRACOExporter,t.ColladaExporter=B.ColladaExporter,t.MMDExporter=R.MMDExporter,t.STLExporter=P.STLExporter,t.OBJExporter=D.OBJExporter,t.RoomEnvironment=L.RoomEnvironment,t.AnimationClipCreator=F.AnimationClipCreator,t.CCDIKHelper=U.CCDIKHelper,t.CCDIKSolver=U.CCDIKSolver,t.MMDPhysics=O.MMDPhysics,t.MMDAnimationHelper=N.MMDAnimationHelper,t.BatchedMesh=k.BatchedMesh,t.Reflector=G.Reflector,t.Refractor=z.Refractor,t.ShadowMesh=Q.ShadowMesh,t.Lensflare=V.Lensflare,t.LensflareElement=V.LensflareElement,t.Water=H.Water,t.MarchingCubes=j.MarchingCubes,t.edgeTable=j.edgeTable,t.triTable=j.triTable,t.LightningStorm=W.LightningStorm,t.ReflectorRTT=X.ReflectorRTT,t.ReflectorForSSRPass=Y.ReflectorForSSRPass,t.Sky=q.Sky,t.Water2=K.Water2,t.GroundProjectedEnv=J.GroundProjectedEnv,t.SceneUtils=Z.SceneUtils,t.UVsDebug=$.UVsDebug,t.GeometryUtils=ee.GeometryUtils,t.RoughnessMipmapper=te.RoughnessMipmapper,t.SkeletonUtils=ne.SkeletonUtils,t.ShadowMapViewer=re.ShadowMapViewer,t.computeMorphedAttributes=ie.computeMorphedAttributes,t.estimateBytesUsed=ie.estimateBytesUsed,t.interleaveAttributes=ie.interleaveAttributes,t.mergeBufferAttributes=ie.mergeBufferAttributes,t.mergeBufferGeometries=ie.mergeBufferGeometries,t.mergeVertices=ie.mergeVertices,t.toCreasedNormals=ie.toCreasedNormals,t.toTrianglesDrawMode=ie.toTrianglesDrawMode,t.GeometryCompressionUtils=se.GeometryCompressionUtils,t.PackedPhongMaterial=se.PackedPhongMaterial,t.CinematicCamera=ae.CinematicCamera,t.ConvexHull=oe.ConvexHull,t.Face=oe.Face,t.HalfEdge=oe.HalfEdge,t.VertexList=oe.VertexList,t.VertexNode=oe.VertexNode,t.MeshSurfaceSampler=le.MeshSurfaceSampler,t.SimplexNoise=ce.SimplexNoise,t.OBB=he.OBB,t.Capsule=ue.Capsule,t.ColorConverter=de.ColorConverter,t.ImprovedNoise=pe.ImprovedNoise,t.Octree=fe.Octree,t.ColorMapKeywords=me.ColorMapKeywords,t.Lut=me.Lut,t.CameraControls=ge.CameraControls,t.MapControlsExp=ge.MapControlsExp,t.OrbitControlsExp=ge.OrbitControlsExp,t.STATE=ge.STATE,t.TrackballControlsExp=ge.TrackballControlsExp,t.FirstPersonControls=Ae.FirstPersonControls,t.TransformControls=ve.TransformControls,t.TransformControlsGizmo=ve.TransformControlsGizmo,t.TransformControlsPlane=ve.TransformControlsPlane,t.DragControls=ye.DragControls,t.PointerLockControls=xe.PointerLockControls,t.DeviceOrientationControls=be.DeviceOrientationControls,t.TrackballControls=Ee.TrackballControls,t.MapControls=_e.MapControls,t.OrbitControls=_e.OrbitControls,t.ArcballControls=Se.ArcballControls,t.FlyControls=we.FlyControls,t.LUTPass=Me.LUTPass,t.ClearPass=Ce.ClearPass,t.GlitchPass=Te.GlitchPass,t.HalftonePass=Ie.HalftonePass,t.SMAAPass=Be.SMAAPass,t.FilmPass=Re.FilmPass,t.OutlinePass=Pe.OutlinePass,t.SSAOPass=De.SSAOPass,t.SavePass=Le.SavePass,t.BokehPass=Fe.BokehPass,t.FullScreenQuad=Ue.FullScreenQuad,t.Pass=Ue.Pass,t.TexturePass=Oe.TexturePass,t.AdaptiveToneMappingPass=Ne.AdaptiveToneMappingPass,t.UnrealBloomPass=ke.UnrealBloomPass,t.CubeTexturePass=Ge.CubeTexturePass,t.SAOPass=ze.SAOPass,t.AfterimagePass=Qe.AfterimagePass,t.ClearMaskPass=Ve.ClearMaskPass,t.MaskPass=Ve.MaskPass,t.EffectComposer=He.EffectComposer,t.DotScreenPass=je.DotScreenPass,t.SSRPass=We.SSRPass,t.TAARenderPass=Xe.TAARenderPass,t.ShaderPass=Ye.ShaderPass,t.SSAARenderPass=qe.SSAARenderPass,t.RenderPass=Ke.RenderPass,t.RenderPixelatedPass=Je.RenderPixelatedPass,t.BloomPass=Ze.BloomPass,t.WaterPass=$e.WaterPass,t.ARButton=et.ARButton,t.OculusHandModel=tt.OculusHandModel,t.OculusHandPointerModel=nt.OculusHandPointerModel,t.createText=rt.createText,t.VRButton=it.VRButton,t.XRControllerModelFactory=st.XRControllerModelFactory,t.XREstimatedLight=at.XREstimatedLight,t.XRHandMeshModel=ot.XRHandMeshModel,t.XRHandModelFactory=lt.XRHandModelFactory,t.XRHandPrimitiveModel=ct.XRHandPrimitiveModel,t.ParametricGeometries=ht.ParametricGeometries,t.ParametricGeometry=ut.ParametricGeometry,t.ConvexGeometry=dt.ConvexGeometry,t.LightningStrike=pt.LightningStrike,t.RoundedBoxGeometry=ft.RoundedBoxGeometry,t.BoxLineGeometry=mt.BoxLineGeometry,t.DecalGeometry=gt.DecalGeometry,t.DecalVertex=gt.DecalVertex,t.TeapotGeometry=At.TeapotGeometry,t.TextBufferGeometry=vt.TextGeometry,t.TextGeometry=vt.TextGeometry,t.CSM=yt.CSM,t.CSMFrustum=xt.CSMFrustum,t.CSMHelper=bt.CSMHelper,t.CSMShader=Et.CSMShader,t.ACESFilmicToneMappingShader=_t.ACESFilmicToneMappingShader,t.AfterimageShader=St.AfterimageShader,t.BasicShader=wt.BasicShader,t.BleachBypassShader=Mt.BleachBypassShader,t.BlendShader=Ct.BlendShader,t.BokehShader=Tt.BokehShader,t.BokehDepthShader=It.BokehDepthShader,t.BokehShader2=It.BokehShader2,t.BrightnessContrastShader=Bt.BrightnessContrastShader,t.ColorCorrectionShader=Rt.ColorCorrectionShader,t.ColorifyShader=Pt.ColorifyShader,t.ConvolutionShader=Dt.ConvolutionShader,t.CopyShader=Lt.CopyShader,t.DOFMipMapShader=Ft.DOFMipMapShader,t.BlurShaderUtils=Ut.BlurShaderUtils,t.DepthLimitedBlurShader=Ut.DepthLimitedBlurShader,t.DigitalGlitch=Ot.DigitalGlitch,t.DotScreenShader=Nt.DotScreenShader,t.FXAAShader=kt.FXAAShader,t.FilmShader=Gt.FilmShader,t.FocusShader=zt.FocusShader,t.FreiChenShader=Qt.FreiChenShader,t.FresnelShader=Vt.FresnelShader,t.GammaCorrectionShader=Ht.GammaCorrectionShader,t.GodRaysCombineShader=jt.GodRaysCombineShader,t.GodRaysDepthMaskShader=jt.GodRaysDepthMaskShader,t.GodRaysFakeSunShader=jt.GodRaysFakeSunShader,t.GodRaysGenerateShader=jt.GodRaysGenerateShader,t.HalftoneShader=Wt.HalftoneShader,t.HorizontalBlurShader=Xt.HorizontalBlurShader,t.HorizontalTiltShiftShader=Yt.HorizontalTiltShiftShader,t.HueSaturationShader=qt.HueSaturationShader,t.KaleidoShader=Kt.KaleidoShader,t.LuminosityHighPassShader=Jt.LuminosityHighPassShader,t.LuminosityShader=Zt.LuminosityShader,t.MirrorShader=$t.MirrorShader,t.NormalMapShader=en.NormalMapShader,t.ParallaxShader=tn.ParallaxShader,t.PixelShader=nn.PixelShader,t.RGBShiftShader=rn.RGBShiftShader,t.SAOShader=sn.SAOShader,t.SMAABlendShader=an.SMAABlendShader,t.SMAAEdgesShader=an.SMAAEdgesShader,t.SMAAWeightsShader=an.SMAAWeightsShader,t.SSAOBlurShader=on.SSAOBlurShader,t.SSAODepthShader=on.SSAODepthShader,t.SSAOShader=on.SSAOShader,t.SSRBlurShader=ln.SSRBlurShader,t.SSRDepthShader=ln.SSRDepthShader,t.SSRShader=ln.SSRShader,t.SepiaShader=cn.SepiaShader,t.SobelOperatorShader=hn.SobelOperatorShader,t.SubsurfaceScatteringShader=un.SubsurfaceScatteringShader,t.TechnicolorShader=dn.TechnicolorShader,t.ToneMapShader=pn.ToneMapShader,t.ToonShader1=fn.ToonShader1,t.ToonShader2=fn.ToonShader2,t.ToonShaderDotted=fn.ToonShaderDotted,t.ToonShaderHatching=fn.ToonShaderHatching,t.TriangleBlurShader=mn.TriangleBlurShader,t.UnpackDepthRGBAShader=gn.UnpackDepthRGBAShader,t.VerticalBlurShader=An.VerticalBlurShader,t.VerticalTiltShiftShader=vn.VerticalTiltShiftShader,t.VignetteShader=yn.VignetteShader,t.VolumeRenderShader1=xn.VolumeRenderShader1,t.WaterRefractionShader=bn.WaterRefractionShader,t.HTMLMesh=En.HTMLMesh,t.InteractiveGroup=_n.InteractiveGroup,t.SelectionHelper=Sn.SelectionHelper,t.SelectionBox=wn.SelectionBox,t.AmmoPhysics=Mn.AmmoPhysics,t.ParallaxBarrierEffect=Cn.ParallaxBarrierEffect,t.PeppersGhostEffect=Tn.PeppersGhostEffect,t.OutlineEffect=In.OutlineEffect,t.AnaglyphEffect=Bn.AnaglyphEffect,t.AsciiEffect=Rn.AsciiEffect,t.StereoEffect=Pn.StereoEffect,t.FBXLoader=Dn.FBXLoader,t.Font=Ln.Font,t.FontLoader=Ln.FontLoader,t.TGALoader=Fn.TGALoader,t.LUTCubeLoader=Un.LUTCubeLoader,t.NRRDLoader=On.NRRDLoader,t.STLLoader=Nn.STLLoader,t.MTLLoader=kn.MTLLoader,t.XLoader=Gn.XLoader,t.BVHLoader=zn.BVHLoader,t.KMZLoader=Qn.KMZLoader,t.VRMLoader=Vn.VRMLoader,t.VRMLLoader=Hn.VRMLLoader,t.KTX2Loader=jn.KTX2Loader,t.LottieLoader=Wn.LottieLoader,t.TTFLoader=Xn.TTFLoader,t.RGBELoader=Yn.RGBELoader,t.AssimpLoader=qn.AssimpLoader,t.ColladaLoader=Kn.ColladaLoader,t.MDDLoader=Jn.MDDLoader,t.EXRLoader=Zn.EXRLoader,t.ThreeMFLoader=$n.ThreeMFLoader,t.XYZLoader=er.XYZLoader,t.VTKLoader=tr.VTKLoader,t.LUT3dlLoader=nr.LUT3dlLoader,t.DDSLoader=rr.DDSLoader,t.PVRLoader=ir.PVRLoader,t.GCodeLoader=sr.GCodeLoader,t.BasisTextureLoader=ar.BasisTextureLoader,t.TDSLoader=or.TDSLoader,t.LDrawLoader=lr.LDrawLoader,t.GLTFLoader=cr.GLTFLoader,t.SVGLoader=hr.SVGLoader,t.Rhino3dmLoader=ur.Rhino3dmLoader,t.OBJLoader=dr.OBJLoader,t.AMFLoader=pr.AMFLoader,t.MMDLoader=fr.MMDLoader,t.MD2Loader=mr.MD2Loader,t.KTXLoader=gr.KTXLoader,t.TiltLoader=Ar.TiltLoader,t.DRACOLoader=vr.DRACOLoader,t.HDRCubeTextureLoader=yr.HDRCubeTextureLoader,t.PDBLoader=xr.PDBLoader,t.PRWMLoader=br.PRWMLoader,t.RGBMLoader=Er.RGBMLoader,t.VOXData3DTexture=_r.VOXData3DTexture,t.VOXLoader=_r.VOXLoader,t.VOXMesh=_r.VOXMesh,t.PCDLoader=Sr.PCDLoader,t.LWOLoader=wr.LWOLoader,t.PLYLoader=Mr.PLYLoader,t.LineSegmentsGeometry=Cr.LineSegmentsGeometry,t.LineGeometry=Tr.LineGeometry,t.Wireframe=Ir.Wireframe,t.WireframeGeometry2=Br.WireframeGeometry2,t.Line2=Rr.Line2,t.LineMaterial=Pr.LineMaterial,t.LineSegments2=Dr.LineSegments2,t.LightProbeHelper=Lr.LightProbeHelper,t.VertexTangentsHelper=Fr.VertexTangentsHelper,t.PositionalAudioHelper=Ur.PositionalAudioHelper,t.VertexNormalsHelper=Or.VertexNormalsHelper,t.RectAreaLightHelper=Nr.RectAreaLightHelper,t.RectAreaLightUniformsLib=kr.RectAreaLightUniformsLib,t.LightProbeGenerator=Gr.LightProbeGenerator,t.calcBSplineDerivatives=zr.calcBSplineDerivatives,t.calcBSplinePoint=zr.calcBSplinePoint,t.calcBasisFunctionDerivatives=zr.calcBasisFunctionDerivatives,t.calcBasisFunctions=zr.calcBasisFunctions,t.calcKoverI=zr.calcKoverI,t.calcNURBSDerivatives=zr.calcNURBSDerivatives,t.calcRationalCurveDerivatives=zr.calcRationalCurveDerivatives,t.calcSurfacePoint=zr.calcSurfacePoint,t.findSpan=zr.findSpan,t.NURBSCurve=Qr.NURBSCurve,t.NURBSSurface=Vr.NURBSSurface,t.CinquefoilKnot=Hr.CinquefoilKnot,t.DecoratedTorusKnot4a=Hr.DecoratedTorusKnot4a,t.DecoratedTorusKnot4b=Hr.DecoratedTorusKnot4b,t.DecoratedTorusKnot5a=Hr.DecoratedTorusKnot5a,t.DecoratedTorusKnot5c=Hr.DecoratedTorusKnot5c,t.FigureEightPolynomialKnot=Hr.FigureEightPolynomialKnot,t.GrannyKnot=Hr.GrannyKnot,t.HeartCurve=Hr.HeartCurve,t.HelixCurve=Hr.HelixCurve,t.KnotCurve=Hr.KnotCurve,t.TorusKnot=Hr.TorusKnot,t.TrefoilKnot=Hr.TrefoilKnot,t.TrefoilPolynomialKnot=Hr.TrefoilPolynomialKnot,t.VivianiCurve=Hr.VivianiCurve,t.Face3=jr.Face3,t.Geometry=jr.Geometry,t.MeshoptDecoder=Wr.MeshoptDecoder,t.MotionController=Xr.MotionController,t.MotionControllerConstants=Xr.MotionControllerConstants,t.fetchProfile=Xr.fetchProfile,t.fetchProfilesList=Xr.fetchProfilesList},96851:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e){const t=new s(e),n=new r.PlaneGeometry(.001*t.image.width,.001*t.image.height),i=new r.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});function o(e){i.map.dispatchDOMEvent(e)}super(n,i),this.addEventListener("mousedown",o),this.addEventListener("mousemove",o),this.addEventListener("mouseup",o),this.addEventListener("click",o),this.dispose=function(){n.dispose(),i.dispose(),i.map.dispose(),a.delete(e),this.removeEventListener("mousedown",o),this.removeEventListener("mousemove",o),this.removeEventListener("mouseup",o),this.removeEventListener("click",o)}}}class s extends r.CanvasTexture{constructor(e){super(o(e)),this.dom=e,this.anisotropy=16,"colorSpace"in this?this.colorSpace="srgb":this.encoding=3001,this.minFilter=r.LinearFilter,this.magFilter=r.LinearFilter;const t=new MutationObserver((()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout((()=>this.update()),16))}));t.observe(e,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.observer=t}dispatchDOMEvent(e){e.data&&function(e,t,n,r){const i={clientX:n*e.offsetWidth+e.offsetLeft,clientY:r*e.offsetHeight+e.offsetTop,view:e.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(t,i));const s=e.getBoundingClientRect();function a(e){if(e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE){const s=e.getBoundingClientRect();if(n>s.left&&n<s.right&&r>s.top&&r<s.bottom&&(e.dispatchEvent(new MouseEvent(t,i)),e instanceof HTMLInputElement&&"range"===e.type&&("mousedown"===t||"click"===t))){const[t,r]=["min","max"].map((t=>parseFloat(e[t]))),i=s.width,a=(n-s.x)/i;e.value=t+(r-t)*a,e.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let t=0;t<e.childNodes.length;t++)a(e.childNodes[t])}}n=n*s.width+s.left,r=r*s.height+s.top,a(e)}(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=o(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const a=new WeakMap;function o(e){const t=document.createRange(),n=new r.Color;function i(e,t,n,r){""!==r&&("uppercase"===e.textTransform&&(r=r.toUpperCase()),h.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,h.textBaseline="top",h.fillStyle=e.color,h.fillText(r,t,n+.1*parseFloat(e.fontSize)))}function s(e,t,n,r,i){n<2*i&&(i=n/2),r<2*i&&(i=r/2),h.beginPath(),h.moveTo(e+i,t),h.arcTo(e+n,t,e+n,t+r,i),h.arcTo(e+n,t+r,e,t+r,i),h.arcTo(e,t+r,e,t,i),h.arcTo(e,t,e+n,t,i),h.closePath()}function o(e,t,n,r,i,s){const a=e[t+"Width"],o=e[t+"Style"],l=e[t+"Color"];"0px"!==a&&"none"!==o&&"transparent"!==l&&"rgba(0, 0, 0, 0)"!==l&&(h.strokeStyle=l,h.lineWidth=parseFloat(a),h.beginPath(),h.moveTo(n,r),h.lineTo(n+i,r+s),h.stroke())}const l=e.getBoundingClientRect();let c=a.get(e);void 0===c&&(c=document.createElement("canvas"),c.width=l.width,c.height=l.height,a.set(e,c));const h=c.getContext("2d"),u=new function(e){const t=[];let n=!1;function r(){if(n&&(n=!1,e.restore()),0===t.length)return;let r=-1/0,i=-1/0,s=1/0,a=1/0;for(let e=0;e<t.length;e++){const n=t[e];r=Math.max(r,n.x),i=Math.max(i,n.y),s=Math.min(s,n.x+n.width),a=Math.min(a,n.y+n.height)}e.save(),e.beginPath(),e.rect(r,i,s-r,a-i),e.clip(),n=!0}return{add:function(e){t.push(e),r()},remove:function(){t.pop(),r()}}}(h);return function e(r,a){let c=0,d=0,p=0,f=0;if(r.nodeType===Node.TEXT_NODE){t.selectNode(r);const e=t.getBoundingClientRect();c=e.left-l.left-.5,d=e.top-l.top-.5,p=e.width,f=e.height,i(a,c,d,r.nodeValue.trim())}else{if(r.nodeType===Node.COMMENT_NODE)return;if(r instanceof HTMLCanvasElement){if("none"===r.style.display)return;h.save();const e=window.devicePixelRatio;h.scale(1/e,1/e),h.drawImage(r,0,0),h.restore()}else{if("none"===r.style.display)return;const e=r.getBoundingClientRect();c=e.left-l.left-.5,d=e.top-l.top-.5,p=e.width,f=e.height,a=window.getComputedStyle(r),s(c,d,p,f,parseFloat(a.borderRadius));const t=a.backgroundColor;"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t&&(h.fillStyle=t,h.fill());const m=["borderTop","borderLeft","borderBottom","borderRight"];let g=!0,A=null;for(const n of m){if(null!==A&&(g=a[n+"Width"]===a[A+"Width"]&&a[n+"Color"]===a[A+"Color"]&&a[n+"Style"]===a[A+"Style"]),!1===g)break;A=n}if(!0===g){const e=parseFloat(a.borderTopWidth);"0px"!==a.borderTopWidth&&"none"!==a.borderTopStyle&&"transparent"!==a.borderTopColor&&"rgba(0, 0, 0, 0)"!==a.borderTopColor&&(h.strokeStyle=a.borderTopColor,h.lineWidth=e,h.stroke())}else o(a,"borderTop",c,d,p,0),o(a,"borderLeft",c,d,0,f),o(a,"borderBottom",c,d+f,p,0),o(a,"borderRight",c+p,d,0,f);if(r instanceof HTMLInputElement){let e=a.accentColor;void 0!==e&&"auto"!==e||(e=a.color),n.set(e);const t=Math.sqrt(.299*n.r**2+.587*n.g**2+.114*n.b**2)<.5?"white":"#111111";if("radio"===r.type&&(s(c,d,p,f,f),h.fillStyle="white",h.strokeStyle=e,h.lineWidth=1,h.fill(),h.stroke(),r.checked&&(s(c+2,d+2,p-4,f-4,f),h.fillStyle=e,h.strokeStyle=t,h.lineWidth=2,h.fill(),h.stroke())),"checkbox"===r.type&&(s(c,d,p,f,2),h.fillStyle=r.checked?e:"white",h.strokeStyle=r.checked?t:e,h.lineWidth=1,h.stroke(),h.fill(),r.checked)){const e=h.textAlign;h.textAlign="center";i({color:t,fontFamily:a.fontFamily,fontSize:f+"px",fontWeight:"bold"},c+p/2,d,"\u2714"),h.textAlign=e}if("range"===r.type){const[n,i,a]=["min","max","value"].map((e=>parseFloat(r[e]))),o=(a-n)/(i-n)*(p-f);s(c,d+f/4,p,f/2,f/4),h.fillStyle=t,h.strokeStyle=e,h.lineWidth=1,h.fill(),h.stroke(),s(c,d+f/4,o+f/2,f/2,f/4),h.fillStyle=e,h.fill(),s(c+o,d,f,f,f/2),h.fillStyle=e,h.fill()}"color"!==r.type&&"text"!==r.type&&"number"!==r.type||(u.add({x:c,y:d,width:p,height:f}),i(a,c+parseInt(a.paddingLeft),d+parseInt(a.paddingTop),r.value),u.remove())}}}const m="auto"===a.overflow||"hidden"===a.overflow;m&&u.add({x:c,y:d,width:p,height:f});for(let t=0;t<r.childNodes.length;t++)e(r.childNodes[t],a);m&&u.remove()}(e),c}t.HTMLMesh=i},24820:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector2,s={type:"",data:i};class a extends r.Group{constructor(e,t){super();const n=this,a=new r.Raycaster,o=new r.Matrix4,l=e.domElement;function c(e){e.stopPropagation(),i.x=e.clientX/l.clientWidth*2-1,i.y=-e.clientY/l.clientHeight*2+1,a.setFromCamera(i,t);const r=a.intersectObjects(n.children,!1);if(r.length>0){const t=r[0],n=t.object,i=t.uv;s.type=e.type,s.data.set(i.x,1-i.y),n.dispatchEvent(s)}}l.addEventListener("pointerdown",c),l.addEventListener("pointerup",c),l.addEventListener("pointermove",c),l.addEventListener("mousedown",c),l.addEventListener("mouseup",c),l.addEventListener("mousemove",c),l.addEventListener("click",c);const h={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function u(e){const t=e.target;o.identity().extractRotation(t.matrixWorld),a.ray.origin.setFromMatrixPosition(t.matrixWorld),a.ray.direction.set(0,0,-1).applyMatrix4(o);const r=a.intersectObjects(n.children,!1);if(r.length>0){const t=r[0],n=t.object,i=t.uv;s.type=h[e.type],s.data.set(i.x,1-i.y),n.dispatchEvent(s)}}const d=e.xr.getController(0);d.addEventListener("move",u),d.addEventListener("select",u),d.addEventListener("selectstart",u),d.addEventListener("selectend",u);const p=e.xr.getController(1);p.addEventListener("move",u),p.addEventListener("select",u),p.addEventListener("selectstart",u),p.addEventListener("selectend",u)}}t.InteractiveGroup=a},72134:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Frustum,s=new r.Vector3,a=new r.Vector3,o=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Vector3,p=new r.Vector3,f=new r.Vector3,m=new r.Vector3,g=new r.Vector3,A=new r.Vector3,v=new r.Vector3;t.SelectionBox=class{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new r.Vector3,this.endPoint=new r.Vector3,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(i,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera)a.copy(e),a.x=Math.min(e.x,t.x),a.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),o.setFromMatrixPosition(this.camera.matrixWorld),l.copy(a),c.set(t.x,a.y,0),h.copy(t),u.set(a.x,t.y,0),l.unproject(this.camera),c.unproject(this.camera),h.unproject(this.camera),u.unproject(this.camera),g.copy(l).sub(o),A.copy(c).sub(o),v.copy(h).sub(o),g.normalize(),A.normalize(),v.normalize(),g.multiplyScalar(this.deep),A.multiplyScalar(this.deep),v.multiplyScalar(this.deep),g.add(o),A.add(o),v.add(o),(n=i.planes)[0].setFromCoplanarPoints(o,l,c),n[1].setFromCoplanarPoints(o,c,h),n[2].setFromCoplanarPoints(h,u,o),n[3].setFromCoplanarPoints(u,l,o),n[4].setFromCoplanarPoints(c,h,u),n[5].setFromCoplanarPoints(v,A,g),n[5].normal.multiplyScalar(-1);else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),s=Math.max(e.y,t.y),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y);var n;l.set(r,s,-1),c.set(a,s,-1),h.set(a,o,-1),u.set(r,o,-1),d.set(r,s,1),p.set(a,s,1),f.set(a,o,1),m.set(r,o,1),l.unproject(this.camera),c.unproject(this.camera),h.unproject(this.camera),u.unproject(this.camera),d.unproject(this.camera),p.unproject(this.camera),f.unproject(this.camera),m.unproject(this.camera),(n=i.planes)[0].setFromCoplanarPoints(l,d,p),n[1].setFromCoplanarPoints(c,p,f),n[2].setFromCoplanarPoints(f,m,u),n[3].setFromCoplanarPoints(m,d,l),n[4].setFromCoplanarPoints(c,h,u),n[5].setFromCoplanarPoints(f,p,d),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&void 0!==t.material&&(null===t.geometry.boundingSphere&&t.geometry.computeBoundingSphere(),s.copy(t.geometry.boundingSphere.center),s.applyMatrix4(t.matrixWorld),e.containsPoint(s)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}},37037:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.SelectionHelper=class{constructor(e,t,n){this.element=document.createElement("div"),this.element.classList.add(n),this.element.style.pointerEvents="none",this.renderer=t,this.startPoint=new r.Vector2,this.pointTopLeft=new r.Vector2,this.pointBottomRight=new r.Vector2,this.isDown=!1,this.renderer.domElement.addEventListener("pointerdown",(e=>{this.isDown=!0,this.onSelectStart(e)})),this.renderer.domElement.addEventListener("pointermove",(e=>{this.isDown&&this.onSelectMove(e)})),this.renderer.domElement.addEventListener("pointerup",(e=>{this.isDown=!1,this.onSelectOver(e)}))}onSelectStart(e){this.renderer.domElement.parentElement.appendChild(this.element),this.element.style.left=`${e.clientX}px`,this.element.style.top=`${e.clientY}px`,this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=e.clientX,this.startPoint.y=e.clientY}onSelectMove(e){this.pointBottomRight.x=Math.max(this.startPoint.x,e.clientX),this.pointBottomRight.y=Math.max(this.startPoint.y,e.clientY),this.pointTopLeft.x=Math.min(this.startPoint.x,e.clientX),this.pointTopLeft.y=Math.min(this.startPoint.y,e.clientY),this.element.style.left=`${this.pointTopLeft.x}px`,this.element.style.top=`${this.pointTopLeft.y}px`,this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}onSelectOver(){this.element.parentElement.removeChild(this.element)}}},15527:(e,t)=>{"use strict";let n;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.MeshoptDecoder=()=>{if(n)return n;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let r,i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(e)&&(i="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const s=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(i),{}).then((e=>{r=e.instance,r.exports.__wasm_call_ctors()}));function a(e,t,n,i,s,a){const o=r.exports.sbrk,l=n+3&-4,c=o(l*i),h=o(s.length),u=new Uint8Array(r.exports.memory.buffer);u.set(s,h);const d=e(c,n,i,h,s.length);if(0===d&&a&&a(c,l,i),t.set(u.subarray(c,c+n*i)),o(c-o(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}const o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return n={ready:s,supported:!0,decodeVertexBuffer(e,t,n,i,s){a(r.exports.meshopt_decodeVertexBuffer,e,t,n,i,r.exports[o[s]])},decodeIndexBuffer(e,t,n,i){a(r.exports.meshopt_decodeIndexBuffer,e,t,n,i)},decodeIndexSequence(e,t,n,i){a(r.exports.meshopt_decodeIndexSequence,e,t,n,i)},decodeGltfBuffer(e,t,n,i,s,c){a(r.exports[l[s]],e,t,n,i,r.exports[o[c]])}},n}},48490:(e,t)=>{"use strict";var n=Object.defineProperty,r=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i={Handedness:{NONE:"none",LEFT:"left",RIGHT:"right"},ComponentState:{DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"},ComponentProperty:{BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"},ComponentType:{TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"},ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:{TRANSFORM:"transform",VISIBILITY:"visibility"}};async function s(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function a(e){if(!e)throw new Error("No basePath supplied");return await s(`${e}/profilesList.json`)}const o={xAxis:0,yAxis:0,button:0,state:i.ComponentState.DEFAULT};class l{constructor(e){r(this,"value"),r(this,"componentProperty"),r(this,"states"),r(this,"valueNodeName"),r(this,"valueNodeProperty"),r(this,"minNodeName"),r(this,"maxNodeName"),r(this,"valueNode"),r(this,"minNode"),r(this,"maxNode"),this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===i.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(o)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:r}){const{normalizedXAxis:s,normalizedYAxis:a}=function(e=0,t=0){let n=e,r=t;if(Math.sqrt(e*e+t*t)>1){const i=Math.atan2(t,e);n=Math.cos(i),r=Math.sin(i)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*r+.5}}(e,t);switch(this.componentProperty){case i.ComponentProperty.X_AXIS:this.value=this.states.includes(r)?s:.5;break;case i.ComponentProperty.Y_AXIS:this.value=this.states.includes(r)?a:.5;break;case i.ComponentProperty.BUTTON:this.value=this.states.includes(r)&&n?n:0;break;case i.ComponentProperty.STATE:this.valueNodeProperty===i.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(r):this.value=this.states.includes(r)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class c{constructor(e,t){if(r(this,"id"),r(this,"values"),r(this,"type"),r(this,"gamepadIndices"),r(this,"rootNodeName"),r(this,"visualResponses"),r(this,"touchPointNodeName"),r(this,"touchPointNode"),!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new l(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:i.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=i.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=i.ComponentState.PRESSED:(t.touched||this.values.button>i.ButtonTouchThreshold)&&(this.values.state=i.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}t.MotionController=class{constructor(e,t,n){if(r(this,"xrInputSource"),r(this,"assetUrl"),r(this,"layoutDescription"),r(this,"id"),r(this,"components"),!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");if(!t.layouts[e.handedness])throw new Error("No layout for "+e.handedness+" handedness");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new c(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}},t.MotionControllerConstants=i,t.fetchProfile=async function(e,t,n=null,r=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const i=await a(t);let o;if(e.profiles.some((e=>{const n=i[e];return n&&(o={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!o})),!o){if(!n)throw new Error("No matching profile name found");const e=i[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);o={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const l=await s(o.profilePath);let c;if(r){let t;if(t="any"===e.handedness?l.layouts[Object.keys(l.layouts)[0]]:l.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${o.profileId}`);t.assetPath&&(c=o.profilePath.replace("profile.json",t.assetPath))}return{profile:l,assetPath:c}},t.fetchProfilesList=a},94479:(e,t,n)=>{"use strict";e=n.nmd(e),Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const{CstParser:r,Lexer:i,createToken:s}=(()=>{const r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var i="object"==typeof self&&self&&self.Object===Object&&self;const s=r||i||Function("return this")();const a=s.Symbol;var o=Object.prototype,l=o.hasOwnProperty,c=o.toString,h=a?a.toStringTag:void 0;var u=Object.prototype.toString;var d="[object Null]",p="[object Undefined]",f=a?a.toStringTag:void 0;function m(e){return null==e?void 0===e?p:d:f&&f in Object(e)?function(e){var t=l.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch(s){}var i=c.call(e);return r&&(t?e[h]=n:delete e[h]),i}(e):function(e){return u.call(e)}(e)}function g(e){return null!=e&&"object"==typeof e}var A="[object Symbol]";function v(e){return"symbol"==typeof e||g(e)&&m(e)==A}function y(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}const x=Array.isArray;var b=1/0,E=a?a.prototype:void 0,_=E?E.toString:void 0;function S(e){if("string"==typeof e)return e;if(x(e))return y(e,S)+"";if(v(e))return _?_.call(e):"";var t=e+"";return"0"==t&&1/e==-b?"-0":t}var w=/\s/;var M=/^\s+/;function C(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t}(e)+1).replace(M,""):e}function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var I=NaN,B=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,P=/^0o[0-7]+$/i,D=parseInt;var L=1/0,F=17976931348623157e292;function U(e){return e?(e=function(e){if("number"==typeof e)return e;if(v(e))return I;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=C(e);var n=R.test(e);return n||P.test(e)?D(e.slice(2),n?2:8):B.test(e)?I:+e}(e))===L||e===-L?(e<0?-1:1)*F:e==e?e:0:0===e?e:0}function O(e){var t=U(e),n=t%1;return t==t?n?t-n:t:0}function N(e){return e}var k="[object AsyncFunction]",G="[object Function]",z="[object GeneratorFunction]",Q="[object Proxy]";function V(e){if(!T(e))return!1;var t=m(e);return t==G||t==z||t==k||t==Q}const H=s["__core-js_shared__"];var j,W=(j=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"";var X=Function.prototype.toString;function Y(e){if(null!=e){try{return X.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var q=/^\[object .+?Constructor\]$/,K=Function.prototype,J=Object.prototype,Z=K.toString,$=J.hasOwnProperty,ee=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function te(e){return!(!T(e)||(t=e,W&&W in t))&&(V(e)?ee:q).test(Y(e));var t}function ne(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return te(n)?n:void 0}const re=ne(s,"WeakMap");var ie=Object.create;const se=function(){function e(){}return function(t){if(!T(t))return{};if(ie)return ie(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ae(){}var oe=Date.now;var le=function(){try{var e=ne(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();const ce=le;var he=ce?function(e,t){return ce(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:N;var ue,de,pe;const fe=(ue=he,de=0,pe=0,function(){var e=oe(),t=16-(e-pe);if(pe=e,t>0){if(++de>=800)return arguments[0]}else de=0;return ue.apply(void 0,arguments)});function me(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ge(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function Ae(e){return e!=e}function ve(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):ge(e,Ae,n)}function ye(e,t){return!!(null==e?0:e.length)&&ve(e,t,0)>-1}var xe=9007199254740991,be=/^(?:0|[1-9]\d*)$/;function Ee(e,t){var n=typeof e;return!!(t=null==t?xe:t)&&("number"==n||"symbol"!=n&&be.test(e))&&e>-1&&e%1==0&&e<t}function _e(e,t,n){"__proto__"==t&&ce?ce(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Se(e,t){return e===t||e!=e&&t!=t}var we=Object.prototype.hasOwnProperty;function Me(e,t,n){var r=e[t];we.call(e,t)&&Se(r,n)&&(void 0!==n||t in e)||_e(e,t,n)}function Ce(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;void 0===l&&(l=e[o]),i?_e(n,o,l):Me(n,o,l)}return n}var Te=Math.max;function Ie(e,t){return fe(function(e,t,n){return t=Te(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Te(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,o)}}(e,t,N),e+"")}var Be=9007199254740991;function Re(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Be}function Pe(e){return null!=e&&Re(e.length)&&!V(e)}function De(e,t,n){if(!T(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&Ee(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}var Le=Object.prototype;function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Ue(e){return g(e)&&"[object Arguments]"==m(e)}var Oe=Object.prototype,Ne=Oe.hasOwnProperty,ke=Oe.propertyIsEnumerable;const Ge=Ue(function(){return arguments}())?Ue:function(e){return g(e)&&Ne.call(e,"callee")&&!ke.call(e,"callee")};var ze=t&&!t.nodeType&&t,Qe=ze&&e&&!e.nodeType&&e,Ve=Qe&&Qe.exports===ze?s.Buffer:void 0;const He=(Ve?Ve.isBuffer:void 0)||function(){return!1};var je={};function We(e){return function(t){return e(t)}}je["[object Float32Array]"]=je["[object Float64Array]"]=je["[object Int8Array]"]=je["[object Int16Array]"]=je["[object Int32Array]"]=je["[object Uint8Array]"]=je["[object Uint8ClampedArray]"]=je["[object Uint16Array]"]=je["[object Uint32Array]"]=!0,je["[object Arguments]"]=je["[object Array]"]=je["[object ArrayBuffer]"]=je["[object Boolean]"]=je["[object DataView]"]=je["[object Date]"]=je["[object Error]"]=je["[object Function]"]=je["[object Map]"]=je["[object Number]"]=je["[object Object]"]=je["[object RegExp]"]=je["[object Set]"]=je["[object String]"]=je["[object WeakMap]"]=!1;var Xe=t&&!t.nodeType&&t,Ye=Xe&&e&&!e.nodeType&&e,qe=Ye&&Ye.exports===Xe&&r.process;const Ke=function(){try{var e=Ye&&Ye.require&&Ye.require("util").types;return e||qe&&qe.binding&&qe.binding("util")}catch(t){}}();var Je=Ke&&Ke.isTypedArray;const Ze=Je?We(Je):function(e){return g(e)&&Re(e.length)&&!!je[m(e)]};var $e=Object.prototype.hasOwnProperty;function et(e,t){var n=x(e),r=!n&&Ge(e),i=!n&&!r&&He(e),s=!n&&!r&&!i&&Ze(e),a=n||r||i||s,o=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=o.length;for(var c in e)!t&&!$e.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ee(c,l))||o.push(c);return o}function tt(e,t){return function(n){return e(t(n))}}const nt=tt(Object.keys,Object);var rt=Object.prototype.hasOwnProperty;function it(e){if(!Fe(e))return nt(e);var t=[];for(var n in Object(e))rt.call(e,n)&&"constructor"!=n&&t.push(n);return t}function st(e){return Pe(e)?et(e):it(e)}var at,ot=Object.prototype.hasOwnProperty;const lt=(at=function(e,t){if(Fe(t)||Pe(t))Ce(t,st(t),e);else for(var n in t)ot.call(t,n)&&Me(e,n,t[n])},Ie((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(i=at.length>3&&"function"==typeof i?(r--,i):void 0,s&&De(t[0],t[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&at(e,a,n,i)}return e})));var ct=Object.prototype.hasOwnProperty;function ht(e){if(!T(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Fe(e),n=[];for(var r in e)("constructor"!=r||!t&&ct.call(e,r))&&n.push(r);return n}function ut(e){return Pe(e)?et(e,!0):ht(e)}var dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pt=/^\w*$/;function ft(e,t){if(x(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!v(e))||(pt.test(e)||!dt.test(e)||null!=t&&e in Object(t))}const mt=ne(Object,"create");var gt=Object.prototype.hasOwnProperty;var At=Object.prototype.hasOwnProperty;function vt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function yt(e,t){for(var n=e.length;n--;)if(Se(e[n][0],t))return n;return-1}vt.prototype.clear=function(){this.__data__=mt?mt(null):{},this.size=0},vt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},vt.prototype.get=function(e){var t=this.__data__;if(mt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return gt.call(t,e)?t[e]:void 0},vt.prototype.has=function(e){var t=this.__data__;return mt?void 0!==t[e]:At.call(t,e)},vt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=mt&&void 0===t?"__lodash_hash_undefined__":t,this};var xt=Array.prototype.splice;function bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bt.prototype.clear=function(){this.__data__=[],this.size=0},bt.prototype.delete=function(e){var t=this.__data__,n=yt(t,e);return!(n<0)&&(n==t.length-1?t.pop():xt.call(t,n,1),--this.size,!0)},bt.prototype.get=function(e){var t=this.__data__,n=yt(t,e);return n<0?void 0:t[n][1]},bt.prototype.has=function(e){return yt(this.__data__,e)>-1},bt.prototype.set=function(e,t){var n=this.__data__,r=yt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const Et=ne(s,"Map");function _t(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function St(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}St.prototype.clear=function(){this.size=0,this.__data__={hash:new vt,map:new(Et||bt),string:new vt}},St.prototype.delete=function(e){var t=_t(this,e).delete(e);return this.size-=t?1:0,t},St.prototype.get=function(e){return _t(this,e).get(e)},St.prototype.has=function(e){return _t(this,e).has(e)},St.prototype.set=function(e,t){var n=_t(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var wt="Expected a function";function Mt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(wt);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Mt.Cache||St),n}Mt.Cache=St;var Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tt=/\\(\\)?/g,It=function(e){var t=Mt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ct,(function(e,n,r,i){t.push(r?i.replace(Tt,"$1"):n||e)})),t}));const Bt=It;function Rt(e,t){return x(e)?e:ft(e,t)?[e]:Bt(function(e){return null==e?"":S(e)}(e))}var Pt=1/0;function Dt(e){if("string"==typeof e||v(e))return e;var t=e+"";return"0"==t&&1/e==-Pt?"-0":t}function Lt(e,t){for(var n=0,r=(t=Rt(t,e)).length;null!=e&&n<r;)e=e[Dt(t[n++])];return n&&n==r?e:void 0}function Ft(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Ut=a?a.isConcatSpreadable:void 0;function Ot(e){return x(e)||Ge(e)||!!(Ut&&e&&e[Ut])}function Nt(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Ot),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Nt(o,t-1,n,r,i):Ft(i,o):r||(i[i.length]=o)}return i}function kt(e){return(null==e?0:e.length)?Nt(e,1):[]}const Gt=tt(Object.getPrototypeOf,Object);function zt(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function Qt(e,t,n,r){var i=-1,s=null==e?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function Vt(e){var t=this.__data__=new bt(e);this.size=t.size}Vt.prototype.clear=function(){this.__data__=new bt,this.size=0},Vt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vt.prototype.get=function(e){return this.__data__.get(e)},Vt.prototype.has=function(e){return this.__data__.has(e)},Vt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof bt){var r=n.__data__;if(!Et||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new St(r)}return n.set(e,t),this.size=n.size,this};var Ht=t&&!t.nodeType&&t,jt=Ht&&e&&!e.nodeType&&e,Wt=jt&&jt.exports===Ht?s.Buffer:void 0,Xt=Wt?Wt.allocUnsafe:void 0;function Yt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function qt(){return[]}var Kt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols;const Zt=Jt?function(e){return null==e?[]:(e=Object(e),Yt(Jt(e),(function(t){return Kt.call(e,t)})))}:qt;const $t=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ft(t,Zt(e)),e=Gt(e);return t}:qt;function en(e,t,n){var r=t(e);return x(e)?r:Ft(r,n(e))}function tn(e){return en(e,st,Zt)}function nn(e){return en(e,ut,$t)}const rn=ne(s,"DataView");const sn=ne(s,"Promise");const an=ne(s,"Set");var on="[object Map]",ln="[object Promise]",cn="[object Set]",hn="[object WeakMap]",un="[object DataView]",dn=Y(rn),pn=Y(Et),fn=Y(sn),mn=Y(an),gn=Y(re),An=m;(rn&&An(new rn(new ArrayBuffer(1)))!=un||Et&&An(new Et)!=on||sn&&An(sn.resolve())!=ln||an&&An(new an)!=cn||re&&An(new re)!=hn)&&(An=function(e){var t=m(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case dn:return un;case pn:return on;case fn:return ln;case mn:return cn;case gn:return hn}return t});const vn=An;var yn=Object.prototype.hasOwnProperty;const xn=s.Uint8Array;function bn(e){var t=new e.constructor(e.byteLength);return new xn(t).set(new xn(e)),t}var En=/\w*$/;var _n=a?a.prototype:void 0,Sn=_n?_n.valueOf:void 0;var wn="[object Boolean]",Mn="[object Date]",Cn="[object Map]",Tn="[object Number]",In="[object RegExp]",Bn="[object Set]",Rn="[object String]",Pn="[object Symbol]",Dn="[object ArrayBuffer]",Ln="[object DataView]",Fn="[object Float32Array]",Un="[object Float64Array]",On="[object Int8Array]",Nn="[object Int16Array]",kn="[object Int32Array]",Gn="[object Uint8Array]",zn="[object Uint8ClampedArray]",Qn="[object Uint16Array]",Vn="[object Uint32Array]";function Hn(e,t,n){var r,i,s,a=e.constructor;switch(t){case Dn:return bn(e);case wn:case Mn:return new a(+e);case Ln:return function(e,t){var n=t?bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case Fn:case Un:case On:case Nn:case kn:case Gn:case zn:case Qn:case Vn:return function(e,t){var n=t?bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case Cn:return new a;case Tn:case Rn:return new a(e);case In:return(s=new(i=e).constructor(i.source,En.exec(i))).lastIndex=i.lastIndex,s;case Bn:return new a;case Pn:return r=e,Sn?Object(Sn.call(r)):{}}}var jn=Ke&&Ke.isMap;const Wn=jn?We(jn):function(e){return g(e)&&"[object Map]"==vn(e)};var Xn=Ke&&Ke.isSet;const Yn=Xn?We(Xn):function(e){return g(e)&&"[object Set]"==vn(e)};var qn=1,Kn=2,Jn=4,Zn="[object Arguments]",$n="[object Function]",er="[object GeneratorFunction]",tr="[object Object]",nr={};function rr(e,t,n,r,i,s){var a,o=t&qn,l=t&Kn,c=t&Jn;if(n&&(a=i?n(e,r,i,s):n(e)),void 0!==a)return a;if(!T(e))return e;var h=x(e);if(h){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&yn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!o)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,a)}else{var u=vn(e),d=u==$n||u==er;if(He(e))return function(e,t){if(t)return e.slice();var n=e.length,r=Xt?Xt(n):new e.constructor(n);return e.copy(r),r}(e,o);if(u==tr||u==Zn||d&&!i){if(a=l||d?{}:function(e){return"function"!=typeof e.constructor||Fe(e)?{}:se(Gt(e))}(e),!o)return l?function(e,t){return Ce(e,$t(e),t)}(e,function(e,t){return e&&Ce(t,ut(t),e)}(a,e)):function(e,t){return Ce(e,Zt(e),t)}(e,function(e,t){return e&&Ce(t,st(t),e)}(a,e))}else{if(!nr[u])return i?e:{};a=Hn(e,u,o)}}s||(s=new Vt);var p=s.get(e);if(p)return p;s.set(e,a),Yn(e)?e.forEach((function(r){a.add(rr(r,t,n,r,e,s))})):Wn(e)&&e.forEach((function(r,i){a.set(i,rr(r,t,n,i,e,s))}));var f=h?void 0:(c?l?nn:tn:l?ut:st)(e);return me(f||e,(function(r,i){f&&(r=e[i=r]),Me(a,i,rr(r,t,n,i,e,s))})),a}nr[Zn]=nr["[object Array]"]=nr["[object ArrayBuffer]"]=nr["[object DataView]"]=nr["[object Boolean]"]=nr["[object Date]"]=nr["[object Float32Array]"]=nr["[object Float64Array]"]=nr["[object Int8Array]"]=nr["[object Int16Array]"]=nr["[object Int32Array]"]=nr["[object Map]"]=nr["[object Number]"]=nr[tr]=nr["[object RegExp]"]=nr["[object Set]"]=nr["[object String]"]=nr["[object Symbol]"]=nr["[object Uint8Array]"]=nr["[object Uint8ClampedArray]"]=nr["[object Uint16Array]"]=nr["[object Uint32Array]"]=!0,nr["[object Error]"]=nr[$n]=nr["[object WeakMap]"]=!1;var ir=4;function sr(e){return rr(e,ir)}function ar(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var s=e[t];s&&(i[r++]=s)}return i}function or(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new St;++t<n;)this.add(e[t])}function lr(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cr(e,t){return e.has(t)}or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or.prototype.has=function(e){return this.__data__.has(e)};var hr=1,ur=2;function dr(e,t,n,r,i,s){var a=n&hr,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var u=-1,d=!0,p=n&ur?new or:void 0;for(s.set(e,t),s.set(t,e);++u<o;){var f=e[u],m=t[u];if(r)var g=a?r(m,f,u,t,e,s):r(f,m,u,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!lr(t,(function(e,t){if(!cr(p,t)&&(f===e||i(f,e,n,r,s)))return p.push(t)}))){d=!1;break}}else if(f!==m&&!i(f,m,n,r,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function pr(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function fr(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var mr=1,gr=2,Ar="[object Boolean]",vr="[object Date]",yr="[object Error]",xr="[object Map]",br="[object Number]",Er="[object RegExp]",_r="[object Set]",Sr="[object String]",wr="[object Symbol]",Mr="[object ArrayBuffer]",Cr="[object DataView]",Tr=a?a.prototype:void 0,Ir=Tr?Tr.valueOf:void 0;var Br=1,Rr=Object.prototype.hasOwnProperty;var Pr=1,Dr="[object Arguments]",Lr="[object Array]",Fr="[object Object]",Ur=Object.prototype.hasOwnProperty;function Or(e,t,n,r,i,s){var a=x(e),o=x(t),l=a?Lr:vn(e),c=o?Lr:vn(t),h=(l=l==Dr?Fr:l)==Fr,u=(c=c==Dr?Fr:c)==Fr,d=l==c;if(d&&He(e)){if(!He(t))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new Vt),a||Ze(e)?dr(e,t,n,r,i,s):function(e,t,n,r,i,s,a){switch(n){case Cr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Mr:return!(e.byteLength!=t.byteLength||!s(new xn(e),new xn(t)));case Ar:case vr:case br:return Se(+e,+t);case yr:return e.name==t.name&&e.message==t.message;case Er:case Sr:return e==t+"";case xr:var o=pr;case _r:var l=r&mr;if(o||(o=fr),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=gr,a.set(e,t);var h=dr(o(e),o(t),r,i,s,a);return a.delete(e),h;case wr:if(Ir)return Ir.call(e)==Ir.call(t)}return!1}(e,t,l,n,r,i,s);if(!(n&Pr)){var p=h&&Ur.call(e,"__wrapped__"),f=u&&Ur.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return s||(s=new Vt),i(m,g,n,r,s)}}return!!d&&(s||(s=new Vt),function(e,t,n,r,i,s){var a=n&Br,o=tn(e),l=o.length;if(l!=tn(t).length&&!a)return!1;for(var c=l;c--;){var h=o[c];if(!(a?h in t:Rr.call(t,h)))return!1}var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var f=a;++c<l;){var m=e[h=o[c]],g=t[h];if(r)var A=a?r(g,m,h,t,e,s):r(m,g,h,e,t,s);if(!(void 0===A?m===g||i(m,g,n,r,s):A)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,r,i,s))}function Nr(e,t,n,r,i){return e===t||(null==e||null==t||!g(e)&&!g(t)?e!=e&&t!=t:Or(e,t,n,r,Nr,i))}var kr=1,Gr=2;function zr(e){return e==e&&!T(e)}function Qr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Vr(e){var t=function(e){for(var t=st(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,zr(i)]}return t}(e);return 1==t.length&&t[0][2]?Qr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var i=n.length,s=i,a=!r;if(null==e)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){var l=(o=n[i])[0],c=e[l],h=o[1];if(a&&o[2]){if(void 0===c&&!(l in e))return!1}else{var u=new Vt;if(r)var d=r(c,h,l,e,t,u);if(!(void 0===d?Nr(h,c,kr|Gr,r,u):d))return!1}}return!0}(n,e,t)}}function Hr(e,t){return null!=e&&t in Object(e)}function jr(e,t,n){for(var r=-1,i=(t=Rt(t,e)).length,s=!1;++r<i;){var a=Dt(t[r]);if(!(s=null!=e&&n(e,a)))break;e=e[a]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&Re(i)&&Ee(a,i)&&(x(e)||Ge(e))}var Wr,Xr=1,Yr=2;function qr(e,t){return ft(e)&&zr(t)?Qr(Dt(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:Lt(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&jr(e,t,Hr)}(n,e):Nr(t,r,Xr|Yr)}}function Kr(e){return ft(e)?(t=Dt(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Lt(t,e)}}(e);var t}function Jr(e){return"function"==typeof e?e:null==e?N:"object"==typeof e?x(e)?qr(e[0],e[1]):Vr(e):Kr(e)}function Zr(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}const $r=function(e,t,n){for(var r=-1,i=Object(e),s=n(e),a=s.length;a--;){var o=s[Wr?a:++r];if(!1===t(i[o],o,i))break}return e};var ei=function(e,t){return function(n,r){if(null==n)return n;if(!Pe(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&!1!==r(a[s],s,a););return n}}((function(e,t){return e&&$r(e,t,st)}));const ti=ei;function ni(e,t,n,r){return ti(e,(function(e,i,s){t(r,e,n(e),s)})),r}var ri=Object.prototype,ii=ri.hasOwnProperty;const si=Ie((function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&De(t[0],t[1],i)&&(r=1);++n<r;)for(var s=t[n],a=ut(s),o=-1,l=a.length;++o<l;){var c=a[o],h=e[c];(void 0===h||Se(h,ri[c])&&!ii.call(e,c))&&(e[c]=s[c])}return e}));function ai(e){return g(e)&&Pe(e)}function oi(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}const li=Ie((function(e,t){return ai(e)?function(e,t,n,r){var i=-1,s=ye,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=y(t,We(n))),r?(s=oi,a=!1):t.length>=200&&(s=cr,a=!1,t=new or(t));e:for(;++i<o;){var h=e[i],u=null==n?h:n(h);if(h=r||0!==h?h:0,a&&u==u){for(var d=c;d--;)if(t[d]===u)continue e;l.push(h)}else s(t,u,r)||l.push(h)}return l}(e,Nt(t,1,ai,!0)):[]}));function ci(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function hi(e,t,n){var r=null==e?0:e.length;return r?zt(e,(t=n||void 0===t?1:O(t))<0?0:t,r):[]}function ui(e,t,n){var r=null==e?0:e.length;return r?zt(e,0,(t=r-(t=n||void 0===t?1:O(t)))<0?0:t):[]}function di(e,t){var n;return(x(e)?me:ti)(e,"function"==typeof(n=t)?n:N)}function pi(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function fi(e,t){var n=!0;return ti(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mi(e,t,n){var r=x(e)?pi:fi;return n&&De(e,t,n)&&(t=void 0),r(e,Jr(t))}function gi(e,t){var n=[];return ti(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Ai(e,t){return(x(e)?Yt:gi)(e,Jr(t))}var vi,yi=Math.max;const xi=(vi=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:O(n);return i<0&&(i=yi(r+i,0)),ge(e,Jr(t),i)},function(e,t,n){var r=Object(e);if(!Pe(e)){var i=Jr(t);e=st(e),t=function(e){return i(r[e],e,r)}}var s=vi(e,t,n);return s>-1?r[i?e[s]:s]:void 0});function bi(e){return e&&e.length?e[0]:void 0}function Ei(e,t){var n=-1,r=Pe(e)?Array(e.length):[];return ti(e,(function(e,i,s){r[++n]=t(e,i,s)})),r}function _i(e,t){return(x(e)?y:Ei)(e,Jr(t))}function Si(e,t){return Nt(_i(e,t),1)}var wi,Mi,Ci=Object.prototype.hasOwnProperty,Ti=(wi=function(e,t,n){Ci.call(e,n)?e[n].push(t):_e(e,n,[t])},function(e,t){var n=x(e)?Zr:ni,r=Mi?Mi():{};return n(e,wi,Jr(t),r)});const Ii=Ti;var Bi=Object.prototype.hasOwnProperty;function Ri(e,t){return null!=e&&Bi.call(e,t)}function Pi(e,t){return null!=e&&jr(e,t,Ri)}var Di="[object String]";function Li(e){return"string"==typeof e||!x(e)&&g(e)&&m(e)==Di}function Fi(e){return null==e?[]:function(e,t){return y(t,(function(t){return e[t]}))}(e,st(e))}var Ui=Math.max;function Oi(e,t,n,r){e=Pe(e)?e:Fi(e),n=n&&!r?O(n):0;var i=e.length;return n<0&&(n=Ui(i+n,0)),Li(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&ve(e,t,n)>-1}var Ni=Math.max;function ki(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:O(n);return i<0&&(i=Ni(r+i,0)),ve(e,t,i)}var Gi="[object Map]",zi="[object Set]",Qi=Object.prototype.hasOwnProperty;function Vi(e){if(null==e)return!0;if(Pe(e)&&(x(e)||"string"==typeof e||"function"==typeof e.splice||He(e)||Ze(e)||Ge(e)))return!e.length;var t=vn(e);if(t==Gi||t==zi)return!e.size;if(Fe(e))return!it(e).length;for(var n in e)if(Qi.call(e,n))return!1;return!0}var Hi=Ke&&Ke.isRegExp;const ji=Hi?We(Hi):function(e){return g(e)&&"[object RegExp]"==m(e)};function Wi(e){return void 0===e}var Xi="Expected a function";function Yi(e,t,n,r){if(!T(e))return e;for(var i=-1,s=(t=Rt(t,e)).length,a=s-1,o=e;null!=o&&++i<s;){var l=Dt(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=a){var h=o[l];void 0===(c=r?r(h,l,o):void 0)&&(c=T(h)?h:Ee(t[i+1])?[]:{})}Me(o,l,c),o=o[l]}return e}function qi(e,t){if(null==e)return{};var n=y(nn(e),(function(e){return[e]}));return t=Jr(t),function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=Lt(e,a);n(o,a)&&Yi(s,Rt(a,e),o)}return s}(e,n,(function(e,n){return t(e,n[0])}))}function Ki(e,t,n,r,i){return i(e,(function(e,i,s){n=r?(r=!1,e):t(n,e,i,s)})),n}function Ji(e,t,n){var r=x(e)?Qt:Ki,i=arguments.length<3;return r(e,Jr(t),n,i,ti)}function Zi(e,t){return(x(e)?Yt:gi)(e,function(e){if("function"!=typeof e)throw new TypeError(Xi);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Jr(t)))}function $i(e,t){var n;return ti(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function es(e,t,n){var r=x(e)?lr:$i;return n&&De(e,t,n)&&(t=void 0),r(e,Jr(t))}const ts=an&&1/fr(new an([,-0]))[1]==1/0?function(e){return new an(e)}:ae;var ns=200;function rs(e){return e&&e.length?function(e,t,n){var r=-1,i=ye,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=oi;else if(s>=ns){var c=t?null:ts(e);if(c)return fr(c);a=!1,i=cr,l=new or}else l=t?[]:o;e:for(;++r<s;){var h=e[r],u=t?t(h):h;if(h=n||0!==h?h:0,a&&u==u){for(var d=l.length;d--;)if(l[d]===u)continue e;t&&l.push(u),o.push(h)}else i(l,u,n)||(l!==o&&l.push(u),o.push(h))}return o}(e):[]}function is(e){console&&console.error&&console.error(`Error: ${e}`)}function ss(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function as(e){const t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}function os(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}function ls(e){return Li((t=e).LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}class cs{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),di(this.definition,(t=>{t.accept(e)}))}}class hs extends cs{constructor(e){super([]),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class us extends cs{constructor(e){super(e.definition),this.orgText="",lt(this,qi(e,(e=>void 0!==e)))}}class ds extends cs{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,lt(this,qi(e,(e=>void 0!==e)))}}class ps extends cs{constructor(e){super(e.definition),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}}class fs extends cs{constructor(e){super(e.definition),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}}class ms extends cs{constructor(e){super(e.definition),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}}class gs extends cs{constructor(e){super(e.definition),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}}class As extends cs{constructor(e){super(e.definition),this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}}class vs extends cs{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,lt(this,qi(e,(e=>void 0!==e)))}}class ys{constructor(e){this.idx=1,lt(this,qi(e,(e=>void 0!==e)))}accept(e){e.visit(this)}}function xs(e){function t(e){return _i(e,xs)}if(e instanceof hs){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Li(e.label)&&(t.label=e.label),t}if(e instanceof ds)return{type:"Alternative",definition:t(e.definition)};if(e instanceof ps)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof fs)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ms)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:xs(new ys({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof As)return{type:"RepetitionWithSeparator",idx:e.idx,separator:xs(new ys({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof gs)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof vs)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ys){const t={type:"Terminal",name:e.terminalType.name,label:ls(e.terminalType),idx:e.idx};Li(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ji(n)?n.source:n),t}if(e instanceof us)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class bs{visit(e){const t=e;switch(t.constructor){case hs:return this.visitNonTerminal(t);case ds:return this.visitAlternative(t);case ps:return this.visitOption(t);case fs:return this.visitRepetitionMandatory(t);case ms:return this.visitRepetitionMandatoryWithSeparator(t);case As:return this.visitRepetitionWithSeparator(t);case gs:return this.visitRepetition(t);case vs:return this.visitAlternation(t);case ys:return this.visitTerminal(t);case us:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Es(e,t=[]){return!!(e instanceof ps||e instanceof gs||e instanceof As)||(e instanceof vs?es(e.definition,(e=>Es(e,t))):!(e instanceof hs&&Oi(t,e))&&(e instanceof cs&&(e instanceof hs&&t.push(e),mi(e.definition,(e=>Es(e,t))))))}function _s(e){if(e instanceof hs)return"SUBRULE";if(e instanceof ps)return"OPTION";if(e instanceof vs)return"OR";if(e instanceof fs)return"AT_LEAST_ONE";if(e instanceof ms)return"AT_LEAST_ONE_SEP";if(e instanceof As)return"MANY_SEP";if(e instanceof gs)return"MANY";if(e instanceof ys)return"CONSUME";throw Error("non exhaustive match")}class Ss{walk(e,t=[]){di(e.definition,((n,r)=>{const i=hi(e.definition,r+1);if(n instanceof hs)this.walkProdRef(n,i,t);else if(n instanceof ys)this.walkTerminal(n,i,t);else if(n instanceof ds)this.walkFlat(n,i,t);else if(n instanceof ps)this.walkOption(n,i,t);else if(n instanceof fs)this.walkAtLeastOne(n,i,t);else if(n instanceof ms)this.walkAtLeastOneSep(n,i,t);else if(n instanceof As)this.walkManySep(n,i,t);else if(n instanceof gs)this.walkMany(n,i,t);else{if(!(n instanceof vs))throw Error("non exhaustive match");this.walkOr(n,i,t)}}))}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new ps({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=ws(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new ps({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=ws(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);di(e.definition,(e=>{const t=new ds({definition:[e]});this.walk(t,r)}))}}function ws(e,t,n){return[new ps({definition:[new ys({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Ms(e){if(e instanceof hs)return Ms(e.referencedRule);if(e instanceof ys)return[e.terminalType];if(function(e){return e instanceof ds||e instanceof ps||e instanceof gs||e instanceof fs||e instanceof ms||e instanceof As||e instanceof ys||e instanceof us}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,a=!0;for(;s&&a;)r=n[i],a=Es(r),t=t.concat(Ms(r)),i+=1,s=n.length>i;return rs(t)}(e);if(function(e){return e instanceof vs}(e))return function(e){const t=_i(e.definition,(e=>Ms(e)));return rs(kt(t))}(e);throw Error("non exhaustive match")}const Cs="_~IN~_";class Ts extends Ss{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Cs+this.topProd.name);var i,s;const a=t.concat(n),o=Ms(new ds({definition:a}));this.follows[r]=o}}function Is(e){return e.charCodeAt(0)}function Bs(e,t){Array.isArray(e)?e.forEach((function(e){t.push(e)})):t.push(e)}function Rs(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ps(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function Ds(e){return"Character"===e.type}const Ls=[];for(let e=Is("0");e<=Is("9");e++)Ls.push(e);const Fs=[Is("_")].concat(Ls);for(let e=Is("a");e<=Is("z");e++)Fs.push(e);for(let e=Is("A");e<=Is("Z");e++)Fs.push(e);const Us=[Is(" "),Is("\f"),Is("\n"),Is("\r"),Is("\t"),Is("\v"),Is("\t"),Is("\xa0"),Is("\u1680"),Is("\u2000"),Is("\u2001"),Is("\u2002"),Is("\u2003"),Is("\u2004"),Is("\u2005"),Is("\u2006"),Is("\u2007"),Is("\u2008"),Is("\u2009"),Is("\u200a"),Is("\u2028"),Is("\u2029"),Is("\u202f"),Is("\u205f"),Is("\u3000"),Is("\ufeff")],Os=/[0-9a-fA-F]/,Ns=/[0-9]/,ks=/[1-9]/;class Gs{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((e=>{this.visit(e)}),this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}let zs={};const Qs=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Rs(n,"global");break;case"i":Rs(n,"ignoreCase");break;case"m":Rs(n,"multiLine");break;case"u":Rs(n,"unicode");break;case"y":Rs(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}Ps(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return function(){throw Error("Internal Error - Should never get here!")}()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ps(t)}if(!0!==e||void 0!==t)return Ps(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}if(void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ps(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Is("\n"),Is("\r"),Is("\u2028"),Is("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Ls;break;case"D":e=Ls,t=!0;break;case"s":e=Us;break;case"S":e=Us,t=!0;break;case"w":e=Fs;break;case"W":e=Fs,t=!0}if(Ps(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Is("\f");break;case"n":e=Is("\n");break;case"r":e=Is("\r");break;case"t":e=Is("\t");break;case"v":e=Is("\v")}if(Ps(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Is("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:Is(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:Is(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,Ds(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,Ds(n)){if(n.value<t.value)throw Error("Range out of order in character class");e.push({from:t.value,to:n.value})}else Bs(t.value,e),e.push(Is("-")),Bs(n.value,e)}else Bs(t.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Is("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;if(this.consumeChar("("),"?"===this.peekChar(0))this.consumeChar("?"),this.consumeChar(":"),e=!1;else this.groupIdx++;const t=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(!1===ks.test(e))throw Error("Expecting a positive integer");for(;Ns.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(!1===Ns.test(e))throw Error("Expecting an integer");for(;Ns.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Is(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return"-"===this.peekChar()&&this.isClassAtom(1)}isDigit(){return Ns.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}}isQuantifier(){const e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let n=0;n<e;n++){const e=this.popChar();if(!1===Os.test(e))throw Error("Expecting a HexDecimal digits");t+=e}return{type:"Character",value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Vs(e){const t=e.toString();if(zs.hasOwnProperty(t))return zs[t];{const e=Qs.pattern(t);return zs[t]=e,e}}const Hs="Complement Sets are not supported for first char optimization",js='Unable to use "first char" lexer optimizations:\n';function Ws(e,t=!1){try{const t=Vs(e);return Xs(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Hs)t&&ss(`${js}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),is(`${js}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Xs(e,t,n){switch(e.type){case"Disjunction":for(let i=0;i<e.value.length;i++)Xs(e.value[i],t,n);break;case"Alternative":const r=e.value;for(let e=0;e<r.length;e++){const i=r[e];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=i;switch(s.type){case"Character":Ys(s.value,t,n);break;case"Set":if(!0===s.complement)throw Error(Hs);di(s.value,(e=>{if("number"==typeof e)Ys(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)Ys(e,t,n);else{for(let e=r.from;e<=r.to&&e<ga;e++)Ys(e,t,n);if(r.to>=ga){const e=r.from>=ga?r.from:ga,n=r.to,i=va(e),s=va(n);for(let r=i;r<=s;r++)t[r]=r}}}}));break;case"Group":Xs(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const a=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ks(s)||"Group"!==s.type&&!1===a)break}break;default:throw Error("non exhaustive match!")}return Fi(t)}function Ys(e,t,n){const r=va(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=va(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=va(e.charCodeAt(0));t[n]=n}}}(e,t)}function qs(e,t){return xi(e.value,(e=>{if("number"==typeof e)return Oi(t,e);{const n=e;return void 0!==xi(t,(e=>n.from<=e&&e<=n.to))}}))}function Ks(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(x(e.value)?mi(e.value,Ks):Ks(e.value))}class Js extends Gs{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){Oi(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===qs(e,this.targetCharCodes)&&(this.found=!0):void 0!==qs(e,this.targetCharCodes)&&(this.found=!0)}}function Zs(e,t){if(t instanceof RegExp){const n=Vs(t),r=new Js(e);return r.visit(n),r.found}return void 0!==xi(t,(t=>Oi(e,t.charCodeAt(0))))}const $s="PATTERN",ea="defaultMode",ta="modes";let na="boolean"==typeof new RegExp("(?:)").sticky;function ra(e,t){const n=(t=si(t,{useSticky:na,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",(()=>{!function(){if(Vi(Aa)){Aa=new Array(65536);for(let e=0;e<65536;e++)Aa[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(()=>{r=Zi(e,(e=>e[$s]===Pa.NA))}));let i,s,a,o,l,c,h,u,d,p,f,m=!1;n("Transform Patterns",(()=>{m=!1,i=_i(r,(e=>{const n=e[$s];if(ji(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||Oi(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?la(n):oa(n):e[1]:e}if(V(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?la(r):oa(r)}}throw Error("non exhaustive match")}))})),n("misc mapping",(()=>{s=_i(r,(e=>e.tokenTypeIdx)),a=_i(r,(e=>{const t=e.GROUP;if(t!==Pa.SKIPPED){if(Li(t))return t;if(Wi(t))return!1;throw Error("non exhaustive match")}})),o=_i(r,(e=>{const t=e.LONGER_ALT;if(t){return x(t)?_i(t,(e=>ki(r,e))):[ki(r,t)]}})),l=_i(r,(e=>e.PUSH_MODE)),c=_i(r,(e=>Pi(e,"POP_MODE")))})),n("Line Terminator Handling",(()=>{const e=fa(t.lineTerminatorCharacters);h=_i(r,(e=>!1)),"onlyOffset"!==t.positionTracking&&(h=_i(r,(t=>Pi(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===pa(t,e)&&Zs(e,t.PATTERN))))})),n("Misc Mapping #2",(()=>{u=_i(r,ha),d=_i(i,ua),p=Ji(r,((e,t)=>{const n=t.GROUP;return Li(n)&&n!==Pa.SKIPPED&&(e[n]=[]),e}),{}),f=_i(i,((e,t)=>({pattern:i[t],longerAlt:o[t],canLineTerminator:h[t],isCustom:u[t],short:d[t],group:a[t],push:l[t],pop:c[t],tokenTypeIdx:s[t],tokenType:r[t]})))}));let g=!0,A=[];return t.safeMode||n("First Char Optimization",(()=>{A=Ji(r,((e,n,r)=>{if("string"==typeof n.PATTERN){const t=va(n.PATTERN.charCodeAt(0));ma(e,t,f[r])}else if(x(n.START_CHARS_HINT)){let t;di(n.START_CHARS_HINT,(n=>{const i=va("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ma(e,i,f[r]))}))}else if(ji(n.PATTERN))if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&is(`${js}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ws(n.PATTERN,t.ensureOptimizations);Vi(i)&&(g=!1),di(i,(t=>{ma(e,t,f[r])}))}else t.ensureOptimizations&&is(`${js}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e}),[])})),{emptyGroups:p,patternIdxToConfig:f,charCodeToPatternIdxToConfig:A,hasCustom:m,canBeOptimized:g}}function ia(e,t){let n=[];const r=function(e){const t=Ai(e,(e=>!Pi(e,$s))),n=_i(t,(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Ia.MISSING_PATTERN,tokenTypes:[e]}))),r=li(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);const i=function(e){const t=Ai(e,(e=>{const t=e[$s];return!(ji(t)||V(t)||Pi(t,"exec")||Li(t))})),n=_i(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ia.INVALID_PATTERN,tokenTypes:[e]}))),r=li(e,t);return{errors:n,valid:r}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=Ai(e,(e=>ji(e[$s])));return t=t.concat(function(e){class t extends Gs{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=Ai(e,(e=>{const n=e.PATTERN;try{const e=Vs(n),r=new t;return r.visit(e),r.found}catch(r){return sa.test(n.source)}})),r=_i(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ia.EOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){class t extends Gs{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=Ai(e,(e=>{const n=e.PATTERN;try{const e=Vs(n),r=new t;return r.visit(e),r.found}catch(r){return aa.test(n.source)}})),r=_i(n,(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Ia.SOI_ANCHOR_FOUND,tokenTypes:[e]})));return r}(n)),t=t.concat(function(e){const t=Ai(e,(e=>{const t=e[$s];return t instanceof RegExp&&(t.multiline||t.global)})),n=_i(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ia.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]})));return n}(n)),t=t.concat(function(e){const t=[];let n=_i(e,(n=>Ji(e,((e,r)=>(n.PATTERN.source!==r.PATTERN.source||Oi(t,r)||r.PATTERN===Pa.NA||(t.push(r),e.push(r)),e)),[])));n=ar(n);const r=_i(Ai(n,(e=>e.length>1)),(e=>{const t=_i(e,(e=>e.name));return{message:`The same RegExp pattern ->${bi(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Ia.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return r}(n)),t=t.concat(function(e){const t=Ai(e,(e=>e.PATTERN.test(""))),n=_i(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Ia.EMPTY_MATCH_PATTERN,tokenTypes:[e]})));return n}(n)),t}(s)),n=n.concat(function(e){const t=Ai(e,(e=>{if(!Pi(e,"GROUP"))return!1;const t=e.GROUP;return t!==Pa.SKIPPED&&t!==Pa.NA&&!Li(t)})),n=_i(t,(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ia.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]})));return n}(s)),n=n.concat(function(e,t){const n=Ai(e,(e=>void 0!==e.PUSH_MODE&&!Oi(t,e.PUSH_MODE))),r=_i(n,(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Ia.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]})));return r}(s,t)),n=n.concat(function(e){const t=[],n=Ji(e,((e,t,n)=>{const r=t.PATTERN;return r===Pa.NA||(Li(r)?e.push({str:r,idx:n,tokenType:t}):ji(r)&&(i=r,void 0===xi([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==i.source.indexOf(e))))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i}),[]);return di(e,((e,r)=>{di(n,(({str:n,idx:i,tokenType:s})=>{if(r<i&&function(e,t){if(ji(t)){const n=t.exec(e);return null!==n&&0===n.index}if(V(t))return t(e,0,[],{});if(Pi(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(n,e.PATTERN)){const n=`Token: ->${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Ia.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(s)),n}const sa=/[^\\][$]/;const aa=/[^\\[][\^]|^\^/;function oa(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function la(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function ca(e,t,n){const r=[];let i=!1;const s=Zi(ar(kt(Fi(e.modes))),(e=>e[$s]===Pa.NA)),a=fa(n);return t&&di(s,(e=>{const t=pa(e,a);if(!1!==t){const n=function(e,t){if(t.issue===Ia.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Ia.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Pi(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):Zs(a,e.PATTERN)&&(i=!0)})),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Ia.NO_LINE_BREAKS_FLAGS}),r}function ha(e){const t=e.PATTERN;if(ji(t))return!1;if(V(t))return!0;if(Pi(t,"exec"))return!0;if(Li(t))return!1;throw Error("non exhaustive match")}function ua(e){return!(!Li(e)||1!==e.length)&&e.charCodeAt(0)}const da={test:function(e){const t=e.length;for(let n=this.lastIndex;n<t;n++){const t=e.charCodeAt(n);if(10===t)return this.lastIndex=n+1,!0;if(13===t)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function pa(e,t){if(Pi(e,"LINE_BREAKS"))return!1;if(ji(e.PATTERN)){try{Zs(t,e.PATTERN)}catch(n){return{issue:Ia.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}if(Li(e.PATTERN))return!1;if(ha(e))return{issue:Ia.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function fa(e){return _i(e,(e=>Li(e)?e.charCodeAt(0):e))}function ma(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ga=256;let Aa=[];function va(e){return e<ga?e:Aa[e]}function ya(e,t){const n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function xa(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}let ba=1;const Ea={};function _a(e){const t=function(e){let t=sr(e),n=e,r=!0;for(;r;){n=ar(kt(_i(n,(e=>e.CATEGORIES))));const e=li(n,t);t=t.concat(e),Vi(e)?r=!1:n=e}return t}(e);!function(e){di(e,(e=>{wa(e)||(Ea[ba]=e,e.tokenTypeIdx=ba++),Ma(e)&&!x(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Ma(e)||(e.CATEGORIES=[]),Pi(e,"categoryMatches")||(e.categoryMatches=[]),function(e){return Pi(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})}))}(t),function(e){di(e,(e=>{Sa([],e)}))}(t),function(e){di(e,(e=>{e.categoryMatches=[],di(e.categoryMatchesMap,((t,n)=>{e.categoryMatches.push(Ea[n].tokenTypeIdx)}))}))}(t),di(t,(e=>{e.isParent=e.categoryMatches.length>0}))}function Sa(e,t){di(e,(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0})),di(t.CATEGORIES,(n=>{const r=e.concat(t);Oi(r,n)||Sa(r,n)}))}function wa(e){return Pi(e,"tokenTypeIdx")}function Ma(e){return Pi(e,"CATEGORIES")}function Ca(e){return Pi(e,"tokenTypeIdx")}const Ta={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};var Ia,Ba;(Ba=Ia||(Ia={}))[Ba.MISSING_PATTERN=0]="MISSING_PATTERN",Ba[Ba.INVALID_PATTERN=1]="INVALID_PATTERN",Ba[Ba.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",Ba[Ba.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",Ba[Ba.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",Ba[Ba.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",Ba[Ba.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",Ba[Ba.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",Ba[Ba.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",Ba[Ba.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",Ba[Ba.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",Ba[Ba.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",Ba[Ba.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",Ba[Ba.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",Ba[Ba.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",Ba[Ba.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",Ba[Ba.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",Ba[Ba.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";const Ra={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ta,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ra);class Pa{constructor(e,t=Ra){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=as(t),s=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=lt({},Ra,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===Ra.lineTerminatorsPattern)this.config.lineTerminatorsPattern=da;else if(this.config.lineTerminatorCharacters===Ra.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),x(e)?n={modes:{defaultMode:sr(e)},defaultMode:ea}:(r=!1,n=sr(e))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t,n){const r=[];return Pi(e,ea)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+ea+"> property in its definition\n",type:Ia.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Pi(e,ta)||r.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:Ia.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Pi(e,ta)&&Pi(e,ea)&&!Pi(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${ea}: <${e.defaultMode}>which does not exist\n`,type:Ia.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Pi(e,ta)&&di(e.modes,((e,t)=>{di(e,((n,i)=>{Wi(n)?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:Ia.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Pi(n,"LONGER_ALT")&&di(x(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],(i=>{Wi(i)||Oi(e,i)||r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>\n`,type:Ia.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}))})),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ca(n,this.trackStartLines,this.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},di(n.modes,((e,t)=>{n.modes[t]=Zi(e,(e=>Wi(e)))}));const i=st(n.modes);if(di(n.modes,((e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,(()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ia(e,i))})),Vi(this.lexerDefinitionErrors)){let r;_a(e),this.TRACE_INIT("analyzeTokenTypes",(()=>{r=ra(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=lt({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}}))})),this.defaultMode=n.defaultMode,!Vi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=_i(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}di(this.lexerDefinitionWarning,(e=>{ss(e.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(na?(this.chopInput=N,this.match=this.matchWithTest):(this.updateLastIndex=ae,this.match=this.matchWithExec),r&&(this.handleModes=ae),!1===this.trackStartLines&&(this.computeNewColumn=N),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=ae),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)})),this.TRACE_INIT("Failed Optimization Warnings",(()=>{const e=Ji(this.canModeBeOptimized,((e,t,n)=>(!1===t&&e.push(n),e)),[]);if(t.ensureOptimizations&&!Vi(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)})),this.TRACE_INIT("clearRegExpParserCache",(()=>{zs={}})),this.TRACE_INIT("toFastProperties",(()=>{os(this)}))}))}tokenize(e,t=this.defaultMode){if(!Vi(this.lexerDefinitionErrors)){const e=_i(this.lexerDefinitionErrors,(e=>e.message)).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,a,o,l,c,h,u,d,p,f,m,g;const A=e,v=A.length;let y=0,b=0;const E=this.hasCustom?0:Math.floor(e.length/10),_=new Array(E),S=[];let w=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const C=function(e){const t={};return di(st(e),(n=>{const r=e[n];if(!x(r))throw Error("non exhaustive match");t[n]=[]})),t}(this.emptyGroups),T=this.trackStartLines,I=this.config.lineTerminatorsPattern;let B=0,R=[],P=[];const D=[],L=[];let F;function U(){return R}function O(e){const t=va(e),n=P[t];return void 0===n?L:n}Object.freeze(L);const N=e=>{if(1===D.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);S.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{D.pop();const e=ci(D);R=this.patternIdxToConfig[e],P=this.charCodeToPatternIdxToConfig[e],B=R.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=P&&t?O:U}};function k(e){D.push(e),P=this.charCodeToPatternIdxToConfig[e],R=this.patternIdxToConfig[e],B=R.length,B=R.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=P&&t?O:U}let G;k.call(this,t);const z=this.config.recoveryEnabled;for(;y<v;){o=null;const t=A.charCodeAt(y),x=F(t),E=x.length;for(n=0;n<E;n++){G=x[n];const r=G.pattern;l=null;const h=G.short;if(!1!==h?t===h&&(o=r):!0===G.isCustom?(g=r.exec(A,y,_,C),null!==g?(o=g[0],void 0!==g.payload&&(l=g.payload)):o=null):(this.updateLastIndex(r,y),o=this.match(r,e,y)),null!==o){if(a=G.longerAlt,void 0!==a){const t=a.length;for(i=0;i<t;i++){const t=R[a[i]],n=t.pattern;if(c=null,!0===t.isCustom?(g=n.exec(A,y,_,C),null!==g?(s=g[0],void 0!==g.payload&&(c=g.payload)):s=null):(this.updateLastIndex(n,y),s=this.match(n,e,y)),s&&s.length>o.length){o=s,l=c,G=t;break}}}break}}if(null!==o){if(h=o.length,u=G.group,void 0!==u&&(d=G.tokenTypeIdx,p=this.createTokenInstance(o,y,d,G.tokenType,w,M,h),this.handlePayload(p,l),!1===u?b=this.addToken(_,b,p):C[u].push(p)),e=this.chopInput(e,h),y+=h,M=this.computeNewColumn(M,h),!0===T&&!0===G.canLineTerminator){let e,t,n=0;I.lastIndex=0;do{e=I.test(o),!0===e&&(t=I.lastIndex-1,n++)}while(!0===e);0!==n&&(w+=n,M=h-t,this.updateTokenEndLineColumnLocation(p,u,t,n,w,M,h))}this.handleModes(G,N,k,p)}else{const t=y,n=w,i=M;let s=!1===z;for(;!1===s&&y<v;)for(e=this.chopInput(e,1),y++,r=0;r<B;r++){const t=R[r],n=t.pattern,i=t.short;if(!1!==i?A.charCodeAt(y)===i&&(s=!0):!0===t.isCustom?s=null!==n.exec(A,y,_,C):(this.updateLastIndex(n,y),s=null!==n.exec(e)),!0===s)break}if(f=y-t,M=this.computeNewColumn(M,f),m=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(A,t,f,n,i),S.push({offset:t,line:n,column:i,length:f,message:m}),!1===z)break}}return this.hasCustom||(_.length=b),{tokens:_,groups:C,errors:S}}handleModes(e,t,n,r){if(!0===e.pop){const i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,r,i,s,a){let o,l;void 0!==t&&(o=n===a-1,l=o?-1:0,1===r&&!0===o||(e.endLine=i+l,e.endColumn=s-1-l))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,s){return{image:e,startOffset:t,startLine:i,startColumn:s,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,s,a){return{image:e,startOffset:t,endOffset:t+a-1,startLine:i,endLine:i,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,++t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){null!==t&&(e.payload=t)}matchWithTest(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null}matchWithExec(e,t){const n=e.exec(t);return null!==n?n[0]:null}}function Da(e){return La(e)?e.LABEL:e.name}function La(e){return Li(e.LABEL)&&""!==e.LABEL}Pa.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Pa.NA=/NOT_APPLICABLE/;const Fa="parent",Ua="categories",Oa="label",Na="group",ka="push_mode",Ga="pop_mode",za="longer_alt",Qa="line_breaks",Va="start_chars_hint";function Ha(e){return function(e){const t=e.pattern,n={};n.name=e.name,Wi(t)||(n.PATTERN=t);if(Pi(e,Fa))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";Pi(e,Ua)&&(n.CATEGORIES=e[Ua]);_a([n]),Pi(e,Oa)&&(n.LABEL=e[Oa]);Pi(e,Na)&&(n.GROUP=e[Na]);Pi(e,Ga)&&(n.POP_MODE=e[Ga]);Pi(e,ka)&&(n.PUSH_MODE=e[ka]);Pi(e,za)&&(n.LONGER_ALT=e[za]);Pi(e,Qa)&&(n.LINE_BREAKS=e[Qa]);Pi(e,Va)&&(n.START_CHARS_HINT=e[Va]);return n}(e)}const ja=Ha({name:"EOF",pattern:Pa.NA});function Wa(e,t,n,r,i,s,a,o){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}_a([ja]);const Xa={buildMismatchTokenMessage:({expected:e,actual:t,previous:n,ruleName:r})=>`Expecting ${La(e)?`--\x3e ${Da(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",a="\nbut found: '"+bi(t).image+"'";if(r)return s+r+a;{const t=_i(Ji(e,((e,t)=>e.concat(t)),[]),(e=>`[${_i(e,(e=>Da(e))).join(", ")}]`));return s+`one of these possible Token sequences:\n${_i(t,((e,t)=>` ${t+1}. ${e}`)).join("\n")}`+a}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+bi(t).image+"'";if(n)return i+n+s;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${_i(e,(e=>`[${_i(e,(e=>Da(e))).join(",")}]`)).join(" ,")}>`+s}};Object.freeze(Xa);const Ya={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},qa={buildDuplicateFoundError(e,t){const n=e.name,r=bi(t),i=r.idx,s=_s(r),a=(o=r)instanceof ys?o.terminalType.name:o instanceof hs?o.nonTerminalName:"";var o;let l=`->${s}${i>0?i:""}<- ${a?`with argument: ->${a}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=_i(e.prefixPath,(e=>Da(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=_i(e.prefixPath,(e=>Da(e))).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=_s(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);return`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --\x3e ${_i(e.leftRecursionPath,(e=>e.name)).concat([t]).join(" --\x3e ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;t=e.topLevelRule instanceof us?e.topLevelRule.name:e.topLevelRule;return`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Ka extends bs{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){di(Fi(this.nameToTopRule),(e=>{this.currTopLevel=e,e.accept(this)}))}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:xl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Ja extends Ss{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=sr(this.path.ruleStack).reverse(),this.occurrenceStack=sr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){Vi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Za extends Ja{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new ds({definition:e});this.possibleTokTypes=Ms(r),this.found=!0}}}class $a extends Ss{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class eo extends $a{walkMany(e,t,n){if(e.idx===this.occurrence){const e=bi(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ys&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class to extends $a{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=bi(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ys&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class no extends $a{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=bi(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ys&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class ro extends $a{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=bi(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ys&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function io(e,t,n=[]){n=sr(n);let r=[],i=0;function s(s){const a=io(s.concat(hi(e,i+1)),t,n);return r.concat(a)}for(;n.length<t&&i<e.length;){const t=e[i];if(t instanceof ds)return s(t.definition);if(t instanceof hs)return s(t.definition);if(t instanceof ps)r=s(t.definition);else{if(t instanceof fs){return s(t.definition.concat([new gs({definition:t.definition})]))}if(t instanceof ms){return s([new ds({definition:t.definition}),new gs({definition:[new ys({terminalType:t.separator})].concat(t.definition)})])}if(t instanceof As){const e=t.definition.concat([new gs({definition:[new ys({terminalType:t.separator})].concat(t.definition)})]);r=s(e)}else if(t instanceof gs){const e=t.definition.concat([new gs({definition:t.definition})]);r=s(e)}else{if(t instanceof vs)return di(t.definition,(e=>{!1===Vi(e.definition)&&(r=s(e.definition))})),r;if(!(t instanceof ys))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:hi(e,i)}),r}function so(e,t,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=t.length,c=l-r-1,h=[],u=[];for(u.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Vi(u);){const e=u.pop();if(e===a){o&&ci(u).idx<=c&&u.pop();continue}const r=e.def,d=e.idx,p=e.ruleStack,f=e.occurrenceStack;if(Vi(r))continue;const m=r[0];if(m===i){const e={idx:d,def:hi(r),ruleStack:ui(p),occurrenceStack:ui(f)};u.push(e)}else if(m instanceof ys)if(d<l-1){const e=d+1;if(n(t[e],m.terminalType)){const t={idx:e,def:hi(r),ruleStack:p,occurrenceStack:f};u.push(t)}}else{if(d!==l-1)throw Error("non exhaustive match");h.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:p,occurrenceStack:f}),o=!0}else if(m instanceof hs){const e=sr(p);e.push(m.nonTerminalName);const t=sr(f);t.push(m.idx);const n={idx:d,def:m.definition.concat(s,hi(r)),ruleStack:e,occurrenceStack:t};u.push(n)}else if(m instanceof ps){const e={idx:d,def:hi(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);const t={idx:d,def:m.definition.concat(hi(r)),ruleStack:p,occurrenceStack:f};u.push(t)}else if(m instanceof fs){const e=new gs({definition:m.definition,idx:m.idx}),t={idx:d,def:m.definition.concat([e],hi(r)),ruleStack:p,occurrenceStack:f};u.push(t)}else if(m instanceof ms){const e=new ys({terminalType:m.separator}),t=new gs({definition:[e].concat(m.definition),idx:m.idx}),n={idx:d,def:m.definition.concat([t],hi(r)),ruleStack:p,occurrenceStack:f};u.push(n)}else if(m instanceof As){const e={idx:d,def:hi(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);const t=new ys({terminalType:m.separator}),n=new gs({definition:[t].concat(m.definition),idx:m.idx}),i={idx:d,def:m.definition.concat([n],hi(r)),ruleStack:p,occurrenceStack:f};u.push(i)}else if(m instanceof gs){const e={idx:d,def:hi(r),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a);const t=new gs({definition:m.definition,idx:m.idx}),n={idx:d,def:m.definition.concat([t],hi(r)),ruleStack:p,occurrenceStack:f};u.push(n)}else if(m instanceof vs)for(let t=m.definition.length-1;t>=0;t--){const e={idx:d,def:m.definition[t].definition.concat(hi(r)),ruleStack:p,occurrenceStack:f};u.push(e),u.push(a)}else if(m instanceof ds)u.push({idx:d,def:m.definition.concat(hi(r)),ruleStack:p,occurrenceStack:f});else{if(!(m instanceof us))throw Error("non exhaustive match");u.push(ao(m,d,p,f))}}return h}function ao(e,t,n,r){const i=sr(n);i.push(e.name);const s=sr(r);return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var oo,lo;function co(e){if(e instanceof ps||"Option"===e)return oo.OPTION;if(e instanceof gs||"Repetition"===e)return oo.REPETITION;if(e instanceof fs||"RepetitionMandatory"===e)return oo.REPETITION_MANDATORY;if(e instanceof ms||"RepetitionMandatoryWithSeparator"===e)return oo.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof As||"RepetitionWithSeparator"===e)return oo.REPETITION_WITH_SEPARATOR;if(e instanceof vs||"Alternation"===e)return oo.ALTERNATION;throw Error("non exhaustive match")}function ho(e,t,n,r){const i=e.length,s=mi(e,(e=>mi(e,(e=>1===e.length))));if(t)return function(t){const r=_i(t,(e=>e.GATE));for(let s=0;s<i;s++){const t=e[s],i=t.length,a=r[s];if(void 0===a||!1!==a.call(this))e:for(let e=0;e<i;e++){const r=t[e],i=r.length;for(let e=0;e<i;e++){const t=this.LA(e+1);if(!1===n(t,r[e]))continue e}return s}}};if(s&&!r){const t=Ji(_i(e,(e=>kt(e))),((e,t,n)=>(di(t,(t=>{Pi(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),di(t.categoryMatches,(t=>{Pi(e,t)||(e[t]=n)}))})),e)),{});return function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){const r=e[t],i=r.length;e:for(let e=0;e<i;e++){const i=r[e],s=i.length;for(let e=0;e<s;e++){const t=this.LA(e+1);if(!1===n(t,i[e]))continue e}return t}}}}function uo(e,t,n){const r=mi(e,(e=>1===e.length)),i=e.length;if(r&&!n){const t=kt(e);if(1===t.length&&Vi(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=Ji(t,((e,t,n)=>(e[t.tokenTypeIdx]=!0,di(t.categoryMatches,(t=>{e[t]=!0})),e)),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;n<i;n++){const r=e[n],i=r.length;for(let e=0;e<i;e++){const n=this.LA(e+1);if(!1===t(n,r[e]))continue e}return!0}return!1}}(lo=oo||(oo={}))[lo.OPTION=0]="OPTION",lo[lo.REPETITION=1]="REPETITION",lo[lo.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",lo[lo.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",lo[lo.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",lo[lo.ALTERNATION=5]="ALTERNATION";class po extends Ss{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,oo.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,oo.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,oo.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,oo.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,oo.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}}class fo extends bs{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,oo.OPTION)}visitRepetition(e){this.checkIsTarget(e,oo.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,oo.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,oo.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,oo.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,oo.ALTERNATION)}}function mo(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function go(e){let t=[""];for(let n=0;n<e.length;n++){const r=e[n],i=[];for(let e=0;e<t.length;e++){const n=t[e];i.push(n+"_"+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){const t="_"+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function Ao(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;const i=e[r];for(let e=0;e<t.length;e++){if(!0===i[t[e]])return!1}}return!0}function vo(e,t){const n=_i(e,(e=>io([e],1))),r=mo(n.length),i=_i(n,(e=>{const t={};return di(e,(e=>{di(go(e.partialPath),(e=>{t[e]=!0}))})),t}));let s=n;for(let a=1;a<=t;a++){const e=s;s=mo(e.length);for(let n=0;n<e.length;n++){const o=e[n];for(let e=0;e<o.length;e++){const l=o[e].partialPath,c=o[e].suffixDef,h=go(l);if(Ao(i,h,n)||Vi(c)||l.length===t){const e=r[n];if(!1===bo(e,l)){e.push(l);for(let e=0;e<h.length;e++){const t=h[e];i[n][t]=!0}}}else{const e=io(c,a+1,l);s[n]=s[n].concat(e),di(e,(e=>{di(go(e.partialPath),(e=>{i[n][e]=!0}))}))}}}}return r}function yo(e,t,n,r){const i=new fo(e,oo.ALTERNATION,r);return t.accept(i),vo(i.result,n)}function xo(e,t,n,r){const i=new fo(e,n);t.accept(i);const s=i.result,a=new po(t,e,n).startWalking();return vo([new ds({definition:s}),new ds({definition:a})],r)}function bo(e,t){e:for(let n=0;n<e.length;n++){const r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){const n=t[e],i=r[e];if(!1===(n===i||void 0!==i.categoryMatchesMap[n.tokenTypeIdx]))continue e}return!0}}return!1}function Eo(e){return mi(e,(e=>mi(e,(e=>mi(e,(e=>Vi(e.categoryMatches)))))))}function _o(e,t,n,r){const i=Si(e,(e=>function(e,t){const n=new Mo;e.accept(n);const r=n.allProductions,i=Ii(r,So),s=_i(Fi(qi(i,(e=>e.length>1))),(n=>{const r=bi(n),i=t.buildDuplicateFoundError(e,n),s=_s(r),a={message:i,type:xl.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},o=wo(r);return o&&(a.parameter=o),a}));return s}(e,n))),s=function(e,t,n){const r=[],i=_i(t,(e=>e.name));return di(e,(e=>{const t=e.name;if(Oi(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:xl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}(e,t,n),a=Si(e,(e=>function(e,t){const n=new Io;e.accept(n);const r=Si(n.alternations,(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:xl.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]));return r}(e,n))),o=Si(e,(t=>function(e,t,n,r){const i=[],s=Ji(t,((t,n)=>n.name===e.name?t+1:t),0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:xl.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n)));return i.concat(s,a,o)}function So(e){return`${_s(e)}_#_${e.idx}_#_${wo(e)}`}function wo(e){return e instanceof ys?e.terminalType.name:e instanceof hs?e.nonTerminalName:""}class Mo extends bs{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Co(e,t,n,r=[]){const i=[],s=To(t.definition);if(Vi(s))return[];{const t=e.name;Oi(s,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:xl.LEFT_RECURSION,ruleName:t});const a=Si(li(s,r.concat([e])),(t=>{const i=sr(r);return i.push(t),Co(e,t,n,i)}));return i.concat(a)}}function To(e){let t=[];if(Vi(e))return t;const n=bi(e);if(n instanceof hs)t.push(n.referencedRule);else if(n instanceof ds||n instanceof ps||n instanceof fs||n instanceof ms||n instanceof As||n instanceof gs)t=t.concat(To(n.definition));else if(n instanceof vs)t=kt(_i(n.definition,(e=>To(e.definition))));else if(!(n instanceof ys))throw Error("non exhaustive match");const r=Es(n),i=e.length>1;if(r&&i){const n=hi(e);return t.concat(To(n))}return t}class Io extends bs{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Bo(e,t,n){const r=new Io;e.accept(r);let i=r.alternations;i=Zi(i,(e=>!0===e.ignoreAmbiguities));const s=Si(i,(r=>{const i=r.idx,s=r.maxLookahead||t,a=yo(i,e,s,r),o=function(e,t,n,r){const i=[],s=Ji(e,((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||di(r,(r=>{const a=[s];di(e,((e,n)=>{s!==n&&bo(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&a.push(n)})),a.length>1&&!bo(i,r)&&(i.push(r),n.push({alts:a,path:r}))})),n)),[]),a=_i(s,(e=>{const i=_i(e.alts,(e=>e+1));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:xl.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}}));return a}(a,r,e,n),l=function(e,t,n,r){const i=Ji(e,((e,t,n)=>{const r=_i(t,(e=>({idx:n,path:e})));return e.concat(r)}),[]),s=ar(Si(i,(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,a=e.path;return _i(Ai(i,(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<s&&(n=e.path,r=a,n.length<r.length&&mi(n,((e,t)=>{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]})));var n,r})),(e=>{const i=[e.idx+1,s+1],a=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:xl.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:a,alternatives:i}}))})));return s}(a,r,e,n);return o.concat(l)}));return s}class Ro extends bs{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function Po(e){const t=si(e,{errMsgProvider:Ya}),n={};return di(e.rules,(e=>{n[e.name]=e})),function(e,t){const n=new Ka(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}const Do="MismatchedTokenException",Lo="NoViableAltException",Fo="EarlyExitException",Uo="NotAllInputParsedException",Oo=[Do,Lo,Fo,Uo];function No(e){return Oi(Oo,e.name)}Object.freeze(Oo);class ko extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Go extends ko{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Do}}class zo extends ko{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Lo}}class Qo extends ko{constructor(e,t){super(e,t),this.name=Uo}}class Vo extends ko{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Fo}}const Ho={},jo="InRuleRecoveryException";class Wo extends Error{constructor(e){super(e),this.name=jo}}function Xo(e,t,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,h=l.occurrence;const u=l.isEndOfRule;1===this.RULE_STACK.length&&u&&void 0===c&&(c=ja,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,a)&&this.tryInRepetitionRecovery(e,t,n,c)}const Yo=1024,qo=1280,Ko=1536;function Jo(e,t,n){return n|t|e}class Zo{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:vl.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(Vi(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return Si(e,(e=>Co(e,e,qa)))}validateEmptyOrAlternatives(e){return Si(e,(e=>function(e,t){const n=new Io;return e.accept(n),Si(n.alternations,(n=>Si(ui(n.definition),((r,i)=>Vi(so([r],[],ya,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:xl.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))))}(e,qa)))}validateAmbiguousAlternationAlternatives(e,t){return Si(e,(e=>Bo(e,t,qa)))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return di(e,(e=>{const i=new Ro;e.accept(i),di(i.allProductions,(i=>{const s=co(i),a=i.maxLookahead||t;if(Vi(kt(xo(i.idx,e,s,a)[0]))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:xl.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),r}(e,t,qa)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const a=yo(e,t,n);return s(a,r,Eo(a)?xa:ya,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ho)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const a=xo(e,t,i,n),o=Eo(a)?xa:ya;return s(a[0],o,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,co(e.prodType),uo)}}const $o=new class extends bs{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function el(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function tl(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}const nl="name";function rl(e,t){Object.defineProperty(e,nl,{enumerable:!1,configurable:!0,writable:!1,value:t})}function il(e,t){const n=st(e),r=n.length;for(let i=0;i<r;i++){const r=e[n[i]],s=r.length;for(let e=0;e<s;e++){const n=r[e];void 0===n.tokenTypeIdx&&this[n.name](n.children,t)}}}function sl(e,t){const n=function(){};rl(n,e+"BaseSemantics");const r={visit:function(e,t){if(x(e)&&(e=e[0]),!Wi(e))return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){const n=Ai(t,(t=>!1===V(e[t]))),r=_i(n,(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:al.MISSING_METHOD,methodName:t})));return ar(r)}(e,t);return n}(this,t);if(!Vi(e)){const t=_i(e,(e=>e.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}var al,ol;(ol=al||(al={}))[ol.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",ol[ol.MISSING_METHOD=1]="MISSING_METHOD";const ll={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ll);const cl=Math.pow(2,8)-1,hl=Ha({name:"RECORDING_PHASE_TOKEN",pattern:Pa.NA});_a([hl]);const ul=Wa(hl,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(ul);const dl={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function pl(e,t,n,r=!1){gl(n);const i=ci(this.recordingProdStack),s=V(t)?t:t.DEF,a=new e({definition:[],idx:n});return r&&(a.separator=t.SEP),Pi(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),ll}function fl(e,t){gl(t);const n=ci(this.recordingProdStack),r=!1===x(e),i=!1===r?e:e.DEF,s=new vs({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});Pi(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const a=es(i,(e=>V(e.GATE)));return s.hasPredicates=a,n.definition.push(s),di(i,(e=>{const t=new ds({definition:[]});s.definition.push(t),Pi(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Pi(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()})),ll}function ml(e){return 0===e?"":`${e}`}function gl(e){if(e<0||e>cl){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${cl+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const Al=Wa(ja,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Al);const vl=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Xa,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),yl=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var xl,bl,El;(bl=xl||(xl={}))[bl.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",bl[bl.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",bl[bl.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",bl[bl.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",bl[bl.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",bl[bl.LEFT_RECURSION=5]="LEFT_RECURSION",bl[bl.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",bl[bl.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",bl[bl.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",bl[bl.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",bl[bl.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",bl[bl.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",bl[bl.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",bl[bl.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION";class _l{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",(()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",(()=>{os(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),di(this.definedRulesNames,(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,(()=>{n=this.topLevelRuleRecord(e,t)})),this.gastProductionsCache[e]=n}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=Po({rules:Fi(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if(Vi(n)&&!1===this.skipValidations){const n=(e={rules:Fi(this.gastProductionsCache),tokenTypes:Fi(this.tokensMap),errMsgProvider:qa,grammarName:t},_o((e=si(e,{errMsgProvider:qa})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){return _i(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),(e=>Object.assign({type:xl.CUSTOM_LOOKAHEAD_VALIDATION},e)))}({lookaheadStrategy:this.lookaheadStrategy,rules:Fi(this.gastProductionsCache),tokenTypes:Fi(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e})),Vi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const e=function(e){const t={};return di(e,(e=>{const n=new Ts(e).startWalking();lt(t,n)})),t}(Fi(this.gastProductionsCache));this.resyncFollows=e})),this.TRACE_INIT("ComputeLookaheadFunctions",(()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Fi(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Fi(this.gastProductionsCache))}))),!_l.DEFER_DEFINITION_ERRORS_HANDLING&&!Vi(this.definitionErrors))throw e=_i(this.definitionErrors,(e=>e.message)),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)}))}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),Pi(t,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Pi(t,"skipValidations")?t.skipValidations:vl.skipValidations}}_l.DEFER_DEFINITION_ERRORS_HANDLING=!1,El=_l,[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Pi(e,"recoveryEnabled")?e.recoveryEnabled:vl.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Xo)}getTokenToInsert(e){const t=Wa(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),a=[];let o=!1;const l=this.LA(1);let c=this.LA(1);const h=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new Go(t,l,this.LA(0));n.resyncedTokens=ui(a),this.SAVE_ERROR(n)};for(;!o;){if(this.tokenMatcher(c,r))return void h();if(n.call(this))return h(),void e.apply(this,t);this.tokenMatcher(c,i)?o=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Wo("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Vi(t))return!1;const n=this.LA(1);return void 0!==xi(t,(e=>this.tokenMatcher(n,e)))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return Oi(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=xi(e,(e=>ya(t,e)));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return Ho;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return _i(e,((n,r)=>0===r?Ho:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])}))}flattenFollowSet(){return kt(_i(this.buildFullFollowKeyStack(),(e=>this.getFollowSetFromFollowKey(e))))}getFollowSetFromFollowKey(e){if(e===Ho)return[ja];const t=e.ruleName+e.idxInCallingRule+Cs+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,ja)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return ui(t)}attemptInRepetitionRecovery(e,t,n,r,i,s,a){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:sr(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return _i(this.RULE_STACK,(e=>this.shortRuleNameToFullName(e)))}},class{initLooksAhead(e){this.dynamicTokensEnabled=Pi(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:vl.dynamicTokensEnabled,this.maxLookahead=Pi(e,"maxLookahead")?e.maxLookahead:vl.maxLookahead,this.lookaheadStrategy=Pi(e,"lookaheadStrategy")?e.lookaheadStrategy:new Zo({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){di(e,(e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,(()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:a}=function(e){$o.reset(),e.accept($o);const t=$o.dslMethods;return $o.reset(),t}(e);di(t,(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${_s(t)}${n}`,(()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Jo(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)}))})),di(n,(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,_s(t))})),di(r,(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,_s(t))})),di(i,(t=>{this.computeLookaheadFunc(e,t.idx,Yo,"RepetitionMandatory",t.maxLookahead,_s(t))})),di(s,(t=>{this.computeLookaheadFunc(e,t.idx,Ko,"RepetitionMandatoryWithSeparator",t.maxLookahead,_s(t))})),di(a,(t=>{this.computeLookaheadFunc(e,t.idx,qo,"RepetitionWithSeparator",t.maxLookahead,_s(t))}))}))}))}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,(()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),a=Jo(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(a,s)}))}getKeyForAutomaticLookahead(e,t){return Jo(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Pi(e,"nodeLocationTracking")?e.nodeLocationTracking:vl.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=tl,this.setNodeLocationFromNode=tl,this.cstPostRule=ae,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ae,this.setNodeLocationFromNode=ae,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=el,this.setNodeLocationFromNode=el,this.cstPostRule=ae,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ae,this.setNodeLocationFromNode=ae,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=ae,this.setNodeLocationFromNode=ae,this.cstPostRule=ae,this.setInitialNodeLocation=ae}else this.cstInvocationStateUpdate=ae,this.cstFinallyStateUpdate=ae,this.cstPostTerminal=ae,this.cstPostNonTerminal=ae,this.cstPostRule=ae}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Wi(this.baseCstVisitorConstructor)){const e=sl(this.className,st(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Wi(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};rl(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return di(t,(e=>{i[e]=il})),(r.prototype=i).constructor=r,r}(this.className,st(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Al}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Al:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=xa,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Pi(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(x(e)){if(Vi(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(x(e))this.tokensMap=Ji(e,((e,t)=>(e[t.name]=t,e)),{});else if(Pi(e,"modes")&&mi(kt(Fi(e.modes)),Ca)){const t=rs(kt(Fi(e.modes)));this.tokensMap=Ji(t,((e,t)=>(e[t.name]=t,e)),{})}else{if(!T(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=sr(e)}this.tokensMap.EOF=ja;const n=mi(Pi(e,"modes")?kt(Fi(e.modes)):Fi(e),(e=>Vi(e.categoryMatches)));this.tokenMatcher=n?xa:ya,_a(Fi(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Pi(n,"resyncEnabled")?n.resyncEnabled:yl.resyncEnabled,i=Pi(n,"recoveryValueFunc")?n.recoveryValueFunc:yl.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let a;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,a=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(a){return this.invokeRuleCatch(a,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(a){return this.invokeRuleCatch(a,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(No(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Yo,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,oo.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Yo,e,no)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ko,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,oo.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,ro],t,Ko,e,ro)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,eo,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(qo,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,to],t,qo,e,to)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,Ko,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=x(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Qo(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,t,n){throw No(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(i){r=this.consumeInternalRecovery(e,t,i)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Go(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(r){throw r.name===jo?n:r}}}saveRecogState(){const e=this.errors,t=sr(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),ja)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=yl){if(Oi(this.definedRulesNames,e)){const t={message:qa.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:xl.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=yl){const r=function(e,t,n){const r=[];let i;return Oi(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:xl.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(No(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return _i(Fi(this.gastProductionsCache),xs)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Pi(e,"errorMessageProvider")?e.errorMessageProvider:vl.errorMessageProvider}SAVE_ERROR(e){if(No(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:sr(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return sr(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=xo(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let o=1;o<=this.maxLookahead;o++)s.push(this.LA(o));const a=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Vo(a,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=yo(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let o=1;o<=this.maxLookahead;o++)i.push(this.LA(o));const s=this.LA(0),a=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new zo(a,this.LA(1),s))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(Wi(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return so([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=bi(e.ruleStack),n=this.getGAstProductions()[t];return new Za(n,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD}))}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Al}topLevelRuleRecord(e,t){try{const n=new us({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(n){if(!0!==n.KNOWN_RECORDER_ERROR)try{n.message=n.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(r){throw n}throw n}}optionInternalRecord(e,t){return pl.call(this,ps,e,t)}atLeastOneInternalRecord(e,t){pl.call(this,fs,t,e)}atLeastOneSepFirstInternalRecord(e,t){pl.call(this,ms,t,e,!0)}manyInternalRecord(e,t){pl.call(this,gs,t,e)}manySepFirstInternalRecord(e,t){pl.call(this,As,t,e,!0)}orInternalRecord(e,t){return fl.call(this,e,t)}subruleInternalRecord(e,t,n){if(gl(t),!e||!1===Pi(e,"ruleName")){const n=new Error(`<SUBRULE${ml(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=ci(this.recordingProdStack),i=e.ruleName,s=new hs({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?dl:ll}consumeInternalRecord(e,t,n){if(gl(t),!wa(e)){const n=new Error(`<CONSUME${ml(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=ci(this.recordingProdStack),i=new ys({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),ul}},class{initPerformanceTracer(e){if(Pi(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=vl.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=as(t),s=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}}].forEach((e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach((n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(El.prototype,n,r):El.prototype[n]=e.prototype[n]}))}));return{CstParser:class extends _l{constructor(e,t=vl){const n=sr(t);n.outputCst=!0,super(e,n)}},Lexer:Pa,createToken:Ha}})();t.CstParser=r,t.Lexer=i,t.createToken=s},29234:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});class n{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class r{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){void 0===t&&(t=0);const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const i=[171,75,84,88,32,50,48,187,13,10,26,10];function s(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}t.KHR_DF_FLAG_ALPHA_PREMULTIPLIED=1,t.KHR_DF_FLAG_ALPHA_STRAIGHT=0,t.KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT=0,t.KHR_DF_MODEL_UNSPECIFIED=0,t.KHR_DF_PRIMARIES_BT709=1,t.KHR_DF_SAMPLE_DATATYPE_SIGNED=64,t.KHR_DF_TRANSFER_SRGB=2,t.KHR_DF_VENDORID_KHRONOS=0,t.KHR_DF_VERSION=2,t.KHR_SUPERCOMPRESSION_NONE=0,t.KHR_SUPERCOMPRESSION_ZSTD=2,t.KTX2Container=n,t.VK_FORMAT_R16G16B16A16_SFLOAT=97,t.VK_FORMAT_R16G16_SFLOAT=83,t.VK_FORMAT_R16_SFLOAT=76,t.VK_FORMAT_R32G32B32A32_SFLOAT=109,t.VK_FORMAT_R32G32_SFLOAT=103,t.VK_FORMAT_R32_SFLOAT=100,t.VK_FORMAT_R8G8B8A8_SRGB=43,t.VK_FORMAT_R8G8B8A8_UNORM=37,t.VK_FORMAT_R8G8_SRGB=22,t.VK_FORMAT_R8G8_UNORM=16,t.VK_FORMAT_R8_SRGB=15,t.VK_FORMAT_R8_UNORM=9,t.VK_FORMAT_UNDEFINED=0,t.read=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,i.length);if(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])throw new Error("Missing KTX 2.0 identifier.");const a=new n,o=17*Uint32Array.BYTES_PER_ELEMENT,l=new r(e,i.length,o,!0);a.vkFormat=l._nextUint32(),a.typeSize=l._nextUint32(),a.pixelWidth=l._nextUint32(),a.pixelHeight=l._nextUint32(),a.pixelDepth=l._nextUint32(),a.layerCount=l._nextUint32(),a.faceCount=l._nextUint32();const c=l._nextUint32();a.supercompressionScheme=l._nextUint32();const h=l._nextUint32(),u=l._nextUint32(),d=l._nextUint32(),p=l._nextUint32(),f=l._nextUint64(),m=l._nextUint64(),g=new r(e,i.length+o,3*c*8,!0);for(let n=0;n<c;n++)a.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const A=new r(e,h,u,!0),v={vendorId:A._skip(4)._nextUint16(),descriptorType:A._nextUint16(),versionNumber:A._nextUint16(),descriptorBlockSize:A._nextUint16(),colorModel:A._nextUint8(),colorPrimaries:A._nextUint8(),transferFunction:A._nextUint8(),flags:A._nextUint8(),texelBlockDimension:[A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8()],bytesPlane:[A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8()],samples:[]},y=(v.descriptorBlockSize/4-6)/4;for(let n=0;n<y;n++){const e={bitOffset:A._nextUint16(),bitLength:A._nextUint8(),channelType:A._nextUint8(),samplePosition:[A._nextUint8(),A._nextUint8(),A._nextUint8(),A._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&e.channelType?(e.sampleLower=A._nextInt32(),e.sampleUpper=A._nextInt32()):(e.sampleLower=A._nextUint32(),e.sampleUpper=A._nextUint32()),v.samples[n]=e}a.dataFormatDescriptor.length=0,a.dataFormatDescriptor.push(v);const x=new r(e,d,p,!0);for(;x._offset<p;){const e=x._nextUint32(),t=x._scan(e),n=s(t);if(a.keyValue[n]=x._nextUint8Array(e-t.byteLength-1),n.match(/^ktx/i)){const e=s(a.keyValue[n]);a.keyValue[n]=e.substring(0,e.lastIndexOf("\0"))}const r=e%4?4-e%4:0;x._skip(r)}if(m<=0)return a;const b=new r(e,f,m,!0),E=b._nextUint16(),_=b._nextUint16(),S=b._nextUint32(),w=b._nextUint32(),M=b._nextUint32(),C=b._nextUint32(),T=[];for(let n=0;n<c;n++)T.push({imageFlags:b._nextUint32(),rgbSliceByteOffset:b._nextUint32(),rgbSliceByteLength:b._nextUint32(),alphaSliceByteOffset:b._nextUint32(),alphaSliceByteLength:b._nextUint32()});const I=f+b._offset,B=I+S,R=B+w,P=R+M,D=new Uint8Array(e.buffer,e.byteOffset+I,S),L=new Uint8Array(e.buffer,e.byteOffset+B,w),F=new Uint8Array(e.buffer,e.byteOffset+R,M),U=new Uint8Array(e.buffer,e.byteOffset+P,C);return a.globalData={endpointCount:E,selectorCount:_,imageDescs:T,endpointsData:D,selectorsData:L,tablesData:F,extendedData:U},a}},47132:module=>{"use strict";const lottie=(()=>{if("undefined"==typeof navigator||"undefined"==typeof document)return{};const svgNS="http://www.w3.org/2000/svg";let locationHref="",_useWebWorker=!1;const initialDefaultFrame=-999999,setWebWorker=e=>{_useWebWorker=!!e},getWebWorker=()=>_useWebWorker,setLocationHref=e=>{locationHref=e},getLocationHref=()=>locationHref;function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var n,r,i=e.length;for(n=0;n<i;n+=1)for(var s in r=e[n].prototype)Object.prototype.hasOwnProperty.call(r,s)&&(t.prototype[s]=r[s])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}const audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var n,r=0,i=[];switch(e){case"int16":case"uint8c":n=1;break;default:n=1.1}for(r=0;r<t;r+=1)i.push(n);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,n){return"float32"===t?new Float32Array(n):"int16"===t?new Int16Array(n):"uint8c"===t?new Uint8ClampedArray(n):e(t,n)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}let subframeEnabled=!0,expressionsPlugin=null,idPrefix$1="";const isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMin=Math.min,BMMath={};!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],n=t.length;for(e=0;e<n;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===typeof e&&e.length){var t,n=createSizedArray(e.length),r=e.length;for(t=0;t<r;t+=1)n[t]=Math.abs(e[t]);return n}return Math.abs(e)};let defaultCurveSegments=150;const degToRads=Math.PI/180,roundCorner=.5519;function BMEnterFrameEvent(e,t,n,r){this.type=e,this.currentTime=t,this.totalTime=n,this.direction=r<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,n,r){this.type=e,this.currentLoop=n,this.totalLoops=t,this.direction=r<0?-1:1}function BMSegmentStartEvent(e,t,n){this.type=e,this.firstFrame=t,this.totalFrames=n}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}const createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)});var _count;function HSVtoRGB(e,t,n){var r,i,s,a,o,l,c,h;switch(l=n*(1-t),c=n*(1-(o=6*e-(a=Math.floor(6*e)))*t),h=n*(1-(1-o)*t),a%6){case 0:r=n,i=h,s=l;break;case 1:r=c,i=n,s=l;break;case 2:r=l,i=n,s=h;break;case 3:r=l,i=c,s=n;break;case 4:r=h,i=l,s=n;break;case 5:r=n,i=l,s=c}return[r,i,s]}function RGBtoHSV(e,t,n){var r,i=Math.max(e,t,n),s=Math.min(e,t,n),a=i-s,o=0===i?0:a/i,l=i/255;switch(i){case s:r=0;break;case e:r=t-n+a*(t<n?6:0),r/=6*a;break;case t:r=n-e+2*a,r/=6*a;break;case n:r=e-t+4*a,r/=6*a}return[r,o,l]}function addSaturationToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[1]+=t,n[1]>1?n[1]=1:n[1]<=0&&(n[1]=0),HSVtoRGB(n[0],n[1],n[2])}function addBrightnessToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),HSVtoRGB(n[0],n[1],n[2])}function addHueToRGB(e,t){var n=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return n[0]+=t/360,n[0]>1?n[0]-=1:n[0]<0&&(n[0]+=1),HSVtoRGB(n[0],n[1],n[2])}!function(){var e,t,n=[];for(e=0;e<256;e+=1)t=e.toString(16),n[e]=1===t.length?"0"+t:t}();const setSubframeEnabled=e=>{subframeEnabled=!!e},getSubframeEnabled=()=>subframeEnabled,setExpressionsPlugin=e=>{expressionsPlugin=e},getExpressionsPlugin=()=>expressionsPlugin,setDefaultCurveSegments=e=>{defaultCurveSegments=e},getDefaultCurveSegments=()=>defaultCurveSegments,setIdPrefix=e=>{idPrefix$1=e};function createNS(e){return document.createElementNS(svgNS,e)}const dataManager=function(){var e,t,n=1,r=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},s={postMessage:function(e){i.onmessage({data:e})}};function a(){t||((t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var n=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),r=URL.createObjectURL(n);return new Worker(r)}return e=t,i}((function(e){if(s.dataManager||(s.dataManager=function(){function e(i,s){var a,o,l,c,h,d,p=i.length;for(o=0;o<p;o+=1)if("ks"in(a=i[o])&&!a.completed){if(a.completed=!0,a.tt&&(i[o-1].td=a.tt),a.hasMask){var f=a.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)r(f[l].pt.k);else for(d=f[l].pt.k.length,h=0;h<d;h+=1)f[l].pt.k[h].s&&r(f[l].pt.k[h].s[0]),f[l].pt.k[h].e&&r(f[l].pt.k[h].e[0])}0===a.ty?(a.layers=t(a.refId,s),e(a.layers,s)):4===a.ty?n(a.shapes):5===a.ty&&u(a)}}function t(e,t){var n=function(e,t){for(var n=0,r=t.length;n<r;){if(t[n].id===e)return t[n];n+=1}return null}(e,t);return n?n.layers.__used?JSON.parse(JSON.stringify(n.layers)):(n.layers.__used=!0,n.layers):null}function n(e){var t,i,s;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)r(e[t].ks.k);else for(s=e[t].ks.k.length,i=0;i<s;i+=1)e[t].ks.k[i].s&&r(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&r(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&n(e[t].it)}function r(e){var t,n=e.i.length;for(t=0;t<n;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var n=t?t.split("."):[100,100,100];return e[0]>n[0]||!(n[0]>e[0])&&(e[1]>n[1]||!(n[1]>e[1])&&(e[2]>n[2]||!(n[2]>e[2])&&null))}var s,a=function(){var e=[4,4,14];function t(e){var t,n,r,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(r=void 0,r=(n=e[t]).t.d,n.t.d={k:[{s:r,t:0}]})}return function(n){if(i(e,n.v)&&(t(n.layers),n.assets)){var r,s=n.assets.length;for(r=0;r<s;r+=1)n.assets[r].layers&&t(n.assets[r].layers)}}}(),o=(s=[4,7,99],function(e){if(e.chars&&!i(s,e.v)){var t,r=e.chars.length;for(t=0;t<r;t+=1){var a=e.chars[t];a.data&&a.data.shapes&&(n(a.data.shapes),a.data.ip=0,a.data.op=99999,a.data.st=0,a.data.sr=1,a.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(a.data.shapes.push({ty:"no"}),a.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,n,r=e.length;for(t=0;t<r;t+=1)5===e[t].ty&&(n=void 0,"number"==typeof(n=e[t].t.p).a&&(n.a={a:0,k:n.a}),"number"==typeof n.p&&(n.p={a:0,k:n.p}),"number"==typeof n.r&&(n.r={a:0,k:n.r}))}return function(n){if(i(e,n.v)&&(t(n.layers),n.assets)){var r,s=n.assets.length;for(r=0;r<s;r+=1)n.assets[r].layers&&t(n.assets[r].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var n,r,i,s=e.length;for(n=0;n<s;n+=1)if("gr"===e[n].ty)t(e[n].it);else if("fl"===e[n].ty||"st"===e[n].ty)if(e[n].c.k&&e[n].c.k[0].i)for(i=e[n].c.k.length,r=0;r<i;r+=1)e[n].c.k[r].s&&(e[n].c.k[r].s[0]/=255,e[n].c.k[r].s[1]/=255,e[n].c.k[r].s[2]/=255,e[n].c.k[r].s[3]/=255),e[n].c.k[r].e&&(e[n].c.k[r].e[0]/=255,e[n].c.k[r].e[1]/=255,e[n].c.k[r].e[2]/=255,e[n].c.k[r].e[3]/=255);else e[n].c.k[0]/=255,e[n].c.k[1]/=255,e[n].c.k[2]/=255,e[n].c.k[3]/=255}function n(e){var n,r=e.length;for(n=0;n<r;n+=1)4===e[n].ty&&t(e[n].shapes)}return function(t){if(i(e,t.v)&&(n(t.layers),t.assets)){var r,s=t.assets.length;for(r=0;r<s;r+=1)t.assets[r].layers&&n(t.assets[r].layers)}}}(),h=function(){var e=[4,4,18];function t(e){var n,r,i;for(n=e.length-1;n>=0;n-=1)if("sh"===e[n].ty)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(i=e[n].ks.k.length,r=0;r<i;r+=1)e[n].ks.k[r].s&&(e[n].ks.k[r].s[0].c=e[n].closed),e[n].ks.k[r].e&&(e[n].ks.k[r].e[0].c=e[n].closed);else"gr"===e[n].ty&&t(e[n].it)}function n(e){var n,r,i,s,a,o,l=e.length;for(r=0;r<l;r+=1){if((n=e[r]).hasMask){var c=n.masksProperties;for(s=c.length,i=0;i<s;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(o=c[i].pt.k.length,a=0;a<o;a+=1)c[i].pt.k[a].s&&(c[i].pt.k[a].s[0].c=c[i].cl),c[i].pt.k[a].e&&(c[i].pt.k[a].e[0].c=c[i].cl)}4===n.ty&&t(n.shapes)}}return function(t){if(i(e,t.v)&&(n(t.layers),t.assets)){var r,s=t.assets.length;for(r=0;r<s;r+=1)t.assets[r].layers&&n(t.assets[r].layers)}}}();function u(e){0===e.t.a.length&&e.t.p}var d={completeData:function(n){n.__complete||(c(n),a(n),o(n),l(n),h(n),e(n.layers,n.assets),function(n,r){if(n){var i=0,s=n.length;for(i=0;i<s;i+=1)1===n[i].t&&(n[i].data.layers=t(n[i].data.refId,r),e(n[i].data.layers,r))}}(n.chars,n.assets),n.__complete=!0)}};return d.checkColors=c,d.checkChars=o,d.checkPathProperties=l,d.checkShapes=h,d.completeLayers=e,d}()),s.assetLoader||(s.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"==typeof e.response?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,n,r,i){var s,a=new XMLHttpRequest;try{a.responseType="json"}catch(o){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)s=e(a),r(s);else try{s=e(a),r(s)}catch(o){i&&i(o)}};try{a.open("GET",t,!0)}catch(l){a.open("GET",n+"/"+t,!0)}a.send()}}}()),"loadAnimation"===e.data.type)s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}))}))).onmessage=function(e){var t=e.data,n=t.id,i=r[n];r[n]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function o(e,t){var i="processId_"+(n+=1);return r[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,n,r){a();var i=o(n,r);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,n,r){a();var i=o(n,r);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,n,r){a();var i=o(n,r);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(e,t,n){var r="";if(e.e)r=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),r=t+i}else r=n,r+=e.u?e.u:"",r+=e.p;return r}function i(e){var t=0,n=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return dataManager.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function a(){this._imageLoaded=t.bind(this),this._footageLoaded=n.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=s.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return a.prototype={loadAssets:function(e,t){var n;this.imagesLoadedCb=t;var r=e.length;for(n=0;n<r;n+=1)e[n].layers||(e[n].t&&"seq"!==e[n].t?3===e[n].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[n]))):(this.totalImages+=1,this.images.push(this._createImageData(e[n]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,n=this.images.length;t<n;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var n=r(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var s={img:i,assetData:t};return s},createImageData:function(t){var n=r(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var s={img:i,assetData:t};return s},imageLoaded:t,footageLoaded:n,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},a}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var n=this._cbs[e],r=0;r<n.length;r+=1)n[r](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var n=0,r=this._cbs[e].length;n<r;)this._cbs[e][n]===t&&(this._cbs[e].splice(n,1),n-=1,r-=1),n+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};const markerParser=function(){function e(e){for(var t,n=e.split("\r\n"),r={},i=0,s=0;s<n.length;s+=1)2===(t=n[s].split(":")).length&&(r[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return r}return function(t){for(var n=[],r=0;r<t.length;r+=1){var i=t[r],s={time:i.tm,duration:i.dr};try{s.payload=JSON.parse(t[r].cm)}catch(a){try{s.payload=e(t[r].cm)}catch(o){s.payload={name:t[r].cm}}}n.push(s)}return n}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,n=this.compositions.length;t<n;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=(e,t)=>{renderers[e]=t};function getRenderer(e){return renderers[e]}const AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0)};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);const n=getRenderer(t);this.renderer=new n(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!=typeof t&&(t=JSON.parse(t));var n={wrapper:e,animationData:t},r=e.attributes;n.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",n.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:"canvas";var i=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";"false"===i?n.loop=!1:"true"===i?n.loop=!0:""!==i&&(n.loop=parseInt(i,10));var s=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:!r.getNamedItem("bm-autoplay")||r.getNamedItem("bm-autoplay").value;n.autoplay="false"!==s,n.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"","false"===(r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"")&&(n.prerender=!1),this.setParams(n)},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,n,r=this.animationData.layers,i=r.length,s=e.layers,a=s.length;for(n=0;n<a;n+=1)for(t=0;t<i;){if(r[t].id===s[n].id){r[t]=s[n];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var n=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(n,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,n=0;n<this.markers.length;n+=1)if((t=this.markers[n]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,n){if(!n||this.name===n){var r=Number(e);if(isNaN(r)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,n){if(!n||this.name===n){var r=Number(e);if(isNaN(r)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(r,t,n);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,n=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(n=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?n=e:this.currentRawFrame+this.firstFrame>t&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==n&&this.goToAndStop(n,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"==typeof e[0]){var n,r=e.length;for(n=0;n<r;n+=1)this.segments.push(e[n])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var n=e.p;-1!==n.indexOf("images/")&&(n=n.split("/")[1]),t=this.assetsPath+n}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,n=this.assets.length;t<n;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,n){try{this.renderer.getElementByPath(e).updateDocumentData(t,n)}catch(r){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};const animationManager=function(){var e={},t=[],n=0,r=0,i=0,s=!0,a=!1;function o(e){for(var n=0,i=e.target;n<r;)t[n].animation===i&&(t.splice(n,1),n-=1,r-=1,i.isPaused||h()),n+=1}function l(e,n){if(!e)return null;for(var i=0;i<r;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var s=new AnimationItem;return u(s,e),s.setData(e,n),s}function c(){i+=1,f()}function h(){i-=1}function u(e,n){e.addEventListener("destroy",o),e.addEventListener("_active",c),e.addEventListener("_idle",h),t.push({elem:n,animation:e}),r+=1}function d(e){var o,l=e-n;for(o=0;o<r;o+=1)t[o].animation.advanceTime(l);n=e,i&&!a?window.requestAnimationFrame(d):s=!0}function p(e){n=e,window.requestAnimationFrame(d)}function f(){!a&&i&&s&&(window.requestAnimationFrame(p),s=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return u(t,null),t.setParams(e),t},e.setSpeed=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setSpeed(e,n)},e.setDirection=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setDirection(e,n)},e.play=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.play(e)},e.pause=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.pause(e)},e.stop=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.stop(e)},e.togglePause=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.togglePause(e)},e.searchAnimations=function(e,t,n){var r,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),s=i.length;for(r=0;r<s;r+=1)n&&i[r].setAttribute("data-bm-type",n),l(i[r],e);if(t&&0===s){n||(n="svg");var a=document.getElementsByTagName("body")[0];a.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",n),a.appendChild(o),l(o,e)}},e.resize=function(){var e;for(e=0;e<r;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,n,i){var s;for(s=0;s<r;s+=1)t[s].animation.goToAndStop(e,n,i)},e.destroy=function(e){var n;for(n=r-1;n>=0;n-=1)t[n].animation.destroy(e)},e.freeze=function(){a=!0},e.unfreeze=function(){a=!1,f()},e.setVolume=function(e,n){var i;for(i=0;i<r;i+=1)t[i].animation.setVolume(e,n)},e.mute=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.mute(e)},e.unmute=function(e){var n;for(n=0;n<r;n+=1)t[n].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,n=t.length,r=[];for(e=0;e<n;e+=1)r.push(t[e].animation);return r},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,n,r,i,s){var a=s||("bez_"+e+"_"+n+"_"+r+"_"+i).replace(/\./g,"p");if(t[a])return t[a];var o=new h([e,n,r,i]);return t[a]=o,o}},t={};var n=11,r=1/(n-1),i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function o(e){return 3*e}function l(e,t,n){return((s(t,n)*e+a(t,n))*e+o(t))*e}function c(e,t,n){return 3*s(t,n)*e*e+2*a(t,n)*e+o(t)}function h(e){this._p=e,this._mSampleValues=i?new Float32Array(n):new Array(n),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(e){var t=this._p[0],n=this._p[1],r=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===n&&r===i?e:0===e?0:1===e?1:l(this._getTForX(e),n,i)},_precompute:function(){var e=this._p[0],t=this._p[1],n=this._p[2],r=this._p[3];this._precomputed=!0,e===t&&n===r||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<n;++i)this._mSampleValues[i]=l(i*r,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],s=this._mSampleValues,a=0,o=1,h=n-1;o!==h&&s[o]<=e;++o)a+=r;var u=a+(e-s[--o])/(s[o+1]-s[o])*r,d=c(u,t,i);return d>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var s=c(t,n,r);if(0===s)return t;t-=(l(t,n,r)-e)/s}return t}(e,u,t,i):0===d?u:function(e,t,n,r,i){var s,a,o=0;do{(s=l(a=t+(n-t)/2,r,i)-e)>0?n=a:t=a}while(Math.abs(s)>1e-7&&++o<10);return a}(e,a,a+r,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,n){var r=0,i=e,s=createSizedArray(i);return{newElement:function(){return r?s[r-=1]:t()},release:function(e){r===i&&(s=pooling.double(s),i*=2),n&&n(e),s[r]=e,r+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,n=e.lengths.length;for(t=0;t<n;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,n,r,i,s){var a=e*r+t*i+n*s-i*r-s*e-n*t;return a>-.001&&a<.001}var n=function(e,t,n,r){var i,s,a,o,l,c,h=getDefaultCurveSegments(),u=0,d=[],p=[],f=bezierLengthPool.newElement();for(a=n.length,i=0;i<h;i+=1){for(l=i/(h-1),c=0,s=0;s<a;s+=1)o=bmPow(1-l,3)*e[s]+3*bmPow(1-l,2)*l*n[s]+3*(1-l)*bmPow(l,2)*r[s]+bmPow(l,3)*t[s],d[s]=o,null!==p[s]&&(c+=bmPow(d[s]-p[s],2)),p[s]=d[s];c&&(u+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=u}return f.addedLength=u,f};function r(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var s,a=(s={},function(e,n,a,o){var l=(e[0]+"_"+e[1]+"_"+n[0]+"_"+n[1]+"_"+a[0]+"_"+a[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!s[l]){var c,h,u,d,p,f,m,g=getDefaultCurveSegments(),A=0,v=null;2===e.length&&(e[0]!==n[0]||e[1]!==n[1])&&t(e[0],e[1],n[0],n[1],e[0]+a[0],e[1]+a[1])&&t(e[0],e[1],n[0],n[1],n[0]+o[0],n[1]+o[1])&&(g=2);var y=new r(g);for(u=a.length,c=0;c<g;c+=1){for(m=createSizedArray(u),p=c/(g-1),f=0,h=0;h<u;h+=1)d=bmPow(1-p,3)*e[h]+3*bmPow(1-p,2)*p*(e[h]+a[h])+3*(1-p)*bmPow(p,2)*(n[h]+o[h])+bmPow(p,3)*n[h],m[h]=d,null!==v&&(f+=bmPow(m[h]-v[h],2));A+=f=bmSqrt(f),y.points[c]=new i(f,m),v=m}y.segmentLength=A,s[l]=y}return s[l]});function o(e,t){var n=t.percents,r=t.lengths,i=n.length,s=bmFloor((i-1)*e),a=e*t.addedLength,o=0;if(s===i-1||0===s||a===r[s])return n[s];for(var l=r[s]>a?-1:1,c=!0;c;)if(r[s]<=a&&r[s+1]>a?(o=(a-r[s])/(r[s+1]-r[s]),c=!1):s+=l,s<0||s>=i-1){if(s===i-1)return n[s];c=!1}return n[s]+(n[s+1]-n[s])*o}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,r=segmentsLengthPool.newElement(),i=e.c,s=e.v,a=e.o,o=e.i,l=e._length,c=r.lengths,h=0;for(t=0;t<l-1;t+=1)c[t]=n(s[t],s[t+1],a[t],o[t+1]),h+=c[t].addedLength;return i&&l&&(c[t]=n(s[t],s[0],a[t],o[0]),h+=c[t].addedLength),r.totalLength=h,r},getNewSegment:function(t,n,r,i,s,a,c){s<0?s=0:s>1&&(s=1);var h,u=o(s,c),d=o(a=a>1?1:a,c),p=t.length,f=1-u,m=1-d,g=f*f*f,A=u*f*f*3,v=u*u*f*3,y=u*u*u,x=f*f*m,b=u*f*m+f*u*m+f*f*d,E=u*u*m+f*u*d+u*f*d,_=u*u*d,S=f*m*m,w=u*m*m+f*d*m+f*m*d,M=u*d*m+f*d*d+u*m*d,C=u*d*d,T=m*m*m,I=d*m*m+m*d*m+m*m*d,B=d*d*m+m*d*d+d*m*d,R=d*d*d;for(h=0;h<p;h+=1)l[4*h]=e.round(1e3*(g*t[h]+A*r[h]+v*i[h]+y*n[h]))/1e3,l[4*h+1]=e.round(1e3*(x*t[h]+b*r[h]+E*i[h]+_*n[h]))/1e3,l[4*h+2]=e.round(1e3*(S*t[h]+w*r[h]+M*i[h]+C*n[h]))/1e3,l[4*h+3]=e.round(1e3*(T*t[h]+I*r[h]+B*i[h]+R*n[h]))/1e3;return l},getPointInSegment:function(t,n,r,i,s,a){var l=o(s,a),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*r[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*n[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*r[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*n[1]))/1e3]},buildBezierData:a,pointOnLine2D:t,pointOnLine3D:function(n,r,i,s,a,o,l,c,h){if(0===i&&0===o&&0===h)return t(n,r,s,a,l,c);var u,d=e.sqrt(e.pow(s-n,2)+e.pow(a-r,2)+e.pow(o-i,2)),p=e.sqrt(e.pow(l-n,2)+e.pow(c-r,2)+e.pow(h-i,2)),f=e.sqrt(e.pow(l-s,2)+e.pow(c-a,2)+e.pow(h-o,2));return(u=d>p?d>f?d-p-f:f-p-d:f>p?f-p-d:p-d-f)>-1e-4&&u<1e-4}}}const bez=bezFunction(),PropertyFactory=function(){var e=initialDefaultFrame,t=Math.abs;function n(e,t){var n,i=this.offsetTime;"multidimensional"===this.propType&&(n=createTypedArray("float32",this.pv.length));for(var s,a,o,l,c,h,u,d,p,f=t.lastIndex,m=f,g=this.keyframes.length-1,A=!0;A;){if(s=this.keyframes[m],a=this.keyframes[m+1],m===g-1&&e>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>e){f=m;break}m<g-1?m+=1:(f=0,A=!1)}o=this.keyframesMetadata[m]||{};var v,y,x,b,E,_,S,w,M,C,T=a.t-i,I=s.t-i;if(s.to){o.bezierData||(o.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var B=o.bezierData;if(e>=T||e<I){var R=e>=T?B.points.length-1:0;for(c=B.points[R].point.length,l=0;l<c;l+=1)n[l]=B.points[R].point[l]}else{o.__fnct?p=o.__fnct:(p=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,o.__fnct=p),h=p((e-I)/(T-I));var P,D=B.segmentLength*h,L=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastAddedLength:0;for(d=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastPoint:0,A=!0,u=B.points.length;A;){if(L+=B.points[d].partialLength,0===D||0===h||d===B.points.length-1){for(c=B.points[d].point.length,l=0;l<c;l+=1)n[l]=B.points[d].point[l];break}if(D>=L&&D<L+B.points[d+1].partialLength){for(P=(D-L)/B.points[d+1].partialLength,c=B.points[d].point.length,l=0;l<c;l+=1)n[l]=B.points[d].point[l]+(B.points[d+1].point[l]-B.points[d].point[l])*P;break}d<u-1?d+=1:A=!1}t._lastPoint=d,t._lastAddedLength=L-B.points[d].partialLength,t._lastKeyframeIndex=m}}else{var F,U,O,N,k;if(g=s.s.length,v=a.s||s.e,this.sh&&1!==s.h)if(e>=T)n[0]=v[0],n[1]=v[1],n[2]=v[2];else if(e<=I)n[0]=s.s[0],n[1]=s.s[1],n[2]=s.s[2];else{var G=r(s.s),z=r(v);y=n,x=function(e,t,n){var r,i,s,a,o,l=[],c=e[0],h=e[1],u=e[2],d=e[3],p=t[0],f=t[1],m=t[2],g=t[3];return(i=c*p+h*f+u*m+d*g)<0&&(i=-i,p=-p,f=-f,m=-m,g=-g),1-i>1e-6?(r=Math.acos(i),s=Math.sin(r),a=Math.sin((1-n)*r)/s,o=Math.sin(n*r)/s):(a=1-n,o=n),l[0]=a*c+o*p,l[1]=a*h+o*f,l[2]=a*u+o*m,l[3]=a*d+o*g,l}(G,z,(e-I)/(T-I)),b=x[0],E=x[1],_=x[2],S=x[3],w=Math.atan2(2*E*S-2*b*_,1-2*E*E-2*_*_),M=Math.asin(2*b*E+2*_*S),C=Math.atan2(2*b*S-2*E*_,1-2*b*b-2*_*_),y[0]=w/degToRads,y[1]=M/degToRads,y[2]=C/degToRads}else for(m=0;m<g;m+=1)1!==s.h&&(e>=T?h=1:e<I?h=0:(s.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[m]?p=o.__fnct[m]:(F=void 0===s.o.x[m]?s.o.x[0]:s.o.x[m],U=void 0===s.o.y[m]?s.o.y[0]:s.o.y[m],O=void 0===s.i.x[m]?s.i.x[0]:s.i.x[m],N=void 0===s.i.y[m]?s.i.y[0]:s.i.y[m],p=BezierFactory.getBezierEasing(F,U,O,N).get,o.__fnct[m]=p)):o.__fnct?p=o.__fnct:(F=s.o.x,U=s.o.y,O=s.i.x,N=s.i.y,p=BezierFactory.getBezierEasing(F,U,O,N).get,s.keyframeMetadata=p),h=p((e-I)/(T-I)))),v=a.s||s.e,k=1===s.h?s.s[m]:s.s[m]+(v[m]-s.s[m])*h,"multidimensional"===this.propType?n[m]=k:n=k}return t.lastIndex=f,n}function r(e){var t=e[0]*degToRads,n=e[1]*degToRads,r=e[2]*degToRads,i=Math.cos(t/2),s=Math.cos(n/2),a=Math.cos(r/2),o=Math.sin(t/2),l=Math.sin(n/2),c=Math.sin(r/2);return[o*l*a+i*s*c,o*s*a+i*l*c,i*l*a-o*s*c,i*s*a-o*l*c]}function i(){var t=this.comp.renderedFrame-this.offsetTime,n=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==e&&(this._caching.lastFrame>=r&&t>=r||this._caching.lastFrame<n&&t<n))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function s(e){var n;if("unidimensional"===this.propType)n=e*this.mult,t(this.v-n)>1e-5&&(this.v=n,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)n=e[r]*this.mult,t(this.v[r]-n)>1e-5&&(this.v[r]=n,this._mdf=!0),r+=1}function a(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)n=this.effectsSequence[e](n);this.setVValue(n),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(e,t,n,r){this.propType="unidimensional",this.mult=n||1,this.data=t,this.v=n?t.k*n:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=r,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.addEffect=o}function c(e,t,n,r){var i;this.propType="multidimensional",this.mult=n||1,this.data=t,this._mdf=!1,this.elem=e,this.container=r,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var l=t.k.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),this.vel=createTypedArray("float32",l),i=0;i<l;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=a,this.setVValue=s,this.addEffect=o}function h(t,r,l,c){this.propType="unidimensional",this.keyframes=r.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:e,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=r,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.v=e,this.pv=e,this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.interpolateValue=n,this.effectsSequence=[i.bind(this)],this.addEffect=o}function u(t,r,l,c){var h;this.propType="multidimensional";var u,d,p,f,m=r.k.length;for(h=0;h<m-1;h+=1)r.k[h].to&&r.k[h].s&&r.k[h+1]&&r.k[h+1].s&&(u=r.k[h].s,d=r.k[h+1].s,p=r.k[h].to,f=r.k[h].ti,(2===u.length&&(u[0]!==d[0]||u[1]!==d[1])&&bez.pointOnLine2D(u[0],u[1],d[0],d[1],u[0]+p[0],u[1]+p[1])&&bez.pointOnLine2D(u[0],u[1],d[0],d[1],d[0]+f[0],d[1]+f[1])||3===u.length&&(u[0]!==d[0]||u[1]!==d[1]||u[2]!==d[2])&&bez.pointOnLine3D(u[0],u[1],u[2],d[0],d[1],d[2],u[0]+p[0],u[1]+p[1],u[2]+p[2])&&bez.pointOnLine3D(u[0],u[1],u[2],d[0],d[1],d[2],d[0]+f[0],d[1]+f[1],d[2]+f[2]))&&(r.k[h].to=null,r.k[h].ti=null),u[0]===d[0]&&u[1]===d[1]&&0===p[0]&&0===p[1]&&0===f[0]&&0===f[1]&&(2===u.length||u[2]===d[2]&&0===p[2]&&0===f[2])&&(r.k[h].to=null,r.k[h].ti=null));this.effectsSequence=[i.bind(this)],this.data=r,this.keyframes=r.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.getValue=a,this.setVValue=s,this.interpolateValue=n,this.frameId=-1;var g=r.k[0].s.length;for(this.v=createTypedArray("float32",g),this.pv=createTypedArray("float32",g),h=0;h<g;h+=1)this.v[h]=e,this.pv[h]=e;this._caching={lastFrame:e,lastIndex:0,value:createTypedArray("float32",g)},this.addEffect=o}return{getProp:function(e,t,n,r,i){var s;if(t.k.length)if("number"==typeof t.k[0])s=new c(e,t,r,i);else switch(n){case 0:s=new h(e,t,r,i);break;case 1:s=new u(e,t,r,i)}else s=new l(e,t,r,i);return s.effectsSequence.length&&i.addDynamicProperty(s),s}}}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};const pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var n=0;n<t;)this.v[n]=pointPool.newElement(),this.o[n]=pointPool.newElement(),this.i[n]=pointPool.newElement(),n+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,n,r,i){var s;switch(this._length=Math.max(this._length,r+1),this._length>=this._maxLength&&this.doubleArrayLength(),n){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[]}(!s[r]||s[r]&&!i)&&(s[r]=pointPool.newElement()),s[r][0]=e,s[r][1]=t},ShapePath.prototype.setTripleAt=function(e,t,n,r,i,s,a,o){this.setXYAt(e,t,"v",a,o),this.setXYAt(n,r,"o",a,o),this.setXYAt(i,s,"i",a,o)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var s,a=this._length-1,o=this._length;for(s=i;s<o;s+=1)e.setTripleAt(t[a][0],t[a][1],r[a][0],r[a][1],n[a][0],n[a][1],s,!1),a-=1;return e};const shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,n=e._length;for(t=0;t<n;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,n=factory.newElement(),r=void 0===e._length?e.v.length:e._length;for(n.setLength(r),n.c=e.c,t=0;t<r;t+=1)n.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return n},factory);var factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};const shapeCollectionPool=(ob2={newShapeCollection:function(){return _length?pool[_length-=1]:new ShapeCollection},release:function(e){var t,n=e._length;for(t=0;t<n;t+=1)shapePool.release(e.shapes[t]);e._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=e,_length+=1}},_length=0,_maxLength=4,pool=createSizedArray(_maxLength),ob2);var ob2,_length,_maxLength,pool;const ShapePropertyFactory=function(){var e=-999999;function t(e,t,n){var r,i,s,a,o,l,c,h,u,d=n.lastIndex,p=this.keyframes;if(e<p[0].t-this.offsetTime)r=p[0].s[0],s=!0,d=0;else if(e>=p[p.length-1].t-this.offsetTime)r=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],s=!0;else{for(var f,m,g,A=d,v=p.length-1,y=!0;y&&(f=p[A],!((m=p[A+1]).t-this.offsetTime>e));)A<v-1?A+=1:y=!1;if(g=this.keyframesMetadata[A]||{},d=A,!(s=1===f.h)){if(e>=m.t-this.offsetTime)h=1;else if(e<f.t-this.offsetTime)h=0;else{var x;g.__fnct?x=g.__fnct:(x=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=x),h=x((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}r=f.s[0]}for(l=t._length,c=r.i[0].length,n.lastIndex=d,a=0;a<l;a+=1)for(o=0;o<c;o+=1)u=s?r.i[a][o]:r.i[a][o]+(i.i[a][o]-r.i[a][o])*h,t.i[a][o]=u,u=s?r.o[a][o]:r.o[a][o]+(i.o[a][o]-r.o[a][o])*h,t.o[a][o]=u,u=s?r.v[a][o]:r.v[a][o]+(i.v[a][o]-r.v[a][o])*h,t.v[a][o]=u}function n(){var t=this.comp.renderedFrame-this.offsetTime,n=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<n&&t<n||i>r&&t>r)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function r(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var n,r=e._length;for(n=0;n<r;n+=1)if(e.v[n][0]!==t.v[n][0]||e.v[n][1]!==t.v[n][1]||e.o[n][0]!==t.o[n][0]||e.o[n][1]!==t.o[n][1]||e.i[n][0]!==t.i[n][0]||e.i[n][1]!==t.i[n][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var n=this.effectsSequence.length;for(t=0;t<n;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function a(e,t,n){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===n?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=r,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[n.bind(this)]}a.prototype.interpolateShape=t,a.prototype.getValue=s,a.prototype.setVValue=i,a.prototype.addEffect=o,l.prototype.getValue=s,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=o;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],n=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=n-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=n,a.v[2][0]=t,a.v[2][1]=n+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=n,a.i[0][0]=s?t-r*e:t+r*e,a.i[0][1]=n-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=n-i*e,a.i[2][0]=s?t+r*e:t-r*e,a.i[2][1]=n+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=n+i*e,a.o[0][0]=s?t+r*e:t-r*e,a.o[0][1]=n-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=n+i*e,a.o[2][0]=s?t-r*e:t+r*e,a.o[2][1]=n+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=n-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),h=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,n,r,i=2*Math.floor(this.pt.v),s=2*Math.PI/i,a=!0,o=this.or.v,l=this.ir.v,c=this.os.v,h=this.is.v,u=2*Math.PI*o/(2*i),d=2*Math.PI*l/(2*i),p=-Math.PI/2;p+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){n=a?c:h,r=a?u:d;var m=(t=a?o:l)*Math.cos(p),g=t*Math.sin(p),A=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-A*r*n*f,g-v*r*n*f,m+A*r*n*f,g+v*r*n*f,e,!0),a=!a,p+=s*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),n=2*Math.PI/t,r=this.or.v,i=this.os.v,s=2*Math.PI*r/(4*t),a=.5*-Math.PI,o=3===this.data.d?-1:1;for(a+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=r*Math.cos(a),c=r*Math.sin(a),h=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),u=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-h*s*i*o,c-u*s*i*o,l+h*s*i*o,c+u*s*i*o,e,!0),a+=n*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),u=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],n=this.s.v[0]/2,r=this.s.v[1]/2,i=bmMin(n,r,this.r.v),s=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+n,t-r+i,e+n,t-r+i,e+n,t-r+s,0,!0),this.v.setTripleAt(e+n,t+r-i,e+n,t+r-s,e+n,t+r-i,1,!0),0!==i?(this.v.setTripleAt(e+n-i,t+r,e+n-i,t+r,e+n-s,t+r,2,!0),this.v.setTripleAt(e-n+i,t+r,e-n+s,t+r,e-n+i,t+r,3,!0),this.v.setTripleAt(e-n,t+r-i,e-n,t+r-i,e-n,t+r-s,4,!0),this.v.setTripleAt(e-n,t-r+i,e-n,t-r+s,e-n,t-r+i,5,!0),this.v.setTripleAt(e-n+i,t-r,e-n+i,t-r,e-n+s,t-r,6,!0),this.v.setTripleAt(e+n-i,t-r,e+n-s,t-r,e+n-i,t-r,7,!0)):(this.v.setTripleAt(e-n,t+r,e-n+s,t+r,e-n,t+r,2),this.v.setTripleAt(e-n,t-r,e-n,t-r+s,e-n,t-r,3))):(this.v.setTripleAt(e+n,t-r+i,e+n,t-r+s,e+n,t-r+i,0,!0),0!==i?(this.v.setTripleAt(e+n-i,t-r,e+n-i,t-r,e+n-s,t-r,1,!0),this.v.setTripleAt(e-n+i,t-r,e-n+s,t-r,e-n+i,t-r,2,!0),this.v.setTripleAt(e-n,t-r+i,e-n,t-r+i,e-n,t-r+s,3,!0),this.v.setTripleAt(e-n,t+r-i,e-n,t+r-s,e-n,t+r-i,4,!0),this.v.setTripleAt(e-n+i,t+r,e-n+i,t+r,e-n+s,t+r,5,!0),this.v.setTripleAt(e+n-i,t+r,e+n-s,t+r,e+n-i,t+r,6,!0),this.v.setTripleAt(e+n,t+r-i,e+n,t+r-i,e+n,t+r-s,7,!0)):(this.v.setTripleAt(e-n,t-r,e-n+s,t-r,e-n,t-r,1,!0),this.v.setTripleAt(e-n,t+r,e-n,t+r-s,e-n,t+r,2,!0),this.v.setTripleAt(e+n,t+r,e+n-s,t+r,e+n,t+r,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},extendPrototype([DynamicPropertyContainer],e),e}();var d={getShapeProp:function(e,t,n){var r;return 3===n||4===n?r=(3===n?t.pt:t.ks).k.length?new l(e,t,n):new a(e,t,n):5===n?r=new u(e,t):6===n?r=new c(e,t):7===n&&(r=new h(e,t)),r.k&&e.addDynamicProperty(r),r},getConstructorFunction:function(){return a},getKeyframedConstructorFunction:function(){return l}};return d}(),Matrix=function(){var e=Math.cos,t=Math.sin,n=Math.tan,r=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function a(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(1,0,0,0,0,r,-i,0,0,i,r,0,0,0,0,1)}function o(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,0,i,0,0,1,0,0,-i,0,r,0,0,0,0,1)}function l(n){if(0===n)return this;var r=e(n),i=t(n);return this._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function h(e,t){return this.shear(n(e),n(t))}function u(r,i){var s=e(i),a=t(i);return this._t(s,a,0,0,-a,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(r),1,0,0,0,0,1,0,0,0,0,1)._t(s,-a,0,0,a,s,0,0,0,0,1,0,0,0,0,1)}function d(e,t,n){return n||0===n||(n=1),1===e&&1===t&&1===n?this:this._t(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1)}function p(e,t,n,r,i,s,a,o,l,c,h,u,d,p,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=n,this.props[3]=r,this.props[4]=i,this.props[5]=s,this.props[6]=a,this.props[7]=o,this.props[8]=l,this.props[9]=c,this.props[10]=h,this.props[11]=u,this.props[12]=d,this.props[13]=p,this.props[14]=f,this.props[15]=m,this}function f(e,t,n){return n=n||0,0!==e||0!==t||0!==n?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1):this}function m(e,t,n,r,i,s,a,o,l,c,h,u,d,p,f,m){var g=this.props;if(1===e&&0===t&&0===n&&0===r&&0===i&&1===s&&0===a&&0===o&&0===l&&0===c&&1===h&&0===u)return g[12]=g[12]*e+g[15]*d,g[13]=g[13]*s+g[15]*p,g[14]=g[14]*h+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var A=g[0],v=g[1],y=g[2],x=g[3],b=g[4],E=g[5],_=g[6],S=g[7],w=g[8],M=g[9],C=g[10],T=g[11],I=g[12],B=g[13],R=g[14],P=g[15];return g[0]=A*e+v*i+y*l+x*d,g[1]=A*t+v*s+y*c+x*p,g[2]=A*n+v*a+y*h+x*f,g[3]=A*r+v*o+y*u+x*m,g[4]=b*e+E*i+_*l+S*d,g[5]=b*t+E*s+_*c+S*p,g[6]=b*n+E*a+_*h+S*f,g[7]=b*r+E*o+_*u+S*m,g[8]=w*e+M*i+C*l+T*d,g[9]=w*t+M*s+C*c+T*p,g[10]=w*n+M*a+C*h+T*f,g[11]=w*r+M*o+C*u+T*m,g[12]=I*e+B*i+R*l+P*d,g[13]=I*t+B*s+R*c+P*p,g[14]=I*n+B*a+R*h+P*f,g[15]=I*r+B*o+R*u+P*m,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function A(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function v(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function y(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function x(e,t,n){return{x:e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]}}function b(e,t,n){return e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12]}function E(e,t,n){return e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13]}function _(e,t,n){return e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]}function S(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,n=-this.props[1]/e,r=-this.props[4]/e,i=this.props[0]/e,s=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,o=new Matrix;return o.props[0]=t,o.props[1]=n,o.props[4]=r,o.props[5]=i,o.props[12]=s,o.props[13]=a,o}function w(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function M(e){var t,n=e.length,r=[];for(t=0;t<n;t+=1)r[t]=w(e[t]);return r}function C(e,t,n){var r=createTypedArray("float32",6);if(this.isIdentity())r[0]=e[0],r[1]=e[1],r[2]=t[0],r[3]=t[1],r[4]=n[0],r[5]=n[1];else{var i=this.props[0],s=this.props[1],a=this.props[4],o=this.props[5],l=this.props[12],c=this.props[13];r[0]=e[0]*i+e[1]*a+l,r[1]=e[0]*s+e[1]*o+c,r[2]=t[0]*i+t[1]*a+l,r[3]=t[0]*s+t[1]*o+c,r[4]=n[0]*i+n[1]*a+l,r[5]=n[0]*s+n[1]*o+c}return r}function T(e,t,n){return this.isIdentity()?[e,t,n]:[e*this.props[0]+t*this.props[4]+n*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+n*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+n*this.props[10]+this.props[14]]}function I(e,t){if(this.isIdentity())return e+","+t;var n=this.props;return Math.round(100*(e*n[0]+t*n[4]+n[12]))/100+","+Math.round(100*(e*n[1]+t*n[5]+n[13]))/100}function B(){for(var e=0,t=this.props,n="matrix3d(";e<16;)n+=r(1e4*t[e])/1e4,n+=15===e?")":",",e+=1;return n}function R(e){return e<1e-6&&e>0||e>-1e-6&&e<0?r(1e4*e)/1e4:e}function P(){var e=this.props;return"matrix("+R(e[0])+","+R(e[1])+","+R(e[4])+","+R(e[5])+","+R(e[12])+","+R(e[13])+")"}return function(){this.reset=i,this.rotate=s,this.rotateX=a,this.rotateY=o,this.rotateZ=l,this.skew=h,this.skewFromAxis=u,this.shear=c,this.scale=d,this.setTransform=p,this.translate=f,this.transform=m,this.applyToPoint=x,this.applyToX=b,this.applyToY=E,this.applyToZ=_,this.applyToPointArray=T,this.applyToTriplePoints=C,this.applyToPointStringified=I,this.toCSS=B,this.to2dCSS=P,this.clone=v,this.cloneFromProps=y,this.equals=A,this.inversePoints=M,this.inversePoint=w,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}(),lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),n=0;n<t.length;n+=1){var r=t[n].split("=");if(decodeURIComponent(r[0])==e)return decodeURIComponent(r[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="[[BM_VERSION]]";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{0}catch(err){}const ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,n){t[e]||(t[e]=n)},e.getModifier=function(e,n,r){return new t[e](n,r)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,n,r,i){var s=[];t<=1?s.push({s:e,e:t}):e>=1?s.push({s:e-1,e:t-1}):(s.push({s:e,e:1}),s.push({s:0,e:t-1}));var a,o,l=[],c=s.length;for(a=0;a<c;a+=1){var h,u;if(!((o=s[a]).e*i<r||o.s*i>r+n))h=o.s*i<=r?0:(o.s*i-r)/n,u=o.e*i>=r+n?1:(o.e*i-r)/n,l.push([h,u])}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t<n;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,n,r,i;if(this._mdf||e){var s=this.o.v%360/360;if(s<0&&(s+=1),(t=this.s.v>1?1+s:this.s.v<0?0+s:this.s.v+s)>(n=this.e.v>1?1+s:this.e.v<0?0+s:this.e.v+s)){var a=t;t=n,n=a}t=1e-4*Math.round(1e4*t),n=1e-4*Math.round(1e4*n),this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var o,l,c,h,u,d=this.shapes.length,p=0;if(n===t)for(i=0;i<d;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===n&&0===t||0===n&&1===t){if(this._mdf)for(i=0;i<d;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<d;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(r=f.shape.paths)._length,u=0,!f.shape._mdf&&f.pathsData.length)u=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),o=0;o<l;o+=1)h=bez.getSegmentsLength(r.shapes[o]),c.push(h),u+=h.totalLength;f.totalShapeLength=u,f.pathsData=c}p+=u,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var A,v=t,y=n,x=0;for(i=d-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&d>1?(A=this.calculateShapeEdges(t,n,f.totalShapeLength,x,p),x+=f.totalShapeLength):A=[[v,y]],l=A.length,o=0;o<l;o+=1){v=A[o][0],y=A[o][1],g.length=0,y<=1?g.push({s:f.totalShapeLength*v,e:f.totalShapeLength*y}):v>=1?g.push({s:f.totalShapeLength*(v-1),e:f.totalShapeLength*(y-1)}):(g.push({s:f.totalShapeLength*v,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(y-1)}));var b=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var E=b.pop();this.addPaths(b,m),b=this.addShapes(f,g[1],E)}else this.addPaths(b,m),b=this.addShapes(f,g[1]);this.addPaths(b,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)t.addShape(e[n])},TrimModifier.prototype.addSegment=function(e,t,n,r,i,s,a){i.setXYAt(t[0],t[1],"o",s),i.setXYAt(n[0],n[1],"i",s+1),a&&i.setXYAt(e[0],e[1],"v",s),i.setXYAt(r[0],r[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,n,r){t.setXYAt(e[1],e[5],"o",n),t.setXYAt(e[2],e[6],"i",n+1),r&&t.setXYAt(e[0],e[4],"v",n),t.setXYAt(e[3],e[7],"v",n+1)},TrimModifier.prototype.addShapes=function(e,t,n){var r,i,s,a,o,l,c,h,u=e.pathsData,d=e.shape.paths.shapes,p=e.shape.paths._length,f=0,m=[],g=!0;for(n?(o=n._length,h=n._length):(n=shapePool.newElement(),o=0,h=0),m.push(n),r=0;r<p;r+=1){for(l=u[r].lengths,n.c=d[r].c,s=d[r].c?l.length:l.length+1,i=1;i<s;i+=1)if(f+(a=l[i-1]).addedLength<t.s)f+=a.addedLength,n.c=!1;else{if(f>t.e){n.c=!1;break}t.s<=f&&t.e>=f+a.addedLength?(this.addSegment(d[r].v[i-1],d[r].o[i-1],d[r].i[i],d[r].v[i],n,o,g),g=!1):(c=bez.getNewSegment(d[r].v[i-1],d[r].v[i],d[r].o[i-1],d[r].i[i],(t.s-f)/a.addedLength,(t.e-f)/a.addedLength,l[i-1]),this.addSegmentFromArray(c,n,o,g),g=!1,n.c=!1),f+=a.addedLength,o+=1}if(d[r].c&&l.length){if(a=l[i-1],f<=t.e){var A=l[i-1].addedLength;t.s<=f&&t.e>=f+A?(this.addSegment(d[r].v[i-1],d[r].o[i-1],d[r].i[0],d[r].v[0],n,o,g),g=!1):(c=bez.getNewSegment(d[r].v[i-1],d[r].v[0],d[r].o[i-1],d[r].i[0],(t.s-f)/A,(t.e-f)/A,l[i-1]),this.addSegmentFromArray(c,n,o,g),g=!1,n.c=!1)}else n.c=!1;f+=a.addedLength,o+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],"i",h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],"o",n._length-1)),f>t.e)break;r<p-1&&(n=shapePool.newElement(),g=!0,m.push(n),o=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var n=t/100,r=[0,0],i=e._length,s=0;for(s=0;s<i;s+=1)r[0]+=e.v[s][0],r[1]+=e.v[s][1];r[0]/=i,r[1]/=i;var a,o,l,c,h,u,d=shapePool.newElement();for(d.c=e.c,s=0;s<i;s+=1)a=e.v[s][0]+(r[0]-e.v[s][0])*n,o=e.v[s][1]+(r[1]-e.v[s][1])*n,l=e.o[s][0]+(r[0]-e.o[s][0])*-n,c=e.o[s][1]+(r[1]-e.o[s][1])*-n,h=e.i[s][0]+(r[0]-e.i[s][0])*-n,u=e.i[s][1]+(r[1]-e.i[s][1])*-n,d.setTripleAt(a,o,l,c,h,u,s);return d},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,n,r,i,s,a,o=this.shapes.length,l=this.amount.v;if(0!==l)for(n=0;n<o;n+=1){if(a=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)a.addShape(this.processPath(t[r],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};const TransformPropertyFactory=function(){var e=[0,0];function t(e,t,n){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r<i;r+=1)t.or.k[r].to=null,t.or.k[r].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var n;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var r,i;if(n=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/n,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/n,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/n,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),i[0]=s.getValueAtTime(s.keyframes[0].t/n,0),i[1]=a.getValueAtTime(a.keyframes[0].t/n,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/n,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/n,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/n,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime))}else r=i=e;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,n,r){return new t(e,n,r)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],n="normal",r="normal",i=t.length,s=0;s<i;s+=1)switch(t[s].toLowerCase()){case"italic":r="italic";break;case"bold":n="700";break;case"black":n="900";break;case"medium":n="500";break;case"regular":case"normal":n="400";break;case"light":case"thin":n="200"}return{style:r,weight:e.fWeight||n}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,n,r,i,s){var a=s?-1:1,o=r.s.v[0]+(1-r.s.v[0])*(1-i),l=r.s.v[1]+(1-r.s.v[1])*(1-i);e.translate(r.p.v[0]*a*i,r.p.v[1]*a*i,r.p.v[2]),t.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),t.rotate(-r.r.v*a*i),t.translate(r.a.v[0],r.a.v[1],r.a.v[2]),n.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),n.scale(s?1/o:o,s?1/l:l),n.translate(r.a.v[0],r.a.v[1],r.a.v[2])},RepeaterModifier.prototype.init=function(e,t,n,r){for(this.elem=e,this.arr=t,this.pos=n,this.elemsData=r,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[n]);n>0;)n-=1,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var n,r=e.length;for(n=0;n<r;n+=1)e[n]._render=t,"gr"===e[n].ty&&this.changeGroupRender(e[n].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,n,r,i,s,a=!1;if(this._mdf||e){var o,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}for(s=0,r=0;r<=this._groups.length-1;r+=1){if(o=s<l,this._groups[r]._render=o,this.changeGroupRender(this._groups[r].it,o),!o){var h=this.elemsData[r].it,u=h[h.length-1];0!==u.transform.op.v?(u.transform.op._mdf=!0,u.transform.op.v=0):u.transform.op._mdf=!1}s+=1}this._currentCopies=l;var d=this.o.v,p=d%1,f=d>0?Math.floor(d):Math.ceil(d),m=this.pMatrix.props,g=this.rMatrix.props,A=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,y,x=0;if(d>0){for(;x<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),x+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),x+=p)}else if(d<0){for(;x>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),x-=p)}for(r=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,s=this._currentCopies;s;){if(y=(n=(t=this.elemsData[r].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==x){for((0!==r&&1===i||r!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<y;v+=1)n[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<y;v+=1)n[v]=this.matrix.props[v];x+=1,s-=1,r+=i}}else for(s=this._currentCopies,r=0,i=1;s;)n=(t=this.elemsData[r].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,s-=1,r+=i;return a},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var n,r=shapePool.newElement();r.c=e.c;var i,s,a,o,l,c,h,u,d,p,f,m,g=e._length,A=0;for(n=0;n<g;n+=1)i=e.v[n],a=e.o[n],s=e.i[n],i[0]===a[0]&&i[1]===a[1]&&i[0]===s[0]&&i[1]===s[1]?0!==n&&n!==g-1||e.c?(o=0===n?e.v[g-1]:e.v[n-1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=f=i[0]+(o[0]-i[0])*c,u=m=i[1]-(i[1]-o[1])*c,d=h-(h-i[0])*roundCorner,p=u-(u-i[1])*roundCorner,r.setTripleAt(h,u,d,p,f,m,A),A+=1,o=n===g-1?e.v[0]:e.v[n+1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=d=i[0]+(o[0]-i[0])*c,u=p=i[1]+(o[1]-i[1])*c,f=h-(h-i[0])*roundCorner,m=u-(u-i[1])*roundCorner,r.setTripleAt(h,u,d,p,f,m,A),A+=1):(r.setTripleAt(i[0],i[1],a[0],a[1],s[0],s[1],A),A+=1):(r.setTripleAt(e.v[n][0],e.v[n][1],e.o[n][0],e.o[n][1],e.i[n][0],e.i[n][1],A),A+=1);return r},RoundCornersModifier.prototype.processShapes=function(e){var t,n,r,i,s,a,o=this.shapes.length,l=this.rd.v;if(0!==l)for(n=0;n<o;n+=1){if(a=(s=this.shapes[n]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,r=0;r<i;r+=1)a.addShape(this.processPath(t[r],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};const FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var n=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"],r=[65039,8205];function i(e,t){var n=createTag("span");n.setAttribute("aria-hidden",!0),n.style.fontFamily=t;var r=createTag("span");r.innerText="giItT1WQy@!-/#",n.style.position="absolute",n.style.left="-10000px",n.style.top="-10000px",n.style.fontSize="300px",n.style.fontVariant="normal",n.style.fontStyle="normal",n.style.fontWeight="normal",n.style.letterSpacing="0",n.appendChild(r),document.body.appendChild(n);var i=r.offsetWidth;return r.style.fontFamily=function(e){var t,n=e.split(","),r=n.length,i=[];for(t=0;t<r;t+=1)"sans-serif"!==n[t]&&"monospace"!==n[t]&&i.push(n[t]);return i.join(",")}(e)+", "+t,{node:r,w:i,parent:n}}function s(e,t){var n,r=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===r){var s=createNS("text");s.style.fontSize="100px",s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),n=s}else{var a=new OffscreenCanvas(500,500).getContext("2d");a.font=i.style+" "+i.weight+" 100px "+e.fFamily,n=a}return{measureText:function(e){return"svg"===r?(n.textContent=e,n.getComputedTextLength()):n.measureText(e).width}}}var a=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return a.isModifier=function(e,t){var r=e.toString(16)+t.toString(16);return-1!==n.indexOf(r)},a.isZeroWidthJoiner=function(e,t){return t?e===r[0]&&t===r[1]:e===r[1]},a.isCombinedCharacter=function(e){return-1!==t.indexOf(e)},a.prototype={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var n,r,i=e.length,s=this.chars.length;for(t=0;t<i;t+=1){for(n=0,r=!1;n<s;)this.chars[n].style===e[t].style&&this.chars[n].fFamily===e[t].fFamily&&this.chars[n].ch===e[t].ch&&(r=!0),n+=1;r||(this.chars.push(e[t]),s+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((e=>{e.helper=s(e),e.cache={}})),void(this.fonts=e.list);var n,r=e.list,a=r.length,o=a;for(n=0;n<a;n+=1){var l,c,h=!0;if(r[n].loaded=!1,r[n].monoCase=i(r[n].fFamily,"monospace"),r[n].sansCase=i(r[n].fFamily,"sans-serif"),r[n].fPath){if("p"===r[n].fOrigin||3===r[n].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+r[n].fFamily+'"], style[f-origin="3"][f-family="'+r[n].fFamily+'"]')).length>0&&(h=!1),h){var u=createTag("style");u.setAttribute("f-forigin",r[n].fOrigin),u.setAttribute("f-origin",r[n].origin),u.setAttribute("f-family",r[n].fFamily),u.type="text/css",u.innerText="@font-face {font-family: "+r[n].fFamily+"; font-style: normal; src: url('"+r[n].fPath+"');}",t.appendChild(u)}}else if("g"===r[n].fOrigin||1===r[n].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(r[n].fPath)&&(h=!1);if(h){var d=createTag("link");d.setAttribute("f-forigin",r[n].fOrigin),d.setAttribute("f-origin",r[n].origin),d.type="text/css",d.rel="stylesheet",d.href=r[n].fPath,document.body.appendChild(d)}}else if("t"===r[n].fOrigin||2===r[n].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)r[n].fPath===l[c].src&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",r[n].fOrigin),p.setAttribute("f-origin",r[n].origin),p.setAttribute("rel","stylesheet"),p.setAttribute("href",r[n].fPath),t.appendChild(p)}}}else r[n].loaded=!0,o-=1;r[n].helper=s(r[n],t),r[n].cache={},this.fonts.push(r[n])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,n,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===n&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,n,r)),e},getFontByName:function(e){for(var t=0,n=this.fonts.length;t<n;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,n){var r=this.getFontByName(t),i=e.charCodeAt(0);if(!r.cache[i+1]){var s=r.helper;if(" "===e){var a=s.measureText("|"+e+"|"),o=s.measureText("||");r.cache[i+1]=(a-o)/100}else r.cache[i+1]=s.measureText(e)/100}return r.cache[i+1]*n},checkLoadedFonts:function(){var e,t,n,r=this.fonts.length,i=r;for(e=0;e<r;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,n=this.fonts[e].monoCase.w,t.offsetWidth!==n?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,n=this.fonts[e].sansCase.w,t.offsetWidth!==n&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},a}();function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};const MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(t){var n,r=createSizedArray(t.viewData.length),i=t.viewData.length;for(n=0;n<i;n+=1)r[n]=new e(t.viewData[n],t.masksProperties[n]);return function(e){for(n=0;n<i;){if(t.masksProperties[n].nm===e)return r[n];n+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function n(e,t,n){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(r){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[r-1]?t.keyframes[r-1].s:"e"in t.keyframes[r-2]?t.keyframes[r-2].e:t.keyframes[r-2].s;var s="unidimensional"===n?new Number(i):Object.assign({},i);return s.time=t.keyframes[r-1].t/t.elem.comp.globalData.frameRate,s.value="unidimensional"===n?i[0]:i,s},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function r(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var r=1/t.mult,i=t.pv*r,s=new Number(i);return s.value=i,n(s,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*r,s.value!==i&&((s=new Number(i)).value=i,n(s,t,"unidimensional")),s}}(i):function(e){e&&"pv"in e||(e=t);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,n(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(i):r}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var n,r,i,s;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?s=ExpressionPropertyInterface(e.p):(n=ExpressionPropertyInterface(e.px),r=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?s():[n(),r(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t);return t}function t(e,t){var n=this.getMatrix(t);return n.props[12]=0,n.props[13]=0,n.props[14]=0,this.applyPoint(n,e)}function n(e,t){var n=this.getMatrix(t);return this.applyPoint(n,e)}function r(e,t){var n=this.getMatrix(t);return n.props[12]=0,n.props[13]=0,n.props[14]=0,this.invertPoint(n,e)}function i(e,t){var n=this.getMatrix(t);return this.invertPoint(n,e)}function s(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function o(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var n,r=this._elem.hierarchy.length;for(n=0;n<r;n+=1)this._elem.hierarchy[n].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var h;function u(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return u.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return h;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return u.effect;case"ADBE Text Properties":return u.textInterface;default:return null}}u.getMatrix=e,u.invertPoint=a,u.applyPoint=s,u.toWorld=n,u.toWorldVec=t,u.fromWorld=i,u.fromWorldVec=r,u.toComp=n,u.fromComp=o,u.sampleImage=l,u.sourceRectAtTime=c.sourceRectAtTime.bind(c),u._elem=c;var d=getDescriptor(h=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(u,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(h,"rotation"),scale:getDescriptor(h,"scale"),position:getDescriptor(h,"position"),opacity:getDescriptor(h,"opacity"),anchorPoint:d,anchor_point:d,transform:{get:function(){return h}},active:{get:function(){return c.isInRange}}}),u.startTime=c.data.st,u.index=c.data.ind,u.source=c.data.refId,u.height=0===c.data.ty?c.data.h:100,u.width=0===c.data.ty?c.data.w:100,u.inPoint=c.data.ip/c.comp.globalData.frameRate,u.outPoint=c.data.op/c.comp.globalData.frameRate,u._name=c.data.nm,u.registerMaskInterface=function(e){u.mask=new MaskManagerInterface(e,c)},u.registerEffectsInterface=function(e){u.effect=e},u}}(),propertyGroupFactory=function(e,t){return function(n){return(n=void 0===n?1:n)<=0?e:t(n-1)}},PropertyInterface=function(e,t){var n={_name:e};return function(e){return(e=void 0===e?1:e)<=0?n:t(e-1)}},EffectsExpressionInterface=function(){function e(n,r,i,s){function a(e){for(var t=n.ef,r=0,i=t.length;r<i;){if(e===t[r].nm||e===t[r].mn||e===t[r].ix)return 5===t[r].ty?c[r]:c[r]();r+=1}throw new Error}var o,l=propertyGroupFactory(a,i),c=[],h=n.ef.length;for(o=0;o<h;o+=1)5===n.ef[o].ty?c.push(e(n.ef[o],r.effectElements[o],r.effectElements[o].propertyGroup,s)):c.push(t(r.effectElements[o],n.ef[o].ty,s,l));return"ADBE Color Control"===n.mn&&Object.defineProperty(a,"color",{get:function(){return c[0]()}}),Object.defineProperties(a,{numProperties:{get:function(){return n.np}},_name:{value:n.nm},propertyGroup:{value:l}}),a.enabled=0!==n.en,a.active=a.enabled,a}function t(e,t,n,r){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",r)),function(){return 10===t?n.comp.compInterface(e.p.v):i()}}return{createEffectsInterface:function(t,n){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(e(s[r],t.effectsManager.effectElements[r],n,t));var o=t.data.ef||[],l=function(e){for(r=0,a=o.length;r<a;){if(e===o[r].nm||e===o[r].mn||e===o[r].ix)return i[r];r+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return o.length}}),l}return null}}}(),CompExpressionInterface=function(e){function t(t){for(var n=0,r=e.layers.length;n<r;){if(e.layers[n].nm===t||e.layers[n].ind===t)return e.elements[n].layerInterface;n+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t},ShapePathInterface=function(e,t,n){var r=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var s=propertyGroupFactory(i,n);return r.setGroupProperty(PropertyInterface("Path",s)),Object.defineProperties(i,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:n}}),i},ShapeExpressionInterface=function(){function e(e,o,p){var f,m=[],g=e?e.length:0;for(f=0;f<g;f+=1)"gr"===e[f].ty?m.push(t(e[f],o[f],p)):"fl"===e[f].ty?m.push(n(e[f],o[f],p)):"st"===e[f].ty?m.push(s(e[f],o[f],p)):"tm"===e[f].ty?m.push(a(e[f],o[f],p)):"tr"===e[f].ty||("el"===e[f].ty?m.push(l(e[f],o[f],p)):"sr"===e[f].ty?m.push(c(e[f],o[f],p)):"sh"===e[f].ty?m.push(ShapePathInterface(e[f],o[f],p)):"rc"===e[f].ty?m.push(h(e[f],o[f],p)):"rd"===e[f].ty?m.push(u(e[f],o[f],p)):"rp"===e[f].ty?m.push(d(e[f],o[f],p)):"gf"===e[f].ty?m.push(r(e[f],o[f],p)):m.push(i(e[f],o[f])));return m}function t(t,n,r){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,n,r){var i,s=function(e){for(var t=0,n=i.length;t<n;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=e(t.it,n.it,s.propertyGroup),s.numProperties=i.length;var a=o(t.it[t.it.length-1],n.it[n.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,n,i.propertyGroup),a=o(t.it[t.it.length-1],n.it[n.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function n(e,t,n){function r(e){return"Color"===e||"color"===e?r.color:"Opacity"===e||"opacity"===e?r.opacity:null}return Object.defineProperties(r,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",n)),t.o.setGroupProperty(PropertyInterface("Opacity",n)),r}function r(e,t,n){function r(e){return"Start Point"===e||"start point"===e?r.startPoint:"End Point"===e||"end point"===e?r.endPoint:"Opacity"===e||"opacity"===e?r.opacity:null}return Object.defineProperties(r,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",n)),t.e.setGroupProperty(PropertyInterface("End Point",n)),t.o.setGroupProperty(PropertyInterface("Opacity",n)),r}function i(){return function(){return null}}function s(e,t,n){var r,i=propertyGroupFactory(c,n),s=propertyGroupFactory(l,i);var a,o=e.d?e.d.length:0,l={};for(r=0;r<o;r+=1)a=r,Object.defineProperty(l,e.d[a].nm,{get:ExpressionPropertyInterface(t.d.dataProps[a].p)}),t.d.dataProps[r].p.setGroupProperty(s);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function a(e,t,n){function r(t){return t===e.e.ix||"End"===t||"end"===t?r.end:t===e.s.ix?r.start:t===e.o.ix?r.offset:null}var i=propertyGroupFactory(r,n);return r.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),r.propertyIndex=e.ix,r.propertyGroup=n,Object.defineProperties(r,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),r.mn=e.mn,r}function o(e,t,n){function r(t){return e.a.ix===t||"Anchor Point"===t?r.anchorPoint:e.o.ix===t||"Opacity"===t?r.opacity:e.p.ix===t||"Position"===t?r.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?r.rotation:e.s.ix===t||"Scale"===t?r.scale:e.sk&&e.sk.ix===t||"Skew"===t?r.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?r.skewAxis:null}var i=propertyGroupFactory(r,n);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(r,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),r.ty="tr",r.mn=e.mn,r.propertyGroup=n,r}function l(e,t,n){function r(t){return e.p.ix===t?r.position:e.s.ix===t?r.size:null}var i=propertyGroupFactory(r,n);r.propertyIndex=e.ix;var s="tm"===t.sh.ty?t.sh.prop:t.sh;return s.s.setGroupProperty(PropertyInterface("Size",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(r,{size:{get:ExpressionPropertyInterface(s.s)},position:{get:ExpressionPropertyInterface(s.p)},_name:{value:e.nm}}),r.mn=e.mn,r}function c(e,t,n){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.rotation:e.pt.ix===t?r.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?r.outerRadius:e.os.ix===t?r.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?r.innerRoundness:null:r.innerRadius}var i=propertyGroupFactory(r,n),s="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,s.or.setGroupProperty(PropertyInterface("Outer Radius",i)),s.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),s.pt.setGroupProperty(PropertyInterface("Points",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(s.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),s.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(s.p)},rotation:{get:ExpressionPropertyInterface(s.r)},points:{get:ExpressionPropertyInterface(s.pt)},outerRadius:{get:ExpressionPropertyInterface(s.or)},outerRoundness:{get:ExpressionPropertyInterface(s.os)},innerRadius:{get:ExpressionPropertyInterface(s.ir)},innerRoundness:{get:ExpressionPropertyInterface(s.is)},_name:{value:e.nm}}),r.mn=e.mn,r}function h(e,t,n){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?r.size:null}var i=propertyGroupFactory(r,n),s="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,s.p.setGroupProperty(PropertyInterface("Position",i)),s.s.setGroupProperty(PropertyInterface("Size",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(s.p)},roundness:{get:ExpressionPropertyInterface(s.r)},size:{get:ExpressionPropertyInterface(s.s)},_name:{value:e.nm}}),r.mn=e.mn,r}function u(e,t,n){function r(t){return e.r.ix===t||"Round Corners 1"===t?r.radius:null}var i=propertyGroupFactory(r,n),s=t;return r.propertyIndex=e.ix,s.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(r,{radius:{get:ExpressionPropertyInterface(s.rd)},_name:{value:e.nm}}),r.mn=e.mn,r}function d(e,t,n){function r(t){return e.c.ix===t||"Copies"===t?r.copies:e.o.ix===t||"Offset"===t?r.offset:null}var i=propertyGroupFactory(r,n),s=t;return r.propertyIndex=e.ix,s.c.setGroupProperty(PropertyInterface("Copies",i)),s.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(r,{copies:{get:ExpressionPropertyInterface(s.c)},offset:{get:ExpressionPropertyInterface(s.o)},_name:{value:e.nm}}),r.mn=e.mn,r}return function(t,n,r){var i;function s(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?r:i[e-1];for(var t=0,n=i.length;t<n;){if(i[t]._name===e)return i[t];t+=1}return null}return s.propertyGroup=propertyGroupFactory(s,(function(){return r})),i=e(t,n,s.propertyGroup),s.numProperties=i.length,s._name="Contents",s}}(),TextExpressionInterface=function(e){var t,n;function r(e){return"ADBE Text Document"===e?r.sourceText:null}return Object.defineProperty(r,"sourceText",{get:function(){e.textProperty.getValue();var r=e.textProperty.currentData.t;return r!==t&&(e.textProperty.currentData.t=t,(n=new String(r)).value=r||new String(r)),n}}),r},getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""});var blendModeEnums;function SliderEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function AngleEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function ColorEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,1,0,n)}function PointEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,1,0,n)}function LayerIndexEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function MaskIndexEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function CheckboxEffect(e,t,n){this.p=PropertyFactory.getProp(t,e.v,0,0,n)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var n,r=e.ef||[];this.effectElements=[];var i,s=r.length;for(n=0;n<s;n+=1)i=new GroupEffect(r[n],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var n;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var r,i=this.data.ef.length,s=this.data.ef;for(n=0;n<i;n+=1){switch(r=null,s[n].ty){case 0:r=new SliderEffect(s[n],t,this);break;case 1:r=new AngleEffect(s[n],t,this);break;case 2:r=new ColorEffect(s[n],t,this);break;case 3:r=new PointEffect(s[n],t,this);break;case 4:case 7:r=new CheckboxEffect(s[n],t,this);break;case 10:r=new LayerIndexEffect(s[n],t,this);break;case 11:r=new MaskIndexEffect(s[n],t,this);break;case 5:r=new EffectsManager(s[n],t);break;default:r=new NoValueEffect(s[n])}r&&this.effectElements.push(r)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var e=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(e),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,n){this.globalData=t,this.comp=n,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var n,r=this.dynamicProperties.length;for(n=0;n<r;n+=1)(t||this._isParent&&"transform"===this.dynamicProperties[n].propType)&&(this.dynamicProperties[n].getValue(),this.dynamicProperties[n]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}};const FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",n=e.getFootageData();function r(e){if(n[e])return t=e,"object"==typeof(n=n[e])?r:n;var i=e.indexOf(t);if(-1!==i){var s=parseInt(e.substr(i+t.length),10);return"object"==typeof(n=n[s])?r:n}return""}return function(){return t="",n=e.getFootageData(),r}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t});var dataInterfaceFactory;function FootageElement(e,t,n){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,n)}function AudioElement(e,t,n){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,n),this._isPlaying=!1,this._canPlay=!1;var r=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(r),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}function TransformElement(){}function MaskElement(e,t,n){this.data=e,this.element=t,this.globalData=n,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var r,i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var o,l,c,h,u,d,p=this.masksProperties,f=0,m=[],g=createElementID(),A="clipPath",v="clip-path";for(r=0;r<a;r+=1)if(("a"!==p[r].mode&&"n"!==p[r].mode||p[r].inv||100!==p[r].o.k||p[r].o.x)&&(A="mask",v="mask"),"s"!==p[r].mode&&"i"!==p[r].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===p[r].mode)this.viewData[r]={op:PropertyFactory.getProp(this.element,p[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[r],3),elem:i,lastPath:""},s.appendChild(i);else{var y;if(f+=1,i.setAttribute("fill","s"===p[r].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==p[r].x.k?(A="mask",v="mask",d=PropertyFactory.getProp(this.element,p[r].x,0,null,this.element),y=createElementID(),(h=createNS("filter")).setAttribute("id",y),(u=createNS("feMorphology")).setAttribute("operator","erode"),u.setAttribute("in","SourceGraphic"),u.setAttribute("radius","0"),h.appendChild(u),s.appendChild(h),i.setAttribute("stroke","s"===p[r].mode?"#000000":"#ffffff")):(u=null,d=null),this.storedData[r]={elem:i,x:d,expan:u,lastPath:"",lastOperator:"",filterId:y,lastRadius:0},"i"===p[r].mode){l=m.length;var x=createNS("g");for(o=0;o<l;o+=1)x.appendChild(m[o]);var b=createNS("mask");b.setAttribute("mask-type","alpha"),b.setAttribute("id",g+"_"+f),b.appendChild(i),s.appendChild(b),x.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(x)}else m.push(i);p[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,p[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[r],3),invRect:c},this.viewData[r].prop.k||this.drawPath(p[r],this.viewData[r].prop.v,this.viewData[r])}for(this.maskElement=createNS(A),a=m.length,r=0;r<a;r+=1)this.maskElement.appendChild(m[r]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+g+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){this.layerInterface=FootageInterface(this)},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var n=this._volume*this._volumeMultiplier;this._previousVolume!==n&&(this._previousVolume=n,this.audio.volume(n))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,n,r=this.layers.length;for(this.completeLayers=!0,t=r-1;t>=0;t-=1)this.elements[t]||(n=this.layers[t]).ip-n.st<=e-this.layers[t].st&&n.op-n.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var n,r=e.length,i=this.layers.length;for(t=0;t<r;t+=1)for(n=0;n<i;){if(this.layers[n].id===e[t].id){this.layers[n]=e[t];break}n+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,n){for(var r=this.elements,i=this.layers,s=0,a=i.length;s<a;)i[s].ind==t&&(r[s]&&!0!==r[s]?(n.push(r[s]),r[s].setAsParent(),void 0!==i[s].parent?this.buildElementParenting(e,i[s].parent,n):e.setHierarchy(n)):(this.buildItem(s),this.addPendingElement(e))),s+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,n=e.length;for(t=0;t<n;t+=1)if(e[t].xt){var r=this.createComp(e[t]);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},BaseRenderer.prototype.getElementByPath=function(e){var t,n=e.shift();if("number"==typeof n)t=this.elements[n];else{var r,i=this.elements.length;for(r=0;r<i;r+=1)if(this.elements[r].data.nm===n){t=this.elements[r];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,n=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;n<r;){if(this.hierarchy[n].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}n+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),n=0;n<r;n+=1)e=this.hierarchy[n].finalTransform.mProp.v.props,t.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var n,r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,a=t.length;for(n=0;n<a;n+=1)s=t[n].mat.applyToPointArray(0,0,0),e=[e[0]-s[0],e[1]-s[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,n=this.element.finalTransform.mat,r=this.masksProperties.length;for(t=0;t<r;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",n.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,n){var r,i,s=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,r=1;r<i;r+=1)s+=" C"+t.o[r-1][0]+","+t.o[r-1][1]+" "+t.i[r][0]+","+t.i[r][1]+" "+t.v[r][0]+","+t.v[r][1];if(t.c&&i>1&&(s+=" C"+t.o[r-1][0]+","+t.o[r-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),n.lastPath!==s){var a="";n.elem&&(t.c&&(a=e.inv?this.solidPath+s:s),n.elem.setAttribute("d",a)),n.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};const filtersFactory=function(){var e={};return e.createFilter=function(e,t){var n=createNS("filter");n.setAttribute("id",e),!0!==t&&(n.setAttribute("filterUnits","objectBoundingBox"),n.setAttribute("x","0%"),n.setAttribute("y","0%"),n.setAttribute("width","100%"),n.setAttribute("height","100%"));return n},e.createAlphaToLuminanceFilter=function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e},e}(),featureSupport=function(){var e={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),e}();var registeredEffects={},idPrefix="filter_result_";function SVGEffects(e){var t,n,r="SourceGraphic",i=e.data.ef?e.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s,!0),o=0;for(this.filters=[],t=0;t<i;t+=1){n=null;var l=e.data.ef[t].ty;if(registeredEffects[l])n=new(0,registeredEffects[l].effect)(a,e.effectsManager.effectElements[t],e,idPrefix+o,r),r=idPrefix+o,registeredEffects[l].countsAsEffect&&(o+=1);n&&this.filters.push(n)}o&&(e.globalData.defs.appendChild(a),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+s+")")),this.filters.length&&e.addRenderableComponent(this)}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,n){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,n),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,n=this.filters.length;for(t=0;t<n;t+=1)this.filters[t].renderFrame(e)},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e,t,n,r=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var i=createNS("mask");i.setAttribute("id",this.layerId),i.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),i.appendChild(this.layerElement),r=i,this.globalData.defs.appendChild(i),featureSupport.maskType||1!=this.data.td||(i.setAttribute("mask-type","luminance"),e=createElementID(),t=filtersFactory.createFilter(e),this.globalData.defs.appendChild(t),t.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(n=createNS("g")).appendChild(this.layerElement),r=n,i.appendChild(n),n.setAttribute("filter","url("+getLocationHref()+"#"+e+")"))}else if(2==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type","alpha");var a=createNS("g");s.appendChild(a),e=createElementID(),t=filtersFactory.createFilter(e);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),t.appendChild(o);var l=createNS("feFuncA");l.setAttribute("type","table"),l.setAttribute("tableValues","1.0 0.0"),o.appendChild(l),this.globalData.defs.appendChild(t);var c=createNS("rect");c.setAttribute("width",this.comp.data.w),c.setAttribute("height",this.comp.data.h),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("fill","#ffffff"),c.setAttribute("opacity","0"),a.setAttribute("filter","url("+getLocationHref()+"#"+e+")"),a.appendChild(c),a.appendChild(this.layerElement),r=a,featureSupport.maskType||(s.setAttribute("mask-type","luminance"),t.appendChild(filtersFactory.createAlphaToLuminanceFilter()),n=createNS("g"),a.appendChild(c),n.appendChild(this.layerElement),r=n,a.appendChild(n)),this.globalData.defs.appendChild(s)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),r=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var h=createNS("clipPath"),u=createNS("path");u.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var d=createElementID();if(h.setAttribute("id",d),h.appendChild(u),this.globalData.defs.appendChild(h),this.checkMasks()){var p=createNS("g");p.setAttribute("clip-path","url("+getLocationHref()+"#"+d+")"),p.appendChild(this.layerElement),this.transformedElement=p,r?r.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+d+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initTransform(e,t,n),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,n=this.shapeModifiers.length;for(t=0;t<n;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n<r;){if(t[n].elem===e)return t[n].pos;n+=1}return 0},addProcessedElement:function(e,t){for(var n=this.processedElements,r=n.length;r;)if(n[r-=1].elem===e)return void(n[r].pos=t);n.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};const lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,n){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=n,this.lvl=t,this._isAnimated=!!n.k;for(var r=0,i=e.length;r<i;){if(e[r].mProps.dynamicProperties.length){this._isAnimated=!0;break}r+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,n,r){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=n,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(r);var s,a=t.length||0;for(i=0;i<a;i+=1)s=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=s.k||this.k,this.dataProps[i]={n:t[i].n,p:s};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=n,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=n}function SVGNoStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=n}function GradientProperty(e,t,n){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var r=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",r),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=r,this.initDynamicPropertyContainer(n),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,n)}function SVGGradientStrokeStyleData(e,t,n){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,n),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,n){this.transform={mProps:e,op:t,container:n},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,n=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<n;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var n=0,r=this.o.length/2;n<r;){if(Math.abs(e[4*n]-e[4*t+2*n])>.01)return!1;n+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,n,r,i=4*this.data.p;for(t=0;t<i;t+=1)n=t%4==0?100:255,r=Math.round(this.prop.v[t]*n),this.c[t]!==r&&(this.c[t]=r,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)n=t%2==0?100:1,r=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==r&&(this.o[t-4*this.data.p]=r,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,n){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=n,this.stops=[],this.setGradientData(n.pElem,t),this.setGradientOpacity(t,n),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var n=createElementID(),r=createNS(1===t.t?"linearGradient":"radialGradient");r.setAttribute("id",n),r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");var i,s,a,o=[];for(a=4*t.g.p,s=0;s<a;s+=4)i=createNS("stop"),r.appendChild(i),o.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+n+")"),this.gf=r,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var n,r,i,s=createNS("mask"),a=createNS("path");s.appendChild(a);var o=createElementID(),l=createElementID();s.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var h=this.stops;for(r=4*e.g.p;r<i;r+=2)(n=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(n),h.push(n);a.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),"gs"===e.ty&&(a.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),a.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&a.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=s,this.ost=h,this.maskId=l,t.msElem=a}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);const buildShapeString=function(e,t,n,r){if(0===t)return"";var i,s=e.o,a=e.i,o=e.v,l=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(i=1;i<t;i+=1)l+=" C"+r.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+r.applyToPointStringified(a[i][0],a[i][1])+" "+r.applyToPointStringified(o[i][0],o[i][1]);return n&&t&&(l+=" C"+r.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+r.applyToPointStringified(a[0][0],a[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix;function n(e,t,n){(n||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(n||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function r(){}function i(n,r,i){var s,a,o,l,c,h,u,d,p,f,m,g=r.styles.length,A=r.lvl;for(h=0;h<g;h+=1){if(l=r.sh._mdf||i,r.styles[h].lvl<A){for(d=t.reset(),f=A-r.styles[h].lvl,m=r.transformers.length-1;!l&&f>0;)l=r.transformers[m].mProps._mdf||l,f-=1,m-=1;if(l)for(f=A-r.styles[h].lvl,m=r.transformers.length-1;f>0;)p=r.transformers[m].mProps.v.props,d.transform(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]),f-=1,m-=1}else d=e;if(a=(u=r.sh.paths)._length,l){for(o="",s=0;s<a;s+=1)(c=u.shapes[s])&&c._length&&(o+=buildShapeString(c,c._length,c.c,d));r.caches[h]=o}else o=r.caches[h];r.styles[h].d+=!0===n.hd?"":o,r.styles[h]._mdf=l||r.styles[h]._mdf}}function s(e,t,n){var r=t.style;(t.c._mdf||n)&&r.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n)&&r.pElem.setAttribute("fill-opacity",t.o.v)}function a(e,t,n){o(e,t,n),l(e,t,n)}function o(e,t,n){var r,i,s,a,o,l=t.gf,c=t.g._hasOpacity,h=t.s.v,u=t.e.v;if(t.o._mdf||n){var d="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(d,t.o.v)}if(t.s._mdf||n){var p=1===e.t?"x1":"cx",f="x1"===p?"y1":"cy";l.setAttribute(p,h[0]),l.setAttribute(f,h[1]),c&&!t.g._collapsable&&(t.of.setAttribute(p,h[0]),t.of.setAttribute(f,h[1]))}if(t.g._cmdf||n){r=t.cst;var m=t.g.c;for(s=r.length,i=0;i<s;i+=1)(a=r[i]).setAttribute("offset",m[4*i]+"%"),a.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||n)){var g=t.g.o;for(s=(r=t.g._collapsable?t.cst:t.ost).length,i=0;i<s;i+=1)a=r[i],t.g._collapsable||a.setAttribute("offset",g[2*i]+"%"),a.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||n)&&(l.setAttribute("x2",u[0]),l.setAttribute("y2",u[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",u[0]),t.of.setAttribute("y2",u[1])));else if((t.s._mdf||t.e._mdf||n)&&(o=Math.sqrt(Math.pow(h[0]-u[0],2)+Math.pow(h[1]-u[1],2)),l.setAttribute("r",o),c&&!t.g._collapsable&&t.of.setAttribute("r",o)),t.e._mdf||t.h._mdf||t.a._mdf||n){o||(o=Math.sqrt(Math.pow(h[0]-u[0],2)+Math.pow(h[1]-u[1],2)));var A=Math.atan2(u[1]-h[1],u[0]-h[0]),v=t.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var y=o*v,x=Math.cos(A+t.a.v)*y+h[0],b=Math.sin(A+t.a.v)*y+h[1];l.setAttribute("fx",x),l.setAttribute("fy",b),c&&!t.g._collapsable&&(t.of.setAttribute("fx",x),t.of.setAttribute("fy",b))}}function l(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute("stroke-dasharray",i.dashStr),r.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n)&&r.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute("stroke-width",t.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return s;case"gf":return o;case"gs":return a;case"st":return l;case"sh":case"el":case"rc":case"sr":return i;case"tr":return n;case"no":return r;default:return null}}}}();function SVGShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}function LetterProps(e,t,n,r,i,s){this.o=e,this.sw=t,this.sc=n,this.fc=r,this.m=i,this.p=s,this._mdf={o:!0,sw:!!t,sc:!!n,fc:!!r,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,n,r,i=this.shapes.length,s=this.stylesList.length,a=[],o=!1;for(n=0;n<s;n+=1){for(r=this.stylesList[n],o=!1,a.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(r)&&(a.push(t),o=t._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var n,r=new SVGStyleData(e,t),i=r.pElem;if("st"===e.ty)n=new SVGStrokeStyleData(this,e,r);else if("fl"===e.ty)n=new SVGFillStyleData(this,e,r);else if("gf"===e.ty||"gs"===e.ty){n=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,r),this.globalData.defs.appendChild(n.gf),n.maskId&&(this.globalData.defs.appendChild(n.ms),this.globalData.defs.appendChild(n.of),i.setAttribute("mask","url("+getLocationHref()+"#"+n.maskId+")"))}else"no"===e.ty&&(n=new SVGNoStyleData(this,e,r));return"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(r),this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var n=TransformPropertyFactory.getTransformProperty(this,e,this),r=new SVGTransformData(n,n.o,t);return this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createShapeElement=function(e,t,n){var r=4;"rc"===e.ty?r=5:"el"===e.ty?r=6:"sr"===e.ty&&(r=7);var i=new SVGShapeData(t,n,ShapePropertyFactory.getShapeProp(this,e,r,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var n=0,r=this.animatedContents.length;n<r;){if(this.animatedContents[n].element===t)return;n+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,n=e.styles,r=this.stylesList.length;for(t=0;t<r;t+=1)this.stylesList[t].closed||n.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,n,r,i,s,a){var o,l,c,h,u,d,p=[].concat(s),f=e.length-1,m=[],g=[];for(o=f;o>=0;o-=1){if((d=this.searchProcessedElement(e[o]))?t[o]=n[d-1]:e[o]._render=a,"fl"===e[o].ty||"st"===e[o].ty||"gf"===e[o].ty||"gs"===e[o].ty||"no"===e[o].ty)d?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],i),e[o]._render&&t[o].style.pElem.parentNode!==r&&r.appendChild(t[o].style.pElem),m.push(t[o].style);else if("gr"===e[o].ty){if(d)for(c=t[o].it.length,l=0;l<c;l+=1)t[o].prevViewData[l]=t[o].it[l];else t[o]=this.createGroupElement(e[o]);this.searchShapes(e[o].it,t[o].it,t[o].prevViewData,t[o].gr,i+1,p,a),e[o]._render&&t[o].gr.parentNode!==r&&r.appendChild(t[o].gr)}else"tr"===e[o].ty?(d||(t[o]=this.createTransformElement(e[o],r)),h=t[o].transform,p.push(h)):"sh"===e[o].ty||"rc"===e[o].ty||"el"===e[o].ty||"sr"===e[o].ty?(d||(t[o]=this.createShapeElement(e[o],p,i)),this.setElementStyles(t[o])):"tm"===e[o].ty||"rd"===e[o].ty||"ms"===e[o].ty||"pb"===e[o].ty?(d?(u=t[o]).closed=!1:((u=ShapeModifiers.getModifier(e[o].ty)).init(this,e[o]),t[o]=u,this.shapeModifiers.push(u)),g.push(u)):"rp"===e[o].ty&&(d?(u=t[o]).closed=!0:(u=ShapeModifiers.getModifier(e[o].ty),t[o]=u,u.init(this,e,o,t),this.shapeModifiers.push(u),a=!1),g.push(u));this.addProcessedElement(e[o],o+1)}for(f=m.length,o=0;o<f;o+=1)m[o].closed=!0;for(f=g.length,o=0;o<f;o+=1)g[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,n=this.animatedContents.length;for(e=0;e<n;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,n,r,i,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,a=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,a=!0),this.sc!==n&&(this.sc=n,this._mdf.sc=!0,a=!0),this.fc!==r&&(this.fc=r,this._mdf.fc=!0,a=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,a=!0),!s.length||this.p[0]===s[0]&&this.p[1]===s[1]&&this.p[4]===s[4]&&this.p[5]===s[5]&&this.p[12]===s[12]&&this.p[13]===s[13]||(this.p=s,this._mdf.p=!0,a=!0),a},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var r;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,s=e||this.data.d.k[this.keysIndex].s;for(r=0;r<i;r+=1)s=n!==this.keysIndex?this.effectsSequence[r](s,s.t):this.effectsSequence[r](this.currentData,s.t);t!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,n=0,r=e.length;n<=r-1&&!(n===r-1||e[n+1].t>t);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,n,r=[],i=0,s=e.length,a=!1;i<s;)t=e.charCodeAt(i),FontManager.isCombinedCharacter(t)?r[r.length-1]+=e.charAt(i):t>=55296&&t<=56319?(n=e.charCodeAt(i+1))>=56320&&n<=57343?(a||FontManager.isModifier(t,n)?(r[r.length-1]+=e.substr(i,2),a=!1):r.push(e.substr(i,2)),i+=1):r.push(e.charAt(i)):t>56319?(n=e.charCodeAt(i+1),FontManager.isZeroWidthJoiner(t,n)?(a=!0,r[r.length-1]+=e.substr(i,2),i+=1):r.push(e.charAt(i))):FontManager.isZeroWidthJoiner(t)?(r[r.length-1]+=e.charAt(i),a=!0):r.push(e.charAt(i)),i+=1;return r},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,n,r,i,s,a,o,l=this.elem.globalData.fontManager,c=this.data,h=[],u=0,d=c.m.g,p=0,f=0,m=0,g=[],A=0,v=0,y=l.getFontByName(e.f),x=0,b=getFontProperties(y);e.fWeight=b.weight,e.fStyle=b.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),n=e.finalText.length,e.finalLineHeight=e.lh;var E,_=e.tr/1e3*e.finalSize;if(e.sz)for(var S,w,M=!0,C=e.sz[0],T=e.sz[1];M;){S=0,A=0,n=(w=this.buildFinalText(e.t)).length,_=e.tr/1e3*e.finalSize;var I=-1;for(t=0;t<n;t+=1)E=w[t].charCodeAt(0),r=!1," "===w[t]?I=t:13!==E&&3!==E||(A=0,r=!0,S+=e.finalLineHeight||1.2*e.finalSize),l.chars?(o=l.getCharData(w[t],y.fStyle,y.fFamily),x=r?0:o.w*e.finalSize/100):x=l.measureText(w[t],e.f,e.finalSize),A+x>C&&" "!==w[t]?(-1===I?n+=1:t=I,S+=e.finalLineHeight||1.2*e.finalSize,w.splice(t,I===t?1:0,"\r"),I=-1,A=0):(A+=x,A+=_);S+=y.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&T<S?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=w,n=e.finalText.length,M=!1)}A=-_,x=0;var B,R=0;for(t=0;t<n;t+=1)if(r=!1,13===(E=(B=e.finalText[t]).charCodeAt(0))||3===E?(R=0,g.push(A),v=A>v?A:v,A=-2*_,i="",r=!0,m+=1):i=B,l.chars?(o=l.getCharData(B,y.fStyle,l.getFontByName(e.f).fFamily),x=r?0:o.w*e.finalSize/100):x=l.measureText(i,e.f,e.finalSize)," "===B?R+=x+_:(A+=x+_+R,R=0),h.push({l:x,an:x,add:p,n:r,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==d){if(p+=x,""===i||" "===i||t===n-1){for(""!==i&&" "!==i||(p-=x);f<=t;)h[f].an=p,h[f].ind=u,h[f].extra=x,f+=1;u+=1,p=0}}else if(3==d){if(p+=x,""===i||t===n-1){for(""===i&&(p-=x);f<=t;)h[f].an=p,h[f].ind=u,h[f].extra=x,f+=1;p=0,u+=1}}else h[u].ind=u,h[u].extra=0,u+=1;if(e.l=h,v=A>v?A:v,g.push(A),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=v,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var P,D,L,F,U=c.a;a=U.length;var O=[];for(s=0;s<a;s+=1){for((P=U[s]).a.sc&&(e.strokeColorAnim=!0),P.a.sw&&(e.strokeWidthAnim=!0),(P.a.fc||P.a.fh||P.a.fs||P.a.fb)&&(e.fillColorAnim=!0),F=0,L=P.s.b,t=0;t<n;t+=1)(D=h[t]).anIndexes[s]=F,(1==L&&""!==D.val||2==L&&""!==D.val&&" "!==D.val||3==L&&(D.n||" "==D.val||t==n-1)||4==L&&(D.n||t==n-1))&&(1===P.s.rn&&O.push(F),F+=1);c.a[s].s.totalChars=F;var N,k=-1;if(1===P.s.rn)for(t=0;t<n;t+=1)k!=(D=h[t]).anIndexes[s]&&(k=D.anIndexes[s],N=O.splice(Math.floor(Math.random()*O.length),1)[0]),D.anIndexes[s]=N}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=y.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var n=this.copyData({},this.data.d.k[t].s);n=this.copyData(n,e),this.data.d.k[t].s=n,this.recalculate(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};const TextSelectorProp=function(){var e=Math.max,t=Math.min,n=Math.floor;function r(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return r.prototype={getMult:function(r){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,s=0,a=1,o=1;this.ne.v>0?i=this.ne.v/100:s=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,s,a,o).get,c=0,h=this.finalS,u=this.finalE,d=this.data.sh;if(2===d)c=l(c=u===h?r>=u?1:0:e(0,t(.5/(u-h)+(r-h)/(u-h),1)));else if(3===d)c=l(c=u===h?r>=u?0:1:1-e(0,t(.5/(u-h)+(r-h)/(u-h),1)));else if(4===d)u===h?c=0:(c=e(0,t(.5/(u-h)+(r-h)/(u-h),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===d){if(u===h)c=0;else{var p=u-h,f=-p/2+(r=t(e(0,r+.5-h),u-h)),m=p/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===d?(u===h?c=0:(r=t(e(0,r+.5-h),u-h),c=(1+Math.cos(Math.PI+2*Math.PI*r/(u-h)))/2),c=l(c)):(r>=n(h)&&(c=e(0,t(r-h<0?t(u,1)-(h-r):u-r,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var A=.5-.5*g;c<A?c=0:(c=(c-A)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var s=r;r=i,i=s}this.finalS=r,this.finalE=i}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(e,t,n){return new r(e,t)}}}();function TextAnimatorDataProperty(e,t,n){var r={propType:!1},i=PropertyFactory.getProp,s=t.a;this.a={r:s.r?i(e,s.r,0,degToRads,n):r,rx:s.rx?i(e,s.rx,0,degToRads,n):r,ry:s.ry?i(e,s.ry,0,degToRads,n):r,sk:s.sk?i(e,s.sk,0,degToRads,n):r,sa:s.sa?i(e,s.sa,0,degToRads,n):r,s:s.s?i(e,s.s,1,.01,n):r,a:s.a?i(e,s.a,1,0,n):r,o:s.o?i(e,s.o,0,.01,n):r,p:s.p?i(e,s.p,1,0,n):r,sw:s.sw?i(e,s.sw,0,0,n):r,sc:s.sc?i(e,s.sc,1,0,n):r,fc:s.fc?i(e,s.fc,1,0,n):r,fh:s.fh?i(e,s.fh,0,0,n):r,fs:s.fs?i(e,s.fs,0,.01,n):r,fb:s.fb?i(e,s.fb,0,.01,n):r,t:s.t?i(e,s.t,0,0,n):r},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function TextAnimatorProperty(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,n=this._textData.a.length,r=PropertyFactory.getProp;for(e=0;e<n;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:r(this._elem,this._textData.p.a,0,0,this),f:r(this._elem,this._textData.p.f,0,0,this),l:r(this._elem,this._textData.p.l,0,0,this),r:r(this._elem,this._textData.p.r,0,0,this),p:r(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=r(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var n,r,i,s,a,o,l,c,h,u,d,p,f,m,g,A,v,y,x,b=this._moreOptions.alignment.v,E=this._animatorsData,_=this._textData,S=this.mHelper,w=this._renderType,M=this.renderedLetters.length,C=e.l;if(this._hasMaskedPath){if(x=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T,I=x.v;for(this._pathData.r.v&&(I=I.reverse()),a={tLength:0,segments:[]},s=I._length-1,A=0,i=0;i<s;i+=1)T=bez.buildBezierData(I.v[i],I.v[i+1],[I.o[i][0]-I.v[i][0],I.o[i][1]-I.v[i][1]],[I.i[i+1][0]-I.v[i+1][0],I.i[i+1][1]-I.v[i+1][1]]),a.tLength+=T.segmentLength,a.segments.push(T),A+=T.segmentLength;i=s,x.v.c&&(T=bez.buildBezierData(I.v[i],I.v[0],[I.o[i][0]-I.v[i][0],I.o[i][1]-I.v[i][1]],[I.i[0][0]-I.v[0][0],I.i[0][1]-I.v[0][1]]),a.tLength+=T.segmentLength,a.segments.push(T),A+=T.segmentLength),this._pathData.pi=a}if(a=this._pathData.pi,o=this._pathData.f.v,d=0,u=1,c=0,h=!0,m=a.segments,o<0&&x.v.c)for(a.tLength<Math.abs(o)&&(o=-Math.abs(o)%a.tLength),u=(f=m[d=m.length-1].points).length-1;o<0;)o+=f[u].partialLength,(u-=1)<0&&(u=(f=m[d-=1].points).length-1);p=(f=m[d].points)[u-1],g=(l=f[u]).partialLength}s=C.length,n=0,r=0;var B,R,P,D,L,F=1.2*e.finalSize*.714,U=!0;P=E.length;var O,N,k,G,z,Q,V,H,j,W,X,Y,q=-1,K=o,J=d,Z=u,$=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var ne=0,re=0,ie=2===e.j?-.5:-1,se=0,ae=!0;for(i=0;i<s;i+=1)if(C[i].n){for(ne&&(ne+=re);se<i;)C[se].animatorJustifyOffset=ne,se+=1;ne=0,ae=!0}else{for(R=0;R<P;R+=1)(B=E[R].a).t.propType&&(ae&&2===e.j&&(re+=B.t.v*ie),(L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars)).length?ne+=B.t.v*L[0]*ie:ne+=B.t.v*L*ie);ae=!1}for(ne&&(ne+=re);se<i;)C[se].animatorJustifyOffset=ne,se+=1}for(i=0;i<s;i+=1){if(S.reset(),G=1,C[i].n)n=0,r+=e.yOffset,r+=U?1:0,o=K,U=!1,this._hasMaskedPath&&(u=Z,p=(f=m[d=J].points)[u-1],g=(l=f[u]).partialLength,c=0),ee="",X="",j="",Y="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==C[i].line){switch(e.j){case 1:o+=A-e.lineWidths[C[i].line];break;case 2:o+=(A-e.lineWidths[C[i].line])/2}$=C[i].line}q!==C[i].ind&&(C[q]&&(o+=C[q].extra),o+=C[i].an/2,q=C[i].ind),o+=b[0]*C[i].an*.005;var oe=0;for(R=0;R<P;R+=1)(B=E[R].a).p.propType&&((L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars)).length?oe+=B.p.v[0]*L[0]:oe+=B.p.v[0]*L),B.a.propType&&((L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars)).length?oe+=B.a.v[0]*L[0]:oe+=B.a.v[0]*L);for(h=!0,this._pathData.a.v&&(o=.5*C[0].an+(A-this._pathData.f.v-.5*C[0].an-.5*C[C.length-1].an)*q/(s-1),o+=this._pathData.f.v);h;)c+g>=o+oe||!f?(v=(o+oe-c)/l.partialLength,N=p.point[0]+(l.point[0]-p.point[0])*v,k=p.point[1]+(l.point[1]-p.point[1])*v,S.translate(-b[0]*C[i].an*.005,-b[1]*F*.01),h=!1):f&&(c+=l.partialLength,(u+=1)>=f.length&&(u=0,m[d+=1]?f=m[d].points:x.v.c?(u=0,f=m[d=0].points):(c-=l.partialLength,f=null)),f&&(p=l,g=(l=f[u]).partialLength));O=C[i].an/2-C[i].add,S.translate(-O,0,0)}else O=C[i].an/2-C[i].add,S.translate(-O,0,0),S.translate(-b[0]*C[i].an*.005,-b[1]*F*.01,0);for(R=0;R<P;R+=1)(B=E[R].a).t.propType&&(L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars),0===n&&0===e.j||(this._hasMaskedPath?L.length?o+=B.t.v*L[0]:o+=B.t.v*L:L.length?n+=B.t.v*L[0]:n+=B.t.v*L));for(e.strokeWidthAnim&&(Q=e.sw||0),e.strokeColorAnim&&(z=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(V=[e.fc[0],e.fc[1],e.fc[2]]),R=0;R<P;R+=1)(B=E[R].a).a.propType&&((L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars)).length?S.translate(-B.a.v[0]*L[0],-B.a.v[1]*L[1],B.a.v[2]*L[2]):S.translate(-B.a.v[0]*L,-B.a.v[1]*L,B.a.v[2]*L));for(R=0;R<P;R+=1)(B=E[R].a).s.propType&&((L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars)).length?S.scale(1+(B.s.v[0]-1)*L[0],1+(B.s.v[1]-1)*L[1],1):S.scale(1+(B.s.v[0]-1)*L,1+(B.s.v[1]-1)*L,1));for(R=0;R<P;R+=1){if(B=E[R].a,L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars),B.sk.propType&&(L.length?S.skewFromAxis(-B.sk.v*L[0],B.sa.v*L[1]):S.skewFromAxis(-B.sk.v*L,B.sa.v*L)),B.r.propType&&(L.length?S.rotateZ(-B.r.v*L[2]):S.rotateZ(-B.r.v*L)),B.ry.propType&&(L.length?S.rotateY(B.ry.v*L[1]):S.rotateY(B.ry.v*L)),B.rx.propType&&(L.length?S.rotateX(B.rx.v*L[0]):S.rotateX(B.rx.v*L)),B.o.propType&&(L.length?G+=(B.o.v*L[0]-G)*L[0]:G+=(B.o.v*L-G)*L),e.strokeWidthAnim&&B.sw.propType&&(L.length?Q+=B.sw.v*L[0]:Q+=B.sw.v*L),e.strokeColorAnim&&B.sc.propType)for(H=0;H<3;H+=1)L.length?z[H]+=(B.sc.v[H]-z[H])*L[0]:z[H]+=(B.sc.v[H]-z[H])*L;if(e.fillColorAnim&&e.fc){if(B.fc.propType)for(H=0;H<3;H+=1)L.length?V[H]+=(B.fc.v[H]-V[H])*L[0]:V[H]+=(B.fc.v[H]-V[H])*L;B.fh.propType&&(V=L.length?addHueToRGB(V,B.fh.v*L[0]):addHueToRGB(V,B.fh.v*L)),B.fs.propType&&(V=L.length?addSaturationToRGB(V,B.fs.v*L[0]):addSaturationToRGB(V,B.fs.v*L)),B.fb.propType&&(V=L.length?addBrightnessToRGB(V,B.fb.v*L[0]):addBrightnessToRGB(V,B.fb.v*L))}}for(R=0;R<P;R+=1)(B=E[R].a).p.propType&&(L=E[R].s.getMult(C[i].anIndexes[R],_.a[R].s.totalChars),this._hasMaskedPath?L.length?S.translate(0,B.p.v[1]*L[0],-B.p.v[2]*L[1]):S.translate(0,B.p.v[1]*L,-B.p.v[2]*L):L.length?S.translate(B.p.v[0]*L[0],B.p.v[1]*L[1],-B.p.v[2]*L[2]):S.translate(B.p.v[0]*L,B.p.v[1]*L,-B.p.v[2]*L));if(e.strokeWidthAnim&&(j=Q<0?0:Q),e.strokeColorAnim&&(W="rgb("+Math.round(255*z[0])+","+Math.round(255*z[1])+","+Math.round(255*z[2])+")"),e.fillColorAnim&&e.fc&&(X="rgb("+Math.round(255*V[0])+","+Math.round(255*V[1])+","+Math.round(255*V[2])+")"),this._hasMaskedPath){if(S.translate(0,-e.ls),S.translate(0,b[1]*F*.01+r,0),this._pathData.p.v){y=(l.point[1]-p.point[1])/(l.point[0]-p.point[0]);var le=180*Math.atan(y)/Math.PI;l.point[0]<p.point[0]&&(le+=180),S.rotate(-le*Math.PI/180)}S.translate(N,k,0),o-=b[0]*C[i].an*.005,C[i+1]&&q!==C[i+1].ind&&(o+=C[i].an/2,o+=.001*e.tr*e.finalSize)}else{switch(S.translate(n,r,0),e.ps&&S.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:S.translate(C[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[C[i].line]),0,0);break;case 2:S.translate(C[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[C[i].line])/2,0,0)}S.translate(0,-e.ls),S.translate(O,0,0),S.translate(b[0]*C[i].an*.005,b[1]*F*.01,0),n+=C[i].l+.001*e.tr*e.finalSize}"html"===w?ee=S.toCSS():"svg"===w?ee=S.to2dCSS():te=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],Y=G}M<=i?(D=new LetterProps(Y,j,W,X,ee,te),this.renderedLetters.push(D),M+=1,this.lettersChangedFlag=!0):(D=this.renderedLetters[i],this.lettersChangedFlag=D.update(Y,j,W,X,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,n){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,n),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,n),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(e,t){var n,r,i=t.length,s="";for(n=0;n<i;n+=1)"sh"===t[n].ty&&(r=t[n].ks.k,s+=buildShapeString(r,r.i.length,!0,e));return s},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,n,r,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[n]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[n])/2,0,0)}t.translate(r,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,n){this.textSpans=[],this.renderType="svg",this.initElement(e,t,n)}function ISolidElement(e,t,n){this.initElement(e,t,n)}function NullElement(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initFrame(),this.initTransform(e,t,n),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,n){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,n),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var n="";if(t&&t.title){var r=createNS("title"),i=createElementID();r.setAttribute("id",i),r.textContent=t.title,this.svgElement.appendChild(r),n+=i}if(t&&t.description){var s=createNS("desc"),a=createElementID();s.setAttribute("id",a),s.textContent=t.description,this.svgElement.appendChild(s),n+=" "+a}n&&this.svgElement.setAttribute("aria-labelledby",n);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CVContextData(){var e;this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;for(this.savedOp=createTypedArray("float32",15),e=0;e<15;e+=1)this.saved[e]=createTypedArray("float32",16);this._length=15}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVEffects(){}function CVMaskElement(e,t){var n;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var r=this.masksProperties.length,i=!1;for(n=0;n<r;n+=1)"n"!==this.masksProperties[n].mode&&(i=!0),this.viewData[n]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[n],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}function CVShapeData(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,s,e);var a,o=n.length;for(i=0;i<o;i+=1)n[i].closed||(a={transforms:r.addTransformSequence(n[i].transforms),trNodes:[]},this.styledShapes.push(a),n[i].elements.push(a))}function CVShapeElement(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,n)}function CVTextElement(e,t,n){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,n)}function CVImageElement(e,t,n){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,n)}function CVSolidElement(e,t,n){this.initElement(e,t,n)}function CanvasRendererBase(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||""},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function CVCompElement(e,t,n){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,n),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||""},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,n=e.length,r=[],i="";t<n;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(r.push(i),i=""):i+=e[t],t+=1;return r.push(i),r},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var n=e.shapes[0];if(n.it){var r=n.it[n.it.length-1];r.s&&(r.s.k[0]=t,r.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var n=this.textProperty.currentData;this.renderedLetters=createSizedArray(n?n.l.length:0),n.fc?this.layerElement.setAttribute("fill",this.buildColor(n.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),n.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(n.sc)),this.layerElement.setAttribute("stroke-width",n.sw)),this.layerElement.setAttribute("font-size",n.finalSize);var r=this.globalData.fontManager.getFontByName(n.f);if(r.fClass)this.layerElement.setAttribute("class",r.fClass);else{this.layerElement.setAttribute("font-family",r.fFamily);var i=n.fWeight,s=n.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",n.t);var a,o=n.l||[],l=!!this.globalData.fontManager.chars;t=o.length;var c=this.mHelper,h=this.data.singleShape,u=0,d=0,p=!0,f=.001*n.tr*n.finalSize;if(!h||l||n.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!h||0===e){if(a=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=a,l){var A=createNS("g");a.appendChild(A),this.textSpans[e].childSpan=A}this.textSpans[e].span=a,this.layerElement.appendChild(a)}a.style.display="inherit"}if(c.reset(),h&&(o[e].n&&(u=-f,d+=n.yOffset,d+=p?1:0,p=!1),this.applyTextPropertiesToMatrix(n,c,o[e].line,u,d),u+=o[e].l||0,u+=f),l){var v;if(1===(m=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily)).t)v=new SVGCompElement(m.data,this.globalData,this);else{var y=emptyShapeData;m.data&&m.data.shapes&&(y=this.buildShapeData(m.data,n.finalSize)),v=new SVGShapeElement(y,this.globalData,this)}if(this.textSpans[e].glyph){var x=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(x.layerElement),x.destroy()}this.textSpans[e].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[e].childSpan.appendChild(v.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+n.finalSize/100+","+n.finalSize/100+")")}else h&&a.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),a.textContent=o[e].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}h&&a&&a.setAttribute("d","")}else{var b=this.textContainer,E="start";switch(n.j){case 1:E="end";break;case 2:E="middle";break;default:E="start"}b.setAttribute("text-anchor",E),b.setAttribute("letter-spacing",f);var _=this.buildTextContents(n.finalText);for(t=_.length,d=n.ps?n.ps[1]+n.ascent:0,e=0;e<t;e+=1)(a=this.textSpans[e].span||createNS("tspan")).textContent=_[e],a.setAttribute("x",0),a.setAttribute("y",d),a.style.display="inherit",b.appendChild(a),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=a,d+=n.finalLineHeight;this.layerElement.appendChild(b)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,n=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<n;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if((!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var n,r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(t=a.length,e=0;e<t;e+=1)a[e].n||(n=s[e],r=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),n._mdf.m&&r.setAttribute("transform",n.m),n._mdf.o&&r.setAttribute("opacity",n.o),n._mdf.sw&&r.setAttribute("stroke-width",n.sw),n._mdf.sc&&r.setAttribute("stroke",n.sc),n._mdf.fc&&r.setAttribute("fill",n.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var n=createNS("clipPath"),r=createNS("rect");r.setAttribute("width",e.w),r.setAttribute("height",e.h),r.setAttribute("x",0),r.setAttribute("y",0);var i=createElementID();n.setAttribute("id",i),n.appendChild(r),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(n),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var n=this.createItem(this.layers[e]);t[e]=n,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(n),n.initExpressions()),this.appendElementInPos(n,e),this.layers[e].tt&&(this.elements[e-1]&&!0!==this.elements[e-1]?n.setMatte(t[e-1].layerId):(this.buildItem(e-1),this.addPendingElement(n)))}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,n=this.elements.length;t<n;){if(this.elements[t]===e){e.setMatte(this.elements[t-1].layerId);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<n;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var n=e.getBaseElement();if(n){for(var r,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(r=this.elements[i].getBaseElement()),i+=1;r?this.layerElement.insertBefore(n,r):this.layerElement.appendChild(n)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,n){this.initFrame(),this.initBaseData(e,t,n),this.initTransform(e,t,n),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var n,r=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),n=r-1;n>=0;n-=1)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=this.savedOp;this.savedOp=createTypedArray("float32",e),this.savedOp.set(t);var n=0;for(n=this._length;n<e;n+=1)this.saved[n]=createTypedArray("float32",16);this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,n=e.length,r="_";for(t=0;t<n;t+=1)r+=e[t].transform.key+"_";var i=this.sequences[r];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var n,r=0,i=e.transforms.length,s=t;r<i&&!t;){if(e.transforms[r].transform.mProps._mdf){s=!0;break}r+=1}if(s)for(e.finalTransform.reset(),r=i-1;r>=0;r-=1)n=e.transforms[r].transform.mProps.v.props,e.finalTransform.transform(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]);e._mdf=s},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t<n;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},CVEffects.prototype.renderFrame=function(){},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,n,r,i=this.element.finalTransform.mat,s=this.element.canvasContext,a=this.masksProperties.length;for(s.beginPath(),e=0;e<a;e+=1)if("n"!==this.masksProperties[e].mode){var o;this.masksProperties[e].inv&&(s.moveTo(0,0),s.lineTo(this.element.globalData.compSize.w,0),s.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),s.lineTo(0,this.element.globalData.compSize.h),s.lineTo(0,0)),r=this.viewData[e].v,t=i.applyToPointArray(r.v[0][0],r.v[0][1],0),s.moveTo(t[0],t[1]);var l=r._length;for(o=1;o<l;o+=1)n=i.applyToTriplePoints(r.o[o-1],r.i[o],r.v[o]),s.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);n=i.applyToTriplePoints(r.o[o-1],r.i[0],r.v[0]),s.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}this.element.globalData.renderer.save(!0),s.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var e=0===this.data.ty;this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(e),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var n={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},r={};if("fl"===e.ty||"st"===e.ty?(r.c=PropertyFactory.getProp(this,e.c,1,255,this),r.c.k||(n.co="rgb("+bmFloor(r.c.v[0])+","+bmFloor(r.c.v[1])+","+bmFloor(r.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(r.s=PropertyFactory.getProp(this,e.s,1,null,this),r.e=PropertyFactory.getProp(this,e.e,1,null,this),r.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),r.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),r.g=new GradientProperty(this,e.g,this)),r.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(n.lc=lineCapEnum[e.lc||2],n.lj=lineJoinEnum[e.lj||2],1==e.lj&&(n.ml=e.ml),r.w=PropertyFactory.getProp(this,e.w,0,null,this),r.w.k||(n.wi=r.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);r.d=i,r.d.k||(n.da=r.d.dashArray,n.do=r.d.dashoffset[0])}}else n.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(n),r.style=n,r},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,n=this.stylesList.length;for(t=0;t<n;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,n=e.length;for(t=0;t<n;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,n,r,i){var s,a,o,l,c,h,u=e.length-1,d=[],p=[],f=[].concat(i);for(s=u;s>=0;s-=1){if((l=this.searchProcessedElement(e[s]))?t[s]=n[l-1]:e[s]._shouldRender=r,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty)l?t[s].style.closed=!1:t[s]=this.createStyleElement(e[s],f),d.push(t[s].style);else if("gr"===e[s].ty){if(l)for(o=t[s].it.length,a=0;a<o;a+=1)t[s].prevViewData[a]=t[s].it[a];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,r,f)}else"tr"===e[s].ty?(l||(h=this.createTransformElement(e[s]),t[s]=h),f.push(t[s]),this.addTransformToStyleList(t[s])):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?l||(t[s]=this.createShapeElement(e[s])):"tm"===e[s].ty||"rd"===e[s].ty||"pb"===e[s].ty?(l?(c=t[s]).closed=!1:((c=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=c,this.shapeModifiers.push(c)),p.push(c)):"rp"===e[s].ty&&(l?(c=t[s]).closed=!0:(c=ShapeModifiers.getModifier(e[s].ty),t[s]=c,c.init(this,e,s,t),this.shapeModifiers.push(c),r=!1),p.push(c));this.addProcessedElement(e[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(d),u=p.length,s=0;s<u;s+=1)p[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,n,r,i,s,a,o,l,c=this.stylesList.length,h=this.globalData.renderer,u=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(o=(l=this.stylesList[e]).type)&&"gs"!==o||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(h.save(),s=l.elements,"st"===o||"gs"===o?(u.strokeStyle="st"===o?l.co:l.grd,u.lineWidth=l.wi,u.lineCap=l.lc,u.lineJoin=l.lj,u.miterLimit=l.ml||0):u.fillStyle="fl"===o?l.co:l.grd,h.ctxOpacity(l.coOp),"st"!==o&&"gs"!==o&&u.beginPath(),h.ctxTransform(l.preTransforms.finalTransform.props),n=s.length,t=0;t<n;t+=1){for("st"!==o&&"gs"!==o||(u.beginPath(),l.da&&(u.setLineDash(l.da),u.lineDashOffset=l.do)),i=(a=s[t].trNodes).length,r=0;r<i;r+=1)"m"===a[r].t?u.moveTo(a[r].p[0],a[r].p[1]):"c"===a[r].t?u.bezierCurveTo(a[r].pts[0],a[r].pts[1],a[r].pts[2],a[r].pts[3],a[r].pts[4],a[r].pts[5]):u.closePath();"st"!==o&&"gs"!==o||(u.stroke(),l.da&&u.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&u.fill(l.r),h.restore()}},CVShapeElement.prototype.renderShape=function(e,t,n,r){var i,s;for(s=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(s=n[i].transform,this.renderShapeTransform(e,s)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],n[i]):"fl"===t[i].ty?this.renderFill(t[i],n[i],s):"st"===t[i].ty?this.renderStroke(t[i],n[i],s):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],n[i],s):"gr"===t[i].ty?this.renderShape(s,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n,r,i,s=e.trNodes,a=t.paths,o=a._length;s.length=0;var l=e.transforms.finalTransform;for(i=0;i<o;i+=1){var c=a.shapes[i];if(c&&c.v){for(r=c._length,n=1;n<r;n+=1)1===n&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),s.push({t:"c",pts:l.applyToTriplePoints(c.o[n-1],c.i[n],c.v[n])});1===r&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&r&&(s.push({t:"c",pts:l.applyToTriplePoints(c.o[n-1],c.i[0],c.v[0])}),s.push({t:"z"}))}}e.trNodes=s}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var n,r=t.styledShapes.length;for(n=0;n<r;n+=1)this.renderStyledShape(t.styledShapes[n],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,n){var r=t.style;(t.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n._opMdf||this._isFirstFrame)&&(r.coOp=t.o.v*n.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,n){var r,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var s,a=this.globalData.canvasContext,o=t.s.v,l=t.e.v;if(1===e.t)r=a.createLinearGradient(o[0],o[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)),h=Math.atan2(l[1]-o[1],l[0]-o[0]),u=t.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var d=c*u,p=Math.cos(h+t.a.v)*d+o[0],f=Math.sin(h+t.a.v)*d+o[1];r=a.createRadialGradient(p,f,0,o[0],o[1],c)}var m=e.g.p,g=t.g.c,A=1;for(s=0;s<m;s+=1)t.g._hasOpacity&&t.g._collapsable&&(A=t.g.o[2*s+1]),r.addColorStop(g[4*s]/100,"rgba("+g[4*s+1]+","+g[4*s+2]+","+g[4*s+3]+","+A+")");i.grd=r}i.coOp=t.o.v*n.opacity},CVShapeElement.prototype.renderStroke=function(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(r.da=i.dashArray,r.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||n._opMdf||this._isFirstFrame)&&(r.coOp=t.o.v*n.opacity),(t.w._mdf||this._isFirstFrame)&&(r.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var n=!1;e.sc&&(n=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var r,i,s,a,o,l,c,h,u,d,p,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,A=this.mHelper;this.stroke=n,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var v=this.data.singleShape,y=.001*e.tr*e.finalSize,x=0,b=0,E=!0,_=0;for(r=0;r<i;r+=1){a=(s=this.globalData.fontManager.getCharData(e.finalText[r],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&s.data||{},A.reset(),v&&g[r].n&&(x=-y,b+=e.yOffset,b+=E?1:0,E=!1),u=(c=a.shapes?a.shapes[0].it:[]).length,A.scale(e.finalSize/100,e.finalSize/100),v&&this.applyTextPropertiesToMatrix(e,A,g[r].line,x,b),p=createSizedArray(u-1);var S=0;for(h=0;h<u;h+=1)if("sh"===c[h].ty){for(l=c[h].ks.k.i.length,d=c[h].ks.k,f=[],o=1;o<l;o+=1)1===o&&f.push(A.applyToX(d.v[0][0],d.v[0][1],0),A.applyToY(d.v[0][0],d.v[0][1],0)),f.push(A.applyToX(d.o[o-1][0],d.o[o-1][1],0),A.applyToY(d.o[o-1][0],d.o[o-1][1],0),A.applyToX(d.i[o][0],d.i[o][1],0),A.applyToY(d.i[o][0],d.i[o][1],0),A.applyToX(d.v[o][0],d.v[o][1],0),A.applyToY(d.v[o][0],d.v[o][1],0));f.push(A.applyToX(d.o[o-1][0],d.o[o-1][1],0),A.applyToY(d.o[o-1][0],d.o[o-1][1],0),A.applyToX(d.i[0][0],d.i[0][1],0),A.applyToY(d.i[0][0],d.i[0][1],0),A.applyToX(d.v[0][0],d.v[0][1],0),A.applyToY(d.v[0][0],d.v[0][1],0)),p[S]=f,S+=1}v&&(x+=g[r].l,x+=y),this.textSpans[_]?this.textSpans[_].elem=p:this.textSpans[_]={elem:p},_+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,n,r,i,s,a=this.canvasContext;a.font=this.values.fValue,a.lineCap="butt",a.lineJoin="miter",a.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;t=c.length;var h,u,d=null,p=null,f=null;for(e=0;e<t;e+=1)if(!c[e].n){if((o=l[e])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?d!==o.fc&&(d=o.fc,a.fillStyle=o.fc):d!==this.values.fill&&(d=this.values.fill,a.fillStyle=this.values.fill),r=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(s=(u=h[n]).length,this.globalData.canvasContext.moveTo(u[0],u[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(u[i],u[i+1],u[i+2],u[i+3],u[i+4],u[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?f!==o.sw&&(f=o.sw,a.lineWidth=o.sw):f!==this.values.sWidth&&(f=this.values.sWidth,a.lineWidth=this.values.sWidth),o&&o.sc?p!==o.sc&&(p=o.sc,a.strokeStyle=o.sc):p!==this.values.stroke&&(p=this.values.stroke,a.strokeStyle=this.values.stroke),r=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(s=(u=h[n]).length,this.globalData.canvasContext.moveTo(u[0],u[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(u[i],u[i+1],u[i+2],u[i+3],u[i+4],u[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,n,r=e.getContext("2d"),i=this.img.width,s=this.img.height,a=i/s,o=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;a>o&&"xMidYMid slice"===l||a<o&&"xMidYMid slice"!==l?t=(n=s)*o:n=(t=i)/o,r.drawImage(this.img,(i-t)/2,(s-n)/2,t,n,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var e=this.canvasContext;e.fillStyle=this.data.sc,e.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){if(1!==e[0]||0!==e[1]||0!==e[4]||1!==e[5]||0!==e[12]||0!==e[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(e);var t=this.contextData.cTr.props;this.transformMat.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var n=this.contextData.cTr.props;this.canvasContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13])}else this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=e<0?0:e,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=e<0?0:e,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(e){if(this.renderConfig.clearCanvas){e&&this.canvasContext.save();var t,n=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var r=this.contextData.saved[this.contextData.cArrPos];for(t=0;t<16;t+=1)r[t]=n[t];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){if(this.renderConfig.clearCanvas){e&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var t,n=this.contextData.saved[this.contextData.cArrPos],r=this.contextData.cTr.props;for(t=0;t<16;t+=1)r[t]=n[t];this.canvasContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13]),n=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=n,this.globalData.currentGlobalAlpha!==n&&(this.canvasContext.globalAlpha=n,this.globalData.currentGlobalAlpha=n)}else this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var n="0px 0px 0px";t.transformOrigin=n,t.mozTransformOrigin=n,t.webkitTransformOrigin=n,t["-webkit-transform"]=n,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(){var e,t,n,r;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(e=this.animationItem.wrapper.offsetWidth,t=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",e*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",t*this.renderConfig.dpr)):(e=this.canvasContext.canvas.width*this.renderConfig.dpr,t=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var i=this.renderConfig.preserveAspectRatio.split(" "),s=i[1]||"meet",a=i[0]||"xMidYMid",o=a.substr(0,4),l=a.substr(4);n=e/t,(r=this.transformCanvas.w/this.transformCanvas.h)>n&&"meet"===s||r<n&&"slice"===s?(this.transformCanvas.sx=e/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=t/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(r<n&&"meet"===s||r>n&&"slice"===s)?(e-this.transformCanvas.w*(t/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(r<n&&"meet"===s||r>n&&"slice"===s)?(e-this.transformCanvas.w*(t/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===l&&(r>n&&"meet"===s||r<n&&"slice"===s)?(t-this.transformCanvas.h*(e/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===l&&(r>n&&"meet"===s||r<n&&"slice"===s)?(t-this.transformCanvas.h*(e/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=e/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var n;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=0;n<r;n+=1)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;n-=1)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},registerRenderer("canvas",CanvasRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier);const Expressions=function(){var e={};return e.initExpressions=function(e){var t=0,n=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=n.length;for(e=0;e<t;e+=1)n[e].release();n.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===n.indexOf(e)&&n.push(e)}},e}();function seedRandom(e,t){var n=this,r=256,i="random",s=t.pow(r,6),a=t.pow(2,52),o=2*a,l=r-1;function c(e){var t,n=e.length,i=this,s=0,a=i.i=i.j=0,o=i.S=[];for(n||(e=[n++]);s<r;)o[s]=s++;for(s=0;s<r;s++)o[s]=o[a=l&a+e[s%n]+(t=o[s])],o[a]=t;i.g=function(e){for(var t,n=0,s=i.i,a=i.j,o=i.S;e--;)t=o[s=l&s+1],n=n*r+o[l&(o[s]=o[a=l&a+t])+(o[a]=t)];return i.i=s,i.j=a,n}}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function u(e,t){var n,r=[],i=typeof e;if(t&&"object"==i)for(n in e)try{r.push(u(e[n],t-1))}catch(s){}return r.length?r:"string"==i?e:e+"\0"}function d(e,t){for(var n,r=e+"",i=0;i<r.length;)t[l&i]=l&(n^=19*t[l&i])+r.charCodeAt(i++);return p(t)}function p(e){return String.fromCharCode.apply(0,e)}t["seed"+i]=function(l,f,m){var g=[],A=d(u((f=!0===f?{entropy:!0}:f||{}).entropy?[l,p(e)]:null===l?function(){try{var t=new Uint8Array(r);return(n.crypto||n.msCrypto).getRandomValues(t),p(t)}catch(a){var i=n.navigator,s=i&&i.plugins;return[+new Date,n,s,n.screen,p(e)]}}():l,3),g),v=new c(g),y=function(){for(var e=v.g(6),t=s,n=0;e<a;)e=(e+n)*r,t*=r,n=v.g(1);for(;e>=o;)e/=2,t/=2,n>>>=1;return(e+n)/t};return y.int32=function(){return 0|v.g(4)},y.quick=function(){return v.g(4)/4294967296},y.double=y,d(p(v.S),e),(f.pass||m||function(e,n,r,s){return s&&(s.S&&h(s,v),e.state=function(){return h(v,{})}),r?(t[i]=e,n):e})(y,A,"global"in f?f.global:this==t,f.state)},d(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};const ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||"boolean"===e||"string"===e||t instanceof Number}function $bm_neg(e){var t=typeof e;if("number"===t||"boolean"===t||e instanceof Number)return-e;if($bm_isInstanceOfArray(e)){var n,r=e.length,i=[];for(n=0;n<r;n+=1)i[n]=-e[n];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var n=typeof e,r=typeof t;if("string"===n||"string"===r)return e+t;if(isNumerable(n,e)&&isNumerable(r,t))return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(r,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(n,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]+t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}var add=sum;function sub(e,t){var n=typeof e,r=typeof t;if(isNumerable(n,e)&&isNumerable(r,t))return"string"===n&&(e=parseInt(e,10)),"string"===r&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(r,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(n,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]-t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}function mul(e,t){var n,r,i,s=typeof e,a=typeof t;if(isNumerable(s,e)&&isNumerable(a,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e[r]*t;return n}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e*t[r];return n}return 0}function div(e,t){var n,r,i,s=typeof e,a=typeof t;if(isNumerable(s,e)&&isNumerable(a,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e[r]/t;return n}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,n=createTypedArray("float32",i),r=0;r<i;r+=1)n[r]=e/t[r];return n}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,n){if(t>n){var r=n;n=t,t=r}return Math.min(Math.max(e,t),n)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var n;t||(t=helperLengthArray);var r=Math.min(e.length,t.length),i=0;for(n=0;n<r;n+=1)i+=Math.pow(t[n]-e[n],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,n,r=e[0],i=e[1],s=e[2],a=Math.max(r,i,s),o=Math.min(r,i,s),l=(a+o)/2;if(a===o)t=0,n=0;else{var c=a-o;switch(n=l>.5?c/(2-a-o):c/(a+o),a){case r:t=(i-s)/c+(i<s?6:0);break;case i:t=(s-r)/c+2;break;case s:t=(r-i)/c+4}t/=6}return[t,n,l,e[3]]}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRgb(e){var t,n,r,i=e[0],s=e[1],a=e[2];if(0===s)t=a,r=a,n=a;else{var o=a<.5?a*(1+s):a+s-a*s,l=2*a-o;t=hue2rgb(l,o,i+1/3),n=hue2rgb(l,o,i),r=hue2rgb(l,o,i-1/3)}return[t,n,r,e[3]]}function linear(e,t,n,r,i){if(void 0!==r&&void 0!==i||(r=t,i=n,t=0,n=1),n<t){var s=n;n=t,t=s}if(e<=t)return r;if(e>=n)return i;var a,o=n===t?0:(e-t)/(n-t);if(!r.length)return r+(i-r)*o;var l=r.length,c=createTypedArray("float32",l);for(a=0;a<l;a+=1)c[a]=r[a]+(i[a]-r[a])*o;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var n,r=t.length;e||(e=createTypedArray("float32",r));var i=createTypedArray("float32",r),s=BMMath.random();for(n=0;n<r;n+=1)i[n]=e[n]+s*(t[n]-e[n]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,n,r){var i,s=e.length,a=shapePool.newElement();a.setPathData(!!r,s);var o,l,c=[0,0];for(i=0;i<s;i+=1)o=t&&t[i]?t[i]:c,l=n&&n[i]?n[i]:c,a.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],o[0]+e[i][0],o[1]+e[i][1],i,!0);return a}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var n,r,i=this.pv.length?this.pv.length:1,s=createTypedArray("float32",i);var a=Math.floor(5*time);for(n=0,r=0;n<a;){for(r=0;r<i;r+=1)s[r]+=-t+2*t*BMMath.random();n+=1}var o=5*time,l=o-Math.floor(o),c=createTypedArray("float32",i);if(i>1){for(r=0;r<i;r+=1)c[r]=this.pv[r]+s[r]+(-t+2*t*BMMath.random())*l;return c}return this.pv+s[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var n=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=Math.atan2(n[0],Math.sqrt(n[1]*n[1]+n[2]*n[2]))/degToRads;return[-Math.atan2(n[1],n[2])/degToRads,r,0]}function easeOut(e,t,n,r,i){return applyEase(easeOutBez,e,t,n,r,i)}function easeIn(e,t,n,r,i){return applyEase(easeInBez,e,t,n,r,i)}function ease(e,t,n,r,i){return applyEase(easeInOutBez,e,t,n,r,i)}function applyEase(e,t,n,r,i,s){void 0===i?(i=n,s=r):t=(t-n)/(r-n),t>1?t=1:t<0&&(t=0);var a=e(t);if($bm_isInstanceOfArray(i)){var o,l=i.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=(s[o]-i[o])*a+i[o];return c}return(s-i)*a+i}function nearestKey(e){var t,n,r,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(n=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)n=1,r=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){n=t+1,r=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(n=t+2,r=data.k[t+1].t):(n=t+1,r=data.k[t].t);break}}-1===n&&(n=t+1,r=data.k[t].t)}else n=0,r=0;var s={};return s.index=n,s.time=r/elem.comp.globalData.frameRate,s}function key(e){var t,n,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(r=i.length,n=0;n<r;n+=1)t[n]=i[n],t.value[n]=i[n];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath],ob}(),expressionHelpers={searchExpressions:function(e,t,n){t.x&&(n.k=!0,n.x=!0,n.initiateExpression=ExpressionManager.initiateExpression,n.effectsSequence.push(n.initiateExpression(e,t,n).bind(n)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),n=this.getValueAtTime(e+-.01),r=0;if(t.length){var i;for(i=0;i<t.length;i+=1)r+=Math.pow(n[i]-t[i],2);r=100*Math.sqrt(r)}else r=0;return r},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,n,r=-.001,i=this.getValueAtTime(e),s=this.getValueAtTime(e+r);if(i.length)for(t=createTypedArray("float32",i.length),n=0;n<i.length;n+=1)t[n]=(s[n]-i[n])/r;else t=(s-i)/r;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,n){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var r,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[c.length-1].t;if(l<=h)return this.pv;if(n?i=h-(r=t?Math.abs(h-this.elem.comp.globalData.frameRate*t):Math.max(0,h-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),r=h-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/r)%2!=0)return this.getValueAtTime((r-(l-i)%r+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),d=this.getValueAtTime(h/this.comp.globalData.frameRate,0),p=this.getValueAtTime(((l-i)%r+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/r);if(this.pv.length){for(a=(o=new Array(u.length)).length,s=0;s<a;s+=1)o[s]=(d[s]-u[s])*f+p[s];return o}return(d-u)*f+p}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*((l-h)/this.comp.globalData.frameRate)/5e-4;return o}return m+(l-h)/.001*(m-g)}}return this.getValueAtTime(((l-i)%r+i)/this.comp.globalData.frameRate,0)}function t(e,t,n){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var r,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[0].t;if(l>=h)return this.pv;if(n?i=h+(r=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-h)):((!t||t>c.length-1)&&(t=c.length-1),r=(i=c[t].t)-h),"pingpong"===e){if(Math.floor((h-l)/r)%2==0)return this.getValueAtTime(((h-l)%r+h)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(h/this.comp.globalData.frameRate,0),d=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime((r-(h-l)%r+h)/this.comp.globalData.frameRate,0),f=Math.floor((h-l)/r)+1;if(this.pv.length){for(a=(o=new Array(u.length)).length,s=0;s<a;s+=1)o[s]=p[s]-(d[s]-u[s])*f;return o}return p-(d-u)*f}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*(h-l)/.001;return o}return m+(m-g)*(h-l)/.001}}return this.getValueAtTime((r-((h-l)%r+h))/this.comp.globalData.frameRate,0)}function n(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var n,r,i=this.comp.renderedFrame/this.comp.globalData.frameRate,s=i-e,a=t>1?(i+e-s)/(t-1):1,o=0,l=0;for(n=this.pv.length?createTypedArray("float32",this.pv.length):0;o<t;){if(r=this.getValueAtTime(s+o*a),this.pv.length)for(l=0;l<this.pv.length;l+=1)n[l]+=r[l];else n+=r;o+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)n[l]/=t;else n/=t;return n}function r(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var n=this.a.getValueAtTime(e);t.translate(-n[0]*this.a.mult,-n[1]*this.a.mult,n[2]*this.a.mult)}if(this.appliedTransformations<2){var r=this.s.getValueAtTime(e);t.scale(r[0]*this.s.mult,r[1]*this.s.mult,r[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),s=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,s*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var a=this.r.getValueAtTime(e);t.rotate(-a*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),h=this.or.getValueAtTime(e);t.rotateZ(-o*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-h[2]*this.or.mult).rotateY(h[1]*this.or.mult).rotateX(h[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var u=this.px.getValueAtTime(e),d=this.py.getValueAtTime(e);if(this.data.p.z){var p=this.pz.getValueAtTime(e);t.translate(u*this.px.mult,d*this.py.mult,-p*this.pz.mult)}else t.translate(u*this.px.mult,d*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,n){var a=s(e,t,n);return a.dynamicProperties.length?a.getValueAtTime=r.bind(a):a.getValueAtTime=i.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a};var a=PropertyFactory.getProp;PropertyFactory.getProp=function(r,i,s,o,l){var c=a(r,i,s,o,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=n,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var h=0;return 0!==s&&(h=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:h},expressionHelpers.searchExpressions(r,i,c),c.k&&l.addDynamicProperty(c),c};var o=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var n,r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0));var i=r._length,s=r[e],a=r.v,o=createSizedArray(i);for(n=0;n<i;n+=1)o[n]="i"===e||"o"===e?[s[n][0]-a[n][0],s[n][1]-a[n][1]]:[s[n][0],s[n][1]];return o},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(n));for(var r,i=this._segmentsLength,s=i.lengths,a=i.totalLength*e,o=0,l=s.length,c=0;o<l;){if(c+s[o].addedLength>a){var h=o,u=n.c&&o===l-1?0:o+1,d=(a-c)/s[o].addedLength;r=bez.getPointInSegment(n.v[h],n.v[u],n.o[h],n.i[u],d,s[o]);break}c+=s[o].addedLength,o+=1}return r||(r=n.c?[n.v[0][0],n.v[0][1]]:[n.v[n._length-1][0],n.v[n._length-1][1]]),r},vectorOnPath:function(e,t,n){1==e?e=this.v.c:0==e&&(e=.999);var r=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),s=i[0]-r[0],a=i[1]-r[1],o=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));return 0===o?[0,0]:"tangent"===n?[s/o,a/o]:[-a/o,s/o]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],o),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var h=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,n,r,i){var s=h(e,t,n,r,i);return s.propertyIndex=t.ix,s.lock=!1,3===n?expressionHelpers.searchExpressions(e,t.pt,s):4===n&&expressionHelpers.searchExpressions(e,t.ks,s),s.k&&e.addDynamicProperty(s),s}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var n=this.calculateExpression(t);if(e.t!==n){var r={};return this.copyData(r,e),r.t=n.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}return setExpressionsPlugin(Expressions),initialize$1(),initialize(),lottie})();module.exports=lottie},62717:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});class n{constructor(){this.s2uTable={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:126,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:65340,33120:65374,33121:8741,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:65293,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:65504,33170:65505,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:65506,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34624:9312,34625:9313,34626:9314,34627:9315,34628:9316,34629:9317,34630:9318,34631:9319,34632:9320,34633:9321,34634:9322,34635:9323,34636:9324,34637:9325,34638:9326,34639:9327,34640:9328,34641:9329,34642:9330,34643:9331,34644:8544,34645:8545,34646:8546,34647:8547,34648:8548,34649:8549,34650:8550,34651:8551,34652:8552,34653:8553,34655:13129,34656:13076,34657:13090,34658:13133,34659:13080,34660:13095,34661:13059,34662:13110,34663:13137,34664:13143,34665:13069,34666:13094,34667:13091,34668:13099,34669:13130,34670:13115,34671:13212,34672:13213,34673:13214,34674:13198,34675:13199,34676:13252,34677:13217,34686:13179,34688:12317,34689:12319,34690:8470,34691:13261,34692:8481,34693:12964,34694:12965,34695:12966,34696:12967,34697:12968,34698:12849,34699:12850,34700:12857,34701:13182,34702:13181,34703:13180,34704:8786,34705:8801,34706:8747,34707:8750,34708:8721,34709:8730,34710:8869,34711:8736,34712:8735,34713:8895,34714:8757,34715:8745,34716:8746,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081,60736:32394,60737:35100,60738:37704,60739:37512,60740:34012,60741:20425,60742:28859,60743:26161,60744:26824,60745:37625,60746:26363,60747:24389,60748:20008,60749:20193,60750:20220,60751:20224,60752:20227,60753:20281,60754:20310,60755:20370,60756:20362,60757:20378,60758:20372,60759:20429,60760:20544,60761:20514,60762:20479,60763:20510,60764:20550,60765:20592,60766:20546,60767:20628,60768:20724,60769:20696,60770:20810,60771:20836,60772:20893,60773:20926,60774:20972,60775:21013,60776:21148,60777:21158,60778:21184,60779:21211,60780:21248,60781:21255,60782:21284,60783:21362,60784:21395,60785:21426,60786:21469,60787:64014,60788:21660,60789:21642,60790:21673,60791:21759,60792:21894,60793:22361,60794:22373,60795:22444,60796:22472,60797:22471,60798:64015,60800:64016,60801:22686,60802:22706,60803:22795,60804:22867,60805:22875,60806:22877,60807:22883,60808:22948,60809:22970,60810:23382,60811:23488,60812:29999,60813:23512,60814:23532,60815:23582,60816:23718,60817:23738,60818:23797,60819:23847,60820:23891,60821:64017,60822:23874,60823:23917,60824:23992,60825:23993,60826:24016,60827:24353,60828:24372,60829:24423,60830:24503,60831:24542,60832:24669,60833:24709,60834:24714,60835:24798,60836:24789,60837:24864,60838:24818,60839:24849,60840:24887,60841:24880,60842:24984,60843:25107,60844:25254,60845:25589,60846:25696,60847:25757,60848:25806,60849:25934,60850:26112,60851:26133,60852:26171,60853:26121,60854:26158,60855:26142,60856:26148,60857:26213,60858:26199,60859:26201,60860:64018,60861:26227,60862:26265,60863:26272,60864:26290,60865:26303,60866:26362,60867:26382,60868:63785,60869:26470,60870:26555,60871:26706,60872:26560,60873:26625,60874:26692,60875:26831,60876:64019,60877:26984,60878:64020,60879:27032,60880:27106,60881:27184,60882:27243,60883:27206,60884:27251,60885:27262,60886:27362,60887:27364,60888:27606,60889:27711,60890:27740,60891:27782,60892:27759,60893:27866,60894:27908,60895:28039,60896:28015,60897:28054,60898:28076,60899:28111,60900:28152,60901:28146,60902:28156,60903:28217,60904:28252,60905:28199,60906:28220,60907:28351,60908:28552,60909:28597,60910:28661,60911:28677,60912:28679,60913:28712,60914:28805,60915:28843,60916:28943,60917:28932,60918:29020,60919:28998,60920:28999,60921:64021,60922:29121,60923:29182,60924:29361,60992:29374,60993:29476,60994:64022,60995:29559,60996:29629,60997:29641,60998:29654,60999:29667,61e3:29650,61001:29703,61002:29685,61003:29734,61004:29738,61005:29737,61006:29742,61007:29794,61008:29833,61009:29855,61010:29953,61011:30063,61012:30338,61013:30364,61014:30366,61015:30363,61016:30374,61017:64023,61018:30534,61019:21167,61020:30753,61021:30798,61022:30820,61023:30842,61024:31024,61025:64024,61026:64025,61027:64026,61028:31124,61029:64027,61030:31131,61031:31441,61032:31463,61033:64028,61034:31467,61035:31646,61036:64029,61037:32072,61038:32092,61039:32183,61040:32160,61041:32214,61042:32338,61043:32583,61044:32673,61045:64030,61046:33537,61047:33634,61048:33663,61049:33735,61050:33782,61051:33864,61052:33972,61053:34131,61054:34137,61056:34155,61057:64031,61058:34224,61059:64032,61060:64033,61061:34823,61062:35061,61063:35346,61064:35383,61065:35449,61066:35495,61067:35518,61068:35551,61069:64034,61070:35574,61071:35667,61072:35711,61073:36080,61074:36084,61075:36114,61076:36214,61077:64035,61078:36559,61079:64036,61080:64037,61081:36967,61082:37086,61083:64038,61084:37141,61085:37159,61086:37338,61087:37335,61088:37342,61089:37357,61090:37358,61091:37348,61092:37349,61093:37382,61094:37392,61095:37386,61096:37434,61097:37440,61098:37436,61099:37454,61100:37465,61101:37457,61102:37433,61103:37479,61104:37543,61105:37495,61106:37496,61107:37607,61108:37591,61109:37593,61110:37584,61111:64039,61112:37589,61113:37600,61114:37587,61115:37669,61116:37665,61117:37627,61118:64040,61119:37662,61120:37631,61121:37661,61122:37634,61123:37744,61124:37719,61125:37796,61126:37830,61127:37854,61128:37880,61129:37937,61130:37957,61131:37960,61132:38290,61133:63964,61134:64041,61135:38557,61136:38575,61137:38707,61138:38715,61139:38723,61140:38733,61141:38735,61142:38737,61143:38741,61144:38999,61145:39013,61146:64042,61147:64043,61148:39207,61149:64044,61150:39326,61151:39502,61152:39641,61153:39644,61154:39797,61155:39794,61156:39823,61157:39857,61158:39867,61159:39936,61160:40304,61161:40299,61162:64045,61163:40473,61164:40657,61167:8560,61168:8561,61169:8562,61170:8563,61171:8564,61172:8565,61173:8566,61174:8567,61175:8568,61176:8569,61177:65506,61178:65508,61179:65287,61180:65282,61504:57344,61505:57345,61506:57346,61507:57347,61508:57348,61509:57349,61510:57350,61511:57351,61512:57352,61513:57353,61514:57354,61515:57355,61516:57356,61517:57357,61518:57358,61519:57359,61520:57360,61521:57361,61522:57362,61523:57363,61524:57364,61525:57365,61526:57366,61527:57367,61528:57368,61529:57369,61530:57370,61531:57371,61532:57372,61533:57373,61534:57374,61535:57375,61536:57376,61537:57377,61538:57378,61539:57379,61540:57380,61541:57381,61542:57382,61543:57383,61544:57384,61545:57385,61546:57386,61547:57387,61548:57388,61549:57389,61550:57390,61551:57391,61552:57392,61553:57393,61554:57394,61555:57395,61556:57396,61557:57397,61558:57398,61559:57399,61560:57400,61561:57401,61562:57402,61563:57403,61564:57404,61565:57405,61566:57406,61568:57407,61569:57408,61570:57409,61571:57410,61572:57411,61573:57412,61574:57413,61575:57414,61576:57415,61577:57416,61578:57417,61579:57418,61580:57419,61581:57420,61582:57421,61583:57422,61584:57423,61585:57424,61586:57425,61587:57426,61588:57427,61589:57428,61590:57429,61591:57430,61592:57431,61593:57432,61594:57433,61595:57434,61596:57435,61597:57436,61598:57437,61599:57438,61600:57439,61601:57440,61602:57441,61603:57442,61604:57443,61605:57444,61606:57445,61607:57446,61608:57447,61609:57448,61610:57449,61611:57450,61612:57451,61613:57452,61614:57453,61615:57454,61616:57455,61617:57456,61618:57457,61619:57458,61620:57459,61621:57460,61622:57461,61623:57462,61624:57463,61625:57464,61626:57465,61627:57466,61628:57467,61629:57468,61630:57469,61631:57470,61632:57471,61633:57472,61634:57473,61635:57474,61636:57475,61637:57476,61638:57477,61639:57478,61640:57479,61641:57480,61642:57481,61643:57482,61644:57483,61645:57484,61646:57485,61647:57486,61648:57487,61649:57488,61650:57489,61651:57490,61652:57491,61653:57492,61654:57493,61655:57494,61656:57495,61657:57496,61658:57497,61659:57498,61660:57499,61661:57500,61662:57501,61663:57502,61664:57503,61665:57504,61666:57505,61667:57506,61668:57507,61669:57508,61670:57509,61671:57510,61672:57511,61673:57512,61674:57513,61675:57514,61676:57515,61677:57516,61678:57517,61679:57518,61680:57519,61681:57520,61682:57521,61683:57522,61684:57523,61685:57524,61686:57525,61687:57526,61688:57527,61689:57528,61690:57529,61691:57530,61692:57531,61760:57532,61761:57533,61762:57534,61763:57535,61764:57536,61765:57537,61766:57538,61767:57539,61768:57540,61769:57541,61770:57542,61771:57543,61772:57544,61773:57545,61774:57546,61775:57547,61776:57548,61777:57549,61778:57550,61779:57551,61780:57552,61781:57553,61782:57554,61783:57555,61784:57556,61785:57557,61786:57558,61787:57559,61788:57560,61789:57561,61790:57562,61791:57563,61792:57564,61793:57565,61794:57566,61795:57567,61796:57568,61797:57569,61798:57570,61799:57571,61800:57572,61801:57573,61802:57574,61803:57575,61804:57576,61805:57577,61806:57578,61807:57579,61808:57580,61809:57581,61810:57582,61811:57583,61812:57584,61813:57585,61814:57586,61815:57587,61816:57588,61817:57589,61818:57590,61819:57591,61820:57592,61821:57593,61822:57594,61824:57595,61825:57596,61826:57597,61827:57598,61828:57599,61829:57600,61830:57601,61831:57602,61832:57603,61833:57604,61834:57605,61835:57606,61836:57607,61837:57608,61838:57609,61839:57610,61840:57611,61841:57612,61842:57613,61843:57614,61844:57615,61845:57616,61846:57617,61847:57618,61848:57619,61849:57620,61850:57621,61851:57622,61852:57623,61853:57624,61854:57625,61855:57626,61856:57627,61857:57628,61858:57629,61859:57630,61860:57631,61861:57632,61862:57633,61863:57634,61864:57635,61865:57636,61866:57637,61867:57638,61868:57639,61869:57640,61870:57641,61871:57642,61872:57643,61873:57644,61874:57645,61875:57646,61876:57647,61877:57648,61878:57649,61879:57650,61880:57651,61881:57652,61882:57653,61883:57654,61884:57655,61885:57656,61886:57657,61887:57658,61888:57659,61889:57660,61890:57661,61891:57662,61892:57663,61893:57664,61894:57665,61895:57666,61896:57667,61897:57668,61898:57669,61899:57670,61900:57671,61901:57672,61902:57673,61903:57674,61904:57675,61905:57676,61906:57677,61907:57678,61908:57679,61909:57680,61910:57681,61911:57682,61912:57683,61913:57684,61914:57685,61915:57686,61916:57687,61917:57688,61918:57689,61919:57690,61920:57691,61921:57692,61922:57693,61923:57694,61924:57695,61925:57696,61926:57697,61927:57698,61928:57699,61929:57700,61930:57701,61931:57702,61932:57703,61933:57704,61934:57705,61935:57706,61936:57707,61937:57708,61938:57709,61939:57710,61940:57711,61941:57712,61942:57713,61943:57714,61944:57715,61945:57716,61946:57717,61947:57718,61948:57719,62016:57720,62017:57721,62018:57722,62019:57723,62020:57724,62021:57725,62022:57726,62023:57727,62024:57728,62025:57729,62026:57730,62027:57731,62028:57732,62029:57733,62030:57734,62031:57735,62032:57736,62033:57737,62034:57738,62035:57739,62036:57740,62037:57741,62038:57742,62039:57743,62040:57744,62041:57745,62042:57746,62043:57747,62044:57748,62045:57749,62046:57750,62047:57751,62048:57752,62049:57753,62050:57754,62051:57755,62052:57756,62053:57757,62054:57758,62055:57759,62056:57760,62057:57761,62058:57762,62059:57763,62060:57764,62061:57765,62062:57766,62063:57767,62064:57768,62065:57769,62066:57770,62067:57771,62068:57772,62069:57773,62070:57774,62071:57775,62072:57776,62073:57777,62074:57778,62075:57779,62076:57780,62077:57781,62078:57782,62080:57783,62081:57784,62082:57785,62083:57786,62084:57787,62085:57788,62086:57789,62087:57790,62088:57791,62089:57792,62090:57793,62091:57794,62092:57795,62093:57796,62094:57797,62095:57798,62096:57799,62097:57800,62098:57801,62099:57802,62100:57803,62101:57804,62102:57805,62103:57806,62104:57807,62105:57808,62106:57809,62107:57810,62108:57811,62109:57812,62110:57813,62111:57814,62112:57815,62113:57816,62114:57817,62115:57818,62116:57819,62117:57820,62118:57821,62119:57822,62120:57823,62121:57824,62122:57825,62123:57826,62124:57827,62125:57828,62126:57829,62127:57830,62128:57831,62129:57832,62130:57833,62131:57834,62132:57835,62133:57836,62134:57837,62135:57838,62136:57839,62137:57840,62138:57841,62139:57842,62140:57843,62141:57844,62142:57845,62143:57846,62144:57847,62145:57848,62146:57849,62147:57850,62148:57851,62149:57852,62150:57853,62151:57854,62152:57855,62153:57856,62154:57857,62155:57858,62156:57859,62157:57860,62158:57861,62159:57862,62160:57863,62161:57864,62162:57865,62163:57866,62164:57867,62165:57868,62166:57869,62167:57870,62168:57871,62169:57872,62170:57873,62171:57874,62172:57875,62173:57876,62174:57877,62175:57878,62176:57879,62177:57880,62178:57881,62179:57882,62180:57883,62181:57884,62182:57885,62183:57886,62184:57887,62185:57888,62186:57889,62187:57890,62188:57891,62189:57892,62190:57893,62191:57894,62192:57895,62193:57896,62194:57897,62195:57898,62196:57899,62197:57900,62198:57901,62199:57902,62200:57903,62201:57904,62202:57905,62203:57906,62204:57907,62272:57908,62273:57909,62274:57910,62275:57911,62276:57912,62277:57913,62278:57914,62279:57915,62280:57916,62281:57917,62282:57918,62283:57919,62284:57920,62285:57921,62286:57922,62287:57923,62288:57924,62289:57925,62290:57926,62291:57927,62292:57928,62293:57929,62294:57930,62295:57931,62296:57932,62297:57933,62298:57934,62299:57935,62300:57936,62301:57937,62302:57938,62303:57939,62304:57940,62305:57941,62306:57942,62307:57943,62308:57944,62309:57945,62310:57946,62311:57947,62312:57948,62313:57949,62314:57950,62315:57951,62316:57952,62317:57953,62318:57954,62319:57955,62320:57956,62321:57957,62322:57958,62323:57959,62324:57960,62325:57961,62326:57962,62327:57963,62328:57964,62329:57965,62330:57966,62331:57967,62332:57968,62333:57969,62334:57970,62336:57971,62337:57972,62338:57973,62339:57974,62340:57975,62341:57976,62342:57977,62343:57978,62344:57979,62345:57980,62346:57981,62347:57982,62348:57983,62349:57984,62350:57985,62351:57986,62352:57987,62353:57988,62354:57989,62355:57990,62356:57991,62357:57992,62358:57993,62359:57994,62360:57995,62361:57996,62362:57997,62363:57998,62364:57999,62365:58e3,62366:58001,62367:58002,62368:58003,62369:58004,62370:58005,62371:58006,62372:58007,62373:58008,62374:58009,62375:58010,62376:58011,62377:58012,62378:58013,62379:58014,62380:58015,62381:58016,62382:58017,62383:58018,62384:58019,62385:58020,62386:58021,62387:58022,62388:58023,62389:58024,62390:58025,62391:58026,62392:58027,62393:58028,62394:58029,62395:58030,62396:58031,62397:58032,62398:58033,62399:58034,62400:58035,62401:58036,62402:58037,62403:58038,62404:58039,62405:58040,62406:58041,62407:58042,62408:58043,62409:58044,62410:58045,62411:58046,62412:58047,62413:58048,62414:58049,62415:58050,62416:58051,62417:58052,62418:58053,62419:58054,62420:58055,62421:58056,62422:58057,62423:58058,62424:58059,62425:58060,62426:58061,62427:58062,62428:58063,62429:58064,62430:58065,62431:58066,62432:58067,62433:58068,62434:58069,62435:58070,62436:58071,62437:58072,62438:58073,62439:58074,62440:58075,62441:58076,62442:58077,62443:58078,62444:58079,62445:58080,62446:58081,62447:58082,62448:58083,62449:58084,62450:58085,62451:58086,62452:58087,62453:58088,62454:58089,62455:58090,62456:58091,62457:58092,62458:58093,62459:58094,62460:58095,62528:58096,62529:58097,62530:58098,62531:58099,62532:58100,62533:58101,62534:58102,62535:58103,62536:58104,62537:58105,62538:58106,62539:58107,62540:58108,62541:58109,62542:58110,62543:58111,62544:58112,62545:58113,62546:58114,62547:58115,62548:58116,62549:58117,62550:58118,62551:58119,62552:58120,62553:58121,62554:58122,62555:58123,62556:58124,62557:58125,62558:58126,62559:58127,62560:58128,62561:58129,62562:58130,62563:58131,62564:58132,62565:58133,62566:58134,62567:58135,62568:58136,62569:58137,62570:58138,62571:58139,62572:58140,62573:58141,62574:58142,62575:58143,62576:58144,62577:58145,62578:58146,62579:58147,62580:58148,62581:58149,62582:58150,62583:58151,62584:58152,62585:58153,62586:58154,62587:58155,62588:58156,62589:58157,62590:58158,62592:58159,62593:58160,62594:58161,62595:58162,62596:58163,62597:58164,62598:58165,62599:58166,62600:58167,62601:58168,62602:58169,62603:58170,62604:58171,62605:58172,62606:58173,62607:58174,62608:58175,62609:58176,62610:58177,62611:58178,62612:58179,62613:58180,62614:58181,62615:58182,62616:58183,62617:58184,62618:58185,62619:58186,62620:58187,62621:58188,62622:58189,62623:58190,62624:58191,62625:58192,62626:58193,62627:58194,62628:58195,62629:58196,62630:58197,62631:58198,62632:58199,62633:58200,62634:58201,62635:58202,62636:58203,62637:58204,62638:58205,62639:58206,62640:58207,62641:58208,62642:58209,62643:58210,62644:58211,62645:58212,62646:58213,62647:58214,62648:58215,62649:58216,62650:58217,62651:58218,62652:58219,62653:58220,62654:58221,62655:58222,62656:58223,62657:58224,62658:58225,62659:58226,62660:58227,62661:58228,62662:58229,62663:58230,62664:58231,62665:58232,62666:58233,62667:58234,62668:58235,62669:58236,62670:58237,62671:58238,62672:58239,62673:58240,62674:58241,62675:58242,62676:58243,62677:58244,62678:58245,62679:58246,62680:58247,62681:58248,62682:58249,62683:58250,62684:58251,62685:58252,62686:58253,62687:58254,62688:58255,62689:58256,62690:58257,62691:58258,62692:58259,62693:58260,62694:58261,62695:58262,62696:58263,62697:58264,62698:58265,62699:58266,62700:58267,62701:58268,62702:58269,62703:58270,62704:58271,62705:58272,62706:58273,62707:58274,62708:58275,62709:58276,62710:58277,62711:58278,62712:58279,62713:58280,62714:58281,62715:58282,62716:58283,62784:58284,62785:58285,62786:58286,62787:58287,62788:58288,62789:58289,62790:58290,62791:58291,62792:58292,62793:58293,62794:58294,62795:58295,62796:58296,62797:58297,62798:58298,62799:58299,62800:58300,62801:58301,62802:58302,62803:58303,62804:58304,62805:58305,62806:58306,62807:58307,62808:58308,62809:58309,62810:58310,62811:58311,62812:58312,62813:58313,62814:58314,62815:58315,62816:58316,62817:58317,62818:58318,62819:58319,62820:58320,62821:58321,62822:58322,62823:58323,62824:58324,62825:58325,62826:58326,62827:58327,62828:58328,62829:58329,62830:58330,62831:58331,62832:58332,62833:58333,62834:58334,62835:58335,62836:58336,62837:58337,62838:58338,62839:58339,62840:58340,62841:58341,62842:58342,62843:58343,62844:58344,62845:58345,62846:58346,62848:58347,62849:58348,62850:58349,62851:58350,62852:58351,62853:58352,62854:58353,62855:58354,62856:58355,62857:58356,62858:58357,62859:58358,62860:58359,62861:58360,62862:58361,62863:58362,62864:58363,62865:58364,62866:58365,62867:58366,62868:58367,62869:58368,62870:58369,62871:58370,62872:58371,62873:58372,62874:58373,62875:58374,62876:58375,62877:58376,62878:58377,62879:58378,62880:58379,62881:58380,62882:58381,62883:58382,62884:58383,62885:58384,62886:58385,62887:58386,62888:58387,62889:58388,62890:58389,62891:58390,62892:58391,62893:58392,62894:58393,62895:58394,62896:58395,62897:58396,62898:58397,62899:58398,62900:58399,62901:58400,62902:58401,62903:58402,62904:58403,62905:58404,62906:58405,62907:58406,62908:58407,62909:58408,62910:58409,62911:58410,62912:58411,62913:58412,62914:58413,62915:58414,62916:58415,62917:58416,62918:58417,62919:58418,62920:58419,62921:58420,62922:58421,62923:58422,62924:58423,62925:58424,62926:58425,62927:58426,62928:58427,62929:58428,62930:58429,62931:58430,62932:58431,62933:58432,62934:58433,62935:58434,62936:58435,62937:58436,62938:58437,62939:58438,62940:58439,62941:58440,62942:58441,62943:58442,62944:58443,62945:58444,62946:58445,62947:58446,62948:58447,62949:58448,62950:58449,62951:58450,62952:58451,62953:58452,62954:58453,62955:58454,62956:58455,62957:58456,62958:58457,62959:58458,62960:58459,62961:58460,62962:58461,62963:58462,62964:58463,62965:58464,62966:58465,62967:58466,62968:58467,62969:58468,62970:58469,62971:58470,62972:58471,63040:58472,63041:58473,63042:58474,63043:58475,63044:58476,63045:58477,63046:58478,63047:58479,63048:58480,63049:58481,63050:58482,63051:58483,63052:58484,63053:58485,63054:58486,63055:58487,63056:58488,63057:58489,63058:58490,63059:58491,63060:58492,63061:58493,63062:58494,63063:58495,63064:58496,63065:58497,63066:58498,63067:58499,63068:58500,63069:58501,63070:58502,63071:58503,63072:58504,63073:58505,63074:58506,63075:58507,63076:58508,63077:58509,63078:58510,63079:58511,63080:58512,63081:58513,63082:58514,63083:58515,63084:58516,63085:58517,63086:58518,63087:58519,63088:58520,63089:58521,63090:58522,63091:58523,63092:58524,63093:58525,63094:58526,63095:58527,63096:58528,63097:58529,63098:58530,63099:58531,63100:58532,63101:58533,63102:58534,63104:58535,63105:58536,63106:58537,63107:58538,63108:58539,63109:58540,63110:58541,63111:58542,63112:58543,63113:58544,63114:58545,63115:58546,63116:58547,63117:58548,63118:58549,63119:58550,63120:58551,63121:58552,63122:58553,63123:58554,63124:58555,63125:58556,63126:58557,63127:58558,63128:58559,63129:58560,63130:58561,63131:58562,63132:58563,63133:58564,63134:58565,63135:58566,63136:58567,63137:58568,63138:58569,63139:58570,63140:58571,63141:58572,63142:58573,63143:58574,63144:58575,63145:58576,63146:58577,63147:58578,63148:58579,63149:58580,63150:58581,63151:58582,63152:58583,63153:58584,63154:58585,63155:58586,63156:58587,63157:58588,63158:58589,63159:58590,63160:58591,63161:58592,63162:58593,63163:58594,63164:58595,63165:58596,63166:58597,63167:58598,63168:58599,63169:58600,63170:58601,63171:58602,63172:58603,63173:58604,63174:58605,63175:58606,63176:58607,63177:58608,63178:58609,63179:58610,63180:58611,63181:58612,63182:58613,63183:58614,63184:58615,63185:58616,63186:58617,63187:58618,63188:58619,63189:58620,63190:58621,63191:58622,63192:58623,63193:58624,63194:58625,63195:58626,63196:58627,63197:58628,63198:58629,63199:58630,63200:58631,63201:58632,63202:58633,63203:58634,63204:58635,63205:58636,63206:58637,63207:58638,63208:58639,63209:58640,63210:58641,63211:58642,63212:58643,63213:58644,63214:58645,63215:58646,63216:58647,63217:58648,63218:58649,63219:58650,63220:58651,63221:58652,63222:58653,63223:58654,63224:58655,63225:58656,63226:58657,63227:58658,63228:58659,63296:58660,63297:58661,63298:58662,63299:58663,63300:58664,63301:58665,63302:58666,63303:58667,63304:58668,63305:58669,63306:58670,63307:58671,63308:58672,63309:58673,63310:58674,63311:58675,63312:58676,63313:58677,63314:58678,63315:58679,63316:58680,63317:58681,63318:58682,63319:58683,63320:58684,63321:58685,63322:58686,63323:58687,63324:58688,63325:58689,63326:58690,63327:58691,63328:58692,63329:58693,63330:58694,63331:58695,63332:58696,63333:58697,63334:58698,63335:58699,63336:58700,63337:58701,63338:58702,63339:58703,63340:58704,63341:58705,63342:58706,63343:58707,63344:58708,63345:58709,63346:58710,63347:58711,63348:58712,63349:58713,63350:58714,63351:58715,63352:58716,63353:58717,63354:58718,63355:58719,63356:58720,63357:58721,63358:58722,63360:58723,63361:58724,63362:58725,63363:58726,63364:58727,63365:58728,63366:58729,63367:58730,63368:58731,63369:58732,63370:58733,63371:58734,63372:58735,63373:58736,63374:58737,63375:58738,63376:58739,63377:58740,63378:58741,63379:58742,63380:58743,63381:58744,63382:58745,63383:58746,63384:58747,63385:58748,63386:58749,63387:58750,63388:58751,63389:58752,63390:58753,63391:58754,63392:58755,63393:58756,63394:58757,63395:58758,63396:58759,63397:58760,63398:58761,63399:58762,63400:58763,63401:58764,63402:58765,63403:58766,63404:58767,63405:58768,63406:58769,63407:58770,63408:58771,63409:58772,63410:58773,63411:58774,63412:58775,63413:58776,63414:58777,63415:58778,63416:58779,63417:58780,63418:58781,63419:58782,63420:58783,63421:58784,63422:58785,63423:58786,63424:58787,63425:58788,63426:58789,63427:58790,63428:58791,63429:58792,63430:58793,63431:58794,63432:58795,63433:58796,63434:58797,63435:58798,63436:58799,63437:58800,63438:58801,63439:58802,63440:58803,63441:58804,63442:58805,63443:58806,63444:58807,63445:58808,63446:58809,63447:58810,63448:58811,63449:58812,63450:58813,63451:58814,63452:58815,63453:58816,63454:58817,63455:58818,63456:58819,63457:58820,63458:58821,63459:58822,63460:58823,63461:58824,63462:58825,63463:58826,63464:58827,63465:58828,63466:58829,63467:58830,63468:58831,63469:58832,63470:58833,63471:58834,63472:58835,63473:58836,63474:58837,63475:58838,63476:58839,63477:58840,63478:58841,63479:58842,63480:58843,63481:58844,63482:58845,63483:58846,63484:58847,63552:58848,63553:58849,63554:58850,63555:58851,63556:58852,63557:58853,63558:58854,63559:58855,63560:58856,63561:58857,63562:58858,63563:58859,63564:58860,63565:58861,63566:58862,63567:58863,63568:58864,63569:58865,63570:58866,63571:58867,63572:58868,63573:58869,63574:58870,63575:58871,63576:58872,63577:58873,63578:58874,63579:58875,63580:58876,63581:58877,63582:58878,63583:58879,63584:58880,63585:58881,63586:58882,63587:58883,63588:58884,63589:58885,63590:58886,63591:58887,63592:58888,63593:58889,63594:58890,63595:58891,63596:58892,63597:58893,63598:58894,63599:58895,63600:58896,63601:58897,63602:58898,63603:58899,63604:58900,63605:58901,63606:58902,63607:58903,63608:58904,63609:58905,63610:58906,63611:58907,63612:58908,63613:58909,63614:58910,63616:58911,63617:58912,63618:58913,63619:58914,63620:58915,63621:58916,63622:58917,63623:58918,63624:58919,63625:58920,63626:58921,63627:58922,63628:58923,63629:58924,63630:58925,63631:58926,63632:58927,63633:58928,63634:58929,63635:58930,63636:58931,63637:58932,63638:58933,63639:58934,63640:58935,63641:58936,63642:58937,63643:58938,63644:58939,63645:58940,63646:58941,63647:58942,63648:58943,63649:58944,63650:58945,63651:58946,63652:58947,63653:58948,63654:58949,63655:58950,63656:58951,63657:58952,63658:58953,63659:58954,63660:58955,63661:58956,63662:58957,63663:58958,63664:58959,63665:58960,63666:58961,63667:58962,63668:58963,63669:58964,63670:58965,63671:58966,63672:58967,63673:58968,63674:58969,63675:58970,63676:58971,63677:58972,63678:58973,63679:58974,63680:58975,63681:58976,63682:58977,63683:58978,63684:58979,63685:58980,63686:58981,63687:58982,63688:58983,63689:58984,63690:58985,63691:58986,63692:58987,63693:58988,63694:58989,63695:58990,63696:58991,63697:58992,63698:58993,63699:58994,63700:58995,63701:58996,63702:58997,63703:58998,63704:58999,63705:59e3,63706:59001,63707:59002,63708:59003,63709:59004,63710:59005,63711:59006,63712:59007,63713:59008,63714:59009,63715:59010,63716:59011,63717:59012,63718:59013,63719:59014,63720:59015,63721:59016,63722:59017,63723:59018,63724:59019,63725:59020,63726:59021,63727:59022,63728:59023,63729:59024,63730:59025,63731:59026,63732:59027,63733:59028,63734:59029,63735:59030,63736:59031,63737:59032,63738:59033,63739:59034,63740:59035,64064:8560,64065:8561,64066:8562,64067:8563,64068:8564,64069:8565,64070:8566,64071:8567,64072:8568,64073:8569,64074:8544,64075:8545,64076:8546,64077:8547,64078:8548,64079:8549,64080:8550,64081:8551,64082:8552,64083:8553,64084:65506,64085:65508,64086:65287,64087:65282,64088:12849,64089:8470,64090:8481,64091:8757,64092:32394,64093:35100,64094:37704,64095:37512,64096:34012,64097:20425,64098:28859,64099:26161,64100:26824,64101:37625,64102:26363,64103:24389,64104:20008,64105:20193,64106:20220,64107:20224,64108:20227,64109:20281,64110:20310,64111:20370,64112:20362,64113:20378,64114:20372,64115:20429,64116:20544,64117:20514,64118:20479,64119:20510,64120:20550,64121:20592,64122:20546,64123:20628,64124:20724,64125:20696,64126:20810,64128:20836,64129:20893,64130:20926,64131:20972,64132:21013,64133:21148,64134:21158,64135:21184,64136:21211,64137:21248,64138:21255,64139:21284,64140:21362,64141:21395,64142:21426,64143:21469,64144:64014,64145:21660,64146:21642,64147:21673,64148:21759,64149:21894,64150:22361,64151:22373,64152:22444,64153:22472,64154:22471,64155:64015,64156:64016,64157:22686,64158:22706,64159:22795,64160:22867,64161:22875,64162:22877,64163:22883,64164:22948,64165:22970,64166:23382,64167:23488,64168:29999,64169:23512,64170:23532,64171:23582,64172:23718,64173:23738,64174:23797,64175:23847,64176:23891,64177:64017,64178:23874,64179:23917,64180:23992,64181:23993,64182:24016,64183:24353,64184:24372,64185:24423,64186:24503,64187:24542,64188:24669,64189:24709,64190:24714,64191:24798,64192:24789,64193:24864,64194:24818,64195:24849,64196:24887,64197:24880,64198:24984,64199:25107,64200:25254,64201:25589,64202:25696,64203:25757,64204:25806,64205:25934,64206:26112,64207:26133,64208:26171,64209:26121,64210:26158,64211:26142,64212:26148,64213:26213,64214:26199,64215:26201,64216:64018,64217:26227,64218:26265,64219:26272,64220:26290,64221:26303,64222:26362,64223:26382,64224:63785,64225:26470,64226:26555,64227:26706,64228:26560,64229:26625,64230:26692,64231:26831,64232:64019,64233:26984,64234:64020,64235:27032,64236:27106,64237:27184,64238:27243,64239:27206,64240:27251,64241:27262,64242:27362,64243:27364,64244:27606,64245:27711,64246:27740,64247:27782,64248:27759,64249:27866,64250:27908,64251:28039,64252:28015,64320:28054,64321:28076,64322:28111,64323:28152,64324:28146,64325:28156,64326:28217,64327:28252,64328:28199,64329:28220,64330:28351,64331:28552,64332:28597,64333:28661,64334:28677,64335:28679,64336:28712,64337:28805,64338:28843,64339:28943,64340:28932,64341:29020,64342:28998,64343:28999,64344:64021,64345:29121,64346:29182,64347:29361,64348:29374,64349:29476,64350:64022,64351:29559,64352:29629,64353:29641,64354:29654,64355:29667,64356:29650,64357:29703,64358:29685,64359:29734,64360:29738,64361:29737,64362:29742,64363:29794,64364:29833,64365:29855,64366:29953,64367:30063,64368:30338,64369:30364,64370:30366,64371:30363,64372:30374,64373:64023,64374:30534,64375:21167,64376:30753,64377:30798,64378:30820,64379:30842,64380:31024,64381:64024,64382:64025,64384:64026,64385:31124,64386:64027,64387:31131,64388:31441,64389:31463,64390:64028,64391:31467,64392:31646,64393:64029,64394:32072,64395:32092,64396:32183,64397:32160,64398:32214,64399:32338,64400:32583,64401:32673,64402:64030,64403:33537,64404:33634,64405:33663,64406:33735,64407:33782,64408:33864,64409:33972,64410:34131,64411:34137,64412:34155,64413:64031,64414:34224,64415:64032,64416:64033,64417:34823,64418:35061,64419:35346,64420:35383,64421:35449,64422:35495,64423:35518,64424:35551,64425:64034,64426:35574,64427:35667,64428:35711,64429:36080,64430:36084,64431:36114,64432:36214,64433:64035,64434:36559,64435:64036,64436:64037,64437:36967,64438:37086,64439:64038,64440:37141,64441:37159,64442:37338,64443:37335,64444:37342,64445:37357,64446:37358,64447:37348,64448:37349,64449:37382,64450:37392,64451:37386,64452:37434,64453:37440,64454:37436,64455:37454,64456:37465,64457:37457,64458:37433,64459:37479,64460:37543,64461:37495,64462:37496,64463:37607,64464:37591,64465:37593,64466:37584,64467:64039,64468:37589,64469:37600,64470:37587,64471:37669,64472:37665,64473:37627,64474:64040,64475:37662,64476:37631,64477:37661,64478:37634,64479:37744,64480:37719,64481:37796,64482:37830,64483:37854,64484:37880,64485:37937,64486:37957,64487:37960,64488:38290,64489:63964,64490:64041,64491:38557,64492:38575,64493:38707,64494:38715,64495:38723,64496:38733,64497:38735,64498:38737,64499:38741,64500:38999,64501:39013,64502:64042,64503:64043,64504:39207,64505:64044,64506:39326,64507:39502,64508:39641,64576:39644,64577:39797,64578:39794,64579:39823,64580:39857,64581:39867,64582:39936,64583:40304,64584:40299,64585:64045,64586:40473,64587:40657}}s2u(e){for(var t=this.s2uTable,n="",r=0;r<e.length;){var i=e[r++];if(!(i>=0&&i<=126||i>=161&&i<=223)&&r<e.length&&(i=i<<8|e[r++]),void 0===t[i])return console.error("unknown char code "+i+"."),n;n+=String.fromCharCode(t[i])}return n}}class r{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t,this.encoder=new n}getInt8(){var e=this.dv.getInt8(this.offset);return this.offset+=1,e}getInt8Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt8());return t}getUint8(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e}getUint8Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint8());return t}getInt16(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt16Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt16());return t}getUint16(){var e=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}getUint16Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint16());return t}getInt32(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getUint32Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint32());return t}getFloat32(){var e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat64());return t}getIndex(e,t){switch(e){case 1:return!0===t?this.getUint8():this.getInt8();case 2:return!0===t?this.getUint16():this.getInt16();case 4:return this.getInt32();default:throw"unknown number type "+e+" exception."}}getIndexArray(e,t,n){for(var r=[],i=0;i<t;i++)r.push(this.getIndex(e,n));return r}getChars(e){for(var t="";e>0;){var n=this.getUint8();if(e--,0===n)break;t+=String.fromCharCode(n)}for(;e>0;)this.getUint8(),e--;return t}getSjisStringsAsUnicode(e){for(var t=[];e>0;){var n=this.getUint8();if(e--,0===n)break;t.push(n)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))}getUnicodeStrings(e){for(var t="";e>0;){var n=this.getUint16();if(e-=2,0===n)break;t+=String.fromCharCode(n)}for(;e>0;)this.getUint8(),e--;return t}getTextBuffer(){var e=this.getUint32();return this.getUnicodeStrings(e)}}class i{leftToRightVector3(e){e[2]=-e[2]}leftToRightQuaternion(e){e[0]=-e[0],e[1]=-e[1]}leftToRightEuler(e){e[0]=-e[0],e[1]=-e[1]}leftToRightIndexOrder(e){var t=e[2];e[2]=e[0],e[0]=t}leftToRightVector3Range(e,t){var n=-t[2];t[2]=-e[2],e[2]=n}leftToRightEulerRange(e,t){var n=-t[0],r=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=n,e[1]=r}}t.CharsetEncoder=n,t.Parser=class{constructor(){}parsePmd(e,t){var n={},i=new r(e);n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left";var s;return function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r<t.vertexCount;r++)n.vertices.push((e=void 0,(e={}).position=i.getFloat32Array(3),e.normal=i.getFloat32Array(3),e.uv=i.getFloat32Array(2),e.skinIndices=i.getUint16Array(2),e.skinWeights=[i.getUint8()/100],e.skinWeights.push(1-e.skinWeights[0]),e.edgeFlag=i.getUint8(),e))}(),function(){var e,t=n.metadata;t.faceCount=i.getUint32()/3,n.faces=[];for(var r=0;r<t.faceCount;r++)n.faces.push((e=void 0,(e={}).indices=i.getUint16Array(3),e))}(),function(){var e,t=n.metadata;t.materialCount=i.getUint32(),n.materials=[];for(var r=0;r<t.materialCount;r++)n.materials.push((e=void 0,(e={}).diffuse=i.getFloat32Array(4),e.shininess=i.getFloat32(),e.specular=i.getFloat32Array(3),e.ambient=i.getFloat32Array(3),e.toonIndex=i.getInt8(),e.edgeFlag=i.getUint8(),e.faceCount=i.getUint32()/3,e.fileName=i.getSjisStringsAsUnicode(20),e))}(),function(){var e,t=n.metadata;t.boneCount=i.getUint16(),n.bones=[];for(var r=0;r<t.boneCount;r++)n.bones.push((e=void 0,(e={}).name=i.getSjisStringsAsUnicode(20),e.parentIndex=i.getInt16(),e.tailIndex=i.getInt16(),e.type=i.getUint8(),e.ikIndex=i.getInt16(),e.position=i.getFloat32Array(3),e))}(),function(){var e=function(){var e={};e.target=i.getUint16(),e.effector=i.getUint16(),e.linkCount=i.getUint8(),e.iteration=i.getUint16(),e.maxAngle=i.getFloat32(),e.links=[];for(var t=0;t<e.linkCount;t++){var n={};n.index=i.getUint16(),e.links.push(n)}return e},t=n.metadata;t.ikCount=i.getUint16(),n.iks=[];for(var r=0;r<t.ikCount;r++)n.iks.push(e())}(),function(){var e=function(){var e={};e.name=i.getSjisStringsAsUnicode(20),e.elementCount=i.getUint32(),e.type=i.getUint8(),e.elements=[];for(var t=0;t<e.elementCount;t++)e.elements.push({index:i.getUint32(),position:i.getFloat32Array(3)});return e},t=n.metadata;t.morphCount=i.getUint16(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push(e())}(),function(){var e,t=n.metadata;t.morphFrameCount=i.getUint8(),n.morphFrames=[];for(var r=0;r<t.morphFrameCount;r++)n.morphFrames.push((e=void 0,(e={}).index=i.getUint16(),e))}(),function(){var e,t=n.metadata;t.boneFrameNameCount=i.getUint8(),n.boneFrameNames=[];for(var r=0;r<t.boneFrameNameCount;r++)n.boneFrameNames.push((e=void 0,(e={}).name=i.getSjisStringsAsUnicode(50),e))}(),function(){var e,t=n.metadata;t.boneFrameCount=i.getUint32(),n.boneFrames=[];for(var r=0;r<t.boneFrameCount;r++)n.boneFrames.push((e=void 0,(e={}).boneIndex=i.getInt16(),e.frameIndex=i.getUint8(),e))}(),(s=n.metadata).englishCompatibility=i.getUint8(),s.englishCompatibility>0&&(s.englishModelName=i.getSjisStringsAsUnicode(20),s.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t<e.boneCount;t++)n.englishBoneNames.push((r=void 0,(r={}).name=i.getSjisStringsAsUnicode(20),r));var r}}(),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishMorphNames=[];for(var t=0;t<e.morphCount-1;t++)n.englishMorphNames.push((r=void 0,(r={}).name=i.getSjisStringsAsUnicode(20),r));var r}}(),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneFrameNames=[];for(var t=0;t<e.boneFrameNameCount;t++)n.englishBoneFrameNames.push((r=void 0,(r={}).name=i.getSjisStringsAsUnicode(50),r));var r}}(),function(){var e;n.toonTextures=[];for(var t=0;t<10;t++)n.toonTextures.push((e=void 0,(e={}).fileName=i.getSjisStringsAsUnicode(100),e))}(),function(){var e,t=n.metadata;t.rigidBodyCount=i.getUint32(),n.rigidBodies=[];for(var r=0;r<t.rigidBodyCount;r++)n.rigidBodies.push((e=void 0,(e={}).name=i.getSjisStringsAsUnicode(20),e.boneIndex=i.getInt16(),e.groupIndex=i.getUint8(),e.groupTarget=i.getUint16(),e.shapeType=i.getUint8(),e.width=i.getFloat32(),e.height=i.getFloat32(),e.depth=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.weight=i.getFloat32(),e.positionDamping=i.getFloat32(),e.rotationDamping=i.getFloat32(),e.restitution=i.getFloat32(),e.friction=i.getFloat32(),e.type=i.getUint8(),e))}(),function(){var e,t=n.metadata;t.constraintCount=i.getUint32(),n.constraints=[];for(var r=0;r<t.constraintCount;r++)n.constraints.push((e=void 0,(e={}).name=i.getSjisStringsAsUnicode(20),e.rigidBodyIndex1=i.getUint32(),e.rigidBodyIndex2=i.getUint32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.translationLimitation1=i.getFloat32Array(3),e.translationLimitation2=i.getFloat32Array(3),e.rotationLimitation1=i.getFloat32Array(3),e.rotationLimitation2=i.getFloat32Array(3),e.springPosition=i.getFloat32Array(3),e.springRotation=i.getFloat32Array(3),e))}(),!0===t&&this.leftToRightModel(n),n}parsePmx(e,t){var n={},i=new r(e);n.metadata={},n.metadata.format="pmx",n.metadata.coordinateSystem="left";return function(){var e=n.metadata;if(e.magic=i.getChars(4),"PMX "!==e.magic)throw"PMX file magic is not PMX , but "+e.magic;if(e.version=i.getFloat32(),2!==e.version&&2.1!==e.version)throw"PMX version "+e.version+" is not supported.";e.headerSize=i.getUint8(),e.encoding=i.getUint8(),e.additionalUvNum=i.getUint8(),e.vertexIndexSize=i.getUint8(),e.textureIndexSize=i.getUint8(),e.materialIndexSize=i.getUint8(),e.boneIndexSize=i.getUint8(),e.morphIndexSize=i.getUint8(),e.rigidBodyIndexSize=i.getUint8(),e.modelName=i.getTextBuffer(),e.englishModelName=i.getTextBuffer(),e.comment=i.getTextBuffer(),e.englishComment=i.getTextBuffer()}(),function(){var e=function(){var e={};e.position=i.getFloat32Array(3),e.normal=i.getFloat32Array(3),e.uv=i.getFloat32Array(2),e.auvs=[];for(var r=0;r<n.metadata.additionalUvNum;r++)e.auvs.push(i.getFloat32Array(4));e.type=i.getUint8();var s=t.boneIndexSize;if(0===e.type)e.skinIndices=i.getIndexArray(s,1),e.skinWeights=[1];else if(1===e.type)e.skinIndices=i.getIndexArray(s,2),e.skinWeights=i.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]);else if(2===e.type)e.skinIndices=i.getIndexArray(s,4),e.skinWeights=i.getFloat32Array(4);else{if(3!==e.type)throw"unsupport bone type "+e.type+" exception.";e.skinIndices=i.getIndexArray(s,2),e.skinWeights=i.getFloat32Array(1),e.skinWeights.push(1-e.skinWeights[0]),e.skinC=i.getFloat32Array(3),e.skinR0=i.getFloat32Array(3),e.skinR1=i.getFloat32Array(3),e.type=1}return e.edgeRatio=i.getFloat32(),e},t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r<t.vertexCount;r++)n.vertices.push(e())}(),function(){var e,t=n.metadata;t.faceCount=i.getUint32()/3,n.faces=[];for(var r=0;r<t.faceCount;r++)n.faces.push((e=void 0,(e={}).indices=i.getIndexArray(t.vertexIndexSize,3,!0),e))}(),function(){var e=n.metadata;e.textureCount=i.getUint32(),n.textures=[];for(var t=0;t<e.textureCount;t++)n.textures.push(i.getTextBuffer())}(),function(){var e=function(){var e={};if(e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.diffuse=i.getFloat32Array(4),e.specular=i.getFloat32Array(3),e.shininess=i.getFloat32(),e.ambient=i.getFloat32Array(3),e.flag=i.getUint8(),e.edgeColor=i.getFloat32Array(4),e.edgeSize=i.getFloat32(),e.textureIndex=i.getIndex(n.metadata.textureIndexSize),e.envTextureIndex=i.getIndex(n.metadata.textureIndexSize),e.envFlag=i.getUint8(),e.toonFlag=i.getUint8(),0===e.toonFlag)e.toonIndex=i.getIndex(n.metadata.textureIndexSize);else{if(1!==e.toonFlag)throw"unknown toon flag "+e.toonFlag+" exception.";e.toonIndex=i.getInt8()}return e.comment=i.getTextBuffer(),e.faceCount=i.getUint32()/3,e},t=n.metadata;t.materialCount=i.getUint32(),n.materials=[];for(var r=0;r<t.materialCount;r++)n.materials.push(e())}(),function(){var e=function(){var e={};if(e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.position=i.getFloat32Array(3),e.parentIndex=i.getIndex(n.metadata.boneIndexSize),e.transformationClass=i.getUint32(),e.flag=i.getUint16(),1&e.flag?e.connectIndex=i.getIndex(n.metadata.boneIndexSize):e.offsetPosition=i.getFloat32Array(3),256&e.flag||512&e.flag){var t={};t.isLocal=0!=(128&e.flag),t.affectRotation=0!=(256&e.flag),t.affectPosition=0!=(512&e.flag),t.parentIndex=i.getIndex(n.metadata.boneIndexSize),t.ratio=i.getFloat32(),e.grant=t}if(1024&e.flag&&(e.fixAxis=i.getFloat32Array(3)),2048&e.flag&&(e.localXVector=i.getFloat32Array(3),e.localZVector=i.getFloat32Array(3)),8192&e.flag&&(e.key=i.getUint32()),32&e.flag){var r={};r.effector=i.getIndex(n.metadata.boneIndexSize),r.target=null,r.iteration=i.getUint32(),r.maxAngle=i.getFloat32(),r.linkCount=i.getUint32(),r.links=[];for(var s=0;s<r.linkCount;s++){var a={};a.index=i.getIndex(n.metadata.boneIndexSize),a.angleLimitation=i.getUint8(),1===a.angleLimitation&&(a.lowerLimitationAngle=i.getFloat32Array(3),a.upperLimitationAngle=i.getFloat32Array(3)),r.links.push(a)}e.ik=r}return e},t=n.metadata;t.boneCount=i.getUint32(),n.bones=[];for(var r=0;r<t.boneCount;r++)n.bones.push(e())}(),function(){var e=function(){var e={};e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.panel=i.getUint8(),e.type=i.getUint8(),e.elementCount=i.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++){if(0===e.type)(r={}).index=i.getIndex(n.metadata.morphIndexSize),r.ratio=i.getFloat32(),e.elements.push(r);else if(1===e.type){(r={}).index=i.getIndex(n.metadata.vertexIndexSize,!0),r.position=i.getFloat32Array(3),e.elements.push(r)}else if(2===e.type){(r={}).index=i.getIndex(n.metadata.boneIndexSize),r.position=i.getFloat32Array(3),r.rotation=i.getFloat32Array(4),e.elements.push(r)}else if(3===e.type){(r={}).index=i.getIndex(n.metadata.vertexIndexSize,!0),r.uv=i.getFloat32Array(4),e.elements.push(r)}else if(4===e.type);else if(5===e.type);else if(6===e.type);else if(7===e.type);else if(8===e.type){var r;(r={}).index=i.getIndex(n.metadata.materialIndexSize),r.type=i.getUint8(),r.diffuse=i.getFloat32Array(4),r.specular=i.getFloat32Array(3),r.shininess=i.getFloat32(),r.ambient=i.getFloat32Array(3),r.edgeColor=i.getFloat32Array(4),r.edgeSize=i.getFloat32(),r.textureColor=i.getFloat32Array(4),r.sphereTextureColor=i.getFloat32Array(4),r.toonColor=i.getFloat32Array(4),e.elements.push(r)}}return e},t=n.metadata;t.morphCount=i.getUint32(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push(e())}(),function(){var e=function(){var e={};e.name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.type=i.getUint8(),e.elementCount=i.getUint32(),e.elements=[];for(var t=0;t<e.elementCount;t++){var r={};r.target=i.getUint8(),r.index=0===r.target?i.getIndex(n.metadata.boneIndexSize):i.getIndex(n.metadata.morphIndexSize),e.elements.push(r)}return e},t=n.metadata;t.frameCount=i.getUint32(),n.frames=[];for(var r=0;r<t.frameCount;r++)n.frames.push(e())}(),function(){var e,t=n.metadata;t.rigidBodyCount=i.getUint32(),n.rigidBodies=[];for(var r=0;r<t.rigidBodyCount;r++)n.rigidBodies.push((e=void 0,(e={}).name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.boneIndex=i.getIndex(n.metadata.boneIndexSize),e.groupIndex=i.getUint8(),e.groupTarget=i.getUint16(),e.shapeType=i.getUint8(),e.width=i.getFloat32(),e.height=i.getFloat32(),e.depth=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.weight=i.getFloat32(),e.positionDamping=i.getFloat32(),e.rotationDamping=i.getFloat32(),e.restitution=i.getFloat32(),e.friction=i.getFloat32(),e.type=i.getUint8(),e))}(),function(){var e,t=n.metadata;t.constraintCount=i.getUint32(),n.constraints=[];for(var r=0;r<t.constraintCount;r++)n.constraints.push((e=void 0,(e={}).name=i.getTextBuffer(),e.englishName=i.getTextBuffer(),e.type=i.getUint8(),e.rigidBodyIndex1=i.getIndex(n.metadata.rigidBodyIndexSize),e.rigidBodyIndex2=i.getIndex(n.metadata.rigidBodyIndexSize),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.translationLimitation1=i.getFloat32Array(3),e.translationLimitation2=i.getFloat32Array(3),e.rotationLimitation1=i.getFloat32Array(3),e.rotationLimitation2=i.getFloat32Array(3),e.springPosition=i.getFloat32Array(3),e.springRotation=i.getFloat32Array(3),e))}(),!0===t&&this.leftToRightModel(n),n}parseVmd(e,t){var n={},i=new r(e);n.metadata={},n.metadata.coordinateSystem="left";return function(){var e=n.metadata;if(e.magic=i.getChars(30),"Vocaloid Motion Data 0002"!==e.magic)throw"VMD file magic is not Vocaloid Motion Data 0002, but "+e.magic;e.name=i.getSjisStringsAsUnicode(20)}(),function(){var e,t=n.metadata;t.motionCount=i.getUint32(),n.motions=[];for(var r=0;r<t.motionCount;r++)n.motions.push((e=void 0,(e={}).boneName=i.getSjisStringsAsUnicode(15),e.frameNum=i.getUint32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(4),e.interpolation=i.getUint8Array(64),e))}(),function(){var e,t=n.metadata;t.morphCount=i.getUint32(),n.morphs=[];for(var r=0;r<t.morphCount;r++)n.morphs.push((e=void 0,(e={}).morphName=i.getSjisStringsAsUnicode(15),e.frameNum=i.getUint32(),e.weight=i.getFloat32(),e))}(),function(){var e,t=n.metadata;t.cameraCount=i.getUint32(),n.cameras=[];for(var r=0;r<t.cameraCount;r++)n.cameras.push((e=void 0,(e={}).frameNum=i.getUint32(),e.distance=i.getFloat32(),e.position=i.getFloat32Array(3),e.rotation=i.getFloat32Array(3),e.interpolation=i.getUint8Array(24),e.fov=i.getUint32(),e.perspective=i.getUint8(),e))}(),!0===t&&this.leftToRightVmd(n),n}parseVpd(e,t){var n={metadata:{}};n.metadata.coordinateSystem="left",n.bones=[];var r=e.replace(/\/\/\w*(\r|\n|\r\n)/g,"").split(/\r|\n|\r\n/);function i(){throw"the file seems not vpd file."}return"Vocaloid Pose Data file"!==r[0]&&i(),r.length<4&&i(),n.metadata.parentFile=r[2],n.metadata.boneCount=parseInt(r[3]),function(){for(var e=/^\s*(Bone[0-9]+)\s*\{\s*(.*)$/,t=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,s=/^\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*,\s*(-?[0-9]+\.[0-9]+)\s*;/,a=/^\s*}/,o=n.bones,l=null,c=null,h=null,u=4;u<r.length;u++){var d,p=r[u];null!==(d=p.match(e))&&(null!==l&&i(),l=d[2]),null!==(d=p.match(t))&&(null!==c&&i(),c=[parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])]),null!==(d=p.match(s))&&(null!==h&&i(),h=[parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]),parseFloat(d[4])]),null!==(d=p.match(a))&&(null!==l&&null!==c&&null!==h||i(),o.push({name:l,translation:c,quaternion:h}),l=null,c=null,h=null)}null===l&&null===c&&null===h||i()}(),!0===t&&this.leftToRightVpd(n),n}mergeVmds(e){var t={metadata:{}};t.metadata.name=e[0].metadata.name,t.metadata.coordinateSystem=e[0].metadata.coordinateSystem,t.metadata.motionCount=0,t.metadata.morphCount=0,t.metadata.cameraCount=0,t.motions=[],t.morphs=[],t.cameras=[];for(var n=0;n<e.length;n++){var r=e[n];t.metadata.motionCount+=r.metadata.motionCount,t.metadata.morphCount+=r.metadata.morphCount,t.metadata.cameraCount+=r.metadata.cameraCount;for(var i=0;i<r.metadata.motionCount;i++)t.motions.push(r.motions[i]);for(i=0;i<r.metadata.morphCount;i++)t.morphs.push(r.morphs[i]);for(i=0;i<r.metadata.cameraCount;i++)t.cameras.push(r.cameras[i])}return t}leftToRightModel(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.metadata.vertexCount;n++)t.leftToRightVector3(e.vertices[n].position),t.leftToRightVector3(e.vertices[n].normal);for(n=0;n<e.metadata.faceCount;n++)t.leftToRightIndexOrder(e.faces[n].indices);for(n=0;n<e.metadata.boneCount;n++)t.leftToRightVector3(e.bones[n].position);for(n=0;n<e.metadata.morphCount;n++){var r=e.morphs[n];if("pmx"!==e.metadata.format||1===r.type)for(var s=0;s<r.elements.length;s++)t.leftToRightVector3(r.elements[s].position)}for(n=0;n<e.metadata.rigidBodyCount;n++)t.leftToRightVector3(e.rigidBodies[n].position),t.leftToRightEuler(e.rigidBodies[n].rotation);for(n=0;n<e.metadata.constraintCount;n++)t.leftToRightVector3(e.constraints[n].position),t.leftToRightEuler(e.constraints[n].rotation),t.leftToRightVector3Range(e.constraints[n].translationLimitation1,e.constraints[n].translationLimitation2),t.leftToRightEulerRange(e.constraints[n].rotationLimitation1,e.constraints[n].rotationLimitation2)}}leftToRightVmd(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.metadata.motionCount;n++)t.leftToRightVector3(e.motions[n].position),t.leftToRightQuaternion(e.motions[n].rotation);for(n=0;n<e.metadata.cameraCount;n++)t.leftToRightVector3(e.cameras[n].position),t.leftToRightEuler(e.cameras[n].rotation)}}leftToRightVpd(e){if("right"!==e.metadata.coordinateSystem){e.metadata.coordinateSystem="right";for(var t=new i,n=0;n<e.bones.length;n++)t.leftToRightVector3(e.bones[n].translation),t.leftToRightQuaternion(e.bones[n].quaternion)}}}},55599:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const{parseBuffer:n}=(()=>{var e=0,n=-3;function r(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function i(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new r,this.dtree=new r}var s=new r,a=new r,o=new Uint8Array(30),l=new Uint16Array(30),c=new Uint8Array(30),h=new Uint16Array(30),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new r,p=new Uint8Array(320);function f(e,t,n,r){var i,s;for(i=0;i<n;++i)e[i]=0;for(i=0;i<30-n;++i)e[i+n]=i/n|0;for(s=r,i=0;i<30;++i)t[i]=s,s+=1<<e[i]}var m=new Uint16Array(16);function g(e,t,n,r){var i,s;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<r;++i)e.table[t[n+i]]++;for(e.table[0]=0,s=0,i=0;i<16;++i)m[i]=s,s+=e.table[i];for(i=0;i<r;++i)t[n+i]&&(e.trans[m[t[n+i]]++]=i)}function A(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function v(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function y(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,r=0,i=0,s=e.tag;do{r=2*r+(1&s),s>>>=1,++i,n+=t.table[i],r-=t.table[i]}while(r>=0);return e.tag=s,e.bitcount-=i,t.trans[n+r]}function x(e,t,n){var r,i,s,a,o,l;for(r=v(e,5,257),i=v(e,5,1),s=v(e,4,4),a=0;a<19;++a)p[a]=0;for(a=0;a<s;++a){var c=v(e,3,0);p[u[a]]=c}for(g(d,p,0,19),o=0;o<r+i;){var h=y(e,d);switch(h){case 16:var f=p[o-1];for(l=v(e,2,3);l;--l)p[o++]=f;break;case 17:for(l=v(e,3,3);l;--l)p[o++]=0;break;case 18:for(l=v(e,7,11);l;--l)p[o++]=0;break;default:p[o++]=h}}g(t,p,0,r),g(n,p,r,i)}function b(t,n,r){for(;;){var i,s,a,u,d=y(t,n);if(256===d)return e;if(d<256)t.dest[t.destLen++]=d;else for(i=v(t,o[d-=257],l[d]),s=y(t,r),u=a=t.destLen-v(t,c[s],h[s]);u<a+i;++u)t.dest[t.destLen++]=t.dest[u]}}function E(t){for(var r,i;t.bitcount>8;)t.sourceIndex--,t.bitcount-=8;if((r=256*(r=t.source[t.sourceIndex+1])+t.source[t.sourceIndex])!==(65535&~(256*t.source[t.sourceIndex+3]+t.source[t.sourceIndex+2])))return n;for(t.sourceIndex+=4,i=r;i;--i)t.dest[t.destLen++]=t.source[t.sourceIndex++];return t.bitcount=0,e}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(s,a),f(o,l,4,3),f(c,h,2,1),o[28]=0,l[28]=258;var _=function(t,r){var o,l,c=new i(t,r);do{switch(o=A(c),v(c,2,0)){case 0:l=E(c);break;case 1:l=b(c,s,a);break;case 2:x(c,c.ltree,c.dtree),l=b(c,c.ltree,c.dtree);break;default:l=n}if(l!==e)throw new Error("Data error")}while(!o);return c.destLen<c.dest.length?"function"==typeof c.dest.slice?c.dest.slice(0,c.destLen):c.dest.subarray(0,c.destLen):c.dest};function S(e,t,n,r,i){return Math.pow(1-i,3)*e+3*Math.pow(1-i,2)*i*t+3*(1-i)*Math.pow(i,2)*n+Math.pow(i,3)*r}function w(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function M(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function C(e){throw new Error(e)}function T(e,t){e||C(t)}w.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},w.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},w.prototype.addX=function(e){this.addPoint(e,null)},w.prototype.addY=function(e){this.addPoint(null,e)},w.prototype.addBezier=function(e,t,n,r,i,s,a,o){var l=[e,t],c=[n,r],h=[i,s],u=[a,o];this.addPoint(e,t),this.addPoint(a,o);for(var d=0;d<=1;d++){var p=6*l[d]-12*c[d]+6*h[d],f=-3*l[d]+9*c[d]-9*h[d]+3*u[d],m=3*c[d]-3*l[d];if(0!==f){var g=Math.pow(p,2)-4*m*f;if(!(g<0)){var A=(-p+Math.sqrt(g))/(2*f);0<A&&A<1&&(0===d&&this.addX(S(l[d],c[d],h[d],u[d],A)),1===d&&this.addY(S(l[d],c[d],h[d],u[d],A)));var v=(-p-Math.sqrt(g))/(2*f);0<v&&v<1&&(0===d&&this.addX(S(l[d],c[d],h[d],u[d],v)),1===d&&this.addY(S(l[d],c[d],h[d],u[d],v)))}}else{if(0===p)continue;var y=-m/p;0<y&&y<1&&(0===d&&this.addX(S(l[d],c[d],h[d],u[d],y)),1===d&&this.addY(S(l[d],c[d],h[d],u[d],y)))}}},w.prototype.addQuad=function(e,t,n,r,i,s){var a=e+2/3*(n-e),o=t+2/3*(r-t),l=a+1/3*(i-e),c=o+1/3*(s-t);this.addBezier(e,t,a,o,l,c,i,s)},M.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},M.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},M.prototype.curveTo=M.prototype.bezierCurveTo=function(e,t,n,r,i,s){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:r,x:i,y:s})},M.prototype.quadTo=M.prototype.quadraticCurveTo=function(e,t,n,r){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:r})},M.prototype.close=M.prototype.closePath=function(){this.commands.push({type:"Z"})},M.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof w){var t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},M.prototype.getBoundingBox=function(){for(var e=new w,t=0,n=0,r=0,i=0,s=0;s<this.commands.length;s++){var a=this.commands[s];switch(a.type){case"M":e.addPoint(a.x,a.y),t=r=a.x,n=i=a.y;break;case"L":e.addPoint(a.x,a.y),r=a.x,i=a.y;break;case"Q":e.addQuad(r,i,a.x1,a.y1,a.x,a.y),r=a.x,i=a.y;break;case"C":e.addBezier(r,i,a.x1,a.y1,a.x2,a.y2,a.x,a.y),r=a.x,i=a.y;break;case"Z":r=t,i=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},M.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},M.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function n(){for(var e=arguments,n="",r=0;r<arguments.length;r+=1){var i=e[r];i>=0&&r>0&&(n+=" "),n+=t(i)}return n}e=void 0!==e?e:2;for(var r="",i=0;i<this.commands.length;i+=1){var s=this.commands[i];"M"===s.type?r+="M"+n(s.x,s.y):"L"===s.type?r+="L"+n(s.x,s.y):"C"===s.type?r+="C"+n(s.x1,s.y1,s.x2,s.y2,s.x,s.y):"Q"===s.type?r+="Q"+n(s.x1,s.y1,s.x,s.y):"Z"===s.type&&(r+="Z")}return r},M.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},M.prototype.toDOMElement=function(e){var t=this.toPathData(e),n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),n};var I={fail:C,argument:T,assert:T},B=2147483648,R={},P={},D={};function L(e){return function(){return e}}P.BYTE=function(e){return I.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},D.BYTE=L(1),P.CHAR=function(e){return[e.charCodeAt(0)]},D.CHAR=L(1),P.CHARARRAY=function(e){void 0===e&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var t=[],n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},D.CHARARRAY=function(e){return void 0===e?0:e.length},P.USHORT=function(e){return[e>>8&255,255&e]},D.USHORT=L(2),P.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},D.SHORT=L(2),P.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},D.UINT24=L(3),P.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},D.ULONG=L(4),P.LONG=function(e){return e>=B&&(e=-(2*B-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONG=L(4),P.FIXED=P.ULONG,D.FIXED=D.ULONG,P.FWORD=P.SHORT,D.FWORD=D.SHORT,P.UFWORD=P.USHORT,D.UFWORD=D.USHORT,P.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONGDATETIME=L(8),P.TAG=function(e){return I.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},D.TAG=L(4),P.Card8=P.BYTE,D.Card8=D.BYTE,P.Card16=P.USHORT,D.Card16=D.USHORT,P.OffSize=P.BYTE,D.OffSize=D.BYTE,P.SID=P.USHORT,D.SID=D.USHORT,P.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?P.NUMBER16(e):P.NUMBER32(e)},D.NUMBER=function(e){return P.NUMBER(e).length},P.NUMBER16=function(e){return[28,e>>8&255,255&e]},D.NUMBER16=L(3),P.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},D.NUMBER32=L(5),P.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var r=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*r)/r).toString()}for(var i="",s=0,a=t.length;s<a;s+=1){var o=t[s];i+="e"===o?"-"===t[++s]?"c":"b":"."===o?"a":"-"===o?"e":o}for(var l=[30],c=0,h=(i+=1&i.length?"f":"ff").length;c<h;c+=2)l.push(parseInt(i.substr(c,2),16));return l},D.REAL=function(e){return P.REAL(e).length},P.NAME=P.CHARARRAY,D.NAME=D.CHARARRAY,P.STRING=P.CHARARRAY,D.STRING=D.CHARARRAY,R.UTF8=function(e,t,n){for(var r=[],i=n,s=0;s<i;s++,t+=1)r[s]=e.getUint8(t);return String.fromCharCode.apply(null,r)},R.UTF16=function(e,t,n){for(var r=[],i=n/2,s=0;s<i;s++,t+=2)r[s]=e.getUint16(t);return String.fromCharCode.apply(null,r)},P.UTF16=function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t[t.length]=r>>8&255,t[t.length]=255&r}return t},D.UTF16=function(e){return 2*e.length};var F={"x-mac-croatian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\u0160\u2122\xb4\xa8\u2260\u017d\xd8\u221e\xb1\u2264\u2265\u2206\xb5\u2202\u2211\u220f\u0161\u222b\xaa\xba\u03a9\u017e\xf8\xbf\xa1\xac\u221a\u0192\u2248\u0106\xab\u010c\u2026 \xc0\xc3\xd5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\uf8ff\xa9\u2044\u20ac\u2039\u203a\xc6\xbb\u2013\xb7\u201a\u201e\u2030\xc2\u0107\xc1\u010d\xc8\xcd\xce\xcf\xcc\xd3\xd4\u0111\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u03c0\xcb\u02da\xb8\xca\xe6\u02c7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\xb0\u0490\xa3\xa7\u2022\xb6\u0406\xae\xa9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\xb1\u2264\u2265\u0456\xb5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e","x-mac-gaelic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u1e02\xb1\u2264\u2265\u1e03\u010a\u010b\u1e0a\u1e0b\u1e1e\u1e1f\u0120\u0121\u1e40\xe6\xf8\u1e41\u1e56\u1e57\u027c\u0192\u017f\u1e60\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u1e61\u1e9b\xff\u0178\u1e6a\u20ac\u2039\u203a\u0176\u0177\u1e6b\xb7\u1ef2\u1ef3\u204a\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\u2663\xd2\xda\xdb\xd9\u0131\xdd\xfd\u0174\u0175\u1e84\u1e85\u1e80\u1e81\u1e82\u1e83","x-mac-greek":"\xc4\xb9\xb2\xc9\xb3\xd6\xdc\u0385\xe0\xe2\xe4\u0384\xa8\xe7\xe9\xe8\xea\xeb\xa3\u2122\xee\xef\u2022\xbd\u2030\xf4\xf6\xa6\u20ac\xf9\xfb\xfc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\xdf\xae\xa9\u03a3\u03aa\xa7\u2260\xb0\xb7\u0391\xb1\u2264\u2265\xa5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\xac\u039f\u03a1\u2248\u03a4\xab\xbb\u2026 \u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\xf7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\xad","x-mac-icelandic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\xdd\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\xd0\xf0\xde\xfe\xfd\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140a\u140b\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144e\u144f\u1450\u1451\u1455\u1456\u1466\u146d\u146e\u146f\u1470\u1472\u1473\u1483\u148b\u148c\u148d\u148e\u1490\u1491\xb0\u14a1\u14a5\u14a6\u2022\xb6\u14a7\xae\xa9\u2122\u14a8\u14aa\u14ab\u14bb\u14c2\u14c3\u14c4\u14c5\u14c7\u14c8\u14d0\u14ef\u14f0\u14f1\u14f2\u14f4\u14f5\u1505\u14d5\u14d6\u14d7\u14d8\u14da\u14db\u14ea\u1528\u1529\u152a\u152b\u152d\u2026 \u152e\u153e\u1555\u1556\u1557\u2013\u2014\u201c\u201d\u2018\u2019\u1558\u1559\u155a\u155d\u1546\u1547\u1548\u1549\u154b\u154c\u1550\u157f\u1580\u1581\u1582\u1583\u1584\u1585\u158f\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15a0\u15a1\u15a2\u15a3\u15a4\u15a5\u15a6\u157c\u0141\u0142","x-mac-ce":"\xc4\u0100\u0101\xc9\u0104\xd6\xdc\xe1\u0105\u010c\xe4\u010d\u0106\u0107\xe9\u0179\u017a\u010e\xed\u010f\u0112\u0113\u0116\xf3\u0117\xf4\xf6\xf5\xfa\u011a\u011b\xfc\u2020\xb0\u0118\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\u0119\xa8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\xac\u221a\u0144\u0147\u2206\xab\xbb\u2026 \u0148\u0150\xd5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\xc1\u0164\u0165\xcd\u017d\u017e\u016a\xd3\xd4\u016b\u016e\xda\u016f\u0170\u0171\u0172\u0173\xdd\xfd\u0137\u017b\u0141\u017c\u0122\u02c7",macintosh:"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\ufb01\ufb02\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-romanian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\u0102\u0218\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\u0103\u0219\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-turkish":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\uf8a0\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7"};R.MACSTRING=function(e,t,n,r){var i=F[r];if(void 0!==i){for(var s="",a=0;a<n;a++){var o=e.getUint8(t+a);s+=o<=127?String.fromCharCode(o):i[127&o]}return s}};var U,O="function"==typeof WeakMap&&new WeakMap;function N(e){return e>=-128&&e<=127}function k(e,t,n){for(var r=0,i=e.length;t<i&&r<64&&0===e[t];)++t,++r;return n.push(128|r-1),t}function G(e,t,n){for(var r=0,i=e.length,s=t;s<i&&r<64;){var a=e[s];if(!N(a))break;if(0===a&&s+1<i&&0===e[s+1])break;++s,++r}n.push(r-1);for(var o=t;o<s;++o)n.push(e[o]+256&255);return s}function z(e,t,n){for(var r=0,i=e.length,s=t;s<i&&r<64;){var a=e[s];if(0===a)break;if(N(a)&&s+1<i&&N(e[s+1]))break;++s,++r}n.push(64|r-1);for(var o=t;o<s;++o){var l=e[o];n.push(l+65536>>8&255,l+256&255)}return s}P.MACSTRING=function(e,t){var n=function(e){if(!U)for(var t in U={},F)U[t]=new String(t);var n=U[e];if(void 0!==n){if(O){var r=O.get(n);if(void 0!==r)return r}var i=F[e];if(void 0!==i){for(var s={},a=0;a<i.length;a++)s[i.charCodeAt(a)]=a+128;return O&&O.set(n,s),s}}}(t);if(void 0!==n){for(var r=[],i=0;i<e.length;i++){var s=e.charCodeAt(i);if(s>=128&&void 0===(s=n[s]))return;r[i]=s}return r}},D.MACSTRING=function(e,t){var n=P.MACSTRING(e,t);return void 0!==n?n.length:0},P.VARDELTAS=function(e){for(var t=0,n=[];t<e.length;){var r=e[t];t=0===r?k(e,t,n):r>=-128&&r<=127?G(e,t,n):z(e,t,n)}return n},P.INDEX=function(e){for(var t=1,n=[t],r=[],i=0;i<e.length;i+=1){var s=P.OBJECT(e[i]);Array.prototype.push.apply(r,s),t+=s.length,n.push(t)}if(0===r.length)return[0,0];for(var a=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,P.BYTE,P.USHORT,P.UINT24,P.ULONG][o],c=0;c<n.length;c+=1){var h=l(n[c]);Array.prototype.push.apply(a,h)}return Array.prototype.concat(P.Card16(e.length),P.OffSize(o),a,r)},D.INDEX=function(e){return P.INDEX(e).length},P.DICT=function(e){for(var t=[],n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var s=parseInt(n[i],0),a=e[s];t=(t=t.concat(P.OPERAND(a.value,a.type))).concat(P.OPERATOR(s))}return t},D.DICT=function(e){return P.DICT(e).length},P.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},P.OPERAND=function(e,t){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r+=1)I.argument(e.length===t.length,"Not enough arguments given for type"+t),n=n.concat(P.OPERAND(e[r],t[r]));else if("SID"===t)n=n.concat(P.NUMBER(e));else if("offset"===t)n=n.concat(P.NUMBER32(e));else if("number"===t)n=n.concat(P.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);n=n.concat(P.REAL(e))}return n},P.OP=P.BYTE,D.OP=D.BYTE;var Q="function"==typeof WeakMap&&new WeakMap;function V(e,t,n){if(t.length&&("coverageFormat"!==t[0].name||1===t[0].value))for(var r=0;r<t.length;r+=1){var i=t[r];this[i.name]=i.value}if(this.tableName=e,this.fields=t,n)for(var s=Object.keys(n),a=0;a<s.length;a+=1){var o=s[a],l=n[o];void 0!==this[o]&&(this[o]=l)}}function H(e,t,n){void 0===n&&(n=t.length);var r=new Array(t.length+1);r[0]={name:e+"Count",type:"USHORT",value:n};for(var i=0;i<t.length;i++)r[i+1]={name:e+i,type:"USHORT",value:t[i]};return r}function j(e,t,n){var r=t.length,i=new Array(r+1);i[0]={name:e+"Count",type:"USHORT",value:r};for(var s=0;s<r;s++)i[s+1]={name:e+s,type:"TABLE",value:n(t[s],s)};return i}function W(e,t,n){var r=t.length,i=[];i[0]={name:e+"Count",type:"USHORT",value:r};for(var s=0;s<r;s++)i=i.concat(n(t[s],s));return i}function X(e){1===e.format?V.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(H("glyph",e.glyphs))):2===e.format?V.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(W("rangeRecord",e.ranges,(function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]})))):I.assert(!1,"Coverage format must be 1 or 2.")}function Y(e){V.call(this,"scriptListTable",W("scriptRecord",e,(function(e,t){var n=e.script,r=n.defaultLangSys;return I.assert(!!r,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new V("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new V("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(H("featureIndex",r.featureIndexes)))}].concat(W("langSys",n.langSysRecords,(function(e,t){var n=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new V("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(H("featureIndex",n.featureIndexes)))}]}))))}]})))}function q(e){V.call(this,"featureListTable",W("featureRecord",e,(function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new V("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(H("lookupListIndex",n.lookupListIndexes)))}]})))}function K(e,t){V.call(this,"lookupListTable",j("lookup",e,(function(e){var n=t[e.lookupType];return I.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new V("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(j("subtable",e.subtables,n)))})))}P.CHARSTRING=function(e){if(Q){var t=Q.get(e);if(void 0!==t)return t}for(var n=[],r=e.length,i=0;i<r;i+=1){var s=e[i];n=n.concat(P[s.type](s.value))}return Q&&Q.set(e,n),n},D.CHARSTRING=function(e){return P.CHARSTRING(e).length},P.OBJECT=function(e){var t=P[e.type];return I.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},D.OBJECT=function(e){var t=D[e.type];return I.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},P.TABLE=function(e){for(var t=[],n=e.fields.length,r=[],i=[],s=0;s<n;s+=1){var a=e.fields[s],o=P[a.type];I.argument(void 0!==o,"No encoding function for field type "+a.type+" ("+a.name+")");var l=e[a.name];void 0===l&&(l=a.value);var c=o(l);"TABLE"===a.type?(i.push(t.length),t=t.concat([0,0]),r.push(c)):t=t.concat(c)}for(var h=0;h<r.length;h+=1){var u=i[h],d=t.length;I.argument(d<65536,"Table "+e.tableName+" too big."),t[u]=d>>8,t[u+1]=255&d,t=t.concat(r[h])}return t},D.TABLE=function(e){for(var t=0,n=e.fields.length,r=0;r<n;r+=1){var i=e.fields[r],s=D[i.type];I.argument(void 0!==s,"No sizeOf function for field type "+i.type+" ("+i.name+")");var a=e[i.name];void 0===a&&(a=i.value),t+=s(a),"TABLE"===i.type&&(t+=2)}return t},P.RECORD=P.TABLE,D.RECORD=D.TABLE,P.LITERAL=function(e){return e},D.LITERAL=function(e){return e.length},V.prototype.encode=function(){return P.TABLE(this)},V.prototype.sizeOf=function(){return D.TABLE(this)},X.prototype=Object.create(V.prototype),X.prototype.constructor=X,Y.prototype=Object.create(V.prototype),Y.prototype.constructor=Y,q.prototype=Object.create(V.prototype),q.prototype.constructor=q,K.prototype=Object.create(V.prototype),K.prototype.constructor=K;var J={Table:V,Record:V,Coverage:X,ScriptList:Y,FeatureList:q,LookupList:K,ushortList:H,tableList:j,recordList:W};function Z(e,t){return e.getUint8(t)}function $(e,t){return e.getUint16(t,!1)}function ee(e,t){return e.getUint32(t,!1)}function te(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var ne={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function re(e,t){this.data=e,this.offset=t,this.relativeOffset=0}re.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseCard8=re.prototype.parseByte,re.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseCard16=re.prototype.parseUShort,re.prototype.parseSID=re.prototype.parseUShort,re.prototype.parseOffset16=re.prototype.parseUShort,re.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},re.prototype.parseULong=function(){var e=ee(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseOffset32=re.prototype.parseULong,re.prototype.parseFixed=function(){var e=te(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseString=function(e){var t=this.data,n=this.offset+this.relativeOffset,r="";this.relativeOffset+=e;for(var i=0;i<e;i++)r+=String.fromCharCode(t.getUint8(n+i));return r},re.prototype.parseTag=function(){return this.parseString(4)},re.prototype.parseLongDateTime=function(){var e=ee(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},re.prototype.parseVersion=function(e){var t=$(this.data,this.offset+this.relativeOffset),n=$(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+n/e/10},re.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=ne[e]*t},re.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint32(r),r+=4;return this.relativeOffset+=4*e,t},re.prototype.parseOffset16List=re.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint16(r),r+=2;return this.relativeOffset+=2*e,t},re.prototype.parseShortList=function(e){for(var t=new Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getInt16(r),r+=2;return this.relativeOffset+=2*e,t},re.prototype.parseByteList=function(e){for(var t=new Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint8(r++);return this.relativeOffset+=e,t},re.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=new Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},re.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=new Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},re.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=new Array(e),r=Object.keys(t),i=0;i<e;i++){for(var s={},a=0;a<r.length;a++){var o=r[a],l=t[o];s[o]=l.call(this)}n[i]=s}return n},re.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=new Array(e),r=Object.keys(t),i=0;i<e;i++){for(var s={},a=0;a<r.length;a++){var o=r[a],l=t[o];s[o]=l.call(this)}n[i]=s}return n},re.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r],s=e[i];n[i]=s.call(this)}return n},re.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0!==e){var t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t}},re.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),n=new Array(t),r=0;r<t;r++)n[r]=this.parseValueRecord(e);return n},re.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),n=t.length,r=this.relativeOffset,i=new Array(n),s=0;s<n;s++){var a=t[s];if(0!==a)if(this.relativeOffset=a,e){for(var o=this.parseOffset16List(),l=new Array(o.length),c=0;c<o.length;c++)this.relativeOffset=a+o[c],l[c]=e.call(this);i[s]=l}else i[s]=this.parseUShortList();else i[s]=void 0}return this.relativeOffset=r,i},re.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(n)};if(2===t){for(var r=new Array(n),i=0;i<n;i++)r[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:r}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},re.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:re.uShort,end:re.uShort,classId:re.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},re.list=function(e,t){return function(){return this.parseList(e,t)}},re.list32=function(e,t){return function(){return this.parseList32(e,t)}},re.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},re.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},re.pointer=function(e){return function(){return this.parsePointer(e)}},re.pointer32=function(e){return function(){return this.parsePointer32(e)}},re.tag=re.prototype.parseTag,re.byte=re.prototype.parseByte,re.uShort=re.offset16=re.prototype.parseUShort,re.uShortList=re.prototype.parseUShortList,re.uLong=re.offset32=re.prototype.parseULong,re.uLongList=re.prototype.parseULongList,re.struct=re.prototype.parseStruct,re.coverage=re.prototype.parseCoverage,re.classDef=re.prototype.parseClassDef;var ie={reserved:re.uShort,reqFeatureIndex:re.uShort,featureIndexes:re.uShortList};re.prototype.parseScriptList=function(){return this.parsePointer(re.recordList({tag:re.tag,script:re.pointer({defaultLangSys:re.pointer(ie),langSysRecords:re.recordList({tag:re.tag,langSys:re.pointer(ie)})})}))||[]},re.prototype.parseFeatureList=function(){return this.parsePointer(re.recordList({tag:re.tag,feature:re.pointer({featureParams:re.offset16,lookupListIndexes:re.uShortList})}))||[]},re.prototype.parseLookupList=function(e){return this.parsePointer(re.list(re.pointer((function(){var t=this.parseUShort();I.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var n=this.parseUShort(),r=16&n;return{lookupType:t,lookupFlag:n,subtables:this.parseList(re.pointer(e[t])),markFilteringSet:r?this.parseUShort():void 0}}))))||[]},re.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return I.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:re.offset32,featureTableSubstitutionOffset:re.offset32})}))||[]};var se={getByte:Z,getCard8:Z,getUShort:$,getCard16:$,getShort:function(e,t){return e.getInt16(t,!1)},getULong:ee,getFixed:te,getTag:function(e,t){for(var n="",r=t;r<t+4;r+=1)n+=String.fromCharCode(e.getInt8(r));return n},getOffset:function(e,t,n){for(var r=0,i=0;i<n;i+=1)r<<=8,r+=e.getUint8(t+i);return r},getBytes:function(e,t,n){for(var r=[],i=t;i<n;i+=1)r.push(e.getUint8(i));return r},bytesToString:function(e){for(var t="",n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t},Parser:re};function ae(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}var oe={parse:function(e,t){var n={};n.version=se.getUShort(e,t),I.argument(0===n.version,"cmap table version should be 0."),n.numTables=se.getUShort(e,t+2);for(var r=-1,i=n.numTables-1;i>=0;i-=1){var s=se.getUShort(e,t+4+8*i),a=se.getUShort(e,t+4+8*i+2);if(3===s&&(0===a||1===a||10===a)||0===s&&(0===a||1===a||2===a||3===a||4===a)){r=se.getULong(e,t+4+8*i+4);break}}if(-1===r)throw new Error("No valid cmap sub-tables found.");var o=new se.Parser(e,t+r);if(n.format=o.parseUShort(),12===n.format)!function(e,t){var n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(var r=0;r<n;r+=1)for(var i=t.parseULong(),s=t.parseULong(),a=t.parseULong(),o=i;o<=s;o+=1)e.glyphIndexMap[o]=a,a++}(n,o);else{if(4!==n.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+n.format+").");!function(e,t,n,r,i){var s;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=s=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(n,r+i+14),o=new se.Parser(n,r+i+16+2*s),l=new se.Parser(n,r+i+16+4*s),c=new se.Parser(n,r+i+16+6*s),h=r+i+16+8*s,u=0;u<s-1;u+=1)for(var d=void 0,p=a.parseUShort(),f=o.parseUShort(),m=l.parseShort(),g=c.parseUShort(),A=f;A<=p;A+=1)0!==g?(h=c.offset+c.relativeOffset-2,h+=g,h+=2*(A-f),0!==(d=se.getUShort(n,h))&&(d=d+m&65535)):d=A+m&65535,e.glyphIndexMap[A]=d}(n,o,e,t,r)}return n},make:function(e){var t,n=!0;for(t=e.length-1;t>0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),n=!1;break}}var r=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:n?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:n?12:20}];n||(r=r.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),r=r.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var i=new J.Table("cmap",r);for(i.segments=[],t=0;t<e.length;t+=1){for(var s=e.get(t),a=0;a<s.unicodes.length;a+=1)ae(i,s.unicodes[a],t);i.segments=i.segments.sort((function(e,t){return e.start-t.start}))}!function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(i);var o=i.segments.length,l=0,c=[],h=[],u=[],d=[],p=[],f=[];for(t=0;t<o;t+=1){var m=i.segments[t];m.end<=65535&&m.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:m.end}),h=h.concat({name:"start_"+t,type:"USHORT",value:m.start}),u=u.concat({name:"idDelta_"+t,type:"SHORT",value:m.delta}),d=d.concat({name:"idRangeOffset_"+t,type:"USHORT",value:m.offset}),void 0!==m.glyphId&&(p=p.concat({name:"glyph_"+t,type:"USHORT",value:m.glyphId}))):l+=1,n||void 0===m.glyphIndex||(f=(f=(f=f.concat({name:"cmap12Start_"+t,type:"ULONG",value:m.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:m.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:m.glyphIndex}))}if(i.segCountX2=2*(o-l),i.searchRange=2*Math.pow(2,Math.floor(Math.log(o-l)/Math.log(2))),i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(c),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(h),i.fields=i.fields.concat(u),i.fields=i.fields.concat(d),i.fields=i.fields.concat(p),i.cmap4Length=14+2*c.length+2+2*h.length+2*u.length+2*d.length+2*p.length,!n){var g=16+4*f.length;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:g},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:f.length/3}]),i.fields=i.fields.concat(f)}return i}},le=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],ce=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],he=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ue=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function de(e){this.font=e}function pe(e){this.cmap=e}function fe(e,t){this.encoding=e,this.charset=t}function me(e){switch(e.version){case 1:this.names=ue.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<ue.length?this.names[t]=ue[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-ue.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)this.names[n]=ue[n+e.glyphNameIndex[n]];break;default:this.names=[]}}function ge(e,t){t.lowMemory?function(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),r=0;r<n.length;r+=1){var i=n[r],s=t[i];void 0===e._IndexToUnicodeMap[s]?e._IndexToUnicodeMap[s]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[s].unicodes.push(parseInt(i))}}(e):function(e){for(var t,n=e.tables.cmap.glyphIndexMap,r=Object.keys(n),i=0;i<r.length;i+=1){var s=r[i],a=n[s];(t=e.glyphs.get(a)).addUnicode(parseInt(s))}for(var o=0;o<e.glyphs.length;o+=1)t=e.glyphs.get(o),e.cffEncoding?e.isCIDFont?t.name="gid"+o:t.name=e.cffEncoding.charset[o]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(o))}(e)}de.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.font.glyphs;if(n)for(var r=0;r<n.length;r+=1)for(var i=n.get(r),s=0;s<i.unicodes.length;s+=1)if(i.unicodes[s]===t)return r;return null},pe.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},fe.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)},me.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},me.prototype.glyphIndexToName=function(e){return this.names[e]};var Ae={line:function(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()}};function ve(e){this.bindConstructorValues(e)}function ye(e,t,n){Object.defineProperty(e,t,{get:function(){return e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function xe(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];r.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=r}this.length=t&&t.length||0}ve.prototype.bindConstructorValues=function(e){var t,n;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(t=e.path,n=t||new M,{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}))},ve.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},ve.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},ve.prototype.getPath=function(e,t,n,r,i){var s,a;e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72,r||(r={});var o=r.xScale,l=r.yScale;if(r.hinting&&i&&i.hinting&&(a=this.path&&i.hinting.exec(this,n)),a)s=i.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),o=l=1;else{s=this.path.commands;var c=1/(this.path.unitsPerEm||1e3)*n;void 0===o&&(o=c),void 0===l&&(l=c)}for(var h=new M,u=0;u<s.length;u+=1){var d=s[u];"M"===d.type?h.moveTo(e+d.x*o,t+-d.y*l):"L"===d.type?h.lineTo(e+d.x*o,t+-d.y*l):"Q"===d.type?h.quadraticCurveTo(e+d.x1*o,t+-d.y1*l,e+d.x*o,t+-d.y*l):"C"===d.type?h.curveTo(e+d.x1*o,t+-d.y1*l,e+d.x2*o,t+-d.y2*l,e+d.x*o,t+-d.y*l):"Z"===d.type&&h.closePath()}return h},ve.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],n=0;n<this.points.length;n+=1){var r=this.points[n];t.push(r),r.lastPointOfContour&&(e.push(t),t=[])}return I.argument(0===t.length,"There are still points left in the current contour."),e},ve.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];"Z"!==i.type&&(t.push(i.x),n.push(i.y)),"Q"!==i.type&&"C"!==i.type||(t.push(i.x1),n.push(i.y1)),"C"===i.type&&(t.push(i.x2),n.push(i.y2))}var s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},ve.prototype.draw=function(e,t,n,r,i){this.getPath(t,n,r,i).draw(e)},ve.prototype.drawPoints=function(e,t,n,r){function i(t,n,r,i){e.beginPath();for(var s=0;s<t.length;s+=1)e.moveTo(n+t[s].x*i,r+t[s].y*i),e.arc(n+t[s].x*i,r+t[s].y*i,2,0,2*Math.PI,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,r=void 0!==r?r:24;for(var s=1/this.path.unitsPerEm*r,a=[],o=[],l=this.path,c=0;c<l.commands.length;c+=1){var h=l.commands[c];void 0!==h.x&&a.push({x:h.x,y:-h.y}),void 0!==h.x1&&o.push({x:h.x1,y:-h.y1}),void 0!==h.x2&&o.push({x:h.x2,y:-h.y2})}e.fillStyle="blue",i(a,t,n,s),e.fillStyle="red",i(o,t,n,s)},ve.prototype.drawMetrics=function(e,t,n,r){var i;t=void 0!==t?t:0,n=void 0!==n?n:0,r=void 0!==r?r:24,i=1/this.path.unitsPerEm*r,e.lineWidth=1,e.strokeStyle="black",Ae.line(e,t,-1e4,t,1e4),Ae.line(e,-1e4,n,1e4,n);var s=this.xMin||0,a=this.yMin||0,o=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",Ae.line(e,t+s*i,-1e4,t+s*i,1e4),Ae.line(e,t+o*i,-1e4,t+o*i,1e4),Ae.line(e,-1e4,n+-a*i,1e4,n+-a*i),Ae.line(e,-1e4,n+-l*i,1e4,n+-l*i),e.strokeStyle="green",Ae.line(e,t+c*i,-1e4,t+c*i,1e4)},xe.prototype.get=function(e){if(void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(var r=0;r<n.unicodes.length;r++)t.addUnicode(n.unicodes[r]);this.font.cffEncoding?this.font.isCIDFont?t.name="gid"+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},xe.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var be={GlyphSet:xe,glyphLoader:function(e,t){return new ve({index:t,font:e})},ttfGlyphLoader:function(e,t,n,r,i,s){return function(){var a=new ve({index:t,font:e});return a.path=function(){n(a,r,i);var t=s(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},ye(a,"xMin","_xMin"),ye(a,"xMax","_xMax"),ye(a,"yMin","_yMin"),ye(a,"yMax","_yMax"),a}},cffGlyphLoader:function(e,t,n,r){return function(){var i=new ve({index:t,font:e});return i.path=function(){var t=n(e,i,r);return t.unitsPerEm=e.unitsPerEm,t},i}}};function Ee(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(!Ee(e[n],t[n]))return!1;return!0}return!1}function _e(e){return e.length<1240?107:e.length<33900?1131:32768}function Se(e,t,n){var r,i,s=[],a=[],o=se.getCard16(e,t);if(0!==o){var l=se.getByte(e,t+2);r=t+(o+1)*l+2;for(var c=t+3,h=0;h<o+1;h+=1)s.push(se.getOffset(e,c,l)),c+=l;i=r+s[o]}else i=t+2;for(var u=0;u<s.length-1;u+=1){var d=se.getBytes(e,r+s[u],r+s[u+1]);n&&(d=n(d)),a.push(d)}return{objects:a,startOffset:t,endOffset:i}}function we(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return function(e){for(var t="",n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var r=e.parseByte(),i=r>>4,s=15&r;if(15===i)break;if(t+=n[i],15===s)break;t+=n[s]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return 256*(t-247)+e.parseByte()+108;if(t>=251&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Me(e,t,n){t=void 0!==t?t:0;var r=new se.Parser(e,t),i=[],s=[];for(n=void 0!==n?n:e.length;r.relativeOffset<n;){var a=r.parseByte();a<=21?(12===a&&(a=1200+r.parseByte()),i.push([a,s]),s=[]):s.push(we(r,a))}return function(e){for(var t={},n=0;n<e.length;n+=1){var r=e[n][0],i=e[n][1],s=void 0;if(s=1===i.length?i[0]:i,t.hasOwnProperty(r)&&!isNaN(t[r]))throw new Error("Object "+t+" already has key "+r);t[r]=s}return t}(i)}function Ce(e,t){return t=t<=390?le[t]:e[t-391]}function Te(e,t,n){for(var r,i={},s=0;s<t.length;s+=1){var a=t[s];if(Array.isArray(a.type)){var o=[];o.length=a.type.length;for(var l=0;l<a.type.length;l++)void 0===(r=void 0!==e[a.op]?e[a.op][l]:void 0)&&(r=void 0!==a.value&&void 0!==a.value[l]?a.value[l]:null),"SID"===a.type[l]&&(r=Ce(n,r)),o[l]=r;i[a.name]=o}else void 0===(r=e[a.op])&&(r=void 0!==a.value?a.value:null),"SID"===a.type&&(r=Ce(n,r)),i[a.name]=r}return i}var Ie=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Be=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Re(e,t){return Te(Me(e,0,e.byteLength),Ie,t)}function Pe(e,t,n,r){return Te(Me(e,t,n),Be,r)}function De(e,t,n,r){for(var i=[],s=0;s<n.length;s+=1){var a=Re(new DataView(new Uint8Array(n[s]).buffer),r);a._subrs=[],a._subrsBias=0,a._defaultWidthX=0,a._nominalWidthX=0;var o=a.private[0],l=a.private[1];if(0!==o&&0!==l){var c=Pe(e,l+t,o,r);if(a._defaultWidthX=c.defaultWidthX,a._nominalWidthX=c.nominalWidthX,0!==c.subrs){var h=Se(e,l+c.subrs+t);a._subrs=h.objects,a._subrsBias=_e(a._subrs)}a._privateDict=c}i.push(a)}return i}function Le(e,t,n){var r,i,s,a,o,l,c,h,u=new M,d=[],p=0,f=!1,m=!1,g=0,A=0;if(e.isCIDFont){var v=e.tables.cff.topDict._fdSelect[t.index],y=e.tables.cff.topDict._fdArray[v];o=y._subrs,l=y._subrsBias,c=y._defaultWidthX,h=y._nominalWidthX}else o=e.tables.cff.topDict._subrs,l=e.tables.cff.topDict._subrsBias,c=e.tables.cff.topDict._defaultWidthX,h=e.tables.cff.topDict._nominalWidthX;var x=c;function b(e,t){m&&u.closePath(),u.moveTo(e,t),m=!0}function E(){d.length%2!=0&&!f&&(x=d.shift()+h),p+=d.length>>1,d.length=0,f=!0}return function n(c){for(var v,y,_,S,w,M,C,T,I,B,R,P,D=0;D<c.length;){var L=c[D];switch(D+=1,L){case 1:case 3:case 18:case 23:E();break;case 4:d.length>1&&!f&&(x=d.shift()+h,f=!0),A+=d.pop(),b(g,A);break;case 5:for(;d.length>0;)g+=d.shift(),A+=d.shift(),u.lineTo(g,A);break;case 6:for(;d.length>0&&(g+=d.shift(),u.lineTo(g,A),0!==d.length);)A+=d.shift(),u.lineTo(g,A);break;case 7:for(;d.length>0&&(A+=d.shift(),u.lineTo(g,A),0!==d.length);)g+=d.shift(),u.lineTo(g,A);break;case 8:for(;d.length>0;)r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a+d.shift(),u.curveTo(r,i,s,a,g,A);break;case 10:w=d.pop()+l,(M=o[w])&&n(M);break;case 11:return;case 12:switch(L=c[D],D+=1,L){case 35:r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),C=s+d.shift(),T=a+d.shift(),I=C+d.shift(),B=T+d.shift(),R=I+d.shift(),P=B+d.shift(),g=R+d.shift(),A=P+d.shift(),d.shift(),u.curveTo(r,i,s,a,C,T),u.curveTo(I,B,R,P,g,A);break;case 34:r=g+d.shift(),i=A,s=r+d.shift(),a=i+d.shift(),C=s+d.shift(),T=a,I=C+d.shift(),B=a,R=I+d.shift(),P=A,g=R+d.shift(),u.curveTo(r,i,s,a,C,T),u.curveTo(I,B,R,P,g,A);break;case 36:r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),C=s+d.shift(),T=a,I=C+d.shift(),B=a,R=I+d.shift(),P=B+d.shift(),g=R+d.shift(),u.curveTo(r,i,s,a,C,T),u.curveTo(I,B,R,P,g,A);break;case 37:r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),C=s+d.shift(),T=a+d.shift(),I=C+d.shift(),B=T+d.shift(),R=I+d.shift(),P=B+d.shift(),Math.abs(R-g)>Math.abs(P-A)?g=R+d.shift():A=P+d.shift(),u.curveTo(r,i,s,a,C,T),u.curveTo(I,B,R,P,g,A);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+L),d.length=0}break;case 14:d.length>0&&!f&&(x=d.shift()+h,f=!0),m&&(u.closePath(),m=!1);break;case 19:case 20:E(),D+=p+7>>3;break;case 21:d.length>2&&!f&&(x=d.shift()+h,f=!0),A+=d.pop(),b(g+=d.pop(),A);break;case 22:d.length>1&&!f&&(x=d.shift()+h,f=!0),b(g+=d.pop(),A);break;case 24:for(;d.length>2;)r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a+d.shift(),u.curveTo(r,i,s,a,g,A);g+=d.shift(),A+=d.shift(),u.lineTo(g,A);break;case 25:for(;d.length>6;)g+=d.shift(),A+=d.shift(),u.lineTo(g,A);r=g+d.shift(),i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a+d.shift(),u.curveTo(r,i,s,a,g,A);break;case 26:for(d.length%2&&(g+=d.shift());d.length>0;)r=g,i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s,A=a+d.shift(),u.curveTo(r,i,s,a,g,A);break;case 27:for(d.length%2&&(A+=d.shift());d.length>0;)r=g+d.shift(),i=A,s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a,u.curveTo(r,i,s,a,g,A);break;case 28:v=c[D],y=c[D+1],d.push((v<<24|y<<16)>>16),D+=2;break;case 29:w=d.pop()+e.gsubrsBias,(M=e.gsubrs[w])&&n(M);break;case 30:for(;d.length>0&&(r=g,i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a+(1===d.length?d.shift():0),u.curveTo(r,i,s,a,g,A),0!==d.length);)r=g+d.shift(),i=A,s=r+d.shift(),a=i+d.shift(),A=a+d.shift(),g=s+(1===d.length?d.shift():0),u.curveTo(r,i,s,a,g,A);break;case 31:for(;d.length>0&&(r=g+d.shift(),i=A,s=r+d.shift(),a=i+d.shift(),A=a+d.shift(),g=s+(1===d.length?d.shift():0),u.curveTo(r,i,s,a,g,A),0!==d.length);)r=g,i=A+d.shift(),s=r+d.shift(),a=i+d.shift(),g=s+d.shift(),A=a+(1===d.length?d.shift():0),u.curveTo(r,i,s,a,g,A);break;default:L<32?console.log("Glyph "+t.index+": unknown operator "+L):L<247?d.push(L-139):L<251?(v=c[D],D+=1,d.push(256*(L-247)+v+108)):L<255?(v=c[D],D+=1,d.push(256*-(L-251)-v-108)):(v=c[D],y=c[D+1],_=c[D+2],S=c[D+3],D+=4,d.push((v<<24|y<<16|_<<8|S)/65536))}}}(n),t.advanceWidth=x,u}function Fe(e,t){var n,r=le.indexOf(e);return r>=0&&(n=r),(r=t.indexOf(e))>=0?n=r+le.length:(n=le.length+t.length,t.push(e)),n}function Ue(e,t,n){for(var r={},i=0;i<e.length;i+=1){var s=e[i],a=t[s.name];void 0===a||Ee(a,s.value)||("SID"===s.type&&(a=Fe(a,n)),r[s.op]={name:s.name,type:s.type,value:a})}return r}function Oe(e,t){var n=new J.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=Ue(Ie,e,t),n}function Ne(e){var t=new J.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function ke(e){var t=[],n=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var r=0,i=0,s=0;s<n.commands.length;s+=1){var a=void 0,o=void 0,l=n.commands[s];if("Q"===l.type){var c=1/3,h=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(c*r+h*l.x1),y1:Math.round(c*i+h*l.y1),x2:Math.round(c*l.x+h*l.x1),y2:Math.round(c*l.y+h*l.y1)}}if("M"===l.type)a=Math.round(l.x-r),o=Math.round(l.y-i),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(l.x),i=Math.round(l.y);else if("L"===l.type)a=Math.round(l.x-r),o=Math.round(l.y-i),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rlineto",type:"OP",value:5}),r=Math.round(l.x),i=Math.round(l.y);else if("C"===l.type){var u=Math.round(l.x1-r),d=Math.round(l.y1-i),p=Math.round(l.x2-l.x1),f=Math.round(l.y2-l.y1);a=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),t.push({name:"dx1",type:"NUMBER",value:u}),t.push({name:"dy1",type:"NUMBER",value:d}),t.push({name:"dx2",type:"NUMBER",value:p}),t.push({name:"dy2",type:"NUMBER",value:f}),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:o}),t.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(l.x),i=Math.round(l.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}var Ge={parse:function(e,t,n,r){n.tables.cff={};var i=function(e,t){var n={};return n.formatMajor=se.getCard8(e,t),n.formatMinor=se.getCard8(e,t+1),n.size=se.getCard8(e,t+2),n.offsetSize=se.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}(e,t),s=Se(e,i.endOffset,se.bytesToString),a=Se(e,s.endOffset),o=Se(e,a.endOffset,se.bytesToString),l=Se(e,o.endOffset);n.gsubrs=l.objects,n.gsubrsBias=_e(n.gsubrs);var c=De(e,t,a.objects,o.objects);if(1!==c.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);var h=c[0];if(n.tables.cff.topDict=h,h._privateDict&&(n.defaultWidthX=h._privateDict.defaultWidthX,n.nominalWidthX=h._privateDict.nominalWidthX),void 0!==h.ros[0]&&void 0!==h.ros[1]&&(n.isCIDFont=!0),n.isCIDFont){var u=h.fdArray,d=h.fdSelect;if(0===u||0===d)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var p=Se(e,u+=t),f=De(e,t,p.objects,o.objects);h._fdArray=f,d+=t,h._fdSelect=function(e,t,n,r){var i,s=[],a=new se.Parser(e,t),o=a.parseCard8();if(0===o)for(var l=0;l<n;l++){if((i=a.parseCard8())>=r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+r+")");s.push(i)}else{if(3!==o)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);var c,h=a.parseCard16(),u=a.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var d=0;d<h;d++){if(i=a.parseCard8(),c=a.parseCard16(),i>=r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+r+")");if(c>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+c);for(;u<c;u++)s.push(i);u=c}if(c!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+c)}return s}(e,d,n.numGlyphs,f.length)}var m,g=t+h.private[1],A=Pe(e,g,h.private[0],o.objects);if(n.defaultWidthX=A.defaultWidthX,n.nominalWidthX=A.nominalWidthX,0!==A.subrs){var v=g+A.subrs,y=Se(e,v);n.subrs=y.objects,n.subrsBias=_e(n.subrs)}else n.subrs=[],n.subrsBias=0;r.lowMemory?(m=function(e,t){var n,r,i=[],s=se.getCard16(e,t);if(0!==s){var a=se.getByte(e,t+2);n=t+(s+1)*a+2;for(var o=t+3,l=0;l<s+1;l+=1)i.push(se.getOffset(e,o,a)),o+=a;r=n+i[s]}else r=t+2;return{offsets:i,startOffset:t,endOffset:r}}(e,t+h.charStrings),n.nGlyphs=m.offsets.length):(m=Se(e,t+h.charStrings),n.nGlyphs=m.objects.length);var x=function(e,t,n,r){var i,s,a=new se.Parser(e,t);n-=1;var o=[".notdef"],l=a.parseCard8();if(0===l)for(var c=0;c<n;c+=1)i=a.parseSID(),o.push(Ce(r,i));else if(1===l)for(;o.length<=n;){i=a.parseSID(),s=a.parseCard8();for(var h=0;h<=s;h+=1)o.push(Ce(r,i)),i+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;o.length<=n;){i=a.parseSID(),s=a.parseCard16();for(var u=0;u<=s;u+=1)o.push(Ce(r,i)),i+=1}}return o}(e,t+h.charset,n.nGlyphs,o.objects);if(0===h.encoding?n.cffEncoding=new fe(ce,x):1===h.encoding?n.cffEncoding=new fe(he,x):n.cffEncoding=function(e,t,n){var r,i={},s=new se.Parser(e,t),a=s.parseCard8();if(0===a)for(var o=s.parseCard8(),l=0;l<o;l+=1)i[r=s.parseCard8()]=l;else{if(1!==a)throw new Error("Unknown encoding format "+a);var c=s.parseCard8();r=1;for(var h=0;h<c;h+=1)for(var u=s.parseCard8(),d=s.parseCard8(),p=u;p<=u+d;p+=1)i[p]=r,r+=1}return new fe(i,n)}(e,t+h.encoding,x),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new be.GlyphSet(n),r.lowMemory)n._push=function(r){var i=function(e,t,n,r,i){var s=se.getCard16(n,r),a=0;0!==s&&(a=r+(s+1)*se.getByte(n,r+2)+2);var o=se.getBytes(n,a+t[e],a+t[e+1]);return i&&(o=i(o)),o}(r,m.offsets,e,t+h.charStrings);n.glyphs.push(r,be.cffGlyphLoader(n,r,Le,i))};else for(var b=0;b<n.nGlyphs;b+=1){var E=m.objects[b];n.glyphs.push(b,be.cffGlyphLoader(n,b,Le,E))}},make:function(e,t){for(var n,r=new J.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),i=1/t.unitsPerEm,s={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[i,0,0,i,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=[],o=1;o<e.length;o+=1)n=e.get(o),a.push(n.name);var l=[];r.header=new J.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),r.nameIndex=function(e){var t=new J.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}([t.postScriptName]);var c=Oe(s,l);r.topDictIndex=Ne(c),r.globalSubrIndex=new J.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),r.charsets=function(e,t){for(var n=new J.Record("Charsets",[{name:"format",type:"Card8",value:0}]),r=0;r<e.length;r+=1){var i=Fe(e[r],t);n.fields.push({name:"glyph_"+r,type:"SID",value:i})}return n}(a,l),r.charStringsIndex=function(e){for(var t=new J.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),n=0;n<e.length;n+=1){var r=e.get(n),i=ke(r);t.charStrings.push({name:r.name,type:"CHARSTRING",value:i})}return t}(e),r.privateDict=function(e,t){var n=new J.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=Ue(Be,e,t),n}({},l),r.stringIndex=function(e){var t=new J.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}(l);var h=r.header.sizeOf()+r.nameIndex.sizeOf()+r.topDictIndex.sizeOf()+r.stringIndex.sizeOf()+r.globalSubrIndex.sizeOf();return s.charset=h,s.encoding=0,s.charStrings=s.charset+r.charsets.sizeOf(),s.private[1]=s.charStrings+r.charStringsIndex.sizeOf(),c=Oe(s,l),r.topDictIndex=Ne(c),r}};var ze={parse:function(e,t){var n={},r=new se.Parser(e,t);return n.version=r.parseVersion(),n.fontRevision=Math.round(1e3*r.parseFixed())/1e3,n.checkSumAdjustment=r.parseULong(),n.magicNumber=r.parseULong(),I.argument(1594834165===n.magicNumber,"Font header has wrong magic number."),n.flags=r.parseUShort(),n.unitsPerEm=r.parseUShort(),n.created=r.parseLongDateTime(),n.modified=r.parseLongDateTime(),n.xMin=r.parseShort(),n.yMin=r.parseShort(),n.xMax=r.parseShort(),n.yMax=r.parseShort(),n.macStyle=r.parseUShort(),n.lowestRecPPEM=r.parseUShort(),n.fontDirectionHint=r.parseShort(),n.indexToLocFormat=r.parseShort(),n.glyphDataFormat=r.parseShort(),n},make:function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,n=t;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new J.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:n},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}};var Qe={parse:function(e,t){var n={},r=new se.Parser(e,t);return n.version=r.parseVersion(),n.ascender=r.parseShort(),n.descender=r.parseShort(),n.lineGap=r.parseShort(),n.advanceWidthMax=r.parseUShort(),n.minLeftSideBearing=r.parseShort(),n.minRightSideBearing=r.parseShort(),n.xMaxExtent=r.parseShort(),n.caretSlopeRise=r.parseShort(),n.caretSlopeRun=r.parseShort(),n.caretOffset=r.parseShort(),r.relativeOffset+=8,n.metricDataFormat=r.parseShort(),n.numberOfHMetrics=r.parseUShort(),n},make:function(e){return new J.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}};var Ve={parse:function(e,t,n,r,i,s,a){a.lowMemory?function(e,t,n,r,i){var s,a;e._hmtxTableData={};for(var o=new se.Parser(t,n),l=0;l<i;l+=1)l<r&&(s=o.parseUShort(),a=o.parseShort()),e._hmtxTableData[l]={advanceWidth:s,leftSideBearing:a}}(e,t,n,r,i):function(e,t,n,r,i){for(var s,a,o=new se.Parser(e,t),l=0;l<r;l+=1){l<n&&(s=o.parseUShort(),a=o.parseShort());var c=i.get(l);c.advanceWidth=s,c.leftSideBearing=a}}(t,n,r,i,s)},make:function(e){for(var t=new J.Table("hmtx",[]),n=0;n<e.length;n+=1){var r=e.get(n),i=r.advanceWidth||0,s=r.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:i}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:s})}return t}};var He={make:function(e){for(var t=new J.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),n="",r=12+4*e.length,i=0;i<e.length;++i){var s=n.indexOf(e[i]);s<0&&(s=n.length,n+=e[i]),t.fields.push({name:"offset "+i,type:"USHORT",value:r+s}),t.fields.push({name:"length "+i,type:"USHORT",value:e[i].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t},parse:function(e,t){var n=new se.Parser(e,t),r=n.parseULong();I.argument(1===r,"Unsupported ltag table version."),n.skip("uLong",1);for(var i=n.parseULong(),s=[],a=0;a<i;a++){for(var o="",l=t+n.parseUShort(),c=n.parseUShort(),h=l;h<l+c;++h)o+=String.fromCharCode(e.getInt8(h));s.push(o)}return s}};var je={parse:function(e,t){var n={},r=new se.Parser(e,t);return n.version=r.parseVersion(),n.numGlyphs=r.parseUShort(),1===n.version&&(n.maxPoints=r.parseUShort(),n.maxContours=r.parseUShort(),n.maxCompositePoints=r.parseUShort(),n.maxCompositeContours=r.parseUShort(),n.maxZones=r.parseUShort(),n.maxTwilightPoints=r.parseUShort(),n.maxStorage=r.parseUShort(),n.maxFunctionDefs=r.parseUShort(),n.maxInstructionDefs=r.parseUShort(),n.maxStackElements=r.parseUShort(),n.maxSizeOfInstructions=r.parseUShort(),n.maxComponentElements=r.parseUShort(),n.maxComponentDepth=r.parseUShort()),n},make:function(e){return new J.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},We=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Xe={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Ye={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},qe={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function Ke(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return Xe[t];case 3:return qe[t]}}var Je="utf-16",Ze={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},$e={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function et(e,t,n){switch(e){case 0:return Je;case 1:return $e[n]||Ze[t];case 3:if(1===t||10===t)return Je}}function tt(e){var t={};for(var n in e)t[e[n]]=parseInt(n);return t}function nt(e,t,n,r,i,s){return new J.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:n},{name:"nameID",type:"USHORT",value:r},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:s}])}function rt(e,t){var n=function(e,t){var n=e.length,r=t.length-n+1;e:for(var i=0;i<r;i++)for(;i<r;i++){for(var s=0;s<n;s++)if(t[i+s]!==e[s])continue e;return i}return-1}(e,t);if(n<0){n=t.length;for(var r=0,i=e.length;r<i;++r)t.push(e[r])}return n}var it={parse:function(e,t,n){for(var r={},i=new se.Parser(e,t),s=i.parseUShort(),a=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<a;l++){var c=i.parseUShort(),h=i.parseUShort(),u=i.parseUShort(),d=i.parseUShort(),p=We[d]||d,f=i.parseUShort(),m=i.parseUShort(),g=Ke(c,u,n),A=et(c,h,u);if(void 0!==A&&void 0!==g){var v=void 0;if(v=A===Je?R.UTF16(e,o+m,f):R.MACSTRING(e,o+m,f,A)){var y=r[p];void 0===y&&(y=r[p]={}),y[g]=v}}}return 1===s&&i.parseUShort(),r},make:function(e,t){var n,r=[],i={},s=tt(We);for(var a in e){var o=s[a];if(void 0===o&&(o=a),n=parseInt(o),isNaN(n))throw new Error('Name table entry "'+a+'" does not exist, see nameTableNames for complete list.');i[n]=e[a],r.push(n)}for(var l=tt(Xe),c=tt(qe),h=[],u=[],d=0;d<r.length;d++){var p=i[n=r[d]];for(var f in p){var m=p[f],g=1,A=l[f],v=Ye[A],y=et(g,v,A),x=P.MACSTRING(m,y);void 0===x&&(g=0,(A=t.indexOf(f))<0&&(A=t.length,t.push(f)),v=4,x=P.UTF16(m));var b=rt(x,u);h.push(nt(g,v,A,n,x.length,b));var E=c[f];if(void 0!==E){var _=P.UTF16(m),S=rt(_,u);h.push(nt(3,1,E,n,_.length,S))}}}h.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var w=new J.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:h.length},{name:"stringOffset",type:"USHORT",value:6+12*h.length}]),M=0;M<h.length;M++)w.fields.push({name:"record_"+M,type:"RECORD",value:h[M]});return w.fields.push({name:"strings",type:"LITERAL",value:u}),w}},st=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];var at={parse:function(e,t){var n={},r=new se.Parser(e,t);n.version=r.parseUShort(),n.xAvgCharWidth=r.parseShort(),n.usWeightClass=r.parseUShort(),n.usWidthClass=r.parseUShort(),n.fsType=r.parseUShort(),n.ySubscriptXSize=r.parseShort(),n.ySubscriptYSize=r.parseShort(),n.ySubscriptXOffset=r.parseShort(),n.ySubscriptYOffset=r.parseShort(),n.ySuperscriptXSize=r.parseShort(),n.ySuperscriptYSize=r.parseShort(),n.ySuperscriptXOffset=r.parseShort(),n.ySuperscriptYOffset=r.parseShort(),n.yStrikeoutSize=r.parseShort(),n.yStrikeoutPosition=r.parseShort(),n.sFamilyClass=r.parseShort(),n.panose=[];for(var i=0;i<10;i++)n.panose[i]=r.parseByte();return n.ulUnicodeRange1=r.parseULong(),n.ulUnicodeRange2=r.parseULong(),n.ulUnicodeRange3=r.parseULong(),n.ulUnicodeRange4=r.parseULong(),n.achVendID=String.fromCharCode(r.parseByte(),r.parseByte(),r.parseByte(),r.parseByte()),n.fsSelection=r.parseUShort(),n.usFirstCharIndex=r.parseUShort(),n.usLastCharIndex=r.parseUShort(),n.sTypoAscender=r.parseShort(),n.sTypoDescender=r.parseShort(),n.sTypoLineGap=r.parseShort(),n.usWinAscent=r.parseUShort(),n.usWinDescent=r.parseUShort(),n.version>=1&&(n.ulCodePageRange1=r.parseULong(),n.ulCodePageRange2=r.parseULong()),n.version>=2&&(n.sxHeight=r.parseShort(),n.sCapHeight=r.parseShort(),n.usDefaultChar=r.parseUShort(),n.usBreakChar=r.parseUShort(),n.usMaxContent=r.parseUShort()),n},make:function(e){return new J.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:st,getUnicodeRange:function(e){for(var t=0;t<st.length;t+=1){var n=st[t];if(e>=n.begin&&e<n.end)return t}return-1}};var ot={parse:function(e,t){var n={},r=new se.Parser(e,t);switch(n.version=r.parseVersion(),n.italicAngle=r.parseFixed(),n.underlinePosition=r.parseShort(),n.underlineThickness=r.parseShort(),n.isFixedPitch=r.parseULong(),n.minMemType42=r.parseULong(),n.maxMemType42=r.parseULong(),n.minMemType1=r.parseULong(),n.maxMemType1=r.parseULong(),n.version){case 1:n.names=ue.slice();break;case 2:n.numberOfGlyphs=r.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(var i=0;i<n.numberOfGlyphs;i++)n.glyphNameIndex[i]=r.parseUShort();n.names=[];for(var s=0;s<n.numberOfGlyphs;s++)if(n.glyphNameIndex[s]>=ue.length){var a=r.parseChar();n.names.push(r.parseString(a))}break;case 2.5:n.numberOfGlyphs=r.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(var o=0;o<n.numberOfGlyphs;o++)n.offset[o]=r.parseChar()}return n},make:function(){return new J.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}},lt=new Array(9);lt[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),substitute:this.parseOffset16List()}:void I.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},lt[2]=function(){var e=this.parseUShort();return I.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),sequences:this.parseListOfLists()}},lt[3]=function(){var e=this.parseUShort();return I.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),alternateSets:this.parseListOfLists()}},lt[4]=function(){var e=this.parseUShort();return I.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var ct={sequenceIndex:re.uShort,lookupListIndex:re.uShort};lt[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ct)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),classDef:this.parsePointer(re.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ct)}}))};if(3===t){var n=this.parseUShort(),r=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,re.pointer(re.coverage)),lookupRecords:this.parseRecordList(r,ct)}}I.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},lt[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ct)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),backtrackClassDef:this.parsePointer(re.classDef),inputClassDef:this.parsePointer(re.classDef),lookaheadClassDef:this.parsePointer(re.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ct)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(re.pointer(re.coverage)),inputCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),lookupRecords:this.parseRecordList(ct)}:void I.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},lt[7]=function(){var e=this.parseUShort();I.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new re(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:lt[t].call(n)}},lt[8]=function(){var e=this.parseUShort();return I.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),backtrackCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),substitutes:this.parseUShortList()}};var ht=new Array(9);ht[1]=function(e){return 1===e.substFormat?new J.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new J.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)}].concat(J.ushortList("substitute",e.substitute)))},ht[2]=function(e){return I.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new J.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)}].concat(J.tableList("seqSet",e.sequences,(function(e){return new J.Table("sequenceSetTable",J.ushortList("sequence",e))}))))},ht[3]=function(e){return I.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new J.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)}].concat(J.tableList("altSet",e.alternateSets,(function(e){return new J.Table("alternateSetTable",J.ushortList("alternate",e))}))))},ht[4]=function(e){return I.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new J.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)}].concat(J.tableList("ligSet",e.ligatureSets,(function(e){return new J.Table("ligatureSetTable",J.tableList("ligature",e,(function(e){return new J.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(J.ushortList("component",e.components,e.components.length+1)))})))}))))},ht[6]=function(e){if(1===e.substFormat)return new J.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new J.Coverage(e.coverage)}].concat(J.tableList("chainRuleSet",e.chainRuleSets,(function(e){return new J.Table("chainRuleSetTable",J.tableList("chainRule",e,(function(e){var t=J.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(J.ushortList("inputGlyph",e.input,e.input.length+1)).concat(J.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(J.ushortList("substitution",[],e.lookupRecords.length));return e.lookupRecords.forEach((function(e,n){t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:e.lookupListIndex})})),new J.Table("chainRuleTable",t)})))}))));if(2===e.substFormat)I.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){var t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];return t.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach((function(e,n){t.push({name:"backtrackCoverage"+n,type:"TABLE",value:new J.Coverage(e)})})),t.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach((function(e,n){t.push({name:"inputCoverage"+n,type:"TABLE",value:new J.Coverage(e)})})),t.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach((function(e,n){t.push({name:"lookaheadCoverage"+n,type:"TABLE",value:new J.Coverage(e)})})),t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach((function(e,n){t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:e.lookupListIndex})})),new J.Table("chainContextTable",t)}I.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var ut={parse:function(e,t){var n=new re(e,t=t||0),r=n.parseVersion(1);return I.argument(1===r||1.1===r,"Unsupported GSUB table version."),1===r?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(lt)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(lt),variations:n.parseFeatureVariationsList()}},make:function(e){return new J.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new J.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new J.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new J.LookupList(e.lookups,ht)}])}};var dt={parse:function(e,t){var n=new se.Parser(e,t),r=n.parseULong();I.argument(1===r,"Unsupported META table version."),n.parseULong(),n.parseULong();for(var i=n.parseULong(),s={},a=0;a<i;a++){var o=n.parseTag(),l=n.parseULong(),c=n.parseULong(),h=R.UTF8(e,t+l,c);s[o]=h}return s},make:function(e){var t=Object.keys(e).length,n="",r=16+12*t,i=new J.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:r},{name:"numTags",type:"ULONG",value:t}]);for(var s in e){var a=n.length;n+=e[s],i.fields.push({name:"tag "+s,type:"TAG",value:s}),i.fields.push({name:"offset "+s,type:"ULONG",value:r+a}),i.fields.push({name:"length "+s,type:"ULONG",value:e[s].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),i}};function pt(e){return Math.log(e)/Math.log(2)|0}function ft(e){for(;e.length%4!=0;)e.push(0);for(var t=0,n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=Math.pow(2,32)}function mt(e,t,n,r){return new J.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==n?n:0},{name:"length",type:"ULONG",value:void 0!==r?r:0}])}function gt(e){var t=new J.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;var n=Math.pow(2,pt(t.numTables));t.searchRange=16*n,t.entrySelector=pt(n),t.rangeShift=16*t.numTables-t.searchRange;for(var r=[],i=[],s=t.sizeOf()+mt().sizeOf()*t.numTables;s%4!=0;)s+=1,i.push({name:"padding",type:"BYTE",value:0});for(var a=0;a<e.length;a+=1){var o=e[a];I.argument(4===o.tableName.length,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),c=mt(o.tableName,ft(o.encode()),s,l);for(r.push({name:c.tag+" Table Record",type:"RECORD",value:c}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),s+=l,I.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,i.push({name:"padding",type:"BYTE",value:0})}return r.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(r),t.fields=t.fields.concat(i),t}function At(e,t,n){for(var r=0;r<t.length;r+=1){var i=e.charToGlyphIndex(t[r]);if(i>0)return e.glyphs.get(i).getMetrics()}return n}function vt(e){for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length}var yt={make:gt,fontToTable:function(e){for(var t,n=[],r=[],i=[],s=[],a=[],o=[],l=[],c=0,h=0,u=0,d=0,p=0,f=0;f<e.glyphs.length;f+=1){var m=e.glyphs.get(f),g=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");(t>g||void 0===t)&&g>0&&(t=g),c<g&&(c=g);var A=at.getUnicodeRange(g);if(A<32)h|=1<<A;else if(A<64)u|=1<<A-32;else if(A<96)d|=1<<A-64;else{if(!(A<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<A-96}if(".notdef"!==m.name){var v=m.getMetrics();n.push(v.xMin),r.push(v.yMin),i.push(v.xMax),s.push(v.yMax),o.push(v.leftSideBearing),l.push(v.rightSideBearing),a.push(m.advanceWidth)}}var y={xMin:Math.min.apply(null,n),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:vt(a),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,l)};y.ascender=e.ascender,y.descender=e.descender;var x=ze.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),b=Qe.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:e.glyphs.length}),E=je.make(e.glyphs.length),_=at.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:t,usLastCharIndex:c,ulUnicodeRange1:h,ulUnicodeRange2:u,ulUnicodeRange3:d,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:At(e,"xyvw",{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:At(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",y).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),S=Ve.make(e.glyphs),w=oe.make(e.glyphs),M=e.getEnglishName("fontFamily"),C=e.getEnglishName("fontSubfamily"),T=M+" "+C,I=e.getEnglishName("postScriptName");I||(I=M.replace(/\s/g,"")+"-"+C);var B={};for(var R in e.names)B[R]=e.names[R];B.uniqueID||(B.uniqueID={en:e.getEnglishName("manufacturer")+":"+T}),B.postScriptName||(B.postScriptName={en:I}),B.preferredFamily||(B.preferredFamily=e.names.fontFamily),B.preferredSubfamily||(B.preferredSubfamily=e.names.fontSubfamily);var P=[],D=it.make(B,P),L=P.length>0?He.make(P):void 0,F=ot.make(),U=Ge.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:M,weightName:C,postScriptName:I,unitsPerEm:e.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),O=e.metas&&Object.keys(e.metas).length>0?dt.make(e.metas):void 0,N=[x,b,E,_,D,w,F,U,S];L&&N.push(L),e.tables.gsub&&N.push(ut.make(e.tables.gsub)),O&&N.push(O);for(var k=gt(N),G=ft(k.encode()),z=k.fields,Q=!1,V=0;V<z.length;V+=1)if("head table"===z[V].name){z[V].value.checkSumAdjustment=2981146554-G,Q=!0;break}if(!Q)throw new Error("Could not find head table with checkSum to adjust.");return k},computeCheckSum:ft};function xt(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,s=e[i].tag;if(s===t)return i;s<t?n=i+1:r=i-1}return-n-1}function bt(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,s=e[i];if(s===t)return i;s<t?n=i+1:r=i-1}return-n-1}function Et(e,t){for(var n,r=0,i=e.length-1;r<=i;){var s=r+i>>>1,a=(n=e[s]).start;if(a===t)return n;a<t?r=s+1:i=s-1}if(r>0)return t>(n=e[r-1]).end?0:n}function _t(e,t){this.font=e,this.tableName=t}function St(e){_t.call(this,e,"gpos")}function wt(e){_t.call(this,e,"gsub")}function Mt(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ct(e,t,n){for(var r=e.subtables,i=0;i<r.length;i++){var s=r[i];if(s.substFormat===t)return s}if(n)return r.push(n),n}function Tt(e,t){if(!e)throw t}function It(e,t,n,r,i){var s;return(t&r)>0?(s=e.parseByte(),0==(t&i)&&(s=-s),s=n+s):s=(t&i)>0?n:n+e.parseShort(),s}function Bt(e,t,n){var r,i,s=new se.Parser(t,n);if(e.numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort(),e.numberOfContours>0){for(var a=e.endPointIndices=[],o=0;o<e.numberOfContours;o+=1)a.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(var l=0;l<e.instructionLength;l+=1)e.instructions.push(s.parseByte());var c=a[a.length-1]+1;r=[];for(var h=0;h<c;h+=1)if(i=s.parseByte(),r.push(i),(8&i)>0)for(var u=s.parseByte(),d=0;d<u;d+=1)r.push(i),h+=1;if(I.argument(r.length===c,"Bad flags."),a.length>0){var p,f=[];if(c>0){for(var m=0;m<c;m+=1)i=r[m],(p={}).onCurve=!!(1&i),p.lastPointOfContour=a.indexOf(m)>=0,f.push(p);for(var g=0,A=0;A<c;A+=1)i=r[A],(p=f[A]).x=It(s,i,g,2,16),g=p.x;for(var v=0,y=0;y<c;y+=1)i=r[y],(p=f[y]).y=It(s,i,v,4,32),v=p.y}e.points=f}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var x=!0;x;){r=s.parseUShort();var b={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(b.dx=s.parseShort(),b.dy=s.parseShort()):b.matchedPoints=[s.parseUShort(),s.parseUShort()]:(2&r)>0?(b.dx=s.parseChar(),b.dy=s.parseChar()):b.matchedPoints=[s.parseByte(),s.parseByte()],(8&r)>0?b.xScale=b.yScale=s.parseF2Dot14():(64&r)>0?(b.xScale=s.parseF2Dot14(),b.yScale=s.parseF2Dot14()):(128&r)>0&&(b.xScale=s.parseF2Dot14(),b.scale01=s.parseF2Dot14(),b.scale10=s.parseF2Dot14(),b.yScale=s.parseF2Dot14()),e.components.push(b),x=!!(32&r)}if(256&r){e.instructionLength=s.parseUShort(),e.instructions=[];for(var E=0;E<e.instructionLength;E+=1)e.instructions.push(s.parseByte())}}}function Rt(e,t){for(var n=[],r=0;r<e.length;r+=1){var i=e[r],s={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};n.push(s)}return n}function Pt(e){var t=new M;if(!e)return t;for(var n=function(e){for(var t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];n.push(i),i.lastPointOfContour&&(t.push(n),n=[])}return I.argument(0===n.length,"There are still points left in the current contour."),t}(e),r=0;r<n.length;++r){var i=n[r],s=null,a=i[i.length-1],o=i[0];if(a.onCurve)t.moveTo(a.x,a.y);else if(o.onCurve)t.moveTo(o.x,o.y);else{var l={x:.5*(a.x+o.x),y:.5*(a.y+o.y)};t.moveTo(l.x,l.y)}for(var c=0;c<i.length;++c)if(s=a,a=o,o=i[(c+1)%i.length],a.onCurve)t.lineTo(a.x,a.y);else{var h=o;s.onCurve||(a.x,s.x,a.y,s.y),o.onCurve||(h={x:.5*(a.x+o.x),y:.5*(a.y+o.y)}),t.quadraticCurveTo(a.x,a.y,h.x,h.y)}t.closePath()}return t}function Dt(e,t){if(t.isComposite)for(var n=0;n<t.components.length;n+=1){var r=t.components[n],i=e.get(r.glyphIndex);if(i.getPath(),i.points){var s=void 0;if(void 0===r.matchedPoints)s=Rt(i.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[r.matchedPoints[0]],o=i.points[r.matchedPoints[1]],l={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};o=Rt([o],l)[0],l.dx=a.x-o.x,l.dy=a.y-o.y,s=Rt(i.points,l)}t.points=t.points.concat(s)}}return Pt(t.points)}_t.prototype={searchTag:xt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,n=0;n<e.scripts.length;n++){var r=e.scripts[n].tag;if("DFLT"===r)return r;"latn"===r&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var n=this.getTable(t);if(n){e=e||"DFLT";var r=n.scripts,i=xt(n.scripts,e);if(i>=0)return r[i].script;if(t){var s={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return r.splice(-1-i,0,s),s.script}}},getLangSysTable:function(e,t,n){var r=this.getScriptTable(e,n);if(r){if(!t||"dflt"===t||"DFLT"===t)return r.defaultLangSys;var i=xt(r.langSysRecords,t);if(i>=0)return r.langSysRecords[i].langSys;if(n){var s={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return r.langSysRecords.splice(-1-i,0,s),s.langSys}}},getFeatureTable:function(e,t,n,r){var i=this.getLangSysTable(e,t,r);if(i){for(var s,a=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<a.length;l++)if((s=o[a[l]]).tag===n)return s.feature;if(r){var c=o.length;return I.assert(0===c||n>=o[c-1].tag,"Features must be added in alphabetical order."),s={tag:n,feature:{params:0,lookupListIndexes:[]}},o.push(s),a.push(c),s.feature}}},getLookupTables:function(e,t,n,r,i){var s=this.getFeatureTable(e,t,n,i),a=[];if(s){for(var o,l=s.lookupListIndexes,c=this.font.tables[this.tableName].lookups,h=0;h<l.length;h++)(o=c[l[h]]).lookupType===r&&a.push(o);if(0===a.length&&i){o={lookupType:r,lookupFlag:0,subtables:[],markFilteringSet:void 0};var u=c.length;return c.push(o),l.push(u),[o]}}return a},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var n=Et(e.ranges,t);return n?n.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var n=bt(e.glyphs,t);return n>=0?n:-1;case 2:var r=Et(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],n=e.ranges,r=0;r<n.length;r++)for(var i=n[r],s=i.start,a=i.end,o=s;o<=a;o++)t.push(o);return t}},St.prototype=_t.prototype,St.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},St.prototype.getKerningValue=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=e[r].subtables,s=0;s<i.length;s++){var a=i[s],o=this.getCoverageIndex(a.coverage,t);if(!(o<0))switch(a.posFormat){case 1:for(var l=a.pairSets[o],c=0;c<l.length;c++){var h=l[c];if(h.secondGlyph===n)return h.value1&&h.value1.xAdvance||0}break;case 2:var u=this.getGlyphClass(a.classDef1,t),d=this.getGlyphClass(a.classDef2,n),p=a.classRecords[u][d];return p.value1&&p.value1.xAdvance||0}}return 0},St.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},wt.prototype=_t.prototype,wt.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},wt.prototype.getSingle=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,1),s=0;s<i.length;s++)for(var a=i[s].subtables,o=0;o<a.length;o++){var l=a[o],c=this.expandCoverage(l.coverage),h=void 0;if(1===l.substFormat){var u=l.deltaGlyphId;for(h=0;h<c.length;h++){var d=c[h];r.push({sub:d,by:d+u})}}else{var p=l.substitute;for(h=0;h<c.length;h++)r.push({sub:c[h],by:p[h]})}}return r},wt.prototype.getMultiple=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,2),s=0;s<i.length;s++)for(var a=i[s].subtables,o=0;o<a.length;o++){var l=a[o],c=this.expandCoverage(l.coverage),h=void 0;for(h=0;h<c.length;h++){var u=c[h],d=l.sequences[h];r.push({sub:u,by:d})}}return r},wt.prototype.getAlternates=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,3),s=0;s<i.length;s++)for(var a=i[s].subtables,o=0;o<a.length;o++)for(var l=a[o],c=this.expandCoverage(l.coverage),h=l.alternateSets,u=0;u<c.length;u++)r.push({sub:c[u],by:h[u]});return r},wt.prototype.getLigatures=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,4),s=0;s<i.length;s++)for(var a=i[s].subtables,o=0;o<a.length;o++)for(var l=a[o],c=this.expandCoverage(l.coverage),h=l.ligatureSets,u=0;u<c.length;u++)for(var d=c[u],p=h[u],f=0;f<p.length;f++){var m=p[f];r.push({sub:[d].concat(m.components),by:m.ligGlyph})}return r},wt.prototype.addSingle=function(e,t,n,r){var i=Ct(this.getLookupTables(n,r,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});I.assert(1===i.coverage.format,"Single: unable to modify coverage table format "+i.coverage.format);var s=t.sub,a=this.binSearch(i.coverage.glyphs,s);a<0&&(a=-1-a,i.coverage.glyphs.splice(a,0,s),i.substitute.splice(a,0,0)),i.substitute[a]=t.by},wt.prototype.addMultiple=function(e,t,n,r){I.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=Ct(this.getLookupTables(n,r,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});I.assert(1===i.coverage.format,"Multiple: unable to modify coverage table format "+i.coverage.format);var s=t.sub,a=this.binSearch(i.coverage.glyphs,s);a<0&&(a=-1-a,i.coverage.glyphs.splice(a,0,s),i.sequences.splice(a,0,0)),i.sequences[a]=t.by},wt.prototype.addAlternate=function(e,t,n,r){var i=Ct(this.getLookupTables(n,r,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});I.assert(1===i.coverage.format,"Alternate: unable to modify coverage table format "+i.coverage.format);var s=t.sub,a=this.binSearch(i.coverage.glyphs,s);a<0&&(a=-1-a,i.coverage.glyphs.splice(a,0,s),i.alternateSets.splice(a,0,0)),i.alternateSets[a]=t.by},wt.prototype.addLigature=function(e,t,n,r){var i=this.getLookupTables(n,r,e,4,!0)[0],s=i.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=s),I.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);var a=t.sub[0],o=t.sub.slice(1),l={ligGlyph:t.by,components:o},c=this.binSearch(s.coverage.glyphs,a);if(c>=0){for(var h=s.ligatureSets[c],u=0;u<h.length;u++)if(Mt(h[u].components,o))return;h.push(l)}else c=-1-c,s.coverage.glyphs.splice(c,0,a),s.ligatureSets.splice(c,0,[l])},wt.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case"aalt":case"salt":return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,n);case"ccmp":return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case"stch":return this.getMultiple(e,t,n)}},wt.prototype.add=function(e,t,n,r){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,r);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,n,r):this.addAlternate(e,t,n,r);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,r);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,n,r):this.addLigature(e,t,n,r)}};var Lt,Ft,Ut,Ot,Nt={getPath:Pt,parse:function(e,t,n,r,i){return i.lowMemory?function(e,t,n,r){var i=new be.GlyphSet(r);return r._push=function(s){var a=n[s];a!==n[s+1]?i.push(s,be.ttfGlyphLoader(r,s,Bt,e,t+a,Dt)):i.push(s,be.glyphLoader(r,s))},i}(e,t,n,r):function(e,t,n,r){for(var i=new be.GlyphSet(r),s=0;s<n.length-1;s+=1){var a=n[s];a!==n[s+1]?i.push(s,be.ttfGlyphLoader(r,s,Bt,e,t+a,Dt)):i.push(s,be.glyphLoader(r,s))}return i}(e,t,n,r)}};function kt(e){this.font=e,this.getCommands=function(e){return Nt.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Gt(e){return e}function zt(e){return Math.sign(e)*Math.round(Math.abs(e))}function Qt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Vt(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Ht(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function jt(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Wt=function(e){var t=this.srPeriod,n=this.srPhase,r=1;return e<0&&(e=-e,r=-1),e+=this.srThreshold-n,e=Math.trunc(e/t)*t,(e+=n)<0?n*r:e*r},Xt={x:1,y:0,axis:"x",distance:function(e,t,n,r){return(n?e.xo:e.x)-(r?t.xo:t.x)},interpolate:function(e,t,n,r){var i,s,a,o,l,c,h;if(!r||r===this)return i=e.xo-t.xo,s=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,0===(h=(a=Math.abs(i))+(o=Math.abs(s)))?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*o+c*a)/h);i=r.distance(e,t,!0,!0),s=r.distance(e,n,!0,!0),l=r.distance(t,t,!1,!0),c=r.distance(n,n,!1,!0),0!==(h=(a=Math.abs(i))+(o=Math.abs(s)))?Xt.setRelative(e,e,(l*o+c*a)/h,r,!0):Xt.setRelative(e,e,(l+c)/2,r,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,r,i){if(r&&r!==this){var s=i?t.xo:t.x,a=i?t.yo:t.y,o=s+n*r.x,l=a+n*r.y;e.x=o+(e.y-l)/r.normalSlope}else e.x=(i?t.xo:t.x)+n},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Yt={x:0,y:1,axis:"y",distance:function(e,t,n,r){return(n?e.yo:e.y)-(r?t.yo:t.y)},interpolate:function(e,t,n,r){var i,s,a,o,l,c,h;if(!r||r===this)return i=e.yo-t.yo,s=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,0===(h=(a=Math.abs(i))+(o=Math.abs(s)))?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*o+c*a)/h);i=r.distance(e,t,!0,!0),s=r.distance(e,n,!0,!0),l=r.distance(t,t,!1,!0),c=r.distance(n,n,!1,!0),0!==(h=(a=Math.abs(i))+(o=Math.abs(s)))?Yt.setRelative(e,e,(l*o+c*a)/h,r,!0):Yt.setRelative(e,e,(l+c)/2,r,!0)},normalSlope:0,setRelative:function(e,t,n,r,i){if(r&&r!==this){var s=i?t.xo:t.x,a=i?t.yo:t.y,o=s+n*r.x,l=a+n*r.y;e.y=l+r.normalSlope*(e.x-o)}else e.y=(i?t.yo:t.y)+n},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function qt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Kt(e,t){var n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Xt:0===e&&1===t?Yt:new qt(e,t)}function Jt(e,t,n,r){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=r,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Xt),Object.freeze(Yt),qt.prototype.distance=function(e,t,n,r){return this.x*Xt.distance(e,t,n,r)+this.y*Yt.distance(e,t,n,r)},qt.prototype.interpolate=function(e,t,n,r){var i,s,a,o,l,c,h;a=r.distance(e,t,!0,!0),o=r.distance(e,n,!0,!0),i=r.distance(t,t,!1,!0),s=r.distance(n,n,!1,!0),0!==(h=(l=Math.abs(a))+(c=Math.abs(o)))?this.setRelative(e,e,(i*c+s*l)/h,r,!0):this.setRelative(e,e,(i+s)/2,r,!0)},qt.prototype.setRelative=function(e,t,n,r,i){r=r||this;var s=i?t.xo:t.x,a=i?t.yo:t.y,o=s+n*r.x,l=a+n*r.y,c=r.normalSlope,h=this.slope,u=e.x,d=e.y;e.x=(h*u-c*o+l-d)/(h-c),e.y=h*(e.x-u)+d},qt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Jt.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Jt.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Zt=Object.freeze(new Jt(0,0)),$t={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function en(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Xt,this.round=zt}}function tn(e){for(var t=e.tZone=new Array(e.gZone.length),n=0;n<t.length;n++)t[n]=new Jt(0,0)}function nn(e,t){var n,r=e.prog,i=e.ip,s=1;do{if(88===(n=r[++i]))s++;else if(89===n)s--;else if(64===n)i+=r[i+1]+1;else if(65===n)i+=2*r[i+1]+1;else if(n>=176&&n<=183)i+=n-176+1;else if(n>=184&&n<=191)i+=2*(n-184+1);else if(t&&1===s&&27===n)break}while(s>0);e.ip=i}function rn(e,n){t.DEBUG&&console.log(n.step,"SVTCA["+e.axis+"]"),n.fv=n.pv=n.dpv=e}function sn(e,n){t.DEBUG&&console.log(n.step,"SPVTCA["+e.axis+"]"),n.pv=n.dpv=e}function an(e,n){t.DEBUG&&console.log(n.step,"SFVTCA["+e.axis+"]"),n.fv=e}function on(e,n){var r,i,s=n.stack,a=s.pop(),o=s.pop(),l=n.z2[a],c=n.z1[o];t.DEBUG&&console.log("SPVTL["+e+"]",a,o),e?(r=l.y-c.y,i=c.x-l.x):(r=c.x-l.x,i=c.y-l.y),n.pv=n.dpv=Kt(r,i)}function ln(e,n){var r,i,s=n.stack,a=s.pop(),o=s.pop(),l=n.z2[a],c=n.z1[o];t.DEBUG&&console.log("SFVTL["+e+"]",a,o),e?(r=l.y-c.y,i=c.x-l.x):(r=c.x-l.x,i=c.y-l.y),n.fv=Kt(r,i)}function cn(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function hn(e,n){var r=n.stack.pop(),i=n.z0[r],s=n.fv,a=n.pv;t.DEBUG&&console.log(n.step,"MDAP["+e+"]",r);var o=a.distance(i,Zt);e&&(o=n.round(o)),s.setRelative(i,Zt,o,a),s.touch(i),n.rp0=n.rp1=r}function un(e,n){var r,i,s,a=n.z2,o=a.length-2;t.DEBUG&&console.log(n.step,"IUP["+e.axis+"]");for(var l=0;l<o;l++)r=a[l],e.touched(r)||(i=r.prevTouched(e))!==r&&(i===(s=r.nextTouched(e))&&e.setRelative(r,r,e.distance(i,i,!1,!0),e,!0),e.interpolate(r,i,s,e))}function dn(e,n){for(var r=n.stack,i=e?n.rp1:n.rp2,s=(e?n.z0:n.z1)[i],a=n.fv,o=n.pv,l=n.loop,c=n.z2;l--;){var h=r.pop(),u=c[h],d=o.distance(s,s,!1,!0);a.setRelative(u,u,d,o),a.touch(u),t.DEBUG&&console.log(n.step,(n.loop>1?"loop "+(n.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",h)}n.loop=1}function pn(e,n){var r=n.stack,i=e?n.rp1:n.rp2,s=(e?n.z0:n.z1)[i],a=n.fv,o=n.pv,l=r.pop(),c=n.z2[n.contours[l]],h=c;t.DEBUG&&console.log(n.step,"SHC["+e+"]",l);var u=o.distance(s,s,!1,!0);do{h!==s&&a.setRelative(h,h,u,o),h=h.nextPointOnContour}while(h!==c)}function fn(e,n){var r,i,s=n.stack,a=e?n.rp1:n.rp2,o=(e?n.z0:n.z1)[a],l=n.fv,c=n.pv,h=s.pop();switch(t.DEBUG&&console.log(n.step,"SHZ["+e+"]",h),h){case 0:r=n.tZone;break;case 1:r=n.gZone;break;default:throw new Error("Invalid zone")}for(var u=c.distance(o,o,!1,!0),d=r.length-2,p=0;p<d;p++)i=r[p],l.setRelative(i,i,u,c)}function mn(e,n){var r=n.stack,i=r.pop()/64,s=r.pop(),a=n.z1[s],o=n.z0[n.rp0],l=n.fv,c=n.pv;l.setRelative(a,o,i,c),l.touch(a),t.DEBUG&&console.log(n.step,"MSIRP["+e+"]",i,s),n.rp1=n.rp0,n.rp2=s,e&&(n.rp0=s)}function gn(e,n){var r=n.stack,i=r.pop(),s=r.pop(),a=n.z0[s],o=n.fv,l=n.pv,c=n.cvt[i];t.DEBUG&&console.log(n.step,"MIAP["+e+"]",i,"(",c,")",s);var h=l.distance(a,Zt);e&&(Math.abs(h-c)<n.cvCutIn&&(h=c),h=n.round(h)),o.setRelative(a,Zt,h,l),0===n.zp0&&(a.xo=a.x,a.yo=a.y),o.touch(a),n.rp0=n.rp1=s}function An(e,n){var r=n.stack,i=r.pop(),s=n.z2[i];t.DEBUG&&console.log(n.step,"GC["+e+"]",i),r.push(64*n.dpv.distance(s,Zt,e,!1))}function vn(e,n){var r=n.stack,i=r.pop(),s=r.pop(),a=n.z1[i],o=n.z0[s],l=n.dpv.distance(o,a,e,e);t.DEBUG&&console.log(n.step,"MD["+e+"]",i,s,"->",l),n.stack.push(Math.round(64*l))}function yn(e,n){var r=n.stack,i=r.pop(),s=n.fv,a=n.pv,o=n.ppem,l=n.deltaBase+16*(e-1),c=n.deltaShift,h=n.z0;t.DEBUG&&console.log(n.step,"DELTAP["+e+"]",i,r);for(var u=0;u<i;u++){var d=r.pop(),p=r.pop();if(l+((240&p)>>4)===o){var f=(15&p)-8;f>=0&&f++,t.DEBUG&&console.log(n.step,"DELTAPFIX",d,"by",f*c);var m=h[d];s.setRelative(m,m,f*c,a)}}}function xn(e,n){var r=n.stack,i=r.pop();t.DEBUG&&console.log(n.step,"ROUND[]"),r.push(64*n.round(i/64))}function bn(e,n){var r=n.stack,i=r.pop(),s=n.ppem,a=n.deltaBase+16*(e-1),o=n.deltaShift;t.DEBUG&&console.log(n.step,"DELTAC["+e+"]",i,r);for(var l=0;l<i;l++){var c=r.pop(),h=r.pop();if(a+((240&h)>>4)===s){var u=(15&h)-8;u>=0&&u++;var d=u*o;t.DEBUG&&console.log(n.step,"DELTACFIX",c,"by",d),n.cvt[c]+=d}}}function En(e,n){var r,i,s=n.stack,a=s.pop(),o=s.pop(),l=n.z2[a],c=n.z1[o];t.DEBUG&&console.log(n.step,"SDPVTL["+e+"]",a,o),e?(r=l.y-c.y,i=c.x-l.x):(r=c.x-l.x,i=c.y-l.y),n.dpv=Kt(r,i)}function _n(e,n){var r=n.stack,i=n.prog,s=n.ip;t.DEBUG&&console.log(n.step,"PUSHB["+e+"]");for(var a=0;a<e;a++)r.push(i[++s]);n.ip=s}function Sn(e,n){var r=n.ip,i=n.prog,s=n.stack;t.DEBUG&&console.log(n.ip,"PUSHW["+e+"]");for(var a=0;a<e;a++){var o=i[++r]<<8|i[++r];32768&o&&(o=-(1+(65535^o))),s.push(o)}n.ip=r}function wn(e,n,r,i,s,a){var o,l,c,h,u=a.stack,d=e&&u.pop(),p=u.pop(),f=a.rp0,m=a.z0[f],g=a.z1[p],A=a.minDis,v=a.fv,y=a.dpv;c=(l=o=y.distance(g,m,!0,!0))>=0?1:-1,l=Math.abs(l),e&&(h=a.cvt[d],i&&Math.abs(l-h)<a.cvCutIn&&(l=h)),r&&l<A&&(l=A),i&&(l=a.round(l)),v.setRelative(g,m,c*l,y),v.touch(g),t.DEBUG&&console.log(a.step,(e?"MIRP[":"MDRP[")+(n?"M":"m")+(r?">":"_")+(i?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",e?d+"("+a.cvt[d]+","+h+")":"",p,"(d =",o,"->",c*l,")"),a.rp1=a.rp0,a.rp2=p,n&&(a.rp0=p)}function Mn(e){this.char=e,this.state={},this.activeState=null}function Cn(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function Tn(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function In(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function Bn(e){this.eventId=e,this.subscribers=[]}function Rn(e){var t=this,n=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];n.forEach((function(e){Object.defineProperty(t.events,e,{value:new Bn(e)})})),e&&n.forEach((function(n){var r=e[n];"function"==typeof r&&t.events[n].subscribe(r)}));["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach((function(e){t.events[e].subscribe(t.updateContextsRanges)}))}function Pn(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Rn.call(this,e)}function Dn(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function Ln(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function Fn(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Un(e){return/[A-z]/.test(e)}function On(e){this.font=e,this.features={}}function Nn(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function kn(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var n=t.ranges,r=0;r<n.length;r++){var i=n[r];if(e>=i.start&&e<=i.end){var s=e-i.start;return i.index+s}}break;default:return-1}return-1}function Gn(e,t){return-1===kn(e,t.coverage)?null:e+t.deltaGlyphId}function zn(e,t){var n=kn(e,t.coverage);return-1===n?null:t.substitute[n]}function Qn(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],s=t.current,a=kn(s=Array.isArray(s)?s[0]:s,i);-1!==a&&n.push(a)}return n.length!==e.length?-1:n}function Vn(e,t){var n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];var r=Qn(t.inputCoverage,e);if(-1===r)return[];var i=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var s=e.lookahead.slice(i);s.length&&Fn(s[0].char);)s.shift();var a=new In(s,0),o=Qn(t.lookaheadCoverage,a),l=[].concat(e.backtrack);for(l.reverse();l.length&&Fn(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];var c=new In(l,0),h=Qn(t.backtrackCoverage,c),u=[];if(r.length===t.inputCoverage.length&&o.length===t.lookaheadCoverage.length&&h.length===t.backtrackCoverage.length)for(var d=0;d<t.lookupRecords.length;d++)for(var p=t.lookupRecords[d].lookupListIndex,f=this.getLookupByIndex(p),m=0;m<f.subtables.length;m++){var g=f.subtables[m],A=this.getLookupMethod(f,g);if("12"===this.getSubstitutionType(f,g))for(var v=0;v<r.length;v++){var y=A(e.get(v));y&&u.push(y)}}return u}function Hn(e,t){var n,r=kn(e.current,t.coverage);if(-1===r)return null;for(var i=t.ligatureSets[r],s=0;s<i.length;s++){n=i[s];for(var a=0;a<n.components.length;a++){if(e.lookahead[a]!==n.components[a])break;if(a===n.components.length-1)return n}}return null}function jn(e,t){var n=kn(e,t.coverage);return-1===n?null:t.sequences[n]}kt.prototype.exec=function(e,n){if("number"!=typeof n)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var r=this.font,i=this._prepState;if(!i||i.ppem!==n){var s=this._fpgmState;if(!s){en.prototype=$t,(s=this._fpgmState=new en("fpgm",r.tables.fpgm)).funcs=[],s.font=r,t.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{Ft(s)}catch(h){return console.log("Hinting error in FPGM:"+h),void(this._errorState=3)}}en.prototype=s,(i=this._prepState=new en("prep",r.tables.prep)).ppem=n;var a=r.tables.cvt;if(a)for(var o=i.cvt=new Array(a.length),l=n/r.unitsPerEm,c=0;c<a.length;c++)o[c]=a[c]*l;else i.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),i.step=-1);try{Ft(i)}catch(h){this._errorState<2&&console.log("Hinting error in PREP:"+h),this._errorState=2}}if(!(this._errorState>1))try{return Ut(e,i)}catch(h){return this._errorState<1&&(console.log("Hinting error:"+h),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},Ut=function(e,n){var r,i,s,a=n.ppem/n.font.unitsPerEm,o=a,l=e.components;if(en.prototype=n,l){var c=n.font;i=[],r=[];for(var h=0;h<l.length;h++){var u=l[h],d=c.glyphs.get(u.glyphIndex);s=new en("glyf",d.instructions),t.DEBUG&&(console.log("---EXEC COMP "+h+"---"),s.step=-1),Ot(d,s,a,o);for(var p=Math.round(u.dx*a),f=Math.round(u.dy*o),m=s.gZone,g=s.contours,A=0;A<m.length;A++){var v=m[A];v.xTouched=v.yTouched=!1,v.xo=v.x=v.x+p,v.yo=v.y=v.y+f}var y=i.length;i.push.apply(i,m);for(var x=0;x<g.length;x++)r.push(g[x]+y)}e.instructions&&!s.inhibitGridFit&&((s=new en("glyf",e.instructions)).gZone=s.z0=s.z1=s.z2=i,s.contours=r,i.push(new Jt(0,0),new Jt(Math.round(e.advanceWidth*a),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),s.step=-1),Ft(s),i.length-=2)}else s=new en("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),s.step=-1),Ot(e,s,a,o),i=s.gZone;return i},Ot=function(e,n,r,i){for(var s,a,o,l=e.points||[],c=l.length,h=n.gZone=n.z0=n.z1=n.z2=[],u=n.contours=[],d=0;d<c;d++)s=l[d],h[d]=new Jt(s.x*r,s.y*i,s.lastPointOfContour,s.onCurve);for(var p=0;p<c;p++)s=h[p],a||(a=s,u.push(p)),s.lastPointOfContour?(s.nextPointOnContour=a,a.prevPointOnContour=s,a=void 0):(o=h[p+1],s.nextPointOnContour=o,o.prevPointOnContour=s);if(!n.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",n.stack);for(var f=0;f<c;f++)console.log(f,h[f].x,h[f].y)}if(h.push(new Jt(0,0),new Jt(Math.round(e.advanceWidth*r),0)),Ft(n),h.length-=2,t.DEBUG){console.log("FINISHED GLYPH",n.stack);for(var m=0;m<c;m++)console.log(m,h[m].x,h[m].y)}}},Ft=function(e){var n=e.prog;if(n){var r,i=n.length;for(e.ip=0;e.ip<i;e.ip++){if(t.DEBUG&&e.step++,!(r=Lt[n[e.ip]]))throw new Error("unknown instruction: 0x"+Number(n[e.ip]).toString(16));r(e)}}},Lt=[rn.bind(void 0,Yt),rn.bind(void 0,Xt),sn.bind(void 0,Yt),sn.bind(void 0,Xt),an.bind(void 0,Yt),an.bind(void 0,Xt),on.bind(void 0,0),on.bind(void 0,1),ln.bind(void 0,0),ln.bind(void 0,1),function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",r,i),e.pv=e.dpv=Kt(i,r)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",r,i),e.fv=Kt(i,r)},function(e){var n=e.stack,r=e.pv;t.DEBUG&&console.log(e.step,"GPV[]"),n.push(16384*r.x),n.push(16384*r.y)},function(e){var n=e.stack,r=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),n.push(16384*r.x),n.push(16384*r.y)},function(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var n=e.stack,r=n.pop(),i=n.pop(),s=n.pop(),a=n.pop(),o=n.pop(),l=e.z0,c=e.z1,h=l[r],u=l[i],d=c[s],p=c[a],f=e.z2[o];t.DEBUG&&console.log("ISECT[], ",r,i,s,a,o);var m=h.x,g=h.y,A=u.x,v=u.y,y=d.x,x=d.y,b=p.x,E=p.y,_=(m-A)*(x-E)-(g-v)*(y-b),S=m*v-g*A,w=y*E-x*b;f.x=(S*(y-b)-w*(m-A))/_,f.y=(S*(x-E)-w*(g-v))/_},function(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",n),e.zp0=n,n){case 0:e.tZone||tn(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",n),e.zp1=n,n){case 0:e.tZone||tn(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",n),e.zp2=n,n){case 0:e.tZone||tn(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",n),e.zp0=e.zp1=e.zp2=n,n){case 0:e.tZone||tn(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=zt},function(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Vt},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",n),e.minDis=n/64},function(e){t.DEBUG&&console.log(e.step,"ELSE[]"),nn(e,!1)},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",n),e.ip+=n-1},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",n),e.cvCutIn=n/64},void 0,void 0,function(e){var n=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),n.push(n[n.length-1])},cn,function(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),n.push(r),n.push(i)},function(e){var n=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),n.push(n.length)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",r),n.push(n[n.length-r])},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",r),n.push(n.splice(n.length-r,1)[0])},void 0,void 0,void 0,function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"LOOPCALL[]",r,i);var s=e.ip,a=e.prog;e.prog=e.funcs[r];for(var o=0;o<i;o++)Ft(e),t.DEBUG&&console.log(++e.step,o+1<i?"next loopcall":"done loopcall",o);e.ip=s,e.prog=a},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"CALL[]",n);var r=e.ip,i=e.prog;e.prog=e.funcs[n],Ft(e),e.ip=r,e.prog=i,t.DEBUG&&console.log(++e.step,"returning from",n)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var n=e.stack,r=e.prog,i=e.ip,s=n.pop(),a=i;for(t.DEBUG&&console.log(e.step,"FDEF[]",s);45!==r[++i];);e.ip=i,e.funcs[s]=r.slice(a+1,i)},void 0,hn.bind(void 0,0),hn.bind(void 0,1),un.bind(void 0,Yt),un.bind(void 0,Xt),dn.bind(void 0,0),dn.bind(void 0,1),pn.bind(void 0,0),pn.bind(void 0,1),fn.bind(void 0,0),fn.bind(void 0,1),function(e){for(var n=e.stack,r=e.loop,i=e.fv,s=n.pop()/64,a=e.z2;r--;){var o=n.pop(),l=a[o];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"SHPIX[]",o,s),i.setRelative(l,l,s),i.touch(l)}e.loop=1},function(e){for(var n=e.stack,r=e.rp1,i=e.rp2,s=e.loop,a=e.z0[r],o=e.z1[i],l=e.fv,c=e.dpv,h=e.z2;s--;){var u=n.pop(),d=h[u];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"IP[]",u,r,"<->",i),l.interpolate(d,a,o,c),l.touch(d)}e.loop=1},mn.bind(void 0,0),mn.bind(void 0,1),function(e){for(var n=e.stack,r=e.rp0,i=e.z0[r],s=e.loop,a=e.fv,o=e.pv,l=e.z1;s--;){var c=n.pop(),h=l[c];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"ALIGNRP[]",c),a.setRelative(h,i,0,o),a.touch(h)}e.loop=1},function(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Qt},gn.bind(void 0,0),gn.bind(void 0,1),function(e){var n=e.prog,r=e.ip,i=e.stack,s=n[++r];t.DEBUG&&console.log(e.step,"NPUSHB[]",s);for(var a=0;a<s;a++)i.push(n[++r]);e.ip=r},function(e){var n=e.ip,r=e.prog,i=e.stack,s=r[++n];t.DEBUG&&console.log(e.step,"NPUSHW[]",s);for(var a=0;a<s;a++){var o=r[++n]<<8|r[++n];32768&o&&(o=-(1+(65535^o))),i.push(o)}e.ip=n},function(e){var n=e.stack,r=e.store;r||(r=e.store=[]);var i=n.pop(),s=n.pop();t.DEBUG&&console.log(e.step,"WS",i,s),r[s]=i},function(e){var n=e.stack,r=e.store,i=n.pop();t.DEBUG&&console.log(e.step,"RS",i);var s=r&&r[i]||0;n.push(s)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"WCVTP",r,i),e.cvt[i]=r/64},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"RCVT",r),n.push(64*e.cvt[r])},An.bind(void 0,0),An.bind(void 0,1),void 0,vn.bind(void 0,0),vn.bind(void 0,1),function(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"LT[]",r,i),n.push(i<r?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",r,i),n.push(i<=r?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"GT[]",r,i),n.push(i>r?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",r,i),n.push(i>=r?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"EQ[]",r,i),n.push(r===i?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"NEQ[]",r,i),n.push(r!==i?1:0)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"ODD[]",r),n.push(Math.trunc(r)%2?1:0)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"EVEN[]",r),n.push(Math.trunc(r)%2?0:1)},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",n),n||(nn(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))},function(e){t.DEBUG&&console.log(e.step,"EIF[]")},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"AND[]",r,i),n.push(r&&i?1:0)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"OR[]",r,i),n.push(r||i?1:0)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"NOT[]",r),n.push(r?0:1)},yn.bind(void 0,1),function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SDB[]",n),e.deltaBase=n},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SDS[]",n),e.deltaShift=Math.pow(.5,n)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"ADD[]",r,i),n.push(i+r)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"SUB[]",r,i),n.push(i-r)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"DIV[]",r,i),n.push(64*i/r)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"MUL[]",r,i),n.push(i*r/64)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"ABS[]",r),n.push(Math.abs(r))},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"NEG[]",r),n.push(-r)},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",r),n.push(64*Math.floor(r/64))},function(e){var n=e.stack,r=n.pop();t.DEBUG&&console.log(e.step,"CEILING[]",r),n.push(64*Math.ceil(r/64))},xn.bind(void 0,0),xn.bind(void 0,1),xn.bind(void 0,2),xn.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",r,i),e.cvt[i]=r*e.ppem/e.font.unitsPerEm},yn.bind(void 0,2),yn.bind(void 0,3),bn.bind(void 0,1),bn.bind(void 0,2),bn.bind(void 0,3),function(e){var n,r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Wt,192&r){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}r&=15,e.srThreshold=0===r?0:(r/8-.5)*n},function(e){var n,r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Wt,192&r){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}r&=15,e.srThreshold=0===r?0:(r/8-.5)*n},void 0,void 0,function(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Gt},void 0,function(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Ht},function(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=jt},cn,cn,void 0,void 0,void 0,void 0,void 0,function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",n)},En.bind(void 0,0),En.bind(void 0,1),function(e){var n=e.stack,r=n.pop(),i=0;t.DEBUG&&console.log(e.step,"GETINFO[]",r),1&r&&(i=35),32&r&&(i|=4096),n.push(i)},void 0,function(e){var n=e.stack,r=n.pop(),i=n.pop(),s=n.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),n.push(i),n.push(r),n.push(s)},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"MAX[]",r,i),n.push(Math.max(i,r))},function(e){var n=e.stack,r=n.pop(),i=n.pop();t.DEBUG&&console.log(e.step,"MIN[]",r,i),n.push(Math.min(i,r))},function(e){var n=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",n)},function(e){var n=e.stack.pop(),r=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",n,r),n){case 1:return void(e.inhibitGridFit=!!r);case 2:return void(e.ignoreCvt=!!r);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_n.bind(void 0,1),_n.bind(void 0,2),_n.bind(void 0,3),_n.bind(void 0,4),_n.bind(void 0,5),_n.bind(void 0,6),_n.bind(void 0,7),_n.bind(void 0,8),Sn.bind(void 0,1),Sn.bind(void 0,2),Sn.bind(void 0,3),Sn.bind(void 0,4),Sn.bind(void 0,5),Sn.bind(void 0,6),Sn.bind(void 0,7),Sn.bind(void 0,8),wn.bind(void 0,0,0,0,0,0),wn.bind(void 0,0,0,0,0,1),wn.bind(void 0,0,0,0,0,2),wn.bind(void 0,0,0,0,0,3),wn.bind(void 0,0,0,0,1,0),wn.bind(void 0,0,0,0,1,1),wn.bind(void 0,0,0,0,1,2),wn.bind(void 0,0,0,0,1,3),wn.bind(void 0,0,0,1,0,0),wn.bind(void 0,0,0,1,0,1),wn.bind(void 0,0,0,1,0,2),wn.bind(void 0,0,0,1,0,3),wn.bind(void 0,0,0,1,1,0),wn.bind(void 0,0,0,1,1,1),wn.bind(void 0,0,0,1,1,2),wn.bind(void 0,0,0,1,1,3),wn.bind(void 0,0,1,0,0,0),wn.bind(void 0,0,1,0,0,1),wn.bind(void 0,0,1,0,0,2),wn.bind(void 0,0,1,0,0,3),wn.bind(void 0,0,1,0,1,0),wn.bind(void 0,0,1,0,1,1),wn.bind(void 0,0,1,0,1,2),wn.bind(void 0,0,1,0,1,3),wn.bind(void 0,0,1,1,0,0),wn.bind(void 0,0,1,1,0,1),wn.bind(void 0,0,1,1,0,2),wn.bind(void 0,0,1,1,0,3),wn.bind(void 0,0,1,1,1,0),wn.bind(void 0,0,1,1,1,1),wn.bind(void 0,0,1,1,1,2),wn.bind(void 0,0,1,1,1,3),wn.bind(void 0,1,0,0,0,0),wn.bind(void 0,1,0,0,0,1),wn.bind(void 0,1,0,0,0,2),wn.bind(void 0,1,0,0,0,3),wn.bind(void 0,1,0,0,1,0),wn.bind(void 0,1,0,0,1,1),wn.bind(void 0,1,0,0,1,2),wn.bind(void 0,1,0,0,1,3),wn.bind(void 0,1,0,1,0,0),wn.bind(void 0,1,0,1,0,1),wn.bind(void 0,1,0,1,0,2),wn.bind(void 0,1,0,1,0,3),wn.bind(void 0,1,0,1,1,0),wn.bind(void 0,1,0,1,1,1),wn.bind(void 0,1,0,1,1,2),wn.bind(void 0,1,0,1,1,3),wn.bind(void 0,1,1,0,0,0),wn.bind(void 0,1,1,0,0,1),wn.bind(void 0,1,1,0,0,2),wn.bind(void 0,1,1,0,0,3),wn.bind(void 0,1,1,0,1,0),wn.bind(void 0,1,1,0,1,1),wn.bind(void 0,1,1,0,1,2),wn.bind(void 0,1,1,0,1,3),wn.bind(void 0,1,1,1,0,0),wn.bind(void 0,1,1,1,0,1),wn.bind(void 0,1,1,1,0,2),wn.bind(void 0,1,1,1,0,3),wn.bind(void 0,1,1,1,1,0),wn.bind(void 0,1,1,1,1,1),wn.bind(void 0,1,1,1,1,2),wn.bind(void 0,1,1,1,1,3)],Mn.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},Mn.prototype.getState=function(e){return this.state[e]||null},Pn.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},Pn.prototype.composeRUD=function(e){var t=this,n=e.map((function(e){return t[e[0]].apply(t,e.slice(1).concat(true))})),r=function(e){return"object"==typeof e&&e.hasOwnProperty("FAIL")};if(n.every(r))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(r)};this.dispatch("composeRUD",[n.filter((function(e){return!r(e)}))])},Pn.prototype.replaceRange=function(e,t,n,r){t=null!==t?t:this.tokens.length;var i=n.every((function(e){return e instanceof Mn}));if(!isNaN(e)&&this.inboundIndex(e)&&i){var s=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return r||this.dispatch("replaceToken",[e,t,n]),[s,n]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},Pn.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Mn){var r=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[r[0],t]}return{FAIL:"replaceToken: invalid token or index."}},Pn.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;var r=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[r,e,t]),r},Pn.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}return{FAIL:"removeToken: invalid token index."}},Pn.prototype.insertToken=function(e,t,n){return e.every((function(e){return e instanceof Mn}))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},Pn.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe((function(r,i){var s=[r,i],a=[r,i];if(null===t||!0===t.apply(this,s)){var o=n.apply(this,a);r.setState(e,o)}})),this.registeredModifiers.push(e)},Bn.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},Bn.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},In.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},In.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},Pn.prototype.rangeToText=function(e){if(e instanceof Cn)return this.getRangeTokens(e).map((function(e){return e.char})).join("")},Pn.prototype.getText=function(){return this.tokens.map((function(e){return e.char})).join("")},Pn.prototype.getContext=function(e){var t=this.registeredContexts[e];return t||null},Pn.prototype.on=function(e,t){var n=this.events[e];return n?n.subscribe(t):null},Pn.prototype.dispatch=function(e,t){var n=this,r=this.events[e];r instanceof Bn&&r.subscribers.forEach((function(e){e.apply(n,t||[])}))},Pn.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof n)return{FAIL:"missing context end check."};var r=new Tn(e,t,n);return this.registeredContexts[e]=r,this.contextCheckers.push(r),r},Pn.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},Pn.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:"context checker '"+e+"' is not registered."}},Pn.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e){if(e.hasOwnProperty(t))e[t].ranges=[]}},Pn.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map((function(e){return e.char})),t=0;t<e.length;t++){var n=new In(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},Pn.prototype.setEndOffset=function(e,t){var n=new Cn(this.getContext(t).openRange.startIndex,e,t),r=this.getContext(t).ranges;return n.rangeId=t+"."+r.length,r.push(n),this.getContext(t).openRange=null,n},Pn.prototype.runContextCheck=function(e){var t=this,n=e.index;this.contextCheckers.forEach((function(r){var i=r.contextName,s=t.getContext(i).openRange;if(!s&&r.checkStart(e)&&(s=new Cn(n,null,i),t.getContext(i).openRange=s,t.dispatch("contextStart",[i,n])),s&&r.checkEnd(e)){var a=n-s.startIndex+1,o=t.setEndOffset(a,i);t.dispatch("contextEnd",[i,o])}}))},Pn.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch("start");for(var n=0;n<t.length;n++){var r=t[n],i=new In(t,n);this.dispatch("next",[i]),this.runContextCheck(i);var s=new Mn(r);this.tokens.push(s),this.dispatch("newToken",[s,i])}return this.dispatch("end",[this.tokens]),this.tokens},On.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var n=e[t];if("DFLT"===n.tag)return n.script.defaultLangSys.featureIndexes}return[]},On.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var r=t[n];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;var i=r.langSysRecords;if(i)for(var s=0;s<i.length;s++){var a=i[s];if(a.tag===e)return a.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},On.prototype.mapTagsToFeatures=function(e,t){for(var n={},r=0;r<e.length;r++){var i=e[r].tag,s=e[r].feature;n[i]=s}this.features[t].tags=n},On.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var n=this.getScriptFeaturesIndexes(e);if(!n)return null;var r=this.font.tables.gsub;return t=n.map((function(e){return r.features[e]})),this.features[e]=t,this.mapTagsToFeatures(t,e),t},On.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},On.prototype.getLookupMethod=function(e,t){var n=this;switch(this.getSubstitutionType(e,t)){case"11":return function(e){return Gn.apply(n,[e,t])};case"12":return function(e){return zn.apply(n,[e,t])};case"63":return function(e){return Vn.apply(n,[e,t])};case"41":return function(e){return Hn.apply(n,[e,t])};case"21":return function(e){return jn.apply(n,[e,t])};default:throw new Error("lookupType: "+e.lookupType+" - substFormat: "+t.substFormat+" is not yet supported")}},On.prototype.lookupFeature=function(e){var t=e.contextParams,n=t.index,r=this.getFeature({tag:e.tag,script:e.script});if(!r)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+e.tag+"' for script '"+e.script+"'.");for(var i=this.getFeatureLookups(r),s=[].concat(t.context),a=0;a<i.length;a++)for(var o=i[a],l=this.getLookupSubtables(o),c=0;c<l.length;c++){var h=l[c],u=this.getSubstitutionType(o,h),d=this.getLookupMethod(o,h),p=void 0;switch(u){case"11":(p=d(t.current))&&s.splice(n,1,new Nn({id:11,tag:e.tag,substitution:p}));break;case"12":(p=d(t.current))&&s.splice(n,1,new Nn({id:12,tag:e.tag,substitution:p}));break;case"63":p=d(t),Array.isArray(p)&&p.length&&s.splice(n,1,new Nn({id:63,tag:e.tag,substitution:p}));break;case"41":(p=d(t))&&s.splice(n,1,new Nn({id:41,tag:e.tag,substitution:p}));break;case"21":(p=d(t.current))&&s.splice(n,1,new Nn({id:21,tag:e.tag,substitution:p}))}t=new In(s,n),Array.isArray(p)&&!p.length||(p=null)}return s.length?s:null},On.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var n=this.features[e.script].some((function(t){return t.tag===e.tag}));return t&&n},On.prototype.getLookupSubtables=function(e){return e.subtables||null},On.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},On.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},On.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};var Wn={startCheck:function(e){var t=e.current,n=e.get(-1);return null===n&&Dn(t)||!Dn(n)&&Dn(t)},endCheck:function(e){var t=e.get(1);return null===t||!Dn(t)}};var Xn={startCheck:function(e){var t=e.current,n=e.get(-1);return(Dn(t)||Fn(t))&&!Dn(n)},endCheck:function(e){var t=e.get(1);switch(!0){case null===t:return!0;case!Dn(t)&&!Fn(t):var n=/\s/.test(t);if(!n)return!0;if(n){var r;if(r=e.lookahead.some((function(e){return Dn(e)||Fn(e)})),!r)return!0}break;default:return!1}}};var Yn={11:function(e,t,n){t[n].setState(e.tag,e.substitution)},12:function(e,t,n){t[n].setState(e.tag,e.substitution)},63:function(e,t,n){e.substitution.forEach((function(r,i){t[n+i].setState(e.tag,r)}))},41:function(e,t,n){var r=t[n];r.setState(e.tag,e.substitution.ligGlyph);for(var i=e.substitution.components.length,s=0;s<i;s++)(r=t[n+s+1]).setState("deleted",!0)}};function qn(e,t,n){e instanceof Nn&&Yn[e.id]&&Yn[e.id](e,t,n)}function Kn(e){var t=this,n="arab",r=this.featuresTags[n],i=this.tokenizer.getRangeTokens(e);if(1!==i.length){var s=new In(i.map((function(e){return e.getState("glyphIndex")})),0),a=new In(i.map((function(e){return e.char})),0);i.forEach((function(e,o){if(!Fn(e.char)){s.setCurrentIndex(o),a.setCurrentIndex(o);var l,c=0;switch(function(e){for(var t=[].concat(e.backtrack),n=t.length-1;n>=0;n--){var r=t[n],i=Ln(r),s=Fn(r);if(!i&&!s)return!0;if(i)return!1}return!1}(a)&&(c|=1),function(e){if(Ln(e.current))return!1;for(var t=0;t<e.lookahead.length;t++)if(!Fn(e.lookahead[t]))return!0;return!1}(a)&&(c|=2),c){case 1:l="fina";break;case 2:l="init";break;case 3:l="medi"}if(-1!==r.indexOf(l)){var h=t.query.lookupFeature({tag:l,script:n,contextParams:s});if(h instanceof Error)return console.info(h.message);h.forEach((function(e,t){e instanceof Nn&&(qn(e,i,t),s.context[t]=e.substitution)}))}}}))}}function Jn(e,t){return new In(e.map((function(e){return e.activeState.value})),t||0)}function Zn(e){var t=this,n=this.tokenizer.getRangeTokens(e),r=Jn(n);r.context.forEach((function(e,i){r.setCurrentIndex(i);var s=t.query.lookupFeature({tag:"rlig",script:"arab",contextParams:r});s.length&&(s.forEach((function(e){return qn(e,n,i)})),r=Jn(n))}))}var $n={startCheck:function(e){var t=e.current,n=e.get(-1);return null===n&&Un(t)||!Un(n)&&Un(t)},endCheck:function(e){var t=e.get(1);return null===t||!Un(t)}};function er(e,t){return new In(e.map((function(e){return e.activeState.value})),t||0)}function tr(e){var t=this,n=this.tokenizer.getRangeTokens(e),r=er(n);r.context.forEach((function(e,i){r.setCurrentIndex(i);var s=t.query.lookupFeature({tag:"liga",script:"latn",contextParams:r});s.length&&(s.forEach((function(e){return qn(e,n,i)})),r=er(n))}))}function nr(e){this.baseDir=e||"ltr",this.tokenizer=new Pn,this.featuresTags={}}function rr(e){var t=this.contextChecks[e+"Check"];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function ir(){return rr.call(this,"latinWord"),rr.call(this,"arabicWord"),rr.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function sr(){var e=this;this.tokenizer.getContextRanges("arabicSentence").forEach((function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())}))}function ar(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function or(){var e=this;this.featuresTags.hasOwnProperty("arab")&&(ar.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Kn.call(e,t)})))}function lr(){var e=this,t="arab";this.featuresTags.hasOwnProperty(t)&&(-1!==this.featuresTags[t].indexOf("rlig")&&(ar.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Zn.call(e,t)}))))}function cr(){var e=this,t="latn";this.featuresTags.hasOwnProperty(t)&&(-1!==this.featuresTags[t].indexOf("liga")&&(ar.call(this),this.tokenizer.getContextRanges("latinWord").forEach((function(t){tr.call(e,t)}))))}function hr(e){(e=e||{}).tables=e.tables||{},e.empty||(Tt(e.familyName,"When creating a new Font object, familyName is required."),Tt(e.styleName,"When creating a new Font object, styleName is required."),Tt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Tt(e.ascender,"When creating a new Font object, ascender is required."),Tt(e.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new be.GlyphSet(this,e.glyphs||[]),this.encoding=new de(this),this.position=new St(this),this.substitution=new wt(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new kt(this):void 0}})}function ur(e,t){var n=JSON.stringify(e),r=256;for(var i in t){var s=parseInt(i);if(s&&!(s<256)){if(JSON.stringify(t[i])===n)return s;r<=s&&(r=s+1)}}return t[r]=e,r}function dr(e,t,n){var r=ur(t.name,n);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:r}]}function pr(e,t,n){var r={},i=new se.Parser(e,t);return r.tag=i.parseTag(),r.minValue=i.parseFixed(),r.defaultValue=i.parseFixed(),r.maxValue=i.parseFixed(),i.skip("uShort",1),r.name=n[i.parseUShort()]||{},r}function fr(e,t,n,r){for(var i=[{name:"nameID_"+e,type:"USHORT",value:ur(t.name,r)},{name:"flags_"+e,type:"USHORT",value:0}],s=0;s<n.length;++s){var a=n[s].tag;i.push({name:"axis_"+e+" "+a,type:"FIXED",value:t.coordinates[a]<<16})}return i}function mr(e,t,n,r){var i={},s=new se.Parser(e,t);i.name=r[s.parseUShort()]||{},s.skip("uShort",1),i.coordinates={};for(var a=0;a<n.length;++a)i.coordinates[n[a].tag]=s.parseFixed();return i}nr.prototype.setText=function(e){this.text=e},nr.prototype.contextChecks={latinWordCheck:$n,arabicWordCheck:Wn,arabicSentenceCheck:Xn},nr.prototype.registerFeatures=function(e,t){var n=this,r=t.filter((function(t){return n.query.supports({script:e,tag:t})}));this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(r):this.featuresTags[e]=r},nr.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new On(e));for(var n=0;n<t.length;n++){var r=t[n];this.query.supports({script:r.script})&&this.registerFeatures(r.script,r.tags)}},nr.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)},nr.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},nr.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(or.call(this),lr.call(this)),this.checkContextReady("latinWord")&&cr.call(this),this.checkContextReady("arabicSentence")&&sr.call(this)},nr.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),ir.call(this),this.applyFeaturesToContexts())},nr.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},nr.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],n=0;n<this.tokenizer.tokens.length;n++){var r=this.tokenizer.tokens[n];if(!r.state.deleted){var i=r.activeState.value;t.push(Array.isArray(i)?i[0]:i)}}return t},hr.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},hr.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},hr.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},hr.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map((function(t){return"latn"===t.script?{script:"latn",tags:t.tags.filter((function(t){return e[t]}))}:t}))},hr.prototype.stringToGlyphs=function(e,t){var n=this,r=new nr;r.registerModifier("glyphIndex",null,(function(e){return n.charToGlyphIndex(e.char)}));var i=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;r.applyFeatures(this,i);for(var s=r.getTextGlyphs(e),a=s.length,o=new Array(a),l=this.glyphs.get(0),c=0;c<a;c+=1)o[c]=this.glyphs.get(s[c])||l;return o},hr.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},hr.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},hr.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},hr.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},hr.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},hr.prototype.forEachGlyph=function(e,t,n,r,i,s){t=void 0!==t?t:0,n=void 0!==n?n:0,r=void 0!==r?r:72,i=Object.assign({},this.defaultRenderOptions,i);var a,o=1/this.unitsPerEm*r,l=this.stringToGlyphs(e,i);if(i.kerning){var c=i.script||this.position.getDefaultScriptName();a=this.position.getKerningTables(c,i.language)}for(var h=0;h<l.length;h+=1){var u=l[h];if(s.call(this,u,t,n,r,i),u.advanceWidth&&(t+=u.advanceWidth*o),i.kerning&&h<l.length-1)t+=(a?this.position.getKerningValue(a,u.index,l[h+1].index):this.getKerningValue(u,l[h+1]))*o;i.letterSpacing?t+=i.letterSpacing*r:i.tracking&&(t+=i.tracking/1e3*r)}return t},hr.prototype.getPath=function(e,t,n,r,i){var s=new M;return this.forEachGlyph(e,t,n,r,i,(function(e,t,n,r){var a=e.getPath(t,n,r,i,this);s.extend(a)})),s},hr.prototype.getPaths=function(e,t,n,r,i){var s=[];return this.forEachGlyph(e,t,n,r,i,(function(e,t,n,r){var a=e.getPath(t,n,r,i,this);s.push(a)})),s},hr.prototype.getAdvanceWidth=function(e,t,n){return this.forEachGlyph(e,0,0,t,n,(function(){}))},hr.prototype.draw=function(e,t,n,r,i,s){this.getPath(t,n,r,i,s).draw(e)},hr.prototype.drawPoints=function(e,t,n,r,i,s){this.forEachGlyph(t,n,r,i,s,(function(t,n,r,i){t.drawPoints(e,n,r,i)}))},hr.prototype.drawMetrics=function(e,t,n,r,i,s){this.forEachGlyph(t,n,r,i,s,(function(t,n,r,i){t.drawMetrics(e,n,r,i)}))},hr.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},hr.prototype.validate=function(){var e=this;function t(t){var n=e.getEnglishName(t);n&&n.trim().length}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm},hr.prototype.toTables=function(){return yt.fontToTable(this)},hr.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},hr.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e[r];return t},hr.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},hr.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},hr.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var gr={make:function(e,t){var n=new J.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);n.offsetToData=n.sizeOf();for(var r=0;r<e.axes.length;r++)n.fields=n.fields.concat(dr(r,e.axes[r],t));for(var i=0;i<e.instances.length;i++)n.fields=n.fields.concat(fr(i,e.instances[i],e.axes,t));return n},parse:function(e,t,n){var r=new se.Parser(e,t),i=r.parseULong();I.argument(65536===i,"Unsupported fvar table version.");var s=r.parseOffset16();r.skip("uShort",1);for(var a=r.parseUShort(),o=r.parseUShort(),l=r.parseUShort(),c=r.parseUShort(),h=[],u=0;u<a;u++)h.push(pr(e,t+s+u*o,n));for(var d=[],p=t+s+a*o,f=0;f<l;f++)d.push(mr(e,p+f*c,h,n));return{axes:h,instances:d}}},Ar=function(){return{coverage:this.parsePointer(re.coverage),attachPoints:this.parseList(re.pointer(re.uShortList))}},vr=function(){var e=this.parseUShort();return I.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},yr=function(){return this.parseList(re.pointer(vr))},xr=function(){return{coverage:this.parsePointer(re.coverage),ligGlyphs:this.parseList(re.pointer(yr))}},br=function(){return this.parseUShort(),this.parseList(re.pointer(re.coverage))};var Er={parse:function(e,t){var n=new re(e,t=t||0),r=n.parseVersion(1);I.argument(1===r||1.2===r||1.3===r,"Unsupported GDEF table version.");var i={version:r,classDef:n.parsePointer(re.classDef),attachList:n.parsePointer(Ar),ligCaretList:n.parsePointer(xr),markAttachClassDef:n.parsePointer(re.classDef)};return r>=1.2&&(i.markGlyphSets=n.parsePointer(br)),i}},_r=new Array(10);_r[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(re.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(re.coverage),values:this.parseValueRecordList()}:void I.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},_r[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();I.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(re.coverage),r=this.parseUShort(),i=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,pairSets:this.parseList(re.pointer(re.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}}))))};if(2===t){var s=this.parsePointer(re.classDef),a=this.parsePointer(re.classDef),o=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,classDef1:s,classDef2:a,class1Count:o,class2Count:l,classRecords:this.parseList(o,re.list(l,(function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}})))}}},_r[3]=function(){return{error:"GPOS Lookup 3 not supported"}},_r[4]=function(){return{error:"GPOS Lookup 4 not supported"}},_r[5]=function(){return{error:"GPOS Lookup 5 not supported"}},_r[6]=function(){return{error:"GPOS Lookup 6 not supported"}},_r[7]=function(){return{error:"GPOS Lookup 7 not supported"}},_r[8]=function(){return{error:"GPOS Lookup 8 not supported"}},_r[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Sr=new Array(10);var wr={parse:function(e,t){var n=new re(e,t=t||0),r=n.parseVersion(1);return I.argument(1===r||1.1===r,"Unsupported GPOS table version "+r),1===r?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(_r)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(_r),variations:n.parseFeatureVariationsList()}},make:function(e){return new J.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new J.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new J.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new J.LookupList(e.lookups,Sr)}])}};var Mr={parse:function(e,t){var n=new se.Parser(e,t),r=n.parseUShort();if(0===r)return function(e){var t={};e.skip("uShort");var n=e.parseUShort();I.argument(0===n,"Unsupported kern sub-table version."),e.skip("uShort",2);var r=e.parseUShort();e.skip("uShort",3);for(var i=0;i<r;i+=1){var s=e.parseUShort(),a=e.parseUShort(),o=e.parseShort();t[s+","+a]=o}return t}(n);if(1===r)return function(e){var t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var n=255&e.parseUShort();if(e.skip("uShort"),0===n){var r=e.parseUShort();e.skip("uShort",3);for(var i=0;i<r;i+=1){var s=e.parseUShort(),a=e.parseUShort(),o=e.parseShort();t[s+","+a]=o}}return t}(n);throw new Error("Unsupported kern table version ("+r+").")}};var Cr={parse:function(e,t,n,r){for(var i=new se.Parser(e,t),s=r?i.parseUShort:i.parseULong,a=[],o=0;o<n+1;o+=1){var l=s.call(i);r&&(l*=2),a.push(l)}return a}};function Tr(e,t){for(var n=[],r=12,i=0;i<t;i+=1){var s=se.getTag(e,r),a=se.getULong(e,r+4),o=se.getULong(e,r+8),l=se.getULong(e,r+12);n.push({tag:s,checksum:a,offset:o,length:l,compression:!1}),r+=16}return n}function Ir(e,t){if("WOFF"===t.compression){var n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(_(n,r),r.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(r.buffer,0),offset:0}}return{data:e,offset:t.offset}}return{parseBuffer:function(e,t){var n,r;t=null==t?{}:t;var i,s,a,o,l,c,h,u,d,p,f,m,g,A=new hr({empty:!0}),v=new DataView(e,0),y=[],x=se.getTag(v,0);if(x===String.fromCharCode(0,1,0,0)||"true"===x||"typ1"===x)A.outlinesFormat="truetype",y=Tr(v,i=se.getUShort(v,4));else if("OTTO"===x)A.outlinesFormat="cff",y=Tr(v,i=se.getUShort(v,4));else{if("wOFF"!==x)throw new Error("Unsupported OpenType signature "+x);var b=se.getTag(v,4);if(b===String.fromCharCode(0,1,0,0))A.outlinesFormat="truetype";else{if("OTTO"!==b)throw new Error("Unsupported OpenType flavor "+x);A.outlinesFormat="cff"}y=function(e,t){for(var n=[],r=44,i=0;i<t;i+=1){var s=se.getTag(e,r),a=se.getULong(e,r+4),o=se.getULong(e,r+8),l=se.getULong(e,r+12),c=void 0;c=o<l&&"WOFF",n.push({tag:s,offset:a,compression:c,compressedLength:o,length:l}),r+=20}return n}(v,i=se.getUShort(v,12))}for(var E=0;E<i;E+=1){var _=y[E],S=void 0;switch(_.tag){case"cmap":S=Ir(v,_),A.tables.cmap=oe.parse(S.data,S.offset),A.encoding=new pe(A.tables.cmap);break;case"cvt ":S=Ir(v,_),g=new se.Parser(S.data,S.offset),A.tables.cvt=g.parseShortList(_.length/2);break;case"fvar":a=_;break;case"fpgm":S=Ir(v,_),g=new se.Parser(S.data,S.offset),A.tables.fpgm=g.parseByteList(_.length);break;case"head":S=Ir(v,_),A.tables.head=ze.parse(S.data,S.offset),A.unitsPerEm=A.tables.head.unitsPerEm,n=A.tables.head.indexToLocFormat;break;case"hhea":S=Ir(v,_),A.tables.hhea=Qe.parse(S.data,S.offset),A.ascender=A.tables.hhea.ascender,A.descender=A.tables.hhea.descender,A.numberOfHMetrics=A.tables.hhea.numberOfHMetrics;break;case"hmtx":u=_;break;case"ltag":S=Ir(v,_),r=He.parse(S.data,S.offset);break;case"maxp":S=Ir(v,_),A.tables.maxp=je.parse(S.data,S.offset),A.numGlyphs=A.tables.maxp.numGlyphs;break;case"name":f=_;break;case"OS/2":S=Ir(v,_),A.tables.os2=at.parse(S.data,S.offset);break;case"post":S=Ir(v,_),A.tables.post=ot.parse(S.data,S.offset),A.glyphNames=new me(A.tables.post);break;case"prep":S=Ir(v,_),g=new se.Parser(S.data,S.offset),A.tables.prep=g.parseByteList(_.length);break;case"glyf":o=_;break;case"loca":p=_;break;case"CFF ":s=_;break;case"kern":d=_;break;case"GDEF":l=_;break;case"GPOS":c=_;break;case"GSUB":h=_;break;case"meta":m=_}}var w=Ir(v,f);if(A.tables.name=it.parse(w.data,w.offset,r),A.names=A.tables.name,o&&p){var M=0===n,C=Ir(v,p),T=Cr.parse(C.data,C.offset,A.numGlyphs,M),I=Ir(v,o);A.glyphs=Nt.parse(I.data,I.offset,T,A,t)}else{if(!s)throw new Error("Font doesn't contain TrueType or CFF outlines.");var B=Ir(v,s);Ge.parse(B.data,B.offset,A,t)}var R=Ir(v,u);if(Ve.parse(A,R.data,R.offset,A.numberOfHMetrics,A.numGlyphs,A.glyphs,t),ge(A,t),d){var P=Ir(v,d);A.kerningPairs=Mr.parse(P.data,P.offset)}else A.kerningPairs={};if(l){var D=Ir(v,l);A.tables.gdef=Er.parse(D.data,D.offset)}if(c){var L=Ir(v,c);A.tables.gpos=wr.parse(L.data,L.offset),A.position.init()}if(h){var F=Ir(v,h);A.tables.gsub=ut.parse(F.data,F.offset)}if(a){var U=Ir(v,a);A.tables.fvar=gr.parse(U.data,U.offset,A.names)}if(m){var O=Ir(v,m);A.tables.meta=dt.parse(O.data,O.offset),A.metas=A.tables.meta}return A}}})();t.parse=n},12258:(e,t)=>{"use strict";let n,r,i;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s={env:{emscripten_notify_memory_growth:function(e){i=new Uint8Array(r.exports.memory.buffer)}}};const a="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";t.ZSTDDecoder=class{init(){return n||(n="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+a).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,s))).then(this._init):WebAssembly.instantiate(Buffer.from(a,"base64"),s).then(this._init),n)}_init(e){r=e.instance,s.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!r)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,s=r.exports.malloc(n);i.set(e,s),t=t||Number(r.exports.ZSTD_findDecompressedSize(s,n));const a=r.exports.malloc(t),o=r.exports.ZSTD_decompress(a,t,s,n),l=i.slice(a,a+o);return r.exports.free(s),r.exports.free(a),l}}},94418:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.LightProbeGenerator=class{static fromCubeTexture(e){let t=0;const n=new r.Vector3,i=new r.Vector3,s=new r.Color,a=[0,0,0,0,0,0,0,0,0],o=new r.SphericalHarmonics3,l=o.coefficients;for(let h=0;h<6;h++){const o=e.image[h],c=o.width,u=o.height,d=document.createElement("canvas");d.width=c,d.height=u;const p=d.getContext("2d");p.drawImage(o,0,0,c,u);const f=p.getImageData(0,0,c,u),m=f.data,g=f.width,A=2/g;for(let v=0,y=m.length;v<y;v+=4){s.setRGB(m[v]/255,m[v+1]/255,m[v+2]/255),"colorSpace"in e?"srgb"===e.colorSpace&&s.convertSRGBToLinear():3001===e.encoding&&s.convertSRGBToLinear();const o=v/4,c=(o%g+.5)*A-1,u=1-(Math.floor(o/g)+.5)*A;switch(h){case 0:n.set(-1,u,-c);break;case 1:n.set(1,u,c);break;case 2:n.set(-c,1,-u);break;case 3:n.set(-c,-1,u);break;case 4:n.set(-c,u,1);break;case 5:n.set(c,u,-1)}const d=n.lengthSq(),p=4/(Math.sqrt(d)*d);t+=p,i.copy(n).normalize(),r.SphericalHarmonics3.getBasisAt(i,a);for(let e=0;e<9;e++)l[e].x+=a[e]*s.r*p,l[e].y+=a[e]*s.g*p,l[e].z+=a[e]*s.b*p}}const c=4*Math.PI/t;for(let r=0;r<9;r++)l[r].x*=c,l[r].y*=c,l[r].z*=c;return new r.LightProbe(o)}static fromCubeRenderTarget(e,t){let n=0;const i=new r.Vector3,s=new r.Vector3,a=new r.Color,o=[0,0,0,0,0,0,0,0,0],l=new r.SphericalHarmonics3,c=l.coefficients;for(let u=0;u<6;u++){const l=t.width,h=new Uint8Array(l*l*4);e.readRenderTargetPixels(t,0,0,l,l,h,u);const d=2/l;for(let e=0,p=h.length;e<p;e+=4){a.setRGB(h[e]/255,h[e+1]/255,h[e+2]/255),"colorSpace"in t.texture?"srgb"===t.texture.colorSpace&&a.convertSRGBToLinear():3001===t.texture.encoding&&a.convertSRGBToLinear();const p=e/4,f=(p%l+.5)*d-1,m=1-(Math.floor(p/l)+.5)*d;switch(u){case 0:i.set(1,m,-f);break;case 1:i.set(-1,m,f);break;case 2:i.set(f,1,-m);break;case 3:i.set(f,-1,m);break;case 4:i.set(f,m,1);break;case 5:i.set(-f,m,-1)}const g=i.lengthSq(),A=4/(Math.sqrt(g)*g);n+=A,s.copy(i).normalize(),r.SphericalHarmonics3.getBasisAt(s,o);for(let e=0;e<9;e++)c[e].x+=o[e]*a.r*A,c[e].y+=o[e]*a.g*A,c[e].z+=o[e]*a.b*A}}const h=4*Math.PI/n;for(let r=0;r<9;r++)c[r].x*=h,c[r].y*=h,c[r].z*=h;return new r.LightProbe(l)}}},60762:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.RectAreaLightUniformsLib=class{static init(){const e=[1,0,0,2e-5,1,0,0,503905e-9,1,0,0,.00201562,1,0,0,.00453516,1,0,0,.00806253,1,0,0,.0125978,1,0,0,.018141,1,0,0,.0246924,1,0,0,.0322525,1,0,0,.0408213,1,0,0,.0503999,1,0,0,.0609894,1,0,0,.0725906,1,0,0,.0852058,1,0,0,.0988363,1,0,0,.113484,1,0,0,.129153,1,0,0,.145839,1,0,0,.163548,1,0,0,.182266,1,0,0,.201942,1,0,0,.222314,1,0,0,.241906,1,0,0,.262314,1,0,0,.285754,1,0,0,.310159,1,0,0,.335426,1,0,0,.361341,1,0,0,.387445,1,0,0,.412784,1,0,0,.438197,1,0,0,.466966,1,0,0,.49559,1,0,0,.523448,1,0,0,.549938,1,0,0,.57979,1,0,0,.608746,1,0,0,.636185,1,0,0,.664748,1,0,0,.69313,1,0,0,.71966,1,0,0,.747662,1,0,0,.774023,1,0,0,.799775,1,0,0,.825274,1,0,0,.849156,1,0,0,.873248,1,0,0,.89532,1,0,0,.917565,1,0,0,.937863,1,0,0,.958139,1,0,0,.976563,1,0,0,.994658,1,0,0,1.0112,1,0,0,1.02712,1,0,0,1.04189,1,0,0,1.05568,1,0,0,1.06877,1,0,0,1.08058,1,0,0,1.09194,1,0,0,1.10191,1,0,0,1.11161,1,0,0,1.1199,1,0,0,1.12813,.999547,-4.48815e-7,.0224417,199902e-10,.999495,-113079e-10,.0224406,503651e-9,.999496,-452317e-10,.0224406,.00201461,.999496,-101772e-9,.0224406,.00453287,.999495,-180928e-9,.0224406,.00805845,.999497,-282702e-9,.0224406,.0125914,.999496,-407096e-9,.0224406,.0181319,.999498,-554114e-9,.0224406,.02468,.999499,-723768e-9,.0224406,.0322363,.999495,-916058e-9,.0224405,.0408009,.999499,-.00113101,.0224408,.050375,.999494,-.00136863,.0224405,.0609586,.999489,-.00162896,.0224401,.0725537,.999489,-.00191201,.0224414,.0851619,.999498,-.00221787,.0224413,.0987867,.999492,-.00254642,.0224409,.113426,.999507,-.00289779,.0224417,.129088,.999494,-.0032716,.0224386,.145767,.999546,-.0036673,.0224424,.163472,.999543,-.00408166,.0224387,.182182,.999499,-.00450056,.0224338,.201843,.999503,-.00483661,.0224203,.222198,.999546,-.00452928,.022315,.241714,.999508,-.00587403,.0224329,.262184,.999509,-.00638806,.0224271,.285609,.999501,-.00691028,.0224166,.309998,.999539,-.00741979,.0223989,.335262,.999454,-.00786282,.0223675,.361154,.999529,-.00811928,.0222828,.387224,.999503,-.00799941,.0221063,.41252,.999561,-.00952753,.0223057,.438006,.999557,-.0099134,.0222065,.466735,.999541,-.0100935,.0220402,.495332,.999562,-.00996821,.0218067,.523197,.999556,-.0105031,.0217096,.550223,.999561,-.0114191,.0217215,.579498,.999588,-.0111818,.0213357,.608416,.999633,-.0107725,.0208689,.635965,.999527,-.0121671,.0210149,.664476,.999508,-.0116005,.020431,.692786,.999568,-.0115604,.0199791,.719709,.999671,-.0121117,.0197415,.74737,.999688,-.0110769,.0188846,.773692,.99962,-.0122368,.0188452,.799534,.999823,-.0110325,.0178001,.825046,.999599,-.0114923,.0174221,.849075,.999619,-.0105923,.0164345,.872999,.999613,-.0105988,.0158227,.895371,.99964,-.00979861,.0148131,.917364,.99977,-.00967238,.0140721,.938002,.999726,-.00869175,.0129543,.957917,.99973,-.00866872,.0122329,.976557,.999773,-.00731956,.0108958,.994459,.999811,-.00756027,.0102715,1.01118,.999862,-.00583732,.00878781,1.02701,.999835,-.00631438,.00827529,1.04186,.999871,-.00450785,.00674583,1.05569,.999867,-.00486079,.00621041,1.06861,.999939,-.00322072,.00478301,1.08064,.999918,-.00318199,.00406395,1.09181,1.00003,-.00193348,.00280682,1.10207,.999928,-.00153729,.00198741,1.11152,.999933,-623666e-9,917714e-9,1.12009,1,-102387e-11,9.07581e-7,1.12813,.997866,-8.96716e-7,.0448334,199584e-10,.997987,-225945e-10,.0448389,502891e-9,.997987,-903781e-10,.0448388,.00201156,.997985,-203351e-9,.0448388,.00452602,.997986,-361514e-9,.0448388,.00804629,.997987,-56487e-8,.0448389,.0125724,.997988,-813423e-9,.0448389,.0181045,.997984,-.00110718,.0448387,.0246427,.997985,-.00144616,.0448388,.0321875,.997987,-.00183038,.044839,.0407392,.997983,-.00225987,.0448387,.0502986,.997991,-.00273467,.0448389,.0608667,.997984,-.00325481,.0448384,.0724444,.998002,-.00382043,.044839,.0850348,.997997,-.00443145,.0448396,.0986372,.998007,-.00508796,.0448397,.113255,.998008,-.00578985,.04484,.128891,.998003,-.00653683,.0448384,.145548,.997983,-.00732713,.0448358,.163221,.997985,-.00815454,.0448358,.181899,.998005,-.00898985,.0448286,.201533,.998026,-.00964404,.0447934,.221821,.998055,-.00922677,.044611,.241282,.99804,-.0117361,.0448245,.261791,.998048,-.0127628,.0448159,.285181,.998088,-.0138055,.0447996,.30954,.998058,-.0148206,.0447669,.334751,.998099,-.0156998,.044697,.36061,.998116,-.0161976,.0445122,.386603,.998195,-.015945,.0441711,.411844,.998168,-.0183947,.0444255,.43773,.998184,-.0197913,.0443809,.466009,.998251,-.0201426,.0440689,.494574,.998305,-.0198847,.0435632,.522405,.998273,-.0210577,.043414,.549967,.998254,-.0227901,.0433943,.578655,.998349,-.0223108,.0426529,.60758,.99843,-.0223088,.042,.635524,.998373,-.0241141,.0418987,.663621,.998425,-.0231446,.0408118,.691906,.998504,-.0233684,.0400565,.719339,.998443,-.0241652,.0394634,.74643,.99848,-.0228715,.0380002,.773086,.998569,-.023519,.0372322,.798988,.998619,-.0223108,.0356468,.824249,.998594,-.0223105,.034523,.848808,.998622,-.0213426,.0328887,.87227,.998669,-.0207912,.0314374,.895157,.998705,-.0198416,.0296925,.916769,.998786,-.0189168,.0279634,.937773,.998888,-.0178811,.0261597,.957431,.99906,-.0166845,.0242159,.976495,.999038,-.0155464,.0222638,.994169,.999237,-.0141349,.0201967,1.01112,.999378,-.0129324,.0181744,1.02692,.999433,-.0113192,.0159898,1.04174,.999439,-.0101244,.0140385,1.05559,.999614,-.00837456,.0117826,1.06852,.999722,-.00721769,.00983745,1.08069,.999817,-.00554067,.00769002,1.09176,.99983,-.00426961,.005782,1.10211,.999964,-.00273904,.00374503,1.11152,1.00001,-.00136739,.00187176,1.12031,.999946,393227e-10,-28919e-9,1.12804,.995847,-13435e-10,.0671785,19916e-9,.995464,-338387e-10,.0671527,501622e-9,.99547,-135355e-9,.0671531,.00200649,.995471,-30455e-8,.0671532,.00451461,.99547,-541423e-9,.0671531,.008026,.995471,-84598e-8,.0671531,.0125407,.99547,-.00121823,.0671531,.0180589,.99547,-.00165817,.0671531,.0245806,.995463,-.00216583,.0671526,.0321062,.995468,-.00274127,.0671527,.0406366,.995474,-.00338447,.0671534,.0501717,.995473,-.00409554,.0671533,.0607131,.995478,-.00487451,.0671531,.0722618,.995476,-.00572148,.0671532,.0848191,.995477,-.00663658,.0671539,.0983882,.995498,-.00761986,.0671541,.112972,.995509,-.00867094,.0671542,.128568,.995509,-.00978951,.0671531,.145183,.995503,-.0109725,.0671491,.162808,.995501,-.012211,.0671465,.181441,.99553,-.0134565,.0671371,.201015,.99555,-.014391,.0670831,.221206,.99558,-.014351,.0668883,.240813,.995577,-.0173997,.0671055,.261257,.995602,-.0191111,.0671178,.284467,.995623,-.0206705,.0670946,.308765,.995658,-.022184,.0670472,.333905,.995705,-.0234832,.0669417,.359677,.995719,-.0241933,.0666714,.385554,.995786,-.0243539,.066266,.410951,.995887,-.0271866,.0664367,.437163,.995944,-.0296012,.0664931,.464842,.996004,-.0301045,.0660105,.49332,.996128,-.0298311,.0652694,.521131,.996253,-.0316426,.0650739,.549167,.996244,-.0339043,.0649433,.57737,.996309,-.033329,.0638926,.606073,.996417,-.0338935,.0630849,.634527,.996372,-.0353104,.0625083,.66256,.996542,-.0348942,.0611986,.690516,.996568,-.0351614,.060069,.718317,.996711,-.0354317,.0588522,.74528,.996671,-.0349513,.0571902,.772061,.996865,-.0345622,.0555321,.798089,.996802,-.0342566,.0537816,.823178,.996992,-.0330862,.0516095,.847949,.996944,-.0324666,.0495537,.871431,.997146,-.0309544,.0470302,.894357,.997189,-.0299372,.0446043,.916142,.997471,-.0281389,.0418812,.937193,.997515,-.0268702,.0391823,.957,.997812,-.0247166,.0361338,.975936,.998027,-.0233525,.0333945,.99391,.998233,-.0209839,.0301917,1.01075,.998481,-.0194309,.027271,1.02669,.998859,-.0169728,.0240162,1.04173,.99894,-.0152322,.0210517,1.05551,.999132,-.0127497,.0178632,1.06856,.999369,-.0108282,.014787,1.08054,.999549,-.00845886,.0116185,1.09185,.999805,-.0063937,.00867209,1.10207,.99985,-.00414582,.00566823,1.1117,.999912,-.00207443,.00277562,1.12022,1.00001,870226e-10,-53766e-9,1.12832,.991943,-178672e-11,.0893382,198384e-10,.991952,-450183e-10,.089339,499849e-9,.991956,-180074e-9,.0893394,.0019994,.991955,-405167e-9,.0893393,.00449867,.991953,-720298e-9,.0893391,.00799764,.991955,-.00112548,.0893393,.0124964,.991957,-.0016207,.0893395,.0179951,.991958,-.00220601,.0893396,.0244939,.991947,-.00288137,.0893385,.0319929,.991962,-.00364693,.0893399,.0404933,.991965,-.00450264,.0893399,.049995,.99198,-.00544862,.0893411,.0604995,.99197,-.00648491,.0893397,.0720074,.991976,-.00761164,.089341,.0845207,.99198,-.00882891,.0893405,.0980413,.991982,-.0101367,.0893396,.112571,.992008,-.011535,.0893415,.128115,.992026,-.0130228,.0893414,.144672,.992064,-.0145966,.0893418,.162241,.992041,-.0162421,.0893359,.180801,.992086,-.0178888,.0893214,.200302,.992157,-.0190368,.0892401,.220332,.992181,-.0195584,.0890525,.240144,.992175,-.0227257,.0892153,.260728,.99221,-.0254195,.089304,.283473,.99222,-.0274883,.0892703,.307673,.992317,-.0294905,.0892027,.332729,.992374,-.0311861,.0890577,.358387,.992505,-.0320656,.0886994,.384102,.992568,-.0329715,.0883198,.409767,.992675,-.036006,.0883602,.436145,.992746,-.0392897,.0884591,.463217,.992873,-.0399337,.0878287,.491557,.992934,-.040231,.0870108,.519516,.993091,-.0422013,.0865857,.547741,.993259,-.0443503,.0861937,.575792,.993455,-.0446368,.0851187,.604233,.993497,-.0454299,.0840576,.632925,.993694,-.0463296,.0829671,.660985,.993718,-.0470619,.0817185,.688714,.993973,-.0468838,.0800294,.716743,.994207,-.046705,.0781286,.74377,.994168,-.0469698,.0763337,.77042,.9945,-.0456816,.0738184,.796659,.994356,-.0455518,.0715545,.821868,.994747,-.0439488,.0686085,.846572,.994937,-.0430056,.065869,.870435,.995142,-.0413414,.0626446,.893272,.995451,-.0396521,.05929,.915376,.995445,-.0378453,.0558503,.936196,.995967,-.0355219,.0520949,.956376,.996094,-.0335146,.048377,.975327,.996622,-.030682,.0442575,.993471,.996938,-.0285504,.0404693,1.01052,.997383,-.0253399,.0360903,1.02637,.997714,-.0231651,.0322176,1.04139,.998249,-.0198138,.0278433,1.05542,.998596,-.0174337,.0238759,1.06846,.998946,-.0141349,.0195944,1.08056,.99928,-.0115603,.0156279,1.09181,.999507,-.00839065,.0114607,1.10213,.999697,-.005666,.00763325,1.11169,.999869,-.00269902,.00364946,1.12042,1.00001,623836e-10,-319288e-10,1.12832,.987221,-222675e-11,.111332,197456e-10,.98739,-561116e-10,.111351,497563e-9,.987448,-224453e-9,.111357,.00199031,.987441,-505019e-9,.111357,.0044782,.987442,-897816e-9,.111357,.00796129,.987442,-.00140284,.111357,.0124396,.987444,-.00202012,.111357,.0179132,.987442,-.00274964,.111357,.0243824,.987446,-.00359147,.111357,.0318474,.987435,-.00454562,.111356,.0403086,.987461,-.00561225,.111358,.0497678,.987458,-.00679125,.111358,.0602239,.987443,-.0080828,.111356,.0716792,.987476,-.0094872,.111358,.0841364,.98749,-.0110044,.111361,.097597,.987508,-.0126344,.111362,.112062,.987494,-.0143767,.111357,.127533,.987526,-.0162307,.111359,.144015,.987558,-.0181912,.111361,.161502,.987602,-.0202393,.111355,.179979,.987692,-.022273,.111346,.199386,.987702,-.0235306,.111215,.219183,.987789,-.0247628,.111061,.239202,.987776,-.0280668,.111171,.259957,.987856,-.0316751,.111327,.282198,.987912,-.0342468,.111282,.306294,.988,-.0367205,.111198,.331219,.988055,-.0387766,.110994,.356708,.988241,-.0397722,.110547,.382234,.988399,-.0416076,.110198,.408227,.988539,-.0448192,.110137,.434662,.988661,-.0483793,.110143,.461442,.988967,-.0495895,.109453,.489318,.989073,-.0506797,.108628,.517516,.989274,-.0526953,.108003,.545844,.989528,-.054578,.107255,.573823,.989709,-.0561503,.106294,.601944,.989991,-.056866,.104896,.630855,.990392,-.0572914,.103336,.658925,.990374,-.0586224,.10189,.686661,.990747,-.0584764,.099783,.714548,.991041,-.0582662,.0974309,.74186,.991236,-.0584118,.0951678,.768422,.991585,-.0573055,.0921581,.794817,.991984,-.0564241,.0891167,.820336,.9921,-.0553608,.085805,.84493,.992749,-.0533816,.0820354,.868961,.99288,-.0518661,.0782181,.891931,.993511,-.0492492,.0738935,.914186,.993617,-.0471956,.0696402,.93532,.99411,-.044216,.0649659,.95543,.994595,-.0416654,.0603177,.974685,.994976,-.0384314,.0553493,.992807,.995579,-.0353491,.0503942,1.00996,.996069,-.0319787,.0452123,1.02606,.996718,-.028472,.0400112,1.04114,.997173,-.0250789,.0349456,1.05517,.997818,-.0213326,.029653,1.0683,.998318,-.0178509,.024549,1.0805,.998853,-.0141118,.0194197,1.09177,.999218,-.0105914,.0143869,1.1022,.999594,-.00693474,.00943517,1.11175,.99975,-.00340478,.00464051,1.12056,1.00001,109172e-9,-112821e-9,1.12853,.983383,-266524e-11,.133358,196534e-10,.981942,-671009e-10,.133162,494804e-9,.981946,-268405e-9,.133163,.00197923,.981944,-603912e-9,.133163,.00445326,.981941,-.00107362,.133162,.00791693,.981946,-.00167755,.133163,.0123703,.981944,-.00241569,.133162,.0178135,.981945,-.00328807,.133163,.0242466,.981945,-.00429472,.133162,.03167,.981955,-.00543573,.133164,.0400846,.981951,-.00671105,.133163,.0494901,.981968,-.00812092,.133165,.0598886,.981979,-.00966541,.133166,.0712811,.981996,-.0113446,.133168,.083669,.982014,-.0131585,.133169,.0970533,.982011,-.0151073,.133167,.111438,.982062,-.0171906,.133172,.126826,.9821,-.0194067,.133175,.143215,.982149,-.0217502,.133176,.160609,.982163,-.0241945,.133173,.178981,.982247,-.0265907,.133148,.198249,.982291,-.027916,.132974,.217795,.982396,-.0299663,.132868,.238042,.982456,-.0334544,.132934,.258901,.982499,-.0378636,.133137,.280639,.982617,-.0409274,.133085,.304604,.98274,-.0438523,.132985,.329376,.982944,-.0462288,.132728,.354697,.98308,-.0475995,.132228,.380102,.983391,-.0501901,.131924,.406256,.983514,-.0535899,.131737,.432735,.98373,-.0571858,.131567,.459359,.984056,-.0592353,.130932,.486637,.984234,-.0610488,.130092,.51509,.984748,-.0630758,.12923,.543461,.985073,-.0647398,.128174,.571376,.985195,-.0671941,.127133,.599414,.985734,-.0681345,.125576,.628134,.986241,-.0686089,.123639,.656399,.986356,-.0698511,.121834,.684258,.986894,-.0700931,.119454,.711818,.987382,-.0698321,.116718,.739511,.988109,-.0693975,.113699,.766267,.988363,-.0689584,.110454,.792456,.989112,-.0672353,.106602,.81813,.989241,-.0662034,.10267,.842889,.990333,-.0638938,.0981381,.867204,.990591,-.0618534,.0935388,.89038,.991106,-.0593117,.088553,.912576,.991919,-.0562676,.0832187,.934118,.992111,-.0534085,.0778302,.954254,.992997,-.0495459,.0720453,.973722,.993317,-.0463707,.0663458,.991949,.994133,-.0421245,.0601883,1.00936,.994705,-.0384977,.0542501,1.02559,.995495,-.0340956,.0479862,1.04083,.996206,-.030105,.041887,1.05497,.996971,-.0256095,.0355355,1.06824,.997796,-.0213932,.0293655,1.08056,.998272,-.0169612,.0232926,1.09182,.998857,-.0126756,.0172786,1.10219,.99939,-.00832486,.0113156,1.11192,.999752,-.00410826,.00557892,1.12075,1,150957e-9,-119101e-9,1.12885,.975169,-309397e-11,.154669,195073e-10,.975439,-779608e-10,.154712,491534e-9,.975464,-311847e-9,.154716,.00196617,.975464,-701656e-9,.154716,.00442387,.975462,-.0012474,.154715,.0078647,.975461,-.00194906,.154715,.0122886,.975464,-.00280667,.154715,.0176959,.975468,-.00382025,.154716,.0240867,.975471,-.00498985,.154716,.0314612,.975472,-.00631541,.154717,.0398199,.975486,-.00779719,.154718,.0491639,.975489,-.00943505,.154718,.0594932,.975509,-.0112295,.154721,.0708113,.97554,-.0131802,.154724,.0831176,.975557,-.0152876,.154726,.096415,.975585,-.0175512,.154728,.110705,.975605,-.0199713,.154729,.125992,.975645,-.0225447,.154729,.142272,.975711,-.0252649,.154735,.159549,.975788,-.0280986,.154736,.177805,.975872,-.0308232,.154704,.196911,.975968,-.0324841,.154525,.216324,.976063,-.0351281,.154432,.236628,.976157,-.0388618,.15446,.257539,.976204,-.0437704,.154665,.278975,.976358,-.047514,.154652,.302606,.976571,-.0508638,.154535,.327204,.976725,-.0534995,.154221,.352276,.977013,-.0555547,.153737,.377696,.977294,-.0586728,.153403,.403855,.977602,-.0622715,.15312,.430333,.977932,-.0658166,.152755,.456855,.978241,-.0689877,.152233,.483668,.978602,-.0712805,.15132,.512097,.979234,-.0732775,.150235,.540455,.97977,-.075163,.148978,.568486,.979995,-.0778026,.147755,.596524,.98078,-.0791854,.146019,.624825,.981628,-.0799666,.143906,.653403,.982067,-.0808532,.141561,.681445,.98271,-.0816024,.139025,.708918,.983734,-.0812511,.135764,.736594,.98431,-.0806201,.132152,.763576,.985071,-.0801605,.12846,.789797,.98618,-.0784208,.124084,.815804,.986886,-.0766643,.1193,.840869,.987485,-.0747744,.114236,.864952,.988431,-.0716701,.108654,.888431,.988886,-.0691609,.102994,.910963,.990024,-.0654048,.0967278,.932629,.990401,-.0619765,.090384,.95313,.991093,-.0579296,.0837885,.972587,.992018,-.0536576,.0770171,.991184,.992536,-.0493719,.0701486,1.00863,.993421,-.0444813,.062953,1.02494,.993928,-.040008,.0560455,1.04017,.994994,-.0347982,.04856,1.05463,.995866,-.0301017,.0416152,1.06807,.996916,-.0248225,.0342597,1.08039,.997766,-.0199229,.0271668,1.09177,.998479,-.0147422,.0201387,1.10235,.99921,-.00980173,.0131944,1.11206,.999652,-.0047426,.00640712,1.12104,.999998,891673e-10,-10379e-8,1.12906,.967868,-351885e-11,.175947,193569e-10,.968001,-886733e-10,.175972,487782e-9,.96801,-354697e-9,.175973,.00195115,.968012,-798063e-9,.175974,.00439006,.968011,-.00141879,.175973,.00780461,.968011,-.00221686,.175973,.0121948,.968016,-.00319231,.175974,.0175607,.968019,-.00434515,.175974,.0239027,.968018,-.00567538,.175974,.0312208,.968033,-.00718308,.175977,.0395158,.968049,-.00886836,.175979,.0487885,.968047,-.0107312,.175978,.0590394,.968072,-.0127719,.175981,.0702705,.968108,-.0149905,.175986,.0824836,.968112,-.0173866,.175985,.0956783,.968173,-.0199611,.175993,.109862,.96827,-.0227128,.176008,.125033,.968292,-.025639,.17601,.141193,.968339,-.0287299,.176007,.158336,.968389,-.0319399,.176001,.176441,.968501,-.034941,.175962,.195359,.968646,-.0370812,.175793,.214686,.968789,-.0402329,.175708,.234973,.96886,-.0442601,.1757,.255871,.969013,-.049398,.175876,.277238,.969242,-.0539932,.17594,.300326,.969419,-.0577299,.175781,.324702,.969763,-.0605643,.175432,.349527,.970093,-.0634488,.174992,.374976,.970361,-.0670589,.174611,.401097,.970825,-.0708246,.174226,.427496,.971214,-.0742871,.173684,.453858,.971622,-.0782608,.173186,.480637,.972175,-.0813151,.172288,.508655,.972944,-.0832678,.170979,.536973,.973595,-.0855964,.169573,.565138,.974345,-.0882163,.168152,.593222,.975233,-.0901671,.166314,.621201,.976239,-.0912111,.163931,.649919,.977289,-.0916959,.161106,.678011,.978076,-.0927061,.158272,.705717,.979533,-.0925562,.15475,.733228,.980335,-.0918159,.150638,.760454,.981808,-.0908508,.146201,.786918,.983061,-.0896172,.141386,.812953,.984148,-.0871588,.135837,.838281,.985047,-.0850624,.130135,.862594,.986219,-.0818541,.123882,.88633,.987043,-.0784523,.117126,.908952,.988107,-.0749601,.110341,.930744,.988955,-.0703548,.102885,.951728,.989426,-.0662798,.0954167,.971166,.990421,-.0610834,.0876331,.989984,.991032,-.0562936,.0797785,1.00765,.992041,-.0508154,.0718166,1.02434,.992794,-.0454045,.0637125,1.03976,.993691,-.0398194,.0555338,1.05418,.994778,-.0341482,.0473388,1.06772,.995915,-.028428,.0391016,1.08028,.997109,-.022642,.0309953,1.09185,.998095,-.0168738,.0230288,1.10247,.998985,-.0111274,.0150722,1.11229,.999581,-.00543881,.00740605,1.12131,1.00003,162239e-9,-105549e-9,1.12946,.959505,-393734e-11,.196876,191893e-10,.959599,-992157e-10,.196895,483544e-9,.959641,-396868e-9,.196903,.0019342,.959599,-892948e-9,.196895,.00435193,.959603,-.00158747,.196896,.0077368,.959604,-.00248042,.196896,.0120888,.959605,-.00357184,.196896,.0174082,.959605,-.00486169,.196896,.0236949,.959613,-.00635008,.196897,.0309497,.959619,-.00803696,.196898,.0391725,.959636,-.00992255,.196901,.0483649,.959634,-.0120067,.1969,.0585266,.959675,-.0142898,.196906,.0696609,.959712,-.0167717,.196911,.0817678,.959752,-.0194524,.196918,.0948494,.959807,-.0223321,.196925,.10891,.959828,-.0254091,.196924,.123947,.959906,-.0286815,.196934,.139968,.960005,-.0321371,.196944,.156968,.960071,-.0357114,.196936,.17491,.960237,-.0389064,.196882,.193597,.960367,-.041623,.196731,.21285,.960562,-.0452655,.196654,.233075,.960735,-.0496207,.196643,.253941,.960913,-.0549379,.196774,.275278,.961121,-.0603414,.196893,.297733,.96139,-.0644244,.196717,.321877,.961818,-.067556,.196314,.346476,.962175,-.0712709,.195917,.371907,.96255,-.0752848,.1955,.397916,.963164,-.0792073,.195026,.424229,.963782,-.0828225,.194424,.450637,.964306,-.0873119,.193831,.477288,.964923,-.0911051,.192973,.504716,.966048,-.093251,.19151,.533053,.967024,-.0958983,.190013,.561366,.968038,-.09835,.188253,.589464,.969152,-.100754,.186257,.617433,.970557,-.102239,.183775,.645801,.972104,-.102767,.180645,.674278,.973203,-.103492,.177242,.702004,.975123,-.103793,.17345,.729529,.97641,-.102839,.168886,.756712,.978313,-.101687,.163892,.783801,.980036,-.100314,.158439,.809671,.981339,-.097836,.152211,.835402,.982794,-.0950006,.145679,.860081,.984123,-.0920994,.138949,.883757,.984918,-.0878641,.131283,.90685,.985999,-.083939,.123464,.928786,.987151,-.0791234,.115324,.94983,.987827,-.0739332,.106854,.96962,.988806,-.0688088,.0982691,.98861,.989588,-.0628962,.0893456,1.00667,.990438,-.0573146,.0805392,1.02344,.991506,-.0509433,.0713725,1.03933,.992492,-.0448724,.0623732,1.05378,.993663,-.0383497,.0530838,1.06747,.994956,-.0319593,.0439512,1.08007,.99634,-.025401,.0347803,1.09182,.99761,-.0189687,.0257954,1.1025,.99863,-.0124441,.0169893,1.11247,.99947,-.00614003,.00829498,1.12151,1.00008,216624e-9,-146107e-9,1.12993,.950129,-434955e-11,.217413,190081e-10,.950264,-10957e-8,.217444,47884e-8,.9503,-438299e-9,.217451,.00191543,.950246,-986124e-9,.21744,.00430951,.950246,-.00175311,.21744,.00766137,.950245,-.00273923,.21744,.011971,.950253,-.00394453,.217441,.0172385,.950258,-.00536897,.217442,.0234641,.950267,-.00701262,.217444,.030648,.950277,-.00887551,.217446,.038791,.950284,-.0109576,.217446,.0478931,.950312,-.0132591,.217451,.0579568,.950334,-.01578,.217454,.0689821,.950378,-.0185204,.217462,.0809714,.950417,-.0214803,.217467,.0939265,.950488,-.0246594,.217479,.10785,.950534,-.0280565,.217483,.122743,.950633,-.0316685,.217498,.138611,.950698,-.0354787,.217499,.155442,.950844,-.0394003,.217507,.173208,.950999,-.0426812,.217419,.191605,.951221,-.0461302,.217317,.21084,.951412,-.0502131,.217238,.230945,.951623,-.0549183,.21722,.251745,.951867,-.0604493,.217306,.273001,.952069,-.0665189,.217466,.294874,.952459,-.0709179,.217266,.318732,.952996,-.0746112,.216891,.34318,.953425,-.0789252,.216503,.36849,.953885,-.0833293,.216042,.394373,.954617,-.087371,.215469,.420505,.955429,-.0914054,.214802,.446907,.956068,-.0961671,.214146,.473522,.957094,-.10048,.213286,.50052,.958372,-.103248,.211796,.528715,.959654,-.106033,.21016,.557065,.961305,-.108384,.208149,.585286,.962785,-.111122,.206024,.613334,.964848,-.112981,.203442,.641334,.966498,-.113717,.19996,.669955,.968678,-.114121,.196105,.698094,.970489,-.114524,.191906,.725643,.972903,-.113792,.186963,.752856,.974701,-.112406,.181343,.780013,.976718,-.110685,.175185,.806268,.978905,-.108468,.168535,.832073,.980267,-.105061,.161106,.857149,.981967,-.101675,.153387,.881145,.983063,-.0974492,.145199,.904255,.984432,-.0925815,.136527,.926686,.985734,-.0877983,.127584,.947901,.986228,-.081884,.118125,.968111,.98719,-.0761208,.108594,.98719,.988228,-.0698196,.0989996,1.00559,.989046,-.0632739,.0890074,1.02246,.990242,-.056522,.0790832,1.03841,.991252,-.0495272,.0689182,1.05347,.992542,-.0425373,.0588592,1.06724,.994096,-.0353198,.0486833,1.08009,.995593,-.028235,.0385977,1.09177,.99711,-.0209511,.0286457,1.10274,.998263,-.0139289,.0188497,1.11262,.999254,-.0067359,.009208,1.12191,.999967,141846e-9,-657764e-10,1.13024,.935608,-474692e-11,.236466,187817e-10,.93996,-11971e-8,.237568,473646e-9,.939959,-478845e-9,.237567,.0018946,.939954,-.0010774,.237566,.00426284,.939956,-.00191538,.237566,.00757842,.939954,-.00299277,.237566,.0118413,.93996,-.00430961,.237567,.0170518,.939969,-.00586589,.237569,.02321,.939982,-.00766166,.237572,.0303164,.939987,-.00969686,.237572,.0383711,.939997,-.0119715,.237574,.0473751,.940031,-.0144858,.237581,.0573298,.940073,-.0172399,.237589,.0682366,.94012,-.0202335,.237598,.080097,.940162,-.0234663,.237604,.0929116,.940237,-.0269387,.237615,.106686,.940328,-.0306489,.237632,.121421,.940419,-.0345917,.237645,.137115,.940522,-.0387481,.237654,.153766,.940702,-.0429906,.237661,.17133,.940871,-.0465089,.237561,.189502,.941103,-.050531,.23748,.208616,.941369,-.0550657,.237423,.228595,.941641,-.0601337,.237399,.249287,.941903,-.0658804,.237443,.270467,.942224,-.0722674,.237597,.292024,.942633,-.0771788,.237419,.315272,.943172,-.0815623,.237068,.339579,.943691,-.0863973,.236682,.364717,.944382,-.0911536,.236213,.390435,.945392,-.0952967,.235562,.416425,.946185,-.0998948,.234832,.442772,.947212,-.104796,.234114,.469347,.948778,-.10928,.233222,.496162,.950149,-.113081,.231845,.523978,.951989,-.115893,.230005,.552295,.953921,-.11846,.227862,.580569,.955624,-.12115,.225439,.608698,.958234,-.123373,.222635,.636696,.960593,-.124519,.219093,.665208,.963201,-.124736,.214749,.693557,.965642,-.125012,.210059,.721334,.968765,-.124661,.204935,.748613,.971753,-.122996,.198661,.776224,.973751,-.120998,.191823,.802461,.976709,-.118583,.184359,.828399,.977956,-.115102,.176437,.853693,.979672,-.111077,.167681,.877962,.981816,-.10688,.158872,.901564,.98238,-.101469,.149398,.924057,.983964,-.0960013,.139436,.945751,.984933,-.0899626,.12943,.966272,.985694,-.0832973,.11894,.985741,.986822,-.0767082,.108349,1.00407,.987725,-.0693614,.0976026,1.02154,.98877,-.06211,.086652,1.03757,.990129,-.0544143,.0756182,1.05296,.991337,-.046744,.0645753,1.06683,.992978,-.0387931,.0534683,1.0798,.994676,-.030973,.0424137,1.09181,.99645,-.0230311,.0314035,1.10286,.997967,-.0152065,.0206869,1.11291,.99922,-.00744837,.010155,1.12237,1.00002,240209e-9,-752767e-10,1.13089,.922948,-515351e-11,.255626,186069e-10,.928785,-129623e-9,.257244,468009e-9,.928761,-51849e-8,.257237,.00187202,.928751,-.0011666,.257235,.00421204,.928751,-.00207395,.257234,.0074881,.928754,-.00324055,.257235,.0117002,.92876,-.00466639,.257236,.0168486,.928763,-.00635149,.257237,.0229334,.928774,-.00829584,.257239,.029955,.928791,-.0104995,.257243,.0379139,.928804,-.0129623,.257245,.0468108,.928847,-.0156846,.257255,.0566473,.92889,-.0186661,.257263,.0674246,.928924,-.0219067,.257268,.0791433,.928989,-.0254066,.257282,.0918076,.92909,-.0291651,.257301,.105419,.92918,-.0331801,.257316,.119978,.92929,-.0374469,.257332,.135491,.929453,-.041939,.257357,.151948,.929586,-.0464612,.257347,.169275,.929858,-.0503426,.257269,.187257,.930125,-.0548409,.257199,.206204,.930403,-.0598063,.257149,.22601,.930726,-.0652437,.257122,.246561,.931098,-.0712376,.257153,.267618,.931396,-.0777506,.257237,.288993,.931947,-.0832374,.257124,.311527,.932579,-.0883955,.25683,.335697,.933194,-.0937037,.256444,.360634,.934013,-.0987292,.255939,.386126,.935307,-.103215,.255282,.412018,.936374,-.108234,.254538,.438292,.93776,-.113234,.253728,.464805,.939599,-.118013,.25275,.491464,.941036,-.122661,.251404,.518751,.94337,-.125477,.249435,.547133,.945318,-.128374,.247113,.575456,.947995,-.130996,.244441,.60372,.950818,-.133438,.241352,.63174,.954378,-.135004,.237849,.659971,.957151,-.135313,.233188,.688478,.960743,-.13521,.228001,.716767,.964352,-.135007,.222249,.744349,.967273,-.133523,.21542,.771786,.969767,-.131155,.208039,.798639,.973195,-.128492,.200076,.824774,.975557,-.125094,.191451,.850222,.977692,-.120578,.18184,.874761,.98026,-.115882,.172102,.898497,.981394,-.110372,.161859,.921636,.982386,-.10415,.15108,.943467,.983783,-.0978128,.140407,.964045,.98422,-.0906171,.129058,.98398,.985447,-.0832921,.117614,1.00276,.986682,-.0754412,.10585,1.02047,.987326,-.0673885,.0940943,1.03678,.988707,-.0592565,.0822093,1.05218,.990185,-.050717,.070192,1.06652,.991866,-.0423486,.0582081,1.07965,.993897,-.0336118,.0460985,1.09188,.995841,-.0252178,.0342737,1.10307,.997605,-.0164893,.0224829,1.11324,.999037,-.00817112,.0110647,1.12262,1.00003,291686e-9,-168673e-9,1.13139,.915304,-552675e-11,.275999,183285e-10,.91668,-139285e-9,.276414,461914e-9,.916664,-55713e-8,.276409,.00184763,.916653,-.00125354,.276406,.00415715,.916651,-.00222851,.276405,.00739053,.916655,-.00348205,.276406,.0115478,.916653,-.00501414,.276405,.0166291,.916667,-.00682478,.276409,.0226346,.91668,-.00891398,.276412,.0295648,.91669,-.0112817,.276413,.0374199,.916727,-.013928,.276422,.0462016,.916759,-.0168528,.276429,.0559101,.916793,-.0200558,.276436,.0665466,.916849,-.0235373,.276448,.0781139,.916964,-.0272973,.276474,.0906156,.917047,-.0313344,.276491,.104051,.917152,-.0356465,.276511,.118424,.917286,-.0402271,.276533,.133736,.917469,-.0450408,.276564,.149978,.917686,-.0497872,.276563,.167057,.917953,-.0540937,.276493,.184846,.918228,-.0590709,.276437,.203614,.918572,-.0644277,.276398,.223212,.918918,-.0702326,.276362,.243584,.919356,-.076484,.276383,.264465,.919842,-.0830808,.276434,.285701,.920451,-.0892972,.276407,.307559,.921113,-.095016,.276128,.331501,.921881,-.100771,.275754,.356207,.923027,-.106029,.275254,.381477,.924364,-.111029,.274595,.40722,.925818,-.116345,.273841,.433385,.92746,-.121424,.272913,.459848,.929167,-.12657,.271837,.486493,.931426,-.131581,.270575,.513432,.934001,-.135038,.268512,.541502,.936296,-.138039,.266135,.569658,.939985,-.140687,.263271,.598375,.943516,-.143247,.260058,.626563,.94782,-.145135,.256138,.654711,.951023,-.145733,.251154,.683285,.955338,-.145554,.245562,.711831,.959629,-.145008,.239265,.739573,.963123,-.144003,.232064,.767027,.966742,-.141289,.224036,.794359,.969991,-.138247,.215305,.820361,.973403,-.134786,.206051,.846548,.975317,-.129966,.195914,.871541,.977647,-.12471,.185184,.895313,.980137,-.119086,.174161,.918398,.981031,-.112297,.162792,.940679,.982037,-.105372,.150952,.961991,.983164,-.097821,.138921,.981913,.983757,-.0897245,.126611,1.00109,.985036,-.0815974,.114228,1.01902,.986289,-.0727725,.101389,1.03604,.987329,-.0639323,.0886476,1.05149,.989193,-.0548109,.0756837,1.06619,.990716,-.045687,.0627581,1.07948,.992769,-.0364315,.0498337,1.09172,.99524,-.0271761,.0370305,1.1033,.997154,-.0179609,.0243959,1.11353,.998845,-.00878063,.0119567,1.12319,1.00002,259038e-9,-108146e-9,1.13177,.903945,-591681e-11,.295126,181226e-10,.903668,-148672e-9,.295037,455367e-9,.903677,-594683e-9,.29504,.00182145,.903673,-.00133805,.295039,.00409831,.903666,-.00237872,.295036,.00728584,.903668,-.00371676,.295037,.0113842,.903679,-.00535212,.29504,.0163936,.903684,-.00728479,.295041,.0223141,.903698,-.00951473,.295044,.0291462,.903718,-.0120419,.295049,.0368904,.903754,-.0148664,.295058,.0455477,.903801,-.017988,.29507,.0551194,.903851,-.0214064,.295082,.0656058,.903921,-.0251219,.295097,.0770109,.904002,-.0291337,.295116,.0893354,.904111,-.033441,.29514,.102583,.904246,-.0380415,.295169,.116755,.904408,-.0429258,.295202,.131853,.904637,-.0480468,.295245,.147869,.904821,-.0529208,.295214,.164658,.905163,-.0577748,.295185,.182274,.905469,-.0631763,.295143,.200828,.905851,-.068917,.295112,.2202,.906322,-.0750861,.295104,.240372,.906761,-.0815855,.295086,.261082,.90735,-.0882138,.295095,.282123,.908087,-.095082,.295139,.303563,.908826,-.101488,.29492,.327028,.909832,-.107577,.294577,.351464,.911393,-.113033,.294115,.376497,.912804,-.118629,.293446,.402115,.914081,-.124232,.292581,.428111,.91637,-.129399,.29166,.454442,.91814,-.134892,.290422,.481024,.921179,-.140069,.289194,.507924,.924544,-.144431,.287421,.535557,.927995,-.147498,.284867,.563984,.931556,-.150197,.281722,.5923,.935777,-.152711,.278207,.620832,.940869,-.154836,.274148,.649069,.945994,-.155912,.269057,.677746,.949634,-.155641,.262799,.706293,.955032,-.154809,.256097,.734278,.95917,-.153678,.248618,.761751,.962931,-.151253,.239794,.789032,.966045,-.147625,.230281,.815422,.96971,-.143964,.220382,.841787,.972747,-.139464,.209846,.867446,.975545,-.133459,.198189,.892004,.978381,-.127424,.186362,.915458,.979935,-.120506,.173964,.937948,.980948,-.11282,.161429,.959732,.982234,-.104941,.148557,.980118,.982767,-.0962905,.135508,.999463,.983544,-.0873625,.122338,1.01756,.984965,-.0783447,.108669,1.03492,.986233,-.0684798,.0949911,1.05087,.987796,-.0590867,.0811386,1.0656,.989885,-.0489145,.0673099,1.0794,.991821,-.0391,.0535665,1.09174,.99448,-.029087,.0397529,1.10341,.996769,-.019114,.0261463,1.11383,.998641,-.00947007,.0128731,1.1237,.999978,446316e-9,-169093e-9,1.13253,.888362,-627064e-11,.312578,178215e-10,.889988,-157791e-9,.313148,448451e-9,.889825,-631076e-9,.313092,.00179356,.88984,-.00141994,.313097,.00403554,.889828,-.0025243,.313092,.00717429,.889831,-.00394421,.313093,.0112099,.889831,-.00567962,.313093,.0161425,.889844,-.00773051,.313096,.0219724,.889858,-.0100968,.3131,.0286999,.889882,-.0127786,.313106,.0363256,.889918,-.0157757,.313116,.0448509,.889967,-.0190878,.313129,.0542758,.89003,-.022715,.313145,.0646032,.890108,-.0266566,.313165,.0758339,.890218,-.0309131,.313193,.0879729,.890351,-.0354819,.313226,.101019,.89051,-.0403613,.313263,.114979,.890672,-.0455385,.313294,.129848,.890882,-.0509444,.313333,.145616,.891189,-.0559657,.313324,.162122,.891457,-.0613123,.313281,.179524,.891856,-.0671488,.313281,.197855,.892312,-.0732732,.313268,.216991,.892819,-.0797865,.313263,.236924,.893369,-.0865269,.313247,.257433,.894045,-.0931592,.313205,.278215,.894884,-.100532,.313276,.299467,.895832,-.107716,.313205,.322276,.897043,-.114099,.312873,.34642,.898515,-.119941,.312331,.371187,.900191,-.126044,.311731,.396656,.90188,-.131808,.310859,.422488,.904359,-.137289,.309857,.448744,.906923,-.142991,.308714,.475239,.910634,-.148253,.307465,.501983,.914502,-.153332,.305774,.529254,.919046,-.156646,.303156,.557709,.923194,-.159612,.299928,.586267,.928858,-.162027,.296245,.614925,.934464,-.164203,.291832,.643187,.939824,-.165602,.286565,.671601,.944582,-.165383,.280073,.700213,.949257,-.164439,.272891,.728432,.954389,-.162953,.264771,.756082,.958595,-.161007,.255927,.78369,.962138,-.157243,.245769,.810769,.966979,-.152872,.235127,.836999,.969566,-.148209,.22347,.862684,.972372,-.142211,.211147,.887847,.975916,-.135458,.198606,.911843,.978026,-.128398,.185498,.934795,.979686,-.120313,.17171,.956787,.980748,-.11166,.158159,.978046,.981622,-.103035,.144399,.997693,.982356,-.0930328,.13001,1.01642,.983308,-.0834627,.115778,1.03366,.985037,-.0732249,.101327,1.05014,.986493,-.0628145,.086554,1.06507,.988484,-.0526556,.0720413,1.07907,.991051,-.0415744,.0571151,1.09189,.993523,-.0314275,.0426643,1.10369,.99628,-.0203603,.0279325,1.11423,.998344,-.0102446,.0138182,1.12421,.999997,42612e-8,-193628e-9,1.1333,.871555,-660007e-11,.329176,174749e-10,.875255,-166579e-9,.330571,441051e-9,.875644,-666394e-9,.330718,.00176441,.875159,-.00149903,.330536,.00396899,.87516,-.00266493,.330536,.007056,.875158,-.00416393,.330535,.0110251,.87516,-.00599598,.330535,.0158764,.875163,-.00816108,.330536,.0216101,.875174,-.0106591,.330538,.0282266,.875199,-.0134899,.330545,.0357266,.875257,-.0166538,.330563,.0441117,.875304,-.0201501,.330575,.0533821,.875373,-.0239785,.330595,.0635395,.875464,-.0281389,.330619,.0745872,.875565,-.0326301,.330645,.0865255,.875691,-.0374516,.330676,.0993599,.875897,-.0425993,.330733,.113093,.876091,-.0480576,.330776,.127722,.876353,-.0537216,.330826,.143227,.876649,-.0589807,.330809,.159462,.877034,-.0647865,.330819,.176642,.877443,-.0709789,.330817,.194702,.877956,-.0774782,.330832,.213577,.878499,-.0843175,.330822,.233246,.879144,-.0912714,.330804,.253512,.879982,-.0980824,.330766,.274137,.88097,-.105823,.330864,.295209,.882051,-.113671,.330896,.317226,.883397,-.120303,.330545,.341068,.884987,-.12667,.330068,.365613,.886789,-.133118,.329418,.390807,.889311,-.139024,.328683,.416494,.891995,-.144971,.327729,.442618,.895106,-.150747,.326521,.469131,.899527,-.156283,.325229,.495921,.90504,-.161707,.32378,.523162,.909875,-.165661,.32122,.55092,.91561,-.168755,.317942,.579928,.921225,-.171193,.313983,.608539,.927308,-.17319,.309636,.636854,.933077,-.174819,.304262,.66523,.938766,-.175002,.297563,.693609,.943667,-.173946,.289613,.722157,.949033,-.172221,.281227,.750021,.953765,-.169869,.271545,.777466,.95804,-.166578,.261034,.804853,.962302,-.161761,.249434,.831569,.966544,-.156636,.237484,.857779,.969372,-.150784,.224395,.883051,.972486,-.143672,.210786,.907864,.975853,-.135772,.196556,.931223,.977975,-.127942,.182307,.954061,.979122,-.118347,.167607,.97531,.980719,-.109112,.152739,.995666,.981223,-.0991789,.137932,1.01475,.98216,-.0883553,.122692,1.03253,.983379,-.0780825,.107493,1.04917,.985434,-.0665646,.0917791,1.06464,.987332,-.0557714,.0764949,1.07896,.990004,-.0442805,.060721,1.09199,.992975,-.0331676,.0452284,1.10393,.995811,-.0219547,.0297934,1.11476,.9982,-.0107613,.0146415,1.12484,1.00002,248678e-9,-14555e-8,1.13413,.859519,-693595e-11,.347264,171673e-10,.859843,-17503e-8,.347394,433219e-9,.859656,-700076e-9,.347319,.00173277,.859671,-.00157517,.347325,.00389875,.859669,-.00280028,.347324,.00693112,.85967,-.0043754,.347324,.01083,.859665,-.00630049,.347321,.0155954,.859685,-.0085755,.347328,.0212278,.859694,-.0112003,.347329,.0277273,.859718,-.0141747,.347336,.0350946,.85976,-.0174988,.347348,.0433314,.85982,-.0211722,.347366,.0524384,.859892,-.0251941,.347387,.0624168,.860006,-.0295649,.347422,.0732708,.860122,-.0342825,.347453,.0849999,.860282,-.0393462,.347499,.0976102,.860482,-.0447513,.347554,.111104,.860719,-.0504775,.347614,.125479,.860998,-.0563577,.347666,.140703,.861322,-.0619473,.347662,.156681,.861724,-.0681277,.347684,.173597,.862198,-.0746567,.347709,.191371,.862733,-.0815234,.347727,.209976,.863371,-.0886643,.347744,.229351,.86414,-.0957908,.347734,.24934,.865138,-.102912,.34772,.269797,.866182,-.110924,.3478,.290654,.867436,-.119223,.347911,.312074,.869087,-.126197,.347649,.335438,.870859,-.133145,.347222,.359732,.872997,-.139869,.346645,.38467,.875939,-.146089,.345935,.41019,.879012,-.152334,.345012,.436218,.883353,-.15821,.343924,.462641,.888362,-.164097,.342636,.489449,.895026,-.169528,.341351,.516629,.900753,-.174408,.339115,.544109,.906814,-.17751,.335809,.572857,.912855,-.180101,.331597,.601554,.919438,-.182116,.32698,.630198,.925962,-.183494,.321449,.658404,.931734,-.184159,.314595,.686625,.93762,-.18304,.306462,.71531,.943858,-.181323,.297514,.744272,.948662,-.178683,.287447,.771462,.953299,-.175379,.276166,.798593,.957346,-.170395,.263758,.8256,.962565,-.165042,.251019,.852575,.966075,-.158655,.237011,.878316,.969048,-.151707,.222518,.90329,.972423,-.143271,.207848,.927745,.975833,-.134824,.192463,.950859,.977629,-.125444,.1768,.972947,.978995,-.114949,.161033,.993263,.980533,-.104936,.145523,1.01337,.980745,-.0935577,.129799,1.03128,.981814,-.0822956,.113486,1.04825,.983943,-.0710082,.0972925,1.06405,.986141,-.0587931,.0808138,1.0785,.988878,-.0472755,.0644915,1.09204,.992132,-.0349128,.0478128,1.10413,.9953,-.0232407,.031621,1.11527,.998117,-.0112713,.0154935,1.12551,1.00003,339743e-9,-195763e-9,1.13504,.845441,-729126e-11,.364305,169208e-10,.843588,-183164e-9,.363506,425067e-9,.843412,-73253e-8,.36343,.00169999,.843401,-.00164818,.363426,.00382495,.843399,-.00293008,.363425,.00679993,.843401,-.00457822,.363425,.010625,.843394,-.00659249,.363421,.0153002,.843398,-.00897282,.363421,.0208258,.843415,-.0117191,.363426,.0272024,.843438,-.0148312,.363432,.0344305,.843483,-.018309,.363447,.0425116,.84356,-.0221521,.363472,.0514471,.843646,-.0263597,.363499,.061238,.843743,-.0309315,.363527,.0718873,.84388,-.0358658,.363569,.0833969,.844079,-.0411624,.363631,.0957742,.844279,-.0468128,.363688,.109015,.844549,-.0527923,.363761,.123124,.844858,-.0588204,.363817,.138044,.84522,-.0647573,.36383,.153755,.845669,-.0713181,.363879,.170394,.846155,-.0781697,.363908,.187861,.846789,-.0853913,.363969,.206176,.847502,-.0928086,.363999,.225244,.8484,-.10005,.363997,.244926,.849461,-.107615,.364008,.265188,.850562,-.115814,.364055,.28587,.851962,-.124334,.364179,.306926,.854326,-.131995,.364233,.329605,.856295,-.139338,.363856,.35359,.858857,-.146346,.363347,.37831,.862428,-.152994,.362807,.403722,.866203,-.159463,.361963,.429537,.871629,-.165623,.36112,.456,.877365,-.171649,.359917,.482773,.883744,-.177151,.35848,.509705,.890693,-.182381,.356523,.537215,.897278,-.186076,.3533,.565493,.903958,-.188602,.349095,.594293,.910908,-.190755,.344215,.623165,.918117,-.192063,.338606,.651573,.924644,-.192758,.331544,.679869,.931054,-.192238,.323163,.708668,.937303,-.190035,.313529,.737201,.943387,-.187162,.303152,.764977,.948494,-.183876,.29146,.792683,.952546,-.178901,.277917,.819228,.958077,-.173173,.264753,.846559,.962462,-.16645,.25002,.872962,.966569,-.159452,.234873,.898729,.969108,-.15074,.218752,.923126,.973072,-.141523,.202673,.947278,.975452,-.132075,.186326,.969938,.977784,-.121257,.169396,.991325,.97899,-.110182,.153044,1.01123,.979777,-.0989634,.136485,1.0299,.980865,-.0865894,.119343,1.04727,.982432,-.0746115,.102452,1.06341,.984935,-.0621822,.0852423,1.07834,.987776,-.0495694,.0678546,1.092,.99103,-.0372386,.0506917,1.1043,.99474,-.0244353,.0333316,1.11576,.997768,-.0121448,.0164348,1.12617,1.00003,31774e-8,-169504e-9,1.13598,.825551,-756799e-11,.378425,165099e-10,.82664,-190922e-9,.378923,416504e-9,.826323,-763495e-9,.378779,.0016656,.826359,-.00171789,.378795,.00374768,.82636,-.00305402,.378795,.00666259,.826368,-.00477185,.378798,.0104104,.826364,-.00687131,.378795,.0149912,.826368,-.00935232,.378795,.0204054,.826376,-.0122146,.378797,.0266532,.826399,-.0154581,.378803,.0337355,.82646,-.0190825,.378824,.0416537,.826525,-.0230873,.378846,.0504091,.826614,-.0274719,.378876,.0600032,.82674,-.0322355,.378917,.0704393,.826888,-.0373766,.378964,.0817195,.827078,-.0428936,.379024,.0938492,.827318,-.0487778,.379099,.106828,.82764,-.0549935,.379199,.120659,.827926,-.0611058,.379227,.13526,.828325,-.0675054,.379275,.150713,.828801,-.0743455,.379332,.167034,.8294,-.0815523,.379415,.184209,.830094,-.0890779,.379495,.202203,.8309,-.096736,.379555,.220945,.831943,-.104135,.379577,.240306,.833037,-.112106,.379604,.260317,.834278,-.120554,.379668,.2808,.836192,-.129128,.3799,.301654,.838671,-.137541,.380109,.323502,.840939,-.14523,.379809,.347176,.844575,-.15248,.379593,.371706,.848379,-.159607,.37909,.39688,.853616,-.166267,.378617,.422702,.858921,-.172698,.377746,.448919,.865324,-.178823,.376749,.475661,.872207,-.184542,.375363,.502599,.880018,-.189836,.373657,.529914,.88694,-.194294,.370673,.557683,.894779,-.197022,.36662,.586848,.902242,-.199108,.36138,.615831,.909914,-.200398,.355434,.644478,.917088,-.20094,.348173,.672905,.923888,-.200671,.339482,.701327,.930495,-.198773,.32956,.730101,.937247,-.195394,.318363,.758383,.943108,-.191956,.306323,.786539,.948296,-.187227,.292576,.813637,.953472,-.181165,.278234,.840793,.958485,-.174119,.263054,.867712,.962714,-.166564,.246756,.893635,.966185,-.158181,.229945,.919028,.970146,-.148275,.212633,.943413,.973491,-.138157,.195229,.966627,.975741,-.127574,.178048,.988817,.977238,-.11554,.160312,1.00924,.978411,-.10364,.142857,1.02845,.979811,-.0913122,.125317,1.04648,.98116,-.0782558,.107627,1.06284,.983543,-.0655957,.0895862,1.07798,.986789,-.0520411,.0713756,1.092,.990292,-.0389727,.053228,1.10484,.994187,-.025808,.0351945,1.11642,.997499,-.0126071,.0173198,1.12703,.999999,275604e-9,-148602e-9,1.13674,.81075,-78735e-10,.394456,161829e-10,.808692,-198293e-9,.393453,407564e-9,.80846,-792877e-9,.39334,.00162965,.808595,-.00178416,.393407,.00366711,.808597,-.00317182,.393408,.00651934,.808598,-.00495589,.393408,.0101866,.808591,-.00713627,.393403,.0146689,.808592,-.00971285,.393402,.0199667,.80861,-.0126855,.393407,.0260803,.808633,-.0160538,.393413,.0330107,.80868,-.0198175,.393429,.0407589,.808748,-.0239758,.393453,.0493264,.808854,-.0285286,.39349,.0587161,.808992,-.0334748,.39354,.0689304,.809141,-.0388116,.393588,.0799707,.809352,-.0445375,.39366,.0918432,.809608,-.0506427,.393742,.104549,.809915,-.0570708,.393834,.118085,.810253,-.0633526,.393885,.132377,.810687,-.0700966,.393953,.147537,.811233,-.0772274,.394047,.163543,.811865,-.0847629,.394148,.180394,.812648,-.0925663,.394265,.198051,.813583,-.100416,.394363,.216443,.814683,-.108119,.394402,.235502,.815948,-.11644,.394489,.255242,.817278,-.125036,.394542,.275441,.819605,-.133655,.39486,.296094,.822256,-.142682,.395248,.317309,.825349,-.150756,.395241,.340516,.829605,-.158392,.395285,.364819,.83391,-.165801,.394922,.389736,.839808,-.172677,.394691,.415409,.845708,-.179448,.394006,.441546,.853025,-.185746,.393279,.46832,.859666,-.191684,.391655,.495302,.86789,-.197146,.390068,.52262,.875845,-.201904,.38727,.550336,.882634,-.205023,.382688,.578825,.891076,-.207098,.377543,.608103,.900589,-.208474,.371752,.63723,.90791,-.209068,.364016,.665769,.915971,-.208655,.355593,.694428,.923455,-.20729,.345439,.723224,.931514,-.203821,.334099,.751925,.937885,-.19986,.321069,.780249,.943136,-.194993,.306571,.8077,.948818,-.189132,.291556,.83497,.954433,-.181617,.275745,.86188,.959078,-.173595,.258695,.888562,.962705,-.164855,.240825,.914008,.966753,-.155129,.22268,.939145,.970704,-.144241,.204542,.963393,.973367,-.133188,.185927,.985983,.975984,-.121146,.167743,1.00704,.976994,-.108366,.149218,1.02715,.978485,-.0956746,.13131,1.0455,.980074,-.0820733,.112513,1.06221,.98225,-.0684061,.0938323,1.07782,.98553,-.0549503,.0749508,1.09199,.989529,-.0407857,.055848,1.10508,.993536,-.0271978,.0368581,1.11684,.997247,-.0132716,.0181845,1.12789,1,431817e-9,-198809e-9,1.13792,.785886,-812608e-11,.405036,157669e-10,.790388,-205278e-9,.407355,398297e-9,.790145,-820824e-9,.407231,.00159263,.790135,-.00184681,.407226,.00358336,.790119,-.00328316,.407218,.00637039,.790126,-.00512988,.40722,.0099539,.79013,-.00738684,.407221,.0143339,.790135,-.0100538,.407221,.0195107,.790134,-.0131306,.407217,.0254848,.79016,-.0166169,.407224,.0322572,.790197,-.020512,.407236,.0398284,.790273,-.0248157,.407263,.0482014,.790381,-.029527,.407304,.0573777,.790521,-.0346446,.407355,.0673602,.790704,-.0401665,.40742,.0781522,.790925,-.0460896,.407499,.0897582,.791195,-.0524017,.407589,.10218,.791522,-.0590121,.407691,.11541,.791878,-.0654876,.407748,.12939,.792361,-.0725207,.407849,.144237,.792942,-.0799844,.407963,.159924,.79362,-.0877896,.408087,.176425,.794529,-.0958451,.408259,.193733,.795521,-.103827,.408362,.211756,.796778,-.111937,.408482,.230524,.798027,-.120521,.408547,.249967,.799813,-.129242,.408721,.269926,.802387,-.138048,.409148,.290338,.805279,-.147301,.409641,.311193,.809251,-.155895,.410154,.333611,.813733,-.163942,.410297,.357615,.819081,-.171666,.410373,.382339,.825427,-.178905,.410348,.407828,.83172,-.185812,.409486,.434034,.83877,-.192318,.408776,.460493,.845817,-.198249,.407176,.487346,.854664,-.204034,.405719,.514832,.863495,-.208908,.403282,.542401,.871883,-.212765,.399293,.570683,.88065,-.214911,.393803,.599947,.89004,-.216214,.387536,.62932,.898476,-.216745,.379846,.658319,.906738,-.216387,.370625,.687138,.914844,-.215053,.360139,.71601,.923877,-.212007,.348849,.745124,.931925,-.207481,.335639,.773366,.938054,-.202418,.320798,.801636,.943895,-.196507,.304772,.829055,.949468,-.189009,.288033,.856097,.955152,-.180539,.270532,.88301,.959403,-.171437,.251639,.909296,.963309,-.161661,.232563,.934868,.967399,-.150425,.213231,.959662,.972009,-.138659,.194247,.98302,.97433,-.126595,.174718,1.00517,.975823,-.113205,.155518,1.02566,.976371,-.0996096,.136709,1.04418,.978705,-.0860754,.117571,1.06146,.981477,-.0714438,.0980046,1.07777,.984263,-.0572304,.0782181,1.09214,.988423,-.0428875,.0584052,1.10553,.993,-.0282442,.038522,1.11758,.99704,-.0140183,.0190148,1.12864,.999913,369494e-9,-145203e-9,1.13901,.777662,-84153e-10,.423844,154403e-10,.770458,-211714e-9,.419915,38845e-8,.770716,-846888e-9,.420055,.00155386,.770982,-.00190567,.420202,.00349653,.770981,-.00338782,.420201,.00621606,.77098,-.00529338,.4202,.00971274,.770983,-.00762223,.4202,.0139867,.770985,-.0103741,.420198,.0190381,.770996,-.0135489,.4202,.0248677,.771029,-.0171461,.420212,.0314764,.771052,-.0211647,.420215,.0388648,.771131,-.0256048,.420245,.047036,.771235,-.0304647,.420284,.0559911,.771383,-.0357436,.420341,.0657346,.771591,-.0414392,.420423,.0762694,.771819,-.0475462,.420506,.0875984,.772123,-.0540506,.420617,.099727,.772464,-.060797,.42072,.112637,.772855,-.0675393,.420799,.126313,.773317,-.0748323,.420893,.140824,.773981,-.0825681,.421058,.15617,.774746,-.0906307,.421226,.172322,.77566,-.0988982,.421397,.189253,.776837,-.106994,.421569,.206912,.778097,-.115528,.421704,.225359,.779588,-.124317,.421849,.24447,.781574,-.133139,.422097,.264156,.784451,-.142179,.422615,.284318,.787682,-.15165,.423269,.304902,.792433,-.160771,.424396,.3265,.797359,-.169166,.424772,.35014,.803986,-.177149,.425475,.374768,.809504,-.184745,.424996,.399928,.815885,-.19173,.424247,.425796,.823513,-.198525,.423515,.452287,.832549,-.204709,.422787,.479321,.841653,-.210447,.421187,.506718,.850401,-.215501,.418519,.53432,.859854,-.219752,.414715,.56242,.869364,-.222305,.409462,.591558,.878837,-.223744,.402926,.621074,.888636,-.224065,.395043,.650538,.898132,-.223742,.38564,.679538,.907181,-.222308,.375378,.708674,.915621,-.219837,.363212,.737714,.9239,-.215233,.349313,.767014,.931644,-.209592,.334162,.795133,.938887,-.203644,.317943,.823228,.945282,-.196349,.300581,.850822,.950758,-.18742,.282195,.877594,.956146,-.177879,.262481,.904564,.960355,-.167643,.242487,.930741,.965256,-.156671,.222668,.955868,.968029,-.144123,.201907,.979869,.97251,-.131305,.18202,1.00291,.974925,-.118335,.161909,1.02392,.975402,-.103714,.142129,1.0433,.976987,-.089415,.122447,1.06089,.979677,-.0748858,.102248,1.07713,.983184,-.0596086,.0814851,1.09218,.987466,-.0447671,.0609484,1.10585,.992348,-.0295217,.0401835,1.11829,.996674,-.0143917,.0198163,1.12966,1.00003,321364e-9,-149983e-9,1.1402,.757901,-869074e-11,.436176,151011e-10,.751195,-217848e-9,.432317,378533e-9,.751178,-871373e-9,.432307,.0015141,.751195,-.00196061,.432317,.0034068,.751198,-.00348552,.432318,.00605659,.751195,-.00544599,.432315,.00946353,.751207,-.00784203,.43232,.013628,.751213,-.0106732,.43232,.0185499,.751221,-.0139393,.432319,.0242302,.751244,-.0176398,.432325,.0306694,.7513,-.0217743,.432348,.0378698,.751358,-.0263412,.432367,.0458321,.751458,-.0313396,.432404,.0545587,.751608,-.0367682,.432464,.0640543,.7518,-.0426246,.43254,.0743222,.752065,-.0489031,.432645,.0853668,.752376,-.0555828,.432762,.0971911,.752715,-.0623861,.432859,.109768,.753137,-.069415,.432958,.123126,.753676,-.0770039,.433099,.137308,.754345,-.084971,.433272,.15229,.755235,-.0932681,.433504,.168075,.756186,-.10171,.433693,.184625,.757363,-.110019,.433857,.201897,.75884,-.11887,.434102,.220014,.760467,-.127881,.434306,.238778,.762969,-.136766,.434751,.258172,.765823,-.14612,.43529,.278062,.769676,-.15566,.436236,.298437,.774909,-.165177,.437754,.319532,.77994,-.17402,.438343,.342505,.785757,-.182201,.438609,.366693,.792487,-.190104,.438762,.391668,.80038,-.197438,.438795,.417494,.808494,-.204365,.438226,.443933,.817695,-.210714,.437283,.470929,.828111,-.216651,.436087,.498569,.837901,-.221804,.433717,.526165,.847813,-.226318,.430133,.554155,.858314,-.229297,.425213,.582822,.868891,-.230999,.418576,.612847,.878941,-.231155,.410405,.642445,.888809,-.230935,.400544,.672024,.898089,-.229343,.389613,.701366,.908081,-.226886,.377197,.730763,.916819,-.222676,.363397,.759642,.924968,-.216835,.347437,.788775,.932906,-.210245,.32995,.817135,.940025,-.202992,.312262,.844912,.946101,-.19436,.293313,.872164,.952835,-.184125,.273638,.899443,.957347,-.173657,.252385,.926389,.961434,-.162204,.231038,.951947,.965522,-.14979,.209834,.976751,.969412,-.136307,.188821,1.00022,.973902,-.122527,.168013,1.02229,.974045,-.108213,.147634,1.04199,.975775,-.0927397,.12705,1.06019,.978383,-.0778212,.106309,1.07711,.98211,-.0621216,.0849279,1.09245,.986517,-.0463847,.0633519,1.10651,.991696,-.0309353,.0419698,1.11903,.996349,-.0150914,.0206272,1.13073,1.00003,442449e-9,-231396e-9,1.14146,.727498,-885074e-11,.441528,145832e-10,.730897,-223525e-9,.443589,368298e-9,.730796,-893996e-9,.443528,.00147303,.730805,-.00201149,.443533,.00331433,.730814,-.00357596,.443538,.00589222,.730815,-.00558734,.443538,.00920678,.730822,-.00804544,.44354,.0132582,.730836,-.0109501,.443545,.0180468,.730848,-.0143008,.443546,.0235732,.730871,-.0180969,.443552,.0298382,.730915,-.022338,.443567,.0368438,.730982,-.0270225,.443591,.044591,.731076,-.0321491,.443627,.0530831,.731245,-.0377166,.443699,.0623243,.73144,-.0437216,.443777,.0723181,.7317,-.0501576,.443881,.0830691,.732034,-.0569942,.444014,.0945809,.732388,-.0638756,.444113,.106825,.732853,-.071203,.444247,.119859,.733473,-.0790076,.444442,.13369,.734195,-.0871937,.444645,.148304,.735069,-.095696,.444877,.163702,.736169,-.10426,.445133,.179861,.73747,-.112853,.44537,.196778,.738991,-.12199,.445651,.214496,.740865,-.131153,.445958,.232913,.743637,-.140245,.446548,.251977,.746797,-.149722,.447246,.271551,.751517,-.159341,.448656,.291774,.756156,-.169106,.449866,.312455,.761519,-.178436,.450919,.334552,.768295,-.186904,.451776,.358491,.776613,-.195117,.452832,.383446,.783966,-.202695,.45249,.408945,.793542,-.20985,.452587,.435364,.803192,-.216403,.451852,.462336,.813892,-.22251,.450708,.48987,.824968,-.227676,.4486,.517697,.835859,-.232443,.445156,.545975,.846825,-.235775,.440351,.574483,.858085,-.237897,.433641,.604246,.868825,-.238074,.425354,.634101,.879638,-.237661,.415383,.664201,.889966,-.236186,.404136,.693918,.899479,-.233599,.390917,.723481,.908769,-.229737,.376352,.75258,.917966,-.223836,.360372,.781764,.926304,-.217067,.342551,.811139,.934626,-.209309,.324238,.839585,.941841,-.20071,.304484,.867044,.94789,-.190602,.283607,.894579,.954196,-.179253,.262205,.921743,.958383,-.167646,.239847,.948026,.963119,-.155073,.218078,.973296,.966941,-.141426,.195899,.998135,.970836,-.126849,.174121,1.02021,.973301,-.112296,.153052,1.04085,.97448,-.0964965,.131733,1.05946,.977045,-.080489,.10997,1.07693,.980751,-.064844,.0881657,1.09254,.985475,-.0481938,.0657987,1.10697,.991089,-.0319185,.0435215,1.12004,.996122,-.0158088,.0214779,1.13173,1.00001,372455e-9,-200295e-9,1.14291,.708622,-907597e-11,.45304,141962e-10,.711162,-228911e-9,.454662,358052e-9,.709812,-914446e-9,.453797,.00143034,.709865,-.00205819,.453834,.00321935,.709864,-.00365894,.453833,.00572331,.709855,-.00571692,.453826,.00894278,.709862,-.00823201,.453828,.012878,.709875,-.011204,.453832,.0175295,.709896,-.0146323,.453839,.0228978,.709925,-.0185163,.453847,.0289839,.709974,-.0228551,.453866,.0357894,.710045,-.0276473,.453892,.0433161,.710133,-.032891,.453924,.0515665,.710292,-.0385851,.453992,.0605458,.710485,-.0447254,.45407,.0702574,.710769,-.0513051,.454192,.0807077,.711106,-.0582733,.454329,.091896,.711516,-.0652866,.45446,.103814,.712071,-.0728426,.454653,.116508,.712676,-.0808307,.45484,.129968,.713476,-.0892216,.455096,.144206,.714377,-.0979047,.455346,.159212,.715579,-.106531,.455647,.174973,.716977,-.115492,.455961,.191504,.71862,-.124821,.456315,.208835,.72084,-.134079,.4568,.226869,.723786,-.143427,.457521,.245582,.727464,-.153061,.458475,.264957,.732771,-.162768,.460239,.284948,.736515,-.172627,.460899,.30522,.743519,-.182487,.463225,.326717,.750041,-.191295,.464027,.350113,.758589,-.199746,.465227,.374782,.767703,-.207584,.465877,.400226,.777484,-.214973,.465996,.426442,.788792,-.221796,.466019,.453688,.800194,-.228038,.465083,.481246,.811234,-.233346,.462506,.509086,.822859,-.238073,.459257,.537338,.835082,-.241764,.454863,.566108,.846332,-.244241,.448163,.595126,.858355,-.244736,.439709,.625574,.87034,-.244278,.429837,.65617,.881027,-.24255,.418002,.686029,.891007,-.239912,.404325,.716039,.900874,-.236133,.389222,.745518,.911072,-.230672,.373269,.775026,.920359,-.22356,.355083,.804521,.928604,-.215591,.335533,.834045,.937175,-.206503,.315278,.861612,.942825,-.196684,.293653,.889131,.949805,-.185116,.271503,.916853,.955535,-.172703,.248821,.943541,.959843,-.159978,.225591,.970132,.964393,-.146375,.202719,.994709,.968008,-.131269,.179928,1.0186,.971013,-.11569,.158007,1.03928,.973334,-.1003,.13624,1.05887,.975775,-.0833352,.1138,1.07652,.979579,-.0668981,.0913141,1.09297,.984323,-.0500902,.0683051,1.10734,.990351,-.0332377,.0451771,1.12084,.995823,-.0161491,.0221705,1.13296,1.0001,234083e-9,-108712e-9,1.14441,.683895,-924677e-11,.46015,137429e-10,.68833,-233383e-9,.463134,346865e-9,.688368,-933547e-9,.463159,.00138748,.688367,-.00210049,.463159,.00312187,.688369,-.00373415,.463159,.00555004,.688377,-.00583449,.463163,.00867216,.688386,-.00840128,.463166,.0124884,.688398,-.0114343,.463169,.0169993,.688418,-.0149329,.463175,.0222054,.688453,-.0188964,.463188,.028108,.688515,-.0233239,.463214,.0347085,.68857,-.0282136,.463231,.0420091,.688679,-.033564,.463276,.0500132,.688854,-.0393733,.463356,.0587255,.689038,-.0456354,.46343,.0681476,.689321,-.0523433,.463553,.0782897,.689662,-.059412,.463693,.0891501,.690188,-.0665736,.4639,.100735,.690755,-.0743106,.464107,.113074,.691405,-.0824722,.464329,.126161,.692198,-.0910484,.464585,.140007,.693196,-.0998778,.464893,.154612,.69454,-.108651,.465285,.169984,.695921,-.117855,.465596,.186106,.697749,-.12734,.466056,.203034,.700375,-.136714,.466771,.220703,.703395,-.146386,.467579,.239062,.707904,-.156096,.469067,.258188,.711673,-.165904,.469851,.277759,.717489,-.175812,.471815,.297935,.724051,-.185931,.47389,.318916,.731965,-.195238,.47587,.341591,.741151,-.204021,.477523,.366062,.751416,-.212113,.478881,.391396,.761848,-.21979,.479226,.417599,.771886,-.2267,.478495,.444401,.783998,-.232991,.477622,.472084,.796523,-.238645,.475833,.500193,.808851,-.243396,.472568,.52865,.821191,-.247226,.467857,.557362,.834261,-.250102,.461871,.586768,.846762,-.251056,.453543,.617085,.859867,-.250604,.443494,.647659,.871948,-.248783,.431711,.678119,.882967,-.245855,.417911,.708399,.892826,-.242168,.401993,.738256,.90332,-.237062,.385371,.767999,.913633,-.22997,.366837,.798191,.922774,-.221687,.346372,.827756,.931371,-.212345,.325682,.856425,.938929,-.20206,.303665,.884299,.944821,-.190981,.280786,.912023,.951792,-.178065,.2573,.939669,.957712,-.164634,.233448,.96655,.961912,-.150863,.209504,.992366,.966382,-.13577,.18597,1.01633,.969588,-.119593,.162905,1.03843,.971777,-.103203,.14053,1.05841,.97433,-.0865888,.117909,1.07632,.978686,-.0690829,.0944101,1.09326,.983281,-.0516568,.0705671,1.10796,.989562,-.034558,.0468592,1.12182,.995465,-.0167808,.0229846,1.1342,.999991,373016e-9,-235606e-9,1.1459,.662251,-939016e-11,.468575,132714e-10,.666634,-237624e-9,.471675,335842e-9,.666411,-950385e-9,.471516,.00134321,.666399,-.00213833,.471509,.00302221,.666386,-.0038014,.471499,.00537283,.666405,-.00593958,.471511,.00839533,.666406,-.00855253,.471508,.0120898,.666428,-.0116401,.471519,.0164569,.666444,-.0152015,.471522,.0214971,.66649,-.0192362,.471543,.027212,.666537,-.0237428,.471558,.033603,.666617,-.0287198,.471591,.0406728,.666718,-.0341647,.471631,.0484238,.666889,-.0400759,.47171,.0568621,.667104,-.0464479,.471805,.0659915,.667374,-.0532677,.471923,.0758178,.667772,-.0603805,.472098,.0863425,.668371,-.0677392,.472363,.0975917,.668971,-.0756028,.472596,.109567,.669696,-.0839293,.472869,.122272,.670481,-.0926683,.473126,.135718,.6715,-.1016,.473442,.149914,.672911,-.110566,.47389,.164882,.674512,-.119984,.474354,.180602,.67651,-.129574,.474922,.19711,.679292,-.139106,.475764,.214371,.682798,-.148993,.476886,.232405,.686955,-.158737,.478179,.251153,.691406,-.168754,.479432,.270436,.697438,-.178703,.481481,.290374,.704761,-.188955,.484143,.311044,.713599,-.198814,.487007,.333003,.723194,-.207869,.488962,.357144,.732601,-.216189,.489815,.382169,.744193,-.22398,.490888,.408227,.754907,-.231156,.490355,.434928,.767403,-.23747,.489548,.462599,.78107,-.243503,.488274,.490908,.793893,-.248114,.484843,.519421,.807296,-.25222,.4803,.548561,.820529,-.255265,.474097,.577772,.833716,-.256741,.466041,.607782,.848403,-.25637,.456547,.638807,.860755,-.254804,.443946,.670058,.874012,-.251834,.430852,.700749,.885619,-.247867,.414903,.731446,.896069,-.242634,.397276,.761191,.906266,-.236093,.378535,.791053,.916759,-.227543,.358038,.821298,.92523,-.21783,.335705,.850747,.93436,-.207534,.313797,.879258,.941631,-.195983,.289671,.907734,.947564,-.183567,.265319,.935206,.953681,-.169345,.240815,.962739,.960008,-.154909,.216119,.989227,.964145,-.140161,.192096,1.01465,.968171,-.123411,.167855,1.03737,.969859,-.106525,.144817,1.05767,.972666,-.0891023,.12149,1.0761,.977055,-.0718094,.0975306,1.09336,.982527,-.0534213,.0730217,1.10878,.989001,-.0355579,.0483366,1.12285,.99512,-.0176383,.023938,1.13548,1.00007,368831e-9,-211581e-9,1.14744,.651047,-960845e-11,.484101,12922e-9,.644145,-241347e-9,.478968,324578e-9,.64396,-965142e-9,.478831,.00129798,.64396,-.00217154,.47883,.00292046,.643968,-.00386049,.478835,.00519202,.643974,-.00603186,.478838,.0081128,.643977,-.0086854,.478836,.011683,.643982,-.0118207,.478834,.0159031,.644024,-.0154374,.478856,.0207743,.644059,-.0195343,.478868,.0262975,.644122,-.0241103,.478896,.0324747,.644207,-.0291638,.478933,.039309,.64432,-.0346919,.478981,.0468029,.644481,-.0406919,.479053,.0549614,.644722,-.047159,.479169,.0637909,.645013,-.0540748,.479302,.0732974,.645503,-.0612001,.479541,.0834898,.646117,-.0687303,.479829,.0943873,.646707,-.0767846,.480061,.105991,.647431,-.0852465,.480343,.11831,.64831,-.0940719,.48066,.131348,.649486,-.103056,.481083,.14514,.650864,-.112261,.481528,.159676,.652604,-.121852,.482102,.174979,.654825,-.131505,.482813,.191079,.657876,-.141189,.483876,.207927,.661339,-.151239,.48499,.225586,.665463,-.161091,.486279,.243947,.670542,-.171235,.487968,.262957,.677361,-.181347,.49053,.282781,.685672,-.191679,.493862,.303311,.694551,-.201781,.49699,.324607,.703753,-.211164,.498884,.347916,.713703,-.219675,.500086,.372628,.725911,-.227836,.501554,.398694,.73862,-.23533,.502193,.425529,.752118,-.241786,.501811,.453209,.76579,-.247865,.500185,.481381,.779568,-.252696,.497159,.51011,.793991,-.256802,.492765,.539322,.808182,-.259942,.486827,.569078,.821698,-.261703,.478386,.598818,.836009,-.262006,.468772,.629762,.849824,-.260333,.456352,.661366,.863888,-.257398,.442533,.69295,.876585,-.253264,.426573,.723608,.888665,-.248026,.408964,.754378,.899537,-.241487,.389677,.784761,.9094,-.233463,.368516,.814688,.920166,-.223397,.346624,.845009,.928899,-.21255,.322717,.874431,.937156,-.200869,.298698,.902922,.943861,-.188387,.273491,.931356,.949557,-.174341,.247866,.958854,.955862,-.158994,.222496,.986098,.961721,-.143664,.197522,1.01229,.965976,-.127412,.17302,1.03571,.968652,-.109798,.148954,1.05699,.971084,-.0916787,.125044,1.07587,.975584,-.0739634,.100577,1.09372,.98122,-.055322,.0753666,1.10948,.988253,-.0366825,.0498899,1.12394,.99482,-.0180389,.024611,1.13694,1.00001,229839e-9,-188283e-9,1.14919,.613867,-964198e-11,.479449,123452e-10,.621485,-244534e-9,.485399,313091e-9,.621429,-978202e-9,.485353,.00125245,.62112,-.00220004,.485114,.00281687,.621119,-.0039111,.485112,.00500783,.621122,-.00611091,.485112,.00782498,.621133,-.00879922,.485117,.0112687,.621152,-.0119756,.485125,.0153394,.621183,-.0156396,.485139,.0200382,.621227,-.0197898,.485158,.0253663,.621298,-.0244253,.485192,.0313261,.621388,-.0295441,.485233,.0379204,.621507,-.0351432,.485286,.0451523,.621693,-.0412198,.485378,.0530277,.621933,-.0477673,.485495,.0615522,.622232,-.0547574,.485635,.0707316,.622809,-.0619417,.485943,.0805883,.623407,-.069625,.486232,.0911267,.62406,-.077796,.486516,.102354,.624835,-.0863731,.486838,.114279,.625758,-.095251,.487188,.126902,.627043,-.104299,.487695,.140285,.628438,-.113724,.488163,.154397,.630325,-.123417,.488858,.169267,.632801,-.133137,.489754,.184941,.635784,-.143052,.490815,.20136,.639406,-.153132,.492048,.218643,.643872,-.163143,.49363,.236615,.6499,-.17333,.496009,.255449,.657201,-.183622,.498994,.275006,.666221,-.194019,.502888,.295354,.674419,-.204192,.505459,.316244,.683729,-.21406,.507771,.33849,.695584,-.222854,.510245,.363166,.708583,-.231315,.512293,.389071,.721233,-.238911,.512747,.415737,.735134,-.245657,.512482,.443331,.750179,-.251879,.511526,.471891,.765073,-.256911,.508935,.500892,.779794,-.261144,.504341,.530294,.794801,-.264316,.498515,.560144,.810339,-.266276,.491015,.590213,.824818,-.266981,.481126,.620865,.839375,-.265778,.468685,.652687,.853043,-.262748,.453925,.684759,.867335,-.258474,.437912,.716209,.88037,-.253187,.419648,.747508,.891711,-.246476,.39982,.77797,.902896,-.238735,.37879,.808586,.913601,-.22885,.355891,.838843,.923019,-.217656,.331773,.869014,.933432,-.205539,.307356,.898512,.939691,-.192595,.281321,.9269,.946938,-.178945,.255441,.955297,.952372,-.163587,.229013,.983231,.95909,-.147214,.203179,1.00971,.963675,-.13064,.17792,1.03438,.968247,-.113121,.152898,1.05625,.97001,-.0945824,.128712,1.07598,.974458,-.0755648,.103349,1.094,.980168,-.0571998,.0776731,1.1104,.987295,-.0377994,.0514445,1.12491,.994432,-.0186417,.025429,1.13851,.999975,542714e-9,-282356e-9,1.15108,.592656,-980249e-11,.486018,119532e-10,.598467,-247275e-9,.490781,301531e-9,.597934,-988317e-9,.490343,.00120517,.597903,-.00222366,.490319,.0027116,.597913,-.00395315,.490327,.00482077,.597919,-.00617653,.490329,.00753264,.597936,-.00889375,.490339,.0108478,.597956,-.0121043,.490347,.0147668,.597992,-.0158073,.490365,.0192905,.598032,-.0200017,.490382,.0244204,.598109,-.0246865,.49042,.0301593,.598215,-.0298594,.490474,.03651,.59833,-.0355167,.490524,.0434757,.598525,-.0416559,.490624,.0510629,.598778,-.0482692,.490753,.0592781,.599135,-.0553114,.49094,.0681304,.599802,-.062542,.491328,.0776467,.600361,-.0703638,.491598,.0878184,.60101,-.0786256,.491882,.0986573,.601811,-.0872962,.492232,.11018,.602861,-.0962284,.492684,.1224,.604167,-.10538,.493213,.135354,.605693,-.114896,.493799,.149034,.607682,-.124654,.494576,.163469,.610672,-.13456,.4959,.178747,.613313,-.144581,.496713,.194723,.617603,-.154703,.498499,.211617,.622174,-.16489,.500188,.229183,.628855,-.175164,.503072,.247786,.636963,-.185565,.506798,.267116,.644866,-.195911,.509719,.28702,.653741,-.206104,.512776,.307763,.664942,-.216447,.516812,.329631,.67633,-.22552,.519181,.353515,.690012,-.234316,.521681,.379226,.704243,-.242032,.523129,.405901,.719396,-.249172,.523768,.433585,.734471,-.255543,.522541,.462085,.750539,-.260697,.520217,.491233,.766365,-.26501,.516293,.521094,.781677,-.268409,.509708,.551014,.797132,-.270399,.501944,.581463,.812655,-.271247,.492025,.612402,.828592,-.270708,.480424,.643798,.844044,-.268085,.465955,.67682,.857305,-.263459,.448425,.708496,.87114,-.258151,.430243,.74046,.884936,-.251171,.410578,.771583,.895772,-.243305,.38862,.802234,.906961,-.234037,.365214,.833179,.917775,-.222714,.34116,.86353,.927883,-.210175,.31572,.893557,.936617,-.196925,.289159,.922976,.943384,-.182788,.261996,.951606,.949713,-.167965,.235324,.979958,.955818,-.151109,.208408,1.00765,.961344,-.133834,.182591,1.03329,.965469,-.115987,.156958,1.0557,.968693,-.09746,.132239,1.07583,.973165,-.0778514,.106195,1.09451,.979387,-.0585067,.0797669,1.11137,.98671,-.0390409,.0530263,1.12643,.994093,-.019408,.0263163,1.14016,1.00002,540029e-9,-194487e-9,1.15299,.574483,-989066e-11,.494533,114896e-10,.574478,-249127e-9,.494528,289403e-9,.574607,-996811e-9,.494637,.00115797,.574396,-.00224241,.494458,.00260498,.574377,-.00398632,.49444,.00463102,.574386,-.00622836,.494445,.00723623,.574401,-.0089683,.494453,.010421,.574419,-.0122056,.49446,.0141859,.574459,-.0159396,.494481,.0185322,.574525,-.0201692,.49452,.0234617,.574587,-.0248924,.494547,.0289762,.574697,-.0301074,.494604,.0350797,.574853,-.0358114,.494688,.0417767,.575027,-.041999,.494772,.0490718,.575294,-.0486618,.494915,.0569728,.575733,-.0557148,.495173,.0654955,.576356,-.0630489,.495537,.0746612,.576944,-.0709285,.495836,.0844615,.57765,-.0792723,.496177,.0949142,.578491,-.0880167,.496563,.10603,.579639,-.0969462,.497096,.117841,.580989,-.10622,.497684,.130367,.582587,-.115861,.498337,.143609,.584951,-.125605,.499414,.157625,.587602,-.135608,.500518,.172413,.59076,-.145742,.501767,.187999,.594992,-.155934,.503542,.20445,.600656,-.166303,.506135,.221764,.607816,-.176681,.509542,.24002,.61522,-.187071,.51263,.258992,.623702,-.197465,.516021,.278773,.634192,-.207816,.520422,.299377,.644936,-.218183,.524073,.320802,.657888,-.2278,.528049,.34384,.670666,-.236747,.52986,.36916,.685626,-.24484,.531892,.395867,.701304,-.252071,.532727,.423488,.717727,-.258714,.532146,.452201,.733914,-.264211,.529883,.481579,.750529,-.26859,.5259,.511558,.76747,-.272046,.51999,.542042,.785189,-.274225,.513083,.572799,.800954,-.275189,.502936,.603816,.816962,-.274946,.490921,.635461,.83336,-.272695,.47684,.6676,.848143,-.268223,.459405,.70051,.861818,-.262768,.440319,.732902,.876828,-.255872,.420123,.765084,.889312,-.247703,.398379,.796391,.900412,-.238381,.374496,.827333,.912251,-.227783,.349874,.858385,.921792,-.214832,.323181,.888652,.931273,-.200949,.296624,.917763,.940295,-.186537,.269211,.947878,.946812,-.171538,.241447,.977016,.953588,-.155254,.213829,1.00501,.958841,-.137156,.186807,1.03179,.963746,-.118699,.160706,1.05502,.966468,-.0998358,.135504,1.07568,.971178,-.0805186,.109131,1.09479,.97831,-.0599348,.0818293,1.1123,.985886,-.0399661,.0545872,1.12771,.994021,-.0198682,.0269405,1.14186,1.00009,271022e-9,-12989e-8,1.15514,.538716,-990918e-11,.486732,109675e-10,.550656,-250642e-9,.497518,277412e-9,.55057,-.00100265,.497441,.00110974,.550903,-.00225672,.497733,.00249779,.550568,-.00401046,.497438,.00443906,.550574,-.00626613,.49744,.00693637,.550591,-.0090226,.497449,.00998921,.550623,-.0122795,.497469,.0135984,.550667,-.0160361,.497495,.0177654,.550724,-.0202908,.497526,.0224915,.550792,-.0250421,.497557,.0277795,.550918,-.0302878,.49763,.0336334,.551058,-.0360241,.497701,.0400573,.551276,-.0422473,.497824,.0470585,.551551,-.0489441,.497977,.0546433,.552074,-.0559596,.498312,.0628367,.552681,-.0633978,.498679,.071646,.553324,-.0713176,.499031,.0810746,.554011,-.0797268,.499365,.091129,.55488,-.0885238,.499779,.101837,.556171,-.0974417,.500444,.113239,.557498,-.106841,.501025,.125316,.559299,-.116533,.501864,.138128,.561647,-.126298,.502967,.151695,.564347,-.136388,.504129,.16604,.567863,-.146576,.505713,.181207,.572569,-.156832,.507953,.197259,.578919,-.167323,.511186,.214258,.585387,-.177712,.514042,.232038,.593134,-.188184,.517484,.250733,.603295,-.198717,.522345,.270454,.613854,-.209177,.526751,.290807,.626092,-.219644,.531595,.312202,.637868,-.229494,.534721,.334435,.652458,-.238718,.538304,.359184,.666985,-.247061,.539875,.385637,.683301,-.254652,.541042,.41328,.69998,-.261376,.540735,.441903,.717824,-.267085,.539139,.471609,.734617,-.271465,.534958,.501446,.753663,-.27528,.53032,.532571,.770512,-.277617,.522134,.563641,.787356,-.278525,.51206,.595067,.806252,-.278512,.50119,.627226,.822061,-.277023,.486791,.659402,.838959,-.273175,.470467,.692874,.85379,-.267238,.450688,.725702,.868268,-.260327,.429741,.75832,.881994,-.251946,.407223,.790189,.893885,-.242432,.383214,.821625,.905118,-.231904,.357297,.853011,.916045,-.219545,.330733,.883773,.927614,-.205378,.303916,.914435,.936005,-.190388,.275941,.944502,.944533,-.1749,.247493,.974439,.950758,-.158588,.218996,1.00286,.957078,-.141027,.191559,1.0304,.962448,-.121507,.164457,1.05466,.964993,-.102068,.138636,1.0761,.970017,-.0822598,.111861,1.09541,.97661,-.062033,.0843438,1.11317,.985073,-.0409832,.0558496,1.12911,.993515,-.020146,.0275331,1.1438,1.00006,27329e-8,-107883e-9,1.15736,.525324,-999341e-11,.498153,105385e-10,.526513,-251605e-9,.499277,265329e-9,.526517,-.00100641,.499282,.0010613,.526588,-.00226466,.499337,.00238823,.526539,-.0040255,.499302,.00424535,.526547,-.00628954,.499306,.00663364,.526561,-.00905628,.499313,.00955337,.526593,-.0123253,.499334,.0130054,.526642,-.0160957,.499365,.0169911,.5267,-.0203661,.499396,.0215122,.526792,-.0251347,.499451,.0265718,.526904,-.0303985,.499511,.0321732,.527079,-.0361554,.499617,.0383231,.527285,-.0423982,.499731,.045026,.527602,-.0491121,.499924,.0522936,.528166,-.0561127,.500306,.0601528,.52879,-.0635988,.5007,.0686059,.529421,-.071581,.501048,.0776518,.530144,-.0799854,.501421,.0873148,.531062,-.0888032,.501884,.0976084,.532374,-.0977643,.50259,.108588,.533828,-.107197,.50329,.120234,.53581,-.116887,.504312,.132602,.538063,-.126755,.505365,.145721,.5409,-.136819,.506668,.159617,.544882,-.147117,.508731,.174369,.550238,-.157446,.511601,.190028,.556038,-.167988,.514431,.206587,.563031,-.178364,.517808,.224046,.571543,-.189007,.521937,.242503,.582255,-.199546,.527415,.261977,.59272,-.210084,.531682,.282162,.605648,-.220448,.537123,.303426,.61785,-.230593,.540664,.325323,.632223,-.240238,.544467,.348993,.648819,-.24887,.547594,.375462,.665825,-.256657,.54912,.403024,.683389,-.263711,.549294,.431773,.701495,-.269666,.547649,.461494,.719197,-.274169,.543786,.491623,.737906,-.278124,.538644,.522994,.756652,-.280632,.531057,.554775,.775279,-.281741,.521972,.586441,.792688,-.281652,.509613,.618596,.811894,-.280345,.496497,.651462,.827938,-.277128,.47968,.684023,.844837,-.271646,.460688,.718024,.859239,-.264397,.438872,.751207,.874088,-.256144,.41577,.784232,.887693,-.246311,.391369,.816191,.899402,-.235497,.365872,.847828,.910973,-.223631,.338618,.87934,.92204,-.209874,.310803,.910325,.930987,-.194265,.281802,.940695,.94,-.178125,.252836,.970958,.948018,-.161479,.224239,1.00078,.955141,-.144038,.195857,1.0288,.960513,-.124915,.168487,1.05371,.963964,-.104284,.141495,1.07596,.968713,-.0838732,.114437,1.09628,.975524,-.0635579,.0863105,1.11448,.98431,-.042291,.0574774,1.13069,.992916,-.0209131,.0284343,1.14568,.999926,743097e-9,-379265e-9,1.15955,.501042,-998428e-11,.498726,100306e-10,.502992,-252112e-9,.500665,253283e-9,.502417,-.00100791,.500092,.00101259,.502965,-.00226919,.500621,.00227978,.502318,-.00403109,.499994,.00405011,.502333,-.00629832,.500005,.00632868,.502362,-.00906907,.500027,.00911446,.502369,-.0123423,.500023,.0124078,.50243,-.0161178,.500066,.016211,.502493,-.0203937,.500103,.0205256,.502592,-.0251684,.500166,.0253548,.502707,-.0304389,.50023,.0307029,.502881,-.0362015,.500335,.0365753,.503124,-.0424507,.500488,.0429798,.503443,-.0491582,.500686,.0499268,.504083,-.0561476,.501155,.0574541,.504668,-.0636846,.501524,.0655408,.505319,-.0716834,.501904,.0742072,.50609,-.0800925,.502321,.0834699,.507122,-.0888425,.502896,.0933603,.508414,-.097855,.503603,.10391,.509955,-.107304,.504416,.115113,.512061,-.116921,.505565,.127054,.514419,-.12689,.506732,.139709,.517529,-.136934,.508338,.153173,.522085,-.147327,.510987,.167528,.526986,-.157612,.513527,.182708,.533122,-.168213,.516717,.198881,.540807,-.178688,.520832,.215986,.550687,-.189511,.52632,.234335,.560567,-.199998,.531009,.253375,.571698,-.210652,.535839,.273499,.584364,-.220917,.541091,.294355,.599066,-.23137,.546875,.316525,.614148,-.241206,.551306,.339671,.631157,-.250379,.555187,.36531,.647919,-.258397,.556595,.392767,.666112,-.265528,.556949,.421397,.686158,-.271827,.556617,.451433,.704838,-.27674,.552975,.482131,.723957,-.280733,.547814,.513458,.74262,-.283359,.53997,.545446,.762009,-.284541,.530422,.57775,.781314,-.284507,.518546,.610434,.799116,-.283309,.504178,.643178,.817604,-.280378,.48843,.676248,.83459,-.275619,.469457,.709698,.850974,-.26856,.447698,.744245,.866747,-.260094,.424791,.777695,.881412,-.249929,.399913,.810392,.8936,-.239137,.37308,.842872,.905943,-.226818,.345705,.874677,.916408,-.213699,.31706,.906257,.927215,-.198428,.288444,.936881,.935625,-.181643,.258329,.96795,.944076,-.164386,.228488,.998216,.951229,-.146339,.199763,1.02689,.958793,-.127709,.172153,1.0535,.963219,-.107244,.144989,1.07646,.967562,-.0857764,.11685,1.09675,.974866,-.0645377,.0880571,1.11576,.983353,-.0431732,.0587352,1.13227,.992503,-.0218356,.0294181,1.1478,1.00003,605203e-9,-231013e-9,1.16207,.482935,-101177e-10,.504695,968142e-11,.477554,-251521e-9,.499071,240676e-9,.477904,-.00100683,.499436,96342e-8,.478368,-.00226636,.499899,.0021687,.477977,-.00402719,.499513,.00385384,.477993,-.00629226,.499525,.0060221,.478011,-.00906011,.499536,.00867289,.478051,-.0123305,.499566,.0118074,.478089,-.016102,.499587,.0154269,.478171,-.0203736,.499645,.0195341,.478254,-.025143,.499692,.0241318,.47839,-.0304071,.499779,.0292247,.478588,-.0361631,.499911,.0348196,.478812,-.0424023,.500046,.0409231,.479208,-.0490724,.500326,.047552,.479841,-.0560722,.500805,.0547377,.480392,-.0636125,.501152,.0624607,.481068,-.0716134,.501561,.0707473,.481898,-.0800062,.502054,.0796118,.483022,-.0886568,.502728,.0890974,.484332,-.0977553,.503479,.0992099,.486126,-.107173,.504546,.10999,.488066,-.11677,.50557,.121476,.490521,-.126725,.506849,.133672,.494232,-.136793,.50911,.146731,.498302,-.147116,.511345,.160577,.503565,-.157446,.514344,.175335,.510902,-.168121,.518824,.191207,.519263,-.178799,.523666,.208058,.528204,-.189407,.528296,.225875,.538854,-.200145,.533724,.244782,.551278,-.210701,.539833,.264753,.565222,-.221303,.546131,.285745,.579403,-.231688,.551496,.307592,.595469,-.241718,.556809,.330582,.610929,-.250992,.559641,.354995,.629433,-.259602,.562379,.382471,.648504,-.267038,.563676,.411126,.66756,-.273388,.562092,.440924,.689143,-.278788,.560807,.472118,.709056,-.282783,.555701,.503774,.729855,-.285836,.548698,.536364,.748954,-.287078,.538544,.56895,.768373,-.287133,.526711,.601991,.78827,-.285839,.512511,.635403,.807465,-.283238,.496323,.668797,.825194,-.27906,.477638,.702584,.842203,-.272286,.456253,.736393,.857749,-.263854,.432412,.77096,.874799,-.253943,.407806,.80489,.887497,-.24237,.38033,.83771,.89966,-.230278,.352446,.870376,.911753,-.21646,.323268,.902256,.923011,-.202071,.294314,.933306,.932375,-.185519,.264104,.965177,.940537,-.167604,.234035,.996303,.948904,-.149068,.20412,1.0261,.955263,-.129539,.175431,1.05304,.960303,-.109932,.148116,1.07617,.965512,-.0880572,.119693,1.09742,.973466,-.0660548,.0901619,1.11721,.98284,-.0439228,.0599875,1.13436,.992216,-.0219588,.0298975,1.15006,.999946,119402e-9,-208547e-10,1.16471,.447827,-100414e-10,.491543,914833e-11,.454778,-251257e-9,.499172,22891e-8,.453519,-.00100342,.497787,914184e-9,.45357,-.00225776,.497847,.00205701,.453578,-.00401371,.497855,.00365705,.45357,-.00627107,.497841,.00571453,.453598,-.00902968,.497864,.00823019,.453627,-.0122888,.497882,.0112049,.453684,-.0160475,.497923,.0146405,.453764,-.0203044,.49798,.0185394,.453866,-.0250576,.498049,.0229054,.453996,-.0303028,.49813,.0277424,.454196,-.0360379,.498267,.0330587,.454457,-.0422521,.498445,.0388613,.454926,-.0488393,.498812,.0451767,.455525,-.0558653,.499272,.0520153,.456074,-.0633772,.499625,.0593754,.456752,-.0713606,.500049,.0672751,.457648,-.07971,.500615,.0757447,.458849,-.0883032,.501399,.0848231,.46029,-.0974095,.502293,.0945135,.462,-.106729,.503301,.104848,.464121,-.116354,.504533,.115884,.466889,-.126214,.506172,.127652,.470744,-.136324,.508667,.14024,.47488,-.146595,.510995,.153673,.480845,-.157027,.514832,.168053,.488262,-.167658,.519506,.183508,.496547,-.178343,.524347,.199948,.506254,-.188916,.52983,.217503,.517961,-.199975,.536357,.236272,.531484,-.210624,.543641,.256096,.545496,-.221227,.550048,.277085,.559497,-.231568,.555076,.298615,.575752,-.241698,.560541,.321547,.591999,-.251172,.564156,.345602,.610654,-.260178,.567607,.371851,.630484,-.268094,.56923,.40076,.651807,-.274661,.569779,.430801,.67239,-.280331,.566791,.461939,.693024,-.284501,.562007,.493854,.715473,-.287852,.555791,.526992,.736323,-.28929,.546345,.560102,.755771,-.289405,.534,.593543,.775424,-.2881,.519114,.627256,.795447,-.285562,.502543,.661464,.815319,-.281416,.484773,.695206,.831769,-.275523,.463445,.729044,.849464,-.267516,.440269,.764069,.866775,-.257584,.415049,.799089,.881252,-.245817,.388049,.831948,.894209,-.233127,.35889,.865526,.906922,-.219579,.329915,.89818,.919686,-.204491,.300441,.930013,.929044,-.188962,.269445,.962061,.938393,-.171079,.238402,.994214,.94661,-.15199,.208204,1.02533,.953095,-.131953,.178653,1.0529,.958644,-.111233,.150684,1.0771,.963925,-.0903098,.122359,1.09855,.971995,-.0680505,.0923342,1.11874,.981658,-.0448512,.0614195,1.13635,.991649,-.0221931,.0303582,1.15238,.999985,393403e-9,-111086e-9,1.16772,.396806,-971563e-11,.457671,842355e-11,.429186,-249421e-9,.495017,21625e-8,.429324,-998052e-9,.495173,865322e-9,.429175,-.00224487,.494999,.00194637,.429129,-.00399041,.494952,.00346004,.429153,-.00623476,.494974,.00540684,.429168,-.0089773,.494983,.00778714,.429207,-.0122175,.495012,.0106022,.429257,-.0159542,.495047,.0138535,.429338,-.0201864,.495106,.0175443,.429431,-.0249104,.495165,.0216774,.429587,-.0301252,.495279,.0262594,.429796,-.0358249,.495432,.0312968,.430065,-.0419972,.495621,.0367985,.430588,-.0485144,.496061,.042798,.43113,-.0555028,.496472,.0492914,.431743,-.0629852,.496904,.0562907,.432448,-.0709256,.497369,.0638056,.433414,-.0791942,.498032,.071885,.434638,-.0877346,.498854,.0805517,.43611,-.0968056,.499812,.0898047,.437859,-.106002,.500891,.0997142,.440017,-.115648,.502198,.110289,.443236,-.125427,.504389,.121644,.44697,-.135492,.506809,.133769,.451689,-.145746,.509858,.146787,.45811,-.156219,.514247,.160793,.465305,-.166834,.518816,.175791,.474085,-.177546,.524331,.191906,.484808,-.188262,.53104,.209199,.49732,-.199346,.538511,.227825,.509693,-.209951,.544554,.247269,.524367,-.220533,.551616,.267978,.539228,-.231082,.557368,.289672,.55644,-.241342,.563782,.31268,.574204,-.250964,.568851,.33651,.593388,-.260306,.57312,.362219,.613358,-.268667,.574916,.390322,.634512,-.275591,.575053,.420478,.65563,-.281328,.572404,.451614,.678265,-.285948,.568893,.484112,.70011,-.289408,.561878,.517348,.723005,-.291328,.55359,.551355,.743744,-.291418,.541099,.585109,.763949,-.290252,.526489,.619487,.784186,-.287648,.509496,.65404,.804304,-.283782,.491484,.688649,.823629,-.278067,.470517,.723133,.84094,-.270588,.44705,.757163,.857852,-.261188,.421252,.792816,.874934,-.249313,.394191,.827248,.888709,-.236492,.365359,.861074,.902589,-.222185,.336016,.894417,.914201,-.207314,.30527,.926825,.925978,-.191146,.274532,.9595,.93512,-.174135,.243393,.991583,.943656,-.155231,.212414,1.02356,.951719,-.134403,.182005,1.05239,.957164,-.113023,.153043,1.07754,.962656,-.0914493,.124186,1.09984,.970695,-.0694179,.0941654,1.12,.980749,-.0466199,.0629671,1.13849,.991205,-.0227032,.0311146,1.15494,.999884,632388e-9,-254483e-9,1.1706,.379821,-957289e-11,.460637,789337e-11,.405188,-247483e-9,.491396,204064e-9,.404796,-989434e-9,.490914,815853e-9,.40483,-.00222607,.490949,.00183559,.40473,-.00395723,.49084,.00326332,.404731,-.00618287,.490836,.00509945,.404768,-.00890258,.490871,.00734463,.404791,-.0121156,.490883,.00999992,.404857,-.0158214,.490938,.0130676,.404943,-.0200178,.491004,.0165503,.405059,-.0247027,.491093,.0204521,.405213,-.0298729,.491205,.0247788,.405399,-.0355226,.491333,.0295373,.405731,-.0416352,.491604,.034741,.406303,-.0480807,.492116,.0404255,.406814,-.0550458,.492506,.0465732,.407404,-.0624652,.492926,.0532058,.408149,-.0702958,.493442,.0603442,.409128,-.0784623,.494136,.0680297,.410408,-.087007,.495054,.0762786,.411813,-.0959639,.495962,.0851046,.413735,-.105075,.497257,.0945878,.416137,-.114646,.498882,.104725,.41934,-.124394,.501132,.11563,.423326,-.134328,.503883,.127325,.428419,-.14458,.50747,.139911,.43484,-.154979,.511964,.153481,.442641,-.165628,.517328,.168114,.452511,-.176365,.524258,.183995,.463473,-.187298,.531248,.200953,.475564,-.198244,.538367,.219176,.488664,-.208938,.545175,.238514,.504073,-.219599,.553227,.259129,.520832,-.230378,.560653,.280997,.538455,-.240703,.567523,.303821,.55709,-.250548,.573287,.327948,.576646,-.259964,.577795,.353362,.596705,-.268721,.580077,.380336,.618053,-.276054,.58018,.4101,.640303,-.282176,.578747,.44161,.662365,-.286931,.574294,.474106,.684542,-.290521,.567035,.507549,.707984,-.292672,.558687,.541853,.730913,-.293189,.547606,.576581,.752948,-.292199,.533471,.61172,.773452,-.289508,.516395,.646339,.794715,-.285716,.497873,.682131,.814251,-.280051,.476845,.716396,.833057,-.272873,.453449,.751503,.84959,-.263982,.427857,.786085,.867022,-.252745,.400335,.821355,.882277,-.239655,.371304,.85646,.895375,-.225386,.340397,.890828,.909347,-.209587,.310005,.923532,.921885,-.193433,.2796,.956419,.932127,-.176135,.247276,.989445,.941869,-.157872,.216186,1.02221,.949735,-.137577,.185602,1.05195,.956617,-.115285,.155767,1.07822,.961974,-.0928418,.126103,1.10149,.96972,-.0700592,.0956758,1.12207,.98012,-.0474671,.0643269,1.1408,.990825,-.0238113,.0320863,1.1577,.999876,381574e-9,-812203e-10,1.17403,.367636,-961342e-11,.469176,753287e-11,.380377,-244772e-9,.485434,191797e-9,.380416,-978857e-9,.485475,767015e-9,.380376,-.00220165,.485435,.00172522,.380419,-.00391408,.485487,.00306734,.380438,-.00611549,.485505,.00479332,.380462,-.00880558,.485525,.00690391,.380496,-.0119837,.485551,.00940039,.38056,-.0156487,.485605,.0122848,.38064,-.0197988,.485666,.0155601,.380767,-.0244324,.48577,.0192313,.380909,-.0295444,.485871,.0233032,.381142,-.0351321,.48606,.0277861,.381472,-.0411535,.486336,.0326939,.382015,-.0475408,.486833,.0380565,.382523,-.0544395,.487231,.0438615,.383129,-.061784,.487683,.0501332,.383952,-.0695085,.488313,.0568996,.38498,-.0775819,.489077,.0641952,.386331,-.0860443,.490113,.0720324,.387788,-.0948406,.491099,.0804379,.389808,-.103899,.492566,.0894899,.39252,-.113313,.494601,.0992098,.395493,-.123007,.496619,.109641,.399826,-.132859,.499912,.120919,.405341,-.143077,.504061,.133107,.411932,-.153465,.508905,.146263,.420591,-.164108,.515482,.160544,.43101,-.174893,.523191,.176123,.441881,-.185839,.53026,.192757,.453919,-.196633,.537295,.210535,.468715,-.207611,.546156,.229886,.485182,-.218517,.555173,.250543,.501926,-.229249,.562728,.27221,.51785,-.239481,.567494,.294892,.536947,-.249395,.573889,.318987,.557115,-.259,.578831,.344348,.577966,-.268075,.582055,.371223,.599489,-.276115,.583307,.399834,.62479,-.282523,.583902,.431415,.647504,-.287663,.57953,.464301,.670601,-.291538,.573103,.498123,.693539,-.293842,.563731,.532662,.717385,-.294681,.553169,.567925,.741533,-.293717,.539908,.603502,.762142,-.291156,.521902,.639074,.783014,-.28719,.502815,.674439,.805158,-.281773,.482598,.710497,.823646,-.274682,.458949,.7456,.841879,-.266184,.433129,.781085,.859515,-.255682,.406064,.816,.875335,-.242849,.376509,.851074,.890147,-.228329,.345502,.886473,.903144,-.212491,.31428,.920751,.916618,-.195695,.282994,.954606,.927953,-.178267,.251091,.988402,.937414,-.159549,.219107,1.02141,.946823,-.140022,.18896,1.05167,.954651,-.118154,.158667,1.07819,.959955,-.0946636,.128808,1.1025,.96858,-.0711792,.0973787,1.12391,.97938,-.0475046,.0650965,1.14322,.990498,-.024059,.0326267,1.16077,.999844,-512408e-10,112444e-9,1.17727,.316912,-934977e-11,.425996,695559e-11,.356423,-241372e-9,.479108,179562e-9,.356272,-965292e-9,.478897,71811e-8,.356262,-.00217182,.478894,.00161574,.356265,-.00386092,.478895,.00287261,.356278,-.0060324,.478905,.00448907,.356293,-.00868565,.478914,.00646572,.356346,-.0118207,.478965,.00880438,.356395,-.0154355,.479001,.0115066,.356484,-.019529,.479075,.0145762,.356609,-.0240991,.47918,.018018,.356766,-.0291413,.479305,.0218379,.357009,-.0346498,.479512,.0260454,.357424,-.0405462,.479909,.0306657,.357899,-.0468825,.480337,.0357054,.358424,-.0536887,.480771,.0411728,.359041,-.0609416,.481242,.0470841,.359903,-.0685239,.481943,.0534831,.360932,-.0764883,.482741,.0603795,.362196,-.0848364,.483688,.0678028,.363847,-.0935002,.484947,.0758086,.365972,-.102471,.486588,.0844173,.368741,-.111751,.488787,.0937199,.372146,-.121334,.491405,.103732,.377114,-.131147,.495604,.114608,.38226,-.141213,.499436,.126345,.389609,-.151632,.505334,.139116,.397925,-.162073,.51168,.152995,.407824,-.172819,.518876,.168071,.420014,-.183929,.527639,.184495,.434266,-.195032,.537588,.20232,.447352,-.205792,.544379,.221189,.463726,-.216704,.553422,.241616,.481406,-.227531,.562074,.263298,.498707,-.238017,.568227,.286116,.518039,-.247936,.574473,.3101,.538277,-.257437,.579191,.335401,.561166,-.266829,.584807,.362246,.583189,-.275329,.586476,.390609,.606024,-.28234,.585578,.420998,.632419,-.287924,.584496,.454357,.656128,-.291972,.577766,.488233,.679953,-.29456,.56875,.523248,.704654,-.295816,.558388,.559168,.729016,-.295157,.544826,.595326,.752062,-.292779,.528273,.631864,.773138,-.288681,.508482,.667793,.794869,-.283358,.487341,.704035,.815101,-.27608,.46354,.739925,.834212,-.26767,.438672,.775539,.852368,-.257397,.411239,.810895,.870207,-.245689,.3829,.846472,.884063,-.231452,.351496,.881788,.898284,-.215561,.31895,.917438,.912964,-.198208,.287367,.952422,.924666,-.180426,.254487,.987551,.934429,-.161525,.222226,1.02142,.943485,-.141197,.191143,1.05218,.9521,-.120085,.161112,1.07937,.957876,-.0975881,.130982,1.10403,.966943,-.0726842,.0990553,1.12616,.978313,-.0483705,.0662818,1.14619,.990048,-.0239072,.0329243,1.16413,.999984,461885e-9,-772859e-10,1.18099,.321287,-935049e-11,.455413,659662e-11,.332595,-237513e-9,.471437,167562e-9,.332729,-949964e-9,.471618,670192e-9,.332305,-.00213618,.471028,.00150712,.332326,-.00379765,.471055,.00267959,.332344,-.00593353,.471072,.00418751,.332356,-.00854349,.471077,.00603172,.332403,-.0116268,.471121,.00821362,.332461,-.0151824,.47117,.0107357,.332552,-.0192088,.471251,.0136014,.332657,-.0237024,.47133,.0168152,.332835,-.0286615,.471487,.0203853,.333083,-.0340765,.471708,.0243212,.333547,-.0398563,.47219,.0286518,.333989,-.0460916,.472587,.0333763,.334532,-.0527897,.473054,.0385084,.335167,-.0599284,.473568,.0440638,.33608,-.0673514,.474362,.0500962,.337146,-.0752237,.475231,.0566022,.338462,-.083418,.476282,.0636272,.34014,-.0919382,.477615,.0712153,.342341,-.100741,.479404,.079417,.345088,-.109905,.481618,.0882631,.349049,-.119369,.485081,.0978851,.353939,-.129033,.489317,.108336,.359893,-.139038,.494309,.119698,.366945,-.149411,.499983,.132024,.375814,-.159843,.507185,.145558,.387112,-.170664,.516392,.160433,.40023,-.181897,.526519,.176648,.412555,-.192785,.53423,.193922,.427023,-.203663,.542741,.212662,.443685,-.214695,.552066,.232944,.461499,-.225561,.560762,.254495,.480975,-.236257,.569421,.277531,.501,-.24639,.576101,.301724,.521691,-.256101,.581493,.327112,.543478,-.265289,.585221,.353917,.566094,-.273938,.587614,.381941,.589578,-.281679,.587991,.41172,.614583,-.287655,.585928,.444148,.641813,-.292228,.582092,.478617,.666189,-.295172,.57398,.51397,.690475,-.29648,.561676,.550118,.715543,-.296203,.548758,.586933,.740405,-.293999,.532792,.62384,.762183,-.28998,.512735,.660723,.786069,-.28478,.492402,.69807,.806812,-.277568,.469058,.734422,.826987,-.268951,.443017,.770946,.844588,-.259049,.415501,.80699,.863725,-.2471,.387328,.842107,.879137,-.234157,.356108,.878078,.894634,-.218719,.324315,.914058,.909162,-.201293,.291813,.949922,.92072,-.18267,.258474,.985337,.93158,-.163212,.225593,1.0205,.941238,-.142771,.193986,1.05273,.949293,-.120956,.163392,1.08075,.956226,-.0985743,.132934,1.10559,.96546,-.075118,.101255,1.12823,.977403,-.0497921,.0675441,1.149,.989648,-.0241574,.0334681,1.16765,1.00001,5762e-7,-184807e-9,1.18519,.303474,-916603e-11,.4542,61243e-10,.308894,-232869e-9,.462306,155592e-9,.309426,-931661e-9,.463093,622499e-9,.308643,-.0020949,.461933,.00139979,.308651,-.0037242,.461941,.00248874,.308662,-.00581873,.46195,.00388933,.308687,-.00837818,.461974,.00560247,.308728,-.0114016,.462011,.00762948,.308789,-.0148884,.462067,.00997326,.308882,-.0188369,.462151,.0126375,.309007,-.0232436,.462263,.0156271,.30918,-.0281054,.462417,.0189498,.309442,-.0334065,.462667,.0226167,.309901,-.0390589,.463162,.0266614,.310331,-.0452042,.463555,.0310715,.310858,-.0517735,.464019,.0358698,.311576,-.0587359,.464669,.0410848,.312436,-.0660383,.465406,.0467453,.313526,-.0737266,.466339,.0528718,.314903,-.0817574,.467504,.0595039,.316814,-.090167,.469226,.0666888,.318965,-.0987555,.470981,.0744658,.322077,-.107792,.473814,.082912,.325947,-.117098,.477241,.0920846,.331008,-.126602,.48184,.102137,.337893,-.136619,.488334,.113135,.345106,-.146838,.494415,.12511,.355111,-.157357,.503275,.138356,.365095,-.167955,.510966,.152686,.378344,-.179157,.521508,.16856,.391599,-.190143,.530455,.18561,.407786,-.20123,.541275,.204308,.425294,-.212456,.551784,.224623,.444021,-.223568,.561493,.246172,.463418,-.234154,.569886,.268979,.484077,-.244546,.577116,.293411,.505513,-.254301,.582914,.318936,.527672,-.263564,.587208,.345856,.550565,-.272332,.589277,.374054,.573656,-.280011,.588426,.403276,.59827,-.286924,.587504,.43474,.624731,-.291994,.583401,.468767,.652396,-.295159,.576997,.504411,.67732,-.296954,.565863,.54114,.703147,-.296877,.552316,.57816,.728715,-.295147,.536773,.616124,.752448,-.291275,.51771,.653885,.775169,-.285905,.496087,.691537,.799307,-.279064,.474232,.729251,.819482,-.270294,.447676,.766267,.837659,-.260032,.419656,.802616,.856903,-.248497,.391328,.838583,.873325,-.235252,.360285,.874711,.889788,-.221126,.329215,.91077,.904486,-.204304,.296392,.94653,.917711,-.185562,.262159,.983828,.928969,-.165635,.229142,1.01955,.939707,-.14442,.19673,1.05317,.948167,-.122147,.165095,1.0823,.955222,-.099098,.13451,1.10791,.964401,-.0755332,.102476,1.1312,.976605,-.0513817,.0689667,1.15218,.989085,-.0258499,.034506,1.17129,.999908,617773e-9,-271268e-9,1.18961,.285803,-905752e-11,.452348,572272e-11,.284689,-22732e-8,.450581,143626e-9,.285263,-910214e-9,.451482,575099e-9,.285302,-.00204784,.451553,.00129395,.285318,-.00364057,.451574,.0023006,.28533,-.00568813,.451585,.00359547,.285361,-.00819001,.451618,.00517934,.285397,-.0111458,.45165,.007054,.285447,-.0145536,.451688,.00922167,.285527,-.0184127,.451758,.0116869,.285688,-.0227207,.451929,.0144555,.28584,-.0274712,.452055,.0175341,.286136,-.0326278,.452369,.0209406,.286574,-.0381792,.452853,.0246965,.287012,-.0441879,.453272,.0287996,.287542,-.0506096,.453752,.033268,.288299,-.0573634,.454488,.0381504,.289186,-.0645458,.455294,.0434447,.290302,-.0720405,.456301,.0491973,.291776,-.0799046,.457648,.0554453,.29372,-.088117,.459483,.0622311,.296052,-.0965328,.461571,.0695992,.299563,-.105409,.465085,.077658,.30335,-.114553,.468506,.0864176,.309167,-.123917,.474423,.0961078,.31529,-.13381,.47995,.106643,.324163,-.144021,.488592,.118322,.333272,-.154382,.496461,.131133,.344224,-.165015,.50562,.145208,.357733,-.176168,.516719,.16073,.373046,-.187468,.528513,.177807,.38788,-.198488,.537713,.196072,.405133,-.209545,.547999,.21605,.423845,-.220724,.55759,.237484,.443777,-.231518,.566246,.26039,.464824,-.242035,.574326,.284835,.486635,-.251898,.58037,.310518,.51012,-.261304,.58568,.337678,.535301,-.270384,.590197,.366242,.559193,-.27841,.590569,.395873,.583544,-.285325,.588161,.426857,.608834,-.291113,.584249,.459477,.635753,-.294882,.57763,.494734,.664367,-.297088,.569479,.532023,.689688,-.297364,.555064,.569629,.715732,-.295949,.539522,.608124,.741307,-.292259,.521613,.646231,.764949,-.287063,.49969,.684938,.788599,-.28012,.476747,.723548,.81048,-.27153,.45116,.761135,.831372,-.261289,.424101,.798916,.850092,-.249559,.39443,.835952,.867777,-.236348,.363849,.871606,.884632,-.221569,.332477,.907843,.90047,-.20618,.300667,.944187,.914524,-.188771,.266552,.981371,.926892,-.168362,.232349,1.01841,.937951,-.146761,.199359,1.05308,.947236,-.123813,.1675,1.0839,.954367,-.099984,.136166,1.11047,.963907,-.0759278,.103808,1.13414,.976218,-.0511367,.0697061,1.15575,.988772,-.0267415,.0352529,1.17531,.999888,-520778e-9,289926e-9,1.19389,.263546,-883274e-11,.441896,526783e-11,.262352,-221849e-9,.439889,132311e-9,.262325,-886683e-9,.439848,528824e-9,.26228,-.00199476,.439765,.00118975,.262372,-.00354671,.439922,.00211568,.26239,-.00554141,.439941,.00330652,.262412,-.00797888,.439961,.00476346,.262453,-.0108584,.440002,.00648818,.262528,-.0141788,.440085,.0084835,.262615,-.017938,.440166,.0107533,.262744,-.0221346,.440291,.0133044,.262939,-.026762,.440493,.0161445,.263277,-.0317573,.440889,.0192974,.26368,-.0371832,.441338,.0227699,.264106,-.0430371,.441753,.0265698,.264624,-.0493035,.442227,.0307178,.265378,-.0558669,.442985,.0352616,.266253,-.0628718,.443795,.0401968,.267478,-.0701569,.445008,.04559,.269062,-.077845,.446599,.0514539,.270926,-.0857941,.448349,.0578382,.273693,-.0940773,.451221,.0648363,.276746,-.102704,.454097,.0724389,.281693,-.111735,.459517,.0808744,.287335,-.121004,.46531,.0901551,.29448,-.130734,.472605,.100371,.30257,-.140777,.480251,.111644,.312465,-.15111,.489444,.124111,.324856,-.16189,.500919,.137979,.33774,-.172946,.511317,.153163,.35255,-.184152,.522684,.169817,.367786,-.19522,.53248,.187886,.385474,-.20632,.543326,.207634,.404976,-.217744,.554109,.229165,.425203,-.228691,.563395,.252068,.446704,-.239299,.571565,.276471,.468951,-.249348,.577935,.302323,.493487,-.258933,.584309,.329882,.517861,-.268009,.58773,.358525,.543309,-.276238,.589612,.388585,.569704,-.28356,.589294,.419787,.594871,-.289497,.585137,.452114,.622555,-.294452,.580356,.486466,.651167,-.296918,.57185,.523079,.677332,-.297647,.558428,.5611,.703718,-.296321,.542232,.599592,.730262,-.293339,.524541,.639138,.754304,-.288036,.502691,.677978,.778051,-.281018,.479212,.716537,.801557,-.272414,.454071,.75586,.822559,-.262419,.425952,.794477,.843051,-.250702,.397313,.832664,.86232,-.237264,.366534,.869876,.879044,-.222716,.334816,.906973,.896362,-.206827,.303143,.943558,.910342,-.189659,.269699,.979759,.924119,-.171108,.236411,1.01718,.935374,-.149579,.202224,1.05289,.944295,-.126295,.16989,1.08496,.952227,-.101511,.138089,1.11256,.962041,-.0766392,.105053,1.1375,.97528,-.0511967,.070329,1.15983,.988476,-.025463,.0351268,1.17987,.999962,286808e-10,145564e-10,1.19901,.227089,-841413e-11,.404216,472707e-11,.239725,-215083e-9,.426708,120833e-9,.239904,-860718e-9,.427028,483555e-9,.239911,-.00193661,.427039,.00108806,.239914,-.00344276,.42704,.00193457,.239933,-.00537907,.427064,.00302363,.239944,-.00774482,.427065,.00435604,.239993,-.01054,.427122,.00593398,.240052,-.0137626,.427179,.00775987,.240148,-.0174115,.427279,.00983854,.240278,-.021484,.42741,.0121763,.240472,-.0259729,.427618,.0147827,.240839,-.0308131,.428086,.0176837,.241201,-.0360893,.428482,.0208775,.241626,-.0417723,.428907,.0243821,.242207,-.0478337,.42952,.0282228,.24298,-.0542199,.430332,.0324333,.243881,-.0610015,.431222,.0370252,.245123,-.0680874,.432512,.0420535,.24667,-.0755482,.434088,.0475414,.248779,-.0832873,.436323,.0535542,.251665,-.0913546,.439509,.0601716,.255305,-.0998489,.443478,.0674282,.260049,-.108576,.448713,.0754673,.266192,-.117754,.455524,.084339,.273158,-.127294,.4627,.0941683,.282131,-.137311,.472068,.10515,.293332,-.147736,.483565,.117402,.304667,-.158357,.493702,.130824,.317785,-.169274,.504708,.145724,.333245,-.180595,.517107,.16215,.349843,-.191892,.528849,.180149,.367944,-.203168,.540301,.199746,.387579,-.214443,.551514,.221047,.408247,-.225624,.560906,.243981,.43014,-.236422,.56959,.268513,.452669,-.24654,.576098,.294409,.476196,-.256157,.580925,.322002,.501157,-.265289,.584839,.351052,.527632,-.273671,.587614,.3812,.555754,-.281254,.589119,.412994,.581682,-.287448,.585204,.445498,.608196,-.292614,.579006,.479505,.635661,-.296068,.571297,.514643,.664999,-.297395,.560855,.552213,.691039,-.296645,.544525,.591365,.7179,-.293785,.526535,.630883,.744059,-.289089,.50545,.670932,.76863,-.282239,.482514,.710904,.793273,-.273688,.457246,.750259,.814731,-.26328,.428872,.78948,.835603,-.251526,.399384,.828597,.85489,-.238339,.368811,.866892,.872828,-.223607,.336617,.90563,.889462,-.207538,.303997,.943538,.904929,-.190297,.270812,.980591,.919101,-.172034,.237453,1.01935,.930536,-.152058,.204431,1.05498,.941223,-.129515,.172495,1.08717,.94982,-.104263,.140175,1.11551,.960592,-.0781944,.106465,1.14098,.974629,-.051688,.0711592,1.16418,.98811,-.0253929,.0354432,1.18465,1.00004,804378e-9,-330876e-9,1.20462,.214668,-821282e-11,.406619,433582e-11,.218053,-208144e-9,.413025,109887e-9,.217987,-832212e-9,.412901,439362e-9,.217971,-.00187246,.412876,988623e-9,.217968,-.00332855,.41286,.00175772,.217985,-.00520055,.412882,.00274729,.218014,-.00748814,.412916,.00395842,.218054,-.0101901,.412957,.00539274,.218106,-.0133057,.413005,.00705348,.218217,-.0168342,.413139,.00894581,.218338,-.0207707,.413258,.0110754,.21855,-.0251001,.413509,.0134551,.218913,-.0297861,.413992,.0161081,.219265,-.0348956,.414383,.0190307,.219696,-.0403909,.414839,.0222458,.220329,-.0462003,.415567,.025792,.220989,-.0524208,.41621,.0296637,.222027,-.058948,.417385,.0339323,.223301,-.0658208,.418779,.0386055,.224988,-.0730347,.420665,.0437355,.227211,-.0805274,.423198,.0493844,.230131,-.088395,.426566,.0556135,.233908,-.0966208,.43091,.0624829,.239092,-.105223,.437148,.0701636,.245315,-.11424,.444302,.0786949,.253166,-.12368,.453262,.0882382,.262374,-.133569,.463211,.0988682,.273145,-.143836,.474271,.110727,.285512,-.154577,.4863,.123945,.299512,-.165501,.498817,.138581,.314287,-.176698,.510341,.154676,.331083,-.188066,.522583,.172459,.349615,-.199597,.534879,.191979,.369318,-.210843,.546083,.21309,.390377,-.222068,.5562,.235998,.412411,-.233059,.564704,.260518,.435715,-.24357,.572314,.286795,.461196,-.253356,.579395,.314559,.485587,-.262362,.581985,.343581,.511908,-.270895,.584347,.374367,.539798,-.278452,.58505,.406015,.567974,-.284877,.583344,.439168,.594303,-.290124,.577348,.473005,.622951,-.294183,.570751,.508534,.652404,-.296389,.561541,.544764,.679291,-.296605,.546426,.582927,.706437,-.294095,.528599,.622681,.734485,-.28978,.508676,.663567,.758841,-.283363,.484768,.704092,.78537,-.275015,.460434,.745101,.807315,-.264689,.432166,.784712,.8271,-.252597,.401807,.824241,.849191,-.239154,.371458,.863803,.867046,-.224451,.338873,.903063,.8852,-.208342,.306175,.942763,.901771,-.190684,.272759,.981559,.915958,-.172105,.239306,1.02048,.928046,-.152214,.206071,1.05765,.939961,-.130247,.17367,1.08999,.948711,-.10672,.142201,1.11829,.959305,-.0808688,.108454,1.14467,.973009,-.0539145,.0728109,1.16839,.987631,-.0262947,.0360625,1.19004,.999978,.00132758,-559424e-9,1.21058,.193925,-793421e-11,.391974,392537e-11,.196746,-200315e-9,.397675,991033e-10,.19667,-801099e-9,.397521,396342e-9,.196633,-.00180246,.397445,891829e-9,.196654,-.00320443,.397482,.00158582,.196659,-.00500647,.39748,.00247867,.196683,-.0072086,.397506,.00357167,.196728,-.00981001,.397562,.00486675,.196792,-.0128096,.397633,.00636707,.19689,-.0162055,.397746,.00807752,.197017,-.0199943,.397884,.0100052,.19729,-.024139,.39827,.0121691,.197583,-.0286671,.398639,.0145755,.197927,-.0335858,.399034,.0172355,.198383,-.0388806,.399554,.0201718,.199002,-.0444736,.400289,.0234194,.199739,-.0504583,.401111,.026984,.200784,-.056729,.402349,.0309217,.202075,-.0633643,.403841,.0352496,.203898,-.0703247,.406076,.0400313,.206199,-.0775565,.408841,.0453282,.209252,-.085184,.41259,.0511794,.213638,-.0931994,.418288,.0577459,.21881,-.101617,.424681,.0650508,.225642,-.11052,.433429,.0732759,.233717,-.119772,.442897,.0824683,.242823,-.129505,.452888,.0927484,.254772,-.139906,.466407,.104417,.266603,-.150402,.477413,.117211,.28073,-.161395,.490519,.131598,.295399,-.172465,.50201,.147407,.312705,-.183982,.515311,.165031,.331335,-.195532,.52786,.184336,.351037,-.206971,.5392,.205361,.372175,-.218117,.54941,.228043,.394548,-.229327,.558642,.25267,.419598,-.240052,.567861,.279071,.443922,-.249937,.573332,.306882,.471495,-.259407,.58013,.33661,.496769,-.267749,.580564,.367328,.524951,-.275524,.581696,.399753,.55318,-.282148,.579885,.433134,.581577,-.287533,.575471,.467534,.609231,-.291612,.567445,.502943,.637478,-.293911,.557657,.53871,.667795,-.295096,.546535,.576568,.694272,-.294073,.529561,.614929,.722937,-.290386,.510561,.655909,.749682,-.284481,.487846,.697663,.774754,-.276188,.462487,.738515,.799301,-.266215,.43481,.779802,.820762,-.254116,.404879,.820045,.843231,-.240393,.374559,.860294,.861857,-.225503,.341582,.900965,.880815,-.209382,.308778,.941727,.89766,-.19155,.275232,.980916,.912926,-.172346,.240938,1.02162,.926391,-.151799,.207223,1.0597,.938429,-.129968,.17484,1.09291,.947834,-.10651,.142984,1.12248,.958432,-.0824098,.109902,1.149,.972402,-.0565242,.0744454,1.1733,.987191,-.028427,.0373794,1.19538,.999975,385685e-10,-4203e-8,1.21676,.178114,-766075e-11,.385418,354027e-11,.176074,-191966e-9,.381002,887135e-10,.17601,-767549e-9,.380861,354715e-9,.17598,-.00172696,.380798,798168e-9,.175994,-.00307012,.380824,.00141928,.176017,-.00479684,.380858,.00221859,.176019,-.00690648,.380839,.00319714,.176072,-.00939888,.380913,.0043572,.176131,-.0122726,.380979,.005702,.176239,-.0155264,.38112,.00723689,.176371,-.0191551,.381272,.00896907,.176638,-.023117,.381669,.0109194,.176912,-.0274633,.382015,.0130903,.177279,-.032173,.382476,.0154949,.17774,-.0372219,.383041,.0181669,.178344,-.0426132,.38378,.0211209,.179153,-.0483309,.384773,.0243899,.180197,-.0543447,.386076,.0280062,.181581,-.0607122,.387809,.032004,.18344,-.0673855,.390205,.036453,.186139,-.0743989,.393944,.0414162,.189432,-.0817731,.39832,.0469394,.193795,-.0895464,.404188,.0531442,.199641,-.0978264,.4121,.0601374,.206679,-.106499,.421425,.0680078,.214865,-.115654,.431504,.076919,.224406,-.125268,.442526,.0868835,.235876,-.135475,.455465,.0981875,.248335,-.146023,.4681,.110759,.262868,-.157016,.482069,.124885,.278962,-.168245,.496182,.140645,.295082,-.17958,.507401,.157838,.313738,-.191227,.520252,.17695,.333573,-.202718,.531708,.197817,.356433,-.214424,.544509,.220785,.378853,-.225492,.55373,.245306,.402717,-.236236,.561348,.271593,.428375,-.246568,.568538,.299776,.454724,-.255941,.573462,.329433,.482291,-.264511,.576356,.360598,.509706,-.272129,.576446,.393204,.538805,-.278979,.575298,.427227,.568919,-.284528,.572154,.462157,.596804,-.288801,.564691,.497997,.625987,-.291334,.555134,.534467,.656414,-.292722,.545051,.571736,.683916,-.292185,.528813,.610158,.711809,-.290043,.51106,.649061,.739547,-.285246,.490103,.690081,.766914,-.277647,.465523,.732554,.791375,-.267603,.437718,.773982,.814772,-.256109,.40882,.81609,.836691,-.242281,.377823,.856849,.856984,-.227155,.34496,.898363,.876332,-.210395,.311335,.939471,.894988,-.192612,.277703,.980799,.911113,-.173236,.243019,1.02215,.924092,-.152258,.209037,1.06139,.936828,-.129575,.175909,1.09635,.946869,-.10594,.143852,1.12707,.958284,-.081318,.110289,1.15419,.972325,-.0556133,.0747232,1.17909,.986878,-.0297899,.0383149,1.20163,.999936,-.00197169,912402e-9,1.22338,.151174,-720365e-11,.351531,309789e-11,.155594,-18279e-8,.361806,78608e-9,.156099,-731569e-9,.362982,314615e-9,.156053,-.00164578,.362869,707845e-9,.156093,-.0029261,.362961,.00125884,.156099,-.00457155,.362959,.00196783,.15612,-.00658224,.362982,.00283622,.156168,-.00895774,.363048,.00386625,.156221,-.0116962,.363101,.00506109,.156324,-.0147973,.363241,.00642675,.156476,-.0182503,.363448,.00797175,.156731,-.0220266,.36384,.00971484,.156994,-.026176,.364179,.0116575,.157341,-.0306701,.36462,.0138207,.157867,-.0354591,.365364,.0162356,.15846,-.0406141,.366111,.0189092,.159308,-.0460519,.367248,.021885,.160426,-.0518096,.368767,.0252004,.161877,-.0578906,.370745,.0288825,.163995,-.0642812,.373831,.0330139,.16655,-.0710067,.377366,.0376283,.170237,-.0781522,.382799,.0428493,.175096,-.0857172,.389915,.0487324,.181069,-.0938025,.398487,.0554214,.188487,-.102363,.408799,.0630189,.197029,-.111343,.419991,.071634,.206684,-.120812,.431455,.0812797,.218698,-.131033,.445746,.0923651,.230726,-.141373,.457471,.104545,.245516,-.152387,.472388,.118449,.261551,-.163628,.486671,.133923,.277437,-.174814,.49762,.150849,.296662,-.186713,.51162,.169924,.31795,-.198513,.525435,.190848,.339422,-.210119,.536267,.213504,.362143,-.221354,.545982,.237947,.387198,-.23224,.555364,.264427,.412349,-.24257,.561489,.292519,.439274,-.252284,.566903,.322561,.466779,-.261023,.569614,.353952,.496011,-.26899,.571589,.387278,.524964,-.275498,.570325,.421356,.556518,-.281449,.568792,.457314,.584363,-.285526,.560268,.493199,.614214,-.28844,.55205,.530276,.645684,-.289777,.541906,.56855,.673446,-.289722,.526464,.606927,.701924,-.287792,.509872,.645945,.73037,-.284315,.490649,.685564,.757405,-.278804,.467964,.726511,.784025,-.269543,.441468,.768601,.808255,-.258117,.41216,.811321,.830739,-.244728,.380606,.853496,.851914,-.229428,.348111,.895374,.872586,-.212508,.314732,.937674,.891581,-.194025,.280338,.979869,.907641,-.174711,.245203,1.02253,.922233,-.153509,.21077,1.06371,.935878,-.130418,.177399,1.09972,.946338,-.105558,.144507,1.13124,.957265,-.080059,.110508,1.15973,.971668,-.0539766,.0742311,1.18515,.9866,-.0277101,.0375224,1.20858,1.00021,-515531e-9,135226e-9,1.23135,.137468,-686011e-11,.345041,273315e-11,.13703,-173378e-9,.343936,690761e-10,.136986,-693048e-9,.34383,276126e-9,.136964,-.00155931,.343761,621337e-9,.137003,-.00277211,.343863,.00110494,.137012,-.00433103,.343868,.00172744,.137043,-.00623606,.343916,.00249022,.13709,-.0084868,.343986,.00339559,.137145,-.0110814,.344045,.00444687,.137242,-.0140187,.344177,.00565007,.137431,-.0172713,.344491,.00701868,.137644,-.0208605,.344805,.00856042,.13791,-.024792,.345172,.0102863,.138295,-.0290461,.345734,.0122185,.138764,-.0335957,.346371,.0143771,.139415,-.038467,.347298,.0167894,.140272,-.0436176,.348527,.0194895,.141457,-.0491016,.350276,.0225043,.14303,-.0548764,.352646,.0258962,.145289,-.0610096,.356206,.0297168,.148502,-.0674777,.361488,.0340562,.152188,-.074345,.367103,.0389534,.157359,-.0817442,.375247,.0445541,.16379,-.0896334,.385064,.0509535,.171376,-.098005,.396082,.0582611,.179901,-.106817,.407418,.06654,.189892,-.116239,.420031,.075994,.201838,-.12627,.434321,.0867239,.214311,-.136701,.447631,.0987517,.228902,-.147616,.462046,.112353,.245107,-.158871,.476942,.127605,.262292,-.170261,.490285,.144469,.281215,-.182017,.503783,.163282,.301058,-.193729,.515505,.183873,.322752,-.205512,.52682,.206466,.347547,-.217214,.539473,.231194,.370969,-.227966,.546625,.257288,.397533,-.238555,.55472,.285789,.42398,-.248278,.559468,.315746,.452928,-.257422,.564095,.347724,.482121,-.265306,.565426,.380922,.510438,-.272043,.563205,.415639,.541188,-.277614,.561087,.451702,.571667,-.281927,.554922,.48845,.602432,-.285015,.546838,.526442,.634126,-.286512,.537415,.564896,.662816,-.286388,.522906,.604037,.692411,-.284734,.507003,.643795,.720946,-.281297,.488398,.68298,.748293,-.276262,.466353,.723466,.776931,-.269978,.443573,.764565,.801065,-.260305,.415279,.805838,.825843,-.247426,.384773,.849985,.84807,-.232437,.352555,.893174,.869122,-.215806,.318642,.936564,.888963,-.197307,.28381,.980253,.905547,-.177203,.247888,1.02463,.918554,-.155542,.212904,1.06714,.931395,-.131948,.1787,1.10451,.941749,-.106723,.145902,1.13694,.954551,-.0804939,.111193,1.1666,.970279,-.0534239,.0744697,1.19249,.986117,-.0257452,.0368788,1.21665,.999938,.00190634,-.0010291,1.23981,.118493,-647439e-11,.32272,23772e-10,.118765,-163023e-9,.323456,598573e-10,.118772,-65212e-8,.323477,239447e-9,.118843,-.00146741,.323657,538881e-9,.118804,-.00260846,.323553,95826e-8,.118826,-.00407576,.323595,.00149845,.118846,-.00586826,.323617,.00216047,.118886,-.00798578,.32367,.00294679,.118947,-.0104273,.323753,.00386124,.119055,-.0131909,.323922,.00490999,.119241,-.0162444,.324251,.00610804,.11944,-.0196339,.324544,.00745805,.119739,-.0233378,.325026,.00897805,.12011,-.0273179,.325586,.0106895,.120571,-.0316143,.326231,.0126073,.12124,-.0361939,.327264,.0147654,.122162,-.0410511,.328733,.0172001,.123378,-.0462233,.330659,.0199375,.125183,-.0517109,.333754,.0230498,.127832,-.0575652,.338507,.026597,.130909,-.0637441,.343666,.0306345,.135221,-.0704302,.351063,.035273,.14082,-.0776364,.360604,.0406137,.146781,-.0852293,.369638,.0466788,.155121,-.0935351,.3827,.0537628,.16398,-.102234,.39522,.0617985,.173926,-.111465,.40793,.07097,.185137,-.121296,.42105,.0813426,.19826,-.13169,.435735,.0931596,.212938,-.142614,.450932,.106547,.229046,-.153884,.465726,.121575,.246246,-.165382,.479461,.138286,.264637,-.176806,.492106,.15666,.284959,-.188793,.504774,.17728,.308157,-.200763,.518805,.19988,.330951,-.21239,.528231,.224293,.3549,-.223521,.536376,.250541,.381502,-.234169,.544846,.278902,.409529,-.244077,.551717,.309227,.437523,-.253363,.55517,.341426,.467624,-.261659,.557772,.37518,.497268,-.268498,.556442,.41007,.528294,-.274018,.553915,.446445,.559053,-.278169,.549153,.483779,.589329,-.281229,.539878,.522249,.622503,-.282902,.53162,.561754,.652382,-.282815,.518119,.601544,.681847,-.281247,.502187,.641574,.712285,-.277986,.484824,.682633,.740094,-.273017,.463483,.723426,.768478,-.266692,.441299,.763747,.794556,-.258358,.415238,.805565,.819408,-.248807,.386912,.847254,.843411,-.236214,.356165,.891091,.862397,-.219794,.320562,.936174,.883113,-.201768,.285322,.982562,.90023,-.181672,.249713,1.02862,.915192,-.159279,.214546,1.07163,.928458,-.134725,.180285,1.10995,.94069,-.10913,.147119,1.14354,.953409,-.0821315,.112492,1.17372,.969537,-.0542677,.0752014,1.20043,.985612,-.0259096,.0370361,1.22528,.999835,.00298198,-.00151801,1.24959,.10097,-602574e-11,.300277,202619e-11,.101577,-152164e-9,.302077,511662e-10,.101572,-608889e-9,.302066,204751e-9,.101566,-.00136997,.302047,460753e-9,.101592,-.00243557,.302114,819497e-9,.101608,-.0038053,.30214,.00128154,.101627,-.00547906,.30216,.0018483,.101669,-.00745647,.302224,.00252223,.101732,-.00973615,.302318,.00330716,.101844,-.0123097,.302513,.00421061,.102025,-.0151681,.30285,.00524481,.102224,-.0183334,.303166,.0064154,.102515,-.0217819,.303654,.00774063,.102886,-.0255067,.304243,.0092398,.103395,-.029514,.305089,.0109339,.104109,-.0337912,.306301,.0128561,.105074,-.0383565,.30798,.0150338,.10654,-.0432132,.310726,.0175228,.108478,-.0484244,.314351,.0203648,.111015,-.0539339,.319032,.0236325,.114682,-.0598885,.32605,.0274188,.11911,-.0663375,.334109,.0317905,.124736,-.0733011,.344013,.0368502,.131479,-.0807744,.355358,.0427104,.139283,-.0888204,.367614,.0494788,.148054,-.0973394,.380072,.0572367,.159037,-.10665,.395678,.0662704,.169794,-.116221,.40795,.0763192,.18314,-.126632,.423546,.087956,.197515,-.137383,.438213,.101042,.213514,-.148641,.453248,.115827,.23065,-.160117,.46688,.132283,.249148,-.171807,.479962,.150644,.270219,-.183695,.494618,.171073,.292338,-.195574,.506937,.193378,.314999,-.207205,.516463,.217585,.340991,-.218955,.528123,.24428,.367982,-.229917,.537025,.272784,.39432,-.239737,.541627,.302742,.423364,-.249048,.546466,.335112,.453751,-.257329,.549466,.369032,.48416,-.264623,.549503,.404577,.515262,-.270411,.547008,.441337,.547036,-.274581,.542249,.479162,.576614,-.277266,.533015,.517904,.611143,-.279144,.525512,.558508,.640989,-.279001,.51154,.598995,.671182,-.277324,.495641,.639935,.700848,-.273908,.477526,.681017,.729862,-.269063,.457955,.722764,.758273,-.262282,.434846,.764349,.784121,-.254281,.409203,.806206,.809798,-.24505,.382694,.848617,.834953,-.233861,.354034,.892445,.856817,-.221308,.321764,.936263,.877609,-.205996,.288118,.982401,.897489,-.186702,.253277,1.02975,.913792,-.164618,.217963,1.07488,.92785,-.140023,.183221,1.11487,.940378,-.11328,.149385,1.14947,.95273,-.0853958,.114152,1.1807,.969059,-.0568698,.0769845,1.20912,.985574,-.0276502,.0381186,1.23498,.999943,.00239052,-.00126861,1.25987,.0852715,-560067e-11,.279021,171162e-11,.0854143,-140871e-9,.279483,430516e-10,.0854191,-563385e-9,.2795,172184e-9,.0854188,-.00126753,.279493,387464e-9,.0854229,-.00225337,.279501,68918e-8,.0854443,-.00352086,.279549,.00107803,.0854697,-.00506962,.279591,.00155536,.0855093,-.00689873,.279652,.00212354,.0855724,-.00900821,.279752,.00278703,.0856991,-.0113799,.280011,.0035551,.085855,-.0140314,.280297,.00443449,.0860682,-.016963,.280682,.00543636,.086344,-.0201438,.281159,.0065788,.0867426,-.0235999,.281886,.00787977,.087239,-.0273069,.282745,.0093606,.0879815,-.031269,.284139,.011056,.0891258,-.035531,.28647,.0130065,.0906909,-.0400947,.289708,.0152495,.0927624,-.0449638,.293904,.0178454,.0958376,-.0502427,.300471,.0208915,.0995827,-.0559514,.30806,.0244247,.104526,-.0622152,.317874,.0285721,.110532,-.0690046,.329332,.0334227,.117385,-.0763068,.341217,.0390466,.12522,-.084184,.353968,.0455786,.134037,-.0925248,.366797,.0530773,.144014,-.101487,.380209,.0617424,.156013,-.111273,.395956,.071777,.168872,-.121431,.41053,.0830905,.183089,-.132105,.425073,.0959341,.198763,-.143286,.439833,.110448,.216159,-.154841,.454507,.126769,.234859,-.166588,.468368,.14495,.255879,-.178626,.482846,.165233,.27677,-.190218,.493489,.187217,.301184,-.202227,.506549,.211659,.325852,-.213764,.5158,.237922,.352824,-.22487,.525442,.26632,.380882,-.235246,.532487,.296691,.410137,-.244847,.537703,.329179,.439787,-.253122,.540361,.363135,.472291,-.260517,.542734,.399222,.501856,-.266519,.538826,.436352,.534816,-.270905,.535152,.474505,.565069,-.273826,.525979,.513988,.597154,-.275333,.516394,.554852,.630473,-.275314,.506206,.596592,.660574,-.273323,.489769,.638117,.692015,-.270008,.472578,.680457,.720647,-.265001,.452134,.723008,.750528,-.258311,.430344,.765954,.777568,-.250046,.405624,.809012,.80387,-.240114,.378339,.852425,.828439,-.228737,.349877,.895346,.851472,-.216632,.318968,.940695,.873906,-.202782,.287489,.987235,.89467,-.187059,.254394,1.03348,.912281,-.168818,.221294,1.07812,.927358,-.146494,.18675,1.11928,.940385,-.120009,.152322,1.15609,.952672,-.0917183,.117514,1.18875,.968496,-.0620321,.0797405,1.21821,.985236,-.0314945,.0402383,1.24523,.99998,-575153e-9,110644e-9,1.27133,.0702429,-512222e-11,.255273,140947e-11,.0702981,-128826e-9,.255469,354488e-10,.0703691,-515562e-9,.255727,141874e-9,.0703805,-.00116,.255754,31929e-8,.0703961,-.00206224,.255813,567999e-9,.0704102,-.00322223,.255839,88871e-8,.0704298,-.00463928,.255863,.00128272,.0704759,-.00631375,.255953,.00175283,.0705434,-.00824317,.256079,.00230342,.0706693,-.010412,.25636,.0029443,.0708189,-.0128439,.256647,.00368031,.0710364,-.0155177,.257084,.00452614,.0713223,-.0184374,.257637,.00549706,.0717182,-.0216002,.258416,.00661246,.072321,-.0249966,.259699,.00790147,.0731446,-.0286566,.261475,.0093884,.0743352,-.0325888,.264132,.0111186,.0760676,-.036843,.26815,.013145,.078454,-.0414292,.273636,.0155251,.0818618,-.0464634,.281653,.0183525,.0857382,-.0519478,.289992,.0216642,.0908131,-.0579836,.30066,.0255956,.0967512,-.0645124,.312204,.0301954,.103717,-.0716505,.325001,.0356017,.111596,-.0793232,.338129,.041896,.120933,-.087645,.352853,.0492447,.130787,-.096492,.366192,.0576749,.142311,-.105973,.380864,.0673969,.155344,-.116182,.396575,.0785899,.169535,-.126815,.411443,.0912377,.185173,-.138015,.426256,.105607,.201755,-.149325,.439607,.121551,.221334,-.161207,.455467,.139608,.241461,-.173162,.469096,.159591,.26294,-.18504,.481014,.18156,.286776,-.196881,.493291,.205781,.311596,-.208311,.503556,.231819,.338667,-.219671,.513268,.260274,.366021,-.230451,.519414,.290862,.395875,-.240131,.526766,.323196,.425564,-.248566,.52905,.357071,.457094,-.256195,.530796,.393262,.488286,-.262331,.528703,.430797,.522291,-.267141,.52727,.470231,.554172,-.270411,.519848,.510477,.586427,-.271986,.510307,.551594,.619638,-.27192,.499158,.593849,.650656,-.269817,.483852,.636314,.68284,-.266267,.467515,.679679,.714356,-.26113,.44931,.723884,.742717,-.254067,.425789,.767245,.770894,-.245652,.401144,.811819,.797358,-.235554,.374224,.856315,.823377,-.223896,.346167,.901077,.847456,-.210865,.316056,.946502,.870697,-.196574,.284503,.993711,.891068,-.180814,.251628,1.04134,.909267,-.163314,.219065,1.08609,.925653,-.143304,.186446,1.12702,.940017,-.121322,.153416,1.16371,.952398,-.0973872,.120334,1.19712,.967568,-.0698785,.08352,1.22791,.984772,-.0390031,.0439209,1.25672,1.00026,-.0070087,.00315668,1.28428,.0556653,-459654e-11,.227325,112556e-11,.0565238,-116382e-9,.230826,284985e-10,.0565717,-465666e-9,.231026,114036e-9,.0565859,-.00104773,.231079,256656e-9,.0565761,-.00186255,.231025,45663e-8,.0565913,-.00291002,.231058,714664e-9,.0566108,-.00418998,.231085,.00103224,.0566532,-.00570206,.231169,.00141202,.0567473,-.00743666,.231417,.00186018,.0568567,-.00940298,.231661,.00238264,.0569859,-.0115991,.231895,.00298699,.0572221,-.0140096,.232456,.00368957,.057519,-.0166508,.233096,.00450303,.0579534,-.01951,.234094,.00544945,.0585922,-.0225991,.235629,.00655564,.0595647,-.0259416,.238106,.00785724,.0609109,-.0295661,.241557,.00939127,.0628751,-.0335126,.246652,.0112198,.0656908,-.0378604,.254091,.0134168,.0691347,-.0426543,.262666,.0160374,.0732165,-.0478967,.272029,.0191514,.0782863,-.0536716,.283007,.0228597,.0843973,-.0600683,.295732,.0272829,.0913598,-.0670095,.308779,.032484,.0994407,-.0745516,.322886,.0385886,.108189,-.082712,.336408,.0457133,.118574,-.0914927,.351692,.0539832,.129989,-.100854,.366502,.0635162,.142722,-.110837,.381675,.0744386,.156654,-.121353,.3963,.0868483,.172151,-.132414,.411477,.100963,.188712,-.143809,.42508,.116795,.208093,-.155765,.441328,.134715,.227936,-.167608,.454328,.154396,.249495,-.179579,.467235,.176179,.27362,-.191488,.480248,.200193,.296371,-.202618,.487886,.225775,.324234,-.214133,.499632,.25441,.353049,-.225212,.509532,.285077,.381785,-.234875,.514265,.317047,.414038,-.244205,.521282,.351874,.445251,-.252145,.522931,.388279,.476819,-.258433,.520947,.425825,.509209,-.263411,.517669,.465104,.542759,-.266732,.512841,.505741,.574822,-.268263,.503317,.547611,.609324,-.268489,.493035,.590953,.641772,-.266941,.478816,.63488,.674049,-.263297,.462863,.679072,.705071,-.257618,.442931,.723487,.734709,-.250625,.421299,.768708,.763704,-.24179,.397085,.814375,.791818,-.231115,.370577,.859907,.817439,-.21922,.34232,.906715,.843202,-.205658,.312627,.953943,.866639,-.190563,.280933,1.00185,.888129,-.173978,.248393,1.05105,.907239,-.155485,.216007,1.09704,.923893,-.134782,.183233,1.13857,.938882,-.11249,.150376,1.17539,.952464,-.0890706,.117177,1.20924,.968529,-.0646523,.0813095,1.24055,.984763,-.038606,.0439378,1.27018,1.00053,-.01238,.00598668,1.29873,.0437928,-409594e-11,.204012,8.79224e-7,.0440166,-103395e-9,.205049,221946e-10,.0440529,-413633e-9,.205225,887981e-10,.0440493,-930594e-9,.2052,199858e-9,.0439884,-.00165352,.204901,355495e-9,.0440716,-.0025849,.205255,556983e-9,.0440968,-.00372222,.205311,805326e-9,.0441359,-.00506478,.205391,.00110333,.0442231,-.00660384,.205638,.00145768,.0443254,-.00835246,.205877,.00187275,.0444832,-.0102992,.20627,.00235938,.0447001,-.0124449,.206796,.0029299,.0450168,-.0147935,.207593,.0036005,.0454816,-.017336,.208819,.00439246,.0462446,-.0201156,.211036,.00533864,.0473694,-.0231568,.214388,.00646984,.0490191,-.0264941,.219357,.00783856,.0512776,-.030184,.226061,.00950182,.0541279,-.0342661,.234094,.0115156,.0578989,-.0388539,.244297,.0139687,.0620835,-.0438735,.254457,.0169015,.0673497,-.04951,.266706,.0204554,.0731759,-.0556263,.278753,.0246606,.0803937,-.0624585,.29309,.0297126,.0879287,-.0697556,.305856,.0355868,.0970669,-.0778795,.321059,.0425768,.106508,-.0863541,.333873,.05056,.11776,-.0955935,.349008,.0598972,.130081,-.105438,.363776,.0706314,.144454,-.115899,.380112,.0828822,.1596,-.126827,.394843,.0967611,.176097,-.138161,.409033,.112381,.194726,-.149904,.424257,.129952,.213944,-.161675,.436945,.149333,.235516,-.173659,.450176,.170892,.260564,-.185963,.466305,.194984,.285183,-.197582,.477328,.220805,.311095,-.208697,.486566,.248694,.338924,-.219519,.494811,.279015,.369757,-.229766,.504065,.311725,.3996,-.238879,.507909,.345844,.430484,-.246802,.509805,.381749,.46413,-.253924,.511436,.420251,.497077,-.259319,.508787,.459957,.530434,-.263297,.50394,.501356,.565725,-.265619,.49804,.544252,.599254,-.265842,.487346,.587856,.631251,-.263978,.472975,.631969,.663972,-.26043,.457135,.677471,.697724,-.255358,.439844,.723744,.727725,-.248308,.417872,.770653,.756417,-.239181,.39273,.817357,.785419,-.22814,.367839,.864221,.81266,-.215681,.339449,.912701,.839391,-.201623,.309279,.962419,.86366,-.185624,.278029,1.0122,.885028,-.16797,.245294,1.06186,.904639,-.148336,.212689,1.10934,.922048,-.12637,.179616,1.15063,.936952,-.102928,.146749,1.18885,.951895,-.0785268,.112733,1.22352,.967198,-.0530153,.0760056,1.25681,.984405,-.02649,.0383183,1.28762,1.00021,70019e-8,-20039e-8,1.31656,.0325964,-355447e-11,.176706,6.55682e-7,.0329333,-899174e-10,.178527,165869e-10,.0329181,-359637e-9,.178453,663498e-10,.0329085,-808991e-9,.178383,149332e-9,.0329181,-.00143826,.178394,265873e-9,.0329425,-.00224678,.178517,416597e-9,.0329511,-.00323575,.17849,603299e-9,.033011,-.00439875,.178695,829422e-9,.0330733,-.00574059,.178843,.00109908,.0331857,-.00725896,.179176,.00141933,.0333445,-.00895289,.179618,.0017999,.0335674,-.0108219,.180238,.00225316,.033939,-.0128687,.181417,.00279765,.0345239,-.015114,.183395,.0034564,.0354458,-.017596,.186616,.00425864,.0368313,-.0203524,.191547,.00524936,.0386115,-.0234105,.197508,.00647033,.0410303,-.0268509,.205395,.00798121,.0442245,-.0307481,.215365,.0098557,.0478659,-.0350863,.225595,.0121417,.0522416,-.0399506,.236946,.0149385,.0574513,-.045357,.249442,.0183189,.0631208,-.0512863,.261222,.0223644,.0701124,-.0579273,.275418,.0272418,.0777331,-.0650652,.288989,.0329458,.0862709,-.0728813,.302546,.0396819,.096103,-.081363,.317164,.04757,.106976,-.0904463,.331733,.0567012,.119175,-.100105,.34661,.067202,.132919,-.110375,.362249,.0792588,.147727,-.121115,.376978,.0928672,.163618,-.132299,.390681,.108228,.182234,-.143887,.406571,.125502,.201809,-.155827,.42042,.144836,.225041,-.168357,.438411,.166706,.247621,-.18004,.450368,.189909,.27097,-.191536,.460083,.215251,.296658,-.203024,.469765,.243164,.325892,-.214056,.481837,.273388,.35406,-.224104,.487474,.305344,.384372,-.233489,.492773,.339741,.41749,-.241874,.498451,.376287,.45013,-.248834,.499632,.414195,.481285,-.254658,.495233,.454077,.519183,-.259367,.496401,.496352,.551544,-.261818,.487686,.538798,.587349,-.262964,.479453,.583626,.621679,-.262128,.467709,.629451,.654991,-.258998,.452123,.67566,.686873,-.254119,.433495,.723248,.719801,-.246946,.413657,.771156,.750355,-.237709,.390366,.81989,.780033,-.226549,.364947,.868601,.809254,-.214186,.337256,.920034,.836576,-.199639,.307395,.971706,.861774,-.183169,.275431,1.02479,.885707,-.165111,.243431,1.07837,.904742,-.144363,.210921,1.12783,.915604,-.121305,.17647,1.17254,.930959,-.0962119,.143106,1.21012,.948404,-.069969,.108112,1.24474,.967012,-.0427586,.0708478,1.27718,.984183,-.0147043,.032335,1.3083,.999577,.0142165,-.00726867,1.3382,.0229227,-299799e-11,.148623,4.62391e-7,.0232194,-758796e-10,.15054,117033e-10,.0232315,-303636e-9,.15063,468397e-10,.0232354,-683189e-9,.150624,105472e-9,.0232092,-.0012136,.150445,187744e-9,.0232523,-.00189765,.150679,294847e-9,.0232828,-.00273247,.150789,428013e-9,.0233371,-.00371287,.150995,591134e-9,.0234015,-.00484794,.15118,787642e-9,.023514,-.00612877,.151562,.00102547,.023679,-.00756125,.152116,.00131351,.0239559,-.00914651,.153162,.00166594,.0244334,-.010904,.155133,.00210182,.025139,-.0128615,.158035,.00264406,.0262598,-.0150628,.162751,.00332923,.0277875,-.0175532,.168944,.00419773,.0298472,-.0203981,.176835,.00530034,.0325444,-.023655,.186686,.00669777,.0355581,-.0272982,.196248,.00842661,.0392841,-.0314457,.207352,.0105854,.0436815,-.0361157,.219279,.0132458,.0485272,-.0412932,.230728,.0164736,.0541574,-.0470337,.242994,.0203715,.0609479,-.0535002,.257042,.0250953,.0685228,-.0605409,.27102,.0306856,.0768042,-.0680553,.28406,.037193,.0864844,-.0765011,.299186,.0449795,.0969415,-.0852674,.3132,.0538316,.108478,-.0947333,.327138,.0641149,.121705,-.10481,.342345,.0759185,.136743,-.115474,.358472,.0894116,.152986,-.126536,.374067,.104562,.170397,-.138061,.388267,.121632,.191392,-.150203,.406467,.140996,.211566,-.161751,.418641,.161696,.233567,-.173407,.430418,.184557,.257769,-.185397,.44277,.210092,.28531,-.197048,.457191,.237827,.311726,-.20784,.464712,.267253,.340537,-.218345,.472539,.299332,.372921,-.228306,.482331,.333988,.402924,-.236665,.484378,.369722,.434475,-.244097,.484717,.407836,.469736,-.250547,.487093,.448465,.505045,-.25511,.485575,.490263,.540262,-.258444,.481225,.534495,.576347,-.259903,.473481,.579451,.608656,-.259572,.4603,.625604,.646679,-.257908,.450341,.674511,.679902,-.253663,.431561,.723269,.714159,-.247419,.412684,.773263,.745345,-.239122,.389388,.824182,.778248,-.228837,.365361,.876634,.807208,-.216197,.337667,.92945,.835019,-.201772,.307197,.985261,.860261,-.185291,.274205,1.04299,.877601,-.165809,.240178,1.09816,.898211,-.143897,.207571,1.14694,.915789,-.119513,.174904,1.19008,.931831,-.0932919,.141423,1.2297,.949244,-.0656528,.105603,1.26553,.967527,-.0370262,.0679551,1.29986,.984139,-.00730117,.0283133,1.33252,.999713,.0234648,-.0121785,1.36397,.0152135,-245447e-11,.122795,3.04092e-7,.0151652,-615778e-10,.122399,76292e-10,.0151181,-245948e-9,.122023,304802e-10,.0151203,-553394e-9,.12203,686634e-10,.015125,-983841e-9,.122037,122463e-9,.0151427,-.00153774,.12214,192706e-9,.0151708,-.0022103,.122237,281219e-9,.0152115,-.00300741,.12238,390804e-9,.0152877,-.00392494,.1227,526317e-9,.015412,-.00496597,.123244,69443e-8,.0156201,-.00613314,.124228,90547e-8,.0159658,-.00744113,.125945,.0011732,.0165674,-.00892546,.129098,.00151888,.017487,-.010627,.133865,.00197007,.018839,-.0126043,.140682,.0025637,.020554,-.0148814,.148534,.00333637,.0226727,-.0175123,.157381,.00433738,.0251879,-.0205266,.166685,.00561664,.0283635,-.0240319,.177796,.00725563,.0318694,-.0279432,.188251,.00928811,.0361044,-.0324313,.200038,.011835,.0406656,-.0373527,.210685,.0149146,.0463846,-.0430132,.224182,.0187254,.0525696,-.0491013,.23634,.0232283,.0598083,-.0559175,.250013,.0286521,.0679437,-.0633657,.263981,.0350634,.0771181,-.0714602,.278072,.0425882,.0881273,-.0803502,.29511,.0514487,.0996628,-.0896903,.309976,.0615766,.112702,-.099644,.325611,.0732139,.126488,-.109829,.339321,.0862324,.142625,-.120859,.35574,.101275,.15953,-.131956,.369845,.117892,.176991,-.143145,.38146,.136205,.199715,-.155292,.40052,.157252,.220787,-.167066,.412055,.179966,.243697,-.178396,.423133,.204418,.272106,-.190433,.439524,.232141,.297637,-.201265,.447041,.261109,.325273,-.211834,.454488,.292627,.357219,-.221889,.465004,.326669,.387362,-.230729,.468527,.362426,.423131,-.23924,.475836,.401533,.45543,-.246067,.475017,.441902,.493393,-.251557,.478017,.484239,.526253,-.255571,.4709,.528586,.560554,-.257752,.463167,.574346,.599306,-.258076,.456452,.621655,.634541,-.256471,.443725,.670492,.668907,-.253283,.428719,.721943,.705619,-.247562,.411348,.772477,.739034,-.240626,.388939,.8264,.771408,-.231493,.36425,.881702,.803312,-.220125,.337321,.9385,.828457,-.206645,.305364,.997437,.854819,-.190664,.273715,1.05693,.878666,-.171429,.242218,1.11251,.898404,-.149235,.209556,1.16398,.917416,-.12435,.176863,1.21014,.933133,-.0972703,.142775,1.25178,.95066,-.0683607,.106735,1.29028,.968589,-.0378724,.0681609,1.32703,.984776,-.00605712,.0273966,1.36158,.99994,.0263276,-.0138124,1.3943,.00867437,-186005e-11,.0928979,1.73682e-7,.00864003,-466389e-10,.0925237,435505e-11,.00864593,-186594e-9,.0925806,174322e-10,.00864095,-419639e-9,.0924903,392862e-10,.00863851,-746272e-9,.0924589,702598e-10,.00868531,-.00116456,.0929,111188e-9,.00869667,-.00167711,.0928529,163867e-9,.00874332,-.00228051,.0930914,23104e-8,.00882709,-.00297864,.0935679,31741e-8,.00898874,-.00377557,.0946165,430186e-9,.00929346,-.00469247,.0967406,580383e-9,.00978271,-.00575491,.100084,783529e-9,.0105746,-.00701514,.105447,.00106304,.0116949,-.00851797,.112494,.00144685,.0130419,-.0102757,.119876,.00196439,.0148375,-.012381,.129034,.00266433,.0168725,-.01482,.137812,.00358364,.0193689,-.0176563,.147696,.00478132,.0222691,-.0209211,.157795,.00631721,.0256891,-.0246655,.168431,.00826346,.0294686,-.0288597,.178587,.0106714,.0340412,-.0336441,.190251,.0136629,.0393918,-.039033,.202999,.0173272,.0453947,-.0450087,.215655,.0217448,.0521936,-.0515461,.228686,.0269941,.0600279,-.058817,.242838,.033272,.0692398,-.0667228,.258145,.0406457,.0793832,-.0752401,.273565,.0492239,.0902297,-.0841851,.287735,.0590105,.102014,-.0936479,.301161,.0702021,.116054,-.103967,.317438,.0832001,.13191,-.114622,.334166,.0977951,.148239,-.125452,.348192,.113985,.165809,-.136453,.361094,.131928,.184616,-.147648,.373534,.151811,.207491,-.159607,.39101,.174476,.230106,-.171119,.402504,.198798,.257036,-.182906,.418032,.225796,.281172,-.193605,.425468,.254027,.312034,-.204771,.440379,.285713,.340402,-.214988,.445406,.319196,.370231,-.224711,.44968,.35537,.407105,-.233516,.460747,.393838,.439037,-.240801,.460624,.433747,.47781,-.24762,.465957,.477234,.510655,-.251823,.460054,.52044,.550584,-.255552,.459172,.567853,.585872,-.257036,.450311,.615943,.620466,-.257535,.437763,.667693,.660496,-.255248,.426639,.718988,.695578,-.251141,.409185,.772503,.732176,-.244718,.39015,.827023,.760782,-.236782,.362594,.885651,.79422,-.225923,.33711,.943756,.824521,-.213855,.308272,1.00874,.854964,-.197723,.278529,1.06764,.878065,-.179209,.246208,1.12836,.899834,-.157569,.21329,1.18318,.918815,-.133206,.181038,1.23161,.934934,-.106545,.146993,1.27644,.952115,-.0780574,.111175,1.31842,.96906,-.0478279,.0728553,1.35839,.985178,-.0160014,.032579,1.39697,1.00039,.0173126,-.0095256,1.43312,.00384146,-124311e-11,.0613583,7.78271e-8,.00390023,-314043e-10,.0622919,196626e-11,.00389971,-125622e-9,.0622632,787379e-11,.00389491,-282352e-9,.0620659,1778e-8,.00391618,-502512e-9,.0624687,320918e-10,.00392662,-784458e-9,.0625113,515573e-10,.00396053,-.00112907,.0628175,778668e-10,.00401911,-.00153821,.0633286,113811e-9,.00414994,-.0020208,.0646443,16445e-8,.00441223,-.00260007,.0673886,237734e-9,.00484427,-.0033097,.0716528,345929e-9,.00549109,-.00418966,.0774998,505987e-9,.00636293,-.00527331,.0844758,739208e-9,.00746566,-.00660428,.0921325,.00107347,.00876625,-.00818826,.0997067,.00153691,.0103125,-.0100811,.107433,.00217153,.0123309,-.0123643,.117088,.00303427,.0146274,-.0150007,.126438,.00416018,.0172295,-.0180531,.135672,.00561513,.0204248,-.0215962,.146244,.007478,.0241597,-.0256234,.157481,.00981046,.0284693,-.0302209,.169125,.0127148,.033445,-.0353333,.181659,.0162453,.0391251,-.0410845,.1944,.0205417,.0454721,-.0473451,.207082,.0256333,.0530983,-.0542858,.221656,.0317036,.0615356,-.0618384,.236036,.0388319,.0703363,-.0697631,.248398,.046974,.0810391,-.0784757,.263611,.0565246,.0920144,-.0873488,.275857,.0671724,.105584,-.0973652,.292555,.0798105,.119506,-.107271,.306333,.0935945,.134434,-.117608,.318888,.109106,.153399,-.128938,.337552,.127074,.171258,-.139944,.349955,.14643,.191059,-.151288,.361545,.168,.215069,-.163018,.378421,.192082,.237838,-.174226,.38879,.217838,.266965,-.186063,.405857,.246931,.292827,-.196909,.414146,.277505,.324352,-.207473,.426955,.310711,.354427,-.217713,.433429,.346794,.389854,-.227183,.443966,.385237,.420749,-.235131,.44471,.424955,.459597,-.242786,.451729,.468446,.495316,-.248767,.45072,.513422,.534903,-.253351,.450924,.560618,.572369,-.256277,.445266,.609677,.612383,-.2576,.438798,.660995,.644037,-.256931,.421693,.713807,.686749,-.254036,.4109,.767616,.719814,-.249785,.390151,.82533,.754719,-.244283,.367847,.888311,.792022,-.235076,.345013,.948177,.822404,-.225061,.316193,1.01661,.853084,-.211113,.287013,1.08075,.879871,-.19449,.255424,1.14501,.901655,-.174023,.222879,1.20203,.919957,-.1509,.18989,1.25698,.938412,-.124923,.15606,1.30588,.953471,-.0968139,.120512,1.3529,.970451,-.066734,.0828515,1.3986,.985522,-.034734,.0424458,1.44148,1.00099,-.00102222,678929e-9,1.48398,965494e-9,-6.27338e-7,.0306409,1.97672e-8,99168e-8,-158573e-10,.0314638,4.99803e-7,991068e-9,-634012e-10,.031363,200682e-11,974567e-9,-14144e-8,.03036,457312e-11,998079e-9,-252812e-9,.031496,860131e-11,.00102243,-396506e-9,.0319955,148288e-10,.00107877,-577593e-9,.0331376,249141e-10,.00121622,-816816e-9,.0359396,423011e-10,.0014455,-.00113761,.0399652,724613e-10,.00178791,-.00156959,.0450556,123929e-9,.00225668,-.00214064,.0508025,208531e-9,.00285627,-.00287655,.0568443,341969e-9,.0035991,-.00380271,.0630892,544158e-9,.00455524,-.00496264,.0702204,842423e-9,.00569143,-.0063793,.0773426,.00126704,.00716928,-.00813531,.0860839,.00186642,.00885307,-.0101946,.0944079,.00267014,.0109316,-.0126386,.103951,.00374033,.0133704,-.0154876,.113786,.0051304,.0161525,-.0187317,.123477,.00688858,.0194267,-.0224652,.133986,.00910557,.0230967,-.0265976,.143979,.0118074,.0273627,-.0312848,.154645,.0151266,.0323898,-.0365949,.166765,.0191791,.0379225,-.0422914,.177932,.0239236,.0447501,-.0487469,.19167,.0296568,.0519391,-.0556398,.203224,.0362924,.0599464,-.0631646,.215652,.0440585,.0702427,-.0714308,.232089,.0531619,.0806902,-.0800605,.245258,.0634564,.0923194,-.0892815,.258609,.0752481,.106938,-.09931,.276654,.0888914,.121238,-.109575,.289847,.104055,.138817,-.120461,.307566,.121266,.15595,-.131209,.320117,.139944,.178418,-.143049,.339677,.161591,.197875,-.154074,.349886,.184303,.224368,-.166307,.369352,.210669,.252213,-.178051,.386242,.238895,.277321,-.189335,.395294,.269182,.310332,-.200683,.412148,.302508,.338809,-.210856,.418266,.337264,.372678,-.220655,.428723,.374881,.405632,-.230053,.433887,.415656,.442293,-.237993,.439911,.457982,.477256,-.244897,.440175,.502831,.515592,-.250657,.441079,.550277,.550969,-.255459,.435219,.601102,.592883,-.257696,.432882,.651785,.629092,-.259894,.421054,.708961,.672033,-.258592,.41177,.763806,.709147,-.256525,.395267,.824249,.745367,-.254677,.375013,.8951,.784715,-.247892,.353906,.959317,.818107,-.240162,.327801,1.03153,.847895,-.229741,.298821,1.10601,.879603,-.213084,.269115,1.164,.902605,-.195242,.236606,1.22854,.922788,-.174505,.203442,1.29017,.944831,-.150169,.169594,1.34157,.959656,-.124099,.135909,1.3956,.972399,-.0960626,.0990563,1.45128,.986549,-.0657097,.0602348,1.50312,1.00013,-.0333558,.0186694,1.55364,619747e-11,-1e-7,.00778326,796756e-16,2.37499e-8,-9.99999e-8,282592e-10,1.14596e-10,100292e-11,-166369e-11,250354e-9,6.77492e-9,350752e-11,-637769e-11,357289e-9,6.31655e-8,826445e-11,-174689e-10,516179e-9,3.1851e-7,242481e-10,-450868e-10,.0010223,130577e-11,455631e-10,-89044e-9,.00144302,374587e-11,971222e-10,-178311e-9,.00241912,102584e-10,171403e-9,-313976e-9,.00354938,236481e-10,292747e-9,-520026e-9,.00513765,496014e-10,789827e-9,-.00118187,.0238621,139056e-9,.00114093,-.00171827,.0286691,244093e-9,.00176119,-.00249667,.0368565,420623e-9,.0022233,-.00333742,.0400469,65673e-8,.00343382,-.00481976,.0535751,.00109323,.00427602,-.00600755,.057099,.00155268,.00461435,-.00737637,.0551084,.00215031,.00695698,-.00971401,.0715767,.00316529,.00867619,-.0120943,.0793314,.00436995,.0106694,-.0148202,.0869391,.0058959,.0140351,-.0183501,.101572,.00798757,.0168939,-.022006,.11018,.0104233,.020197,-.0261568,.119041,.0134167,.0254702,-.0312778,.135404,.0173009,.0298384,-.0362469,.1437,.0215428,.035159,-.042237,.15512,.0268882,.0427685,-.0488711,.17128,.033235,.0494848,-.0557997,.181813,.0404443,.0592394,-.0635578,.198745,.0490043,.0681463,-.071838,.210497,.0588239,.0804753,-.0809297,.228864,.0702835,.0942205,-.0906488,.247008,.0834012,.106777,-.100216,.258812,.0975952,.124471,-.110827,.278617,.114162,.138389,-.121193,.287049,.131983,.159543,-.13253,.307151,.152541,.176432,-.143611,.31564,.174673,.201723,-.15548,.33538,.199842,.229721,-.167166,.355256,.227097,.250206,-.178238,.360047,.256014,.282118,-.189905,.378761,.28855,.312821,-.201033,.39181,.323348,.341482,-.211584,.397716,.360564,.377368,-.221314,.410141,.400004,.418229,-.230474,.423485,.442371,.444881,-.239443,.418874,.488796,.488899,-.245987,.427545,.535012,.520317,-.253948,.422147,.589678,.568566,-.256616,.42719,.637683,.599607,-.26376,.415114,.703363,.64222,-.268687,.408715,.771363,.685698,-.2694,.399722,.83574,.732327,-.266642,.388651,.897764,.769873,-.267712,.369198,.983312,.806733,-.263479,.346802,1.06222,.843466,-.254575,.321368,1.13477,.873008,-.242749,.29211,1.20712,.908438,-.22725,.262143,1.27465,.936321,-.207621,.228876,1.33203,.950353,-.187932,.19484,1.40439,.96442,-.165154,.163178,1.4732,.979856,-.139302,.127531,1.53574,.982561,-.11134,.0903457,1.59982,.996389,-.0808124,.0489007,1.6577],t=[1,0,0,0,1,791421e-36,0,0,1,104392e-29,0,0,1,349405e-26,0,0,1,109923e-23,0,0,1,947414e-22,0,0,1,359627e-20,0,0,1,772053e-19,0,0,1,108799e-17,0,0,1,110655e-16,0,0,1,865818e-16,0,0,.999998,5.45037e-10,0,0,.999994,2.85095e-9,0,0,.999989,1.26931e-8,0,0,.999973,4.89938e-8,0,0,.999947,1.66347e-7,0,0,.999894,5.02694e-7,0,0,.999798,136532e-11,0,0,.999617,335898e-11,0,0,.999234,752126e-11,0,0,.998258,152586e-10,0,0,.99504,266207e-10,0,0,.980816,236802e-10,0,0,.967553,207684e-11,0,0,.966877,403733e-11,0,0,.965752,741174e-11,0,0,.96382,127746e-10,0,0,.960306,202792e-10,0,0,.953619,280232e-10,0,0,.941103,278816e-10,0,0,.926619,160221e-10,0,0,.920983,235164e-10,0,0,.912293,311924e-10,0,.0158731,.899277,348118e-10,0,.0476191,.880884,26041e-9,0,.0793651,.870399,338726e-10,0,.111111,.856138,392906e-10,0,.142857,.837436,372874e-10,0,.174603,.820973,392558e-10,0,.206349,.803583,434658e-10,0,.238095,.782168,40256e-9,0,.269841,.764107,448159e-10,0,.301587,.743092,457627e-10,0,.333333,.721626,455314e-10,0,.365079,.700375,477335e-10,0,.396825,.677334,461072e-10,0,.428571,.655702,484393e-10,0,.460317,.632059,464583e-10,0,.492064,.610125,483923e-10,0,.52381,.58653,464342e-10,0,.555556,.564508,477033e-10,0,.587302,.541405,459263e-10,0,.619048,.519556,46412e-9,0,.650794,.497292,448913e-10,0,.68254,.475898,445789e-10,0,.714286,.454722,433496e-10,0,.746032,.434042,423054e-10,0,.777778,.414126,413737e-10,0,.809524,.394387,397265e-10,0,.84127,.375841,390709e-10,0,.873016,.357219,369938e-10,0,.904762,.340084,365618e-10,0,.936508,.322714,342533e-10,0,.968254,.306974,339596e-10,0,1,1,101524e-23,0,0,1,10292e-22,0,0,1,130908e-23,0,0,1,473331e-23,0,0,1,625319e-22,0,0,1,107932e-20,0,0,1,163779e-19,0,0,1,203198e-18,0,0,1,204717e-17,0,0,.999999,168995e-16,0,0,.999998,1.15855e-10,0,0,.999996,6.6947e-10,0,0,.999991,3.30863e-9,0,0,.999983,1.41737e-8,0,0,.999968,5.32626e-8,0,0,.99994,1.77431e-7,0,0,.999891,5.28835e-7,0,0,.999797,142169e-11,0,0,.999617,347057e-11,0,0,.999227,77231e-10,0,0,.998239,155753e-10,0,0,.994937,268495e-10,0,0,.980225,213742e-10,0,0,.967549,21631e-10,0,0,.966865,417989e-11,0,0,.965739,763341e-11,0,0,.963794,130892e-10,0,0,.960244,206456e-10,0,0,.953495,282016e-10,0,148105e-9,.940876,271581e-10,0,.002454,.926569,164159e-10,0,.00867491,.920905,239521e-10,0,.01956,.912169,315127e-10,0,.035433,.899095,346626e-10,0,.056294,.882209,290223e-10,0,.0818191,.870272,342992e-10,0,.111259,.855977,394164e-10,0,.142857,.837431,372343e-10,0,.174603,.820826,396691e-10,0,.206349,.803408,435395e-10,0,.238095,.782838,419579e-10,0,.269841,.763941,450953e-10,0,.301587,.742904,455847e-10,0,.333333,.721463,458833e-10,0,.365079,.700197,477159e-10,0,.396825,.677501,470641e-10,0,.428571,.655527,484732e-10,0,.460317,.6324,476834e-10,0,.492064,.609964,484213e-10,0,.52381,.586839,475541e-10,0,.555556,.564353,476951e-10,0,.587302,.541589,467611e-10,0,.619048,.519413,463493e-10,0,.650794,.497337,453994e-10,0,.68254,.475797,445308e-10,0,.714286,.454659,435787e-10,0,.746032,.434065,424839e-10,0,.777778,.414018,41436e-9,0,.809524,.39455,401902e-10,0,.84127,.375742,390813e-10,0,.873016,.357501,377116e-10,0,.904762,.339996,36535e-9,0,.936508,.323069,351265e-10,0,.968254,.306897,339112e-10,0,1,1,10396e-19,0,0,1,104326e-20,0,0,1,110153e-20,0,0,1,144668e-20,0,0,1,34528e-19,0,0,1,175958e-19,0,0,1,12627e-17,0,0,1,936074e-18,0,0,1,645742e-17,0,0,.999998,401228e-16,0,0,.999997,2.22338e-10,0,0,.999995,1.0967e-9,0,0,.999991,4.82132e-9,0,0,.999981,1.89434e-8,0,0,.999967,6.67716e-8,0,0,.999938,2.12066e-7,0,0,.999886,6.0977e-7,0,0,.999792,159504e-11,0,0,.999608,381191e-11,0,0,.999209,833727e-11,0,0,.998179,165288e-10,0,0,.994605,274387e-10,0,0,.979468,167316e-10,0,0,.967529,242877e-11,0,0,.966836,461696e-11,0,0,.96569,830977e-11,0,0,.963706,140427e-10,0,244659e-11,.960063,217353e-10,0,760774e-9,.953113,286606e-10,0,.00367261,.940192,247691e-10,0,.00940263,.927731,195814e-10,0,.018333,.920669,252531e-10,0,.0306825,.911799,324277e-10,0,.0465556,.89857,340982e-10,0,.0659521,.883283,319622e-10,0,.0887677,.86989,35548e-9,0,.114784,.855483,397143e-10,0,.143618,.837987,391665e-10,0,.174606,.820546,411306e-10,0,.206349,.802878,436753e-10,0,.238095,.783402,444e-7,0,.269841,.763439,458726e-10,0,.301587,.742925,467097e-10,0,.333333,.721633,478887e-10,0,.365079,.69985,481251e-10,0,.396825,.67783,491811e-10,0,.428571,.655126,488199e-10,0,.460318,.632697,496025e-10,0,.492064,.609613,48829e-9,0,.52381,.587098,492754e-10,0,.555556,.564119,482625e-10,0,.587302,.541813,482807e-10,0,.619048,.519342,471552e-10,0,.650794,.497514,466765e-10,0,.68254,.475879,455582e-10,0,.714286,.454789,446007e-10,0,.746032,.434217,435382e-10,0,.777778,.414086,421753e-10,0,.809524,.394744,412093e-10,0,.84127,.375782,396634e-10,0,.873016,.357707,386419e-10,0,.904762,.340038,370345e-10,0,.936508,.323284,359725e-10,0,.968254,.306954,3436e-8,0,1,1,599567e-19,0,0,1,600497e-19,0,0,1,614839e-19,0,0,1,686641e-19,0,0,1,972658e-19,0,0,1,221271e-18,0,0,1,833195e-18,0,0,1,403601e-17,0,0,.999999,206001e-16,0,0,.999998,1.01739e-10,0,0,.999997,4.70132e-10,0,0,.999993,2.00436e-9,0,0,.999988,7.83682e-9,0,0,.999979,2.80338e-8,0,0,.999962,9.17033e-8,0,0,.999933,2.74514e-7,0,0,.999881,7.53201e-7,0,0,.999783,189826e-11,0,0,.999594,440279e-11,0,0,.999178,93898e-10,0,0,.998073,181265e-10,0,0,.993993,280487e-10,0,0,.979982,149422e-10,0,0,.968145,378481e-11,0,0,.966786,53771e-10,0,0,.965611,947508e-11,0,388934e-10,.963557,156616e-10,0,9693e-7,.959752,235144e-10,0,.00370329,.952461,291568e-10,0,.00868428,.940193,240102e-10,0,.0161889,.929042,231235e-10,0,.0263948,.920266,273968e-10,0,.0394088,.911178,337915e-10,0,.0552818,.897873,333629e-10,0,.0740138,.884053,351405e-10,0,.0955539,.869455,378034e-10,0,.119795,.854655,399378e-10,0,.14656,.838347,419108e-10,0,.175573,.820693,440831e-10,0,.206388,.802277,445599e-10,0,.238095,.783634,472691e-10,0,.269841,.763159,476984e-10,0,.301587,.742914,491487e-10,0,.333333,.721662,502312e-10,0,.365079,.699668,502817e-10,0,.396825,.677839,51406e-9,0,.428571,.655091,511095e-10,0,.460317,.632665,516067e-10,0,.492064,.609734,512255e-10,0,.52381,.587043,510263e-10,0,.555556,.564298,50565e-9,0,.587302,.541769,497951e-10,0,.619048,.519529,492698e-10,0,.650794,.497574,482066e-10,0,.68254,.476028,473689e-10,0,.714286,.454961,461941e-10,0,.746032,.434341,450618e-10,0,.777778,.414364,438355e-10,0,.809524,.394832,424196e-10,0,.84127,.376109,412563e-10,0,.873016,.35779,396226e-10,0,.904762,.340379,384886e-10,0,.936508,.323385,368214e-10,0,.968254,.307295,356636e-10,0,1,1,106465e-17,0,0,1,106555e-17,0,0,1,107966e-17,0,0,1,114601e-17,0,0,1,137123e-17,0,0,1,21243e-16,0,0,.999999,489653e-17,0,0,.999999,160283e-16,0,0,.999998,62269e-15,0,0,.999997,2.51859e-10,0,0,.999996,9.96192e-10,0,0,.999992,3.74531e-9,0,0,.999986,1.32022e-8,0,0,.999975,4.33315e-8,0,0,.999959,1.31956e-7,0,0,.999927,3.72249e-7,0,0,.999871,9.72461e-7,0,0,.999771,235343e-11,0,0,.999572,52768e-10,0,0,.999133,109237e-10,0,0,.997912,203675e-10,0,0,.993008,279396e-10,0,0,.980645,139604e-10,0,0,.970057,646596e-11,0,0,.966717,65089e-10,0,474145e-10,.965497,111863e-10,0,89544e-8,.96334,179857e-10,0,.0032647,.959294,259045e-10,0,.0075144,.951519,292327e-10,0,.0138734,.940517,249769e-10,0,.0224952,.93014,26803e-9,0,.0334828,.91972,303656e-10,0,.0468973,.910294,353323e-10,0,.0627703,.897701,351002e-10,0,.0811019,.884522,388104e-10,0,.10186,.869489,412932e-10,0,.124985,.853983,415781e-10,0,.150372,.838425,454066e-10,0,.177868,.820656,471624e-10,0,.207245,.801875,475243e-10,0,.238143,.783521,505621e-10,0,.269841,.763131,50721e-9,0,.301587,.74261,523293e-10,0,.333333,.72148,528699e-10,0,.365079,.699696,538677e-10,0,.396825,.677592,539255e-10,0,.428571,.65525,546367e-10,0,.460317,.632452,541348e-10,0,.492064,.609903,544976e-10,0,.52381,.586928,536201e-10,0,.555556,.564464,535185e-10,0,.587302,.541801,524949e-10,0,.619048,.519681,51812e-9,0,.650794,.497685,507687e-10,0,.68254,.47622,496243e-10,0,.714286,.455135,485714e-10,0,.746032,.4346,471847e-10,0,.777778,.414564,459294e-10,0,.809524,.395165,444705e-10,0,.84127,.376333,430772e-10,0,.873016,.358197,416229e-10,0,.904762,.34064,401019e-10,0,.936508,.323816,386623e-10,0,.968254,.307581,370933e-10,0,1,1,991541e-17,0,0,1,992077e-17,0,0,1,100041e-16,0,0,1,10385e-15,0,0,1,115777e-16,0,0,1,150215e-16,0,0,.999999,254738e-16,0,0,.999999,598822e-16,0,0,.999998,1.79597e-10,0,0,.999997,6.02367e-10,0,0,.999994,2.06835e-9,0,0,.99999,6.94952e-9,0,0,.999984,2.23363e-8,0,0,.999972,6.78578e-8,0,0,.999952,1.93571e-7,0,0,.999919,5.16594e-7,0,0,.99986,128739e-11,0,0,.999753,299298e-11,0,0,.999546,648258e-11,0,0,.999074,129985e-10,0,0,.997671,232176e-10,0,0,.991504,256701e-10,0,0,.981148,131141e-10,0,0,.971965,869048e-11,0,280182e-10,.966624,808301e-11,0,695475e-9,.965344,135235e-10,0,.00265522,.963048,210592e-10,0,.00622975,.958673,287473e-10,0,.0116234,.950262,281379e-10,0,.018976,.940836,271089e-10,0,.0283844,.930996,30926e-9,0,.0399151,.919848,348359e-10,0,.0536063,.909136,366092e-10,0,.0694793,.897554,384162e-10,0,.0875342,.884691,430971e-10,0,.107749,.869414,447803e-10,0,.130087,.853462,452858e-10,0,.154481,.838187,495769e-10,0,.180833,.820381,502709e-10,0,.209005,.801844,522713e-10,0,.238791,.783061,541505e-10,0,.269869,.763205,553712e-10,0,.301587,.742362,564909e-10,0,.333333,.721393,572646e-10,0,.365079,.699676,581012e-10,0,.396825,.677395,58096e-9,0,.428571,.655208,585766e-10,0,.460317,.632451,583602e-10,0,.492064,.609839,580234e-10,0,.52381,.587093,577161e-10,0,.555556,.564467,568447e-10,0,.587302,.542043,563166e-10,0,.619048,.519826,55156e-9,0,.650794,.497952,541682e-10,0,.68254,.476477,528971e-10,0,.714286,.455412,514952e-10,0,.746032,.434926,502222e-10,0,.777778,.4149,485779e-10,0,.809524,.395552,472242e-10,0,.84127,.376712,454891e-10,0,.873016,.358622,440924e-10,0,.904762,.341048,422984e-10,0,.936508,.324262,408582e-10,0,.968254,.308013,390839e-10,0,1,1,613913e-16,0,0,1,614145e-16,0,0,1,617708e-16,0,0,1,633717e-16,0,0,1,681648e-16,0,0,1,808291e-16,0,0,1,1.14608e-10,0,0,.999998,2.10507e-10,0,0,.999997,4.99595e-10,0,0,.999995,1.39897e-9,0,0,.999994,4.19818e-9,0,0,.999988,1.27042e-8,0,0,.999979,3.75153e-8,0,0,.999965,1.06206e-7,0,0,.999945,2.85381e-7,0,0,.999908,7.23611e-7,0,0,.999846,17255e-10,0,0,.999733,386104e-11,0,0,.999511,808493e-11,0,0,.998993,156884e-10,0,0,.997326,265538e-10,0,0,.989706,206466e-10,0,0,.981713,130756e-10,0,70005e-10,.973636,106473e-10,0,464797e-9,.966509,10194e-9,0,.00201743,.965149,165881e-10,0,.00497549,.962669,249147e-10,0,.00953262,.95786,317449e-10,0,.0158211,.949334,281045e-10,0,.0239343,.941041,303263e-10,0,.0339372,.931575,356754e-10,0,.0458738,.920102,397075e-10,0,.059772,.908002,384886e-10,0,.075645,.897269,43027e-9,0,.0934929,.884559,479925e-10,0,.113302,.869161,48246e-9,0,.135045,.853342,509505e-10,0,.158678,.837633,542846e-10,0,.184136,.820252,554139e-10,0,.211325,.801872,581412e-10,0,.240113,.782418,585535e-10,0,.270306,.7631,610923e-10,0,.301594,.742183,613678e-10,0,.333333,.721098,627275e-10,0,.365079,.699512,629413e-10,0,.396825,.677372,636351e-10,0,.428571,.655059,633555e-10,0,.460317,.632567,636513e-10,0,.492064,.609784,628965e-10,0,.52381,.587237,625546e-10,0,.555556,.564525,615825e-10,0,.587302,.542181,605048e-10,0,.619048,.520017,596329e-10,0,.650794,.498204,581516e-10,0,.68254,.476742,569186e-10,0,.714286,.455803,553833e-10,0,.746032,.435251,537807e-10,0,.777778,.415374,522025e-10,0,.809524,.395921,503421e-10,0,.84127,.377253,488211e-10,0,.873016,.359021,468234e-10,0,.904762,.341637,453269e-10,0,.936508,.3247,433014e-10,0,.968254,.308625,418007e-10,0,1,1,2.86798e-10,0,0,1,2.86877e-10,0,0,1,2.88094e-10,0,0,1,2.93506e-10,0,0,1,3.09262e-10,0,0,.999999,3.48593e-10,0,0,.999999,4.44582e-10,0,0,.999998,6.88591e-10,0,0,.999996,1.34391e-9,0,0,.999993,3.17438e-9,0,0,.999989,8.35609e-9,0,0,.999983,2.28677e-8,0,0,.999974,6.23361e-8,0,0,.999959,1.65225e-7,0,0,.999936,4.19983e-7,0,0,.999896,101546e-11,0,0,.99983,232376e-11,0,0,.999709,50156e-10,0,0,.999469,10167e-9,0,0,.998886,190775e-10,0,0,.996819,300511e-10,0,0,.988837,185092e-10,0,1.68222e-7,.982178,134622e-10,0,259622e-9,.975017,125961e-10,0,.00142595,.967101,13507e-9,0,.00382273,.964905,205003e-10,0,.00764164,.96218,29546e-9,0,.0130121,.956821,343738e-10,0,.0200253,.948829,305063e-10,0,.0287452,.941092,346487e-10,0,.039218,.931883,412061e-10,0,.0514748,.920211,444651e-10,0,.0655351,.907307,431252e-10,0,.0814082,.89684,490382e-10,0,.0990939,.884119,53334e-9,0,.118583,.869148,54114e-9,0,.139856,.853377,578536e-10,0,.162882,.836753,592285e-10,0,.187615,.820063,622787e-10,0,.213991,.801694,645492e-10,0,.241918,.782116,65353e-9,0,.271267,.762673,674344e-10,0,.301847,.742133,682788e-10,0,.333333,.720779,691959e-10,0,.365079,.699386,696817e-10,0,.396826,.67732,699583e-10,0,.428572,.654888,698447e-10,0,.460318,.632499,694063e-10,0,.492064,.609825,691612e-10,0,.52381,.587287,681576e-10,0,.555556,.564743,674138e-10,0,.587302,.542409,661617e-10,0,.619048,.520282,647785e-10,0,.650794,.498506,633836e-10,0,.68254,.477102,615905e-10,0,.714286,.456167,601013e-10,0,.746032,.435728,581457e-10,0,.777778,.415809,564215e-10,0,.809524,.396517,544997e-10,0,.84127,.377737,525061e-10,0,.873016,.359698,506831e-10,0,.904762,.342164,48568e-9,0,.936508,.325417,467826e-10,0,.968254,.309186,446736e-10,0,1,1,1.09018e-9,0,0,1,1.0904e-9,0,0,1,1.09393e-9,0,0,1,1.1095e-9,0,0,1,1.154e-9,0,0,1,1.26089e-9,0,0,.999999,1.5059e-9,0,0,.999997,2.07899e-9,0,0,.999994,3.48164e-9,0,0,.999993,7.05728e-9,0,0,.999987,1.63692e-8,0,0,.999981,4.06033e-8,0,0,.999969,1.0245e-7,0,0,.999953,2.55023e-7,0,0,.999925,6.1511e-7,0,0,.999881,142218e-11,0,0,.99981,313086e-11,0,0,.99968,653119e-11,0,0,.999418,12832e-9,0,0,.998748,232497e-10,0,0,.996066,329522e-10,0,0,.988379,179613e-10,0,108799e-9,.982567,143715e-10,0,921302e-9,.976097,148096e-10,0,.00280738,.968475,178905e-10,0,.00596622,.964606,253921e-10,0,.0105284,.961564,348623e-10,0,.0165848,.955517,357612e-10,0,.0242,.948381,343493e-10,0,.03342,.941095,405849e-10,0,.0442777,.931923,475394e-10,0,.0567958,.91996,484328e-10,0,.0709879,.907419,502146e-10,0,.086861,.89618,561654e-10,0,.104415,.88337,587612e-10,0,.123643,.869046,618057e-10,0,.144531,.853278,657392e-10,0,.167057,.836091,66303e-9,0,.191188,.819644,704445e-10,0,.216878,.801246,714071e-10,0,.244062,.782031,740093e-10,0,.272649,.762066,74685e-9,0,.302509,.741964,766647e-10,0,.333442,.720554,766328e-10,0,.365079,.699098,777857e-10,0,.396826,.677189,774633e-10,0,.428572,.65484,776235e-10,0,.460318,.632496,770316e-10,0,.492064,.609908,762669e-10,0,.52381,.587312,753972e-10,0,.555556,.564938,739994e-10,0,.587302,.542577,728382e-10,0,.619048,.52062,71112e-9,0,.650794,.498819,694004e-10,0,.68254,.477555,675575e-10,0,.714286,.456568,653449e-10,0,.746032,.436278,636068e-10,0,.777778,.41637,613466e-10,0,.809524,.397144,594177e-10,0,.84127,.378412,570987e-10,0,.873016,.360376,550419e-10,0,.904762,.342906,527422e-10,0,.936508,.326136,506544e-10,0,.968254,.30997,484307e-10,0,1,1,3.54014e-9,0,0,1,3.54073e-9,0,0,1,3.54972e-9,0,0,1,3.58929e-9,0,0,1,3.70093e-9,0,0,.999999,3.96194e-9,0,0,.999998,4.53352e-9,0,0,.999997,5.78828e-9,0,0,.999994,8.63812e-9,0,0,.999991,1.53622e-8,0,0,.999985,3.16356e-8,0,0,.999977,7.12781e-8,0,0,.999964,1.66725e-7,0,0,.999945,3.90501e-7,0,0,.999912,8.95622e-7,0,0,.999866,198428e-11,0,0,.999786,421038e-11,0,0,.999647,850239e-11,0,0,.999356,162059e-10,0,0,.998563,282652e-10,0,0,.994928,336309e-10,0,244244e-10,.987999,178458e-10,0,523891e-9,.982893,159162e-10,0,.00194729,.977044,178056e-10,0,.00451099,.969972,230624e-10,0,.00835132,.964237,313922e-10,0,.013561,.960791,406145e-10,0,.0202056,.954292,372796e-10,0,.0283321,.948052,403199e-10,0,.0379739,.940938,479537e-10,0,.0491551,.931689,545292e-10,0,.0618918,.91987,54038e-9,0,.0761941,.907665,589909e-10,0,.0920672,.895281,642651e-10,0,.109511,.882621,659707e-10,0,.12852,.86873,709973e-10,0,.149085,.853008,742221e-10,0,.171189,.835944,761754e-10,0,.194809,.818949,797052e-10,0,.21991,.800951,812434e-10,0,.246447,.781847,838075e-10,0,.274352,.761649,84501e-9,0,.303535,.74152,860258e-10,0,.333857,.720495,866233e-10,0,.365104,.698742,868326e-10,0,.396826,.677096,87133e-9,0,.428572,.654782,863497e-10,0,.460318,.632335,860206e-10,0,.492064,.610031,849337e-10,0,.52381,.587457,838279e-10,0,.555556,.56513,82309e-9,0,.587302,.542877,803542e-10,0,.619048,.5209,786928e-10,0,.650794,.499291,765171e-10,0,.68254,.477971,744753e-10,0,.714286,.457221,72209e-9,0,.746032,.436803,697448e-10,0,.777778,.417083,675333e-10,0,.809524,.397749,648058e-10,0,.84127,.379177,625759e-10,0,.873016,.361061,598584e-10,0,.904762,.343713,575797e-10,0,.936508,.326894,549999e-10,0,.968254,.310816,527482e-10,0,1,1,1.0153e-8,0,0,1,1.01544e-8,0,0,1,1.01751e-8,0,0,1,1.02662e-8,0,0,1,1.0521e-8,0,0,.999999,1.11049e-8,0,0,.999999,1.23408e-8,0,0,.999996,1.4924e-8,0,0,.999992,2.04471e-8,0,0,.999989,3.26539e-8,0,0,.99998,6.03559e-8,0,0,.999971,1.23936e-7,0,0,.999955,2.69058e-7,0,0,.999933,5.93604e-7,0,0,.999901,129633e-11,0,0,.999847,275621e-11,0,0,.999761,564494e-11,0,0,.999607,110485e-10,0,0,.999282,204388e-10,0,0,.99831,341084e-10,0,2.2038e-7,.993288,294949e-10,0,242388e-9,.987855,192736e-10,0,.0012503,.983167,182383e-10,0,.0032745,.977908,218633e-10,0,.00646321,.971194,290662e-10,0,.0109133,.963867,386401e-10,0,.0166927,.95982,462827e-10,0,.0238494,.953497,420705e-10,0,.0324178,.947621,477743e-10,0,.0424225,.940611,568258e-10,0,.0538808,.931174,618061e-10,0,.0668047,.919919,627098e-10,0,.0812014,.907856,694714e-10,0,.0970745,.894509,735008e-10,0,.114424,.881954,763369e-10,0,.133246,.868309,821896e-10,0,.153534,.852511,83769e-9,0,.175275,.835821,881615e-10,0,.198453,.817981,896368e-10,0,.223042,.800504,930906e-10,0,.249009,.78141,945056e-10,0,.276304,.761427,963605e-10,0,.304862,.74094,968088e-10,0,.334584,.720233,981481e-10,0,.365322,.698592,979122e-10,0,.396826,.676763,981057e-10,0,.428571,.654808,973956e-10,0,.460318,.632326,962619e-10,0,.492064,.610049,952996e-10,0,.52381,.58763,933334e-10,0,.555556,.565261,917573e-10,0,.587302,.543244,896636e-10,0,.619048,.521273,873304e-10,0,.650794,.499818,852648e-10,0,.68254,.478536,823961e-10,0,.714286,.457826,79939e-9,0,.746032,.437549,77126e-9,0,.777778,.41776,743043e-10,0,.809524,.39863,716426e-10,0,.84127,.379954,686456e-10,0,.873016,.362025,660514e-10,0,.904762,.344581,630755e-10,0,.936508,.327909,605439e-10,0,.968254,.311736,576345e-10,0,1,1,2.63344e-8,0,0,1,2.63373e-8,0,0,1,2.63815e-8,0,0,1,2.65753e-8,0,0,1,2.71132e-8,0,0,.999999,2.83279e-8,0,0,.999997,3.0833e-8,0,0,.999995,3.58711e-8,0,0,.999992,4.61266e-8,0,0,.999985,6.7574e-8,0,0,.999977,1.1358e-7,0,0,.999966,2.13657e-7,0,0,.999948,4.31151e-7,0,0,.999923,8.96656e-7,0,0,.999884,186603e-11,0,0,.999826,381115e-11,0,0,.999732,754184e-11,0,0,.999561,143192e-10,0,0,.999191,257061e-10,0,0,.997955,405724e-10,0,744132e-10,.992228,276537e-10,0,716477e-9,.987638,208885e-10,0,.0022524,.983395,215226e-10,0,.00484816,.978614,270795e-10,0,.00860962,.972389,365282e-10,0,.0136083,.964392,474747e-10,0,.0198941,.95861,509141e-10,0,.0275023,.952806,48963e-9,0,.0364584,.94712,571119e-10,0,.04678,.940104,671704e-10,0,.0584799,.930398,687586e-10,0,.0715665,.919866,738161e-10,0,.086045,.907853,813235e-10,0,.101918,.894078,834582e-10,0,.119186,.881177,892093e-10,0,.137845,.867575,944548e-10,0,.157891,.852107,969607e-10,0,.179316,.835502,101456e-9,0,.202106,.81756,103256e-9,0,.226243,.79984,106954e-9,0,.251704,.780998,108066e-9,0,.278451,.761132,110111e-9,0,.306436,.740429,110459e-9,0,.335586,.719836,111219e-9,0,.365796,.698467,11145e-8,0,.3969,.676446,110393e-9,0,.428571,.654635,110035e-9,0,.460318,.632411,108548e-9,0,.492064,.609986,106963e-9,0,.52381,.587872,105238e-9,0,.555556,.565528,102665e-9,0,.587302,.543563,100543e-9,0,.619048,.52176,976182e-10,0,.650794,.500188,947099e-10,0,.68254,.479204,919929e-10,0,.714286,.458413,886139e-10,0,.746032,.438314,857839e-10,0,.777778,.418573,82411e-9,0,.809524,.39947,792211e-10,0,.84127,.380892,759546e-10,0,.873016,.362953,727571e-10,0,.904762,.345601,695738e-10,0,.936508,.328895,664907e-10,0,.968254,.312808,634277e-10,0,1,1,6.28647e-8,0,0,1,6.28705e-8,0,0,1,6.29587e-8,0,0,1,6.33441e-8,0,0,.999999,6.44087e-8,0,0,.999998,6.67856e-8,0,0,.999997,7.15889e-8,0,0,.999995,8.09577e-8,0,0,.999989,9.92764e-8,0,0,.999983,1.35834e-7,0,0,.999974,2.10482e-7,0,0,.999959,3.65215e-7,0,0,.999939,6.86693e-7,0,0,.999911,13472e-10,0,0,.999868,26731e-10,0,0,.999804,524756e-11,0,0,.9997,100403e-10,0,0,.99951,185019e-10,0,0,.999078,322036e-10,0,620676e-11,.997428,470002e-10,0,341552e-9,.99162,287123e-10,0,.00143727,.987479,234706e-10,0,.00349201,.983582,260083e-10,0,.0066242,.979186,337927e-10,0,.0109113,.97325,454689e-10,0,.0164064,.965221,573759e-10,0,.0231463,.957262,544114e-10,0,.0311571,.952211,587006e-10,0,.0404572,.946631,692256e-10,0,.0510592,.939391,787819e-10,0,.0629723,.929795,792368e-10,0,.0762025,.91965,875075e-10,0,.090753,.907737,950903e-10,0,.106626,.893899,972963e-10,0,.123822,.880239,10459e-8,0,.142337,.866562,107689e-9,0,.16217,.85164,113081e-9,0,.183314,.835021,116636e-9,0,.20576,.817311,120074e-9,0,.229496,.798845,121921e-9,0,.254502,.780479,12475e-8,0,.280753,.760694,125255e-9,0,.308212,.740142,126719e-9,0,.336825,.719248,12636e-8,0,.366517,.698209,126712e-9,0,.397167,.676398,125769e-9,0,.428578,.654378,124432e-9,0,.460318,.632484,123272e-9,0,.492064,.610113,12085e-8,0,.52381,.587931,118411e-9,0,.555556,.565872,11569e-8,0,.587302,.543814,112521e-9,0,.619048,.522265,109737e-9,0,.650794,.500835,106228e-9,0,.68254,.479818,102591e-9,0,.714286,.459258,991288e-10,0,.746032,.439061,952325e-10,0,.777778,.419552,91895e-9,0,.809524,.400399,879051e-10,0,.84127,.381976,844775e-10,0,.873016,.364009,806316e-10,0,.904762,.346761,771848e-10,0,.936508,.330049,735429e-10,0,.968254,.314018,702103e-10,0,1,1,1.39968e-7,0,0,1,1.39979e-7,0,0,1,1.40145e-7,0,0,1,1.4087e-7,0,0,.999999,1.42865e-7,0,0,.999998,1.47279e-7,0,0,.999997,1.56057e-7,0,0,.999992,1.7276e-7,0,0,.999989,2.04352e-7,0,0,.99998,2.6494e-7,0,0,.999969,3.83435e-7,0,0,.999953,6.18641e-7,0,0,.999929,108755e-11,0,0,.999898,201497e-11,0,0,.999849,381346e-11,0,0,.999778,719815e-11,0,0,.999661,133215e-10,0,0,.999451,238313e-10,0,0,.998936,401343e-10,0,113724e-9,.99662,517346e-10,0,820171e-9,.991094,304323e-10,0,.00238143,.987487,281757e-10,0,.00493527,.983731,320048e-10,0,.00856859,.979647,423905e-10,0,.0133393,.973837,562935e-10,0,.0192863,.96584,677442e-10,0,.0264369,.956309,623073e-10,0,.03481,.951523,704131e-10,0,.0444184,.946003,836594e-10,0,.0552713,.938454,911736e-10,0,.0673749,.929279,938264e-10,0,.0807329,.919239,103754e-9,0,.0953479,.907293,109928e-9,0,.111221,.893936,115257e-9,0,.128352,.879674,122265e-9,0,.14674,.865668,125733e-9,0,.166382,.850998,132305e-9,0,.187276,.834498,134844e-9,0,.209413,.816903,139276e-9,0,.232786,.798235,140984e-9,0,.257382,.779724,14378e-8,0,.283181,.760251,144623e-9,0,.310156,.739808,145228e-9,0,.338269,.718762,14539e-8,0,.367461,.697815,144432e-9,0,.397646,.67631,143893e-9,0,.428685,.654278,141846e-9,0,.460318,.632347,13935e-8,0,.492064,.610296,137138e-9,0,.52381,.588039,133806e-9,0,.555556,.566218,130755e-9,0,.587302,.544346,127128e-9,0,.619048,.522701,123002e-9,0,.650794,.501542,119443e-9,0,.68254,.480508,115055e-9,0,.714286,.460092,111032e-9,0,.746032,.440021,106635e-9,0,.777778,.420446,102162e-9,0,.809524,.401512,98184e-9,0,.84127,.38299,936497e-10,0,.873016,.365232,89813e-9,0,.904762,.347865,853073e-10,0,.936508,.331342,817068e-10,0,.968254,.315202,773818e-10,0,1,1,2.9368e-7,0,0,1,2.937e-7,0,0,1,2.93998e-7,0,0,1,2.95298e-7,0,0,.999999,2.98865e-7,0,0,.999998,3.067e-7,0,0,.999995,3.22082e-7,0,0,.999992,3.50767e-7,0,0,.999986,4.03538e-7,0,0,.999976,5.01372e-7,0,0,.999964,6.8562e-7,0,0,.999945,10374e-10,0,0,.999919,171269e-11,0,0,.999882,300175e-11,0,0,.999829,542144e-11,0,0,.999749,984182e-11,0,0,.99962,176213e-10,0,0,.999382,305995e-10,0,138418e-10,.998751,496686e-10,0,389844e-9,.995344,510733e-10,0,.00150343,.990768,345829e-10,0,.00352451,.987464,342841e-10,0,.00655379,.983846,399072e-10,0,.0106554,.980007,533219e-10,0,.0158723,.974494,696992e-10,0,.0222333,.96622,776754e-10,0,.029758,.956273,747718e-10,0,.0384596,.950952,864611e-10,0,.0483473,.945215,100464e-9,0,.0594266,.937287,103729e-9,0,.0717019,.928649,111665e-9,0,.0851752,.918791,12353e-8,0,.0998479,.906685,127115e-9,0,.115721,.893706,13628e-8,0,.132794,.879248,142427e-9,0,.151067,.864685,148091e-9,0,.170538,.850032,153517e-9,0,.191204,.833853,157322e-9,0,.213063,.816353,161086e-9,0,.236107,.797834,164111e-9,0,.260329,.778831,165446e-9,0,.285714,.759756,167492e-9,0,.312243,.739419,166928e-9,0,.339887,.718491,167e-6,0,.368604,.697392,165674e-9,0,.398329,.676102,163815e-9,0,.428961,.654243,162003e-9,0,.460331,.632176,158831e-9,0,.492064,.610407,155463e-9,0,.52381,.588394,152062e-9,0,.555556,.56645,147665e-9,0,.587302,.5449,14375e-8,0,.619048,.523276,138905e-9,0,.650794,.502179,134189e-9,0,.68254,.481359,129392e-9,0,.714286,.46092,124556e-9,0,.746032,.441084,11957e-8,0,.777778,.421517,114652e-9,0,.809524,.402721,109688e-9,0,.84127,.384222,104667e-9,0,.873016,.366534,999633e-10,0,.904762,.349205,950177e-10,0,.936508,.332702,907301e-10,0,.968254,.316599,859769e-10,0,1,1,5.85473e-7,0,0,1,5.85507e-7,0,0,1,5.8602e-7,0,0,.999999,5.88259e-7,0,0,.999999,5.94381e-7,0,0,.999998,6.07754e-7,0,0,.999995,6.33729e-7,0,0,.99999,6.8137e-7,0,0,.999984,7.67003e-7,0,0,.999973,9.21212e-7,0,0,.999959,120218e-11,0,0,.999936,172024e-11,0,0,.999907,268088e-11,0,0,.999866,445512e-11,0,0,.999806,768481e-11,0,0,.999716,1342e-8,0,0,.999576,232473e-10,0,0,.9993,391694e-10,0,129917e-9,.998498,608429e-10,0,845035e-9,.994132,489743e-10,0,.00237616,.99031,384644e-10,0,.00484456,.987409,421768e-10,0,.00832472,.983981,504854e-10,0,.0128643,.980268,671028e-10,0,.0184947,.974875,852749e-10,0,.025237,.966063,85531e-9,0,.0331046,.956779,900588e-10,0,.0421067,.950259,10577e-8,0,.0522487,.944239,119458e-9,0,.0635343,.936341,122164e-9,0,.0759654,.928047,134929e-9,0,.0895434,.918065,145544e-9,0,.104269,.906267,150531e-9,0,.120142,.893419,161652e-9,0,.137163,.878758,16593e-8,0,.15533,.863699,174014e-9,0,.174645,.848876,177877e-9,0,.195106,.833032,184049e-9,0,.21671,.815557,186088e-9,0,.239454,.797323,19054e-8,0,.263332,.778124,191765e-9,0,.288336,.758929,192535e-9,0,.314451,.738979,192688e-9,0,.341658,.718213,191522e-9,0,.369924,.696947,190491e-9,0,.399202,.675807,187913e-9,0,.429416,.654147,184451e-9,0,.460447,.63229,181442e-9,0,.492064,.610499,177139e-9,0,.523809,.588747,172596e-9,0,.555555,.566783,167457e-9,0,.587301,.545359,162518e-9,0,.619048,.523984,156818e-9,0,.650794,.502917,151884e-9,0,.68254,.482294,145514e-9,0,.714286,.461945,140199e-9,0,.746032,.442133,134101e-9,0,.777778,.422705,128374e-9,0,.809524,.403916,122996e-9,0,.84127,.38554,116808e-9,0,.873016,.367909,111973e-9,0,.904762,.350651,105938e-9,0,.936508,.334208,101355e-9,0,.968254,.318123,957629e-10,0,1,1,111633e-11,0,0,1,111639e-11,0,0,1,111725e-11,0,0,1,112096e-11,0,0,.999999,11311e-10,0,0,.999997,115315e-11,0,0,.999995,11956e-10,0,0,.999989,127239e-11,0,0,.999981,140772e-11,0,0,.999969,164541e-11,0,0,.999952,206607e-11,0,0,.999928,281783e-11,0,0,.999895,416835e-11,0,0,.999848,658728e-11,0,0,.999781,108648e-10,0,0,.999682,182579e-10,0,0,.999523,306003e-10,0,159122e-10,.999205,499862e-10,0,391184e-9,.998131,73306e-9,0,.00147534,.993334,513229e-10,0,.0034227,.99016,467783e-10,0,.00632232,.987321,523413e-10,0,.0102295,.984099,64267e-9,0,.0151794,.980432,843042e-10,0,.0211947,.974976,102819e-9,0,.0282899,.966429,996234e-10,0,.0364739,.957633,111074e-9,0,.0457522,.949422,128644e-9,0,.0561278,.943045,140076e-9,0,.0676023,.935448,146349e-9,0,.0801762,.927225,161854e-9,0,.0938499,.917033,169135e-9,0,.108623,.905762,179987e-9,0,.124496,.892879,189832e-9,0,.141469,.878435,195881e-9,0,.159541,.863114,20466e-8,0,.178713,.84776,209473e-9,0,.198985,.832084,214861e-9,0,.220355,.814915,217695e-9,0,.242823,.796711,220313e-9,0,.266385,.777603,22313e-8,0,.291036,.757991,222471e-9,0,.316767,.738371,222869e-9,0,.343563,.717872,221243e-9,0,.371402,.696619,218089e-9,0,.400248,.675379,21562e-8,0,.430047,.65411,21169e-8,0,.460709,.63241,206947e-9,0,.492079,.61046,201709e-9,0,.52381,.58903,196753e-9,0,.555556,.567267,189637e-9,0,.587302,.545886,184735e-9,0,.619048,.524714,177257e-9,0,.650794,.503789,171424e-9,0,.68254,.483204,164688e-9,0,.714286,.462976,157172e-9,0,.746032,.443294,151341e-9,0,.777778,.423988,143737e-9,0,.809524,.405325,138098e-9,0,.84127,.386981,130698e-9,0,.873016,.369436,125276e-9,0,.904762,.35219,118349e-9,0,.936508,.335804,11312e-8,0,.968254,.319749,106687e-9,0,1,1,204685e-11,0,0,1,204694e-11,0,0,1,204831e-11,0,0,.999999,205428e-11,0,0,.999999,207056e-11,0,0,.999997,210581e-11,0,0,.999993,21732e-10,0,0,.999987,229365e-11,0,0,.999979,250243e-11,0,0,.999965,286127e-11,0,0,.999947,348028e-11,0,0,.999918,455588e-11,0,0,.999881,643303e-11,0,0,.999828,970064e-11,0,0,.999753,153233e-10,0,0,.999642,24793e-9,0,0,.999464,402032e-10,0,122947e-9,.999089,635852e-10,0,807414e-9,.997567,857026e-10,0,.00227206,.992903,594912e-10,0,.00462812,.990011,578515e-10,0,.00794162,.987192,65399e-9,0,.0122534,.98418,819675e-10,0,.0175888,.980491,105514e-9,0,.0239635,.974779,121532e-9,0,.031387,.96675,119144e-9,0,.0398644,.958248,136125e-9,0,.0493982,.948884,155408e-9,0,.0599896,.941673,162281e-9,0,.0716382,.934521,176754e-9,0,.0843437,.926205,192873e-9,0,.0981056,.916089,200038e-9,0,.112923,.904963,213624e-9,0,.128796,.892089,221834e-9,0,.145725,.878028,232619e-9,0,.163709,.86249,238632e-9,0,.182749,.846587,247002e-9,0,.202847,.830988,250702e-9,0,.224001,.814165,255562e-9,0,.246214,.796135,257505e-9,0,.269482,.777052,258625e-9,0,.293805,.757201,258398e-9,0,.319176,.737655,256714e-9,0,.345587,.717477,255187e-9,0,.373021,.696433,251792e-9,0,.401454,.675084,247223e-9,0,.430844,.653907,242213e-9,0,.461125,.632561,237397e-9,0,.492187,.610658,229313e-9,0,.52381,.589322,224402e-9,0,.555556,.567857,216116e-9,0,.587302,.54652,209124e-9,0,.619048,.525433,201601e-9,0,.650794,.504679,192957e-9,0,.68254,.484203,186052e-9,0,.714286,.464203,177672e-9,0,.746032,.444549,170005e-9,0,.777778,.425346,162401e-9,0,.809524,.406706,1544e-7,0,.84127,.388576,147437e-9,0,.873016,.37094,139493e-9,0,.904762,.353996,133219e-9,0,.936508,.337391,125573e-9,0,.968254,.321648,119867e-9,0,1,1,362511e-11,0,0,1,362525e-11,0,0,1,362739e-11,0,0,.999999,363673e-11,0,0,.999998,366214e-11,0,0,.999996,371698e-11,0,0,.999992,382116e-11,0,0,.999986,400554e-11,0,0,.999976,432058e-11,0,0,.999961,485194e-11,0,0,.999938,574808e-11,0,0,.999908,726643e-11,0,0,.999865,984707e-11,0,0,.999807,142217e-10,0,0,.999723,215581e-10,0,0,.999602,336114e-10,0,119113e-10,.999398,527353e-10,0,355813e-9,.998946,805809e-10,0,.00137768,.996647,942908e-10,0,.00322469,.992298,668733e-10,0,.00597897,.989802,716564e-10,0,.00968903,.987019,821355e-10,0,.0143845,.984219,104555e-9,0,.0200831,.980425,131245e-9,0,.0267948,.974241,139613e-9,0,.034525,.967006,145931e-9,0,.0432757,.95893,167153e-9,0,.0530471,.949157,188146e-9,0,.0638386,.94062,194625e-9,0,.0756487,.933509,213721e-9,0,.0884762,.925088,229616e-9,0,.10232,.915178,239638e-9,0,.117178,.904093,254814e-9,0,.133051,.891337,263685e-9,0,.149939,.877326,274789e-9,0,.167841,.861794,280534e-9,0,.18676,.845758,289534e-9,0,.206696,.829792,294446e-9,0,.22765,.813037,296877e-9,0,.249625,.795285,300217e-9,0,.27262,.776323,299826e-9,0,.296636,.756673,299787e-9,0,.321671,.736856,297867e-9,0,.347718,.716883,294052e-9,0,.374768,.696089,289462e-9,0,.402804,.67505,285212e-9,0,.431796,.653509,27653e-8,0,.461695,.63258,271759e-9,0,.49242,.61104,262811e-9,0,.523822,.589567,255151e-9,0,.555556,.568322,246434e-9,0,.587302,.547235,237061e-9,0,.619048,.52616,228343e-9,0,.650794,.505716,219236e-9,0,.68254,.485274,209595e-9,0,.714286,.465411,201011e-9,0,.746032,.445854,19109e-8,0,.777778,.426911,182897e-9,0,.809524,.408222,173569e-9,0,.84127,.390307,165496e-9,0,.873016,.372624,156799e-9,0,.904762,.355804,14917e-8,0,.936508,.33924,140907e-9,0,.968254,.323534,134062e-9,0,1,1,622487e-11,0,0,1,62251e-10,0,0,1,622837e-11,0,0,.999999,624259e-11,0,0,.999998,628127e-11,0,0,.999996,636451e-11,0,0,.999991,65218e-10,0,0,.999984,679782e-11,0,0,.999973,726361e-11,0,0,.999955,803644e-11,0,0,.999931,931397e-11,0,0,.999896,114299e-10,0,0,.999847,149402e-10,0,0,.999784,207461e-10,0,0,.999692,302493e-10,0,0,.999554,454957e-10,0,997275e-10,.999326,690762e-10,0,724813e-9,.998757,101605e-9,0,.0020972,.995367,958745e-10,0,.00432324,.99209,832808e-10,0,.00746347,.989517,887601e-10,0,.0115534,.987008,10564e-8,0,.0166134,.98421,133179e-9,0,.0226552,.98021,161746e-9,0,.0296838,.973676,161821e-9,0,.0377016,.967052,178635e-9,0,.0467079,.959385,206765e-9,0,.0567013,.949461,22476e-8,0,.0676796,.939578,23574e-8,0,.0796403,.932416,25893e-8,0,.0925812,.923759,271228e-9,0,.106501,.914223,289165e-9,0,.121397,.902942,301156e-9,0,.13727,.890419,313852e-9,0,.15412,.876639,324408e-9,0,.171946,.861316,33249e-8,0,.190751,.84496,338497e-9,0,.210537,.828427,345861e-9,0,.231305,.811871,347863e-9,0,.253057,.794397,350225e-9,0,.275797,.775726,349915e-9,0,.299525,.75617,347297e-9,0,.324242,.736091,344232e-9,0,.349947,.716213,340835e-9,0,.376633,.695736,332369e-9,0,.404289,.674961,327943e-9,0,.432895,.653518,318533e-9,0,.462415,.632574,310391e-9,0,.492788,.61134,300755e-9,0,.523909,.590017,290506e-9,0,.555556,.568752,280446e-9,0,.587302,.548061,269902e-9,0,.619048,.52711,258815e-9,0,.650794,.506682,248481e-9,0,.68254,.486524,237141e-9,0,.714286,.466812,226872e-9,0,.746032,.44732,216037e-9,0,.777778,.428473,205629e-9,0,.809524,.409921,195691e-9,0,.84127,.392028,185457e-9,0,.873016,.374606,176436e-9,0,.904762,.357601,166508e-9,0,.936508,.341348,158385e-9,0,.968254,.32542,149203e-9,0,1,1,103967e-10,0,0,1,10397e-9,0,0,1,104019e-10,0,0,.999999,104231e-10,0,0,.999998,104806e-10,0,0,.999995,106042e-10,0,0,.999991,108366e-10,0,0,.999982,112415e-10,0,0,.999968,119174e-10,0,0,.99995,130227e-10,0,0,.999922,148176e-10,0,0,.999884,177303e-10,0,0,.99983,224564e-10,0,0,.999758,300966e-10,0,0,.999654,423193e-10,0,549083e-11,.999503,614848e-10,0,296087e-9,.999237,903576e-10,0,.00123144,.998491,1271e-7,0,.00295954,.994594,107754e-9,0,.00555829,.99178,103025e-9,0,.00907209,.989265,11154e-8,0,.0135257,.986998,136296e-9,0,.0189327,.984137,169154e-9,0,.0252993,.979798,196671e-9,0,.0326272,.97337,196678e-9,0,.0409157,.967239,223121e-9,0,.0501623,.959543,253809e-9,0,.0603638,.949466,265972e-9,0,.0715171,.939074,288372e-9,0,.0836187,.931118,310983e-9,0,.0966657,.922525,325561e-9,0,.110656,.912983,345725e-9,0,.125588,.901617,3556e-7,0,.141461,.889487,374012e-9,0,.158275,.875787,383445e-9,0,.176031,.860654,393972e-9,0,.19473,.844417,400311e-9,0,.214374,.82741,405004e-9,0,.234967,.810545,407378e-9,0,.256512,.793312,407351e-9,0,.279011,.774847,406563e-9,0,.302468,.755621,404903e-9,0,.326887,.735511,397486e-9,0,.352266,.715435,39357e-8,0,.378605,.695403,384739e-9,0,.405897,.674681,376108e-9,0,.43413,.65359,365997e-9,0,.463277,.632471,354957e-9,0,.493295,.61151,343593e-9,0,.524106,.59064,331841e-9,0,.555561,.569386,318891e-9,0,.587302,.548785,3072e-7,0,.619048,.528146,29361e-8,0,.650794,.507872,281709e-9,0,.68254,.487805,268627e-9,0,.714286,.468196,255887e-9,0,.746032,.448922,243997e-9,0,.777778,.430093,231662e-9,0,.809524,.411845,220339e-9,0,.84127,.393808,208694e-9,0,.873016,.376615,198045e-9,0,.904762,.359655,187375e-9,0,.936508,.343452,177371e-9,0,.968254,.32765,167525e-9,0,1,1,169351e-10,0,0,1,169356e-10,0,0,1,169427e-10,0,0,.999999,169736e-10,0,0,.999998,170575e-10,0,0,.999995,172372e-10,0,0,.99999,175739e-10,0,0,.999979,181568e-10,0,0,.999966,191206e-10,0,0,.999944,20677e-9,0,0,.999912,231644e-10,0,0,.999869,271268e-10,0,0,.999811,334272e-10,0,0,.99973,433979e-10,0,0,.999617,590083e-10,0,680315e-10,.999445,829497e-10,0,612796e-9,.999138,118019e-9,0,.00187408,.998095,156712e-9,0,.00395791,.993919,125054e-9,0,.00692144,.991333,126091e-9,0,.0107962,.989226,144912e-9,0,.0155986,.986954,175737e-9,0,.0213364,.983982,213883e-9,0,.0280114,.979128,234526e-9,0,.0356226,.973327,243725e-9,0,.0441668,.967416,2773e-7,0,.0536399,.959729,308799e-9,0,.0640376,.949758,322447e-9,0,.0753554,.939173,350021e-9,0,.0875893,.9296,370089e-9,0,.100736,.921181,391365e-9,0,.114793,.91164,413636e-9,0,.129759,.900435,427068e-9,0,.145632,.888183,441046e-9,0,.162412,.874772,454968e-9,0,.180101,.859566,461882e-9,0,.1987,.843579,471556e-9,0,.218213,.826453,474335e-9,0,.238641,.809164,477078e-9,0,.259989,.792179,47755e-8,0,.282262,.773866,472573e-9,0,.305464,.754944,469765e-9,0,.329599,.735133,462371e-9,0,.35467,.714858,453674e-9,0,.380678,.694829,443888e-9,0,.407622,.674453,432052e-9,0,.435493,.653685,420315e-9,0,.464275,.632666,406829e-9,0,.493938,.611676,392234e-9,0,.524422,.591193,379208e-9,0,.555624,.570145,36319e-8,0,.587302,.549566,349111e-9,0,.619048,.529278,334166e-9,0,.650794,.509026,318456e-9,0,.68254,.489186,30449e-8,0,.714286,.469662,289051e-9,0,.746032,.450691,275494e-9,0,.777778,.431841,261437e-9,0,.809524,.413752,247846e-9,0,.84127,.395951,235085e-9,0,.873016,.378633,222245e-9,0,.904762,.36194,210533e-9,0,.936508,.345599,198494e-9,0,.968254,.329999,188133e-9,0,1,1,269663e-10,0,0,1,26967e-9,0,0,1,269772e-10,0,0,.999999,270214e-10,0,0,.999998,271415e-10,0,0,.999994,27398e-9,0,0,.999988,278771e-10,0,0,.999977,287019e-10,0,0,.999961,300544e-10,0,0,.999937,322138e-10,0,0,.999904,356163e-10,0,0,.999854,409465e-10,0,0,.99979,492651e-10,0,0,.999699,621722e-10,0,8.8288e-7,.999572,819715e-10,0,223369e-9,.999381,111689e-9,0,.00105414,.999016,153862e-9,0,.0026493,.997437,187667e-9,0,.00508608,.993545,155672e-9,0,.00840554,.991135,161455e-9,0,.012629,.989157,188241e-9,0,.0177661,.986874,226229e-9,0,.0238198,.983714,268668e-9,0,.0307887,.978301,277109e-9,0,.0386688,.973227,303446e-9,0,.0474554,.967317,341851e-9,0,.0571428,.959477,370885e-9,0,.0677256,.950012,392753e-9,0,.0791988,.939484,42781e-8,0,.0915576,.928135,443866e-9,0,.104798,.919819,472959e-9,0,.118918,.910049,491551e-9,0,.133915,.899181,512616e-9,0,.149788,.886881,523563e-9,0,.166537,.87359,540183e-9,0,.184164,.858613,547386e-9,0,.202669,.842809,554809e-9,0,.222056,.825727,558316e-9,0,.242329,.808086,557824e-9,0,.263492,.790728,556346e-9,0,.285551,.772987,552672e-9,0,.30851,.7541,543738e-9,0,.332376,.734669,536107e-9,0,.357153,.714411,523342e-9,0,.382845,.694196,512238e-9,0,.409454,.674252,497465e-9,0,.436977,.65357,481096e-9,0,.465404,.632999,467054e-9,0,.494713,.611994,448771e-9,0,.524864,.591604,431889e-9,0,.555779,.571134,415238e-9,0,.587302,.550528,396369e-9,0,.619048,.530292,379477e-9,0,.650794,.510364,361488e-9,0,.68254,.490749,343787e-9,0,.714286,.471266,327822e-9,0,.746032,.452462,310626e-9,0,.777778,.433907,295352e-9,0,.809524,.415659,279179e-9,0,.84127,.398138,264685e-9,0,.873016,.380833,249905e-9,0,.904762,.364247,236282e-9,0,.936508,.348041,222905e-9,0,.968254,.332389,210522e-9,0,1,1,420604e-10,0,0,1,420614e-10,0,0,1,420757e-10,0,0,.999999,42138e-9,0,0,.999997,423067e-10,0,0,.999993,426668e-10,0,0,.999986,433372e-10,0,0,.999974,444857e-10,0,0,.999956,463554e-10,0,0,.99993,493105e-10,0,0,.999892,539077e-10,0,0,.999838,610005e-10,0,0,.999767,718822e-10,0,0,.999666,884581e-10,0,365471e-10,.999525,113398e-9,0,485623e-9,.999311,150043e-9,0,.00162096,.998865,200063e-9,0,.00355319,.996278,211014e-9,0,.00633818,.992956,189672e-9,0,.0100043,.991017,210262e-9,0,.0145648,.989055,244292e-9,0,.0200237,.986741,290481e-9,0,.0263798,.983288,334303e-9,0,.033629,.977784,340307e-9,0,.0417652,.973037,377864e-9,0,.0507821,.967181,4239e-7,0,.060673,.958971,443854e-9,0,.0714314,.950093,483039e-9,0,.0830518,.939552,517934e-9,0,.0955288,.927678,539449e-9,0,.108859,.918278,568604e-9,0,.123038,.908449,588505e-9,0,.138065,.897713,612473e-9,0,.153938,.885533,625575e-9,0,.170657,.872131,63854e-8,0,.188224,.857517,647034e-9,0,.20664,.841796,65209e-8,0,.225909,.824726,6544e-7,0,.246035,.807297,655744e-9,0,.267022,.789058,646716e-9,0,.288878,.77189,643898e-9,0,.311607,.753082,629973e-9,0,.335216,.7341,621564e-9,0,.359713,.714094,605171e-9,0,.385103,.693839,588752e-9,0,.41139,.673891,573294e-9,0,.438576,.653565,552682e-9,0,.466656,.633326,533446e-9,0,.495617,.612582,514635e-9,0,.525431,.59205,49303e-8,0,.556041,.571918,471842e-9,0,.587338,.551572,451713e-9,0,.619048,.531553,430049e-9,0,.650794,.51175,410445e-9,0,.68254,.49238,390098e-9,0,.714286,.473143,370033e-9,0,.746032,.45423,351205e-9,0,.777778,.435963,332049e-9,0,.809524,.41787,315021e-9,0,.84127,.400387,297315e-9,0,.873016,.383332,281385e-9,0,.904762,.366665,265397e-9,0,.936508,.350633,250601e-9,0,.968254,.334964,23589e-8,0,1,1,643736e-10,0,0,1,64375e-9,0,0,1,643947e-10,0,0,.999999,64481e-9,0,0,.999997,647143e-10,0,0,.999994,652119e-10,0,0,.999985,661359e-10,0,0,.999972,677116e-10,0,0,.999952,702599e-10,0,0,.999922,742517e-10,0,0,.99988,803906e-10,0,0,.99982,897315e-10,0,0,.999741,103838e-9,0,0,.999629,12496e-8,0,149024e-9,.999474,156161e-9,0,861027e-9,.999229,201034e-9,0,.00231198,.998662,259069e-9,0,.00458147,.995299,245439e-9,0,.00770895,.992732,24498e-8,0,.0117126,.990847,273211e-9,0,.0165989,.988911,316492e-9,0,.0223674,.98654,37161e-8,0,.0290135,.982636,410352e-9,0,.0365309,.977346,421756e-9,0,.0449117,.972909,475578e-9,0,.0541481,.966821,522482e-9,0,.0642326,.958686,545008e-9,0,.075158,.949754,589286e-9,0,.0869181,.939184,619995e-9,0,.0995074,.927505,654266e-9,0,.112922,.916606,682362e-9,0,.127157,.906707,704286e-9,0,.142212,.895937,725909e-9,0,.158085,.883913,743939e-9,0,.174776,.870642,755157e-9,0,.192287,.856241,764387e-9,0,.210619,.84069,771032e-9,0,.229775,.823728,765906e-9,0,.249761,.806481,767604e-9,0,.270582,.787924,754385e-9,0,.292243,.770588,749668e-9,0,.314753,.751991,731613e-9,0,.338118,.733407,717655e-9,0,.362347,.713688,700604e-9,0,.387447,.693595,678765e-9,0,.413424,.673426,657042e-9,0,.440284,.65359,635892e-9,0,.468027,.633576,611569e-9,0,.496645,.613144,586011e-9,0,.526122,.592711,563111e-9,0,.556417,.572722,537699e-9,0,.587451,.552762,512556e-9,0,.619048,.532985,489757e-9,0,.650794,.513219,464139e-9,0,.68254,.493992,442193e-9,0,.714286,.47509,418629e-9,0,.746032,.456287,397045e-9,0,.777778,.438152,375504e-9,0,.809524,.420294,35492e-8,0,.84127,.402749,335327e-9,0,.873016,.385879,316422e-9,0,.904762,.369352,298333e-9,0,.936508,.353301,281417e-9,0,.968254,.337781,265203e-9,0,1,1,968267e-10,0,0,1,968284e-10,0,0,1,968556e-10,0,0,.999999,969733e-10,0,0,.999997,972913e-10,0,0,.999993,979688e-10,0,0,.999984,992239e-10,0,0,.999969,101356e-9,0,0,.999946,104784e-9,0,0,.999913,110111e-9,0,0,.999868,118217e-9,0,0,.999801,130396e-9,0,0,.999712,148523e-9,0,124907e-10,.999589,175233e-9,0,355405e-9,.999416,213999e-9,0,.0013528,.999136,268529e-9,0,.00312557,.998367,333088e-9,0,.00573045,.994701,304757e-9,0,.00919397,.992497,318031e-9,0,.0135261,.990608,353863e-9,0,.0187278,.988715,409044e-9,0,.0247947,.986241,472967e-9,0,.0317196,.981696,495104e-9,0,.039494,.977097,532873e-9,0,.0481087,.972583,594447e-9,0,.0575549,.966142,636867e-9,0,.0678242,.95823,669899e-9,0,.0789089,.949677,719499e-9,0,.0908023,.939226,750584e-9,0,.103499,.927501,793183e-9,0,.116993,.915199,81995e-8,0,.131282,.90498,847654e-9,0,.146364,.894243,868929e-9,0,.162237,.882154,884278e-9,0,.178902,.869161,898108e-9,0,.196358,.854751,901254e-9,0,.21461,.839368,90679e-8,0,.23366,.822874,901541e-9,0,.253512,.805514,897297e-9,0,.274174,.78716,881856e-9,0,.29565,.769061,870032e-9,0,.31795,.751,851719e-9,0,.341081,.732614,830671e-9,0,.365053,.713171,806569e-9,0,.389874,.693472,78338e-8,0,.415553,.673528,756404e-9,0,.442098,.653397,726872e-9,0,.469512,.633781,700494e-9,0,.497794,.613877,67105e-8,0,.526935,.593506,640361e-9,0,.556908,.573667,613502e-9,0,.587657,.553932,583177e-9,0,.61906,.534345,554375e-9,0,.650794,.515042,527811e-9,0,.68254,.495674,499367e-9,0,.714286,.477132,47429e-8,0,.746032,.458609,447726e-9,0,.777778,.440354,424205e-9,0,.809524,.422765,399549e-9,0,.84127,.405472,378315e-9,0,.873016,.388482,355327e-9,0,.904762,.372191,336122e-9,0,.936508,.356099,315247e-9,0,.968254,.340737,29794e-8,0,1,1,143327e-9,0,0,1,14333e-8,0,0,1,143366e-9,0,0,.999999,143524e-9,0,0,.999996,143952e-9,0,0,.999991,144862e-9,0,0,.999981,146544e-9,0,0,.999966,149391e-9,0,0,.999941,153946e-9,0,0,.999905,160971e-9,0,0,.999852,171562e-9,0,0,.99978,18729e-8,0,0,.999681,210386e-9,0,826239e-10,.999546,243906e-9,0,664807e-9,.999352,291739e-9,0,.00196192,.999027,357419e-9,0,.00405941,.997886,422349e-9,0,.00699664,.99419,385008e-9,0,.0107896,.99214,409775e-9,0,.0154415,.990274,456418e-9,0,.0209488,.988455,527008e-9,0,.0273037,.985804,597685e-9,0,.0344969,.98103,613124e-9,0,.0425183,.976674,668321e-9,0,.0513575,.972021,736985e-9,0,.0610046,.965274,773789e-9,0,.0714508,.958046,830852e-9,0,.0826877,.949333,875766e-9,0,.0947085,.939135,917088e-9,0,.107507,.927119,952244e-9,0,.121078,.91469,990626e-9,0,.135419,.903006,.00101304,0,.150526,.892368,.00103834,0,.166399,.880231,.00105002,0,.183038,.867432,.00106331,0,.200443,.853208,.00106783,0,.218618,.837956,.00106458,0,.237566,.821772,.00105945,0,.257291,.804328,.00104685,0,.2778,.786465,.00103178,0,.2991,.768004,.00101077,0,.321199,.74972,985504e-9,0,.344106,.731682,962893e-9,0,.36783,.712813,932146e-9,0,.392383,.693139,89871e-8,0,.417774,.673566,869678e-9,0,.444013,.653483,835525e-9,0,.471107,.633891,799853e-9,0,.49906,.614433,766838e-9,0,.527869,.594586,732227e-9,0,.557517,.574769,696442e-9,0,.587966,.555149,663935e-9,0,.61913,.535898,629826e-9,0,.650794,.516753,596486e-9,0,.68254,.497816,567078e-9,0,.714286,.479034,534399e-9,0,.746032,.460975,507013e-9,0,.777778,.442935,477421e-9,0,.809524,.425263,451101e-9,0,.84127,.408248,424964e-9,0,.873016,.391339,39993e-8,0,.904762,.37513,377619e-9,0,.936508,.359172,354418e-9,0,.968254,.343876,334823e-9,0,1,1,209042e-9,0,0,1,209045e-9,0,0,1,209093e-9,0,0,.999999,209304e-9,0,0,.999996,209871e-9,0,0,.999991,211078e-9,0,0,.999979,213304e-9,0,0,.999963,217061e-9,0,0,.999933,223042e-9,0,0,.999894,232206e-9,0,0,.999837,245901e-9,0,0,.999756,266023e-9,0,102927e-11,.999648,295204e-9,0,233468e-9,.999499,336958e-9,0,.00108237,.999283,395563e-9,0,.00268832,.998896,473785e-9,0,.00511138,.997006,520008e-9,0,.00837705,.993819,497261e-9,0,.0124928,.991632,523722e-9,0,.0174561,.989875,587258e-9,0,.0232596,.988109,676329e-9,0,.0298932,.985155,747701e-9,0,.0373453,.980479,768803e-9,0,.0456045,.976271,841054e-9,0,.0546593,.971347,911469e-9,0,.0644994,.964528,953057e-9,0,.0751152,.957632,.00102221,0,.0864981,.948681,.00106122,0,.0986407,.938716,.00111857,0,.111537,.926629,.00114762,0,.125182,.914025,.00118995,0,.139571,.901026,.00121228,0,.154703,.890358,.00123946,0,.170576,.878283,.0012527,0,.18719,.865459,.00125536,0,.204547,.851407,.00126134,0,.222648,.836276,.00124759,0,.241498,.820436,.00124443,0,.261101,.803253,.00122071,0,.281465,.785562,.00120107,0,.302595,.76718,.00117762,0,.324501,.748551,.00114289,0,.347192,.730564,.00110872,0,.370679,.712253,.00107636,0,.394973,.692867,.00103646,0,.420085,.673695,996793e-9,0,.446027,.653912,95675e-8,0,.47281,.634129,916739e-9,0,.500441,.615004,874401e-9,0,.528921,.595587,833411e-9,0,.558244,.575965,794556e-9,0,.588384,.5566,75196e-8,0,.619281,.537428,716381e-9,0,.650795,.518623,676558e-9,0,.68254,.499964,64074e-8,0,.714286,.481356,605984e-9,0,.746032,.463279,570256e-9,0,.777778,.445673,540138e-9,0,.809524,.428032,507299e-9,0,.84127,.411112,479553e-9,0,.873016,.394444,450737e-9,0,.904762,.378247,424269e-9,0,.936508,.362415,399111e-9,0,.968254,.347103,375274e-9,0,1,1,300729e-9,0,0,1,300733e-9,0,0,1,300797e-9,0,0,.999998,301072e-9,0,0,.999996,301817e-9,0,0,.999989,303398e-9,0,0,.999977,306309e-9,0,0,.999958,311209e-9,0,0,.999927,318975e-9,0,0,.999884,330804e-9,0,0,.99982,34834e-8,0,0,.999733,373854e-9,0,326995e-10,.999613,410424e-9,0,477174e-9,.999447,462047e-9,0,.00161099,.999204,533322e-9,0,.00353153,.998725,624964e-9,0,.00627965,.995871,631786e-9,0,.0098693,.993194,632017e-9,0,.0143011,.991541,68923e-8,0,.019568,.989773,766892e-9,0,.0256593,.987647,863668e-9,0,.0325625,.984193,922089e-9,0,.0402647,.980016,970749e-9,0,.0487532,.975859,.00106027,0,.058016,.970514,.00112239,0,.0680419,.963625,.00117212,0,.0788208,.956959,.00125211,0,.0903439,.947956,.00129411,0,.102604,.93809,.00135879,0,.115594,.92659,.00139309,0,.129309,.913829,.00143253,0,.143745,.90005,.00145809,0,.158901,.888129,.0014748,0,.174774,.87607,.00148756,0,.191365,.863461,.00148714,0,.208674,.849594,.00148892,0,.226705,.834531,.00146496,0,.245461,.81903,.0014579,0,.264947,.802122,.00143039,0,.28517,.78445,.00139717,0,.306137,.766434,.00136312,0,.327857,.747816,.00132597,0,.350341,.729519,.00128323,0,.373598,.711454,.00123803,0,.397642,.692699,.00119097,0,.422485,.673723,.00114565,0,.448139,.654386,.00109552,0,.474619,.634673,.00104553,0,.501933,.615554,99985e-8,0,.530089,.596462,948207e-9,0,.559087,.577385,902299e-9,0,.588913,.558257,856448e-9,0,.619525,.5392,810395e-9,0,.650826,.520543,768558e-9,0,.68254,.502206,7239e-7,0,.714286,.48402,685794e-9,0,.746032,.465779,64471e-8,0,.777778,.448455,609583e-9,0,.809524,.431091,57227e-8,0,.84127,.414147,54042e-8,0,.873016,.39765,506545e-9,0,.904762,.381576,477635e-9,0,.936508,.365881,448446e-9,0,.968254,.350582,421424e-9,0,1,1,427144e-9,0,0,1,427151e-9,0,0,1,427232e-9,0,0,.999998,42759e-8,0,0,.999995,428555e-9,0,0,.999988,430603e-9,0,0,.999976,434368e-9,0,0,.999952,440688e-9,0,0,.999919,450667e-9,0,0,.999871,46578e-8,0,0,.999801,488024e-9,0,0,.999704,520092e-9,0,129791e-9,.999572,565553e-9,0,821056e-9,.999389,628906e-9,0,.00225241,.999114,714911e-9,0,.00449109,.998488,819218e-9,0,.00756249,.995234,80415e-8,0,.0114716,.993021,830181e-9,0,.0162131,.991407,902645e-9,0,.021776,.989625,996934e-9,0,.0281471,.987064,.00109707,0,.0353118,.983265,.00114353,0,.0432562,.979535,.0012272,0,.0519665,.975224,.00132642,0,.0614298,.969574,.00138092,0,.0716348,.963021,.00145896,0,.0825709,.956046,.00152834,0,.094229,.947136,.00158217,0,.106602,.937313,.0016347,0,.119682,.926073,.00168383,0,.133465,.913121,.00171627,0,.147947,.899165,.00174229,0,.163125,.885891,.00176137,0,.178998,.873783,.00176406,0,.195566,.861331,.00176156,0,.21283,.847569,.00175346,0,.230793,.832785,.00172753,0,.249459,.817442,.00170204,0,.268832,.800613,.00166576,0,.28892,.783597,.00162909,0,.30973,.76571,.0015826,0,.331271,.747021,.00153106,0,.353554,.728593,.00148036,0,.37659,.710661,.00142808,0,.400391,.692426,.00136906,0,.424973,.673623,.00131066,0,.450347,.65494,.00125569,0,.476531,.635448,.00119517,0,.503535,.616221,.00113828,0,.531372,.597531,.0010816,0,.560047,.578795,.00102673,0,.589554,.559892,970985e-9,0,.619869,.541307,919773e-9,0,.650923,.522608,868479e-9,0,.68254,.504484,82137e-8,0,.714286,.486603,772916e-9,0,.746032,.468802,730353e-9,0,.777778,.451172,684955e-9,0,.809524,.434348,647565e-9,0,.84127,.417445,605863e-9,0,.873016,.401077,571885e-9,0,.904762,.385039,536034e-9,0,.936508,.369483,504227e-9,0,.968254,.354272,473165e-9,0,1,1,599525e-9,0,0,1,599533e-9,0,0,1,599639e-9,0,0,.999998,600097e-9,0,0,.999994,601336e-9,0,0,.999987,603958e-9,0,0,.999972,608775e-9,0,0,.999949,616842e-9,0,0,.999912,629534e-9,0,0,.999857,648658e-9,0,0,.999781,676615e-9,0,538873e-11,.999674,716574e-9,0,308602e-9,.999528,772641e-9,0,.00127003,.999326,849806e-9,0,.00300783,.999009,952682e-9,0,.00556637,.998112,.00106394,0,.00895889,.994496,.00102228,0,.0131827,.992806,.00108586,0,.0182277,.991211,.0011759,0,.0240795,.989415,.00128955,0,.030723,.986499,.00139038,0,.0381418,.982679,.00144539,0,.046321,.978839,.00153954,0,.0552459,.974295,.00164417,0,.0649034,.968784,.00171517,0,.0752814,.962324,.00180282,0,.0863693,.954956,.00186387,0,.0981578,.94624,.00193817,0,.110639,.936517,.00198156,0,.123806,.925186,.00203042,0,.137655,.91252,.0020664,0,.15218,.898441,.00207822,0,.16738,.884394,.0020992,0,.183253,.871273,.00208748,0,.199799,.859057,.00208686,0,.21702,.845243,.00205519,0,.234918,.830723,.00202868,0,.253496,.815801,.00199501,0,.272761,.79914,.00194193,0,.292719,.782372,.00188824,0,.313377,.76482,.00183695,0,.334745,.746586,.00177418,0,.356833,.7281,.00170628,0,.379654,.709842,.00164063,0,.403221,.692019,.00157355,0,.427548,.67364,.00150262,0,.452651,.655277,.00143473,0,.478545,.636438,.00136371,0,.505246,.617364,.00129911,0,.532768,.598603,.00123014,0,.561122,.580195,.00116587,0,.590309,.561786,.00110398,0,.620318,.543377,.00104148,0,.651102,.525093,983984e-9,0,.682545,.506791,92667e-8,0,.714286,.489291,874326e-9,0,.746032,.471811,821734e-9,0,.777778,.454435,774698e-9,0,.809524,.437493,727302e-9,0,.84127,.420977,684039e-9,0,.873016,.404729,64373e-8,0,.904762,.388756,60285e-8,0,.936508,.373344,56765e-8,0,.968254,.358191,531929e-9,0,1,1,832169e-9,0,0,1,832178e-9,0,0,1,83231e-8,0,0,.999998,832893e-9,0,0,.999995,834465e-9,0,0,.999985,837791e-9,0,0,.999969,843893e-9,0,0,.999944,854086e-9,0,0,.999903,870071e-9,0,0,.999843,894042e-9,0,0,.999759,928865e-9,0,531805e-10,.999643,978242e-9,0,579365e-9,.99948,.00104684,0,.00182774,.999255,.00114012,0,.00387804,.998885,.00126188,0,.00675709,.997405,.00135888,0,.010468,.99424,.00133626,0,.0150018,.992458,.00140905,0,.0203443,.990929,.00152305,0,.0264786,.989116,.00165882,0,.0333875,.985624,.00174128,0,.0410536,.982003,.00182108,0,.0494609,.978336,.00194498,0,.0585941,.973184,.00202708,0,.0684396,.9678,.00212166,0,.0789851,.961348,.00221366,0,.0902199,.953841,.00228219,0,.102134,.94534,.00235662,0,.114721,.935552,.00240572,0,.127972,.924064,.00244405,0,.141884,.911827,.00247557,0,.156451,.897731,.00248374,0,.171672,.883409,.00249863,0,.187545,.868625,.00246688,0,.20407,.856529,.00246523,0,.221249,.842999,.00242368,0,.239083,.828505,.00237354,0,.257578,.813825,.00232588,0,.276738,.797813,.00226731,0,.296569,.781097,.00219704,0,.31708,.764038,.00212394,0,.338281,.746067,.00204786,0,.360181,.727687,.00196728,0,.382794,.709571,.00188779,0,.406133,.691503,.00180532,0,.430213,.673673,.00171849,0,.45505,.655732,.00164147,0,.480662,.637399,.00155858,0,.507065,.618616,.00147641,0,.534278,.60005,.00140125,0,.562313,.581713,.00132441,0,.59118,.563546,.00125014,0,.620875,.545605,.00118249,0,.651373,.527559,.0011116,0,.682593,.509764,.00104979,0,.714286,.49193,985977e-9,0,.746032,.475011,928592e-9,0,.777778,.457878,873466e-9,0,.809524,.440979,819585e-9,0,.84127,.424613,772365e-9,0,.873016,.408549,722195e-9,0,.904762,.392771,680014e-9,0,.936508,.377317,636797e-9,0,.968254,.362352,598318e-9,0,1,1,.00114313,0,0,1,.00114314,0,0,.999999,.00114331,0,0,.999998,.00114404,0,0,.999994,.00114601,0,0,.999984,.00115019,0,0,.999967,.00115784,0,0,.999937,.0011706,0,0,.999894,.00119054,0,0,.999828,.00122031,0,0,.999735,.00126331,0,169263e-9,.999606,.00132382,0,949167e-9,.999426,.0014071,0,.00249668,.999173,.00151895,0,.00486392,.99873,.00166102,0,.00806323,.996243,.0017023,0,.0120895,.993779,.00172782,0,.0169288,.9919,.0018108,0,.0225633,.990524,.00196028,0,.028974,.98868,.00212014,0,.036142,.984663,.00217598,0,.044049,.981457,.00230563,0,.0526781,.977608,.00243966,0,.0620137,.972215,.00251336,0,.0720418,.966798,.0026285,0,.0827499,.960241,.00271409,0,.0941271,.952489,.00278381,0,.106164,.944127,.00285399,0,.118852,.934282,.00290994,0,.132185,.923271,.00294558,0,.146157,.910803,.00296269,0,.160766,.896705,.00296803,0,.176007,.88238,.00296637,0,.19188,.867116,.00293163,0,.208385,.853636,.00289418,0,.225523,.840469,.00284663,0,.243296,.82639,.00278594,0,.261709,.811759,.00271618,0,.280767,.796113,.00263187,0,.300476,.779518,.00254589,0,.320845,.763142,.00246003,0,.341883,.745464,.00236529,0,.363601,.727491,.00226536,0,.386011,.709414,.00216375,0,.409128,.691396,.00207127,0,.432967,.67368,.00197106,0,.457545,.656049,.00187022,0,.482881,.638188,.00177605,0,.508992,.620177,.00168482,0,.535899,.601506,.00158909,0,.563619,.58362,.00150583,0,.592165,.565496,.00141791,0,.621544,.54789,.00133693,0,.651743,.530323,.00126038,0,.682709,.512795,.00118556,0,.714286,.495199,.00111527,0,.746032,.478101,.0010489,0,.777778,.461511,984264e-9,0,.809524,.444879,92591e-8,0,.84127,.428424,866582e-9,0,.873016,.412495,814463e-9,0,.904762,.396975,764498e-9,0,.936508,.381614,715967e-9,0,.968254,.366732,672483e-9,0,1,1,.00155501,0,0,1,.00155503,0,0,1,.00155524,0,0,.999998,.00155615,0,0,.999994,.0015586,0,0,.999983,.00156379,0,0,.999963,.0015733,0,0,.999932,.00158911,0,0,.999882,.00161376,0,0,.99981,.00165041,0,100875e-10,.999708,.00170304,0,367658e-9,.999565,.00177658,0,.0014234,.999368,.00187688,0,.00327939,.999081,.00200989,0,.00596629,.99852,.00217177,0,.0094852,.99549,.0021745,0,.013824,.993252,.00222357,0,.0189642,.991727,.00235022,0,.0248856,.989951,.00250561,0,.0315669,.988029,.00268829,0,.0389882,.984029,.0027496,0,.0471302,.980683,.00289793,0,.0559754,.976554,.00303315,0,.0655081,.97139,.00313257,0,.0757138,.965544,.00323656,0,.08658,.95912,.00333432,0,.0980954,.951183,.0034039,0,.110251,.942974,.00347515,0,.123038,.932642,.00350381,0,.13645,.922158,.00354519,0,.150482,.909404,.00353851,0,.165129,.896071,.0035435,0,.18039,.881206,.00349936,0,.196263,.866077,.00347256,0,.212748,.85093,.003415,0,.229847,.837703,.00333367,0,.247561,.823878,.003249,0,.265895,.809449,.00316347,0,.284854,.794379,.00306351,0,.304445,.778138,.0029499,0,.324675,.761997,.00284099,0,.345555,.744938,.00272104,0,.367095,.727212,.00260715,0,.389309,.709549,.00248855,0,.41221,.691704,.00236783,0,.435814,.673689,.00225178,0,.460138,.656453,.00213765,0,.485203,.639128,.00202178,0,.511028,.621512,.00191443,0,.537634,.603598,.00180977,0,.565041,.58559,.00170456,0,.593268,.567852,.00160927,0,.622327,.5503,.00151395,0,.652217,.533033,.00142499,0,.682907,.515942,.00133955,0,.714296,.498814,.0012602,0,.746032,.481595,.00118188,0,.777778,.465117,.00111171,0,.809524,.448865,.00104091,0,.84127,.432711,976618e-9,0,.873016,.416822,91859e-8,0,.904762,.401272,857704e-9,0,.936508,.386226,807172e-9,0,.968254,.371321,75464e-8,0,1,1,.00209596,0,0,1,.00209598,0,0,1,.00209624,0,0,.999997,.00209736,0,0,.999991,.00210039,0,0,.999979,.00210678,0,0,.999959,.00211847,0,0,.999925,.0021379,0,0,.99987,.00216809,0,0,.999791,.00221281,0,681487e-10,.999677,.00227669,0,658161e-9,.999521,.00236533,0,.00200635,.999301,.00248514,0,.0041779,.998977,.00264185,0,.00718648,.998191,.00281695,0,.0110239,.994801,.00278518,0,.015672,.993091,.00288774,0,.0211091,.991571,.00303931,0,.0273123,.9897,.00321643,0,.034259,.987023,.00337332,0,.0419282,.983289,.00346146,0,.0502998,.979892,.00363704,0,.0593562,.975111,.00373601,0,.069081,.970351,.0038842,0,.0794598,.964131,.00397053,0,.0904798,.957747,.00408078,0,.10213,.949536,.00413533,0,.1144,.941372,.00420305,0,.127284,.931049,.00422815,0,.140772,.920647,.00425048,0,.154862,.908033,.0042281,0,.169548,.895028,.00422026,0,.184828,.879968,.00415042,0,.200701,.864875,.00408821,0,.217167,.84918,.00400909,0,.234227,.834934,.00391178,0,.251884,.821397,.00380066,0,.270141,.807135,.00367974,0,.289004,.792363,.00355172,0,.308479,.776661,.003411,0,.328575,.760705,.00328123,0,.349301,.744408,.00314003,0,.370668,.726994,.0029906,0,.392689,.709598,.00285034,0,.415379,.692112,.00271179,0,.438754,.674435,.00257185,0,.46283,.65676,.00243425,0,.48763,.639982,.00230351,0,.513173,.622983,.0021777,0,.539482,.605471,.00204991,0,.566579,.58796,.00193759,0,.594488,.570463,.00181976,0,.623226,.553058,.00171497,0,.6528,.535894,.00161109,0,.683198,.519089,.00151394,0,.714354,.502454,.00142122,0,.746032,.485681,.00133488,0,.777778,.468935,.00124975,0,.809524,.452951,.00117309,0,.84127,.437139,.00110155,0,.873016,.421446,.00103124,0,.904762,.405951,966387e-9,0,.936508,.391003,908119e-9,0,.968254,.376198,848057e-9,0,1,1,.00280076,0,0,1,.00280078,0,0,.999999,.00280109,0,0,.999997,.00280246,0,0,.999992,.00280616,0,0,.999979,.00281396,0,0,.999956,.00282822,0,0,.999916,.00285186,0,0,.999857,.0028885,0,0,.999768,.00294259,0,196026e-9,.999645,.00301946,0,.00104842,.99947,.00312541,0,.00270199,.999229,.00326733,0,.00519449,.998852,.00344992,0,.00852602,.997558,.00361052,0,.0126804,.994417,.0035898,0,.017635,.992824,.00372393,0,.023365,.991344,.00390695,0,.0298456,.989337,.00410392,0,.0370529,.985811,.00420987,0,.0449651,.982772,.00437488,0,.0535615,.979001,.00455069,0,.0628243,.974102,.00464462,0,.0727368,.969197,.00480577,0,.0832844,.962759,.00487818,0,.0944545,.956207,.00498176,0,.106236,.947909,.00503392,0,.118619,.939596,.00507474,0,.131595,.929642,.00509798,0,.145159,.918807,.00508476,0,.159305,.906921,.00505634,0,.174028,.893312,.00498845,0,.189327,.878933,.0049133,0,.2052,.863986,.0048259,0,.221647,.847936,.00470848,0,.23867,.832253,.00456889,0,.25627,.818619,.00442726,0,.274453,.804788,.00427677,0,.293222,.790241,.00411906,0,.312585,.775162,.00394833,0,.33255,.759463,.00377366,0,.353126,.743598,.00361026,0,.374324,.72697,.00343627,0,.396158,.709646,.00326422,0,.418641,.69277,.00309717,0,.44179,.675371,.0029356,0,.465624,.657863,.00277712,0,.490163,.640772,.00261738,0,.515429,.624441,.0024737,0,.541445,.607497,.00233125,0,.568236,.590438,.00218994,0,.595828,.573224,.0020664,0,.624242,.556168,.00193526,0,.653496,.539232,.00182463,0,.683588,.522352,.00170735,0,.714482,.506172,.00160555,0,.746032,.489842,.00150451,0,.777778,.473463,.00140938,0,.809524,.457266,.00132568,0,.84127,.441609,.0012376,0,.873016,.426348,.00116265,0,.904762,.411002,.00108935,0,.936508,.396045,.00101946,0,.968254,.381448,955665e-9,0,1,1,.0037121,0,0,1,.00371213,0,0,1,.00371251,0,0,.999997,.00371417,0,0,.99999,.00371863,0,0,.999977,.00372807,0,0,.99995,.00374529,0,0,.999908,.0037738,0,0,.999843,.00381789,0,123596e-10,.999745,.00388273,0,407442e-9,.999608,.00397443,0,.0015447,.999415,.00409998,0,.00351385,.999143,.00426662,0,.0063316,.9987,.00447625,0,.00998679,.996363,.00455323,0,.0144569,.994021,.00461052,0,.0197151,.992372,.00476359,0,.0257344,.991007,.00499101,0,.0324882,.988767,.0051972,0,.0399517,.984872,.00528407,0,.0481022,.982004,.00548926,0,.0569191,.977714,.00564385,0,.0663839,.973076,.0057693,0,.0764801,.967565,.0058924,0,.0871928,.961384,.00599629,0,.0985095,.954435,.00605998,0,.110419,.946303,.0061133,0,.122912,.937662,.00612028,0,.13598,.927867,.00612209,0,.149617,.916475,.00604813,0,.163817,.90541,.00603088,0,.178577,.891591,.00592218,0,.193894,.877573,.00578854,0,.209767,.862511,.00566648,0,.226196,.846861,.00551481,0,.243182,.83068,.00533754,0,.260728,.815725,.00515487,0,.278837,.802321,.0049655,0,.297515,.787826,.00475421,0,.316768,.773454,.00456002,0,.336605,.758224,.00434727,0,.357034,.74265,.00414444,0,.378067,.726729,.00393738,0,.399717,.710155,.00373575,0,.421998,.693312,.00353736,0,.444928,.67653,.00334368,0,.468523,.659444,.00315981,0,.492806,.642051,.00297809,0,.517798,.625758,.00280592,0,.543525,.609615,.00264254,0,.570012,.592919,.00248459,0,.597288,.576298,.00233327,0,.625379,.559489,.00219519,0,.654307,.542891,.00205441,0,.684084,.526255,.00193385,0,.714693,.509853,.00180745,0,.746044,.494131,.00169817,0,.777778,.478114,.0015913,0,.809524,.462274,.00148981,0,.84127,.446412,.00139537,0,.873016,.431274,.00130984,0,.904762,.41635,.00122403,0,.936508,.401476,.00114809,0,.968254,.386993,.00107563,0,1,1,.00488216,0,0,1,.0048822,0,0,1,.00488265,0,0,.999997,.00488463,0,0,.999988,.00488999,0,0,.999974,.00490129,0,0,.999946,.00492191,0,0,.999897,.00495598,0,0,.999825,.00500855,0,744791e-10,.999718,.00508559,0,712744e-9,.999565,.005194,0,.00215249,.999352,.00534147,0,.00444576,.999046,.00553523,0,.00759218,.998492,.00577016,0,.0115714,.995564,.00578487,0,.0163557,.993339,.00586414,0,.021915,.991834,.00606002,0,.0282201,.990496,.00633312,0,.0352433,.987826,.00651941,0,.042959,.98383,.00660842,0,.0513439,.98109,.00685523,0,.0603772,.976131,.00695778,0,.0700402,.971922,.00714236,0,.0803163,.965901,.00721437,0,.0911908,.959606,.00732017,0,.102651,.952504,.00735788,0,.114686,.944365,.00738493,0,.127286,.935652,.00737969,0,.140443,.925813,.00733612,0,.154151,.914397,.00723094,0,.168405,.903257,.00714002,0,.183201,.890015,.00700149,0,.198536,.876014,.00682813,0,.214409,.861436,.00665567,0,.23082,.845752,.00644526,0,.24777,.829169,.00621635,0,.265263,.813435,.00597789,0,.283301,.799701,.00575694,0,.301889,.785726,.00549866,0,.321035,.77152,.0052503,0,.340746,.75683,.00499619,0,.361032,.741951,.0047543,0,.381904,.726367,.0045084,0,.403374,.710537,.00426784,0,.425457,.693965,.00403487,0,.448169,.677724,.0038075,0,.47153,.66117,.00359431,0,.495561,.644274,.00338354,0,.520284,.627449,.00318163,0,.545725,.611645,.00299672,0,.571911,.595614,.00281016,0,.598873,.579426,.00264252,0,.62664,.563016,.00247509,0,.655239,.546728,.00232647,0,.684692,.530539,.00217803,0,.714999,.514164,.00204216,0,.746106,.498344,.00191403,0,.777778,.482957,.00179203,0,.809524,.467336,.00167695,0,.84127,.451994,.00157567,0,.873016,.436514,.00147113,0,.904762,.42178,.00138034,0,.936508,.407271,.00129219,0,.968254,.392822,.0012098,0,1,1,.00637427,0,0,1,.00637431,0,0,.999999,.00637485,0,0,.999996,.00637721,0,0,.999987,.00638357,0,0,.999971,.006397,0,0,.999939,.00642142,0,0,.999888,.00646177,0,0,.999807,.00652387,0,207916e-9,.999689,.00661454,0,.00112051,.99952,.00674155,0,.00287719,.999283,.00691313,0,.00550145,.998936,.00713598,0,.00897928,.998165,.00738501,0,.0132829,.994847,.00734388,0,.01838,.993182,.00749991,0,.0242381,.991665,.0077246,0,.030826,.989708,.00797579,0,.0381152,.986663,.00813011,0,.0460794,.983288,.00830365,0,.0546951,.980104,.00853496,0,.0639411,.974855,.00861045,0,.0737988,.97045,.00879133,0,.0842516,.964509,.00886377,0,.0952848,.957594,.00890346,0,.106886,.950546,.00893289,0,.119044,.942225,.00890074,0,.131749,.933365,.00886826,0,.144994,.923202,.0087316,0,.158772,.912605,.00863082,0,.173078,.901099,.00847403,0,.187908,.888177,.00825838,0,.203261,.873955,.00801834,0,.219134,.860091,.00779026,0,.235527,.84434,.00752478,0,.252443,.828517,.00724074,0,.269883,.81239,.00693769,0,.287851,.79721,.00664817,0,.306352,.783489,.00634763,0,.325393,.769514,.00604221,0,.344981,.755419,.00573568,0,.365126,.741083,.00544359,0,.385839,.726059,.00515515,0,.407132,.710809,.00487139,0,.42902,.695052,.00459846,0,.45152,.678886,.00433412,0,.474651,.663042,.00407981,0,.498433,.646634,.00384264,0,.52289,.630117,.00360897,0,.548048,.613804,.00338863,0,.573936,.598338,.00318486,0,.600584,.582687,.00298377,0,.628027,.566809,.00280082,0,.656295,.550817,.00262255,0,.685417,.534937,.00245835,0,.715406,.519151,.00230574,0,.74624,.503118,.0021549,0,.777778,.487723,.00202008,0,.809524,.472725,.00189355,0,.84127,.457599,.00177108,0,.873016,.442558,.00165843,0,.904762,.427624,.00155494,0,.936508,.413171,.00145273,0,.968254,.399122,.00136454,0,1,1,.00826496,0,0,1,.00826499,0,0,1,.00826564,0,0,.999996,.00826842,0,0,.999987,.00827589,0,0,.999967,.00829167,0,0,.999933,.00832037,0,0,.999876,.00836768,0,109338e-10,.999786,.00844031,0,427145e-9,.999655,.00854603,0,.0016384,.999468,.00869337,0,.00372392,.999203,.008891,0,.00668513,.998803,.00914387,0,.0104968,.99748,.00935838,0,.015125,.994446,.00933309,0,.0205338,.99292,.00953084,0,.0266884,.991414,.0097893,0,.0335565,.989049,.0100228,0,.0411086,.98582,.0101664,0,.0493181,.982441,.0103582,0,.0581613,.978595,.0105292,0,.0676169,.973495,.0106274,0,.0776661,.968405,.0107261,0,.0882926,.962717,.0108234,0,.0994817,.955478,.0108102,0,.111221,.948275,.0107914,0,.123499,.940006,.0107161,0,.136308,.930831,.0106309,0,.149639,.920648,.0104083,0,.163485,.910205,.0102312,0,.177843,.898445,.0100051,0,.192707,.885986,.00971928,0,.208077,.872204,.00940747,0,.22395,.858436,.0091085,0,.240326,.843454,.00876595,0,.257208,.827437,.00839794,0,.274596,.811488,.00803692,0,.292496,.796039,.00767352,0,.310911,.781083,.0073097,0,.329849,.767642,.00694032,0,.349316,.753901,.00657476,0,.369323,.740131,.00622699,0,.38988,.725845,.0058838,0,.410999,.710991,.00555586,0,.432696,.696002,.00523089,0,.454987,.680461,.00492494,0,.47789,.664875,.00463464,0,.501426,.649273,.00435422,0,.52562,.63302,.0040875,0,.550498,.61705,.00384075,0,.576089,.601154,.00359557,0,.602427,.586008,.00337636,0,.629544,.570699,.00316019,0,.657479,.555166,.00296033,0,.686264,.539645,.00277552,0,.715924,.524159,.00259499,0,.746459,.508682,.00243257,0,.777789,.493163,.00227851,0,.809524,.478004,.00213083,0,.84127,.46347,.00199502,0,.873016,.448778,.00186967,0,.904762,.434105,.00174732,0,.936508,.419576,.00163861,0,.968254,.405541,.00153341,0,1,1,.0106462,0,0,1,.0106462,0,0,.999999,.010647,0,0,.999995,.0106502,0,0,.999985,.0106589,0,0,.999964,.0106773,0,0,.999925,.0107106,0,0,.999861,.0107655,0,712986e-10,.999763,.0108497,0,743959e-9,.999616,.0109716,0,.00227361,.999408,.0111408,0,.0046983,.999112,.0113659,0,.00800158,.998637,.0116475,0,.0121493,.996223,.0117231,0,.0171023,.994006,.0118064,0,.0228218,.992444,.0120254,0,.0292711,.991028,.0123314,0,.036417,.98803,.0124954,0,.0442295,.984816,.0126538,0,.0526815,.981399,.0128537,0,.0617492,.977085,.0129694,0,.0714114,.972154,.013091,0,.0816495,.966617,.0131166,0,.0924472,.960628,.0131583,0,.10379,.953295,.0131094,0,.115665,.94575,.0129966,0,.128062,.937654,.0128796,0,.140972,.927716,.0126477,0,.154387,.917932,.0123889,0,.168301,.907719,.012131,0,.182709,.89584,.0118013,0,.197608,.883526,.0114145,0,.212994,.870301,.0110075,0,.228867,.856272,.0106019,0,.245227,.842251,.0101938,0,.262074,.826466,.00973254,0,.279412,.810859,.0092846,0,.297244,.795051,.00883304,0,.315575,.780053,.00840272,0,.334412,.76575,.00796438,0,.35376,.752298,.00752526,0,.373631,.739153,.00711486,0,.394034,.725514,.00670361,0,.414983,.711473,.00632656,0,.436491,.696936,.00595206,0,.458575,.682126,.00559191,0,.481253,.667027,.00525362,0,.504547,.651875,.00493805,0,.528481,.636463,.00462848,0,.553081,.620641,.00433936,0,.578377,.604931,.00407,0,.604404,.589549,.00380864,0,.631197,.574712,.00357049,0,.658795,.559775,.00334466,0,.687238,.544514,.00312505,0,.716559,.529555,.00293199,0,.746776,.514402,.00274204,0,.777849,.499302,.00256647,0,.809524,.484114,.00239901,0,.84127,.469308,.00225148,0,.873016,.455133,.00210178,0,.904762,.440939,.0019727,0,.936508,.426627,.00184382,0,.968254,.412509,.00172548,0,1,1,.013628,0,0,1,.0136281,0,0,.999999,.0136289,0,0,.999995,.0136327,0,0,.999983,.0136427,0,0,.99996,.0136638,0,0,.999917,.0137022,0,0,.999846,.0137652,0,204597e-9,.999736,.0138615,0,.00116837,.999573,.0140007,0,.00303325,.99934,.0141927,0,.00580613,.999004,.0144457,0,.00945626,.998407,.0147489,0,.0139421,.995464,.014731,0,.0192202,.993328,.0148283,0,.0252495,.991799,.0150797,0,.0319921,.990397,.0154316,0,.0394138,.986835,.0155005,0,.0474843,.983938,.0157308,0,.0561763,.980154,.0158753,0,.0654661,.975659,.0159581,0,.0753326,.970171,.0159832,0,.0857571,.964803,.0160084,0,.0967236,.958366,.0159484,0,.108218,.950613,.0158001,0,.120227,.942874,.0155845,0,.132741,.935005,.0154292,0,.145751,.924991,.0150742,0,.159249,.914814,.0146757,0,.17323,.904743,.0143097,0,.187687,.893216,.0138695,0,.202619,.880769,.0133706,0,.218021,.868136,.0128606,0,.233894,.85469,.0123403,0,.250238,.840593,.0118091,0,.267052,.825808,.011253,0,.284341,.81009,.0107099,0,.302106,.79504,.0101636,0,.320354,.779757,.00964041,0,.33909,.764697,.00911896,0,.358322,.750913,.00859533,0,.378059,.738175,.00811592,0,.398311,.725242,.00764504,0,.41909,.711864,.00718885,0,.440412,.698009,.00675843,0,.462292,.683841,.00634984,0,.484748,.669391,.00595502,0,.507802,.654731,.00558671,0,.531477,.639805,.00523578,0,.555802,.624789,.00490834,0,.580805,.609325,.00459448,0,.606522,.593975,.00430342,0,.63299,.578983,.00403019,0,.66025,.564442,.0037707,0,.688346,.549835,.0035316,0,.717319,.535039,.00330255,0,.7472,.520403,.00308932,0,.777982,.505687,.00289335,0,.809524,.490939,.00270818,0,.84127,.476233,.0025343,0,.873016,.461624,.00237097,0,.904762,.447833,.00222065,0,.936508,.433992,.00207561,0,.968254,.420147,.00194955,0,1,1,.0173415,0,0,1,.0173416,0,0,.999999,.0173426,0,0,.999995,.0173468,0,0,.999983,.0173582,0,0,.999954,.0173822,0,0,.999908,.0174258,0,669501e-11,.999828,.0174973,0,427399e-9,.999705,.0176063,0,.00171019,.999524,.0177631,0,.0039248,.999263,.0179781,0,.00705382,.998878,.018258,0,.0110552,.998012,.0185551,0,.0158812,.994614,.0184264,0,.0214852,.993132,.0186385,0,.0278239,.991563,.0189067,0,.0348585,.989298,.0191577,0,.0425544,.986036,.0192522,0,.050881,.982558,.0194063,0,.059811,.978531,.019486,0,.0693209,.974198,.0195847,0,.0793895,.968148,.0194749,0,.0899984,.962565,.0194277,0,.101132,.956041,.0192991,0,.112775,.947749,.0189893,0,.124917,.94018,.018704,0,.137547,.93165,.0183458,0,.150655,.921798,.0178775,0,.164236,.911573,.0173618,0,.178281,.901569,.0168482,0,.192788,.890341,.016265,0,.207752,.877835,.0156199,0,.223171,.865472,.0149516,0,.239044,.852905,.0143274,0,.255371,.838906,.0136643,0,.272153,.824888,.0129903,0,.289393,.809977,.0123218,0,.307093,.794697,.0116572,0,.325259,.780028,.0110307,0,.343896,.765124,.0104236,0,.363012,.750411,.0098219,0,.382617,.737264,.00924397,0,.402719,.724799,.00868719,0,.423332,.712253,.00816476,0,.444469,.699267,.00767262,0,.466146,.685618,.00719746,0,.488383,.671736,.00673916,0,.511199,.657777,.00631937,0,.534618,.643497,.00592411,0,.558668,.62889,.00553928,0,.58338,.614299,.0051934,0,.608787,.599197,.00485985,0,.634929,.584175,.00454357,0,.661849,.569541,.00425787,0,.689594,.555193,.00397905,0,.718211,.540947,.00372364,0,.747742,.526593,.00348599,0,.778205,.512335,.00326103,0,.80953,.498017,.00305137,0,.84127,.483609,.00285485,0,.873016,.469368,.00267472,0,.904762,.455037,.00249945,0,.936508,.441493,.00234792,0,.968254,.428147,.00219936,0,1,1,.0219422,0,0,1,.0219423,0,0,.999998,.0219434,0,0,.999993,.0219481,0,0,.999981,.021961,0,0,.999949,.0219879,0,0,.999896,.0220367,0,593194e-10,.999808,.0221167,0,75364e-8,.99967,.0222383,0,.00237884,.999466,.0224125,0,.00495612,.999174,.0226495,0,.00844887,.998725,.0229525,0,.0128058,.996979,.0231123,0,.0179742,.994317,.0230742,0,.0239047,.992781,.0232895,0,.0305526,.991191,.0235734,0,.0378786,.987787,.0236152,0,.0458475,.985092,.0237994,0,.0544287,.981121,.0238553,0,.0635952,.976924,.0238706,0,.0733233,.97218,.0238704,0,.0835922,.965956,.0236598,0,.0943839,.959998,.0234735,0,.105682,.953245,.0232277,0,.117474,.944445,.0226973,0,.129747,.937087,.0223527,0,.142491,.928341,.0218144,0,.155697,.9184,.0211516,0,.169358,.907959,.0204553,0,.183469,.89808,.0197673,0,.198024,.887047,.0189915,0,.21302,.875221,.0182082,0,.228455,.86269,.0173584,0,.244329,.850735,.0165718,0,.260639,.837545,.0157524,0,.277389,.823639,.0149482,0,.29458,.809699,.0141431,0,.312216,.794797,.0133527,0,.3303,.780578,.0126193,0,.34884,.766019,.0118914,0,.367842,.751447,.0111839,0,.387315,.737275,.010514,0,.40727,.724545,.00987277,0,.427717,.712644,.00926569,0,.448671,.700432,.00869029,0,.470149,.687664,.00814691,0,.492167,.674288,.00763012,0,.514746,.660966,.00714437,0,.537911,.647264,.00668457,0,.561688,.633431,.00626581,0,.586108,.619133,.00585593,0,.611206,.604935,.00548188,0,.637022,.590236,.00513288,0,.663599,.575473,.0047906,0,.690989,.561228,.00448895,0,.719242,.547054,.00420233,0,.748411,.533175,.00392869,0,.778531,.519163,.00367445,0,.809583,.505328,.00344097,0,.84127,.491446,.00322003,0,.873016,.477356,.00301283,0,.904762,.46356,.00282592,0,.936508,.449623,.00264956,0,.968254,.436068,.00246956,0,1,1,.0276135,0,0,1,.0276136,0,0,.999998,.0276148,0,0,.999993,.0276201,0,0,.999976,.0276342,0,0,.999945,.027664,0,0,.999884,.0277179,0,18679e-8,.999784,.027806,0,.00119607,.99963,.0279394,0,.00318407,.999401,.0281295,0,.00613601,.999066,.0283858,0,.00999963,.998524,.0287027,0,.0147164,.995702,.0286256,0,.0202295,.993593,.0286733,0,.0264876,.992067,.0288989,0,.0334452,.990548,.0292135,0,.0410621,.986775,.0291296,0,.0493032,.984054,.0293099,0,.0581381,.979481,.0291881,0,.0675397,.975297,.0291598,0,.0774848,.96981,.028954,0,.0879528,.963524,.028628,0,.0989258,.957398,.0283135,0,.110388,.950088,.0278469,0,.122327,.941538,.0271798,0,.134729,.933332,.0265388,0,.147587,.924392,.0257776,0,.160889,.914581,.024916,0,.174631,.904347,.0240242,0,.188806,.894324,.0231229,0,.203409,.883724,.022153,0,.218437,.872207,.0211355,0,.233888,.859927,.0201048,0,.249761,.848373,.0191263,0,.266056,.836023,.0181306,0,.282774,.82289,.0171718,0,.299917,.809324,.0162196,0,.317488,.795361,.0152622,0,.335493,.781253,.01439,0,.353936,.767338,.013533,0,.372825,.753156,.0127244,0,.392168,.739122,.0119454,0,.411976,.725358,.0112054,0,.432259,.712949,.010487,0,.453032,.701621,.00984032,0,.47431,.689703,.00921495,0,.496111,.677216,.00862492,0,.518456,.664217,.00806882,0,.541367,.65137,.00755922,0,.564872,.638,.00705705,0,.589001,.62453,.00661266,0,.613789,.610601,.00618432,0,.639277,.59676,.00578033,0,.66551,.582433,.00540927,0,.692539,.568026,.00506104,0,.720422,.55414,.0047353,0,.749216,.540178,.00442889,0,.778974,.526513,.00414363,0,.809711,.512954,.00388237,0,.84127,.499403,.00362875,0,.873016,.486026,.00340827,0,.904762,.472345,.00318598,0,.936508,.458828,.00297635,0,.968254,.445379,.00279447,0,1,1,.0345716,0,0,1,.0345717,0,0,.999999,.034573,0,0,.999991,.0345787,0,0,.999974,.0345941,0,0,.999937,.0346263,0,188589e-11,.999869,.0346847,0,409238e-9,.999757,.0347798,0,.0017674,.999582,.0349233,0,.00413658,.999322,.0351265,0,.00747408,.998939,.0353967,0,.0117157,.998219,.0357018,0,.0167966,.994974,.0354726,0,.0226572,.993201,.0355621,0,.0292445,.991573,.0357641,0,.0365123,.989301,.0359252,0,.0444203,.985712,.0358017,0,.0529334,.982411,.0358353,0,.0620214,.977827,.035617,0,.0716574,.973278,.0354398,0,.0818186,.967397,.0350483,0,.0924846,.960696,.0344795,0,.103638,.954349,.0339861,0,.115263,.946066,.0331323,0,.127348,.938012,.032359,0,.13988,.929413,.0314413,0,.152849,.920355,.0304103,0,.166248,.910586,.0292785,0,.18007,.900609,.0281391,0,.194308,.890093,.0269103,0,.208958,.880013,.0257269,0,.224018,.869001,.0244671,0,.239485,.85751,.0232252,0,.255359,.84582,.0220117,0,.271638,.834383,.0208274,0,.288324,.822158,.0196628,0,.305419,.809056,.0185306,0,.322927,.795832,.0174174,0,.340851,.782547,.0163758,0,.359199,.7689,.015391,0,.377975,.755526,.0144488,0,.397189,.741681,.0135372,0,.416851,.728178,.0126957,0,.436971,.714642,.0118812,0,.457564,.702756,.0111165,0,.478644,.69175,.0104145,0,.500229,.680159,.00974439,0,.522339,.668073,.00911926,0,.544997,.655405,.00851393,0,.56823,.642921,.00797637,0,.592068,.629993,.00745119,0,.616546,.616828,.00696972,0,.641705,.603305,.00652425,0,.66759,.589833,.00610188,0,.694255,.575945,.00570834,0,.72176,.561745,.00533384,0,.750168,.548277,.00500001,0,.779545,.534467,.00467582,0,.809933,.521032,.00438092,0,.841272,.507877,.00410348,0,.873016,.494654,.00383618,0,.904762,.481592,.00358699,0,.936508,.468509,.00337281,0,.968254,.455293,.00316196,0,1,1,.0430698,0,0,1,.0430699,0,0,.999998,.0430713,0,0,.999991,.0430773,0,0,.99997,.0430936,0,0,.999928,.0431277,0,406396e-10,.999852,.0431893,0,744376e-9,.999724,.0432895,0,.0024806,.999527,.0434397,0,.00524779,.99923,.0436507,0,.00898164,.998783,.0439255,0,.0136083,.997507,.0441104,0,.0190582,.994418,.0438225,0,.0252694,.992864,.0439396,0,.0321879,.991127,.0440962,0,.039767,.987331,.0438408,0,.0479667,.984819,.0438991,0,.056752,.980384,.0435906,0,.0660929,.975846,.0432543,0,.075963,.970748,.0428293,0,.0863398,.964303,.042153,0,.0972035,.95772,.0414111,0,.108537,.950747,.0405893,0,.120325,.942533,.0394887,0,.132554,.934045,.0383544,0,.145215,.924942,.037057,0,.158296,.915811,.0356993,0,.17179,.90612,.0342401,0,.185691,.896434,.0328078,0,.199993,.886021,.031288,0,.214691,.876081,.0297776,0,.229782,.865608,.0282334,0,.245265,.854924,.026749,0,.261138,.843607,.02526,0,.277401,.832456,.0238214,0,.294056,.821342,.0224682,0,.311104,.809303,.0211297,0,.328548,.796468,.0198387,0,.346394,.784046,.0186227,0,.364645,.771262,.0174561,0,.38331,.758118,.0163806,0,.402396,.745075,.0153287,0,.421912,.731926,.0143647,0,.44187,.71863,.0134363,0,.462283,.705414,.0125603,0,.483165,.693792,.0117508,0,.504535,.683108,.0110016,0,.52641,.67183,.0102757,0,.548816,.66015,.00962044,0,.571776,.647907,.00898031,0,.595323,.635734,.00840811,0,.619489,.623208,.00786211,0,.644317,.610438,.00734953,0,.669852,.597345,.00687688,0,.696148,.584138,.00643469,0,.723267,.5707,.00602236,0,.75128,.556966,.0056324,0,.780258,.543607,.00528277,0,.810268,.530213,.00493999,0,.841311,.516912,.00462265,0,.873016,.503916,.0043307,0,.904762,.491146,.00406858,0,.936508,.478439,.00381436,0,.968254,.465834,.00358003,0,1,1,.0534039,0,0,1,.053404,0,0,.999998,.0534055,0,0,.999989,.0534116,0,0,.999968,.0534283,0,0,.999918,.0534633,0,155895e-9,.99983,.0535262,0,.00120914,.999685,.0536281,0,.00334944,.999461,.0537799,0,.00653077,.999119,.0539902,0,.0106718,.998582,.0542524,0,.0156907,.995919,.0540318,0,.0215147,.993735,.0538914,0,.0280801,.992126,.0539557,0,.0353323,.990266,.0540401,0,.0432247,.986317,.0536064,0,.0517172,.983213,.0534425,0,.0607754,.978303,.0528622,0,.0703698,.973665,.0523363,0,.0804742,.968091,.0516165,0,.0910667,.961026,.0505434,0,.102128,.954333,.049523,0,.113641,.946372,.0481698,0,.125591,.938254,.0467674,0,.137965,.929516,.0452341,0,.150754,.920106,.0435083,0,.163947,.910899,.0417399,0,.177537,.901532,.0399389,0,.191516,.891919,.0380901,0,.205881,.882006,.0362341,0,.220626,.871965,.0343444,0,.235749,.862145,.0324832,0,.251248,.852058,.0306681,0,.267121,.84161,.0289097,0,.283368,.830806,.0272079,0,.299992,.820476,.0256089,0,.316992,.809514,.0240394,0,.334374,.797865,.0225379,0,.35214,.785621,.0211235,0,.370296,.773765,.0197908,0,.388849,.761629,.0185235,0,.407807,.748891,.0173358,0,.427178,.736437,.0162305,0,.446974,.723707,.0151778,0,.467207,.710606,.0141791,0,.487892,.698019,.0132592,0,.509046,.686203,.0123887,0,.530687,.675692,.0115976,0,.552839,.664826,.0108325,0,.575527,.65349,.0101348,0,.59878,.641774,.00947756,0,.622634,.629794,.00886058,0,.647128,.617647,.00828526,0,.672308,.60534,.00775312,0,.698231,.592718,.00726033,0,.724958,.579746,.00679731,0,.752563,.566763,.00636111,0,.781127,.553515,.00595228,0,.810733,.540118,.00556876,0,.841426,.527325,.00523051,0,.873016,.514265,.00490712,0,.904762,.501406,.00460297,0,.936508,.488922,.00431247,0,.968254,.476541,.0040472,0,1,1,.0659184,0,0,1,.0659185,0,0,.999998,.06592,0,0,.999988,.0659259,0,0,.999963,.0659423,0,0,.999907,.0659764,0,374198e-9,.999806,.0660376,0,.00182071,.999639,.0661361,0,.0043894,.999378,.0662814,0,.00800055,.998985,.0664779,0,.0125594,.998285,.0666914,0,.0179786,.995071,.0661989,0,.0241822,.993172,.0660454,0,.031106,.991438,.0660105,0,.0386952,.988428,.0656875,0,.0469032,.985218,.0652913,0,.0556905,.981128,.0647107,0,.065023,.976015,.0638491,0,.0748717,.97097,.062993,0,.0852112,.964582,.0617927,0,.0960199,.957383,.0603626,0,.107279,.949969,.0588128,0,.118971,.941843,.0570274,0,.131084,.933624,.0551885,0,.143604,.924543,.053122,0,.156521,.914919,.0508897,0,.169825,.905773,.0486418,0,.18351,.896434,.0463364,0,.197569,.887195,.0440623,0,.211997,.877706,.0417799,0,.226789,.867719,.03945,0,.241944,.858587,.037243,0,.257458,.849317,.0350956,0,.273331,.839585,.0329852,0,.289563,.829856,.0310028,0,.306154,.819589,.0290953,0,.323108,.809714,.0272738,0,.340426,.79934,.0255631,0,.358113,.788224,.0239175,0,.376175,.776619,.0223831,0,.394616,.76521,.0209298,0,.413445,.753716,.0195786,0,.432671,.741564,.0183001,0,.452305,.729413,.0171259,0,.472358,.717146,.0159933,0,.492845,.70436,.0149495,0,.513783,.69219,.0139681,0,.535189,.680289,.0130577,0,.557087,.669611,.0122198,0,.5795,.659113,.0114174,0,.602459,.648148,.0106729,0,.625997,.636905,.00998997,0,.650154,.625154,.00934313,0,.674976,.613481,.00874839,0,.700518,.60154,.00818265,0,.726845,.58943,.00766889,0,.754032,.576828,.00717153,0,.782167,.564194,.00672696,0,.811344,.551501,.00630863,0,.841644,.538635,.00592177,0,.873016,.525724,.00554888,0,.904762,.513209,.00520225,0,.936508,.500457,.00488231,0,.968254,.48799,.00457153,0,1,1,.0810131,0,0,1,.0810133,0,0,.999997,.0810145,0,0,.999985,.08102,0,0,.999956,.0810347,0,195026e-10,.999893,.0810656,0,719316e-9,.999777,.0811205,0,.00259774,.999583,.081208,0,.00561807,.999281,.0813343,0,.00967472,.998813,.0814969,0,.0146627,.997597,.0815217,0,.0204902,.994379,.0808502,0,.0270802,.992744,.0806792,0,.0343674,.990745,.0804589,0,.0422974,.986646,.0796107,0,.0508242,.983611,.0790913,0,.0599087,.978869,.0780746,0,.0695175,.973475,.0768218,0,.0796223,.967845,.0754926,0,.0901983,.960778,.0737063,0,.101224,.953333,.0718052,0,.112682,.945274,.0695946,0,.124555,.936955,.0672492,0,.136831,.928319,.0647732,0,.149496,.919075,.0620947,0,.162542,.909114,.0591816,0,.175958,.900137,.0563917,0,.189739,.891069,.0535392,0,.203877,.882262,.0507642,0,.218368,.873232,.0479793,0,.233208,.864042,.045226,0,.248393,.855002,.0425413,0,.263923,.846569,.0400126,0,.279796,.837714,.0375269,0,.296012,.828918,.0352027,0,.312573,.819783,.0330011,0,.329479,.810129,.0308908,0,.346734,.800866,.0289112,0,.364342,.79093,.0270255,0,.382307,.780593,.0252758,0,.400637,.769511,.0236178,0,.419337,.758558,.0220652,0,.438418,.747632,.0206289,0,.457889,.736146,.0192873,0,.477761,.724093,.0180333,0,.49805,.71234,.0168264,0,.51877,.700201,.015746,0,.53994,.687949,.0147027,0,.561581,.676163,.0137512,0,.583718,.665001,.0128655,0,.60638,.65472,.0120366,0,.629599,.644213,.0112604,0,.653415,.633382,.0105413,0,.677874,.62212,.00986498,0,.70303,.610631,.00923308,0,.728948,.599078,.00864206,0,.755706,.587519,.00811784,0,.783396,.575505,.00761237,0,.812121,.563148,.00713949,0,.841989,.550828,.00668379,0,.873035,.538458,.00627715,0,.904762,.525905,.00588336,0,.936508,.513517,.00552687,0,.968254,.501395,.00519681,0,1,1,.0991506,0,0,1,.0991504,0,0,.999996,.0991515,0,0,.999984,.0991558,0,0,.999947,.0991672,0,114389e-9,.999874,.0991912,0,.00121503,.999739,.0992331,0,.00356108,.999514,.0992983,0,.00705578,.999159,.0993877,0,.011574,.998586,.0994837,0,.017003,.995731,.0988425,0,.0232484,.993384,.098276,0,.0302318,.991615,.0979269,0,.0378884,.989029,.0973432,0,.0461641,.985373,.0963539,0,.0550136,.981278,.0952306,0,.0643988,.975777,.0936233,0,.0742868,.970526,.0920219,0,.0846501,.963755,.0898912,0,.0954644,.956676,.0876064,0,.106709,.948099,.0847751,0,.118367,.939718,.0818638,0,.130423,.931305,.078857,0,.142862,.922342,.0756127,0,.155674,.912842,.0721473,0,.168849,.903304,.0686195,0,.182378,.89411,.0650589,0,.196255,.885512,.0616022,0,.210473,.877193,.0582434,0,.225027,.86877,.0548979,0,.239915,.860267,.0516095,0,.255132,.851915,.048468,0,.270678,.843912,.0454447,0,.286551,.83604,.0425612,0,.302751,.828245,.0398752,0,.31928,.820159,.0373198,0,.336138,.81167,.034916,0,.35333,.802659,.0326402,0,.370858,.793921,.0304901,0,.388728,.784713,.0284857,0,.406944,.774946,.0266186,0,.425515,.76448,.0248593,0,.444449,.753793,.0232114,0,.463756,.743506,.0217039,0,.483447,.732555,.0202841,0,.503535,.720965,.0189648,0,.524036,.709422,.0177189,0,.544968,.697756,.0165626,0,.56635,.685565,.015483,0,.588208,.673987,.0144892,0,.610569,.66244,.0135607,0,.633466,.651675,.0126956,0,.656936,.641598,.0118788,0,.681025,.63121,.0111261,0,.705788,.620514,.010437,0,.731289,.609366,.00978747,0,.757606,.598137,.00917257,0,.784834,.586966,.00859778,0,.813085,.575549,.00806803,0,.842485,.563797,.00757294,0,.87313,.551758,.00710592,0,.904762,.539894,.0066841,0,.936508,.527901,.00627901,0,.968254,.515819,.00590506,0,1,1,.120864,0,0,1,.120864,0,0,.999996,.120864,0,0,.99998,.120867,0,0,.99994,.120872,0,323781e-9,.999852,.120884,0,.00188693,.999693,.120903,0,.00473489,.999426,.120929,0,.00872704,.999002,.120955,0,.0137237,.998235,.120918,0,.0196068,.994608,.119764,0,.0262803,.992997,.119265,0,.0336657,.990968,.11863,0,.0416987,.987002,.117261,0,.0503261,.983524,.116009,0,.0595035,.97875,.114252,0,.0691935,.972652,.11193,0,.0793645,.966613,.109555,0,.0899894,.959275,.106612,0,.101045,.951272,.103375,0,.112512,.942323,.0996594,0,.124372,.933679,.0958841,0,.136611,.924822,.0919265,0,.149216,.915742,.0878061,0,.162176,.906348,.0834894,0,.175482,.896883,.079085,0,.189125,.88774,.0746745,0,.203098,.87986,.0705773,0,.217396,.871998,.0665005,0,.232015,.864325,.0625413,0,.24695,.856685,.0586781,0,.2622,.84925,.0550063,0,.277761,.841719,.0514727,0,.293634,.834755,.0481398,0,.309819,.827853,.0450172,0,.326315,.820888,.0420969,0,.343126,.813616,.0393702,0,.360254,.805767,.0367771,0,.377701,.797338,.0343274,0,.395474,.789122,.0320529,0,.413577,.780601,.0299485,0,.432018,.771424,.0279812,0,.450804,.761502,.0261054,0,.469944,.751166,.0243942,0,.489451,.741276,.0228087,0,.509337,.730898,.0213265,0,.529617,.719878,.0199307,0,.550307,.708379,.0186574,0,.571428,.697165,.0174446,0,.593003,.685554,.0163144,0,.615059,.673631,.015276,0,.637628,.662385,.0143003,0,.660746,.651059,.0134112,0,.68446,.640451,.0125794,0,.70882,.630536,.011793,0,.733893,.620316,.0110547,0,.759756,.609722,.0103668,0,.786505,.598804,.00973009,0,.814259,.587871,.00912812,0,.843157,.577121,.00858916,0,.87334,.566019,.00807333,0,.904762,.554664,.00759687,0,.936508,.543101,.00714759,0,.968254,.531558,.00673418,0,1,1,.146767,0,0,1,.146767,0,0,.999997,.146767,0,0,.999977,.146765,0,320658e-11,.999929,.146762,0,682576e-9,.999823,.146753,0,.00276402,.999633,.146735,0,.00614771,.999314,.146699,0,.0106613,.998796,.14662,0,.0161546,.997124,.146107,0,.0225063,.994062,.144857,0,.0296198,.992154,.144011,0,.037417,.989186,.142712,0,.0458348,.985279,.140926,0,.0548211,.980826,.13885,0,.0643326,.975056,.136168,0,.074333,.969005,.133217,0,.0847917,.961554,.12959,0,.0956828,.954206,.125886,0,.106984,.945046,.121335,0,.118675,.935678,.116492,0,.130741,.926748,.111635,0,.143166,.917764,.106625,0,.155939,.908358,.101325,0,.169049,.899219,.0960249,0,.182487,.890089,.0906527,0,.196245,.881488,.0853905,0,.210317,.874031,.0804177,0,.224697,.866932,.0756005,0,.23938,.859976,.0709019,0,.254364,.853375,.0664391,0,.269646,.846971,.0622012,0,.285223,.840483,.058129,0,.301096,.833969,.0542762,0,.317265,.82806,.0507042,0,.333729,.822128,.047368,0,.350491,.815989,.044272,0,.367554,.809336,.0413444,0,.38492,.802177,.038601,0,.402594,.79441,.0360227,0,.420582,.786573,.0336383,0,.438891,.778619,.0314321,0,.457527,.77,.029362,0,.476499,.760698,.0274102,0,.49582,.750932,.0256146,0,.5155,.740993,.023974,0,.535555,.731159,.0224182,0,.556,.720836,.0209889,0,.576855,.709913,.0196411,0,.598143,.698415,.0183824,0,.619888,.68745,.0172222,0,.642123,.676154,.0161509,0,.664883,.664383,.0151397,0,.688211,.6533,.0141873,0,.71216,.642072,.0133105,0,.736792,.631412,.0124932,0,.762186,.621622,.0117408,0,.788439,.611681,.0110358,0,.815672,.60142,.0103775,0,.844034,.59083,.00975623,0,.873699,.580254,.00918084,0,.904765,.569841,.00864721,0,.936508,.559224,.00815731,0,.968254,.548315,.00767924,0,1,1,.177563,0,0,1,.177563,0,0,.999994,.177562,0,0,.999972,.177555,0,664171e-10,.999914,.177536,0,.0012276,.999787,.177496,0,.00388025,.999556,.17742,0,.00783463,.999165,.177285,0,.0128953,.9985,.177037,0,.0189053,.995388,.175634,0,.025742,.993102,.174375,0,.033309,.990992,.173121,0,.0415298,.986932,.170896,0,.0503425,.982786,.16847,0,.0596964,.977592,.165455,0,.0695498,.971075,.161676,0,.0798676,.963967,.157458,0,.0906201,.956397,.152836,0,.101783,.947489,.147467,0,.113333,.937564,.14145,0,.125254,.928182,.135383,0,.137529,.919027,.129212,0,.150144,.909618,.12276,0,.163088,.900492,.116273,0,.176351,.891671,.1098,0,.189924,.883146,.103362,0,.203799,.875151,.0970799,0,.21797,.868338,.0911732,0,.232433,.862033,.0854966,0,.247182,.856107,.0800691,0,.262216,.850644,.0749618,0,.27753,.845261,.070079,0,.293124,.839885,.0654321,0,.308997,.834609,.0610975,0,.325149,.829083,.0569741,0,.341581,.82404,.0531736,0,.358294,.818968,.049665,0,.37529,.813496,.0463856,0,.392573,.807533,.0433217,0,.410148,.80099,.0404402,0,.428019,.793891,.0377578,0,.446192,.786281,.0352616,0,.464676,.778773,.0329577,0,.483478,.770737,.030808,0,.502608,.762094,.0287964,0,.522079,.752898,.0269254,0,.541905,.743306,.0251926,0,.5621,.733416,.023595,0,.582684,.723742,.0221155,0,.603677,.713542,.0207435,0,.625106,.702755,.019434,0,.646998,.691484,.0182046,0,.66939,.680531,.0170771,0,.692324,.66953,.0160339,0,.715849,.658126,.0150677,0,.740028,.646933,.0141551,0,.764937,.636107,.0133179,0,.790673,.625271,.0125284,0,.817358,.615225,.0117937,0,.84515,.605678,.0111181,0,.874244,.59583,.0104759,0,.904828,.585704,.00986672,0,.936508,.575413,.00929712,0,.968254,.565373,.00876713,0,1,1,.214058,0,0,.999999,.214058,0,0,.999994,.214055,0,0,.999966,.214039,0,259642e-9,.999893,.213998,0,.00200075,.999737,.21391,0,.00527775,.999449,.213745,0,.00983959,.99896,.213458,0,.0154755,.9979,.212855,0,.0220249,.994278,.210779,0,.0293654,.992254,.20926,0,.0374021,.98881,.206908,0,.0460604,.984715,.204009,0,.0552802,.979738,.200471,0,.0650127,.972884,.195813,0,.0752175,.965996,.190856,0,.0858612,.957974,.185077,0,.0969155,.949155,.17868,0,.108356,.939288,.171513,0,.120163,.928996,.163838,0,.132319,.919563,.156246,0,.144808,.910004,.148359,0,.157618,.900791,.140417,0,.170737,.892135,.132569,0,.184155,.883803,.124741,0,.197866,.876034,.117091,0,.211861,.869219,.109835,0,.226134,.863062,.102859,0,.240682,.857795,.0962928,0,.255499,.853009,.0900725,0,.270583,.848603,.0842101,0,.285931,.844335,.0786527,0,.301542,.840208,.0734397,0,.317415,.836035,.0685334,0,.33355,.83172,.0639275,0,.349948,.827135,.0595909,0,.36661,.822797,.0556204,0,.383539,.818387,.0519394,0,.400738,.813565,.0485317,0,.41821,.808142,.0453138,0,.435961,.802212,.0423354,0,.453997,.79573,.0395553,0,.472324,.788741,.036988,0,.490951,.781093,.0345688,0,.509887,.773597,.0323297,0,.529144,.765622,.0302719,0,.548735,.757083,.0283477,0,.568674,.747992,.0265562,0,.588979,.738591,.0248844,0,.609671,.728719,.0233342,0,.630773,.719146,.0219081,0,.652314,.709165,.0205711,0,.674328,.69875,.0193248,0,.696854,.687884,.0181582,0,.719942,.676818,.0170746,0,.743651,.666247,.0160718,0,.768057,.655284,.0151262,0,.793253,.64401,.0142561,0,.819363,.633353,.0134327,0,.846547,.622674,.012653,0,.875017,.612265,.0119354,0,.905021,.602455,.0112533,0,.936508,.593147,.0106234,0,.968254,.583592,.0100213,0,1,1,.25717,0,0,1,.25717,0,0,.999992,.257164,0,0,.999958,.257135,0,641715e-9,.999864,.25706,0,.00305314,.999666,.256897,0,.00700975,.999302,.256596,0,.0122194,.998663,.25607,0,.0184622,.995607,.254123,0,.0255773,.993094,.252081,0,.0334439,.9907,.249867,0,.0419696,.98594,.246118,0,.0510823,.981214,.242049,0,.0607242,.974966,.236869,0,.0708486,.967589,.230724,0,.081417,.95915,.223635,0,.0923974,.950257,.21596,0,.103763,.940165,.207296,0,.115491,.929396,.197901,0,.127562,.919288,.188437,0,.13996,.909428,.178762,0,.15267,.900105,.169072,0,.165679,.891418,.159478,0,.178979,.883347,.15002,0,.192558,.875992,.140813,0,.20641,.869466,.13196,0,.220529,.863699,.123501,0,.234907,.858553,.115436,0,.249542,.854379,.107901,0,.264428,.850894,.10088,0,.279564,.847632,.0942296,0,.294947,.844571,.0879861,0,.310575,.84163,.0821534,0,.326448,.838542,.0766409,0,.342566,.835412,.0715322,0,.358929,.831899,.0666883,0,.37554,.828177,.0622175,0,.392399,.82416,.0580452,0,.409511,.820393,.054267,0,.426878,.816068,.0507172,0,.444506,.811201,.0474041,0,.4624,.805785,.0443174,0,.480566,.799878,.0414562,0,.499013,.793469,.0388147,0,.517749,.786473,.0363453,0,.536785,.778874,.0340225,0,.556134,.771277,.0318599,0,.575809,.763426,.0298859,0,.595827,.755044,.0280357,0,.616207,.746161,.0262979,0,.636973,.737124,.0247295,0,.65815,.72761,.0232514,0,.679772,.717822,.0218755,0,.701876,.708279,.0205942,0,.724509,.698333,.0193947,0,.74773,.68802,.0182717,0,.771609,.677321,.0172044,0,.79624,.666504,.0162122,0,.821743,.656184,.0152924,0,.84828,.64556,.0144326,0,.876069,.634636,.0136157,0,.905404,.624124,.0128612,0,.936508,.613914,.0121435,0,.968254,.603589,.0114887,0,1,1,.307946,0,0,.999999,.307945,0,0,.999988,.307934,0,204479e-10,.999944,.307886,0,.00127833,.999824,.307756,0,.00445047,.999565,.30748,0,.00914673,.999085,.306966,0,.0150498,.998103,.306004,0,.0219367,.994249,.303028,0,.0296485,.991807,.300435,0,.038068,.987773,.296554,0,.0471062,.982673,.2916,0,.0566942,.976623,.285641,0,.0667768,.968757,.27815,0,.0773099,.959849,.269529,0,.088257,.950663,.260248,0,.0995879,.940129,.249704,0,.111277,.92895,.238291,0,.123304,.917996,.226501,0,.13565,.907813,.214669,0,.148299,.898305,.202835,0,.161237,.889626,.191158,0,.174455,.88175,.179695,0,.187941,.874715,.168548,0,.201687,.868746,.15792,0,.215687,.863703,.147807,0,.229933,.859315,.138149,0,.24442,.855538,.128993,0,.259145,.852428,.120414,0,.274103,.850168,.112498,0,.289293,.848132,.105054,0,.304711,.846291,.0981087,0,.320357,.844431,.0915942,0,.33623,.842493,.0855056,0,.35233,.840368,.0798204,0,.368658,.83798,.0745097,0,.385214,.83523,.0695424,0,.402002,.832091,.0649092,0,.419023,.828667,.0606291,0,.436282,.824805,.0566523,0,.453782,.820988,.0530229,0,.471529,.816635,.0496364,0,.489528,.811725,.0464658,0,.507788,.806316,.0435082,0,.526317,.800469,.0407873,0,.545124,.794107,.038255,0,.564221,.787218,.0358825,0,.583621,.779872,.0336785,0,.603341,.772097,.0316379,0,.623397,.764484,.0297379,0,.643812,.756428,.0279581,0,.664611,.748022,.0263153,0,.685824,.739268,.0247799,0,.707488,.73024,.0233385,0,.729646,.720893,.0220035,0,.752354,.71119,.0207555,0,.77568,.701791,.0195843,0,.799715,.692184,.0184891,0,.824574,.682258,.0174541,0,.850417,.67206,.0164873,0,.877466,.661717,.0155959,0,.90604,.651462,.0147519,0,.936528,.641467,.0139727,0,.968254,.631229,.0132363,0,1,1,.367573,0,0,.999999,.367571,0,0,.999984,.367553,0,183382e-9,.999925,.367473,0,.00225254,.999759,.367259,0,.00628165,.99941,.366801,0,.0117858,.998739,.365946,0,.0184359,.995529,.363191,0,.0260114,.992875,.360171,0,.0343581,.989135,.355981,0,.0433637,.984166,.350401,0,.0529438,.977871,.343348,0,.0630334,.96951,.334341,0,.0735805,.959964,.323862,0,.0845437,.950162,.312521,0,.095889,.938882,.299577,0,.107588,.926992,.285573,0,.119617,.915589,.271212,0,.131957,.904791,.256611,0,.144591,.895177,.242224,0,.157503,.886403,.227952,0,.170682,.878957,.214192,0,.184117,.872418,.200795,0,.197799,.867029,.188015,0,.21172,.862835,.175975,0,.225873,.859411,.164526,0,.240253,.856655,.153693,0,.254854,.854519,.14352,0,.269673,.852828,.13397,0,.284707,.851412,.124984,0,.299953,.850609,.116748,0,.315408,.849855,.10905,0,.331073,.849017,.101839,0,.346946,.848079,.0951359,0,.363028,.846911,.0888774,0,.379318,.845445,.0830375,0,.395818,.84362,.0775844,0,.41253,.841411,.0725054,0,.429457,.838768,.0677691,0,.446602,.835801,.0634016,0,.463968,.832341,.0593095,0,.481561,.828424,.0555121,0,.499386,.824312,.052024,0,.51745,.819918,.0487865,0,.535761,.815072,.0457801,0,.554328,.809863,.0430184,0,.573162,.804164,.0404245,0,.592275,.798034,.0380146,0,.611681,.791436,.0357436,0,.631398,.784498,.0336475,0,.651445,.777125,.0316666,0,.671845,.769365,.0298122,0,.692628,.761579,.0281001,0,.713827,.753746,.0265049,0,.735484,.745573,.0250067,0,.75765,.737083,.0236026,0,.78039,.728545,.0223302,0,.803789,.719691,.0211243,0,.82796,.710569,.0199983,0,.853056,.701216,.0189569,0,.879298,.692094,.0179702,0,.907014,.682909,.0170418,0,.936691,.673509,.0161732,0,.968254,.663863,.0153406,0,1,1,.437395,0,0,.999998,.437394,0,0,.99998,.437363,0,616704e-9,.999891,.437232,0,.00367925,.999656,.436877,0,.00867446,.999148,.436121,0,.0150679,.997959,.434564,0,.022531,.993464,.430134,0,.0308507,.990606,.426077,0,.0398805,.985027,.419397,0,.0495148,.978491,.41118,0,.0596749,.969643,.40048,0,.0703001,.959189,.38769,0,.0813427,.948223,.373575,0,.0927641,.935955,.357622,0,.104533,.923237,.34043,0,.116624,.911074,.322735,0,.129015,.899724,.30479,0,.141687,.890189,.287392,0,.154626,.881796,.270248,0,.167818,.874781,.253659,0,.181252,.869166,.237786,0,.194918,.864725,.222618,0,.208807,.861565,.208356,0,.222913,.859284,.194867,0,.237229,.857677,.18212,0,.25175,.856714,.17018,0,.266473,.856155,.158969,0,.281392,.8558,.148413,0,.296505,.855672,.138578,0,.311811,.855538,.129345,0,.327306,.855689,.120861,0,.342991,.855767,.112969,0,.358864,.855618,.105593,0,.374925,.85525,.0987451,0,.391176,.854583,.0923727,0,.407616,.853534,.0864143,0,.424249,.852061,.0808338,0,.441076,.850253,.0756771,0,.4581,.848004,.0708612,0,.475324,.845333,.0663784,0,.492754,.842376,.0622631,0,.510394,.838956,.0584112,0,.528251,.835121,.0548328,0,.546331,.830842,.0514838,0,.564644,.826212,.048355,0,.583198,.821522,.0454714,0,.602005,.816551,.0428263,0,.621078,.811211,.0403612,0,.640434,.805479,.038039,0,.660089,.799409,.0358739,0,.680066,.79306,.0338727,0,.70039,.786395,.0319985,0,.721094,.779416,.030241,0,.742215,.77214,.0285951,0,.7638,.764636,.0270747,0,.785912,.756836,.0256354,0,.808628,.749315,.0243027,0,.832055,.741561,.0230497,0,.856338,.733589,.0218801,0,.88169,.725479,.020784,0,.908441,.717255,.0197702,0,.937125,.708829,.0188168,0,.968254,.700191,.0179113,0,1,1,.518937,0,0,.999998,.518933,0,0,.999967,.518883,0,.00147741,.999832,.51866,0,.00573221,.999466,.518057,0,.011826,.998644,.516752,0,.0192116,.994458,.512347,0,.027573,.991223,.507675,0,.0367099,.985515,.500188,0,.046487,.978308,.490408,0,.0568071,.968359,.477357,0,.0675984,.95682,.461752,0,.0788059,.943929,.443796,0,.090386,.930224,.423893,0,.102304,.916514,.402682,0,.114532,.903653,.380914,0,.127047,.892315,.359212,0,.139828,.882942,.338102,0,.152861,.875438,.31773,0,.16613,.869642,.298186,0,.179624,.865304,.279491,0,.193332,.862382,.261804,0,.207247,.860666,.245146,0,.22136,.859788,.229406,0,.235666,.859608,.214605,0,.250158,.859912,.200691,0,.264832,.86053,.187623,0,.279684,.861368,.17539,0,.294711,.862237,.163901,0,.309911,.863127,.153175,0,.32528,.863923,.143147,0,.340819,.864567,.133781,0,.356524,.865013,.125042,0,.372397,.86539,.116952,0,.388438,.865591,.109476,0,.404645,.865517,.102542,0,.421022,.865084,.0960688,0,.437569,.864309,.0900499,0,.454287,.863151,.0844328,0,.471181,.861649,.0792218,0,.488253,.859742,.0743482,0,.505507,.857446,.0697963,0,.522947,.854757,.0655364,0,.54058,.851783,.061608,0,.558412,.848516,.0579701,0,.576449,.844897,.0545742,0,.594701,.840956,.0514167,0,.613178,.836676,.0484598,0,.631892,.832075,.0456934,0,.650856,.827191,.0431178,0,.670088,.822295,.0407718,0,.689606,.817294,.0386032,0,.709434,.812013,.0365675,0,.7296,.806465,.0346547,0,.750138,.800691,.0328717,0,.771093,.794709,.031211,0,.792519,.788493,.0296504,0,.814488,.782049,.0281782,0,.837097,.775403,.0267965,0,.860481,.76857,.0255002,0,.884842,.761536,.0242759,0,.910494,.754303,.0231142,0,.937985,.74692,.0220305,0,.968254,.739745,.0210192,0,1,1,.613914,0,0,.999996,.613907,0,963597e-10,.999942,.613814,0,.00301247,.999704,.613407,0,.00870385,.999046,.612302,0,.0160714,.995516,.608266,0,.0245899,.991726,.602863,0,.0339681,.985157,.593956,0,.0440254,.97642,.581748,0,.0546409,.964404,.565183,0,.0657284,.950601,.545273,0,.0772246,.935158,.522129,0,.0890812,.919364,.496782,0,.10126,.904754,.470571,0,.113731,.89176,.444037,0,.126469,.881492,.418322,0,.139454,.873656,.393522,0,.15267,.868053,.369795,0,.166101,.864336,.347171,0,.179736,.862259,.325737,0,.193565,.861556,.305532,0,.207578,.861776,.286416,0,.221769,.862661,.268355,0,.23613,.864015,.251334,0,.250656,.865711,.235352,0,.265343,.867519,.220302,0,.280187,.869351,.206161,0,.295183,.871144,.192908,0,.31033,.872839,.180505,0,.325624,.874307,.168848,0,.341065,.875667,.158021,0,.35665,.876758,.147877,0,.37238,.87764,.138441,0,.388253,.878237,.129627,0,.404269,.878563,.121415,0,.42043,.878572,.113741,0,.436735,.87842,.106652,0,.453187,.878057,.100097,0,.469786,.877413,.0940128,0,.486536,.87646,.0883462,0,.503439,.875233,.0830924,0,.520498,.8737,.0781975,0,.537717,.871873,.07364,0,.555102,.86978,.0694103,0,.572657,.867405,.0654696,0,.59039,.864751,.0617914,0,.608307,.861818,.0583491,0,.626419,.858645,.0551443,0,.644733,.855307,.0521894,0,.663264,.851736,.0494334,0,.682025,.847927,.0468504,0,.701032,.843888,.0444261,0,.720308,.839629,.0421497,0,.739875,.835158,.0400082,0,.759764,.830509,.0380076,0,.780014,.825714,.0361488,0,.800673,.820729,.0343956,0,.821803,.815751,.0327781,0,.843492,.810752,.031275,0,.86586,.805587,.0298542,0,.889087,.800317,.0285397,0,.913466,.79489,.0272948,0,.93952,.789314,.0261139,0,.96835,.783593,.0249938,0,1,1,.724258,0,0,.999992,.724243,0,726889e-9,.99987,.724044,0,.00569574,.999336,.72317,0,.0131702,.996271,.719432,0,.0220738,.991159,.712576,0,.0319405,.982465,.700927,0,.0425202,.97049,.684297,0,.0536599,.953973,.661244,0,.065258,.935546,.633804,0,.0772427,.916596,.603071,0,.0895616,.899353,.57105,0,.102175,.885216,.539206,0,.11505,.875076,.508714,0,.128164,.868334,.479571,0,.141495,.864414,.451796,0,.155026,.862678,.425328,0,.168745,.862835,.400352,0,.182639,.864067,.376532,0,.196699,.866086,.35391,0,.210915,.868557,.332424,0,.225282,.871271,.312053,0,.239792,.874058,.292764,0,.25444,.8768,.27453,0,.269223,.87939,.257297,0,.284135,.8819,.24114,0,.299174,.884187,.225934,0,.314337,.886262,.211669,0,.329622,.888119,.198311,0,.345026,.889709,.185783,0,.360549,.891054,.174063,0,.376189,.892196,.163143,0,.391946,.893101,.152952,0,.407819,.893803,.143475,0,.423808,.894277,.134647,0,.439914,.894532,.126434,0,.456137,.894576,.1188,0,.472479,.894393,.111694,0,.48894,.893976,.105069,0,.505523,.893346,.0989077,0,.52223,.892502,.0931724,0,.539064,.891441,.0878276,0,.556028,.890276,.082903,0,.573125,.888972,.0783505,0,.590361,.887469,.0741083,0,.607741,.885785,.0701633,0,.62527,.883914,.0664835,0,.642957,.881872,.0630567,0,.660809,.879651,.0598527,0,.678836,.877267,.0568615,0,.69705,.874717,.05406,0,.715465,.872012,.0514378,0,.734098,.869157,.0489805,0,.752968,.866155,.0466727,0,.772101,.863014,.0445056,0,.791529,.859748,.0424733,0,.81129,.856416,.0405957,0,.831438,.852958,.0388273,0,.852044,.849382,.0371619,0,.87321,.845694,.0355959,0,.89509,.841893,.0341155,0,.917932,.837981,.0327141,0,.942204,.833963,.0313856,0,.968981,.829847,.0301275,0,1,1,.85214,0,0,.999969,.852095,0,.00279627,.999483,.851408,0,.0107635,.994545,.84579,0,.0206454,.986188,.835231,0,.0315756,.969847,.814687,0,.0432021,.945951,.783735,0,.0553396,.91917,.746074,0,.0678766,.895488,.706938,0,.0807395,.878232,.669534,0,.0938767,.868252,.635168,0,.10725,.863873,.603069,0,.120832,.863369,.572514,0,.134598,.86545,.543169,0,.148533,.868803,.514578,0,.16262,.872794,.486762,0,.176849,.87702,.459811,0,.19121,.881054,.433654,0,.205694,.884974,.408574,0,.220294,.888587,.384525,0,.235005,.891877,.36156,0,.24982,.894793,.339661,0,.264737,.89743,.318913,0,.279751,.899796,.299302,0,.294859,.901943,.280843,0,.310058,.903858,.263481,0,.325346,.905574,.247197,0,.340721,.907069,.231915,0,.356181,.908379,.217614,0,.371725,.90952,.20425,0,.387353,.910483,.191758,0,.403063,.91128,.180092,0,.418854,.911936,.169222,0,.434727,.912454,.159098,0,.450682,.912835,.149668,0,.466718,.913078,.140884,0,.482837,.913192,.132709,0,.499038,.913175,.125095,0,.515324,.91304,.118012,0,.531695,.912781,.111417,0,.548153,.91241,.105281,0,.5647,.911924,.0995691,0,.581338,.911331,.0942531,0,.59807,.910637,.0893076,0,.6149,.90984,.0846998,0,.63183,.908941,.0804044,0,.648865,.907944,.0763984,0,.666011,.906857,.0726638,0,.683273,.90568,.0691783,0,.700659,.904416,.0659222,0,.718176,.903067,.0628782,0,.735834,.901637,.0600307,0,.753646,.900128,.0573647,0,.771625,.898544,.0548668,0,.78979,.89689,.052527,0,.808162,.895165,.0503306,0,.826771,.893371,.0482668,0,.845654,.891572,.0463605,0,.864863,.889763,.0445998,0,.884472,.887894,.0429451,0,.904592,.885967,.0413884,0,.925407,.883984,.0399225,0,.947271,.881945,.0385405,0,.97105,.879854,.0372362,0,1,.999804,.995833,0,0,.938155,.933611,0,.0158731,.864755,.854311,0,.0317461,.888594,.865264,0,.0476191,.905575,.863922,0,.0634921,.915125,.850558,0,.0793651,.920665,.829254,0,.0952381,.924073,.802578,0,.111111,.926304,.772211,0,.126984,.927829,.739366,0,.142857,.928924,.705033,0,.15873,.92973,.670019,0,.174603,.930339,.634993,0,.190476,.930811,.600485,0,.206349,.931191,.566897,0,.222222,.93149,.534485,0,.238095,.931737,.503429,0,.253968,.931939,.473811,0,.269841,.932108,.445668,0,.285714,.93225,.418993,0,.301587,.932371,.393762,0,.31746,.932474,.369939,0,.333333,.932562,.347479,0,.349206,.932638,.326336,0,.365079,.932703,.306462,0,.380952,.93276,.287805,0,.396825,.932809,.270313,0,.412698,.932851,.253933,0,.428571,.932887,.23861,0,.444444,.932917,.224289,0,.460317,.932943,.210917,0,.47619,.932965,.19844,0,.492063,.932982,.186807,0,.507937,.932995,.175966,0,.52381,.933005,.165869,0,.539683,.933011,.156468,0,.555556,.933013,.147719,0,.571429,.933013,.139579,0,.587302,.93301,.132007,0,.603175,.933004,.124965,0,.619048,.932994,.118416,0,.634921,.932982,.112326,0,.650794,.932968,.106663,0,.666667,.93295,.101397,0,.68254,.932931,.0964993,0,.698413,.932908,.0919438,0,.714286,.932883,.0877057,0,.730159,.932856,.0837623,0,.746032,.932827,.0800921,0,.761905,.932796,.0766754,0,.777778,.932762,.0734936,0,.793651,.932727,.0705296,0,.809524,.932689,.0677676,0,.825397,.93265,.0651929,0,.84127,.932609,.0627917,0,.857143,.932565,.0605515,0,.873016,.932521,.0584606,0,.888889,.932474,.0565082,0,.904762,.932427,.0546841,0,.920635,.932377,.0529793,0,.936508,.932326,.0513851,0,.952381,.932274,.0498936,0,.968254,.93222,.0484975,0,.984127,.932164,.0471899,0,1],n=new Float32Array(e),i=new Float32Array(t);r.UniformsLib.LTC_FLOAT_1=new r.DataTexture(n,64,64,r.RGBAFormat,r.FloatType,r.UVMapping,r.ClampToEdgeWrapping,r.ClampToEdgeWrapping,r.LinearFilter,r.NearestFilter,1),r.UniformsLib.LTC_FLOAT_2=new r.DataTexture(i,64,64,r.RGBAFormat,r.FloatType,r.UVMapping,r.ClampToEdgeWrapping,r.ClampToEdgeWrapping,r.LinearFilter,r.NearestFilter,1),r.UniformsLib.LTC_FLOAT_1.needsUpdate=!0,r.UniformsLib.LTC_FLOAT_2.needsUpdate=!0;const s=new Uint16Array(e.length);e.forEach((function(e,t){s[t]=r.DataUtils.toHalfFloat(e)}));const a=new Uint16Array(t.length);t.forEach((function(e,t){a[t]=r.DataUtils.toHalfFloat(e)})),r.UniformsLib.LTC_HALF_1=new r.DataTexture(s,64,64,r.RGBAFormat,r.HalfFloatType,r.UVMapping,r.ClampToEdgeWrapping,r.ClampToEdgeWrapping,r.LinearFilter,r.NearestFilter,1),r.UniformsLib.LTC_HALF_2=new r.DataTexture(a,64,64,r.RGBAFormat,r.HalfFloatType,r.UVMapping,r.ClampToEdgeWrapping,r.ClampToEdgeWrapping,r.LinearFilter,r.NearestFilter,1),r.UniformsLib.LTC_HALF_1.needsUpdate=!0,r.UniformsLib.LTC_HALF_2.needsUpdate=!0}}},27575:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(39867),i=n(13235),s=n(45051);class a extends r.LineSegments2{constructor(e=new i.LineGeometry,t=new s.LineMaterial({color:16777215*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}t.Line2=a},13235:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(5440);class i extends r.LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}t.LineGeometry=i},45051:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:r.UniformsUtils.clone(r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:"\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_vertex>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\t\t\t\t#include <clipping_planes_pars_vertex>\n\n\t\t\t\tuniform float linewidth;\n\t\t\t\tuniform vec2 resolution;\n\n\t\t\t\tattribute vec3 instanceStart;\n\t\t\t\tattribute vec3 instanceEnd;\n\n\t\t\t\tattribute vec3 instanceColorStart;\n\t\t\t\tattribute vec3 instanceColorEnd;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashScale;\n\t\t\t\t\tattribute float instanceDistanceStart;\n\t\t\t\t\tattribute float instanceDistanceEnd;\n\t\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#endif\n\n\t\t\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t\t\t// conservative estimate of the near plane\n\t\t\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#ifdef USE_COLOR\n\n\t\t\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t\t\t// camera space\n\t\t\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\tworldStart = start.xyz;\n\t\t\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvUv = uv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\t\t\tif ( perspective ) {\n\n\t\t\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// clip space\n\t\t\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t\t\t// ndc space\n\t\t\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t\t\t// direction\n\t\t\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t\t\t// account for clip-space aspect ratio\n\t\t\t\t\tdir.x *= aspect;\n\t\t\t\t\tdir = normalize( dir );\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\t\t\tvec3 offset;\n\t\t\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t\t\t// set the world position\n\t\t\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t\t\t// project the worldpos\n\t\t\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t\t\t// segments overlap neatly\n\t\t\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\t\t\tdir.x /= aspect;\n\t\t\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t\t\t// sign flip\n\t\t\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t\t\t// endcaps\n\t\t\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\t\t\toffset += - dir;\n\n\t\t\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\t\t\toffset += dir;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// adjust for linewidth\n\t\t\t\t\t\toffset *= linewidth;\n\n\t\t\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t\t\t// select end\n\t\t\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t\t\t// back to clip space\n\t\t\t\t\t\toffset *= clip.w;\n\n\t\t\t\t\t\tclip.xy += offset;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_Position = clip;\n\n\t\t\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t\t#include <clipping_planes_vertex>\n\t\t\t\t\t#include <fog_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:`\n\t\t\t\tuniform vec3 diffuse;\n\t\t\t\tuniform float opacity;\n\t\t\t\tuniform float linewidth;\n\n\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\tuniform float dashOffset;\n\t\t\t\t\tuniform float dashSize;\n\t\t\t\t\tuniform float gapSize;\n\n\t\t\t\t#endif\n\n\t\t\t\tvarying float vLineDistance;\n\n\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\tvarying vec4 worldPos;\n\t\t\t\t\tvarying vec3 worldStart;\n\t\t\t\t\tvarying vec3 worldEnd;\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#else\n\n\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#endif\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <color_pars_fragment>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <clipping_planes_pars_fragment>\n\n\t\t\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\t\t\tfloat mua;\n\t\t\t\t\tfloat mub;\n\n\t\t\t\t\tvec3 p13 = p1 - p3;\n\t\t\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\t\t\tmua = numer / denom;\n\t\t\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\t\t\treturn vec2( mua, mub );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t\t\t#ifdef USE_DASH\n\n\t\t\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfloat alpha = opacity;\n\n\t\t\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\t\t\tfloat len = length( delta );\n\t\t\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\t#include <color_fragment>\n\n\t\t\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t\t\t}\n\t\t\t`,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(e){Boolean(e)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)},set:function(e){Boolean(e)!==Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}t.LineMaterial=i},39867:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(5440),s=n(45051),a=new r.Vector3,o=new r.Vector3,l=new r.Vector4,c=new r.Vector4,h=new r.Vector4,u=new r.Vector3,d=new r.Matrix4,p=new r.Line3,f=new r.Vector3,m=new r.Box3,g=new r.Sphere,A=new r.Vector4;let v,y,x,b;function E(e,t,n){return A.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),A.multiplyScalar(1/A.w),A.x=b/n.width,A.y=b/n.height,A.applyMatrix4(e.projectionMatrixInverse),A.multiplyScalar(1/A.w),Math.abs(Math.max(A.x,A.y))}class _ extends r.Mesh{constructor(e=new i.LineSegmentsGeometry,t=new s.LineMaterial({color:16777215*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let r=0,l=0,c=t.count;r<c;r++,l+=2)a.fromBufferAttribute(t,r),o.fromBufferAttribute(n,r),i[l]=0===l?0:i[l-1],i[l+1]=i[l]+a.distanceTo(o);const s=new r.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(s,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;null!==i||n||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=void 0!==e.params.Line2&&e.params.Line2.threshold||0;v=e.ray;const a=this.matrixWorld,o=this.geometry,A=this.material;let _,S;if(b=A.linewidth+s,y=o.attributes.instanceStart,x=o.attributes.instanceEnd,null===o.boundingSphere&&o.computeBoundingSphere(),g.copy(o.boundingSphere).applyMatrix4(a),n)_=.5*b;else{_=E(i,Math.max(i.near,g.distanceToPoint(v.origin)),A.resolution)}if(g.radius+=_,!1!==v.intersectsSphere(g)){if(null===o.boundingBox&&o.computeBoundingBox(),m.copy(o.boundingBox).applyMatrix4(a),n)S=.5*b;else{S=E(i,Math.max(i.near,m.distanceToPoint(v.origin)),A.resolution)}m.expandByScalar(S),!1!==v.intersectsBox(m)&&(n?function(e,t){for(let n=0,i=y.count;n<i;n++){p.start.fromBufferAttribute(y,n),p.end.fromBufferAttribute(x,n);const i=new r.Vector3,s=new r.Vector3;v.distanceSqToSegment(p.start,p.end,s,i),s.distanceTo(i)<.5*b&&t.push({point:s,pointOnLine:i,distance:v.origin.distanceTo(s),object:e,face:null,faceIndex:n,uv:null,uv2:null})}}(this,t):function(e,t,n){const i=t.projectionMatrix,s=e.material.resolution,a=e.matrixWorld,o=e.geometry,m=o.attributes.instanceStart,g=o.attributes.instanceEnd,A=-t.near;v.at(1,h),h.w=1,h.applyMatrix4(t.matrixWorldInverse),h.applyMatrix4(i),h.multiplyScalar(1/h.w),h.x*=s.x/2,h.y*=s.y/2,h.z=0,u.copy(h),d.multiplyMatrices(t.matrixWorldInverse,a);for(let h=0,y=m.count;h<y;h++){if(l.fromBufferAttribute(m,h),c.fromBufferAttribute(g,h),l.w=1,c.w=1,l.applyMatrix4(d),c.applyMatrix4(d),l.z>A&&c.z>A)continue;if(l.z>A){const e=l.z-c.z,t=(l.z-A)/e;l.lerp(c,t)}else if(c.z>A){const e=c.z-l.z,t=(c.z-A)/e;c.lerp(l,t)}l.applyMatrix4(i),c.applyMatrix4(i),l.multiplyScalar(1/l.w),c.multiplyScalar(1/c.w),l.x*=s.x/2,l.y*=s.y/2,c.x*=s.x/2,c.y*=s.y/2,p.start.copy(l),p.start.z=0,p.end.copy(c),p.end.z=0;const t=p.closestPointToPointParameter(u,!0);p.at(t,f);const o=r.MathUtils.lerp(l.z,c.z,t),y=o>=-1&&o<=1,x=u.distanceTo(f)<.5*b;if(y&&x){p.start.fromBufferAttribute(m,h),p.end.fromBufferAttribute(g,h),p.start.applyMatrix4(a),p.end.applyMatrix4(a);const t=new r.Vector3,i=new r.Vector3;v.distanceSqToSegment(p.start,p.end,i,t),n.push({point:i,pointOnLine:t,distance:v.origin.distanceTo(i),object:e,face:null,faceIndex:h,uv:null,uv2:null})}}}(this,i,t))}}}t.LineSegments2=_},5440:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Box3,s=new r.Vector3;class a extends r.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new r.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new r.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new r.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new r.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(t),this.boundingBox.union(i))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i<a;i++)s.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(s)),s.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(s));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}t.LineSegmentsGeometry=a},77723:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(5440),s=n(45051),a=new r.Vector3,o=new r.Vector3;class l extends r.Mesh{constructor(e=new i.LineSegmentsGeometry,t=new s.LineMaterial({color:16777215*Math.random()})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let r=0,l=0,c=t.count;r<c;r++,l+=2)a.fromBufferAttribute(t,r),o.fromBufferAttribute(n,r),i[l]=0===l?0:i[l-1],i[l+1]=i[l]+a.distanceTo(o);const s=new r.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(s,1,1)),this}}t.Wireframe=l},8052:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(5440);class s extends i.LineSegmentsGeometry{constructor(e){super(),this.isWireframeGeometry2=!0,this.type="WireframeGeometry2",this.fromWireframeGeometry(new r.WireframeGeometry(e))}}t.WireframeGeometry2=s},37425:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new WeakMap;class s extends r.Loader{constructor(e){super(e),this.libraryPath="",this.libraryPending=null,this.libraryBinary=null,this.libraryConfig={},this.url="",this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.workerConfig={},this.materials=[]}setLibraryPath(e){return this.libraryPath=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,s){const a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),this.url=e,a.load(e,(n=>{if(i.has(n)){return i.get(n).promise.then(t).catch(s)}this.decodeObjects(n,e).then(t).catch(s)}),n,s)}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}decodeObjects(e,t){let n,r;const s=e.byteLength,a=this._getWorker(s).then((t=>(n=t,r=this.workerNextTaskID++,new Promise(((t,i)=>{n._callbacks[r]={resolve:t,reject:i},n.postMessage({type:"decode",id:r,buffer:e},[e])}))))).then((e=>this._createGeometry(e.data)));return a.catch((()=>!0)).then((()=>{n&&r&&this._releaseTask(n,r)})),i.set(e,{url:t,promise:a}),a}parse(e,t,n){this.decodeObjects(e,"").then(t).catch(n)}_compareMaterials(e){const t={};t.name=e.name,t.color={},t.color.r=e.color.r,t.color.g=e.color.g,t.color.b=e.color.b,t.type=e.type;for(let n=0;n<this.materials.length;n++){const e=this.materials[n],r={};if(r.name=e.name,r.color={},r.color.r=e.color.r,r.color.g=e.color.g,r.color.b=e.color.b,r.type=e.type,JSON.stringify(t)===JSON.stringify(r))return e}return this.materials.push(e),e}_createMaterial(e){if(void 0===e)return new r.MeshStandardMaterial({color:new r.Color(1,1,1),metalness:.8,name:"default",side:2});const t=e.diffuseColor,n=new r.Color(t.r/255,t.g/255,t.b/255);0===t.r&&0===t.g&&0===t.b&&(n.r=1,n.g=1,n.b=1);const i=new r.MeshStandardMaterial({color:n,name:e.name,side:2,transparent:e.transparency>0,opacity:1-e.transparency}),s=new r.TextureLoader;for(let r=0;r<e.textures.length;r++){const t=e.textures[r];if(null!==t.image){const e=s.load(t.image);switch(t.type){case"Diffuse":i.map=e;break;case"Bump":i.bumpMap=e;break;case"Transparency":i.alphaMap=e,i.transparent=!0;break;case"Emap":i.envMap=e}}}return i}_createGeometry(e){const t=new r.Object3D,n=[],i=[],s=[];t.userData.layers=e.layers,t.userData.groups=e.groups,t.userData.settings=e.settings,t.userData.objectType="File3dm",t.userData.materials=null,t.name=this.url;let a=e.objects;const o=e.materials;for(let r=0;r<a.length;r++){const l=a[r],c=l.attributes;switch(l.objectType){case"InstanceDefinition":i.push(l);break;case"InstanceReference":s.push(l);break;default:let r;if(c.materialIndex>=0){const e=o[c.materialIndex];let t=this._createMaterial(e);t=this._compareMaterials(t),r=this._createObject(l,t)}else{const e=this._createMaterial();r=this._createObject(l,e)}if(void 0===r)continue;const a=e.layers[c.layerIndex];r.visible=!a||e.layers[c.layerIndex].visible,c.isInstanceDefinitionObject?n.push(r):t.add(r)}}for(let l=0;l<i.length;l++){const e=i[l];a=[];for(let t=0;t<e.attributes.objectIds.length;t++){const r=e.attributes.objectIds[t];for(let e=0;e<n.length;e++){r===n[e].userData.attributes.id&&a.push(n[e])}}for(let n=0;n<s.length;n++){const i=s[n];if(i.geometry.parentIdefId===e.attributes.id){const e=new r.Object3D,n=i.geometry.xform.array,s=new r.Matrix4;s.set(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]),e.applyMatrix4(s);for(let t=0;t<a.length;t++)e.add(a[t].clone(!0));t.add(e)}}}return t.userData.materials=this.materials,t}_createObject(e,t){const n=new r.BufferGeometryLoader,i=e.attributes;let s,a,o,l;switch(e.objectType){case"Point":case"PointSet":s=n.parse(e.geometry),s.attributes.hasOwnProperty("color")?a=new r.PointsMaterial({vertexColors:!0,sizeAttenuation:!1,size:2}):(o=i.drawColor,l=new r.Color(o.r/255,o.g/255,o.b/255),a=new r.PointsMaterial({color:l,sizeAttenuation:!1,size:2})),a=this._compareMaterials(a);const c=new r.Points(s,a);return c.userData.attributes=i,c.userData.objectType=e.objectType,i.name&&(c.name=i.name),c;case"Mesh":case"Extrusion":case"SubD":case"Brep":if(null===e.geometry)return;s=n.parse(e.geometry),s.attributes.hasOwnProperty("color")&&(t.vertexColors=!0),null===t&&(t=this._createMaterial(),t=this._compareMaterials(t));const h=new r.Mesh(s,t);return h.castShadow=i.castsShadows,h.receiveShadow=i.receivesShadows,h.userData.attributes=i,h.userData.objectType=e.objectType,i.name&&(h.name=i.name),h;case"Curve":s=n.parse(e.geometry),o=i.drawColor,l=new r.Color(o.r/255,o.g/255,o.b/255),a=new r.LineBasicMaterial({color:l}),a=this._compareMaterials(a);const u=new r.Line(s,a);return u.userData.attributes=i,u.userData.objectType=e.objectType,i.name&&(u.name=i.name),u;case"TextDot":s=e.geometry;const d=document.createElement("canvas").getContext("2d"),p=`${s.fontHeight}px ${s.fontFace}`;d.font=p;const f=d.measureText(s.text).width+10,m=s.fontHeight+10,g=window.devicePixelRatio;d.canvas.width=f*g,d.canvas.height=m*g,d.canvas.style.width=f+"px",d.canvas.style.height=m+"px",d.setTransform(g,0,0,g,0,0),d.font=p,d.textBaseline="middle",d.textAlign="center",l=i.drawColor,d.fillStyle=`rgba(${l.r},${l.g},${l.b},${l.a})`,d.fillRect(0,0,f,m),d.fillStyle="white",d.fillText(s.text,f/2,m/2);const A=new r.CanvasTexture(d.canvas);A.minFilter=r.LinearFilter,A.wrapS=r.ClampToEdgeWrapping,A.wrapT=r.ClampToEdgeWrapping,a=new r.SpriteMaterial({map:A,depthTest:!1});const v=new r.Sprite(a);return v.position.set(s.point[0],s.point[1],s.point[2]),v.scale.set(f/10,m/10,1),v.userData.attributes=i,v.userData.objectType=e.objectType,i.name&&(v.name=i.name),v;case"Light":let y;if(s=e.geometry,s.isDirectionalLight)y=new r.DirectionalLight,y.castShadow=i.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.target.position.set(s.direction[0],s.direction[1],s.direction[2]),y.shadow.normalBias=.1;else if(s.isPointLight)y=new r.PointLight,y.castShadow=i.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.shadow.normalBias=.1;else if(s.isRectangularLight){y=new r.RectAreaLight;const e=Math.abs(s.width[2]),t=Math.abs(s.length[0]);y.position.set(s.location[0]-t/2,s.location[1],s.location[2]-e/2),y.height=t,y.width=e,y.lookAt(new r.Vector3(s.direction[0],s.direction[1],s.direction[2]))}else if(s.isSpotLight)y=new r.SpotLight,y.castShadow=i.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.target.position.set(s.direction[0],s.direction[1],s.direction[2]),y.angle=s.spotAngleRadians,y.shadow.normalBias=.1;else if(s.isLinearLight)return void console.warn("THREE.3DMLoader: No conversion exists for linear lights.");return y&&(y.intensity=s.intensity,o=s.diffuse,l=new r.Color(o.r/255,o.g/255,o.b/255),y.color=l,y.userData.attributes=i,y.userData.objectType=e.objectType),y}}_initLibrary(){if(!this.libraryPending){const e=new r.FileLoader(this.manager);e.setPath(this.libraryPath);const t=new Promise(((t,n)=>{e.load("rhino3dm.js",t,void 0,n)})),n=new r.FileLoader(this.manager);n.setPath(this.libraryPath),n.setResponseType("arraybuffer");const i=new Promise(((e,t)=>{n.load("rhino3dm.wasm",e,void 0,t)}));this.libraryPending=Promise.all([t,i]).then((([e,t])=>{this.libraryConfig.wasmBinary=t;const n=a.toString(),r=["/* rhino3dm.js */",e,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))}))}return this.libraryPending}_getWorker(e){return this._initLibrary().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",libraryConfig:this.libraryConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.Rhino3dmLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskLoad+=e,t}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function a(){let e,t,n;function r(e,t){const r=e.geometry(),a=e.attributes();let o,l,c,h,u,d=r.objectType;switch(d){case n.ObjectType.Curve:const e=s(r,100);c={},l={},h={},c.itemSize=3,c.type="Float32Array",c.array=[];for(let t=0;t<e.length;t++)c.array.push(e[t][0]),c.array.push(e[t][1]),c.array.push(e[t][2]);l.position=c,h.attributes=l,o={data:h};break;case n.ObjectType.Point:const p=r.location;c={};const f={};l={},h={},c.itemSize=3,c.type="Float32Array",c.array=[p[0],p[1],p[2]];const m=a.drawColor(t);f.itemSize=3,f.type="Float32Array",f.array=[m.r/255,m.g/255,m.b/255],l.position=c,l.color=f,h.attributes=l,o={data:h};break;case n.ObjectType.PointSet:case n.ObjectType.Mesh:o=r.toThreejsJSON();break;case n.ObjectType.Brep:const g=r.faces();u=new n.Mesh;for(let t=0;t<g.count;t++){const e=g.get(t),r=e.getMesh(n.MeshType.Any);r&&(u.append(r),r.delete()),e.delete()}u.faces().count>0&&(u.compact(),o=u.toThreejsJSON(),g.delete()),u.delete();break;case n.ObjectType.Extrusion:u=r.getMesh(n.MeshType.Any),u&&(o=u.toThreejsJSON(),u.delete());break;case n.ObjectType.TextDot:case n.ObjectType.Light:o=i(r);break;case n.ObjectType.InstanceReference:o=i(r),o.xform=i(r.xform),o.xform.array=r.xform.toFloatArray(!0);break;case n.ObjectType.SubD:r.subdivide(3),u=n.Mesh.createFromSubDControlNet(r),u&&(o=u.toThreejsJSON(),u.delete());break;default:console.warn(`THREE.3DMLoader: TODO: Implement ${d.constructor.name}`)}if(o)return l=i(a),l.geometry=i(r),a.groupCount>0&&(l.groupIds=a.getGroupList()),a.userStringCount>0&&(l.userStrings=a.getUserStrings()),r.userStringCount>0&&(l.geometry.userStrings=r.getUserStrings()),l.drawColor=a.drawColor(t),d=d.constructor.name,d=d.substring(11,d.length),{geometry:o,attributes:l,objectType:d};console.warn(`THREE.3DMLoader: ${d.constructor.name} has no associated mesh geometry.`)}function i(e){const t={};for(const n in e){const r=e[n];"function"!=typeof r&&("object"==typeof r&&null!==r&&r.hasOwnProperty("constructor")?t[n]={name:r.constructor.name,value:r.value}:t[n]=r)}return t}function s(e,t){let r=t,i=[];const a=[];if(e instanceof n.LineCurve)return[e.pointAtStart,e.pointAtEnd];if(e instanceof n.PolylineCurve){r=e.pointCount;for(let t=0;t<r;t++)i.push(e.point(t));return i}if(e instanceof n.PolyCurve){const t=e.segmentCount;for(let n=0;n<t;n++){const t=e.segmentCurve(n),a=s(t,r);i=i.concat(a),t.delete()}return i}if(e instanceof n.ArcCurve&&(r=Math.floor(e.angleDegrees/5),r=r<2?2:r),e instanceof n.NurbsCurve&&1===e.degree){const t=e.tryGetPolyline();for(let e=0;e<t.count;e++)i.push(t.get(e));return t.delete(),i}const o=e.domain,l=r-1;for(let n=0;n<r;n++){const t=o[0]+n/l*(o[1]-o[0]);if(t===o[0]||t===o[1]){a.push(t);continue}const r=e.tangentAt(t),i=e.tangentAt(a.slice(-1)[0]),s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],c=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],h=Math.sqrt(s*c);let u;if(0===h)u=Math.PI/2;else{const e=(r.x*i.x+r.y*i.y+r.z*i.z)/h;u=Math.acos(Math.max(-1,Math.min(1,e)))}u<.1||a.push(t)}return i=a.map((t=>e.pointAt(t))),i}onmessage=function(s){const a=s.data;switch(a.type){case"init":t=a.libraryConfig;const s=t.wasmBinary;let o;e=new Promise((function(e){o={wasmBinary:s,onRuntimeInitialized:e},rhino3dm(o)})).then((()=>{n=o}));break;case"decode":const l=a.buffer;e.then((()=>{const e=function(e,t){const n=new Uint8Array(t),s=e.File3dm.fromByteArray(n),a=[],o=[],l=[],c=[],h=[],u=[],d=s.objects(),p=d.count;for(let i=0;i<p;i++){const e=d.get(i),t=r(e,s);e.delete(),t&&a.push(t)}for(let r=0;r<s.instanceDefinitions().count();r++){const e=s.instanceDefinitions().get(r),t=i(e);t.objectIds=e.getObjectIds(),a.push({geometry:null,attributes:t,objectType:"InstanceDefinition"})}const f=[e.TextureType.Diffuse,e.TextureType.Bump,e.TextureType.Transparency,e.TextureType.Opacity,e.TextureType.Emap],m=[e.TextureType.PBR_BaseColor,e.TextureType.PBR_Subsurface,e.TextureType.PBR_SubsurfaceScattering,e.TextureType.PBR_SubsurfaceScatteringRadius,e.TextureType.PBR_Metallic,e.TextureType.PBR_Specular,e.TextureType.PBR_SpecularTint,e.TextureType.PBR_Roughness,e.TextureType.PBR_Anisotropic,e.TextureType.PBR_Anisotropic_Rotation,e.TextureType.PBR_Sheen,e.TextureType.PBR_SheenTint,e.TextureType.PBR_Clearcoat,e.TextureType.PBR_ClearcoatBump,e.TextureType.PBR_ClearcoatRoughness,e.TextureType.PBR_OpacityIor,e.TextureType.PBR_OpacityRoughness,e.TextureType.PBR_Emission,e.TextureType.PBR_AmbientOcclusion,e.TextureType.PBR_Displacement];for(let r=0;r<s.materials().count();r++){const e=s.materials().get(r),t=e.physicallyBased();let n=i(e);const a=[];for(let r=0;r<f.length;r++){const t=e.getTexture(f[r]);if(t){let e=f[r].constructor.name;e=e.substring(12,e.length);const n={type:e},i=s.getEmbeddedFileAsBase64(t.fileName);i?n.image="data:image/png;base64,"+i:(console.warn(`THREE.3DMLoader: Image for ${e} texture not embedded in file.`),n.image=null),a.push(n),t.delete()}}if(n.textures=a,t.supported){console.log("pbr true");for(let n=0;n<m.length;n++){const t=e.getTexture(f[n]);if(t){const e=s.getEmbeddedFileAsBase64(t.fileName);let r=f[n].constructor.name;r=r.substring(12,r.length);const i={type:r,image:"data:image/png;base64,"+e};a.push(i),t.delete()}}const t=i(e.physicallyBased());n=Object.assign(t,n)}o.push(n),e.delete(),t.delete()}for(let r=0;r<s.layers().count();r++){const e=s.layers().get(r),t=i(e);l.push(t),e.delete()}for(let r=0;r<s.views().count();r++){const e=s.views().get(r),t=i(e);c.push(t),e.delete()}for(let r=0;r<s.namedViews().count();r++){const e=s.namedViews().get(r),t=i(e);h.push(t),e.delete()}for(let r=0;r<s.groups().count();r++){const e=s.groups().get(r),t=i(e);u.push(t),e.delete()}const g=i(s.settings());return s.delete(),{objects:a,materials:o,layers:l,views:c,namedViews:h,groups:u,settings:g}}(n,l);self.postMessage({type:"decode",id:a.id,data:e})}))}}}t.Rhino3dmLoader=s},88799:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083);class s extends r.Loader{constructor(e){super(e),this.availableExtensions=[]}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=this,n=new r.TextureLoader(this.manager);function s(e){const t=[],n=(new DOMParser).parseFromString(e,"application/xml").querySelectorAll("Relationship");for(let r=0;r<n.length;r++){const e=n[r],i={target:e.getAttribute("Target"),id:e.getAttribute("Id"),type:e.getAttribute("Type")};t.push(i)}return t}function a(e){const t={id:e.getAttribute("id"),basematerials:[]},n=e.querySelectorAll("base");for(let r=0;r<n.length;r++){const e=h(n[r]);e.index=r,t.basematerials.push(e)}return t}function o(e){const t={id:e.getAttribute("id"),texid:e.getAttribute("texid"),displaypropertiesid:e.getAttribute("displaypropertiesid")},n=e.querySelectorAll("tex2coord"),r=[];for(let i=0;i<n.length;i++){const e=n[i],t=e.getAttribute("u"),s=e.getAttribute("v");r.push(parseFloat(t),parseFloat(s))}return t.uvs=new Float32Array(r),t}function l(e){const t={id:e.getAttribute("id"),displaypropertiesid:e.getAttribute("displaypropertiesid")},n=e.querySelectorAll("color"),i=[],s=new r.Color;for(let r=0;r<n.length;r++){const e=n[r].getAttribute("color");s.setStyle(e.substring(0,7)),s.convertSRGBToLinear(),i.push(s.r,s.g,s.b)}return t.colors=new Float32Array(i),t}function c(e){const t={id:e.getAttribute("id")},n=e.querySelectorAll("pbmetallic"),r=[];for(let i=0;i<n.length;i++){const e=n[i];r.push({name:e.getAttribute("name"),metallicness:parseFloat(e.getAttribute("metallicness")),roughness:parseFloat(e.getAttribute("roughness"))})}return t.data=r,t}function h(e){const t={};return t.name=e.getAttribute("name"),t.displaycolor=e.getAttribute("displaycolor"),t.displaypropertiesid=e.getAttribute("displaypropertiesid"),t}function u(e){const t={};t.objectId=e.getAttribute("objectid");const n=e.getAttribute("transform");return n&&(t.transform=d(n)),t}function d(e){const t=[];e.split(" ").forEach((function(e){t.push(parseFloat(e))}));const n=new r.Matrix4;return n.set(t[0],t[3],t[6],t[9],t[1],t[4],t[7],t[10],t[2],t[5],t[8],t[11],0,0,0,1),n}function p(e){const t={type:e.getAttribute("type")},n=e.getAttribute("id");n&&(t.id=n);const r=e.getAttribute("pid");r&&(t.pid=r);const i=e.getAttribute("pindex");i&&(t.pindex=i);const s=e.getAttribute("thumbnail");s&&(t.thumbnail=s);const a=e.getAttribute("partnumber");a&&(t.partnumber=a);const o=e.getAttribute("name");o&&(t.name=o);const l=e.querySelector("mesh");l&&(t.mesh=function(e){const t={},n=[],r=e.querySelectorAll("vertices vertex");for(let o=0;o<r.length;o++){const e=r[o],t=e.getAttribute("x"),i=e.getAttribute("y"),s=e.getAttribute("z");n.push(parseFloat(t),parseFloat(i),parseFloat(s))}t.vertices=new Float32Array(n);const i=[],s=[],a=e.querySelectorAll("triangles triangle");for(let o=0;o<a.length;o++){const e=a[o],t=e.getAttribute("v1"),n=e.getAttribute("v2"),r=e.getAttribute("v3"),l=e.getAttribute("p1"),c=e.getAttribute("p2"),h=e.getAttribute("p3"),u=e.getAttribute("pid"),d={};d.v1=parseInt(t,10),d.v2=parseInt(n,10),d.v3=parseInt(r,10),s.push(d.v1,d.v2,d.v3),l&&(d.p1=parseInt(l,10)),c&&(d.p2=parseInt(c,10)),h&&(d.p3=parseInt(h,10)),u&&(d.pid=u),0<Object.keys(d).length&&i.push(d)}return t.triangleProperties=i,t.triangles=new Uint32Array(s),t}(l));const c=e.querySelector("components");return c&&(t.components=function(e){const t=[],n=e.querySelectorAll("component");for(let r=0;r<n.length;r++){const e=u(n[r]);t.push(e)}return t}(c)),t}function f(e){const t={unit:e.getAttribute("unit")||"millimeter"},n=e.querySelectorAll("metadata");n&&(t.metadata=function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=r.getAttribute("name");0<=["Title","Designer","Description","Copyright","LicenseTerms","Rating","CreationDate","ModificationDate"].indexOf(i)&&(t[i]=r.textContent)}return t}(n));const r=e.querySelector("resources");r&&(t.resources=function(e){const t={basematerials:{}},n=e.querySelectorAll("basematerials");for(let o=0;o<n.length;o++){const e=a(n[o]);t.basematerials[e.id]=e}t.texture2d={};const r=e.querySelectorAll("texture2d");for(let a=0;a<r.length;a++){const e={id:(i=r[a]).getAttribute("id"),path:i.getAttribute("path"),contenttype:i.getAttribute("contenttype"),tilestyleu:i.getAttribute("tilestyleu"),tilestylev:i.getAttribute("tilestylev"),filter:i.getAttribute("filter")};t.texture2d[e.id]=e}var i;t.colorgroup={};const s=e.querySelectorAll("colorgroup");for(let a=0;a<s.length;a++){const e=l(s[a]);t.colorgroup[e.id]=e}t.pbmetallicdisplayproperties={};const h=e.querySelectorAll("pbmetallicdisplayproperties");for(let a=0;a<h.length;a++){const e=c(h[a]);t.pbmetallicdisplayproperties[e.id]=e}t.texture2dgroup={};const u=e.querySelectorAll("texture2dgroup");for(let a=0;a<u.length;a++){const e=o(u[a]);t.texture2dgroup[e.id]=e}t.object={};const d=e.querySelectorAll("object");for(let a=0;a<d.length;a++){const e=p(d[a]);t.object[e.id]=e}return t}(r));const i=e.querySelector("build");return i&&(t.build=function(e){const t=[],n=e.querySelectorAll("item");for(let r=0;r<n.length;r++){const e=n[r],i={objectId:e.getAttribute("objectid")},s=e.getAttribute("transform");s&&(i.transform=d(s)),t.push(i)}return t}(i)),t}function m(e,t,i,s){const a=e.texid,o=i.resources.texture2d[a];if(o){const e=s[o.path],t=o.contenttype,i=new Blob([e],{type:t}),a=URL.createObjectURL(i),l=n.load(a,(function(){URL.revokeObjectURL(a)}));switch("colorSpace"in l?l.colorSpace="srgb":l.encoding=3001,o.tilestyleu){case"wrap":default:l.wrapS=r.RepeatWrapping;break;case"mirror":l.wrapS=r.MirroredRepeatWrapping;break;case"none":case"clamp":l.wrapS=r.ClampToEdgeWrapping}switch(o.tilestylev){case"wrap":default:l.wrapT=r.RepeatWrapping;break;case"mirror":l.wrapT=r.MirroredRepeatWrapping;break;case"none":case"clamp":l.wrapT=r.ClampToEdgeWrapping}switch(o.filter){case"auto":default:l.magFilter=r.LinearFilter,l.minFilter=r.LinearMipmapLinearFilter;break;case"linear":l.magFilter=r.LinearFilter,l.minFilter=r.LinearFilter;break;case"nearest":l.magFilter=r.NearestFilter,l.minFilter=r.NearestFilter}return l}return null}function g(e,t,n,i,s,a,o){const l=o.pindex,c={};for(let r=0,d=t.length;r<d;r++){const e=t[r],n=void 0!==e.p1?e.p1:l;void 0===c[n]&&(c[n]=[]),c[n].push(e)}const h=Object.keys(c),u=[];for(let d=0,p=h.length;d<p;d++){const t=h[d],l=c[t],p=E(e.basematerials[t],i,s,a,o,_),f=new r.BufferGeometry,m=[],g=n.vertices;for(let e=0,n=l.length;e<n;e++){const t=l[e];m.push(g[3*t.v1+0]),m.push(g[3*t.v1+1]),m.push(g[3*t.v1+2]),m.push(g[3*t.v2+0]),m.push(g[3*t.v2+1]),m.push(g[3*t.v2+2]),m.push(g[3*t.v3+0]),m.push(g[3*t.v3+1]),m.push(g[3*t.v3+2])}f.setAttribute("position",new r.Float32BufferAttribute(m,3));const A=new r.Mesh(f,p);u.push(A)}return u}function A(e,t,n,i,s,a,o){const l=new r.BufferGeometry,c=[],h=[],u=n.vertices,d=e.uvs;for(let r=0,m=t.length;r<m;r++){const e=t[r];c.push(u[3*e.v1+0]),c.push(u[3*e.v1+1]),c.push(u[3*e.v1+2]),c.push(u[3*e.v2+0]),c.push(u[3*e.v2+1]),c.push(u[3*e.v2+2]),c.push(u[3*e.v3+0]),c.push(u[3*e.v3+1]),c.push(u[3*e.v3+2]),h.push(d[2*e.p1+0]),h.push(d[2*e.p1+1]),h.push(d[2*e.p2+0]),h.push(d[2*e.p2+1]),h.push(d[2*e.p3+0]),h.push(d[2*e.p3+1])}l.setAttribute("position",new r.Float32BufferAttribute(c,3)),l.setAttribute("uv",new r.Float32BufferAttribute(h,2));const p=E(e,i,s,a,o,m),f=new r.MeshPhongMaterial({map:p,flatShading:!0});return new r.Mesh(l,f)}function v(e,t,n,i,s,a){const o=new r.BufferGeometry,l=[],c=[],h=n.vertices,u=e.colors;for(let r=0,p=t.length;r<p;r++){const e=t[r],n=e.v1,i=e.v2,s=e.v3;l.push(h[3*n+0]),l.push(h[3*n+1]),l.push(h[3*n+2]),l.push(h[3*i+0]),l.push(h[3*i+1]),l.push(h[3*i+2]),l.push(h[3*s+0]),l.push(h[3*s+1]),l.push(h[3*s+2]);const o=void 0!==e.p1?e.p1:a.pindex,d=void 0!==e.p2?e.p2:o,p=void 0!==e.p3?e.p3:o;c.push(u[3*o+0]),c.push(u[3*o+1]),c.push(u[3*o+2]),c.push(u[3*d+0]),c.push(u[3*d+1]),c.push(u[3*d+2]),c.push(u[3*p+0]),c.push(u[3*p+1]),c.push(u[3*p+2])}o.setAttribute("position",new r.Float32BufferAttribute(l,3)),o.setAttribute("color",new r.Float32BufferAttribute(c,3));const d=new r.MeshPhongMaterial({vertexColors:!0,flatShading:!0});return new r.Mesh(o,d)}function y(e){const t=new r.BufferGeometry;t.setIndex(new r.BufferAttribute(e.triangles,1)),t.setAttribute("position",new r.BufferAttribute(e.vertices,3));const n=new r.MeshPhongMaterial({color:11184895,flatShading:!0});return new r.Mesh(t,n)}function x(e,t){return void 0!==t.resources.texture2dgroup[e]?"texture":void 0!==t.resources.basematerials[e]?"material":void 0!==t.resources.colorgroup[e]?"vertexColors":"default"===e?"default":void 0}function b(e,t,n,i,s){const a=new r.Group,o=function(e,t,n){const r={},i=t.triangleProperties,s=n.pid;for(let a=0,o=i.length;a<o;a++){const e=i[a];let t=void 0!==e.pid?e.pid:s;void 0===t&&(t="default"),void 0===r[t]&&(r[t]=[]),r[t].push(e)}return r}(0,e,s),l=function(e,t,n,r,i,s){const a=Object.keys(e),o=[];for(let l=0,c=a.length;l<c;l++){const c=a[l],h=e[c];switch(x(c,r)){case"material":const e=g(r.resources.basematerials[c],h,t,n,r,i,s);for(let t=0,n=e.length;t<n;t++)o.push(e[t]);break;case"texture":const a=r.resources.texture2dgroup[c];o.push(A(a,h,t,n,r,i,s));break;case"vertexColors":const l=r.resources.colorgroup[c];o.push(v(l,h,t,0,0,s));break;case"default":o.push(y(t));break;default:console.error("THREE.3MFLoader: Unsupported resource type.")}}return o}(o,e,t,n,i,s);for(let r=0,c=l.length;r<c;r++)a.add(l[r]);return a}function E(e,t,n,r,i,s){return void 0!==e.build||(e.build=s(e,t,n,r,i)),e.build}function _(e,t,n){let i;const s=e.displaypropertiesid,a=n.resources.pbmetallicdisplayproperties;if(null!==s&&void 0!==a[s]){const t=a[s].data[e.index];i=new r.MeshStandardMaterial({flatShading:!0,roughness:t.roughness,metalness:t.metallicness})}else i=new r.MeshPhongMaterial({flatShading:!0});i.name=e.name;const o=e.displaycolor,l=o.substring(0,7);return i.color.setStyle(l),i.color.convertSRGBToLinear(),9===o.length&&(i.opacity=parseInt(o.charAt(7)+o.charAt(8),16)/255),i}function S(e,t,n,i){const s=new r.Group;for(let r=0;r<e.length;r++){const a=e[r];let o=t[a.objectId];void 0===o&&(w(a.objectId,t,n,i),o=t[a.objectId]);const l=o.clone(),c=a.transform;c&&l.applyMatrix4(c),s.add(l)}return s}function w(e,n,r,i){const s=r.resources.object[e];if(s.mesh){const e=s.mesh;!function(e,n,r){if(!e)return;const i=[],s=Object.keys(e);for(let a=0;a<s.length;a++){const e=s[a];for(let n=0;n<t.availableExtensions.length;n++){const r=t.availableExtensions[n];r.ns===e&&i.push(r)}}for(let t=0;t<i.length;t++){const s=i[t];s.apply(r,e[s.ns],n)}}(r.extensions,e,r.xml),n[s.id]=E(e,n,r,i,s,b)}else{const e=s.components;n[s.id]=E(e,n,r,i,s,S)}}const M=function(e){let t,n,a=null,o=null;const l=[],c=[];let h;const u={},d={};try{a=i.unzipSync(new Uint8Array(e))}catch(g){if(g instanceof ReferenceError)return console.error("THREE.3MFLoader: fflate missing and file is compressed."),null}for(o in a)o.match(/\_rels\/.rels$/)?t=o:o.match(/3D\/_rels\/.*\.model\.rels$/)?n=o:o.match(/^3D\/.*\.model$/)?l.push(o):o.match(/^3D\/Metadata\/.*\.xml$/)||(o.match(/^3D\/Textures?\/.*/)?c.push(o):o.match(/^3D\/Other\/.*/));const p=a[t],m=s(r.LoaderUtils.decodeText(p));if(n){const e=a[n];h=s(r.LoaderUtils.decodeText(e))}for(let i=0;i<l.length;i++){const e=l[i],t=a[e],n=r.LoaderUtils.decodeText(t),s=(new DOMParser).parseFromString(n,"application/xml");"model"!==s.documentElement.nodeName.toLowerCase()&&console.error("THREE.3MFLoader: Error loading 3MF - no 3MF document found: ",e);const o=s.querySelector("model"),c={};for(let r=0;r<o.attributes.length;r++){const e=o.attributes[r];e.name.match(/^xmlns:(.+)$/)&&(c[e.value]=RegExp.$1)}const h=f(o);h.xml=o,0<Object.keys(c).length&&(h.extensions=c),u[e]=h}for(let r=0;r<c.length;r++){const e=c[r];d[e]=a[e].buffer}return{rels:m,modelRels:h,model:u,printTicket:{},texture:d,other:{}}}(e);return function(e,t){const n=new r.Group,i=function(e){for(let t=0;t<e.length;t++){const n=e[t];if("model"===n.target.split(".").pop().toLowerCase())return n}}(t.rels),s=t.model[i.target.substring(1)].build;for(let r=0;r<s.length;r++){const t=s[r],i=e[t.objectId],a=t.transform;a&&i.applyMatrix4(a),n.add(i)}return n}(function(e){const t=e.model,n=e.modelRels,r={},i=Object.keys(t),s={};if(n)for(let a=0,o=n.length;a<o;a++){const t=n[a],r=t.target.substring(1);e.texture[r]&&(s[t.target]=e.texture[r])}for(let a=0;a<i.length;a++){const e=t[i[a]],n=Object.keys(e.resources.object);for(let t=0;t<n.length;t++){w(n[t],r,e,s)}}return r}(M),M)}addExtension(e){this.availableExtensions.push(e)}}t.ThreeMFLoader=s},37343:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083);class s extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){function t(e){let t="AMF Material";const i=e.attributes.id.textContent;let s={r:1,g:1,b:1,a:1},a=null;for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];"metadata"===i.nodeName&&void 0!==i.attributes.type?"name"===i.attributes.type.value&&(t=i.textContent):"color"===i.nodeName&&(s=n(i))}return a=new r.MeshPhongMaterial({flatShading:!0,color:new r.Color(s.r,s.g,s.b),name:t}),1!==s.a&&(a.transparent=!0,a.opacity=s.a),{id:i,material:a}}function n(e){const t={r:1,g:1,b:1,a:1};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];"r"===r.nodeName?t.r=r.textContent:"g"===r.nodeName?t.g=r.textContent:"b"===r.nodeName?t.b=r.textContent:"a"===r.nodeName&&(t.a=r.textContent)}return t}function s(e){const t={name:"",triangles:[],materialid:null};let n=e.firstElementChild;for(void 0!==e.attributes.materialid&&(t.materialId=e.attributes.materialid.nodeValue);n;){if("metadata"===n.nodeName)void 0!==n.attributes.type&&"name"===n.attributes.type.value&&(t.name=n.textContent);else if("triangle"===n.nodeName){const e=n.getElementsByTagName("v1")[0].textContent,r=n.getElementsByTagName("v2")[0].textContent,i=n.getElementsByTagName("v3")[0].textContent;t.triangles.push(e,r,i)}n=n.nextElementSibling}return t}function a(e){const t=[],n=[];let r=e.firstElementChild;for(;r;){if("vertex"===r.nodeName){let e=r.firstElementChild;for(;e;){if("coordinates"===e.nodeName){const n=e.getElementsByTagName("x")[0].textContent,r=e.getElementsByTagName("y")[0].textContent,i=e.getElementsByTagName("z")[0].textContent;t.push(n,r,i)}else if("normal"===e.nodeName){const t=e.getElementsByTagName("nx")[0].textContent,r=e.getElementsByTagName("ny")[0].textContent,i=e.getElementsByTagName("nz")[0].textContent;n.push(t,r,i)}e=e.nextElementSibling}}r=r.nextElementSibling}return{vertices:t,normals:n}}function o(e){const t=e.attributes.id.textContent,r={name:"amfobject",meshes:[]};let i=null,o=e.firstElementChild;for(;o;){if("metadata"===o.nodeName)void 0!==o.attributes.type&&"name"===o.attributes.type.value&&(r.name=o.textContent);else if("color"===o.nodeName)i=n(o);else if("mesh"===o.nodeName){let e=o.firstElementChild;const t={vertices:[],normals:[],volumes:[],color:i};for(;e;){if("vertices"===e.nodeName){const n=a(e);t.normals=t.normals.concat(n.normals),t.vertices=t.vertices.concat(n.vertices)}else"volume"===e.nodeName&&t.volumes.push(s(e));e=e.nextElementSibling}r.meshes.push(t)}o=o.nextElementSibling}return{id:t,obj:r}}const l=function(e){let t=new DataView(e);if("PK"===String.fromCharCode(t.getUint8(0),t.getUint8(1))){let n=null,r=null;console.log("THREE.AMFLoader: Loading Zip");try{n=i.unzipSync(new Uint8Array(e))}catch(a){if(a instanceof ReferenceError)return console.log("THREE.AMFLoader: fflate missing and file is compressed."),null}for(r in n)if(".amf"===r.toLowerCase().substr(-4))break;console.log("THREE.AMFLoader: Trying to load file asset: "+r),t=new DataView(n[r].buffer)}const n=r.LoaderUtils.decodeText(t),s=(new DOMParser).parseFromString(n,"application/xml");return"amf"!==s.documentElement.nodeName.toLowerCase()?(console.log("THREE.AMFLoader: Error loading AMF - no AMF document found."),null):s}(e);let c="",h="";const u=function(e){let t=1,n="millimeter";void 0!==e.documentElement.attributes.unit&&(n=e.documentElement.attributes.unit.value.toLowerCase());const r={millimeter:1,inch:25.4,feet:304.8,meter:1e3,micron:.001};return void 0!==r[n]&&(t=r[n]),console.log("THREE.AMFLoader: Unit scale: "+t),t}(l),d={},p={},f=l.documentElement.childNodes;let m,g;for(m=0;m<f.length;m++){const e=f[m];if("metadata"===e.nodeName)void 0!==e.attributes.type&&("name"===e.attributes.type.value?c=e.textContent:"author"===e.attributes.type.value&&(h=e.textContent));else if("material"===e.nodeName){const n=t(e);d[n.id]=n.material}else if("object"===e.nodeName){const t=o(e);p[t.id]=t.obj}}const A=new r.Group,v=new r.MeshPhongMaterial({color:11184895,flatShading:!0});A.name=c,A.userData.author=h,A.userData.loader="AMF";for(const i in p){const e=p[i],t=e.meshes,n=new r.Group;for(n.name=e.name||"",m=0;m<t.length;m++){let e=v;const i=t[m],s=new r.Float32BufferAttribute(i.vertices,3);let a=null;if(i.normals.length&&(a=new r.Float32BufferAttribute(i.normals,3)),i.color){const t=i.color;e=v.clone(),e.color=new r.Color(t.r,t.g,t.b),1!==t.a&&(e.transparent=!0,e.opacity=t.a)}const o=i.volumes;for(g=0;g<o.length;g++){const t=o[g],i=new r.BufferGeometry;let l=e;i.setIndex(t.triangles),i.setAttribute("position",s.clone()),a&&i.setAttribute("normal",a.clone()),void 0!==d[t.materialId]&&(l=d[t.materialId]),i.scale(u,u,u),n.add(new r.Mesh(i,l.clone()))}}A.add(n)}return A}}t.AMFLoader=s},66910:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{load(e,t,n,i){var s=this,a=""===s.path?r.LoaderUtils.extractUrlBase(e):s.path,o=new r.FileLoader(s.manager);o.setPath(s.path),o.setResponseType("arraybuffer"),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){var n=new r.TextureLoader(this.manager);n.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);var i={KeyFrame:class{constructor(e,t){this.time=e,this.matrix=t.clone(),this.position=new r.Vector3,this.quaternion=new r.Quaternion,this.scale=new r.Vector3(1,1,1),this.matrix.decompose(this.position,this.quaternion,this.scale),this.clone=function(){return new i.KeyFrame(this.time,this.matrix)},this.lerp=function(e,t){var n=(t-=this.time)/(e.time-this.time),r=1-n,s=this.position,a=this.quaternion,o=e.position,l=e.quaternion;return i.KeyFrame.tempAniPos.x=s.x*r+o.x*n,i.KeyFrame.tempAniPos.y=s.y*r+o.y*n,i.KeyFrame.tempAniPos.z=s.z*r+o.z*n,i.KeyFrame.tempAniQuat.set(a.x,a.y,a.z,a.w),i.KeyFrame.tempAniQuat.slerp(l,n),i.KeyFrame.tempAniMatrix.compose(i.KeyFrame.tempAniPos,i.KeyFrame.tempAniQuat,i.KeyFrame.tempAniScale)}}}};i.KeyFrame.tempAniPos=new r.Vector3,i.KeyFrame.tempAniQuat=new r.Quaternion,i.KeyFrame.tempAniScale=new r.Vector3(1,1,1),i.KeyFrame.tempAniMatrix=new r.Matrix4,i.KeyFrameTrack=function(){this.keys=[],this.target=null,this.time=0,this.length=0,this._accelTable={},this.fps=20,this.addKey=function(e){this.keys.push(e)},this.init=function(){if(this.sortKeys(),this.keys.length>0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(let e=0;e<this.length*this.fps;e++)for(let t=0;t<this.keys.length;t++){if(this.keys[t].time==e){this._accelTable[e]=t;break}if(this.keys[t].time<e/this.fps&&this.keys[t+1]&&this.keys[t+1].time>=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;var n=e.hierarchy[0].keys;for(let r=0;r<n.length;r++)this.addKey(new i.KeyFrame(r/t||n[r].time,n[r].targets[0].data));this.init()},this.parseFromCollada=function(e){var t=e.keys,n=this.fps;for(let r=0;r<t.length;r++)this.addKey(new i.KeyFrame(r/n||t[r].time,t[r].matrix));this.init()},this.sortKeys=function(){this.keys.sort(this.keySortFunc)},this.keySortFunc=function(e,t){return e.time-t.time},this.clone=function(){var e=new i.KeyFrameTrack;e.target=this.target,e.time=this.time,e.length=this.length;for(let t=0;t<this.keys.length;t++)e.addKey(this.keys[t].clone());return e.init(),e},this.reTarget=function(e,t){t||(t=i.TrackTargetNodeNameCompare),this.target=t(e,this.target)},this.keySearchAccel=function(e){return e*=this.fps,e=Math.floor(e),this._accelTable[e]||0},this.setTime=function(e){e=Math.abs(e),this.length&&(e=e%this.length+.05);var t=null,n=null;for(let r=this.keySearchAccel(e);r<this.keys.length;r++){if(this.keys[r].time==e){t=this.keys[r],n=this.keys[r];break}if(this.keys[r].time<e&&this.keys[r+1]&&this.keys[r+1].time>e){t=this.keys[r],n=this.keys[r+1];break}if(this.keys[r].time<e&&r==this.keys.length-1){t=this.keys[r],(n=this.keys[0].clone()).time+=this.length+.05;break}}return t&&n&&t!==n?(this.target.matrixAutoUpdate=!1,this.target.matrix.copy(t.lerp(n,e)),void(this.target.matrixWorldNeedsUpdate=!0)):t&&n&&t==n?(this.target.matrixAutoUpdate=!1,this.target.matrix.copy(t.matrix),void(this.target.matrixWorldNeedsUpdate=!0)):void 0}},i.TrackTargetNodeNameCompare=function(e,t){return function e(t,n){if(t.name==n)return t;for(let i=0;i<t.children.length;i++){var r=e(t.children[i],n);if(r)return r}return null}(e,t.name)},i.Animation=function(){this.tracks=[],this.length=0,this.addTrack=function(e){this.tracks.push(e),this.length=Math.max(e.length,this.length)},this.setTime=function(e){this.time=e;for(let t=0;t<this.tracks.length;t++)this.tracks[t].setTime(e)},this.clone=function(e,t){t||(t=i.TrackTargetNodeNameCompare);var n=new i.Animation;n.target=e;for(let i=0;i<this.tracks.length;i++){var r=this.tracks[i].clone();r.reTarget(e,t),n.addTrack(r)}return n}};function s(e){return 256<<e}function a(e){return 65536<<e}function o(e,t){var n=new r.Bone;n.matrix.copy(e.matrix),n.matrixWorld.copy(e.matrixWorld),n.position.copy(e.position),n.quaternion.copy(e.quaternion),n.scale.copy(e.scale),t.nodeCount++,n.name="bone_"+e.name+t.nodeCount.toString(),t.nodeToBoneMap[e.name]||(t.nodeToBoneMap[e.name]=[]),t.nodeToBoneMap[e.name].push(n);for(let r in e.children){var i=o(e.children[r],t);n.add(i)}return n}function l(e,t){var n=[];for(let i=0;i<e.length;i++)n.push({i:e[i],w:t[i]});for(n.sort((function(e,t){return t.w-e.w}));n.length<4;)n.push({i:0,w:0});n.length>4&&(n.length=4);var r=0;for(let i=0;i<4;i++)r+=n[i].w*n[i].w;r=Math.sqrt(r);for(let i=0;i<4;i++)n[i].w=n[i].w/r,e[i]=n[i].i,t[i]=n[i].w}function c(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(let r in e.children){var n=c(e.children[r],t);if(n)return n}}class h{constructor(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e){if(0!=this.mBones.length){for(var t=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var s=o(i.toTHREE(e),e);this.threeNode.add(s);for(let r=0;r<this.mBones.length;r++){if(l=c(s,this.mBones[r].mName)){var a=l;t.push(a),n.push(this.mBones[r].mOffsetMatrix.toTHREE())}else{if(!(i=e.findNode(this.mBones[r].mName)))return;s=o(i.toTHREE(e),e);this.threeNode.add(s);var l;a=l=c(s,this.mBones[r].mName);t.push(a),n.push(this.mBones[r].mOffsetMatrix.toTHREE())}}var h=new r.Skeleton(t,n);this.threeNode.bind(h,new r.Matrix4),this.threeNode.material.skinning=!0}},this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t,n,i=new r.BufferGeometry;if(t=e.mMaterials[this.mMaterialIndex]?e.mMaterials[this.mMaterialIndex].toTHREE(e):new r.MeshLambertMaterial,i.setIndex(new r.BufferAttribute(new Uint32Array(this.mIndexArray),1)),i.setAttribute("position",new r.BufferAttribute(this.mVertexBuffer,3)),this.mNormalBuffer&&this.mNormalBuffer.length>0&&i.setAttribute("normal",new r.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&i.setAttribute("color",new r.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&i.setAttribute("uv",new r.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&i.setAttribute("uv1",new r.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&i.setAttribute("tangents",new r.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&i.setAttribute("bitangents",new r.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){var s=[],a=[];for(let e=0;e<this.mBones.length;e++)for(let t=0;t<this.mBones[e].mWeights.length;t++){var o=this.mBones[e].mWeights[t];o&&(s[o.mVertexId]||(s[o.mVertexId]=[]),a[o.mVertexId]||(a[o.mVertexId]=[]),s[o.mVertexId].push(o.mWeight),a[o.mVertexId].push(parseInt(e)))}for(let e in a)l(a[e],s[e]);var c=[],h=[];for(let e=0;e<s.length;e++)for(let t=0;t<4;t++)s[e]&&a[e]?(c.push(s[e][t]),h.push(a[e][t])):(c.push(0),h.push(0));i.setAttribute("skinWeight",new r.BufferAttribute(new Float32Array(c),4)),i.setAttribute("skinIndex",new r.BufferAttribute(new Float32Array(h),4))}return 0==this.mBones.length&&(n=new r.Mesh(i,t)),this.mBones.length>0&&(n=new r.SkinnedMesh(i,t)).normalizeSkinWeights(),this.threeNode=n,n}}}class u{constructor(){this.mNumIndices=0,this.mIndices=[]}}class d{constructor(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new r.Vector3(this.x,this.y,this.z)}}}class p{constructor(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new r.Color(this.r,this.g,this.b)}}}class f{constructor(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new r.Quaternion(this.x,this.y,this.z,this.w)}}}class m{constructor(){this.mVertexId=0,this.mWeight=0}}class g{constructor(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}}class A{constructor(){this.mTime=0,this.mValue=null}}class v{constructor(){this.mTime=0,this.mValue=null}}class y{constructor(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new r.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(let n=0;n<this.mChildren.length;n++)t.add(this.mChildren[n].toTHREE(e));for(let n=0;n<this.mMeshes.length;n++)t.add(e.mMeshes[this.mMeshes[n]].toTHREE(e));return this.threeNode=t,t.matrix.decompose(t.position,t.quaternion,t.scale),t}}}class x{constructor(){this.mName="",this.mNumWeights=0,this.mOffsetMatrix=0}}class b{constructor(){this.mKey="",this.mSemantic=0,this.mIndex=0,this.mData=[],this.mDataLength=0,this.mType=0,this.dataAsColor=function(){var e=new Uint8Array(this.mData).buffer,t=new DataView(e),n=t.getFloat32(0,!0),i=t.getFloat32(4,!0),s=t.getFloat32(8,!0);return new r.Color(n,i,s)},this.dataAsFloat=function(){var e=new Uint8Array(this.mData).buffer;return new DataView(e).getFloat32(0,!0)},this.dataAsBool=function(){var e=new Uint8Array(this.mData).buffer;return!!new DataView(e).getFloat32(0,!0)},this.dataAsString=function(){var e=new g;return e.data=this.mData,e.toString()},this.dataAsMap=function(){var e=new g;e.data=this.mData;var t=e.toString();return-1!=(t=t.replace(/\\/g,"/")).indexOf("/")&&(t=t.substr(t.lastIndexOf("/")+1)),n.load(t)}}}var E={"?mat.name":"name","$mat.shadingm":"shading","$mat.twosided":"twoSided","$mat.wireframe":"wireframe","$clr.ambient":"ambient","$clr.diffuse":"color","$clr.specular":"specular","$clr.emissive":"emissive","$clr.transparent":"transparent","$clr.reflective":"reflect","$mat.shininess":"shininess","$mat.reflectivity":"reflectivity","$mat.refracti":"refraction","$tex.file":"map"},_={"?mat.name":"string","$mat.shadingm":"bool","$mat.twosided":"bool","$mat.wireframe":"bool","$clr.ambient":"color","$clr.diffuse":"color","$clr.specular":"color","$clr.emissive":"color","$clr.transparent":"color","$clr.reflective":"color","$mat.shininess":"float","$mat.reflectivity":"float","$mat.refracti":"float","$tex.file":"map"};class S{constructor(){this.mNumAllocated=0,this.mNumProperties=0,this.mProperties=[],this.toTHREE=function(){var e=new r.MeshPhongMaterial;for(let n=0;n<this.mProperties.length;n++)if("float"==_[this.mProperties[n].mKey]&&(e[E[this.mProperties[n].mKey]]=this.mProperties[n].dataAsFloat()),"color"==_[this.mProperties[n].mKey]&&(e[E[this.mProperties[n].mKey]]=this.mProperties[n].dataAsColor()),"bool"==_[this.mProperties[n].mKey]&&(e[E[this.mProperties[n].mKey]]=this.mProperties[n].dataAsBool()),"string"==_[this.mProperties[n].mKey]&&(e[E[this.mProperties[n].mKey]]=this.mProperties[n].dataAsString()),"map"==_[this.mProperties[n].mKey]){var t=this.mProperties[n];1==t.mSemantic&&(e.map=this.mProperties[n].dataAsMap()),6==t.mSemantic&&(e.normalMap=this.mProperties[n].dataAsMap()),10==t.mSemantic&&(e.lightMap=this.mProperties[n].dataAsMap()),8==t.mSemantic&&(e.alphaMap=this.mProperties[n].dataAsMap())}return e.ambient.r=.53,e.ambient.g=.53,e.ambient.b=.53,e.color.r=1,e.color.g=1,e.color.b=1,e}}}function w(e,t,n){var i=new r.Vector3,s=1-n;return i.x=e.x*n+t.x*s,i.y=e.y*n+t.y*s,i.z=e.z*n+t.z*s,i}function M(e,t,n){return e.clone().slerp(t,1-n)}function C(e,t,n,r){if(1==e.length)return e[0].mValue.toTHREE();var i=1/0,s=null,a=null;for(let h=0;h<e.length;h++){var o=Math.abs(e[h].mTime-t);o<i&&e[h].mTime<=t&&(i=o,s=e[h],a=e[h+1])}if(s){if(a){var l=a.mTime-s.mTime,c=(s.mTime-t)/l;return r(s.mValue.toTHREE(),a.mValue.toTHREE(),c)}(a=e[0].clone()).mTime+=n;l=a.mTime-s.mTime,c=(s.mTime-t)/l;return r(s.mValue.toTHREE(),a.mValue.toTHREE(),c)}return null}class T{constructor(){this.mNodeName="",this.mNumPositionKeys=0,this.mNumRotationKeys=0,this.mNumScalingKeys=0,this.mPositionKeys=[],this.mRotationKeys=[],this.mScalingKeys=[],this.mPreState="",this.mPostState="",this.init=function(e){function t(t){t.mTime/=e}e||(e=1),this.mPositionKeys.forEach(t),this.mRotationKeys.forEach(t),this.mScalingKeys.forEach(t)},this.sortKeys=function(){function e(e,t){return e.mTime-t.mTime}this.mPositionKeys.sort(e),this.mRotationKeys.sort(e),this.mScalingKeys.sort(e)},this.getLength=function(){return Math.max(Math.max.apply(null,this.mPositionKeys.map((function(e){return e.mTime}))),Math.max.apply(null,this.mRotationKeys.map((function(e){return e.mTime}))),Math.max.apply(null,this.mScalingKeys.map((function(e){return e.mTime}))))},this.toTHREE=function(e){this.sortKeys();var t=this.getLength(),n=new i.KeyFrameTrack;for(let p=0;p<t;p+=.05){var s=new r.Matrix4,a=p,o=C(this.mPositionKeys,a,t,w),l=C(this.mScalingKeys,a,t,w),c=C(this.mRotationKeys,a,t,M);s.compose(o,c,l);var h=new i.KeyFrame(a,s);n.addKey(h)}n.target=e.findNode(this.mNodeName).toTHREE();var u=[n];if(e.nodeToBoneMap[this.mNodeName])for(let r=0;r<e.nodeToBoneMap[this.mNodeName].length;r++){var d=n.clone();d.target=e.nodeToBoneMap[this.mNodeName][r],u.push(d)}return u}}}class I{constructor(){this.mName="",this.mDuration=0,this.mTicksPerSecond=0,this.mNumChannels=0,this.mChannels=[],this.toTHREE=function(e){var t=new i.Animation;for(let r in this.mChannels){this.mChannels[r].init(this.mTicksPerSecond);var n=this.mChannels[r].toTHREE(e);for(let e in n)n[e].init(),t.addTrack(n[e])}return t.length=Math.max.apply(null,t.tracks.map((function(e){return e.length}))),t}}}class B{constructor(){this.mWidth=0,this.mHeight=0,this.texAchFormatHint=[],this.pcData=[]}}class R{constructor(){this.mName="",this.mType=0,this.mAttenuationConstant=0,this.mAttenuationLinear=0,this.mAttenuationQuadratic=0,this.mAngleInnerCone=0,this.mAngleOuterCone=0,this.mColorDiffuse=null,this.mColorSpecular=null,this.mColorAmbient=null}}class P{constructor(){this.mName="",this.mPosition=null,this.mLookAt=null,this.mUp=null,this.mHorizontalFOV=0,this.mClipPlaneNear=0,this.mClipPlaneFar=0,this.mAspect=0}}class D{constructor(){this.versionMajor=0,this.versionMinor=0,this.versionRevision=0,this.compileFlags=0,this.mFlags=0,this.mNumMeshes=0,this.mNumMaterials=0,this.mNumAnimations=0,this.mNumTextures=0,this.mNumLights=0,this.mNumCameras=0,this.mRootNode=null,this.mMeshes=[],this.mMaterials=[],this.mAnimations=[],this.mLights=[],this.mCameras=[],this.nodeToBoneMap={},this.findNode=function(e,t){if(t||(t=this.mRootNode),t.mName==e)return t;for(let r=0;r<t.mChildren.length;r++){var n=this.findNode(e,t.mChildren[r]);if(n)return n}return null},this.toTHREE=function(){this.nodeCount=0,function(e){for(let r in e.mMeshes){var t=e.mMeshes[r];for(let r in t.mBones){var n=e.findNode(t.mBones[r].mName);n&&(n.isBone=!0)}}}(this);var e=this.mRootNode.toTHREE(this);for(let n in this.mMeshes)this.mMeshes[n].hookupSkeletons(this);if(this.mAnimations.length>0)var t=this.mAnimations[0].toTHREE(this);return{object:e,animation:t}}}}class L{constructor(){this.elements=[[],[],[],[]],this.toTHREE=function(){var e=new r.Matrix4;for(let t=0;t<4;++t)for(let n=0;n<4;++n)e.elements[4*t+n]=this.elements[n][t];return e}}}var F=!0;function U(e){var t=e.getFloat32(e.readOffset,F);return e.readOffset+=4,t}function O(e){var t=e.getFloat64(e.readOffset,F);return e.readOffset+=8,t}function N(e){var t=e.getUint16(e.readOffset,F);return e.readOffset+=2,t}function k(e){var t=e.getUint32(e.readOffset,F);return e.readOffset+=4,t}function G(e){var t=e.getUint32(e.readOffset,F);return e.readOffset+=4,t}function z(e){var t=new d;return t.x=U(e),t.y=U(e),t.z=U(e),t}function Q(e){var t=new p;return t.r=U(e),t.g=U(e),t.b=U(e),t}function V(e){var t=new g,n=k(e);return e.ReadBytes(t.data,1,n),t.toString()}function H(e){var t=new m;return t.mVertexId=k(e),t.mWeight=U(e),t}function j(e){var t=new L;for(let n=0;n<4;++n)for(let r=0;r<4;++r)t.elements[n][r]=U(e);return t}function W(e){var t=new A;return t.mTime=O(e),t.mValue=z(e),t}function X(e){var t=new v;return t.mTime=O(e),t.mValue=function(e){var t=new f;return t.w=U(e),t.x=U(e),t.y=U(e),t.z=U(e),t}(e),t}function Y(e,t,n){for(let r=0;r<n;r++)t[r]=W(e)}function q(e,t,n){return e.Seek(sizeof(t)*n,he)}function K(e){if(!e)throw"asset failed"}function J(e,t,n){K(4668==G(e)),G(e);var r=new y;if(r.mParent=t,r.mDepth=n,r.mName=V(e),r.mTransformation=j(e),r.mNumChildren=k(e),r.mNumMeshes=k(e),r.mNumMeshes){r.mMeshes=[];for(let t=0;t<r.mNumMeshes;++t)r.mMeshes[t]=k(e)}if(r.mNumChildren){r.mChildren=[];for(let t=0;t<r.mNumChildren;++t){var i=J(e,r,n++);r.mChildren[t]=i}}return r}function Z(e,t){return K(4666==G(e)),G(e),t.mName=V(e),t.mNumWeights=k(e),t.mOffsetMatrix=j(e),le?q(e,t.mWeights,t.mNumWeights):(t.mWeights=[],function(e,t,n){for(let r=0;r<n;r++)t[r]=H(e)}(e,t.mWeights,t.mNumWeights)),t}function $(e,t){K(4663==G(e)),G(e),t.mPrimitiveTypes=k(e),t.mNumVertices=k(e),t.mNumFaces=k(e),t.mNumBones=k(e),t.mMaterialIndex=k(e),t.mNumUVComponents=[];var n=k(e);1&n&&(le?q(e,t.mVertices,t.mNumVertices):(t.mVertices=[],t.mVertexBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,he))),2&n&&(le?q(e,t.mNormals,t.mNumVertices):(t.mNormals=[],t.mNormalBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,he))),4&n&&(le?(q(e,t.mTangents,t.mNumVertices),q(e,t.mBitangents,t.mNumVertices)):(t.mTangents=[],t.mTangentBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,he),t.mBitangents=[],t.mBitangentBuffer=e.subArray32(e.readOffset,e.readOffset+3*t.mNumVertices*4),e.Seek(3*t.mNumVertices*4,he)));for(let i=0;i<1&&n&a(i);++i)le?q(e,t.mColors[i],t.mNumVertices):(t.mColors[i]=[],t.mColorBuffer=e.subArray32(e.readOffset,e.readOffset+4*t.mNumVertices*4),e.Seek(4*t.mNumVertices*4,he));t.mTexCoordsBuffers=[];for(let i=0;i<4&&n&s(i);++i)if(t.mNumUVComponents[i]=k(e),le)q(e,t.mTextureCoords[i],t.mNumVertices);else{t.mTextureCoords[i]=[],t.mTexCoordsBuffers[i]=[];for(let n=0;n<t.mNumVertices;n++)t.mTexCoordsBuffers[i].push(U(e)),t.mTexCoordsBuffers[i].push(U(e)),U(e)}if(le)k(e);else{t.mFaces=[],t.mIndexArray=[];for(let n=0;n<t.mNumFaces;++n){var r=t.mFaces[n]=new u;r.mNumIndices=N(e),r.mIndices=[];for(let n=0;n<r.mNumIndices;++n)t.mNumVertices<65536?r.mIndices[n]=N(e):r.mIndices[n]=k(e);if(3===r.mNumIndices)t.mIndexArray.push(r.mIndices[0]),t.mIndexArray.push(r.mIndices[1]),t.mIndexArray.push(r.mIndices[2]);else{if(4!==r.mNumIndices)throw new Error("Sorry, can't currently triangulate polys. Use the triangulate preprocessor in Assimp.");t.mIndexArray.push(r.mIndices[0]),t.mIndexArray.push(r.mIndices[1]),t.mIndexArray.push(r.mIndices[2]),t.mIndexArray.push(r.mIndices[2]),t.mIndexArray.push(r.mIndices[3]),t.mIndexArray.push(r.mIndices[0])}}}if(t.mNumBones){t.mBones=[];for(let n=0;n<t.mNumBones;++n)t.mBones[n]=new x,Z(e,t.mBones[n])}}function ee(e,t){K(4670==G(e)),G(e),t.mKey=V(e),t.mSemantic=k(e),t.mIndex=k(e),t.mDataLength=k(e),t.mType=k(e),t.mData=[],e.ReadBytes(t.mData,1,t.mDataLength)}function te(e,t){if(K(4669==G(e)),G(e),t.mNumAllocated=t.mNumProperties=k(e),t.mNumProperties){t.mProperties&&delete t.mProperties,t.mProperties=[];for(let n=0;n<t.mNumProperties;++n)t.mProperties[n]=new b,ee(e,t.mProperties[n])}}function ne(e,t){K(4664==G(e)),G(e),t.mNodeName=V(e),t.mNumPositionKeys=k(e),t.mNumRotationKeys=k(e),t.mNumScalingKeys=k(e),t.mPreState=k(e),t.mPostState=k(e),t.mNumPositionKeys&&(le?q(e,t.mPositionKeys,t.mNumPositionKeys):(t.mPositionKeys=[],Y(e,t.mPositionKeys,t.mNumPositionKeys))),t.mNumRotationKeys&&(le?q(e,t.mRotationKeys,t.mNumRotationKeys):(t.mRotationKeys=[],function(e,t,n){for(let r=0;r<n;r++)t[r]=X(e)}(e,t.mRotationKeys,t.mNumRotationKeys))),t.mNumScalingKeys&&(le?q(e,t.mScalingKeys,t.mNumScalingKeys):(t.mScalingKeys=[],Y(e,t.mScalingKeys,t.mNumScalingKeys)))}function re(e,t){if(K(4667==G(e)),G(e),t.mName=V(e),t.mDuration=O(e),t.mTicksPerSecond=O(e),t.mNumChannels=k(e),t.mNumChannels){t.mChannels=[];for(let n=0;n<t.mNumChannels;++n)t.mChannels[n]=new T,ne(e,t.mChannels[n])}}function ie(e,t){K(4662==G(e)),G(e),t.mWidth=k(e),t.mHeight=k(e),e.ReadBytes(t.achFormatHint,1,4),le||(t.mHeight?(t.pcData=[],e.ReadBytes(t.pcData,1,t.mWidth*t.mHeight*4)):(t.pcData=[],e.ReadBytes(t.pcData,1,t.mWidth)))}function se(e,t){K(4661==G(e)),G(e),t.mName=V(e),t.mType=k(e),1!=t.mType&&(t.mAttenuationConstant=U(e),t.mAttenuationLinear=U(e),t.mAttenuationQuadratic=U(e)),t.mColorDiffuse=Q(e),t.mColorSpecular=Q(e),t.mColorAmbient=Q(e),3==t.mType&&(t.mAngleInnerCone=U(e),t.mAngleOuterCone=U(e))}function ae(e,t){K(4660==G(e)),G(e),t.mName=V(e),t.mPosition=z(e),t.mLookAt=z(e),t.mUp=z(e),t.mHorizontalFOV=U(e),t.mClipPlaneNear=U(e),t.mClipPlaneFar=U(e),t.mAspect=U(e)}function oe(e,t){if(K(4665==G(e)),G(e),t.mFlags=k(e),t.mNumMeshes=k(e),t.mNumMaterials=k(e),t.mNumAnimations=k(e),t.mNumTextures=k(e),t.mNumLights=k(e),t.mNumCameras=k(e),t.mRootNode=new y,t.mRootNode=J(e,null,0),t.mNumMeshes){t.mMeshes=[];for(let n=0;n<t.mNumMeshes;++n)t.mMeshes[n]=new h,$(e,t.mMeshes[n])}if(t.mNumMaterials){t.mMaterials=[];for(let n=0;n<t.mNumMaterials;++n)t.mMaterials[n]=new S,te(e,t.mMaterials[n])}if(t.mNumAnimations){t.mAnimations=[];for(let n=0;n<t.mNumAnimations;++n)t.mAnimations[n]=new I,re(e,t.mAnimations[n])}if(t.mNumTextures){t.mTextures=[];for(let n=0;n<t.mNumTextures;++n)t.mTextures[n]=new B,ie(e,t.mTextures[n])}if(t.mNumLights){t.mLights=[];for(let n=0;n<t.mNumLights;++n)t.mLights[n]=new R,se(e,t.mLights[n])}if(t.mNumCameras){t.mCameras=[];for(let n=0;n<t.mNumCameras;++n)t.mCameras[n]=new P,ae(e,t.mCameras[n])}}var le,ce,he=0;return function(e){var t=new D,n=new DataView(e);if(function(e){e.readOffset=0,e.Seek=function(t,n){n==he&&(e.readOffset+=t),1==n&&(e.readOffset=t)},e.ReadBytes=function(e,t,n){var r,i,s=t*n;for(let a=0;a<s;a++)e[a]=(i=void 0,i=(r=this).getUint8(r.readOffset),r.readOffset+=1,i)},e.subArray32=function(e,t){var n=this.buffer.slice(e,t);return new Float32Array(n)},e.subArrayUint16=function(e,t){var n=this.buffer.slice(e,t);return new Uint16Array(n)},e.subArrayUint8=function(e,t){var n=this.buffer.slice(e,t);return new Uint8Array(n)},e.subArrayUint32=function(e,t){var n=this.buffer.slice(e,t);return new Uint32Array(n)}}(n),n.Seek(44,he),t.versionMajor=k(n),t.versionMinor=k(n),t.versionRevision=k(n),t.compileFlags=k(n),le=N(n)>0,ce=N(n)>0,le)throw"Shortened binaries are not supported!";if(n.Seek(256,he),n.Seek(128,he),n.Seek(64,he),ce){var r=G(n),i=n.FileSize()-n.Tell(),s=[];n.Read(s,1,i);var a=[];uncompress(a,r,s,i),oe(new ArrayBuffer(a),t)}else oe(n,t);return t.toTHREE()}(e)}}t.AssimpLoader=i},4951:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){function t(e,n,i){if("ENDSITE"===i.type)return;const s={time:n,position:new r.Vector3,rotation:new r.Quaternion};i.frames.push(s);const a=new r.Quaternion,o=new r.Vector3(1,0,0),l=new r.Vector3(0,1,0),c=new r.Vector3(0,0,1);for(let t=0;t<i.channels.length;t++)switch(i.channels[t]){case"Xposition":s.position.x=parseFloat(e.shift().trim());break;case"Yposition":s.position.y=parseFloat(e.shift().trim());break;case"Zposition":s.position.z=parseFloat(e.shift().trim());break;case"Xrotation":a.setFromAxisAngle(o,parseFloat(e.shift().trim())*Math.PI/180),s.rotation.multiply(a);break;case"Yrotation":a.setFromAxisAngle(l,parseFloat(e.shift().trim())*Math.PI/180),s.rotation.multiply(a);break;case"Zrotation":a.setFromAxisAngle(c,parseFloat(e.shift().trim())*Math.PI/180),s.rotation.multiply(a);break;default:console.warn("THREE.BVHLoader: Invalid channel type.")}for(let r=0;r<i.children.length;r++)t(e,n,i.children[r])}function n(e,t,s){const a={name:"",type:"",frames:[]};s.push(a);let o=t.split(/[\s]+/);"END"===o[0].toUpperCase()&&"SITE"===o[1].toUpperCase()?(a.type="ENDSITE",a.name="ENDSITE"):(a.name=o[1],a.type=o[0].toUpperCase()),"{"!==i(e)&&console.error("THREE.BVHLoader: Expected opening { after type & name"),o=i(e).split(/[\s]+/),"OFFSET"!==o[0]&&console.error("THREE.BVHLoader: Expected OFFSET but got: "+o[0]),4!==o.length&&console.error("THREE.BVHLoader: Invalid number of values for OFFSET.");const l=new r.Vector3(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));if((isNaN(l.x)||isNaN(l.y)||isNaN(l.z))&&console.error("THREE.BVHLoader: Invalid values of OFFSET."),a.offset=l,"ENDSITE"!==a.type){o=i(e).split(/[\s]+/),"CHANNELS"!==o[0]&&console.error("THREE.BVHLoader: Expected CHANNELS definition.");const t=parseInt(o[1]);a.channels=o.splice(2,t),a.children=[]}for(;;){const t=i(e);if("}"===t)return a;a.children.push(n(e,t,s))}}function i(e){let t;for(;0===(t=e.shift().trim()).length;);return t}const s=this,a=function(e){"HIERARCHY"!==i(e)&&console.error("THREE.BVHLoader: HIERARCHY expected.");const r=[],s=n(e,i(e),r);"MOTION"!==i(e)&&console.error("THREE.BVHLoader: MOTION expected.");let a=i(e).split(/[\s]+/);const o=parseInt(a[1]);isNaN(o)&&console.error("THREE.BVHLoader: Failed to read number of frames."),a=i(e).split(/[\s]+/);const l=parseFloat(a[2]);isNaN(l)&&console.error("THREE.BVHLoader: Failed to read frame time.");for(let n=0;n<o;n++)a=i(e).split(/[\s]+/),t(a,n*l,s);return r}(e.split(/[\r\n]+/g)),o=[];!function e(t,n){const i=new r.Bone;if(n.push(i),i.position.add(t.offset),i.name=t.name,"ENDSITE"!==t.type)for(let r=0;r<t.children.length;r++)i.add(e(t.children[r],n));return i}(a[0],o);const l=function(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];if("ENDSITE"===i.type)continue;const a=[],o=[],l=[];for(let e=0;e<i.frames.length;e++){const t=i.frames[e];a.push(t.time),o.push(t.position.x+i.offset.x),o.push(t.position.y+i.offset.y),o.push(t.position.z+i.offset.z),l.push(t.rotation.x),l.push(t.rotation.y),l.push(t.rotation.z),l.push(t.rotation.w)}s.animateBonePositions&&t.push(new r.VectorKeyframeTrack(".bones["+i.name+"].position",a,o)),s.animateBoneRotations&&t.push(new r.QuaternionKeyframeTrack(".bones["+i.name+"].quaternion",a,l))}return new r.AnimationClip("animation",-1,t)}(a);return{skeleton:new r.Skeleton(o),clip:l}}}t.BVHLoader=i},85569:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=new WeakMap,o=class extends s.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.workerConfig=null}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerLimit=e,this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}load(e,t,n,r){const i=new s.FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const o=new s.CompressedTexture;return i.load(e,(e=>{if(a.has(e)){return a.get(e).promise.then(t).catch(r)}this._createTexture([e]).then((function(e){o.copy(e),o.needsUpdate=!0,t&&t(o)})).catch(r)}),n,r),o}parseInternalAsync(e){const{levels:t}=e,n=new Set;for(let r=0;r<t.length;r++)n.add(t[r].data.buffer);return this._createTexture(Array.from(n),{...e,lowLevel:!0})}_createTexture(e,t={}){let n,r;const i=t;let o=0;for(let s=0;s<e.length;s++)o+=e[s].byteLength;const l=this._allocateWorker(o).then((t=>(n=t,r=this.workerNextTaskID++,new Promise(((t,s)=>{n._callbacks[r]={resolve:t,reject:s},n.postMessage({type:"transcode",id:r,buffers:e,taskConfig:i},e)}))))).then((e=>{const{mipmaps:t,width:n,height:r,format:i}=e,a=new s.CompressedTexture(t,n,r,i,s.UnsignedByteType);return a.minFilter=1===t.length?s.LinearFilter:s.LinearMipmapLinearFilter,a.magFilter=s.LinearFilter,a.generateMipmaps=!1,a.needsUpdate=!0,a}));return l.catch((()=>!0)).then((()=>{n&&r&&(n._taskLoad-=o,delete n._callbacks[r])})),a.set(e[0],{promise:l}),l}_initTranscoder(){if(!this.transcoderPending){const e=new s.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=new Promise(((t,n)=>{e.load("basis_transcoder.js",t,void 0,n)})),n=new s.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=new Promise(((e,t)=>{n.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([t,r]).then((([e,t])=>{const n=o.BasisWorker.toString(),r=["/* constants */","let _EngineFormat = "+JSON.stringify(o.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(o.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(o.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r])),this.transcoderBinary=t}))}return this.transcoderPending}_allocateWorker(e){return this._initTranscoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskLoad=0,e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:this.transcoderBinary}),e.onmessage=function(t){const n=t.data;switch(n.type){case"transcode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.BasisTextureLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskLoad+=e,t}))}dispose(){for(let e=0;e<this.workerPool.length;e++)this.workerPool[e].terminate();return this.workerPool.length=0,this}};let l=o;i(l,"BasisFormat",{ETC1S:0,UASTC_4x4:1}),i(l,"TranscoderFormat",{ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16}),i(l,"EngineFormat",{RGBAFormat:s.RGBAFormat,RGBA_ASTC_4x4_Format:s.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:s.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:s.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:s.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:s.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:s.RGB_ETC1_Format,RGB_ETC2_Format:s.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:s.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:s.RGB_S3TC_DXT1_Format}),i(l,"BasisWorker",(function(){let e,t,n;const r=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.config,a=i.transcoderBinary,t=new Promise((e=>{n={wasmBinary:a,onRuntimeInitialized:e},BASIS(n)})).then((()=>{n.initializeBasis()}));break;case"transcode":t.then((()=>{try{const{width:e,height:t,hasAlpha:r,mipmaps:a,format:o}=i.taskConfig.lowLevel?function(e){const{basisFormat:t,width:r,height:i,hasAlpha:a}=e,{transcoderFormat:o,engineFormat:l}=c(t,r,i,a),f=n.getBytesPerBlockOrPixel(o);h(n.isFormatSupported(o),"THREE.BasisTextureLoader: Unsupported format.");const m=[];if(t===s.ETC1S){const t=new n.LowLevelETC1SImageTranscoder,{endpointCount:r,endpointsData:i,selectorCount:s,selectorsData:l,tablesData:c}=e.globalData;try{let n;n=t.decodePalettes(r,i,s,l),h(n,"THREE.BasisTextureLoader: decodePalettes() failed."),n=t.decodeTables(c),h(n,"THREE.BasisTextureLoader: decodeTables() failed.");for(let r=0;r<e.levels.length;r++){const i=e.levels[r],s=e.globalData.imageDescs[r],l=p(o,i.width,i.height),c=new Uint8Array(l);n=t.transcodeImage(o,c,l/f,i.data,u(o,i.width),d(o,i.height),i.width,i.height,i.index,s.rgbSliceByteOffset,s.rgbSliceByteLength,s.alphaSliceByteOffset,s.alphaSliceByteLength,s.imageFlags,a,!1,0,0),h(n,"THREE.BasisTextureLoader: transcodeImage() failed for level "+i.index+"."),m.push({data:c,width:i.width,height:i.height})}}finally{t.delete()}}else for(let s=0;s<e.levels.length;s++){const t=e.levels[s],r=p(o,t.width,t.height),i=new Uint8Array(r);h(n.transcodeUASTCImage(o,i,r/f,t.data,u(o,t.width),d(o,t.height),t.width,t.height,t.index,0,t.data.byteLength,0,a,!1,0,0,-1,-1),"THREE.BasisTextureLoader: transcodeUASTCImage() failed for level "+t.index+"."),m.push({data:i,width:t.width,height:t.height})}return{width:r,height:i,hasAlpha:a,mipmaps:m,format:l}}(i.taskConfig):function(e){const t=new n.BasisFile(new Uint8Array(e)),r=t.isUASTC()?s.UASTC_4x4:s.ETC1S,i=t.getImageWidth(0,0),a=t.getImageHeight(0,0),o=t.getNumLevels(0),l=t.getHasAlpha();function h(){t.close(),t.delete()}const{transcoderFormat:u,engineFormat:d}=c(r,i,a,l);if(!i||!a||!o)throw h(),new Error("THREE.BasisTextureLoader:\tInvalid texture");if(!t.startTranscoding())throw h(),new Error("THREE.BasisTextureLoader: .startTranscoding failed");const p=[];for(let n=0;n<o;n++){const e=t.getImageWidth(0,n),r=t.getImageHeight(0,n),i=new Uint8Array(t.getImageTranscodedSizeInBytes(0,n,u));if(!t.transcodeImage(i,0,n,u,0,l))throw h(),new Error("THREE.BasisTextureLoader: .transcodeImage failed.");p.push({data:i,width:e,height:r})}return h(),{width:i,height:a,hasAlpha:l,mipmaps:p,format:d}}(i.buffers[0]),l=[];for(let n=0;n<a.length;++n)l.push(a[n].data.buffer);self.postMessage({type:"transcode",id:i.id,width:e,height:t,hasAlpha:r,mipmaps:a,format:o},l)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}}))}var a};const a=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[r.RGBA_ASTC_4x4_Format,r.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[r.RGBA_BPTC_Format,r.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[r.RGB_S3TC_DXT1_Format,r.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[r.RGB_ETC2_Format,r.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC1],engineFormat:[r.RGB_ETC1_Format,r.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[r.RGB_PVRTC_4BPPV1_Format,r.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],o=a.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=a.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(t,n,a,c){let h,u;const d=t===s.ETC1S?o:l;for(let r=0;r<d.length;r++){const i=d[r];if(e[i.if]&&(i.basisFormat.includes(t)&&(!i.needsPowerOfTwo||f(n)&&f(a))))return h=i.transcoderFormat[c?1:0],u=i.engineFormat[c?1:0],{transcoderFormat:h,engineFormat:u}}return console.warn("THREE.BasisTextureLoader: No suitable compressed texture format found. Decoding to RGBA32."),h=i.RGBA32,u=r.RGBAFormat,{transcoderFormat:h,engineFormat:u}}function h(e,t){if(!e)throw new Error(t)}function u(e,t){return Math.ceil(t/n.getFormatBlockWidth(e))}function d(e,t){return Math.ceil(t/n.getFormatBlockHeight(e))}function p(e,t,r){const s=n.getBytesPerBlockOrPixel(e);if(n.formatIsUncompressed(e))return t*r*s;if(e===i.PVRTC1_4_RGB||e===i.PVRTC1_4_RGBA){const e=t+3&-4,n=r+3&-4;return(Math.max(8,e)*Math.max(8,n)*4+7)/8}return u(e,t)*d(e,r)*s}function f(e){return e<=2||0==(e&e-1)&&0!==e}})),t.BasisTextureLoader=l},16354:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(2545);class s extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=""===s.path?r.LoaderUtils.extractUrlBase(e):s.path,o=new r.FileLoader(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){function n(e,t){const n=[],r=e.childNodes;for(let i=0,s=r.length;i<s;i++){const e=r[i];e.nodeName===t&&n.push(e)}return n}function s(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r];return n}function a(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=parseFloat(t[r]);return n}function o(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=parseInt(t[r]);return n}function l(e){return e.substring(1)}function c(e){return 0===Object.keys(e).length}function h(e){return void 0!==e&&!0===e.hasAttribute("meter")?parseFloat(e.getAttribute("meter")):1}function u(e){return void 0!==e?e.textContent:"Y_UP"}function d(e,t,r,i){const s=n(e,t)[0];if(void 0!==s){const e=n(s,r);for(let t=0;t<e.length;t++)i(e[t])}}function p(e,t){for(const n in e){e[n].build=t(e[n])}}function f(e,t){return void 0!==e.build||(e.build=t(e)),e.build}function m(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"input"===r.nodeName){const e=l(r.getAttribute("source")),n=r.getAttribute("semantic");t.inputs[n]=e}}return t}function g(e){const t={};let n=e.getAttribute("target").split("/");const r=n.shift();let i=n.shift();const s=-1!==i.indexOf("("),a=-1!==i.indexOf(".");if(a)n=i.split("."),i=n.shift(),t.member=n.shift();else if(s){const e=i.split("(");i=e.shift();for(let t=0;t<e.length;t++)e[t]=parseInt(e[t].replace(/\)/,""));t.indices=e}return t.id=r,t.sid=i,t.arraySyntax=s,t.memberSyntax=a,t.sampler=l(e.getAttribute("source")),t}function A(e){const t=[],n=e.channels,r=e.samplers,i=e.sources;for(const s in n)if(n.hasOwnProperty(s)){const e=n[s],a=r[e.sampler],o=a.inputs.INPUT,l=a.inputs.OUTPUT;_(y(e,i[o],i[l]),t)}return t}function v(e){return f(Ze.animations[e],A)}function y(e,t,n){const r=Ze.nodes[e.id],i=Ne(r.id),s=r.transforms[e.sid],a=r.matrix.clone().transpose();let o,l,c,h,u,d;const p={};switch(s){case"matrix":for(c=0,h=t.array.length;c<h;c++)if(o=t.array[c],l=c*n.stride,void 0===p[o]&&(p[o]={}),!0===e.arraySyntax){const t=n.array[l],r=e.indices[0]+4*e.indices[1];p[o][r]=t}else for(u=0,d=n.stride;u<d;u++)p[o][u]=n.array[l+u];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',s)}const f=function(e,t){const n=[];for(const i in e)n.push({time:parseFloat(i),value:e[i]});n.sort(r);for(let i=0;i<16;i++)S(n,i,t.elements[i]);return n;function r(e,t){return e.time-t.time}}(p,a);return{name:i.uuid,keyframes:f}}const x=new r.Vector3,b=new r.Vector3,E=new r.Quaternion;function _(e,t){const n=e.keyframes,i=e.name,s=[],a=[],o=[],l=[];for(let r=0,c=n.length;r<c;r++){const e=n[r],t=e.time,i=e.value;Ce.fromArray(i).transpose(),Ce.decompose(x,E,b),s.push(t),a.push(x.x,x.y,x.z),o.push(E.x,E.y,E.z,E.w),l.push(b.x,b.y,b.z)}return a.length>0&&t.push(new r.VectorKeyframeTrack(i+".position",s,a)),o.length>0&&t.push(new r.QuaternionKeyframeTrack(i+".quaternion",s,o)),l.length>0&&t.push(new r.VectorKeyframeTrack(i+".scale",s,l)),t}function S(e,t,n){let r,i,s,a=!0;for(i=0,s=e.length;i<s;i++)r=e[i],void 0===r.value[t]?r.value[t]=null:a=!1;if(!0===a)for(i=0,s=e.length;i<s;i++)r=e[i],r.value[t]=n;else!function(e,t){let n,r;for(let i=0,s=e.length;i<s;i++){const s=e[i];if(null===s.value[t]){if(n=w(e,i,t),r=M(e,i,t),null===n){s.value[t]=r.value[t];continue}if(null===r){s.value[t]=n.value[t];continue}C(s,n,r,t)}}}(e,t)}function w(e,t,n){for(;t>=0;){const r=e[t];if(null!==r.value[n])return r;t--}return null}function M(e,t,n){for(;t<e.length;){const r=e[t];if(null!==r.value[n])return r;t++}return null}function C(e,t,n,r){n.time-t.time!=0?e.value[r]=(e.time-t.time)*(n.value[r]-t.value[r])/(n.time-t.time)+t.value[r]:e.value[r]=t.value[r]}function T(e){const t=[],n=e.name,i=e.end-e.start||-1,s=e.animations;for(let r=0,a=s.length;r<a;r++){const e=v(s[r]);for(let n=0,r=e.length;n<r;n++)t.push(e[n])}return new r.AnimationClip(n,i,t)}function I(e){return f(Ze.clips[e],T)}function B(e){const t={sources:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=a(r.textContent);break;case"source":const e=r.getAttribute("id");t.sources[e]=oe(r);break;case"joints":t.joints=R(r);break;case"vertex_weights":t.vertexWeights=P(r)}}return t}function R(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"input"===r.nodeName){const e=r.getAttribute("semantic"),n=l(r.getAttribute("source"));t.inputs[e]=n}}return t}function P(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=r.getAttribute("semantic"),n=l(r.getAttribute("source")),i=parseInt(r.getAttribute("offset"));t.inputs[e]={id:n,offset:i};break;case"vcount":t.vcount=o(r.textContent);break;case"v":t.v=o(r.textContent)}}return t}function D(e){const t={id:e.id},n=Ze.geometries[t.id];return void 0!==e.skin&&(t.skin=function(e){const t=4,n={joints:[],indices:{array:[],stride:t},weights:{array:[],stride:t}},i=e.sources,s=e.vertexWeights,a=s.vcount,o=s.v,l=s.inputs.JOINT.offset,c=s.inputs.WEIGHT.offset,h=e.sources[e.joints.inputs.JOINT],u=e.sources[e.joints.inputs.INV_BIND_MATRIX],d=i[s.inputs.WEIGHT.id].array;let p,f,m,g=0;for(p=0,m=a.length;p<m;p++){const e=a[p],r=[];for(f=0;f<e;f++){const e=o[g+l],t=d[o[g+c]];r.push({index:e,weight:t}),g+=2}for(r.sort(A),f=0;f<t;f++){const e=r[f];void 0!==e?(n.indices.array.push(e.index),n.weights.array.push(e.weight)):(n.indices.array.push(0),n.weights.array.push(0))}}e.bindShapeMatrix?n.bindMatrix=(new r.Matrix4).fromArray(e.bindShapeMatrix).transpose():n.bindMatrix=(new r.Matrix4).identity();for(p=0,m=h.array.length;p<m;p++){const e=h.array[p],t=(new r.Matrix4).fromArray(u.array,p*u.stride).transpose();n.joints.push({name:e,boneInverse:t})}return n;function A(e,t){return t.weight-e.weight}}(e.skin),n.sources.skinIndices=t.skin.indices,n.sources.skinWeights=t.skin.weights),t}function L(e){return void 0!==e.build?e.build:e.init_from}function F(e){const t=Ze.images[e];return void 0!==t?f(t,L):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",e),null)}function U(e){const t={surfaces:{},samplers:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"newparam":O(r,t);break;case"technique":t.technique=G(r);break;case"extra":t.extra=W(r)}}return t}function O(e,t){const n=e.getAttribute("sid");for(let r=0,i=e.childNodes.length;r<i;r++){const i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"surface":t.surfaces[n]=N(i);break;case"sampler2D":t.samplers[n]=k(i)}}}function N(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"init_from"===r.nodeName)t.init_from=r.textContent}return t}function k(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"source"===r.nodeName)t.source=r.textContent}return t}function G(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=r.nodeName,t.parameters=z(r);break;case"extra":t.extra=W(r)}}return t}function z(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[r.nodeName]=Q(r);break;case"transparent":t[r.nodeName]={opaque:r.hasAttribute("opaque")?r.getAttribute("opaque"):"A_ONE",data:Q(r)}}}return t}function Q(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"color":t[r.nodeName]=a(r.textContent);break;case"float":t[r.nodeName]=parseFloat(r.textContent);break;case"texture":t[r.nodeName]={id:r.getAttribute("texture"),extra:V(r)}}}return t}function V(e){const t={technique:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"extra"===r.nodeName)H(r,t)}return t}function H(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique"===r.nodeName)j(r,t)}}function j(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[r.nodeName]=parseFloat(r.textContent);break;case"wrapU":case"wrapV":"TRUE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=1:"FALSE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=0:t.technique[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Y(r)}}}function W(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique"===r.nodeName)t.technique=X(r)}return t}function X(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"double_sided":t[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Y(r)}}return t}function Y(e){for(var t={},n=0,r=e.childNodes.length;n<r;n++){var i=e.childNodes[n];if(1===i.nodeType&&"texture"===i.nodeName)t[i.nodeName]={id:i.getAttribute("texture"),texcoord:i.getAttribute("texcoord"),extra:V(i)}}return t}function q(e){return e}function K(e){const t=(n=e.url,f(Ze.effects[n],q));var n;const i=t.profile.technique;let s;switch(i.type){case"phong":case"blinn":s=new r.MeshPhongMaterial;break;case"lambert":s=new r.MeshLambertMaterial;break;default:s=new r.MeshBasicMaterial}function a(e){const n=t.profile.samplers[e.id];let i=null;if(void 0!==n){i=F(t.profile.surfaces[n.source].init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),i=F(e.id);if(null!==i){const t=function(e){let t,n=e.slice(2+(e.lastIndexOf(".")-1>>>0));n=n.toLowerCase(),t="tga"===n?Ye:Xe;return t}(i);if(void 0!==t){const n=t.load(i),s=e.extra;if(void 0!==s&&void 0!==s.technique&&!1===c(s.technique)){const e=s.technique;n.wrapS=e.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,n.wrapT=e.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,n.offset.set(e.offsetU||0,e.offsetV||0),n.repeat.set(e.repeatU||1,e.repeatV||1)}else n.wrapS=r.RepeatWrapping,n.wrapT=r.RepeatWrapping;return n}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",i),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}s.name=e.name||"";const o=i.parameters;for(const r in o){const e=o[r];switch(r){case"diffuse":e.color&&s.color.fromArray(e.color),e.texture&&(s.map=a(e.texture));break;case"specular":e.color&&s.specular&&s.specular.fromArray(e.color),e.texture&&(s.specularMap=a(e.texture));break;case"bump":e.texture&&(s.normalMap=a(e.texture));break;case"ambient":e.texture&&(s.lightMap=a(e.texture));break;case"shininess":e.float&&s.shininess&&(s.shininess=e.float);break;case"emission":e.color&&s.emissive&&s.emissive.fromArray(e.color),e.texture&&(s.emissiveMap=a(e.texture))}}let l=o.transparent,h=o.transparency;if(void 0===h&&l&&(h={float:1}),void 0===l&&h&&(l={opaque:"A_ONE",data:{color:[1,1,1,1]}}),l&&h)if(l.data.texture)s.transparent=!0;else{const e=l.data.color;switch(l.opaque){case"A_ONE":s.opacity=e[3]*h.float;break;case"RGB_ZERO":s.opacity=1-e[0]*h.float;break;case"A_ZERO":s.opacity=1-e[3]*h.float;break;case"RGB_ONE":s.opacity=e[0]*h.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',l.opaque)}s.opacity<1&&(s.transparent=!0)}if(void 0!==i.extra&&void 0!==i.extra.technique){const e=i.extra.technique;for(const t in e){const n=e[t];switch(t){case"double_sided":s.side=1===n?r.DoubleSide:r.FrontSide;break;case"bump":s.normalMap=a(n.texture),s.normalScale=new r.Vector2(1,1)}}}return s}function J(e){return f(Ze.materials[e],K)}function Z(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if("technique_common"===n.nodeName)return $(n)}return{}}function $(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"perspective":case"orthographic":t.technique=r.nodeName,t.parameters=ee(r)}}return t}function ee(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[r.nodeName]=parseFloat(r.textContent)}}return t}function te(e){let t;switch(e.optics.technique){case"perspective":t=new r.PerspectiveCamera(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":let n=e.optics.parameters.ymag,i=e.optics.parameters.xmag;const s=e.optics.parameters.aspect_ratio;i=void 0===i?n*s:i,n=void 0===n?i/s:n,i*=.5,n*=.5,t=new r.OrthographicCamera(-i,i,n,-n,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new r.PerspectiveCamera}return t.name=e.name||"",t}function ne(e){const t=Ze.cameras[e];return void 0!==t?f(t,te):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function re(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=r.nodeName,t.parameters=ie(r)}}return t}function ie(e){const t={};for(let n=0,i=e.childNodes.length;n<i;n++){const i=e.childNodes[n];if(1===i.nodeType)switch(i.nodeName){case"color":const e=a(i.textContent);t.color=(new r.Color).fromArray(e);break;case"falloff_angle":t.falloffAngle=parseFloat(i.textContent);break;case"quadratic_attenuation":const n=parseFloat(i.textContent);t.distance=n?Math.sqrt(1/n):0}}return t}function se(e){let t;switch(e.technique){case"directional":t=new r.DirectionalLight;break;case"point":t=new r.PointLight;break;case"spot":t=new r.SpotLight;break;case"ambient":t=new r.AmbientLight}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function ae(e){const t=Ze.lights[e];return void 0!==t?f(t,se):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function oe(e){const t={array:[],stride:3};for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"float_array":t.array=a(i.textContent);break;case"Name_array":t.array=s(i.textContent);break;case"technique_common":const e=n(i,"accessor")[0];void 0!==e&&(t.stride=parseInt(e.getAttribute("stride")))}}return t}function le(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];1===r.nodeType&&(t[r.getAttribute("semantic")]=l(r.getAttribute("source")))}return t}function ce(e){const t={type:e.nodeName,material:e.getAttribute("material"),count:parseInt(e.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=l(r.getAttribute("source")),n=r.getAttribute("semantic"),i=parseInt(r.getAttribute("offset")),s=parseInt(r.getAttribute("set")),a=s>0?n+s:n;t.inputs[a]={id:e,offset:i},t.stride=Math.max(t.stride,i+1),"TEXCOORD"===n&&(t.hasUV=!0);break;case"vcount":t.vcount=o(r.textContent);break;case"p":t.p=o(r.textContent)}}return t}function he(e){let t=0;for(let n=0,r=e.length;n<r;n++){!0===e[n].hasUV&&t++}t>0&&t<e.length&&(e.uvsNeedsFix=!0)}function ue(e){const t={},n=e.sources,r=e.vertices,i=e.primitives;if(0===i.length)return{};const s=function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];void 0===t[r.type]&&(t[r.type]=[]),t[r.type].push(r)}return t}(i);for(const a in s){const e=s[a];he(e),t[a]=de(e,n,r)}return t}function de(e,t,n){const i={},s={array:[],stride:0},a={array:[],stride:0},o={array:[],stride:0},l={array:[],stride:0},c={array:[],stride:0},h=[],u=4,d=[],p=4,f=new r.BufferGeometry,m=[];let g=0;for(let r=0;r<e.length;r++){const i=e[r],u=i.inputs;let p=0;switch(i.type){case"lines":case"linestrips":p=2*i.count;break;case"triangles":p=3*i.count;break;case"polylist":for(let e=0;e<i.count;e++){const t=i.vcount[e];switch(t){case 3:p+=3;break;case 4:p+=6;break;default:p+=3*(t-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",i.type)}f.addGroup(g,p,r),g+=p,i.material&&m.push(i.material);for(const r in u){const p=u[r];switch(r){case"VERTEX":for(const r in n){const u=n[r];switch(r){case"POSITION":const n=s.array.length;if(pe(i,t[u],p.offset,s.array),s.stride=t[u].stride,t.skinWeights&&t.skinIndices&&(pe(i,t.skinIndices,p.offset,h),pe(i,t.skinWeights,p.offset,d)),!1===i.hasUV&&!0===e.uvsNeedsFix){const e=(s.array.length-n)/s.stride;for(let t=0;t<e;t++)o.array.push(0,0)}break;case"NORMAL":pe(i,t[u],p.offset,a.array),a.stride=t[u].stride;break;case"COLOR":pe(i,t[u],p.offset,c.array),c.stride=t[u].stride;break;case"TEXCOORD":pe(i,t[u],p.offset,o.array),o.stride=t[u].stride;break;case"TEXCOORD1":pe(i,t[u],p.offset,l.array),o.stride=t[u].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',r)}}break;case"NORMAL":pe(i,t[p.id],p.offset,a.array),a.stride=t[p.id].stride;break;case"COLOR":pe(i,t[p.id],p.offset,c.array),c.stride=t[p.id].stride;break;case"TEXCOORD":pe(i,t[p.id],p.offset,o.array),o.stride=t[p.id].stride;break;case"TEXCOORD1":pe(i,t[p.id],p.offset,l.array),l.stride=t[p.id].stride}}}return s.array.length>0&&f.setAttribute("position",new r.Float32BufferAttribute(s.array,s.stride)),a.array.length>0&&f.setAttribute("normal",new r.Float32BufferAttribute(a.array,a.stride)),c.array.length>0&&f.setAttribute("color",new r.Float32BufferAttribute(c.array,c.stride)),o.array.length>0&&f.setAttribute("uv",new r.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&f.setAttribute("uv2",new r.Float32BufferAttribute(l.array,l.stride)),h.length>0&&f.setAttribute("skinIndex",new r.Float32BufferAttribute(h,u)),d.length>0&&f.setAttribute("skinWeight",new r.Float32BufferAttribute(d,p)),i.data=f,i.type=e[0].type,i.materialKeys=m,i}function pe(e,t,n,r){const i=e.p,s=e.stride,a=e.vcount;function o(e){let t=i[e+n]*c;const s=t+c;for(;t<s;t++)r.push(l[t])}const l=t.array,c=t.stride;if(void 0!==e.vcount){let e=0;for(let t=0,n=a.length;t<n;t++){const n=a[t];if(4===n){const t=e+1*s,n=e+2*s,r=e+3*s;o(e+0*s),o(t),o(r),o(t),o(n),o(r)}else if(3===n){const t=e+1*s,n=e+2*s;o(e+0*s),o(t),o(n)}else if(n>4)for(let t=1,r=n-2;t<=r;t++){const n=e+s*t,r=e+s*(t+1);o(e+0*s),o(n),o(r)}e+=s*n}}else for(let h=0,u=i.length;h<u;h+=s)o(h)}function fe(e){return f(Ze.geometries[e],ue)}function me(e){return void 0!==e.build?e.build:e}function ge(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"joint":t.joints[r.getAttribute("sid")]=Ae(r);break;case"link":t.links.push(ye(r))}}}function Ae(e){let t;for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"prismatic":case"revolute":t=ve(r)}}return t}function ve(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new r.Vector3,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"axis":const e=a(r.textContent);t.axis.fromArray(e);break;case"limits":const n=r.getElementsByTagName("max")[0],i=r.getElementsByTagName("min")[0];t.limits.max=parseFloat(n.textContent),t.limits.min=parseFloat(i.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ye(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"attachment_full":t.attachments.push(xe(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(be(r))}}return t}function xe(e){const t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"link":t.links.push(ye(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(be(r))}}return t}function be(e){const t={type:e.nodeName},n=a(e.textContent);switch(t.type){case"matrix":t.obj=new r.Matrix4,t.obj.fromArray(n).transpose();break;case"translate":t.obj=new r.Vector3,t.obj.fromArray(n);break;case"rotate":t.obj=new r.Vector3,t.obj.fromArray(n),t.angle=r.MathUtils.degToRad(n[3])}return t}function Ee(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)_e(r,t)}}function _e(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"inertia":t.inertia=a(r.textContent);break;case"mass":t.mass=a(r.textContent)[0]}}}function Se(e){const t={target:e.getAttribute("target").split("/").pop()};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"axis"===r.nodeName){const e=r.getElementsByTagName("param")[0];t.axis=e.textContent;const n=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=n.substr(0,n.length-1)}}return t}function we(e){return void 0!==e.build?e.build:e}function Me(e){const t=[],n=Qe.querySelector('[id="'+e.id+'"]');for(let i=0;i<n.childNodes.length;i++){const e=n.childNodes[i];if(1!==e.nodeType)continue;let s,o;switch(e.nodeName){case"matrix":s=a(e.textContent);const n=(new r.Matrix4).fromArray(s).transpose();t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:n});break;case"translate":case"scale":s=a(e.textContent),o=(new r.Vector3).fromArray(s),t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:o});break;case"rotate":s=a(e.textContent),o=(new r.Vector3).fromArray(s);const i=r.MathUtils.degToRad(s[3]);t.push({sid:e.getAttribute("sid"),type:e.nodeName,obj:o,angle:i})}}return t}const Ce=new r.Matrix4,Te=new r.Vector3;function Ie(e){const t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new r.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;let s;switch(i.nodeName){case"node":t.nodes.push(i.getAttribute("id")),Ie(i);break;case"instance_camera":t.instanceCameras.push(l(i.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Be(i));break;case"instance_light":t.instanceLights.push(l(i.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Be(i));break;case"instance_node":t.instanceNodes.push(l(i.getAttribute("url")));break;case"matrix":s=a(i.textContent),t.matrix.multiply(Ce.fromArray(s).transpose()),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"translate":s=a(i.textContent),Te.fromArray(s),t.matrix.multiply(Ce.makeTranslation(Te.x,Te.y,Te.z)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"rotate":s=a(i.textContent);const e=r.MathUtils.degToRad(s[3]);t.matrix.multiply(Ce.makeRotationAxis(Te.fromArray(s),e)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"scale":s=a(i.textContent),t.matrix.scale(Te.fromArray(s)),t.transforms[i.getAttribute("sid")]=i.nodeName;break;case"extra":break;default:console.log(i)}}return Oe(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):Ze.nodes[t.id]=t,t}function Be(e){const t={id:l(e.getAttribute("url")),materials:{},skeletons:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"bind_material":const e=r.getElementsByTagName("instance_material");for(let n=0;n<e.length;n++){const r=e[n],i=r.getAttribute("symbol"),s=r.getAttribute("target");t.materials[i]=l(s)}break;case"skeleton":t.skeletons.push(l(r.textContent))}}return t}function Re(e,t){const n=[],i=[];let s,a,o;for(s=0;s<e.length;s++){const r=e[s];let i;if(Oe(r))i=Ne(r),Pe(i,t,n);else if(l=r,void 0!==Ze.visualScenes[l]){const e=Ze.visualScenes[r].children;for(let r=0;r<e.length;r++){const i=e[r];if("JOINT"===i.type){Pe(Ne(i.id),t,n)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",r)}var l;for(s=0;s<t.length;s++)for(a=0;a<n.length;a++)if(o=n[a],o.bone.name===t[s].name){i[s]=o,o.processed=!0;break}for(s=0;s<n.length;s++)o=n[s],!1===o.processed&&(i.push(o),o.processed=!0);const c=[],h=[];for(s=0;s<i.length;s++)o=i[s],c.push(o.bone),h.push(o.boneInverse);return new r.Skeleton(c,h)}function Pe(e,t,n){e.traverse((function(e){if(!0===e.isBone){let i;for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e.name){i=r.boneInverse;break}}void 0===i&&(i=new r.Matrix4),n.push({bone:e,boneInverse:i,processed:!1})}}))}function De(e){const t=[],n=e.matrix,i=e.nodes,s=e.type,a=e.instanceCameras,o=e.instanceControllers,l=e.instanceLights,c=e.instanceGeometries,h=e.instanceNodes;for(let r=0,p=i.length;r<p;r++)t.push(Ne(i[r]));for(let r=0,p=a.length;r<p;r++){const e=ne(a[r]);null!==e&&t.push(e.clone())}for(let r=0,p=o.length;r<p;r++){const e=o[r],n=(u=e.id,f(Ze.controllers[u],D)),i=Ue(fe(n.id),e.materials),s=Re(e.skeletons,n.skin.joints);for(let r=0,a=i.length;r<a;r++){const e=i[r];e.isSkinnedMesh&&(e.bind(s,n.skin.bindMatrix),e.normalizeSkinWeights()),t.push(e)}}var u;for(let r=0,p=l.length;r<p;r++){const e=ae(l[r]);null!==e&&t.push(e.clone())}for(let r=0,p=c.length;r<p;r++){const e=c[r],n=Ue(fe(e.id),e.materials);for(let r=0,i=n.length;r<i;r++)t.push(n[r])}for(let r=0,p=h.length;r<p;r++)t.push(Ne(h[r]).clone());let d;if(0===i.length&&1===t.length)d=t[0];else{d="JOINT"===s?new r.Bone:new r.Group;for(let e=0;e<t.length;e++)d.add(t[e])}return d.name="JOINT"===s?e.sid:e.name,d.matrix.copy(n),d.matrix.decompose(d.position,d.quaternion,d.scale),d}const Le=new r.MeshBasicMaterial({color:16711935});function Fe(e,t){const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];void 0===i?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",e[r]),n.push(Le)):n.push(J(i))}return n}function Ue(e,t){const n=[];for(const i in e){const s=e[i],a=Fe(s.materialKeys,t);0===a.length&&("lines"===i||"linestrips"===i?a.push(new r.LineBasicMaterial):a.push(new r.MeshPhongMaterial));const o=void 0!==s.data.attributes.skinIndex,l=1===a.length?a[0]:a;let c;switch(i){case"lines":c=new r.LineSegments(s.data,l);break;case"linestrips":c=new r.Line(s.data,l);break;case"triangles":case"polylist":c=o?new r.SkinnedMesh(s.data,l):new r.Mesh(s.data,l)}n.push(c)}return n}function Oe(e){return void 0!==Ze.nodes[e]}function Ne(e){return f(Ze.nodes[e],De)}function ke(e){const t=new r.Group;t.name=e.name;const n=e.children;for(let r=0;r<n.length;r++){const e=n[r];t.add(Ne(e.id))}return t}function Ge(e){return f(Ze.visualScenes[e],ke)}if(0===e.length)return{scene:new r.Scene};const ze=(new DOMParser).parseFromString(e,"application/xml"),Qe=n(ze,"COLLADA")[0],Ve=ze.getElementsByTagName("parsererror")[0];if(void 0!==Ve){const e=n(Ve,"div")[0];let t;return t=e?e.textContent:function(e){let t="";const n=[e];for(;n.length;){const e=n.shift();e.nodeType===Node.TEXT_NODE?t+=e.textContent:(t+="\n",n.push.apply(n,e.childNodes))}return t.trim()}(Ve),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",t),null}const He=Qe.getAttribute("version");console.log("THREE.ColladaLoader: File version",He);const je=(We=n(Qe,"asset")[0],{unit:h(n(We,"unit")[0]),upAxis:u(n(We,"up_axis")[0])});var We;const Xe=new r.TextureLoader(this.manager);let Ye;Xe.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),i.TGALoader&&(Ye=new i.TGALoader(this.manager),Ye.setPath(this.resourcePath||t));const qe=[];let Ke={},Je=0;const Ze={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};d(Qe,"library_animations","animation",(function e(t){const n={sources:{},samplers:{},channels:{}};let i=!1;for(let r=0,s=t.childNodes.length;r<s;r++){const s=t.childNodes[r];if(1!==s.nodeType)continue;let a;switch(s.nodeName){case"source":a=s.getAttribute("id"),n.sources[a]=oe(s);break;case"sampler":a=s.getAttribute("id"),n.samplers[a]=m(s);break;case"channel":a=s.getAttribute("target"),n.channels[a]=g(s);break;case"animation":e(s),i=!0;break;default:console.log(s)}}!1===i&&(Ze.animations[t.getAttribute("id")||r.MathUtils.generateUUID()]=n)})),d(Qe,"library_animation_clips","animation_clip",(function(e){const t={name:e.getAttribute("id")||"default",start:parseFloat(e.getAttribute("start")||0),end:parseFloat(e.getAttribute("end")||0),animations:[]};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"instance_animation"===r.nodeName)t.animations.push(l(r.getAttribute("url")))}Ze.clips[e.getAttribute("id")]=t})),d(Qe,"library_controllers","controller",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"skin":t.id=l(r.getAttribute("source")),t.skin=B(r);break;case"morph":t.id=l(r.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}Ze.controllers[e.getAttribute("id")]=t})),d(Qe,"library_images","image",(function(e){const t={init_from:n(e,"init_from")[0].textContent};Ze.images[e.getAttribute("id")]=t})),d(Qe,"library_effects","effect",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"profile_COMMON"===r.nodeName)t.profile=U(r)}Ze.effects[e.getAttribute("id")]=t})),d(Qe,"library_materials","material",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"instance_effect"===r.nodeName)t.url=l(r.getAttribute("url"))}Ze.materials[e.getAttribute("id")]=t})),d(Qe,"library_cameras","camera",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"optics"===r.nodeName)t.optics=Z(r)}Ze.cameras[e.getAttribute("id")]=t})),d(Qe,"library_lights","light",(function(e){let t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)t=re(r)}Ze.lights[e.getAttribute("id")]=t})),d(Qe,"library_geometries","geometry",(function(e){const t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},r=n(e,"mesh")[0];if(void 0!==r){for(let e=0;e<r.childNodes.length;e++){const n=r.childNodes[e];if(1!==n.nodeType)continue;const i=n.getAttribute("id");switch(n.nodeName){case"source":t.sources[i]=oe(n);break;case"vertices":t.vertices=le(n);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",n.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(ce(n));break;default:console.log(n)}}Ze.geometries[e.getAttribute("id")]=t}})),d(Qe,"library_nodes","node",Ie),d(Qe,"library_visual_scenes","visual_scene",(function(e){const t={name:e.getAttribute("name"),children:[]};!function(e){const t=e.getElementsByTagName("node");for(let n=0;n<t.length;n++){const e=t[n];!1===e.hasAttribute("id")&&e.setAttribute("id","three_default_"+Je++)}}(e);const r=n(e,"node");for(let n=0;n<r.length;n++)t.children.push(Ie(r[n]));Ze.visualScenes[e.getAttribute("id")]=t})),d(Qe,"library_kinematics_models","kinematics_model",(function(e){const t={name:e.getAttribute("name")||"",joints:{},links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"technique_common"===r.nodeName)ge(r,t)}Ze.kinematicsModels[e.getAttribute("id")]=t})),d(Qe,"library_physics_models","physics_model",(function(e){const t={name:e.getAttribute("name")||"",rigidBodies:{}};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"rigid_body"===r.nodeName)t.rigidBodies[r.getAttribute("name")]={},Ee(r,t.rigidBodies[r.getAttribute("name")])}Ze.physicsModels[e.getAttribute("id")]=t})),d(Qe,"scene","instance_kinematics_scene",(function(e){const t={bindJointAxis:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType&&"bind_joint_axis"===r.nodeName)t.bindJointAxis.push(Se(r))}Ze.kinematicsScenes[l(e.getAttribute("url"))]=t})),p(Ze.animations,A),p(Ze.clips,T),p(Ze.controllers,D),p(Ze.images,L),p(Ze.effects,q),p(Ze.materials,K),p(Ze.cameras,te),p(Ze.lights,se),p(Ze.geometries,ue),p(Ze.visualScenes,ke),function(){const e=Ze.clips;if(!0===c(e)){if(!1===c(Ze.animations)){const e=[];for(const t in Ze.animations){const n=v(t);for(let t=0,r=n.length;t<r;t++)e.push(n[t])}qe.push(new r.AnimationClip("default",-1,e))}}else for(const t in e)qe.push(I(t))}(),function(){const e=Object.keys(Ze.kinematicsModels)[0],t=Object.keys(Ze.kinematicsScenes)[0],n=Object.keys(Ze.visualScenes)[0];if(void 0===e||void 0===t)return;const i=(s=e,f(Ze.kinematicsModels[s],me));var s;const a=function(e){return f(Ze.kinematicsScenes[e],we)}(t),o=Ge(n),l=a.bindJointAxis,c={};for(let r=0,d=l.length;r<d;r++){const e=l[r],t=Qe.querySelector('[sid="'+e.target+'"]');if(t){const n=t.parentElement;h(e.jointIndex,n)}}function h(e,t){const n=t.getAttribute("name"),r=i.joints[e];o.traverse((function(i){i.name===n&&(c[e]={object:i,transforms:Me(t),joint:r,position:r.zeroPosition})}))}const u=new r.Matrix4;Ke={joints:i&&i.joints,getJointValue:function(e){const t=c[e];if(t)return t.position;console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){const n=c[e];if(n){const i=n.joint;if(t>i.limits.max||t<i.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+i.limits.min+", max: "+i.limits.max+").");else if(i.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{const s=n.object,a=i.axis,o=n.transforms;Ce.identity();for(let n=0;n<o.length;n++){const s=o[n];if(s.sid&&-1!==s.sid.indexOf(e))switch(i.type){case"revolute":Ce.multiply(u.makeRotationAxis(a,r.MathUtils.degToRad(t)));break;case"prismatic":Ce.multiply(u.makeTranslation(a.x*t,a.y*t,a.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+i.type)}else switch(s.type){case"matrix":Ce.multiply(s.obj);break;case"translate":Ce.multiply(u.makeTranslation(s.obj.x,s.obj.y,s.obj.z));break;case"scale":Ce.scale(s.obj);break;case"rotate":Ce.multiply(u.makeRotationAxis(s.obj,s.angle))}}s.matrix.copy(Ce),s.matrix.decompose(s.position,s.quaternion,s.scale),c[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}();const $e=function(e){return Ge(l(n(e,"instance_visual_scene")[0].getAttribute("url")))}(n(Qe,"scene")[0]);return $e.animations=qe,"Z_UP"===je.upAxis&&$e.quaternion.setFromEuler(new r.Euler(-Math.PI/2,0,0)),$e.scale.multiplyScalar(je.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),qe},kinematics:Ke,library:Ze,scene:$e}}}t.ColladaLoader=s},79872:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const n={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function s(e,t,n,r){const i=n*r*4,s=new Uint8Array(e,t,i),a=new Uint8Array(i);let o=0,l=0;for(let c=0;c<r;c++)for(let e=0;e<n;e++){const e=s[l];l++;const t=s[l];l++;const n=s[l];l++;const r=s[l];l++,a[o]=n,o++,a[o]=t,o++,a[o]=e,o++,a[o]=r,o++}return a}const a=i("DXT1"),o=i("DXT3"),l=i("DXT5"),c=i("ETC1"),h=new Int32Array(e,0,31);if(542327876!==h[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),n;if(4&!h[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),n;let u;const d=h[21];let p=!1;switch(d){case a:u=8,n.format=r.RGB_S3TC_DXT1_Format;break;case o:u=16,n.format=r.RGBA_S3TC_DXT3_Format;break;case l:u=16,n.format=r.RGBA_S3TC_DXT5_Format;break;case c:u=8,n.format=r.RGB_ETC1_Format;break;default:if(!(32===h[22]&&16711680&h[23]&&65280&h[24]&&255&h[25]&&4278190080&h[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(f=d,String.fromCharCode(255&f,f>>8&255,f>>16&255,f>>24&255))),n;p=!0,u=64,n.format=r.RGBAFormat}var f;n.mipmapCount=1,131072&h[2]&&!1!==t&&(n.mipmapCount=Math.max(1,h[7]));const m=h[28];if(n.isCubemap=!!(512&m),n.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),n;n.width=h[4],n.height=h[3];let g=h[1]+4;const A=n.isCubemap?6:1;for(let r=0;r<A;r++){let t=n.width,r=n.height;for(let i=0;i<n.mipmapCount;i++){let i,a;p?(i=s(e,g,t,r),a=i.length):(a=Math.max(4,t)/4*Math.max(4,r)/4*u,i=new Uint8Array(e,g,a));const o={data:i,width:t,height:r};n.mipmaps.push(o),g+=a,t=Math.max(t>>1,1),r=Math.max(r>>1,1)}}return n}}t.DDSLoader=i},88909:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new WeakMap;class s extends r.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const s=new r.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(i)}),n,i)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const i in t.attributeTypes){const e=t.attributeTypes[i];void 0!==e.BYTES_PER_ELEMENT&&(t.attributeTypes[i]=e.name)}const n=JSON.stringify(t);if(i.has(e)){const t=i.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(s,a).then((n=>(r=n,new Promise(((n,i)=>{r._callbacks[s]={resolve:n,reject:i},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{r&&s&&this._releaseTask(r,s)})),i.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new r.BufferGeometry;e.index&&t.setIndex(new r.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],s=i.name,a=i.array,o=i.itemSize;t.setAttribute(s,new r.BufferAttribute(a,o))}return t}_loadLibrary(e,t){const n=new r.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=a.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function a(){let e,t;function n(e,t,n,r,i,s){const a=s.num_components(),o=n.num_points()*a,l=o*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),h=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,s,c,l,h);const u=new i(e.HEAPF32.buffer,h,o).slice();return e._free(h),{name:r,array:u,itemSize:a}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,s=i.taskConfig;t.then((e=>{const t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const s=i.attributeIDs,a=i.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(r,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const u in s){const r=self[a[u]];let l,c;if(i.useUniqueIDs)c=s[u],l=t.GetAttributeByUniqueId(o,c);else{if(c=t.GetAttributeId(o,e[s[u]]),-1===c)continue;l=t.GetAttribute(o,c)}h.attributes.push(n(e,t,o,u,r,l))}c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const r=n.num_faces(),i=3*r,s=4*i,a=e._malloc(s);t.GetTrianglesUInt32Array(n,s,a);const o=new Uint32Array(e.HEAPF32.buffer,a,i).slice();return e._free(a),{array:o,itemSize:1}}(e,t,o));return e.destroy(o),h}(t,a,o,s),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(l){console.error(l),self.postMessage({type:"error",id:i.id,error:l.message})}finally{t.destroy(o),t.destroy(a)}}))}}}t.DRACOLoader=s},13785:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083),s="colorSpace"in new r.Texture;class a extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType}parse(e){const t=65536,n=14,a=65537,o=16384,l=Math.pow(2.7182818,2.2);const c={l:0,c:0,lc:0};function h(e,t,n,r,i){for(;n<e;)t=t<<8|H(r,i),n+=8;n-=e,c.l=t>>n&(1<<e)-1,c.c=t,c.lc=n}const u=new Array(59);function d(e,t,n,r,i,s,o){for(var l=n,d=0,p=0;i<=s;i++){if(l.value-n.value>r)return!1;h(6,d,p,e,l);var f=c.l;if(d=c.c,p=c.lc,o[i]=f,63==f){if(l.value-n.value>r)throw"Something wrong with hufUnpackEncTable";h(8,d,p,e,l);var m=c.l+6;if(d=c.c,p=c.lc,i+m>s+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)o[i++]=0;i--}else if(f>=59){if(i+(m=f-59+2)>s+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)o[i++]=0;i--}}!function(e){for(var t=0;t<=58;++t)u[t]=0;for(t=0;t<a;++t)u[e[t]]+=1;var n=0;for(t=58;t>0;--t){var r=n+u[t]>>1;u[t]=n,n=r}for(t=0;t<a;++t){var i=e[t];i>0&&(e[t]=i|u[i]++<<6)}}(o)}function p(e){return 63&e}function f(e){return e>>6}const m={c:0,lc:0};function g(e,t,n,r){e=e<<8|H(n,r),t+=8,m.c=e,m.lc=t}const A={c:0,lc:0};function v(e,t,n,r,i,s,a,o,l,c){if(e==t){r<8&&(g(n,r,i,a),n=m.c,r=m.lc);var h=n>>(r-=8);h=new Uint8Array([h])[0];if(l.value+h>c)return!1;for(var u=o[l.value-1];h-- >0;)o[l.value++]=u}else{if(!(l.value<c))return!1;o[l.value++]=e}A.c=n,A.lc=r}function y(e){return 65535&e}function x(e){var t=y(e);return t>32767?t-65536:t}const b={a:0,b:0};function E(e,t){var n=x(e),r=x(t),i=n+(1&r)+(r>>1),s=i,a=i-r;b.a=s,b.b=a}function _(e,t){var n=y(e),r=y(t),i=n-(r>>1)&65535,s=r+i-32768&65535;b.a=s,b.b=i}function S(e,t,n,r,i,s,a){for(var o,l=a<16384,c=n>i?i:n,h=1;h<=c;)h<<=1;for(o=h>>=1,h>>=1;h>=1;){for(var u,d,p,f,m=0,g=m+s*(i-o),A=s*h,v=s*o,y=r*h,x=r*o;m<=g;m+=v){for(var S=m,w=m+r*(n-o);S<=w;S+=x){var M=S+y,C=(T=S+A)+y;l?(E(e[S+t],e[T+t]),u=b.a,p=b.b,E(e[M+t],e[C+t]),d=b.a,f=b.b,E(u,d),e[S+t]=b.a,e[M+t]=b.b,E(p,f),e[T+t]=b.a,e[C+t]=b.b):(_(e[S+t],e[T+t]),u=b.a,p=b.b,_(e[M+t],e[C+t]),d=b.a,f=b.b,_(u,d),e[S+t]=b.a,e[M+t]=b.b,_(p,f),e[T+t]=b.a,e[C+t]=b.b)}if(n&h){var T=S+A;l?E(e[S+t],e[T+t]):_(e[S+t],e[T+t]),u=b.a,e[T+t]=b.b,e[S+t]=u}}if(i&h)for(S=m,w=m+r*(n-o);S<=w;S+=x){M=S+y;l?E(e[S+t],e[M+t]):_(e[S+t],e[M+t]),u=b.a,e[M+t]=b.b,e[S+t]=u}o=h,h>>=1}return m}function w(e,t,r,i,s,l){var c=r.value,h=V(t,r),u=V(t,r);r.value+=4;var y=V(t,r);if(r.value+=4,h<0||h>=a||u<0||u>=a)throw"Something wrong with HUF_ENCSIZE";var x=new Array(a),b=new Array(o);if(function(e){for(var t=0;t<o;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(b),d(e,0,r,i-(r.value-c),h,u,x),y>8*(i-(r.value-c)))throw"Something wrong with hufUncompress";!function(e,t,r,i){for(;t<=r;t++){var s=f(e[t]),a=p(e[t]);if(s>>a)throw"Invalid table entry";if(a>n){if((h=i[s>>a-n]).len)throw"Invalid table entry";if(h.lit++,h.p){var o=h.p;h.p=new Array(h.lit);for(var l=0;l<h.lit-1;++l)h.p[l]=o[l]}else h.p=new Array(1);h.p[h.lit-1]=t}else if(a){var c=0;for(l=1<<n-a;l>0;l--){var h;if((h=i[(s<<n-a)+c]).len||h.p)throw"Invalid table entry";h.len=a,h.lit=t,c++}}}}(x,h,u,b),function(e,t,r,i,s,a,o,l,c,h){for(var u=0,d=0,y=l,x=Math.trunc(s.value+(a+7)/8);s.value<x;)for(g(u,d,r,s),u=m.c,d=m.lc;d>=n;)if((S=t[u>>d-n&16383]).len)d-=S.len,v(S.lit,o,u,d,r,0,s,c,h,y),u=A.c,d=A.lc;else{if(!S.p)throw"hufDecode issues";var b;for(b=0;b<S.lit;b++){for(var E=p(e[S.p[b]]);d<E&&s.value<x;)g(u,d,r,s),u=m.c,d=m.lc;if(d>=E&&f(e[S.p[b]])==(u>>d-E&(1<<E)-1)){d-=E,v(S.p[b],o,u,d,r,0,s,c,h,y),u=A.c,d=A.lc;break}}if(b==S.lit)throw"hufDecode issues"}var _=8-a&7;for(u>>=_,d-=_;d>0;){var S;if(!(S=t[u<<n-d&16383]).len)throw"hufDecode issues";d-=S.len,v(S.lit,o,u,d,r,0,s,c,h,y),u=A.c,d=A.lc}}(x,b,e,0,r,y,u,l,s,{value:0})}function M(e){for(var t=1;t<e.length;t++){var n=e[t-1]+e[t]-128;e[t]=n}}function C(e,t){for(var n=0,r=Math.floor((e.length+1)/2),i=0,s=e.length-1;!(i>s||(t[i++]=e[n++],i>s));)t[i++]=e[r++]}function T(e){for(var t=e.byteLength,n=new Array,r=0,i=new DataView(e);t>0;){var s=i.getInt8(r++);if(s<0){t-=(o=-s)+1;for(var a=0;a<o;a++)n.push(i.getUint8(r++))}else{var o=s;t-=2;var l=i.getUint8(r++);for(a=0;a<o+1;a++)n.push(l)}}return n}function I(e,t,n){for(var r,i=1;i<64;)65280==(r=t[e.value])?i=64:r>>8==255?i+=255&r:(n[i]=r,i++),e.value++}function B(e,t){t[0]=q(e[0]),t[1]=q(e[1]),t[2]=q(e[5]),t[3]=q(e[6]),t[4]=q(e[14]),t[5]=q(e[15]),t[6]=q(e[27]),t[7]=q(e[28]),t[8]=q(e[2]),t[9]=q(e[4]),t[10]=q(e[7]),t[11]=q(e[13]),t[12]=q(e[16]),t[13]=q(e[26]),t[14]=q(e[29]),t[15]=q(e[42]),t[16]=q(e[3]),t[17]=q(e[8]),t[18]=q(e[12]),t[19]=q(e[17]),t[20]=q(e[25]),t[21]=q(e[30]),t[22]=q(e[41]),t[23]=q(e[43]),t[24]=q(e[9]),t[25]=q(e[11]),t[26]=q(e[18]),t[27]=q(e[24]),t[28]=q(e[31]),t[29]=q(e[40]),t[30]=q(e[44]),t[31]=q(e[53]),t[32]=q(e[10]),t[33]=q(e[19]),t[34]=q(e[23]),t[35]=q(e[32]),t[36]=q(e[39]),t[37]=q(e[45]),t[38]=q(e[52]),t[39]=q(e[54]),t[40]=q(e[20]),t[41]=q(e[22]),t[42]=q(e[33]),t[43]=q(e[38]),t[44]=q(e[46]),t[45]=q(e[51]),t[46]=q(e[55]),t[47]=q(e[60]),t[48]=q(e[21]),t[49]=q(e[34]),t[50]=q(e[37]),t[51]=q(e[47]),t[52]=q(e[50]),t[53]=q(e[56]),t[54]=q(e[59]),t[55]=q(e[61]),t[56]=q(e[35]),t[57]=q(e[36]),t[58]=q(e[48]),t[59]=q(e[49]),t[60]=q(e[57]),t[61]=q(e[58]),t[62]=q(e[62]),t[63]=q(e[63])}function R(e){const t=.5*Math.cos(.7853975),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),i=.5*Math.cos(3*3.14159/16),s=.5*Math.cos(.981746875),a=.5*Math.cos(3*3.14159/8),o=.5*Math.cos(1.374445625);for(var l=new Array(4),c=new Array(4),h=new Array(4),u=new Array(4),d=0;d<8;++d){var p=8*d;l[0]=r*e[p+2],l[1]=a*e[p+2],l[2]=r*e[p+6],l[3]=a*e[p+6],c[0]=n*e[p+1]+i*e[p+3]+s*e[p+5]+o*e[p+7],c[1]=i*e[p+1]-o*e[p+3]-n*e[p+5]-s*e[p+7],c[2]=s*e[p+1]-n*e[p+3]+o*e[p+5]+i*e[p+7],c[3]=o*e[p+1]-s*e[p+3]+i*e[p+5]-n*e[p+7],h[0]=t*(e[p+0]+e[p+4]),h[3]=t*(e[p+0]-e[p+4]),h[1]=l[0]+l[3],h[2]=l[1]-l[2],u[0]=h[0]+h[1],u[1]=h[3]+h[2],u[2]=h[3]-h[2],u[3]=h[0]-h[1],e[p+0]=u[0]+c[0],e[p+1]=u[1]+c[1],e[p+2]=u[2]+c[2],e[p+3]=u[3]+c[3],e[p+4]=u[3]-c[3],e[p+5]=u[2]-c[2],e[p+6]=u[1]-c[1],e[p+7]=u[0]-c[0]}for(var f=0;f<8;++f)l[0]=r*e[16+f],l[1]=a*e[16+f],l[2]=r*e[48+f],l[3]=a*e[48+f],c[0]=n*e[8+f]+i*e[24+f]+s*e[40+f]+o*e[56+f],c[1]=i*e[8+f]-o*e[24+f]-n*e[40+f]-s*e[56+f],c[2]=s*e[8+f]-n*e[24+f]+o*e[40+f]+i*e[56+f],c[3]=o*e[8+f]-s*e[24+f]+i*e[40+f]-n*e[56+f],h[0]=t*(e[f]+e[32+f]),h[3]=t*(e[f]-e[32+f]),h[1]=l[0]+l[3],h[2]=l[1]-l[2],u[0]=h[0]+h[1],u[1]=h[3]+h[2],u[2]=h[3]-h[2],u[3]=h[0]-h[1],e[0+f]=u[0]+c[0],e[8+f]=u[1]+c[1],e[16+f]=u[2]+c[2],e[24+f]=u[3]+c[3],e[32+f]=u[3]-c[3],e[40+f]=u[2]-c[2],e[48+f]=u[1]-c[1],e[56+f]=u[0]-c[0]}function P(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],i=e[2][t];e[0][t]=n+1.5747*i,e[1][t]=n-.1873*r-.4682*i,e[2][t]=n+1.8556*r}}function D(e,t,n){for(var i=0;i<64;++i)t[n+i]=r.DataUtils.toHalfFloat(L(e[i]))}function L(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(l,Math.abs(e)-1)}function F(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function U(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(T(t)),r=new Uint8Array(n.length);return M(n),C(n,r),new DataView(r.buffer)}function O(e){var t=e.array.slice(e.offset.value,e.offset.value+e.size),n=i.unzlibSync(t),r=new Uint8Array(n.length);return M(n),C(n,r),new DataView(r.buffer)}function N(e){for(var n=e.viewer,r={value:e.offset.value},i=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),s=new Uint8Array(8192),a=0,o=new Array(e.channels),l=0;l<e.channels;l++)o[l]={},o[l].start=a,o[l].end=o[l].start,o[l].nx=e.width,o[l].ny=e.lines,o[l].size=e.type,a+=o[l].nx*o[l].ny*o[l].size;var c=K(n,r),h=K(n,r);if(h>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(c<=h)for(l=0;l<h-c+1;l++)s[l+c]=j(n,r);var u=new Uint16Array(t),d=function(e,n){for(var r=0,i=0;i<t;++i)(0==i||e[i>>3]&1<<(7&i))&&(n[r++]=i);for(var s=r-1;r<t;)n[r++]=0;return s}(s,u),p=V(n,r);w(e.array,n,r,p,i,a);for(l=0;l<e.channels;++l)for(var f=o[l],m=0;m<o[l].size;++m)S(i,f.start+m,f.nx,f.size,f.ny,f.nx*f.size,d);!function(e,t,n){for(var r=0;r<n;++r)t[r]=e[t[r]]}(u,i,a);for(var g=0,A=new Uint8Array(i.buffer.byteLength),v=0;v<e.lines;v++)for(var y=0;y<e.channels;y++){var x=(f=o[y]).nx*f.size,b=new Uint8Array(i.buffer,2*f.end,2*x);A.set(b,g),g+=2*x,f.end+=x}return new DataView(A.buffer)}function k(e){var t=e.array.slice(e.offset.value,e.offset.value+e.size),n=i.unzlibSync(t);const r=e.lines*e.channels*e.width,s=1==e.type?new Uint16Array(r):new Uint32Array(r);let a=0,o=0;const l=new Array(4);for(let i=0;i<e.lines;i++)for(let t=0;t<e.channels;t++){let t=0;switch(e.type){case 1:l[0]=a,l[1]=l[0]+e.width,a=l[1]+e.width;for(let r=0;r<e.width;++r){t+=n[l[0]++]<<8|n[l[1]++],s[o]=t,o++}break;case 2:l[0]=a,l[1]=l[0]+e.width,l[2]=l[1]+e.width,a=l[2]+e.width;for(let r=0;r<e.width;++r){t+=n[l[0]++]<<24|n[l[1]++]<<16|n[l[2]++]<<8,s[o]=t,o++}}}return new DataView(s.buffer)}function G(e){var t=e.viewer,n={value:e.offset.value},r=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),s={version:W(t,n),unknownUncompressedSize:W(t,n),unknownCompressedSize:W(t,n),acCompressedSize:W(t,n),dcCompressedSize:W(t,n),rleCompressedSize:W(t,n),rleUncompressedSize:W(t,n),rleRawSize:W(t,n),totalAcUncompressedCount:W(t,n),totalDcUncompressedCount:W(t,n),acCompression:W(t,n)};if(s.version<2)throw"EXRLoader.parse: "+ne.compression+" version "+s.version+" is unsupported";for(var a=new Array,o=K(t,n)-2;o>0;){var l=z(t.buffer,n),c=j(t,n),h=c>>2&3,u=new Int8Array([(c>>4)-1])[0],d=j(t,n);a.push({name:l,index:u,type:d,compression:h}),o-=l.length+3}for(var p=ne.channels,f=new Array(e.channels),m=0;m<e.channels;++m){var g=f[m]={},A=p[m];g.name=A.name,g.compression=0,g.decoded=!1,g.type=A.pixelType,g.pLinear=A.pLinear,g.width=e.width,g.height=e.lines}for(var v={idx:new Array(3)},y=0;y<e.channels;++y)for(g=f[y],m=0;m<a.length;++m){var x=a[m];g.name==x.name&&(g.compression=x.compression,x.index>=0&&(v.idx[x.index]=y),g.offset=y)}if(s.acCompressedSize>0)switch(s.acCompression){case 0:var b=new Uint16Array(s.totalAcUncompressedCount);w(e.array,t,n,s.acCompressedSize,b,s.totalAcUncompressedCount);break;case 1:var E=e.array.slice(n.value,n.value+s.totalAcUncompressedCount),_=i.unzlibSync(E);b=new Uint16Array(_.buffer);n.value+=s.totalAcUncompressedCount}if(s.dcCompressedSize>0){var S={array:e.array,offset:n,size:s.dcCompressedSize},M=new Uint16Array(O(S).buffer);n.value+=s.dcCompressedSize}if(s.rleRawSize>0){E=e.array.slice(n.value,n.value+s.rleCompressedSize);var C=T((_=i.unzlibSync(E)).buffer);n.value+=s.rleCompressedSize}var L=0,F=new Array(f.length);for(m=0;m<F.length;++m)F[m]=new Array;for(var U=0;U<e.lines;++U)for(var N=0;N<f.length;++N)F[N].push(L),L+=f[N].width*e.type*2;!function(e,t,n,r,i,s){var a=new DataView(s.buffer),o=n[e.idx[0]].width,l=n[e.idx[0]].height,c=Math.floor(o/8),h=Math.ceil(o/8),u=Math.ceil(l/8),d=o-8*(h-1),p=l-8*(u-1),f={value:0},m=new Array(3),g=new Array(3),A=new Array(3),v=new Array(3),y=new Array(3);for(let C=0;C<3;++C)y[C]=t[e.idx[C]],m[C]=C<1?0:m[C-1]+h*u,g[C]=new Float32Array(64),A[C]=new Uint16Array(64),v[C]=new Uint16Array(64*h);for(let C=0;C<u;++C){var x=8;C==u-1&&(x=p);var b=8;for(let e=0;e<h;++e){e==h-1&&(b=d);for(let e=0;e<3;++e)A[e].fill(0),A[e][0]=i[m[e]++],I(f,r,A[e]),B(A[e],g[e]),R(g[e]);P(g);for(let t=0;t<3;++t)D(g[t],v[t],64*e)}let t=0;for(let r=0;r<3;++r){const i=n[e.idx[r]].type;for(let e=8*C;e<8*C+x;++e){t=y[r][e];for(let n=0;n<c;++n){const s=64*n+8*(7&e);a.setUint16(t+0*i,v[r][s+0],!0),a.setUint16(t+2*i,v[r][s+1],!0),a.setUint16(t+4*i,v[r][s+2],!0),a.setUint16(t+6*i,v[r][s+3],!0),a.setUint16(t+8*i,v[r][s+4],!0),a.setUint16(t+10*i,v[r][s+5],!0),a.setUint16(t+12*i,v[r][s+6],!0),a.setUint16(t+14*i,v[r][s+7],!0),t+=16*i}}if(c!=h)for(let e=8*C;e<8*C+x;++e){const t=y[r][e]+8*c*2*i,n=64*c+8*(7&e);for(let e=0;e<b;++e)a.setUint16(t+2*e*i,v[r][n+e],!0)}}}for(var E=new Uint16Array(o),_=(a=new DataView(s.buffer),0);_<3;++_){n[e.idx[_]].decoded=!0;var S=n[e.idx[_]].type;if(2==n[_].type)for(var w=0;w<l;++w){const e=y[_][w];for(var M=0;M<o;++M)E[M]=a.getUint16(e+2*M*S,!0);for(M=0;M<o;++M)a.setFloat32(e+2*M*S,q(E[M]),!0)}}}(v,F,f,b,M,r);for(m=0;m<f.length;++m){if(!(g=f[m]).decoded){if(2!==g.compression)throw"EXRLoader.parse: unsupported channel compression";var k=0,G=0;for(U=0;U<e.lines;++U){for(var Q=F[m][k],V=0;V<g.width;++V){for(var H=0;H<2*g.type;++H)r[Q++]=C[G+H*g.width*g.height];G++}k++}}}return new DataView(r.buffer)}function z(e,t){for(var n=new Uint8Array(e),r=0;0!=n[t.value+r];)r+=1;var i=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,i}function Q(e,t){var n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function V(e,t){var n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function H(e,t){var n=e[t.value];return t.value=t.value+1,n}function j(e,t){var n=e.getUint8(t.value);return t.value=t.value+1,n}const W=function(e,t){let n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function X(e,t){var n=e.getFloat32(t.value,!0);return t.value+=4,n}function Y(e,t){return r.DataUtils.toHalfFloat(X(e,t))}function q(e){var t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function K(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function J(e,t){return q(K(e,t))}function Z(e,t,n,r,i){return"string"===r||"stringvector"===r||"iccProfile"===r?function(e,t,n){var r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(t,n,i):"chlist"===r?function(e,t,n,r){for(var i=n.value,s=[];n.value<i+r-1;){var a=z(t,n),o=Q(e,n),l=j(e,n);n.value+=3;var c=Q(e,n),h=Q(e,n);s.push({name:a,pixelType:o,pLinear:l,xSampling:c,ySampling:h})}return n.value+=1,s}(e,t,n,i):"chromaticities"===r?function(e,t){return{redX:X(e,t),redY:X(e,t),greenX:X(e,t),greenY:X(e,t),blueX:X(e,t),blueY:X(e,t),whiteX:X(e,t),whiteY:X(e,t)}}(e,n):"compression"===r?function(e,t){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][j(e,t)]}(e,n):"box2i"===r?function(e,t){return{xMin:V(e,t),yMin:V(e,t),xMax:V(e,t),yMax:V(e,t)}}(e,n):"lineOrder"===r?function(e,t){return["INCREASING_Y"][j(e,t)]}(e,n):"float"===r?X(e,n):"v2f"===r?function(e,t){return[X(e,t),X(e,t)]}(e,n):"v3f"===r?function(e,t){return[X(e,t),X(e,t),X(e,t)]}(e,n):"int"===r?Q(e,n):"rational"===r?function(e,t){return[Q(e,t),V(e,t)]}(e,n):"timecode"===r?function(e,t){return[V(e,t),V(e,t)]}(e,n):"preview"===r?(n.value+=i,"skipped"):void(n.value+=i)}const $=new DataView(e),ee=new Uint8Array(e),te={value:0},ne=function(e,t,n){const r={};if(20000630!=e.getUint32(0,!0))throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";r.version=e.getUint8(4);const i=e.getUint8(5);r.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},n.value=8;for(var s=!0;s;){var a=z(t,n);if(0==a)s=!1;else{var o=z(t,n),l=Z(e,t,n,o,V(e,n));void 0===l?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${o}'.`):r[a]=l}}if(0!=i)throw console.error("EXRHeader:",r),"THREE.EXRLoader: provided file is currently unsupported.";return r}($,e,te),re=function(e,t,n,i,a){const o={size:0,viewer:t,array:n,offset:i,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[s?"colorSpace":"encoding"]:null};switch(e.compression){case"NO_COMPRESSION":o.lines=1,o.uncompress=F;break;case"RLE_COMPRESSION":o.lines=1,o.uncompress=U;break;case"ZIPS_COMPRESSION":o.lines=1,o.uncompress=O;break;case"ZIP_COMPRESSION":o.lines=16,o.uncompress=O;break;case"PIZ_COMPRESSION":o.lines=32,o.uncompress=N;break;case"PXR24_COMPRESSION":o.lines=16,o.uncompress=k;break;case"DWAA_COMPRESSION":o.lines=32,o.uncompress=G;break;case"DWAB_COMPRESSION":o.lines=256,o.uncompress=G;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(o.scanlineBlockSize=o.lines,1==o.type)switch(a){case r.FloatType:o.getter=J,o.inputSize=2;break;case r.HalfFloatType:o.getter=K,o.inputSize=2}else{if(2!=o.type)throw"EXRLoader.parse: unsupported pixelType "+o.type+" for "+e.compression+".";switch(a){case r.FloatType:o.getter=X,o.inputSize=4;break;case r.HalfFloatType:o.getter=Y,o.inputSize=4}}o.blockCount=(e.dataWindow.yMax+1)/o.scanlineBlockSize;for(var l=0;l<o.blockCount;l++)W(t,i);o.outputChannels=3==o.channels?4:o.channels;const c=o.width*o.height*o.outputChannels;switch(a){case r.FloatType:o.byteArray=new Float32Array(c),o.channels<o.outputChannels&&o.byteArray.fill(1,0,c);break;case r.HalfFloatType:o.byteArray=new Uint16Array(c),o.channels<o.outputChannels&&o.byteArray.fill(15360,0,c);break;default:console.error("THREE.EXRLoader: unsupported type: ",a)}return o.bytesPerLine=o.width*o.inputSize*o.channels,4==o.outputChannels?o.format=r.RGBAFormat:o.format=r.RedFormat,s?o.colorSpace="srgb-linear":o.encoding=3e3,o}(ne,$,ee,te,this.type),ie={value:0},se={R:0,G:1,B:2,A:3,Y:0};for(let r=0;r<re.height/re.scanlineBlockSize;r++){const e=V($,te);re.size=V($,te),re.lines=e+re.scanlineBlockSize>re.height?re.height-e:re.scanlineBlockSize;const t=re.size<re.lines*re.bytesPerLine?re.uncompress(re):F(re);te.value+=re.size;for(let n=0;n<re.scanlineBlockSize;n++){const e=n+r*re.scanlineBlockSize;if(e>=re.height)break;for(let r=0;r<re.channels;r++){const i=se[ne.channels[r].name];for(let s=0;s<re.width;s++){ie.value=(n*(re.channels*re.width)+r*re.width+s)*re.inputSize;const a=(re.height-1-e)*(re.width*re.outputChannels)+s*re.outputChannels+i;re.byteArray[a]=re.getter(t,ie)}}}}return{header:ne,width:re.width,height:re.height,data:re.byteArray,format:re.format,[s?"colorSpace":"encoding"]:re[s?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){return super.load(e,(function(e,n){s?e.colorSpace=n.colorSpace:e.encoding=n.encoding,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)}),n,i)}}t.EXRLoader=a},27619:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083),s=n(98001);let a,o,l;class c extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=""===s.path?r.LoaderUtils.extractUrlBase(e):s.path,o=new r.FileLoader(this.manager);o.setPath(s.path),o.setResponseType("arraybuffer"),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===M(e,0,t.length)}(e))a=(new f).parse(e);else{const t=M(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(t){const r=e[t-1];return e=e.slice(n+t),n++,r}for(let i=0;i<t.length;++i){if(r(1)===t[i])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(A(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+A(t));a=(new p).parse(t)}const n=new r.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new h(n,this.manager).parse(a)}}class h{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){o=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),i=(new u).parse(r);return this.parseScene(r,i,n),l}parseConnections(){const e=new Map;if("Connections"in a){a.Connections.connections.forEach((function(t){const n=t[0],r=t[1],i=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:r,relationship:i};e.get(n).parents.push(s),e.has(r)||e.set(r,{parents:[],children:[]});const a={ID:n,relationship:i};e.get(r).children.push(a)}))}return e}parseImages(){const e={},t={};if("Video"in a.Objects){const n=a.Objects.Video;for(const r in n){const i=n[r];if(e[parseInt(r)]=i.RelativeFilename||i.Filename,"Content"in i){const e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,s="string"==typeof i.Content&&""!==i.Content;if(e||s){const e=this.parseImage(n[r]);t[i.RelativeFilename||i.Filename]=e}}}}for(const n in e){const r=e[n];void 0!==t[r]?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let i;switch(r){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof t)return"data:"+i+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in a.Objects){const n=a.Objects.Texture;for(const r in n){const i=this.parseTexture(n[r],e);t.set(parseInt(r),i)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const i=e.WrapModeU,s=e.WrapModeV,a=void 0!==i?i.value:0,o=void 0!==s?s.value:0;if(n.wrapS=0===a?r.RepeatWrapping:r.ClampToEdgeWrapping,n.wrapT=0===o?r.RepeatWrapping:r.ClampToEdgeWrapping,"Scaling"in e){const t=e.Scaling.value;n.repeat.x=t[0],n.repeat.y=t[1]}return n}loadTexture(e,t){let n;const i=this.textureLoader.path,s=o.get(e.id).children;let a;void 0!==s&&s.length>0&&void 0!==t[s[0].ID]&&(n=t[s[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const l=e.FileName.slice(-3).toLowerCase();if("tga"===l){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),a=new r.Texture):(t.setPath(this.textureLoader.path),a=t.load(n))}else"psd"===l?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),a=new r.Texture):a=this.textureLoader.load(n);return this.textureLoader.setPath(i),a}parseMaterials(e){const t=new Map;if("Material"in a.Objects){const n=a.Objects.Material;for(const r in n){const i=this.parseMaterial(n[r],e);null!==i&&t.set(parseInt(r),i)}}return t}parseMaterial(e,t){const n=e.id,i=e.attrName;let s=e.ShadingModel;if("object"==typeof s&&(s=s.value),!o.has(n))return null;const a=this.parseParameters(e,t,n);let l;switch(s.toLowerCase()){case"phong":l=new r.MeshPhongMaterial;break;case"lambert":l=new r.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',s),l=new r.MeshPhongMaterial}return l.setValues(a),l.name=i,l}parseParameters(e,t,n){const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new r.Color).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(i.color=(new r.Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new r.Color).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(i.emissive=(new r.Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new r.Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new r.Color).fromArray(e.SpecularColor.value));const s=this;return o.get(n).children.forEach((function(e){const n=e.relationship;switch(n){case"Bump":i.bumpMap=s.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=s.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=s.getTexture(t,e.ID),void 0!==i.map&&("colorSpace"in i.map?i.map.colorSpace="srgb":i.map.encoding=3001);break;case"DisplacementColor":i.displacementMap=s.getTexture(t,e.ID);break;case"EmissiveColor":i.emissiveMap=s.getTexture(t,e.ID),void 0!==i.emissiveMap&&("colorSpace"in i.emissiveMap?i.emissiveMap.colorSpace="srgb":i.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=s.getTexture(t,e.ID);break;case"ReflectionColor":i.envMap=s.getTexture(t,e.ID),void 0!==i.envMap&&(i.envMap.mapping=r.EquirectangularReflectionMapping,"colorSpace"in i.envMap?i.envMap.colorSpace="srgb":i.envMap.encoding=3001);break;case"SpecularColor":i.specularMap=s.getTexture(t,e.ID),void 0!==i.specularMap&&("colorSpace"in i.specularMap?i.specularMap.colorSpace="srgb":i.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=s.getTexture(t,e.ID),i.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),i}getTexture(e,t){return"LayeredTexture"in a.Objects&&t in a.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=o.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in a.Objects){const n=a.Objects.Deformer;for(const r in n){const i=n[r],s=o.get(parseInt(r));if("Skin"===i.attrType){const t=this.parseSkeleton(s,n);t.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=s.parents[0].ID,e[r]=t}else if("BlendShape"===i.attrType){const e={id:r};e.rawTargets=this.parseMorphTargets(s,n),e.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach((function(e){const i=t[e.ID];if("Cluster"!==i.attrType)return;const s={ID:e.ID,indices:[],weights:[],transformLink:(new r.Matrix4).fromArray(i.TransformLink.a)};"Indexes"in i&&(s.indices=i.Indexes.a,s.weights=i.Weights.a),n.push(s)})),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let r=0;r<e.children.length;r++){const i=e.children[r],s=t[i.ID],a={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;a.geoID=o.get(parseInt(i.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,n.push(a)}return n}parseScene(e,t,n){l=new r.Group;const i=this.parseModels(e.skeletons,t,n),s=a.Objects.Model,c=this;i.forEach((function(e){const t=s[e.ID];c.setLookAtProperties(e,t);o.get(e.ID).parents.forEach((function(t){const n=i.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&l.add(e)})),this.bindSkeleton(e.skeletons,t,i),this.createAmbientLight(),l.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=_(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const h=(new d).parse();1===l.children.length&&l.children[0].isGroup&&(l.children[0].animations=h,l=l.children[0]),l.animations=h}parseModels(e,t,n){const i=new Map,s=a.Objects.Model;for(const a in s){const l=parseInt(a),c=s[a],h=o.get(l);let u=this.buildSkeleton(h,e,l,c.attrName);if(!u){switch(c.attrType){case"Camera":u=this.createCamera(h);break;case"Light":u=this.createLight(h);break;case"Mesh":u=this.createMesh(h,t,n);break;case"NurbsCurve":u=this.createCurve(h,t);break;case"LimbNode":case"Root":u=new r.Bone;break;default:u=new r.Group}u.name=c.attrName?r.PropertyBinding.sanitizeNodeName(c.attrName):"",u.ID=l}this.getTransformData(u,c),i.set(l,u)}return i}buildSkeleton(e,t,n,i){let s=null;return e.parents.forEach((function(e){for(const a in t){const o=t[a];o.rawBones.forEach((function(t,a){if(t.ID===e.ID){const e=s;s=new r.Bone,s.matrixWorld.copy(t.transformLink),s.name=i?r.PropertyBinding.sanitizeNodeName(i):"",s.ID=n,o.bones[a]=s,null!==e&&s.add(e)}}))}})),s}createCamera(e){let t,n;if(e.children.forEach((function(e){const t=a.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new r.Object3D;else{let e=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(e=1);let i=1;void 0!==n.NearPlane&&(i=n.NearPlane.value/1e3);let s=1e3;void 0!==n.FarPlane&&(s=n.FarPlane.value/1e3);let a=window.innerWidth,o=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(a=n.AspectWidth.value,o=n.AspectHeight.value);const l=a/o;let c=45;void 0!==n.FieldOfView&&(c=n.FieldOfView.value);const h=n.FocalLength?n.FocalLength.value:null;switch(e){case 0:t=new r.PerspectiveCamera(c,l,i,s),null!==h&&t.setFocalLength(h);break;case 1:t=new r.OrthographicCamera(-a/2,a/2,o/2,-o/2,i,s);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new r.Object3D}}return t}createLight(e){let t,n;if(e.children.forEach((function(e){const t=a.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new r.Object3D;else{let e;e=void 0===n.LightType?0:n.LightType.value;let i=16777215;void 0!==n.Color&&(i=(new r.Color).fromArray(n.Color.value));let s=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(s=0);let a=0;void 0!==n.FarAttenuationEnd&&(a=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const o=1;switch(e){case 0:t=new r.PointLight(i,s,a,o);break;case 1:t=new r.DirectionalLight(i,s);break;case 2:let e=Math.PI/3;void 0!==n.InnerAngle&&(e=r.MathUtils.degToRad(n.InnerAngle.value));let l=0;void 0!==n.OuterAngle&&(l=r.MathUtils.degToRad(n.OuterAngle.value),l=Math.max(l,1)),t=new r.SpotLight(i,s,a,e,l,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new r.PointLight(i,s)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,n){let i,s=null,a=null;const o=[];return e.children.forEach((function(e){t.has(e.ID)&&(s=t.get(e.ID)),n.has(e.ID)&&o.push(n.get(e.ID))})),o.length>1?a=o:o.length>0?a=o[0]:(a=new r.MeshPhongMaterial({color:13421772}),o.push(a)),"color"in s.attributes&&o.forEach((function(e){e.vertexColors=!0})),s.FBX_Deformer?(i=new r.SkinnedMesh(s,a),i.normalizeSkinWeights()):i=new r.Mesh(s,a),i}createCurve(e,t){const n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),i=new r.LineBasicMaterial({color:3342591,linewidth:1});return new r.Line(n,i)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?S(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){if("LookAtProperty"in t){o.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const n=a.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),l.add(e.target)):e.lookAt((new r.Vector3).fromArray(t))}}}))}}bindSkeleton(e,t,n){const i=this.parsePoseNodes();for(const s in e){const a=e[s];o.get(parseInt(a.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;o.get(t).parents.forEach((function(e){if(n.has(e.ID)){n.get(e.ID).bind(new r.Skeleton(a.bones),i[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in a.Objects){const t=a.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const i=t[n].PoseNode;Array.isArray(i)?i.forEach((function(t){e[t.Node]=(new r.Matrix4).fromArray(t.Matrix.a)})):e[i.Node]=(new r.Matrix4).fromArray(i.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in a&&"AmbientColor"in a.GlobalSettings){const e=a.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],i=e[2];if(0!==t||0!==n||0!==i){const e=new r.Color(t,n,i);l.add(new r.AmbientLight(e,1))}}}}class u{parse(e){const t=new Map;if("Geometry"in a.Objects){const n=a.Objects.Geometry;for(const r in n){const i=o.get(parseInt(r)),s=this.parseGeometry(i,n[r],e);t.set(parseInt(r),s)}}return t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const r=n.skeletons,i=[],s=e.parents.map((function(e){return a.Objects.Model[e.ID]}));if(0===s.length)return;const o=e.children.reduce((function(e,t){return void 0!==r[t.ID]&&(e=r[t.ID]),e}),null);e.children.forEach((function(e){void 0!==n.morphTargets[e.ID]&&i.push(n.morphTargets[e.ID])}));const l=s[0],c={};"RotationOrder"in l&&(c.eulerOrder=S(l.RotationOrder.value)),"InheritType"in l&&(c.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(c.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(c.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(c.scale=l.GeometricScaling.value);const h=_(c);return this.genGeometry(t,o,i,h)}genGeometry(e,t,n,i){const s=new r.BufferGeometry;e.attrName&&(s.name=e.attrName);const a=this.parseGeoNode(e,t),o=this.genBuffers(a),l=new r.Float32BufferAttribute(o.vertex,3);if(l.applyMatrix4(i),s.setAttribute("position",l),o.colors.length>0&&s.setAttribute("color",new r.Float32BufferAttribute(o.colors,3)),t&&(s.setAttribute("skinIndex",new r.Uint16BufferAttribute(o.weightsIndices,4)),s.setAttribute("skinWeight",new r.Float32BufferAttribute(o.vertexWeights,4)),s.FBX_Deformer=t),o.normal.length>0){const e=(new r.Matrix3).getNormalMatrix(i),t=new r.Float32BufferAttribute(o.normal,3);t.applyNormalMatrix(e),s.setAttribute("normal",t)}if(o.uvs.forEach((function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),s.setAttribute(n,new r.Float32BufferAttribute(o.uvs[t],2))})),a.material&&"AllSame"!==a.material.mappingType){let e=o.materialIndex[0],t=0;if(o.materialIndex.forEach((function(n,r){n!==e&&(s.addGroup(t,r-t,e),e=n,t=r)})),s.groups.length>0){const t=s.groups[s.groups.length-1],n=t.start+t.count;n!==o.materialIndex.length&&s.addGroup(n,o.materialIndex.length-n,e)}0===s.groups.length&&s.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(s,e,n,i),s}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,i){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[i]})}))}))),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,i=!1,s=[],a=[],o=[],l=[],c=[],h=[];const u=this;return e.vertexIndices.forEach((function(d,p){let f,m=!1;d<0&&(d^=-1,m=!0);let g=[],A=[];if(s.push(3*d,3*d+1,3*d+2),e.color){const t=x(p,n,d,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[d]&&e.weightTable[d].forEach((function(e){A.push(e.weight),g.push(e.id)})),A.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const e=[0,0,0,0],t=[0,0,0,0];A.forEach((function(n,r){let i=n,s=g[r];t.forEach((function(t,n,r){if(i>t){r[n]=i,i=t;const a=e[n];e[n]=s,s=a}}))})),g=e,A=t}for(;A.length<4;)A.push(0),g.push(0);for(let e=0;e<4;++e)c.push(A[e]),h.push(g[e])}if(e.normal){const t=x(p,n,d,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=x(p,n,d,e.material)[0]),e.uv&&e.uv.forEach((function(e,t){const r=x(p,n,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(r[0]),l[t].push(r[1])})),r++,m&&(u.genFace(t,e,s,f,a,o,l,c,h,r),n++,r=0,s=[],a=[],o=[],l=[],c=[],h=[])})),t}genFace(e,t,n,r,i,s,a,o,l,c){for(let h=2;h<c;h++)e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(h-1)]),e.vertexWeights.push(o[4*(h-1)+1]),e.vertexWeights.push(o[4*(h-1)+2]),e.vertexWeights.push(o[4*(h-1)+3]),e.vertexWeights.push(o[4*h]),e.vertexWeights.push(o[4*h+1]),e.vertexWeights.push(o[4*h+2]),e.vertexWeights.push(o[4*h+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(h-1)]),e.weightsIndices.push(l[4*(h-1)+1]),e.weightsIndices.push(l[4*(h-1)+2]),e.weightsIndices.push(l[4*(h-1)+3]),e.weightsIndices.push(l[4*h]),e.weightsIndices.push(l[4*h+1]),e.weightsIndices.push(l[4*h+2]),e.weightsIndices.push(l[4*h+3])),t.color&&(e.colors.push(s[0]),e.colors.push(s[1]),e.colors.push(s[2]),e.colors.push(s[3*(h-1)]),e.colors.push(s[3*(h-1)+1]),e.colors.push(s[3*(h-1)+2]),e.colors.push(s[3*h]),e.colors.push(s[3*h+1]),e.colors.push(s[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(i[0]),e.normal.push(i[1]),e.normal.push(i[2]),e.normal.push(i[3*(h-1)]),e.normal.push(i[3*(h-1)+1]),e.normal.push(i[3*(h-1)+2]),e.normal.push(i[3*h]),e.normal.push(i[3*h+1]),e.normal.push(i[3*h+2])),t.uv&&t.uv.forEach((function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(a[n][0]),e.uvs[n].push(a[n][1]),e.uvs[n].push(a[n][2*(h-1)]),e.uvs[n].push(a[n][2*(h-1)+1]),e.uvs[n].push(a[n][2*h]),e.uvs[n].push(a[n][2*h+1])}))}addMorphTargets(e,t,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const s=a.Objects.Geometry[n.geoID];void 0!==s&&i.genMorphGeometry(e,t,s,r,n.name)}))}))}genMorphGeometry(e,t,n,i,s){const a=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],o=void 0!==n.Vertices?n.Vertices.a:[],l=void 0!==n.Indexes?n.Indexes.a:[],c=3*e.attributes.position.count,h=new Float32Array(c);for(let r=0;r<l.length;r++){const e=3*l[r];h[e]=o[3*r],h[e+1]=o[3*r+1],h[e+2]=o[3*r+2]}const u={vertexIndices:a,vertexPositions:h},d=this.genBuffers(u),p=new r.Float32BufferAttribute(d.vertex,3);p.name=s||n.attrName,p.applyMatrix4(i),e.morphAttributes.position.push(p)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let i=[];return"IndexToDirect"===n&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:i,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let i=[];return"IndexToDirect"===n&&(i=e.UVIndex.a),{dataSize:2,buffer:r,indices:i,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let i=[];return"IndexToDirect"===n&&(i=e.ColorIndex.a),{dataSize:4,buffer:r,indices:i,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,i=[];for(let s=0;s<r.length;++s)i.push(s);return{dataSize:1,buffer:r,indices:i,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===s.NURBSCurve)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new r.BufferGeometry;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new r.BufferGeometry;const n=t-1,i=e.KnotVector.a,a=[],o=e.Points.a;for(let s=0,u=o.length;s<u;s+=4)a.push((new r.Vector4).fromArray(o,s));let l,c;if("Closed"===e.Form)a.push(a[0]);else if("Periodic"===e.Form){l=n,c=i.length-1-l;for(let e=0;e<n;++e)a.push(a[e])}const h=new s.NURBSCurve(n,i,a,l,c).getPoints(12*a.length);return(new r.BufferGeometry).setFromPoints(h)}}class d{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const r=t[n],i=this.addClip(r);e.push(i)}return e}parseClips(){if(void 0===a.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=a.Objects.AnimationCurveNode,t=new Map;for(const n in e){const r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=a.Objects.AnimationCurve;for(const n in t){const r={id:t[n].id,times:t[n].KeyTime.a.map(v),values:t[n].KeyValueFloat.a},i=o.get(r.id);if(void 0!==i){const t=i.parents[0].ID,n=i.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=r:n.match(/Y/)?e.get(t).curves.y=r:n.match(/Z/)?e.get(t).curves.z=r:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=r)}}}parseAnimationLayers(e){const t=a.Objects.AnimationLayer,n=new Map;for(const i in t){const t=[],s=o.get(parseInt(i));if(void 0!==s){s.children.forEach((function(n,i){if(e.has(n.ID)){const s=e.get(n.ID);if(void 0!==s.curves.x||void 0!==s.curves.y||void 0!==s.curves.z){if(void 0===t[i]){const e=o.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const s=a.Objects.Model[e.toString()];if(void 0===s)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const o={modelName:s.attrName?r.PropertyBinding.sanitizeNodeName(s.attrName):"",ID:s.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};l.traverse((function(e){e.ID===s.id&&(o.transform=e.matrix,e.userData.transformData&&(o.eulerOrder=e.userData.transformData.eulerOrder))})),o.transform||(o.transform=new r.Matrix4),"PreRotation"in s&&(o.preRotation=s.PreRotation.value),"PostRotation"in s&&(o.postRotation=s.PostRotation.value),t[i]=o}}t[i]&&(t[i][s.attr]=s)}else if(void 0!==s.curves.morph){if(void 0===t[i]){const e=o.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,s=o.get(e).parents[0].ID,l=o.get(s).parents[0].ID,c=o.get(l).parents[0].ID,h=a.Objects.Model[c],u={modelName:h.attrName?r.PropertyBinding.sanitizeNodeName(h.attrName):"",morphName:a.Objects.Deformer[e].attrName};t[i]=u}t[i][s.attr]=s}}})),n.set(parseInt(i),t)}}return n}parseAnimStacks(e){const t=a.Objects.AnimationStack,n={};for(const r in t){const i=o.get(parseInt(r)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=e.get(i[0].ID);n[r]={name:t[r].attrName,layer:s}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new r.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let n=new r.Vector3,i=new r.Quaternion,s=new r.Vector3;if(e.transform&&e.transform.decompose(n,i,s),n=n.toArray(),i=(new r.Euler).setFromQuaternion(i,e.eulerOrder).toArray(),s=s.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,i,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,i){const s=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(s,t,n);return new r.VectorKeyframeTrack(e+"."+i,s,a)}generateRotationTrack(e,t,n,i,s,a){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(r.MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(r.MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(r.MathUtils.degToRad));const o=this.getTimesForAllAxes(t),l=this.getKeyframeTrackValues(o,t,n);void 0!==i&&((i=i.map(r.MathUtils.degToRad)).push(a),i=(new r.Euler).fromArray(i),i=(new r.Quaternion).setFromEuler(i)),void 0!==s&&((s=s.map(r.MathUtils.degToRad)).push(a),s=(new r.Euler).fromArray(s),s=(new r.Quaternion).setFromEuler(s).invert());const c=new r.Quaternion,h=new r.Euler,u=[];for(let r=0;r<l.length;r+=3)h.set(l[r],l[r+1],l[r+2],a),c.setFromEuler(h),void 0!==i&&c.premultiply(i),void 0!==s&&c.multiply(s),c.toArray(u,r/3*4);return new r.QuaternionKeyframeTrack(e+".quaternion",o,u)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map((function(e){return e/100})),i=l.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new r.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+i+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let r=1;r<t.length;r++){const i=t[r];i!==n&&(t[e]=i,n=i,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,n){const r=n,i=[];let s=-1,a=-1,o=-1;return e.forEach((function(e){if(t.x&&(s=t.x.times.indexOf(e)),t.y&&(a=t.y.times.indexOf(e)),t.z&&(o=t.z.times.indexOf(e)),-1!==s){const e=t.x.values[s];i.push(e),r[0]=e}else i.push(r[0]);if(-1!==a){const e=t.y.values[a];i.push(e),r[1]=e}else i.push(r[1]);if(-1!==o){const e=t.z.values[o];i.push(e),r[2]=e}else i.push(r[2])})),i}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const n=e.values[t-1],r=e.values[t]-n,i=Math.abs(r);if(i>=180){const s=i/180,a=r/s;let o=n+a;const l=e.times[t-1],c=(e.times[t]-l)/s;let h=l+c;const u=[],d=[];for(;h<e.times[t];)u.push(h),h+=c,d.push(o),o+=a;e.times=C(e.times,t,u),e.values=C(e.values,t,d)}}}}class p{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new g,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach((function(e,r){const i=e.match(/^[\s\t]*;/),s=e.match(/^[\s\t]*$/);if(i||s)return;const a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,n[++r]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),i={name:n},s=this.parseNodeAttr(r),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,i):n in a?("PoseNode"===n?a.PoseNode.push(i):void 0!==a[n].id&&(a[n]={},a[n][a[n].id]=a[n]),""!==s.id&&(a[n][s.id]=i)):"number"==typeof s.id?(a[n]={},a[n][s.id]=i):"Properties70"!==n&&(a[n]="PoseNode"===n?[i]:i),"number"==typeof s.id&&(i.id=s.id),""!==s.name&&(i.attrName=s.name),""!==s.type&&(i.attrType=s.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===i&&(i=n.replace(/"/g,"").replace(/,$/,"").trim());const s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===r){const e=i.split(",").slice(1),t=parseInt(e[0]),n=parseInt(e[1]);let a=i.split(",").slice(3);a=a.map((function(e){return e.trim().replace(/^"/,"")})),r="connections",i=[t,n],function(e,t){for(let n=0,r=e.length,i=t.length;n<i;n++,r++)e[r]=t[n]}(i,a),void 0===s[r]&&(s[r]=[])}"Node"===r&&(s.id=i),r in s&&Array.isArray(s[r])?s[r].push(i):"a"!==r?s[r]=i:s.a=i,this.setCurrentProp(s,r),"a"===r&&","!==i.slice(-1)&&(s.a=w(i))}else this.parseNodeSpecialProperty(e,r,i)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=w(t.a))}parseNodeSpecialProperty(e,t,n){const r=n.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),i=r[0],s=r[1],a=r[2],o=r[3];let l=r[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=w(l)}this.getPrevNode()[i]={type:s,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class f{parse(e){const t=new m(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new g;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const s=e.getUint8(),a=e.getString(s);if(0===r)return null;const o=[];for(let u=0;u<i;u++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",h=o.length>2?o[2]:"";for(n.singleProperty=1===i&&e.getOffset()===r;r>e.getOffset();){const r=this.parseNode(e,t);null!==r&&this.parseSubNode(a,n,r)}return n.propertyList=o,"number"==typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==h&&(n.attrType=h),""!==a&&(n.name=a),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];Array.isArray(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){const e=[];n.propertyList.forEach((function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name){Object.keys(n).forEach((function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],r=n.propertyList[1];const i=n.propertyList[2],s=n.propertyList[3];let a;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),a="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===r.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:r,type2:i,flag:s,value:a}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=e.getUint32(),s=e.getUint32(),a=e.getUint32();if(0===s)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}const o=i.unzlibSync(new Uint8Array(e.getArrayBuffer(a))),l=new m(o.buffer);switch(t){case"b":case"c":return l.getBooleanArray(r);case"d":return l.getFloat64Array(r);case"f":return l.getFloat32Array(r);case"i":return l.getInt32Array(r);case"l":return l.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class m{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let r=0;r<e;r++)t[r]=this.getUint8();const n=t.indexOf(0);return n>=0&&(t=t.slice(0,n)),r.LoaderUtils.decodeText(new Uint8Array(t))}}class g{add(e,t){this[e]=t}}function A(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return parseInt(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function v(e){return e/46186158e3}const y=[];function x(e,t,n,r){let i;switch(r.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=n;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(i=r.indices[i]);const s=i*r.dataSize,a=s+r.dataSize;return function(e,t,n,r){for(let i=n,s=0;i<r;i++,s++)e[s]=t[i];return e}(y,r.buffer,s,a)}const b=new r.Euler,E=new r.Vector3;function _(e){const t=new r.Matrix4,n=new r.Matrix4,i=new r.Matrix4,s=new r.Matrix4,a=new r.Matrix4,o=new r.Matrix4,l=new r.Matrix4,c=new r.Matrix4,h=new r.Matrix4,u=new r.Matrix4,d=new r.Matrix4,p=new r.Matrix4,f=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(E.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder),n.makeRotationFromEuler(b.fromArray(t))}if(e.rotation){const t=e.rotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder),i.makeRotationFromEuler(b.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder),s.makeRotationFromEuler(b.fromArray(t)),s.invert()}e.scale&&a.scale(E.fromArray(e.scale)),e.scalingOffset&&l.setPosition(E.fromArray(e.scalingOffset)),e.scalingPivot&&o.setPosition(E.fromArray(e.scalingPivot)),e.rotationOffset&&c.setPosition(E.fromArray(e.rotationOffset)),e.rotationPivot&&h.setPosition(E.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(d.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));const m=n.clone().multiply(i).multiply(s),g=new r.Matrix4;g.extractRotation(u);const A=new r.Matrix4;A.copyPosition(u);const v=A.clone().invert().multiply(u),y=g.clone().invert().multiply(v),x=a,_=new r.Matrix4;if(0===f)_.copy(g).multiply(m).multiply(y).multiply(x);else if(1===f)_.copy(g).multiply(y).multiply(m).multiply(x);else{const e=(new r.Matrix4).scale((new r.Vector3).setFromMatrixScale(d)).clone().invert(),t=y.clone().multiply(e);_.copy(g).multiply(m).multiply(t).multiply(x)}const S=h.clone().invert(),w=o.clone().invert();let M=t.clone().multiply(c).multiply(h).multiply(n).multiply(i).multiply(s).multiply(S).multiply(l).multiply(o).multiply(a).multiply(w);const C=(new r.Matrix4).copyPosition(M),T=u.clone().multiply(C);return p.copyPosition(T),M=p.clone().multiply(_),M.premultiply(u.invert()),M}function S(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function w(e){return e.split(",").map((function(e){return parseFloat(e)}))}function M(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),r.LoaderUtils.decodeText(new Uint8Array(e,t,n))}function C(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}t.FBXLoader=c},74758:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);class a extends s.Loader{constructor(e){super(e)}load(e,t,n,r){const i=new s.FileLoader(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{if("string"!=typeof e)throw new Error("unsupported data type");const n=JSON.parse(e),r=this.parse(n);t&&t(r)}),n,r)}loadAsync(e,t){return super.loadAsync(e,t)}parse(e){return new o(e)}}class o{constructor(e){i(this,"data"),this.data=e}generateShapes(e,t=100,n){const r=[],i={letterSpacing:0,lineHeight:1,...n},s=function(e,t,n,r){const i=Array.from(e),s=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*s,o=[];let c=0,h=0;for(let u=0;u<i.length;u++){const e=i[u];if("\n"===e)c=0,h-=a*r.lineHeight;else{const t=l(e,s,c,h,n);t&&(c+=t.offsetX+r.letterSpacing,o.push(t.path))}}return o}(e,t,this.data,i);for(let a=0,o=s.length;a<o;a++)Array.prototype.push.apply(r,s[a].toShapes(!1));return r}}function l(e,t,n,r,i){const a=i.glyphs[e]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const o=new s.ShapePath;let l,c,h,u,d,p,f,m;if(a.o){const e=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,s=e.length;i<s;){switch(e[i++]){case"m":l=parseInt(e[i++])*t+n,c=parseInt(e[i++])*t+r,o.moveTo(l,c);break;case"l":l=parseInt(e[i++])*t+n,c=parseInt(e[i++])*t+r,o.lineTo(l,c);break;case"q":h=parseInt(e[i++])*t+n,u=parseInt(e[i++])*t+r,d=parseInt(e[i++])*t+n,p=parseInt(e[i++])*t+r,o.quadraticCurveTo(d,p,h,u);break;case"b":h=parseInt(e[i++])*t+n,u=parseInt(e[i++])*t+r,d=parseInt(e[i++])*t+n,p=parseInt(e[i++])*t+r,f=parseInt(e[i++])*t+n,m=parseInt(e[i++])*t+r,o.bezierCurveTo(d,p,f,m,h,u)}}}return{offsetX:a.ha*t,path:o}}i(o,"isFont"),i(o,"type"),t.Font=o,t.FontLoader=a},77750:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.splitLayer=!1}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){let t,n={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},i=[];const s=new r.LineBasicMaterial({color:16711680});s.name="path";const a=new r.LineBasicMaterial({color:65280});function o(e){t={vertex:[],pathVertex:[],z:e.z},i.push(t)}function l(e,t){return n.relative?t:t-e}function c(e,t){return n.relative?e+t:t}a.name="extruded";let h=e.replace(/;.+/g,"").split("\n");for(let r=0;r<h.length;r++){let e=h[r].split(" "),i=e[0].toUpperCase(),s={};if(e.splice(1).forEach((function(e){if(void 0!==e[0]){let t=e[0].toLowerCase(),n=parseFloat(e.substring(1));s[t]=n}})),"G0"===i||"G1"===i){let e={x:void 0!==s.x?c(n.x,s.x):n.x,y:void 0!==s.y?c(n.y,s.y):n.y,z:void 0!==s.z?c(n.z,s.z):n.z,e:void 0!==s.e?c(n.e,s.e):n.e,f:void 0!==s.f?c(n.f,s.f):n.f};l(n.e,e.e)>0&&(e.extruding=l(n.e,e.e)>0,null!=t&&e.z==t.z||o(e)),u=n,d=e,void 0===t&&o(u),n.extruding?(t.vertex.push(u.x,u.y,u.z),t.vertex.push(d.x,d.y,d.z)):(t.pathVertex.push(u.x,u.y,u.z),t.pathVertex.push(d.x,d.y,d.z)),n=e}else if("G2"===i||"G3"===i);else if("G90"===i)n.relative=!1;else if("G91"===i)n.relative=!0;else if("G92"===i){let e=n;e.x=void 0!==s.x?s.x:e.x,e.y=void 0!==s.y?s.y:e.y,e.z=void 0!==s.z?s.z:e.z,e.e=void 0!==s.e?s.e:e.e,n=e}}var u,d;function p(e,t,n){let i=new r.BufferGeometry;i.setAttribute("position",new r.Float32BufferAttribute(e,3));let o=new r.LineSegments(i,t?a:s);o.name="layer"+n,f.add(o)}const f=new r.Group;if(f.name="gcode",this.splitLayer)for(let r=0;r<i.length;r++){let e=i[r];p(e.vertex,!0,r),p(e.pathVertex,!1,r)}else{const e=[],t=[];for(let n=0;n<i.length;n++){let r=i[n],s=r.vertex,a=r.pathVertex;for(let t=0;t<s.length;t++)e.push(s[t]);for(let e=0;e<a.length;e++)t.push(a[e])}p(e,!0,i.length),p(t,!1,i.length)}return f.quaternion.setFromEuler(new r.Euler(-Math.PI/2,0,0)),f}}t.GCodeLoader=i},20614:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(66552),s=n(65236);class a extends r.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new d(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new b(e)})),this.register((function(e){return new E(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new A(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new p(e)})),this.register((function(e){return new y(e)})),this.register((function(e){return new c(e)})),this.register((function(e){return new _(e)})),this.register((function(e){return new S(e)}))}load(e,t,n,i){const s=this;let a;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:r.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},l=new r.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(function(n){try{s.parse(n,a,(function(n){t(n),s.manager.itemEnd(e)}),o)}catch(r){o(r)}}),n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const a={},o={};if("string"==typeof e)s=JSON.parse(e);else if(e instanceof ArrayBuffer){if(r.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4)))===w){try{a[l.KHR_BINARY_GLTF]=new T(e)}catch(u){return void(i&&i(u))}s=JSON.parse(a[l.KHR_BINARY_GLTF].content)}else s=JSON.parse(r.LoaderUtils.decodeText(new Uint8Array(e)))}else s=e;if(void 0===s.asset||s.asset.version[0]<2)return void(i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const c=new $(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let r=0;r<this.pluginCallbacks.length;r++){const e=this.pluginCallbacks[r](c);o[e.name]=e,a[e.name]=!0}if(s.extensionsUsed)for(let r=0;r<s.extensionsUsed.length;++r){const e=s.extensionsUsed[r],t=s.extensionsRequired||[];switch(e){case l.KHR_MATERIALS_UNLIT:a[e]=new h;break;case l.KHR_DRACO_MESH_COMPRESSION:a[e]=new I(s,this.dracoLoader);break;case l.KHR_TEXTURE_TRANSFORM:a[e]=new B;break;case l.KHR_MESH_QUANTIZATION:a[e]=new R;break;default:t.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}c.setExtensions(a),c.setPlugins(o),c.parse(n,i)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function o(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const l={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class c{constructor(e){this.parser=e,this.name=l.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,a=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let o;const l=new r.Color(16777215);void 0!==a.color&&l.fromArray(a.color);const c=void 0!==a.range?a.range:0;switch(a.type){case"directional":o=new r.DirectionalLight(l),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new r.PointLight(l),o.distance=c;break;case"spot":o=new r.SpotLight(l),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return o.position.set(0,0,0),o.decay=2,X(o,a),void 0!==a.intensity&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||"light_"+e),i=Promise.resolve(o),t.cache.add(n,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class h{constructor(){this.name=l.KHR_MATERIALS_UNLIT}getMaterialType(){return r.MeshBasicMaterial}extendParams(e,t,n){const i=[];e.color=new r.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const t=s.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==s.baseColorTexture&&i.push(n.assignTexture(e,"map",s.baseColorTexture,3001))}return Promise.all(i)}}class u{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class d{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&s.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(s.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){const e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new r.Vector2(e,e)}return Promise.all(s)}}class p{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(i)}}class f{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new r.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=i.extensions[this.name];return void 0!==a.sheenColorFactor&&t.sheenColor.fromArray(a.sheenColorFactor),void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&s.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,3001)),void 0!==a.sheenRoughnessTexture&&s.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(s)}}class m{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(i)}}class g{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&s.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=new r.Color(o[0],o[1],o[2]),Promise.all(s)}}class A{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class v{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&s.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=new r.Color(o[0],o[1],o[2]),void 0!==a.specularColorTexture&&s.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,3001)),Promise.all(s)}}class y{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?r.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.anisotropyStrength&&(t.anisotropy=s.anisotropyStrength),void 0!==s.anisotropyRotation&&(t.anisotropyRotation=s.anisotropyRotation),void 0!==s.anisotropyTexture&&i.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(i)}}class x{constructor(e){this.parser=e,this.name=l.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class b{constructor(e){this.parser=e,this.name=l.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],a=r.images[s.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class E{constructor(e){this.parser=e,this.name=l.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],a=r.images[s.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,s.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class _{constructor(e){this.name=l.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,s=e.count,a=e.byteStride,o=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,a,o,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*a);return i.decodeGltfBuffer(new Uint8Array(t),s,a,o,e.mode,e.filter),t}))}))}return null}}class S{constructor(e){this.name=l.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const i=t.meshes[n.mesh];for(const r of i.primitives)if(r.mode!==F.TRIANGLES&&r.mode!==F.TRIANGLE_STRIP&&r.mode!==F.TRIANGLE_FAN&&void 0!==r.mode)return null;const s=n.extensions[this.name].attributes,a=[],o={};for(const r in s)a.push(this.parser.getDependency("accessor",s[r]).then((e=>(o[r]=e,o[r]))));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const a of n){const e=new r.Matrix4,t=new r.Vector3,n=new r.Quaternion,l=new r.Vector3(1,1,1),c=new r.InstancedMesh(a.geometry,a.material,i);for(let r=0;r<i;r++)o.TRANSLATION&&t.fromBufferAttribute(o.TRANSLATION,r),o.ROTATION&&n.fromBufferAttribute(o.ROTATION,r),o.SCALE&&l.fromBufferAttribute(o.SCALE,r),c.setMatrixAt(r,e.compose(t,n,l));for(const r in o)"TRANSLATION"!==r&&"ROTATION"!==r&&"SCALE"!==r&&a.geometry.setAttribute(r,o[r]);r.Object3D.prototype.copy.call(c,a),this.parser.assignFinalMaterial(c),s.push(c)}return t.isGroup?(t.clear(),t.add(...s),t):s[0]})))}}const w="glTF",M=1313821514,C=5130562;class T{constructor(e){this.name=l.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:r.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==w)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,i=new DataView(e,12);let s=0;for(;s<n;){const t=i.getUint32(s,!0);s+=4;const n=i.getUint32(s,!0);if(s+=4,n===M){const n=new Uint8Array(e,12+s,t);this.content=r.LoaderUtils.decodeText(n)}else if(n===C){const n=12+s;this.body=e.slice(n,n+t)}s+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class I{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=l.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,a={},o={},l={};for(const c in s){const e=G[c]||c.toLowerCase();a[e]=s[c]}for(const c in e.attributes){const t=G[c]||c.toLowerCase();if(void 0!==s[c]){const r=n.accessors[e.attributes[c]],i=U[r.componentType];l[t]=i.name,o[t]=!0===r.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=o[t];void 0!==r&&(n.normalized=r)}t(e)}),a,l)}))}))}}class B{constructor(){this.name=l.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class R{constructor(){this.name=l.KHR_MESH_QUANTIZATION}}class P extends r.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[i+s];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=r-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,A=1-m,v=g-u+h;for(let y=0;y!==a;y++){const e=s[f+y+a],t=s[f+y+o]*c,n=s[p+y+a],r=s[p+y]*c;i[y]=A*e+v*t+m*n+g*r}return i}}const D=new r.Quaternion;class L extends P{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return D.fromArray(i).normalize().toArray(i),i}}const F={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},U={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},O={9728:r.NearestFilter,9729:r.LinearFilter,9984:r.NearestMipmapNearestFilter,9985:r.LinearMipmapNearestFilter,9986:r.NearestMipmapLinearFilter,9987:r.LinearMipmapLinearFilter},N={33071:r.ClampToEdgeWrapping,33648:r.MirroredRepeatWrapping,10497:r.RepeatWrapping},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},G={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...s.version>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Q={CUBICSPLINE:void 0,LINEAR:r.InterpolateLinear,STEP:r.InterpolateDiscrete},V="OPAQUE",H="MASK",j="BLEND";function W(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function X(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Y(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function q(e){let t;const n=e.extensions&&e.extensions[l.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+K(n.attributes):e.indices+":"+K(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,i=e.targets.length;r<i;r++)t+=":"+K(e.targets[r]);return t}function K(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function J(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const Z=new r.Matrix4;class ${constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new o,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(n=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||n||i&&s<98?this.textureLoader=new r.TextureLoader(this.options.manager):this.textureLoader=new r.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new r.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const s={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};W(i,s,r),X(s,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,i=t.length;r<i;r++){const n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let r=0,i=e.length;r<i;r++){const t=e[r];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(n[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[r,s]of e.children.entries())i(s,t.children[r])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne((function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)})),!r)throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[l.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,s){n.load(r.LoaderUtils.resolveURL(t.uri,i.path),e,void 0,(function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){const e=k[i.type],t=U[i.componentType],n=!0===i.normalized,s=new t(i.count*e);return Promise.resolve(new r.BufferAttribute(s,e,n))}const s=[];return void 0!==i.bufferView?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),void 0!==i.sparse&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then((function(e){const s=e[0],a=k[i.type],o=U[i.componentType],l=o.BYTES_PER_ELEMENT,c=l*a,h=i.byteOffset||0,u=void 0!==i.bufferView?n.bufferViews[i.bufferView].byteStride:void 0,d=!0===i.normalized;let p,f;if(u&&u!==c){const e=Math.floor(h/u),n="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let c=t.cache.get(n);c||(p=new o(s,e*u,i.count*u/l),c=new r.InterleavedBuffer(p,u/l),t.cache.add(n,c)),f=new r.InterleavedBufferAttribute(c,a,h%u/l,d)}else p=null===s?new o(i.count*a):new o(s,h,i.count*a),f=new r.BufferAttribute(p,a,d);if(void 0!==i.sparse){const t=k.SCALAR,n=U[i.sparse.indices.componentType],l=i.sparse.indices.byteOffset||0,c=i.sparse.values.byteOffset||0,h=new n(e[1],l,i.sparse.count*t),u=new o(e[2],c,i.sparse.count*a);null!==s&&(f=new r.BufferAttribute(f.array.slice(),f.itemSize,f.normalized));for(let e=0,r=h.length;e<r;e++){const t=h[e];if(f.setX(t,u[e*a]),a>=2&&f.setY(t,u[e*a+1]),a>=3&&f.setZ(t,u[e*a+2]),a>=4&&f.setW(t,u[e*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let s=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){const i=this,s=this.json,a=s.textures[e],o=s.images[t],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const n=(s.samplers||{})[a.sampler]||{};return t.magFilter=O[n.magFilter]||r.LinearFilter,t.minFilter=O[n.minFilter]||r.LinearMipmapLinearFilter,t.wrapS=N[n.wrapS]||r.RepeatWrapping,t.wrapT=N[n.wrapT]||r.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const a=i.images[e],o=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(void 0!==a.bufferView)l=n.getDependency("bufferView",a.bufferView).then((function(e){c=!0;const t=new Blob([e],{type:a.mimeType});return l=o.createObjectURL(t),l}));else if(void 0===a.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then((function(e){return new Promise((function(n,i){let a=n;!0===t.isImageBitmapLoader&&(a=function(e){const t=new r.Texture(e);t.needsUpdate=!0,n(t)}),t.load(r.LoaderUtils.resolveURL(e,s.path),a,void 0,i)}))})).then((function(e){var t;return!0===c&&o.revokeObjectURL(l),e.userData.mimeType=a.mimeType||((t=a.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),e}));return this.sourceCache[e]=h,h}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(s){if(!s)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((s=s.clone()).channel=n.texCoord),i.extensions[l.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[l.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[l.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==r&&("colorSpace"in s?s.colorSpace=3001===r?"srgb":"srgb-linear":s.encoding=r),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new r.PointsMaterial,r.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new r.LineBasicMaterial,r.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(i||s||a){let e="ClonedMaterial:"+n.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),s&&(t.vertexColors=!0),a&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return r.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let a;const o={},c=[];if((s.extensions||{})[l.KHR_MATERIALS_UNLIT]){const e=i[l.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,s,t))}else{const n=s.pbrMetallicRoughness||{};if(o.color=new r.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==n.baseColorTexture&&c.push(t.assignTexture(o,"map",n.baseColorTexture,3001)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(c.push(t.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),c.push(t.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),a=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===s.doubleSided&&(o.side=r.DoubleSide);const h=s.alphaMode||V;if(h===j?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===H&&(o.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&a!==r.MeshBasicMaterial&&(c.push(t.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new r.Vector2(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==s.occlusionTexture&&a!==r.MeshBasicMaterial&&(c.push(t.assignTexture(o,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(o.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&a!==r.MeshBasicMaterial&&(o.emissive=(new r.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&a!==r.MeshBasicMaterial&&c.push(t.assignTexture(o,"emissiveMap",s.emissiveTexture,3001)),Promise.all(c).then((function(){const n=new a(o);return s.name&&(n.name=s.name),X(n,s),t.associations.set(n,{materials:e}),s.extensions&&W(i,n,s),n}))}createUniqueName(e){const t=r.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(e){return n[l.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return ee(n,e,t)}))}const a=[];for(let o=0,c=e.length;o<c;o++){const n=e[o],c=q(n),h=i[c];if(h)a.push(h.promise);else{let e;e=n.extensions&&n.extensions[l.KHR_DRACO_MESH_COMPRESSION]?s(n):ee(new r.BufferGeometry,n,t),i[c]={primitive:n,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,s=this.extensions,a=n.meshes[e],o=a.primitives,l=[];for(let i=0,h=o.length;i<h;i++){const e=void 0===o[i].material?(void 0===(c=this.cache).DefaultMaterial&&(c.DefaultMaterial=new r.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:r.FrontSide})),c.DefaultMaterial):this.getDependency("material",o[i].material);l.push(e)}var c;return l.push(t.loadGeometries(o)),Promise.all(l).then((function(n){const l=n.slice(0,n.length-1),c=n[n.length-1],h=[];for(let d=0,p=c.length;d<p;d++){const n=c[d],u=o[d];let p;const f=l[d];if(u.mode===F.TRIANGLES||u.mode===F.TRIANGLE_STRIP||u.mode===F.TRIANGLE_FAN||void 0===u.mode)p=!0===a.isSkinnedMesh?new r.SkinnedMesh(n,f):new r.Mesh(n,f),!0===p.isSkinnedMesh&&p.normalizeSkinWeights(),u.mode===F.TRIANGLE_STRIP?p.geometry=i.toTrianglesDrawMode(p.geometry,r.TriangleStripDrawMode):u.mode===F.TRIANGLE_FAN&&(p.geometry=i.toTrianglesDrawMode(p.geometry,r.TriangleFanDrawMode));else if(u.mode===F.LINES)p=new r.LineSegments(n,f);else if(u.mode===F.LINE_STRIP)p=new r.Line(n,f);else if(u.mode===F.LINE_LOOP)p=new r.LineLoop(n,f);else{if(u.mode!==F.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);p=new r.Points(n,f)}Object.keys(p.geometry.morphAttributes).length>0&&Y(p,a),p.name=t.createUniqueName(a.name||"mesh_"+e),X(p,a),u.extensions&&W(s,p,u),t.assignFinalMaterial(p),h.push(p)}for(let r=0,i=h.length;r<i;r++)t.associations.set(h[r],{meshes:e,primitives:r});if(1===h.length)return a.extensions&&W(s,h[0],a),h[0];const u=new r.Group;a.extensions&&W(s,u,a),t.associations.set(u,{meshes:e});for(let e=0,t=h.length;e<t;e++)u.add(h[e]);return u}))}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(i)return"perspective"===n.type?t=new r.PerspectiveCamera(r.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(t=new r.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),X(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,i=t.joints.length;r<i;r++)n.push(this._loadNodeShallow(t.joints[r]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then((function(e){const n=e.pop(),i=e,s=[],a=[];for(let o=0,l=i.length;o<l;o++){const e=i[o];if(e){s.push(e);const t=new r.Matrix4;null!==n&&t.fromArray(n.array,16*o),a.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}return new r.Skeleton(s,a)}))}loadAnimation(e){const t=this.json.animations[e],n=t.name?t.name:"animation_"+e,i=[],s=[],a=[],o=[],l=[];for(let r=0,c=t.channels.length;r<c;r++){const e=t.channels[r],n=t.samplers[e.sampler],c=e.target,h=c.node,u=void 0!==t.parameters?t.parameters[n.input]:n.input,d=void 0!==t.parameters?t.parameters[n.output]:n.output;void 0!==c.node&&(i.push(this.getDependency("node",h)),s.push(this.getDependency("accessor",u)),a.push(this.getDependency("accessor",d)),o.push(n),l.push(c))}return Promise.all([Promise.all(i),Promise.all(s),Promise.all(a),Promise.all(o),Promise.all(l)]).then((function(e){const t=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=[];for(let n=0,c=t.length;n<c;n++){const e=t[n],c=i[n],h=s[n],u=a[n],d=o[n];if(void 0===e)continue;let p;switch(e.updateMatrix(),z[d.path]){case z.weights:p=r.NumberKeyframeTrack;break;case z.rotation:p=r.QuaternionKeyframeTrack;break;default:p=r.VectorKeyframeTrack}const f=e.name?e.name:e.uuid,m=void 0!==u.interpolation?Q[u.interpolation]:r.InterpolateLinear,g=[];z[d.path]===z.weights?e.traverse((function(e){e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)})):g.push(f);let A=h.array;if(h.normalized){const e=J(A.constructor),t=new Float32Array(A.length);for(let n=0,r=A.length;n<r;n++)t[n]=A[n]*e;A=t}for(let t=0,n=g.length;t<n;t++){const e=new p(g[t]+"."+z[d.path],c.array,A,m);"CUBICSPLINE"===u.interpolation&&(e.createInterpolant=function(e){return new(this instanceof r.QuaternionKeyframeTrack?L:P)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(e)}}return new r.AnimationClip(n,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this,n=this.json.nodes[e],r=t._loadNodeShallow(e),i=[],s=n.children||[];for(let o=0,l=s.length;o<l;o++)i.push(t.getDependency("node",s[o]));const a=void 0===n.skin?Promise.resolve(null):t.getDependency("skin",n.skin);return Promise.all([r,Promise.all(i),a]).then((function(e){const t=e[0],n=e[1],r=e[2];null!==r&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(r,Z)}));for(let i=0,s=n.length;i<s;i++)t.add(n[i]);return t}))}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const s=t.nodes[e],a=s.name?i.createUniqueName(s.name):"",o=[],l=i._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return l&&o.push(l),void 0!==s.camera&&o.push(i.getDependency("camera",s.camera).then((function(e){return i._getNodeRef(i.cameraCache,s.camera,e)}))),i._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){o.push(e)})),this.nodeCache[e]=Promise.all(o).then((function(t){let o;if(o=!0===s.isBone?new r.Bone:t.length>1?new r.Group:1===t.length?t[0]:new r.Object3D,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(s.name&&(o.userData.name=s.name,o.name=a),X(o,s),s.extensions&&W(n,o,s),void 0!==s.matrix){const e=new r.Matrix4;e.fromArray(s.matrix),o.applyMatrix4(e)}else void 0!==s.translation&&o.position.fromArray(s.translation),void 0!==s.rotation&&o.quaternion.fromArray(s.rotation),void 0!==s.scale&&o.scale.fromArray(s.scale);return i.associations.has(o)||i.associations.set(o,{}),i.associations.get(o).nodes=e,o})),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new r.Group;n.name&&(s.name=i.createUniqueName(n.name)),X(s,n),n.extensions&&W(t,s,n);const a=n.nodes||[],o=[];for(let r=0,l=a.length;r<l;r++)o.push(i.getDependency("node",a[r]));return Promise.all(o).then((function(e){for(let t=0,n=e.length;t<n;t++)s.add(e[t]);return i.associations=(e=>{const t=new Map;for(const[n,s]of i.associations)(n instanceof r.Material||n instanceof r.Texture)&&t.set(n,s);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(s),s}))}}function ee(e,t,n){const i=t.attributes,s=[];function a(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const r in i){const t=G[r]||r.toLowerCase();t in e.attributes||s.push(a(i[r],t))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));s.push(r)}return X(e,t),function(e,t,n){const i=t.attributes,s=new r.Box3;if(void 0===i.POSITION)return;{const e=n.json.accessors[i.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(s.set(new r.Vector3(t[0],t[1],t[2]),new r.Vector3(a[0],a[1],a[2])),e.normalized){const t=J(U[e.componentType]);s.min.multiplyScalar(t),s.max.multiplyScalar(t)}}const a=t.targets;if(void 0!==a){const e=new r.Vector3,t=new r.Vector3;for(let r=0,i=a.length;r<i;r++){const i=a[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],s=r.min,a=r.max;if(void 0!==s&&void 0!==a){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(a[2]))),r.normalized){const e=J(U[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(e)}e.boundingBox=s;const o=new r.Sphere;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(s).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,s=!1;for(let c=0,h=t.length;c<h;c++){const e=t[c];if(void 0!==e.POSITION&&(r=!0),void 0!==e.NORMAL&&(i=!0),void 0!==e.COLOR_0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(e);const a=[],o=[],l=[];for(let c=0,h=t.length;c<h;c++){const h=t[c];if(r){const t=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position;a.push(t)}if(i){const t=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal;o.push(t)}if(s){const t=void 0!==h.COLOR_0?n.getDependency("accessor",h.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then((function(t){const n=t[0],a=t[1],o=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=a),s&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}t.GLTFLoader=a},22996:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(31150);class s extends r.Loader{constructor(e){super(e),this.hdrLoader=new i.RGBELoader,this.type=r.HalfFloatType}load(e,t,n,i){Array.isArray(e)||(console.warn("THREE.HDRCubeTextureLoader signature has changed. Use .setDataType() instead."),this.setDataType(e),e=t,t=n,n=i,i=arguments[4]);const s=new r.CubeTexture;switch(s.type=this.type,s.type){case r.FloatType:case r.HalfFloatType:"colorSpace"in s?s.colorSpace="srgb-linear":s.encoding=3e3,s.minFilter=r.LinearFilter,s.magFilter=r.LinearFilter,s.generateMipmaps=!1}const a=this;let o=0;function l(t,n,i,l){new r.FileLoader(a.manager).setPath(a.path).setResponseType("arraybuffer").setWithCredentials(a.withCredentials).load(e[t],(function(e){o++;const i=a.hdrLoader.parse(e);if(i){if(void 0!==i.data){const e=new r.DataTexture(i.data,i.width,i.height);e.type=s.type,e.encoding=s.encoding,e.format=s.format,e.minFilter=s.minFilter,e.magFilter=s.magFilter,e.generateMipmaps=s.generateMipmaps,s.images[t]=e}6===o&&(s.needsUpdate=!0,n&&n(s))}}),i,l)}for(let r=0;r<e.length;r++)l(r,t,n,i);return s}setDataType(e){return this.type=e,this.hdrLoader.setDataType(e),this}}t.HDRCubeTextureLoader=s},96334:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(16354),s=n(8083);class a extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=new r.LoadingManager;t.setURLModifier((function(e){const t=function(e){for(const t in n)if(t.substr(-e.length)===e)return n[t]}(e);if(t){console.log("Loading",e);const n=new Blob([t.buffer],{type:"application/octet-stream"});return URL.createObjectURL(n)}return e}));const n=s.unzipSync(new Uint8Array(e));if(n["doc.kml"]){const e=(new DOMParser).parseFromString(fflate.strFromU8(n["doc.kml"]),"application/xml").querySelector("Placemark Model Link href");if(e){return new i.ColladaLoader(t).parse(fflate.strFromU8(n[e.textContent]))}}else{console.warn("KMZLoader: Missing doc.kml file.");for(const e in n){if("dae"===e.split(".").pop().toLowerCase()){return new i.ColladaLoader(t).parse(fflate.strFromU8(n[e]))}}}return console.error("KMZLoader: Couldn't find .dae file."),{scene:new r.Group}}}t.KMZLoader=a},8117:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(83088),o=n(29234),l=n(12258),c=n(84951),h=n(79836),u=new WeakMap;let d,p=0;const f=class extends s.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new a.WorkerPool,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new s.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new s.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then((([e,t])=>{const n=f.BasisWorker.toString(),r=["/* constants */","let _EngineFormat = "+JSON.stringify(f.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(f.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(f.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r])),this.transcoderBinary=t,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),p>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),p++}return this.transcoderPending}load(e,t,n,r){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new s.FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{if(u.has(e)){return u.get(e).promise.then(t).catch(r)}this._createTexture(e).then((e=>t?t(e):null)).catch(r)}),n,r)}_createTextureFrom(e,t){const{mipmaps:n,width:r,height:i,format:a,type:l,error:h,dfdTransferFn:u,dfdFlags:d}=e;if("error"===l)return Promise.reject(h);const p=t.layerCount>1?new c.CompressedArrayTexture(n,r,i,t.layerCount,a,s.UnsignedByteType):new s.CompressedTexture(n,r,i,a,s.UnsignedByteType);return p.minFilter=1===n.length?s.LinearFilter:s.LinearMipmapLinearFilter,p.magFilter=s.LinearFilter,p.generateMipmaps=!1,p.needsUpdate=!0,"colorSpace"in p?p.colorSpace=u===o.KHR_DF_TRANSFER_SRGB?"srgb":"srgb-linear":p.encoding=u===o.KHR_DF_TRANSFER_SRGB?3001:3e3,p.premultiplyAlpha=!!(d&o.KHR_DF_FLAG_ALPHA_PREMULTIPLIED),p}async _createTexture(e,t={}){const n=o.read(new Uint8Array(e));if(n.vkFormat!==o.VK_FORMAT_UNDEFINED)return async function(e){const{vkFormat:t,pixelWidth:n,pixelHeight:r,pixelDepth:i}=e;if(void 0===g[t])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");const a=e.levels[0];let c,u;if(e.supercompressionScheme===o.KHR_SUPERCOMPRESSION_NONE)c=a.levelData;else{if(e.supercompressionScheme!==o.KHR_SUPERCOMPRESSION_ZSTD)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");d||(d=new Promise((async e=>{const t=new l.ZSTDDecoder;await t.init(),e(t)}))),c=(await d).decode(a.levelData,a.uncompressedByteLength)}u=A[t]===s.FloatType?new Float32Array(c.buffer,c.byteOffset,c.byteLength/Float32Array.BYTES_PER_ELEMENT):A[t]===s.HalfFloatType?new Uint16Array(c.buffer,c.byteOffset,c.byteLength/Uint16Array.BYTES_PER_ELEMENT):c;const p=0===i?new s.DataTexture(u,n,r):new h.Data3DTexture(u,n,r,i);return p.type=A[t],p.format=g[t],p.encoding=v[t]||3e3,p.needsUpdate=!0,Promise.resolve(p)}(n);const r=t,i=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:r},[e]))).then((e=>this._createTextureFrom(e.data,n)));return u.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),p--,this}};let m=f;i(m,"BasisFormat",{ETC1S:0,UASTC_4x4:1}),i(m,"TranscoderFormat",{ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16}),i(m,"EngineFormat",{RGBAFormat:s.RGBAFormat,RGBA_ASTC_4x4_Format:s.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:s.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:s.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:s.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:s.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:s.RGB_ETC1_Format,RGB_ETC2_Format:s.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:s.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:s.RGB_S3TC_DXT1_Format}),i(m,"BasisWorker",(function(){let e,t,n;const r=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(a){const u=a.data;switch(u.type){case"init":e=u.config,d=u.transcoderBinary,t=new Promise((e=>{n={wasmBinary:d,onRuntimeInitialized:e},BASIS(n)})).then((()=>{n.initializeBasis(),void 0===n.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{width:t,height:a,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g}=function(t){const a=new n.KTX2File(new Uint8Array(t));function u(){a.close(),a.delete()}if(!a.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=a.isUASTC()?s.UASTC_4x4:s.ETC1S,p=a.getWidth(),f=a.getHeight(),m=a.getLayers()||1,g=a.getLevels(),A=a.getHasAlpha(),v=a.getDFDTransferFunc(),y=a.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(t,n,a,h){let u,d;const p=t===s.ETC1S?o:l;for(let r=0;r<p.length;r++){const i=p[r];if(e[i.if]&&(i.basisFormat.includes(t)&&!(h&&i.transcoderFormat.length<2)&&(!i.needsPowerOfTwo||c(n)&&c(a))))return u=i.transcoderFormat[h?1:0],d=i.engineFormat[h?1:0],{transcoderFormat:u,engineFormat:d}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),u=i.RGBA32,d=r.RGBAFormat,{transcoderFormat:u,engineFormat:d}}(d,p,f,A);if(!p||!f||!g)throw u(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!a.startTranscoding())throw u(),new Error("THREE.KTX2Loader: .startTranscoding failed");const E=[];for(let e=0;e<g;e++){const t=[];let n,r;for(let i=0;i<m;i++){const s=a.getImageLevelInfo(e,i,0);n=s.origWidth<4?s.origWidth:s.width,r=s.origHeight<4?s.origHeight:s.height;const o=new Uint8Array(a.getImageTranscodedSizeInBytes(e,i,0,x));if(!a.transcodeImage(o,e,i,0,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");t.push(o)}E.push({data:h(t),width:n,height:r})}return u(),{width:p,height:f,hasAlpha:A,mipmaps:E,format:b,dfdTransferFn:v,dfdFlags:y}}(u.buffer),A=[];for(let e=0;e<p.length;++e)A.push(p[e].data.buffer);self.postMessage({type:"transcode",id:u.id,width:t,height:a,hasAlpha:d,mipmaps:p,format:f,dfdTransferFn:m,dfdFlags:g},A)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const a=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[r.RGBA_ASTC_4x4_Format,r.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[r.RGBA_BPTC_Format,r.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[r.RGB_S3TC_DXT1_Format,r.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[r.RGB_ETC2_Format,r.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[r.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[r.RGB_PVRTC_4BPPV1_Format,r.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],o=a.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=a.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||0==(e&e-1)&&0!==e}function h(e){let t=0;for(let i=0;i<e.length;i++){t+=e[i].byteLength}const n=new Uint8Array(t);let r=0;for(let i=0;i<e.length;i++){const t=e[i];n.set(t,r),r+=t.byteLength}return n}}));const g={[o.VK_FORMAT_R32G32B32A32_SFLOAT]:s.RGBAFormat,[o.VK_FORMAT_R16G16B16A16_SFLOAT]:s.RGBAFormat,[o.VK_FORMAT_R8G8B8A8_UNORM]:s.RGBAFormat,[o.VK_FORMAT_R8G8B8A8_SRGB]:s.RGBAFormat,[o.VK_FORMAT_R32G32_SFLOAT]:s.RGFormat,[o.VK_FORMAT_R16G16_SFLOAT]:s.RGFormat,[o.VK_FORMAT_R8G8_UNORM]:s.RGFormat,[o.VK_FORMAT_R8G8_SRGB]:s.RGFormat,[o.VK_FORMAT_R32_SFLOAT]:s.RedFormat,[o.VK_FORMAT_R16_SFLOAT]:s.RedFormat,[o.VK_FORMAT_R8_SRGB]:s.RedFormat,[o.VK_FORMAT_R8_UNORM]:s.RedFormat},A={[o.VK_FORMAT_R32G32B32A32_SFLOAT]:s.FloatType,[o.VK_FORMAT_R16G16B16A16_SFLOAT]:s.HalfFloatType,[o.VK_FORMAT_R8G8B8A8_UNORM]:s.UnsignedByteType,[o.VK_FORMAT_R8G8B8A8_SRGB]:s.UnsignedByteType,[o.VK_FORMAT_R32G32_SFLOAT]:s.FloatType,[o.VK_FORMAT_R16G16_SFLOAT]:s.HalfFloatType,[o.VK_FORMAT_R8G8_UNORM]:s.UnsignedByteType,[o.VK_FORMAT_R8G8_SRGB]:s.UnsignedByteType,[o.VK_FORMAT_R32_SFLOAT]:s.FloatType,[o.VK_FORMAT_R16_SFLOAT]:s.HalfFloatType,[o.VK_FORMAT_R8_SRGB]:s.UnsignedByteType,[o.VK_FORMAT_R8_UNORM]:s.UnsignedByteType},v={[o.VK_FORMAT_R8G8B8A8_SRGB]:3001,[o.VK_FORMAT_R8G8_SRGB]:3001,[o.VK_FORMAT_R8_SRGB]:3001};t.KTX2Loader=m},6258:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const n=new s(e,1);return{mipmaps:n.mipmaps(t),width:n.pixelWidth,height:n.pixelHeight,format:n.glInternalFormat,isCubemap:6===n.numberOfFaces,mipmapCount:n.numberOfMipmapLevels}}}class s{constructor(e,t){this.arrayBuffer=e;const n=new Uint8Array(this.arrayBuffer,0,12);if(171!==n[0]||75!==n[1]||84!==n[2]||88!==n[3]||32!==n[4]||49!==n[5]||49!==n[6]||187!==n[7]||13!==n[8]||10!==n[9]||26!==n[10]||10!==n[11])return void console.error("texture missing KTX identifier");const r=Uint32Array.BYTES_PER_ELEMENT,i=new DataView(this.arrayBuffer,12,13*r),s=67305985===i.getUint32(0,!0);this.glType=i.getUint32(1*r,s),this.glTypeSize=i.getUint32(2*r,s),this.glFormat=i.getUint32(3*r,s),this.glInternalFormat=i.getUint32(4*r,s),this.glBaseInternalFormat=i.getUint32(5*r,s),this.pixelWidth=i.getUint32(6*r,s),this.pixelHeight=i.getUint32(7*r,s),this.pixelDepth=i.getUint32(8*r,s),this.numberOfArrayElements=i.getUint32(9*r,s),this.numberOfFaces=i.getUint32(10*r,s),this.numberOfMipmapLevels=i.getUint32(11*r,s),this.bytesOfKeyValueData=i.getUint32(12*r,s),0===this.glType?(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===t?this.loadType=0:console.warn("number of faces expected"+t+", but found "+this.numberOfFaces):console.warn("texture arrays not currently supported"):console.warn("only 2D textures currently supported")):console.warn("only compressed formats currently supported")}mipmaps(e){const t=[];let n=64+this.bytesOfKeyValueData,r=this.pixelWidth,i=this.pixelHeight;const s=e?this.numberOfMipmapLevels:1;for(let a=0;a<s;a++){const e=new Int32Array(this.arrayBuffer,n,1)[0];n+=4;for(let s=0;s<this.numberOfFaces;s++){const s=new Uint8Array(this.arrayBuffer,n,e);t.push({data:s,width:r,height:i}),n+=e,n+=3-(e+3)%4}r=Math.max(1,.5*r),i=Math.max(1,.5*i)}return t}}t.KTXLoader=i},23940:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i="16",s="24",a=new r.Vector3,o=new r.Vector3;class l extends r.ShaderMaterial{constructor(e){super({uniforms:r.UniformsUtils.merge([r.UniformsLib.fog,{diffuse:{value:new r.Color},opacity:{value:1}}]),vertexShader:"\n attribute vec3 control0;\n attribute vec3 control1;\n attribute vec3 direction;\n varying float discardFlag;\n\n #include <common>\n #include <color_pars_vertex>\n #include <fog_pars_vertex>\n #include <logdepthbuf_pars_vertex>\n #include <clipping_planes_pars_vertex>\n\n void main() {\n #include <color_vertex>\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n // Transform the line segment ends and control points into camera clip space\n vec4 c0 = projectionMatrix * modelViewMatrix * vec4(control0, 1.0);\n vec4 c1 = projectionMatrix * modelViewMatrix * vec4(control1, 1.0);\n vec4 p0 = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n vec4 p1 = projectionMatrix * modelViewMatrix * vec4(position + direction, 1.0);\n\n c0.xy /= c0.w;\n c1.xy /= c1.w;\n p0.xy /= p0.w;\n p1.xy /= p1.w;\n\n // Get the direction of the segment and an orthogonal vector\n vec2 dir = p1.xy - p0.xy;\n vec2 norm = vec2(-dir.y, dir.x);\n\n // Get control point directions from the line\n vec2 c0dir = c0.xy - p1.xy;\n vec2 c1dir = c1.xy - p1.xy;\n\n // If the vectors to the controls points are pointed in different directions away\n // from the line segment then the line should not be drawn.\n float d0 = dot(normalize(norm), normalize(c0dir));\n float d1 = dot(normalize(norm), normalize(c1dir));\n discardFlag = float(sign(d0) != sign(d1));\n\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n }\n ",fragmentShader:`\n uniform vec3 diffuse;\n uniform float opacity;\n varying float discardFlag;\n\n #include <common>\n #include <color_pars_fragment>\n #include <fog_pars_fragment>\n #include <logdepthbuf_pars_fragment>\n #include <clipping_planes_pars_fragment>\n\n void main() {\n if (discardFlag > 0.5) discard;\n\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3(0.0);\n vec4 diffuseColor = vec4(diffuse, opacity);\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb; // simple shader\n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include <tonemapping_fragment>\n #include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n }\n `}),Object.defineProperties(this,{opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},color:{get:function(){return this.uniforms.diffuse.value}}}),this.setValues(e),this.isLDrawConditionalLineMaterial=!0}}class c extends r.LineSegments{constructor(e,t){super(e,t),this.isConditionalLine=!0}}const h=new r.Ray;function u(e){return"Part"===e||"Unofficial_Part"===e}class d{constructor(e,t){this.line=e,this.lineLength=e.length,this.currentCharIndex=0,this.currentChar=" ",this.lineNumber=t}seekNonSpace(){for(;this.currentCharIndex<this.lineLength;){if(this.currentChar=this.line.charAt(this.currentCharIndex)," "!==this.currentChar&&"\t"!==this.currentChar)return;this.currentCharIndex++}}getToken(){const e=this.currentCharIndex++;for(;this.currentCharIndex<this.lineLength&&(this.currentChar=this.line.charAt(this.currentCharIndex)," "!==this.currentChar&&"\t"!==this.currentChar);)this.currentCharIndex++;const t=this.currentCharIndex;return this.seekNonSpace(),this.line.substring(e,t)}getVector(){return new r.Vector3(parseFloat(this.getToken()),parseFloat(this.getToken()),parseFloat(this.getToken()))}getRemainingString(){return this.line.substring(this.currentCharIndex,this.lineLength)}isAtTheEnd(){return this.currentCharIndex>=this.lineLength}setToEnd(){this.currentCharIndex=this.lineLength}getLineNumberString(){return this.lineNumber>=0?" at line "+this.lineNumber:""}}class p{constructor(e){this.loader=e,this._cache={}}cloneResult(e){const t={};return t.faces=e.faces.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone())),normals:e.normals.map((()=>null)),faceNormal:null}))),t.conditionalSegments=e.conditionalSegments.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone())),controlPoints:e.controlPoints.map((e=>e.clone()))}))),t.lineSegments=e.lineSegments.map((e=>({colorCode:e.colorCode,material:e.material,vertices:e.vertices.map((e=>e.clone()))}))),t.type=e.type,t.category=e.category,t.keywords=e.keywords,t.subobjects=e.subobjects,t.totalFaces=e.totalFaces,t.startingConstructionStep=e.startingConstructionStep,t.materials=e.materials,t.group=null,t}async fetchData(e){let t=!1,n=0;for(;6!==n;){let s=e;switch(n){case 0:n+=1;break;case 1:s="parts/"+s,n+=1;break;case 2:s="p/"+s,n+=1;break;case 3:s="models/"+s,n+=1;break;case 4:s=e.substring(0,e.lastIndexOf("/")+1)+s,n+=1;break;case 5:t?n=6:(s=e=e.toLowerCase(),t=!0,n=0)}const a=this.loader,o=new r.FileLoader(a.manager);o.setPath(a.partsLibraryPath),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials);try{return await o.loadAsync(s)}catch(i){continue}}throw new Error('LDrawLoader: Subobject "'+e+'" could not be loaded.')}parse(e,t=null){const n=this.loader,i=[],s=[],a=[],o=[],l={},c=e=>l[e]||null;let h="Model",u=null,p=null,f=0;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n"));const m=e.split("\n"),g=m.length;let A=!1,v=null,y=null,x=!1,b=!0,E=!1,_=!0,S=!1;for(let w=0;w<g;w++){const e=m[w];if(0===e.length)continue;if(A){e.startsWith("0 FILE ")?(this.setData(v,y),v=e.substring(7),y=""):y+=e+"\n";continue}const t=new d(e,w+1);if(t.seekNonSpace(),t.isAtTheEnd())continue;const g=t.getToken();let M,C,T,I,B,R,P,D,L,F,U;switch(g){case"0":const e=t.getToken();if(e)switch(e){case"!LDRAW_ORG":h=t.getToken();break;case"!COLOUR":M=n.parseColorMetaDirective(t),M?l[M.userData.code]=M:console.warn("LDrawLoader: Error parsing material"+t.getLineNumberString());break;case"!CATEGORY":u=t.getToken();break;case"!KEYWORDS":const e=t.getRemainingString().split(",");e.length>0&&(p||(p=[]),e.forEach((function(e){p.push(e.trim())})));break;case"FILE":w>0&&(A=!0,v=t.getRemainingString(),y="",x=!1,b=!0);break;case"BFC":for(;!t.isAtTheEnd();){const e=t.getToken();switch(e){case"CERTIFY":case"NOCERTIFY":x="CERTIFY"===e,b=!0;break;case"CW":case"CCW":b="CCW"===e;break;case"INVERTNEXT":E=!0;break;case"CLIP":case"NOCLIP":_="CLIP"===e;break;default:console.warn('THREE.LDrawLoader: BFC directive "'+e+'" is unknown.')}}break;case"STEP":S=!0}break;case"1":C=t.getToken(),M=c(C);const d=parseFloat(t.getToken()),m=parseFloat(t.getToken()),O=parseFloat(t.getToken()),N=parseFloat(t.getToken()),k=parseFloat(t.getToken()),G=parseFloat(t.getToken()),z=parseFloat(t.getToken()),Q=parseFloat(t.getToken()),V=parseFloat(t.getToken()),H=parseFloat(t.getToken()),j=parseFloat(t.getToken()),W=parseFloat(t.getToken()),X=(new r.Matrix4).set(N,k,G,d,z,Q,V,m,H,j,W,O,0,0,0,1);let Y=t.getRemainingString().trim().replace(/\\/g,"/");n.fileMap[Y]?Y=n.fileMap[Y]:Y.startsWith("s/")?Y="parts/"+Y:Y.startsWith("48/")&&(Y="p/"+Y),o.push({material:M,colorCode:C,matrix:X,fileName:Y,inverted:E,startingConstructionStep:S}),E=!1;break;case"2":C=t.getToken(),M=c(C),R=t.getVector(),P=t.getVector(),T={material:M,colorCode:C,vertices:[R,P]},s.push(T);break;case"5":C=t.getToken(),M=c(C),R=t.getVector(),P=t.getVector(),F=t.getVector(),U=t.getVector(),T={material:M,colorCode:C,vertices:[R,P],controlPoints:[F,U]},a.push(T);break;case"3":C=t.getToken(),M=c(C),I=b,B=!x||!_,!0===I?(R=t.getVector(),P=t.getVector(),D=t.getVector()):(D=t.getVector(),P=t.getVector(),R=t.getVector()),i.push({material:M,colorCode:C,faceNormal:null,vertices:[R,P,D],normals:[null,null,null]}),f++,!0===B&&(i.push({material:M,colorCode:C,faceNormal:null,vertices:[D,P,R],normals:[null,null,null]}),f++);break;case"4":C=t.getToken(),M=c(C),I=b,B=!x||!_,!0===I?(R=t.getVector(),P=t.getVector(),D=t.getVector(),L=t.getVector()):(L=t.getVector(),D=t.getVector(),P=t.getVector(),R=t.getVector()),i.push({material:M,colorCode:C,faceNormal:null,vertices:[R,P,D,L],normals:[null,null,null,null]}),f+=2,!0===B&&(i.push({material:M,colorCode:C,faceNormal:null,vertices:[L,D,P,R],normals:[null,null,null,null]}),f+=2);break;default:throw new Error('LDrawLoader: Unknown line type "'+g+'"'+t.getLineNumberString()+".")}}return A&&this.setData(v,y),{faces:i,conditionalSegments:a,lineSegments:s,type:h,category:u,keywords:p,subobjects:o,totalFaces:f,startingConstructionStep:S,materials:l,fileName:t,group:null}}getData(e,t=!0){const n=e.toLowerCase(),r=this._cache[n];return null===r||r instanceof Promise?null:t?this.cloneResult(r):r}async ensureDataLoaded(e){const t=e.toLowerCase();t in this._cache||(this._cache[t]=this.fetchData(e).then((n=>{const r=this.parse(n,e);return this._cache[t]=r,r}))),await this._cache[t]}setData(e,t){const n=e.toLowerCase();this._cache[n]=this.parse(t,e)}}function f(e,t,n,r){return(!r&&e===i||r&&e===s)&&(e=t),n[e]||null}class m{constructor(e){this.loader=e,this.parseCache=new p(e),this._cache={}}async processIntoMesh(e){const t=this.loader,n=this.parseCache,l=new Set,c=async(e,a=null)=>{const o=e.subobjects,h=[];for(let t=0,r=o.length;t<r;t++){const e=o[t],r=n.ensureDataLoaded(e.fileName).then((()=>{const t=n.getData(e.fileName,!1);return r=t.type,/primitive/i.test(r)||"Subpart"===r?c(n.getData(e.fileName),e):this.loadModel(e.fileName).catch((e=>(console.warn(e),null)));var r}));h.push(r)}const u=new r.Group;u.userData.category=e.category,u.userData.keywords=e.keywords,e.group=u;const d=await Promise.all(h);for(let n=0,r=d.length;n<r;n++){const r=e.subobjects[n],a=d[n];if(null===a)continue;if(a.isGroup){const n=a;r.matrix.decompose(n.position,n.quaternion,n.scale),n.userData.startingConstructionStep=r.startingConstructionStep,n.name=r.fileName,t.applyMaterialsToMesh(n,r.colorCode,e.materials),u.add(n);continue}a.group.children.length&&u.add(a.group);const o=e.lineSegments,c=e.conditionalSegments,h=e.faces,p=a.lineSegments,m=a.conditionalSegments,g=a.faces,A=r.matrix,v=r.inverted,y=A.determinant()<0,x=r.colorCode,b=x===i?s:x;for(let t=0,n=p.length;t<n;t++){const n=p[t],r=n.vertices;r[0].applyMatrix4(A),r[1].applyMatrix4(A),n.colorCode=n.colorCode===s?b:n.colorCode,n.material=n.material||f(n.colorCode,n.colorCode,e.materials,!0),o.push(n)}for(let t=0,n=m.length;t<n;t++){const n=m[t],r=n.vertices,i=n.controlPoints;r[0].applyMatrix4(A),r[1].applyMatrix4(A),i[0].applyMatrix4(A),i[1].applyMatrix4(A),n.colorCode=n.colorCode===s?b:n.colorCode,n.material=n.material||f(n.colorCode,n.colorCode,e.materials,!0),c.push(n)}for(let t=0,n=g.length;t<n;t++){const n=g[t],r=n.vertices;for(let e=0,t=r.length;e<t;e++)r[e].applyMatrix4(A);n.colorCode=n.colorCode===i?x:n.colorCode,n.material=n.material||f(n.colorCode,x,e.materials,!1),l.add(n.colorCode),y!==v&&r.reverse(),h.push(n)}e.totalFaces+=a.totalFaces}return a&&t.applyMaterialsToMesh(u,a.colorCode,e.materials),e};for(let r=0,i=e.faces;r<i;r++)l.add(e.faces[r].colorCode);if(await c(e),t.smoothNormals){const t=l.size>1;!function(e){for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.vertices,s=i[0],l=i[1],c=i[2];a.subVectors(l,s),o.subVectors(c,l),n.faceNormal=(new r.Vector3).crossVectors(a,o).normalize()}}(e.faces),function(e,t,n=!1){const i=100*(1+1e-10);function s(e){return`${~~(e.x*i)},${~~(e.y*i)},${~~(e.z*i)}`}function a(e,t){return`${s(e)}_${s(t)}`}function o(e,t,n){n.direction.subVectors(t,e).normalize();const r=e.dot(n.direction);return n.origin.copy(e).addScaledVector(n.direction,-r),n}function l(e){return a(e.origin,e.direction)}const c=new Set,u=new Map,d={},p=[];for(let h=0,f=t.length;h<f;h++){const e=t[h].vertices,i=e[0],s=e[1];if(c.add(a(i,s)),c.add(a(s,i)),n){const e=o(i,s,new r.Ray),t=l(e);if(!u.has(t)){o(s,i,e);const n=l(e),r={ray:e,distances:[]};u.set(t,r),u.set(n,r)}const n=u.get(t);let a=n.ray.direction.dot(i),c=n.ray.direction.dot(s);a>c&&([a,c]=[c,a]),n.distances.push(a,c)}}for(let r=0,f=e.length;r<f;r++){const t=e[r],i=t.vertices,s=i.length;for(let e=0;e<s;e++){const r=e,p=(e+1)%s,f=i[r],m=i[p],g=a(f,m);if(c.has(g))continue;if(n){o(f,m,h);const e=l(h);if(u.has(e)){const t=u.get(e),{ray:n,distances:r}=t;let i=n.direction.dot(f),s=n.direction.dot(m);i>s&&([i,s]=[s,i]);let a=!1;for(let e=0,o=r.length;e<o;e+=2)if(i>=r[e]&&s<=r[e+1]){a=!0;break}if(a)continue}}const A={index:r,tri:t};d[g]=A}}for(;;){let e=null;for(const n in d){e=d[n];break}if(null===e)break;const t=[e];for(;t.length>0;){const e=t.pop().tri,n=e.vertices,i=e.normals,s=e.faceNormal,o=n.length;for(let l=0;l<o;l++){const c=l,h=(l+1)%o,u=n[c],f=n[h];delete d[a(u,f)];const m=a(f,u),g=d[m];if(g){const n=g.tri,a=g.index,o=n.normals,l=o.length,u=n.faceNormal;if(Math.abs(n.faceNormal.dot(e.faceNormal))<.25)continue;m in d&&(t.push(g),delete d[m]);const f=(a+1)%l;i[c]&&o[f]&&i[c]!==o[f]&&(o[f].norm.add(i[c].norm),i[c].norm=o[f].norm);let A=i[c]||o[f];null===A&&(A={norm:new r.Vector3},p.push(A.norm)),null===i[c]&&(i[c]=A,A.norm.add(s)),null===o[f]&&(o[f]=A,A.norm.add(u)),i[h]&&o[a]&&i[h]!==o[a]&&(o[a].norm.add(i[h].norm),i[h].norm=o[a].norm);let v=i[h]||o[a];null===v&&(v={norm:new r.Vector3},p.push(v.norm)),null===i[h]&&(i[h]=v,v.norm.add(s)),null===o[a]&&(o[a]=v,v.norm.add(u))}}}}for(let r=0,h=p.length;r<h;r++)p[r].normalize()}(e.faces,e.lineSegments,t)}const u=e.group;return e.faces.length>0&&u.add(A(e.faces,3,!1,e.totalFaces)),e.lineSegments.length>0&&u.add(A(e.lineSegments,2)),e.conditionalSegments.length>0&&u.add(A(e.conditionalSegments,2,!0)),u}hasCachedModel(e){return null!==e&&e.toLowerCase()in this._cache}async getCachedModel(e){if(null!==e&&this.hasCachedModel(e)){const t=e.toLowerCase();return(await this._cache[t]).clone()}return null}async loadModel(e){const t=this.parseCache,n=e.toLowerCase();if(this.hasCachedModel(e))return this.getCachedModel(e);{await t.ensureDataLoaded(e);const r=t.getData(e),i=this.processIntoMesh(r);if(this.hasCachedModel(e))return this.getCachedModel(e);u(r.type)&&(this._cache[n]=i);return(await i).clone()}}async parseModel(e){const t=this.parseCache.parse(e);return u(t.type)&&this.hasCachedModel(t.fileName)?this.getCachedModel(t.fileName):this.processIntoMesh(t)}}function g(e,t){return e.colorCode===t.colorCode?0:e.colorCode<t.colorCode?-1:1}function A(e,t,n=!1,i=null){e.sort(g),null===i&&(i=e.length);const s=new Float32Array(t*i*3),l=3===t?new Float32Array(t*i*3):null,h=[],u=new Array(6),d=new r.BufferGeometry;let p=null,f=0,m=0,A=0;for(let c=0,g=e.length;c<g;c++){const i=e[c];let g=i.vertices;4===g.length&&(u[0]=g[0],u[1]=g[1],u[2]=g[2],u[3]=g[0],u[4]=g[2],u[5]=g[3],g=u);for(let e=0,t=g.length;e<t;e++){const t=g[e],n=A+3*e;s[n+0]=t.x,s[n+1]=t.y,s[n+2]=t.z}if(3===t){if(!i.faceNormal){const e=g[0],t=g[1],n=g[2];a.subVectors(t,e),o.subVectors(n,t),i.faceNormal=(new r.Vector3).crossVectors(a,o).normalize()}let e=i.normals;4===e.length&&(u[0]=e[0],u[1]=e[1],u[2]=e[2],u[3]=e[0],u[4]=e[2],u[5]=e[3],e=u);for(let t=0,n=e.length;t<n;t++){let n=i.faceNormal;e[t]&&(n=e[t].norm);const r=A+3*t;l[r+0]=n.x,l[r+1]=n.y,l[r+2]=n.z}}if(p!==i.colorCode){null!==p&&d.addGroup(f,m,h.length-1);const e=i.material;null!==e?3===t?h.push(e):2===t&&(null!==e?n?h.push(e.userData.edgeMaterial.userData.conditionalEdgeMaterial):h.push(e.userData.edgeMaterial):h.push(null)):h.push(i.colorCode),p=i.colorCode,f=A/3,m=g.length}else m+=g.length;A+=3*g.length}m>0&&d.addGroup(f,1/0,h.length-1),d.setAttribute("position",new r.BufferAttribute(s,3)),null!==l&&d.setAttribute("normal",new r.BufferAttribute(l,3));let v=null;if(2===t?v=n?new c(d,1===h.length?h[0]:h):new r.LineSegments(d,1===h.length?h[0]:h):3===t&&(v=new r.Mesh(d,1===h.length?h[0]:h)),n){v.isConditionalLine=!0;const t=new Float32Array(3*e.length*2),n=new Float32Array(3*e.length*2),i=new Float32Array(3*e.length*2);for(let r=0,s=e.length;r<s;r++){const s=e[r],a=s.vertices,o=s.controlPoints,l=o[0],c=o[1],h=a[0],u=a[1],d=3*r*2;t[d+0]=l.x,t[d+1]=l.y,t[d+2]=l.z,t[d+3]=l.x,t[d+4]=l.y,t[d+5]=l.z,n[d+0]=c.x,n[d+1]=c.y,n[d+2]=c.z,n[d+3]=c.x,n[d+4]=c.y,n[d+5]=c.z,i[d+0]=u.x-h.x,i[d+1]=u.y-h.y,i[d+2]=u.z-h.z,i[d+3]=u.x-h.x,i[d+4]=u.y-h.y,i[d+5]=u.z-h.z}d.setAttribute("control0",new r.BufferAttribute(t,3,!1)),d.setAttribute("control1",new r.BufferAttribute(n,3,!1)),d.setAttribute("direction",new r.BufferAttribute(i,3,!1))}return v}class v extends r.Loader{constructor(e){super(e),this.materials=[],this.materialLibrary={},this.partsCache=new m(this),this.fileMap={},this.setMaterials([]),this.smoothNormals=!0,this.partsLibraryPath=""}setPartsLibraryPath(e){return this.partsLibraryPath=e,this}async preloadMaterials(e){const t=new r.FileLoader(this.manager);t.setPath(this.path),t.setRequestHeader(this.requestHeader),t.setWithCredentials(this.withCredentials);const n=/^0 !COLOUR/,i=(await t.loadAsync(e)).split(/[\n\r]/g),s=[];for(let r=0,a=i.length;r<a;r++){const e=i[r];if(n.test(e)){const t=e.replace(n,""),r=this.parseColorMetaDirective(new d(t));s.push(r)}}this.setMaterials(s)}load(e,t,n,s){const a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{this.partsCache.parseModel(e,this.materialLibrary).then((e=>{this.applyMaterialsToMesh(e,i,this.materialLibrary,!0),this.computeConstructionSteps(e),t(e)})).catch(s)}),n,s)}parse(e,t){this.partsCache.parseModel(e,this.materialLibrary).then((e=>{this.computeConstructionSteps(e),t(e)}))}setMaterials(e){this.materialLibrary={},this.materials=[];for(let t=0,n=e.length;t<n;t++)this.addMaterial(e[t]);return this.addMaterial(this.parseColorMetaDirective(new d("Main_Colour CODE 16 VALUE #FF8080 EDGE #333333"))),this.addMaterial(this.parseColorMetaDirective(new d("Edge_Colour CODE 24 VALUE #A0A0A0 EDGE #333333"))),this}setFileMap(e){return this.fileMap=e,this}addMaterial(e){const t=this.materialLibrary;return t[e.userData.code]||(this.materials.push(e),t[e.userData.code]=e),this}getMaterial(e){if(e.startsWith("0x2")){const t=e.substring(3);return this.parseColorMetaDirective(new d("Direct_Color_"+t+" CODE -1 VALUE #"+t+" EDGE #"+t))}return this.materialLibrary[e]||null}applyMaterialsToMesh(e,t,n,r=!1){const a=this,o=t===i;function l(e,l){if(o&&!(l in n)&&!r)return l;const c=e.isLineSegments||e.isConditionalLine;(!c&&l===i||c&&l===s)&&(l=t);let h=null;if(l in n)h=n[l];else{if(!r)return l;if(h=a.getMaterial(l),null===h)throw new Error(`LDrawLoader: Material properties for code ${l} not available.`)}return e.isLineSegments&&(h=h.userData.edgeMaterial,e.isConditionalLine&&(h=h.userData.conditionalEdgeMaterial)),h}e.traverse((e=>{if(e.isMesh||e.isLineSegments)if(Array.isArray(e.material))for(let t=0,n=e.material.length;t<n;t++)e.material[t].isMaterial||(e.material[t]=l(e,e.material[t]));else e.material.isMaterial||(e.material=l(e,e.material))}))}getMainMaterial(){return this.getMaterial(i)}getMainEdgeMaterial(){return this.getMaterial(s)}parseColorMetaDirective(e){let t=null,n=16711935,i=16711935,s=1,a=!1,o=0,c=0,h=null;const u=e.getToken();if(!u)throw new Error('LDrawLoader: Material name was expected after "!COLOUR tag'+e.getLineNumberString()+".");let p=null;for(;p=e.getToken(),p;)switch(p.toUpperCase()){case"CODE":t=e.getToken();break;case"VALUE":if(n=e.getToken(),n.startsWith("0x"))n="#"+n.substring(2);else if(!n.startsWith("#"))throw new Error("LDrawLoader: Invalid color while parsing material"+e.getLineNumberString()+".");break;case"EDGE":if(i=e.getToken(),i.startsWith("0x"))i="#"+i.substring(2);else if(!i.startsWith("#")){if(h=this.getMaterial(i),!h)throw new Error("LDrawLoader: Invalid edge color while parsing material"+e.getLineNumberString()+".");h=h.userData.edgeMaterial}break;case"ALPHA":if(s=parseInt(e.getToken()),isNaN(s))throw new Error("LDrawLoader: Invalid alpha value in material definition"+e.getLineNumberString()+".");s=Math.max(0,Math.min(1,s/255)),s<1&&(a=!0);break;case"LUMINANCE":if(o=parseInt(e.getToken()),isNaN(o))throw new Error("LDrawLoader: Invalid luminance value in material definition"+d.getLineNumberString()+".");o=Math.max(0,Math.min(1,o/255));break;case"CHROME":c=1;break;case"PEARLESCENT":c=2;break;case"RUBBER":c=3;break;case"MATTE_METALLIC":c=4;break;case"METAL":c=5;break;case"MATERIAL":e.setToEnd();break;default:throw new Error('LDrawLoader: Unknown token "'+p+'" while parsing material'+e.getLineNumberString()+".")}let f=null;switch(c){case 0:f=new r.MeshStandardMaterial({color:n,roughness:.3,metalness:0});break;case 2:f=new r.MeshStandardMaterial({color:n,roughness:.3,metalness:.25});break;case 1:f=new r.MeshStandardMaterial({color:n,roughness:0,metalness:1});break;case 3:f=new r.MeshStandardMaterial({color:n,roughness:.9,metalness:0});break;case 4:f=new r.MeshStandardMaterial({color:n,roughness:.8,metalness:.4});break;case 5:f=new r.MeshStandardMaterial({color:n,roughness:.2,metalness:.85})}return f.transparent=a,f.premultipliedAlpha=!0,f.opacity=s,f.depthWrite=!a,f.polygonOffset=!0,f.polygonOffsetFactor=1,0!==o&&f.emissive.set(f.color).multiplyScalar(o),h||(h=new r.LineBasicMaterial({color:i,transparent:a,opacity:s,depthWrite:!a}),h.userData.code=t,h.name=u+" - Edge",h.userData.conditionalEdgeMaterial=new l({fog:!0,transparent:a,depthWrite:!a,color:i,opacity:s})),f.userData.code=t,f.name=u,f.userData.edgeMaterial=h,this.addMaterial(f),f}computeConstructionSteps(e){let t=0;e.traverse((e=>{e.isGroup&&(e.userData.startingConstructionStep&&t++,e.userData.constructionStep=t)})),e.userData.numConstructionSteps=t+1}}t.LDrawLoader=v},7472:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(79836);class s extends r.Loader{load(e,t,n,i){const s=new r.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("text"),s.load(e,(n=>{try{t(this.parse(n))}catch(r){i?i(r):console.error(r),this.manager.itemError(e)}}),n,i)}parse(e){const t=(e=e.replace(/^#.*?(\n|\r)/gm,"").replace(/^\s*?(\n|\r)/gm,"").trim()).split(/[\n\r]+/g),n=t[0].trim().split(/\s+/g).map((e=>parseFloat(e))),s=n[1]-n[0],a=n.length;for(let r=1,i=n.length;r<i;r++)if(s!==n[r]-n[r-1])throw new Error("LUT3dlLoader: Inconsistent grid size not supported.");const o=new Array(a*a*a*4);let l=0,c=0;for(let r=1,i=t.length;r<i;r++){const e=t[r].trim().split(/\s/g),n=parseFloat(e[0]),i=parseFloat(e[1]),s=parseFloat(e[2]);c=Math.max(c,n,i,s);const h=l%a*a*a+Math.floor(l/a)%a*a+Math.floor(l/(a*a))%a;o[4*h+0]=n,o[4*h+1]=i,o[4*h+2]=s,o[4*h+3]=1,l+=1}const h=Math.ceil(Math.log2(c)),u=Math.pow(2,h);for(let r=0,i=o.length;r<i;r+=4){const e=o[r+0],t=o[r+1],n=o[r+2];o[r+0]=255*e/u,o[r+1]=255*t/u,o[r+2]=255*n/u}const d=new Uint8Array(o),p=new r.DataTexture;p.image.data=d,p.image.width=a,p.image.height=a*a,p.format=r.RGBAFormat,p.type=r.UnsignedByteType,p.magFilter=r.LinearFilter,p.minFilter=r.LinearFilter,p.wrapS=r.ClampToEdgeWrapping,p.wrapT=r.ClampToEdgeWrapping,p.generateMipmaps=!1,p.needsUpdate=!0;const f=new i.Data3DTexture;return f.image.data=d,f.image.width=a,f.image.height=a,f.image.depth=a,f.format=r.RGBAFormat,f.type=r.UnsignedByteType,f.magFilter=r.LinearFilter,f.minFilter=r.LinearFilter,f.wrapS=r.ClampToEdgeWrapping,f.wrapT=r.ClampToEdgeWrapping,f.wrapR=r.ClampToEdgeWrapping,f.generateMipmaps=!1,f.needsUpdate=!0,{size:a,texture:p,texture3D:f}}}t.LUT3dlLoader=s},76193:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(79836);class s extends r.Loader{load(e,t,n,i){const s=new r.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("text"),s.load(e,(n=>{try{t(this.parse(n))}catch(r){i?i(r):console.error(r),this.manager.itemError(e)}}),n,i)}parse(e){e=e.replace(/^#.*?(\n|\r)/gm,"").replace(/^\s*?(\n|\r)/gm,"").trim();let t=null,n=null;const s=new r.Vector3(0,0,0),a=new r.Vector3(1,1,1),o=e.split(/[\n\r]+/g);let l=null,c=0;for(let r=0,i=o.length;r<i;r++){const e=o[r].trim(),i=e.split(/\s/g);switch(i[0]){case"TITLE":t=e.substring(7,e.length-1);break;case"LUT_3D_SIZE":const r=i[1];n=parseFloat(r),l=new Uint8Array(n*n*n*4);break;case"DOMAIN_MIN":s.x=parseFloat(i[1]),s.y=parseFloat(i[2]),s.z=parseFloat(i[3]);break;case"DOMAIN_MAX":a.x=parseFloat(i[1]),a.y=parseFloat(i[2]),a.z=parseFloat(i[3]);break;default:const o=parseFloat(i[0]),h=parseFloat(i[1]),u=parseFloat(i[2]);if(o>1||o<0||h>1||h<0||u>1||u<0)throw new Error("LUTCubeLoader : Non normalized values not supported.");l[c+0]=255*o,l[c+1]=255*h,l[c+2]=255*u,l[c+3]=255,c+=4}}const h=new r.DataTexture;h.image.data=l,h.image.width=n,h.image.height=n*n,h.type=r.UnsignedByteType,h.magFilter=r.LinearFilter,h.minFilter=r.LinearFilter,h.wrapS=r.ClampToEdgeWrapping,h.wrapT=r.ClampToEdgeWrapping,h.generateMipmaps=!1,h.needsUpdate=!0;const u=new i.Data3DTexture;return u.image.data=l,u.image.width=n,u.image.height=n,u.image.depth=n,u.type=r.UnsignedByteType,u.magFilter=r.LinearFilter,u.minFilter=r.LinearFilter,u.wrapS=r.ClampToEdgeWrapping,u.wrapT=r.ClampToEdgeWrapping,u.wrapR=r.ClampToEdgeWrapping,u.generateMipmaps=!1,u.needsUpdate=!0,{title:t,size:n,domainMin:s,domainMax:a,texture:h,texture3D:u}}}t.LUTCubeLoader=s},18113:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(40876);let s;class a extends r.Loader{constructor(e,t={}){super(e),this.resourcePath=void 0!==t.resourcePath?t.resourcePath:""}load(e,t,n,i){const s=this,a=""===s.path?function(e,t){const n=e.indexOf(t);return-1===n?"./":e.substr(0,n)}(e,"Objects"):s.path,o=e.split(a).pop().split(".")[0],l=new r.FileLoader(this.manager);l.setPath(s.path),l.setResponseType("arraybuffer"),l.load(e,(function(n){try{t(s.parse(n,a,o))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t,n){s=(new i.IFFParser).parse(e);const a=new r.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new o(a).parse(n)}}class o{constructor(e){this.textureLoader=e}parse(e){return this.materials=new l(this.textureLoader).parse(),this.defaultLayerName=e,this.meshes=this.parseLayers(),{materials:this.materials,meshes:this.meshes}}parseLayers(){const e=[],t=[],n=new c,r=this;return s.layers.forEach((function(i){const s=n.parse(i.geometry,i),a=r.parseMesh(s,i);e[i.number]=a,-1===i.parent?t.push(a):e[i.parent].add(a)})),this.applyPivots(t),t}parseMesh(e,t){let n;const i=this.getMaterials(e.userData.matNames,t.geometry.type);return this.duplicateUVs(e,i),n="points"===t.geometry.type?new r.Points(e,i):"lines"===t.geometry.type?new r.LineSegments(e,i):new r.Mesh(e,i),t.name?n.name=t.name:n.name=this.defaultLayerName+"_layer_"+t.number,n.userData.pivot=t.pivot,n}applyPivots(e){e.forEach((function(e){e.traverse((function(e){const t=e.userData.pivot;if(e.position.x+=t[0],e.position.y+=t[1],e.position.z+=t[2],e.parent){const t=e.parent.userData.pivot;e.position.x-=t[0],e.position.y-=t[1],e.position.z-=t[2]}}))}))}getMaterials(e,t){const n=[],i=this;e.forEach((function(e,t){n[t]=i.getMaterialByName(e)})),"points"!==t&&"lines"!==t||n.forEach((function(e,i){const s={color:e.color};"points"===t?(s.size=.1,s.map=e.map,s.morphTargets=e.morphTargets,n[i]=new r.PointsMaterial(s)):"lines"===t&&(n[i]=new r.LineBasicMaterial(s))}));const s=n.filter(Boolean);return 1===s.length?s[0]:n}getMaterialByName(e){return this.materials.filter((function(t){return t.name===e}))[0]}duplicateUVs(e,t){let n=!1;Array.isArray(t)?t.forEach((function(e){e.aoMap&&(n=!0)})):t.aoMap&&(n=!0),n&&e.setAttribute("uv2",new r.BufferAttribute(e.attributes.uv.array,2))}}class l{constructor(e){this.textureLoader=e}parse(){const e=[];this.textures={};for(const t in s.materials)"LWO3"===s.format?e.push(this.parseMaterial(s.materials[t],t,s.textures)):"LWO2"===s.format&&e.push(this.parseMaterialLwo2(s.materials[t],t,s.textures));return e}parseMaterial(e,t,n){let r={name:t,side:this.getSide(e.attributes),flatShading:this.getSmooth(e.attributes)};const i=this.parseConnections(e.connections,e.nodes),s=this.parseTextureNodes(i.maps);this.parseAttributeImageMaps(i.attributes,n,s,e.maps);const a=this.parseAttributes(i.attributes,s);this.parseEnvMap(i,s,a),r=Object.assign(s,r),r=Object.assign(r,a);return new(this.getMaterialType(i.attributes))(r)}parseMaterialLwo2(e,t){let n={name:t,side:this.getSide(e.attributes),flatShading:this.getSmooth(e.attributes)};const i=this.parseAttributes(e.attributes,{});return n=Object.assign(n,i),new r.MeshPhongMaterial(n)}getSide(e){if(!e.side)return r.BackSide;switch(e.side){case 0:case 1:return r.BackSide;case 2:return r.FrontSide;case 3:return r.DoubleSide}}getSmooth(e){return!e.smooth||!e.smooth}parseConnections(e,t){const n={maps:{}},r=e.inputName,i=e.inputNodeName,s=e.nodeName,a=this;return r.forEach((function(e,r){if("Material"===e){const e=a.getNodeByRefName(i[r],t);n.attributes=e.attributes,n.envMap=e.fileName,n.name=i[r]}})),s.forEach((function(e,s){e===n.name&&(n.maps[r[s]]=a.getNodeByRefName(i[s],t))})),n}getNodeByRefName(e,t){for(const n in t)if(t[n].refName===e)return t[n]}parseTextureNodes(e){const t={};for(const n in e){const i=e[n],s=i.fileName;if(!s)return;const a=this.loadTexture(s);switch(void 0!==i.widthWrappingMode&&(a.wrapS=this.getWrappingType(i.widthWrappingMode)),void 0!==i.heightWrappingMode&&(a.wrapT=this.getWrappingType(i.heightWrappingMode)),n){case"Color":t.map=a;break;case"Roughness":t.roughnessMap=a,t.roughness=.5;break;case"Specular":t.specularMap=a,t.specular=16777215;break;case"Luminous":t.emissiveMap=a,t.emissive=8421504;break;case"Luminous Color":t.emissive=8421504;break;case"Metallic":t.metalnessMap=a,t.metalness=.5;break;case"Transparency":case"Alpha":t.alphaMap=a,t.transparent=!0;break;case"Normal":t.normalMap=a,void 0!==i.amplitude&&(t.normalScale=new r.Vector2(i.amplitude,i.amplitude));break;case"Bump":t.bumpMap=a}}return t.roughnessMap&&t.specularMap&&delete t.specularMap,t}parseAttributeImageMaps(e,t,n){for(const r in e){const i=e[r];if(i.maps){const e=i.maps[0],s=this.getTexturePathByIndex(e.imageIndex,t);if(!s)return;const a=this.loadTexture(s);switch(void 0!==e.wrap&&(a.wrapS=this.getWrappingType(e.wrap.w)),void 0!==e.wrap&&(a.wrapT=this.getWrappingType(e.wrap.h)),r){case"Color":n.map=a;break;case"Diffuse":n.aoMap=a;break;case"Roughness":n.roughnessMap=a,n.roughness=1;break;case"Specular":n.specularMap=a,n.specular=16777215;break;case"Luminosity":n.emissiveMap=a,n.emissive=8421504;break;case"Metallic":n.metalnessMap=a,n.metalness=1;break;case"Transparency":case"Alpha":n.alphaMap=a,n.transparent=!0;break;case"Normal":n.normalMap=a;break;case"Bump":n.bumpMap=a}}}}parseAttributes(e,t){const n={};return e.Color&&!t.map?n.color=(new r.Color).fromArray(e.Color.value):n.color=new r.Color,e.Transparency&&0!==e.Transparency.value&&(n.opacity=1-e.Transparency.value,n.transparent=!0),e["Bump Height"]&&(n.bumpScale=.1*e["Bump Height"].value),e["Refraction Index"]&&(n.refractionRatio=1/e["Refraction Index"].value),this.parsePhysicalAttributes(n,e,t),this.parseStandardAttributes(n,e,t),this.parsePhongAttributes(n,e,t),n}parsePhysicalAttributes(e,t){t.Clearcoat&&t.Clearcoat.value>0&&(e.clearcoat=t.Clearcoat.value,t["Clearcoat Gloss"]&&(e.clearcoatRoughness=.5*(1-t["Clearcoat Gloss"].value)))}parseStandardAttributes(e,t,n){t.Luminous&&(e.emissiveIntensity=t.Luminous.value,t["Luminous Color"]&&!n.emissive?e.emissive=(new r.Color).fromArray(t["Luminous Color"].value):e.emissive=new r.Color(8421504)),t.Roughness&&!n.roughnessMap&&(e.roughness=t.Roughness.value),t.Metallic&&!n.metalnessMap&&(e.metalness=t.Metallic.value)}parsePhongAttributes(e,t,n){t.Diffuse&&e.color.multiplyScalar(t.Diffuse.value),t.Reflection&&(e.reflectivity=t.Reflection.value,e.combine=r.AddOperation),t.Luminosity&&(e.emissiveIntensity=t.Luminosity.value,n.emissiveMap||n.map?e.emissive=new r.Color(8421504):e.emissive=e.color),t.Roughness||!t.Specular||n.specularMap||(t["Color Highlight"]?e.specular=(new r.Color).setScalar(t.Specular.value).lerp(e.color.clone().multiplyScalar(t.Specular.value),t["Color Highlight"].value):e.specular=(new r.Color).setScalar(t.Specular.value)),e.specular&&t.Glossiness&&(e.shininess=7+Math.pow(2,12*t.Glossiness.value+2))}parseEnvMap(e,t,n){if(e.envMap){const i=this.loadTexture(e.envMap);n.transparent&&n.opacity<.999?(i.mapping=r.EquirectangularRefractionMapping,void 0!==n.reflectivity&&(delete n.reflectivity,delete n.combine),void 0!==n.metalness&&delete n.metalness):i.mapping=r.EquirectangularReflectionMapping,t.envMap=i}}getTexturePathByIndex(e){let t="";return s.textures?(s.textures.forEach((function(n){n.index===e&&(t=n.fileName)})),t):t}loadTexture(e){if(!e)return null;return this.textureLoader.load(e,void 0,void 0,(function(){console.warn("LWOLoader: non-standard resource hierarchy. Use `resourcePath` parameter to specify root content directory.")}))}getWrappingType(e){switch(e){case 0:return console.warn('LWOLoader: "Reset" texture wrapping type is not supported in three.js'),r.ClampToEdgeWrapping;case 1:return r.RepeatWrapping;case 2:return r.MirroredRepeatWrapping;case 3:return r.ClampToEdgeWrapping}}getMaterialType(e){return e.Clearcoat&&e.Clearcoat.value>0?r.MeshPhysicalMaterial:e.Roughness?r.MeshStandardMaterial:r.MeshPhongMaterial}}class c{parse(e,t){const n=new r.BufferGeometry;n.setAttribute("position",new r.Float32BufferAttribute(e.points,3));const i=this.splitIndices(e.vertexIndices,e.polygonDimensions);return n.setIndex(i),this.parseGroups(n,e),n.computeVertexNormals(),this.parseUVs(n,t,i),this.parseMorphTargets(n,t,i),n.translate(-t.pivot[0],-t.pivot[1],-t.pivot[2]),n}splitIndices(e,t){const n=[];let r=0;return t.forEach((function(t){if(t<4)for(let i=0;i<t;i++)n.push(e[r+i]);else if(4===t)n.push(e[r],e[r+1],e[r+2],e[r],e[r+2],e[r+3]);else if(t>4){for(let i=1;i<t-1;i++)n.push(e[r],e[r+i],e[r+i+1]);console.warn("LWOLoader: polygons with greater than 4 sides are not supported")}r+=t})),n}parseGroups(e,t){const n=s.tags,r=[];let i=3;"lines"===t.type&&(i=2),"points"===t.type&&(i=1);const a=this.splitMaterialIndices(t.polygonDimensions,t.materialIndices);let o=0;const l={};let c,h,u=0,d=0;for(let s=0;s<a.length;s+=2){if(h=a[s+1],0===s&&(r[o]=n[h]),void 0===c&&(c=h),h!==c){let t;l[n[c]]?t=l[n[c]]:(t=o,l[n[c]]=o,r[o]=n[c],o++),e.addGroup(u,d,t),u+=d,c=h,d=0}d+=i}if(e.groups.length>0){let t;l[n[h]]?t=l[n[h]]:(t=o,l[n[h]]=o,r[o]=n[h]),e.addGroup(u,d,t)}e.userData.matNames=r}splitMaterialIndices(e,t){const n=[];return e.forEach((function(e,r){if(e<=3)n.push(t[2*r],t[2*r+1]);else if(4===e)n.push(t[2*r],t[2*r+1],t[2*r],t[2*r+1]);else for(let i=0;i<e-2;i++)n.push(t[2*r],t[2*r+1])})),n}parseUVs(e,t){const n=Array.from(Array(2*e.attributes.position.count),(function(){return 0}));for(const r in t.uvs){const e=t.uvs[r].uvs;t.uvs[r].uvIndices.forEach((function(t,r){n[2*t]=e[2*r],n[2*t+1]=e[2*r+1]}))}e.setAttribute("uv",new r.Float32BufferAttribute(n,2))}parseMorphTargets(e,t){let n=0;for(const i in t.morphTargets){const s=e.attributes.position.array.slice();e.morphAttributes.position||(e.morphAttributes.position=[]);const a=t.morphTargets[i].points,o=t.morphTargets[i].indices,l=t.morphTargets[i].type;o.forEach((function(e,t){"relative"===l?(s[3*e]+=a[3*t],s[3*e+1]+=a[3*t+1],s[3*e+2]+=a[3*t+2]):(s[3*e]=a[3*t],s[3*e+1]=a[3*t+1],s[3*e+2]=a[3*t+2])})),e.morphAttributes.position[n]=new r.Float32BufferAttribute(s,3),e.morphAttributes.position[n].name=i,n++}e.morphTargetsRelative=!1}}t.LWOLoader=a},57659:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(47132);class s extends r.Loader{setQuality(e){this._quality=e}load(e,t,n,s){const a=this._quality||1,o=new r.CanvasTexture;o.minFilter=r.NearestFilter;const l=new r.FileLoader(this.manager);return l.setPath(this.path),l.setWithCredentials(this.withCredentials),l.load(e,(function(e){const n=JSON.parse(e),r=document.createElement("div");r.style.width=n.w+"px",r.style.height=n.h+"px",document.body.appendChild(r);const s=i.loadAnimation({container:r,animType:"canvas",loop:!0,autoplay:!0,animationData:n,rendererSettings:{dpr:a}});o.animation=s,o.image=s.container,s.addEventListener("enterFrame",(function(){o.needsUpdate=!0})),r.style.display="none",void 0!==t&&t(o)}),n,s),o}}t.LottieLoader=s},28057:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=[[-.525731,0,.850651],[-.442863,.238856,.864188],[-.295242,0,.955423],[-.309017,.5,.809017],[-.16246,.262866,.951056],[0,0,1],[0,.850651,.525731],[-.147621,.716567,.681718],[.147621,.716567,.681718],[0,.525731,.850651],[.309017,.5,.809017],[.525731,0,.850651],[.295242,0,.955423],[.442863,.238856,.864188],[.16246,.262866,.951056],[-.681718,.147621,.716567],[-.809017,.309017,.5],[-.587785,.425325,.688191],[-.850651,.525731,0],[-.864188,.442863,.238856],[-.716567,.681718,.147621],[-.688191,.587785,.425325],[-.5,.809017,.309017],[-.238856,.864188,.442863],[-.425325,.688191,.587785],[-.716567,.681718,-.147621],[-.5,.809017,-.309017],[-.525731,.850651,0],[0,.850651,-.525731],[-.238856,.864188,-.442863],[0,.955423,-.295242],[-.262866,.951056,-.16246],[0,1,0],[0,.955423,.295242],[-.262866,.951056,.16246],[.238856,.864188,.442863],[.262866,.951056,.16246],[.5,.809017,.309017],[.238856,.864188,-.442863],[.262866,.951056,-.16246],[.5,.809017,-.309017],[.850651,.525731,0],[.716567,.681718,.147621],[.716567,.681718,-.147621],[.525731,.850651,0],[.425325,.688191,.587785],[.864188,.442863,.238856],[.688191,.587785,.425325],[.809017,.309017,.5],[.681718,.147621,.716567],[.587785,.425325,.688191],[.955423,.295242,0],[1,0,0],[.951056,.16246,.262866],[.850651,-.525731,0],[.955423,-.295242,0],[.864188,-.442863,.238856],[.951056,-.16246,.262866],[.809017,-.309017,.5],[.681718,-.147621,.716567],[.850651,0,.525731],[.864188,.442863,-.238856],[.809017,.309017,-.5],[.951056,.16246,-.262866],[.525731,0,-.850651],[.681718,.147621,-.716567],[.681718,-.147621,-.716567],[.850651,0,-.525731],[.809017,-.309017,-.5],[.864188,-.442863,-.238856],[.951056,-.16246,-.262866],[.147621,.716567,-.681718],[.309017,.5,-.809017],[.425325,.688191,-.587785],[.442863,.238856,-.864188],[.587785,.425325,-.688191],[.688191,.587785,-.425325],[-.147621,.716567,-.681718],[-.309017,.5,-.809017],[0,.525731,-.850651],[-.525731,0,-.850651],[-.442863,.238856,-.864188],[-.295242,0,-.955423],[-.16246,.262866,-.951056],[0,0,-1],[.295242,0,-.955423],[.16246,.262866,-.951056],[-.442863,-.238856,-.864188],[-.309017,-.5,-.809017],[-.16246,-.262866,-.951056],[0,-.850651,-.525731],[-.147621,-.716567,-.681718],[.147621,-.716567,-.681718],[0,-.525731,-.850651],[.309017,-.5,-.809017],[.442863,-.238856,-.864188],[.16246,-.262866,-.951056],[.238856,-.864188,-.442863],[.5,-.809017,-.309017],[.425325,-.688191,-.587785],[.716567,-.681718,-.147621],[.688191,-.587785,-.425325],[.587785,-.425325,-.688191],[0,-.955423,-.295242],[0,-1,0],[.262866,-.951056,-.16246],[0,-.850651,.525731],[0,-.955423,.295242],[.238856,-.864188,.442863],[.262866,-.951056,.16246],[.5,-.809017,.309017],[.716567,-.681718,.147621],[.525731,-.850651,0],[-.238856,-.864188,-.442863],[-.5,-.809017,-.309017],[-.262866,-.951056,-.16246],[-.850651,-.525731,0],[-.716567,-.681718,-.147621],[-.716567,-.681718,.147621],[-.525731,-.850651,0],[-.5,-.809017,.309017],[-.238856,-.864188,.442863],[-.262866,-.951056,.16246],[-.864188,-.442863,.238856],[-.809017,-.309017,.5],[-.688191,-.587785,.425325],[-.681718,-.147621,.716567],[-.442863,-.238856,.864188],[-.587785,-.425325,.688191],[-.309017,-.5,.809017],[-.147621,-.716567,.681718],[-.425325,-.688191,.587785],[-.16246,-.262866,.951056],[.442863,-.238856,.864188],[.16246,-.262866,.951056],[.309017,-.5,.809017],[.147621,-.716567,.681718],[0,-.525731,.850651],[.425325,-.688191,.587785],[.587785,-.425325,.688191],[.688191,-.587785,.425325],[-.955423,.295242,0],[-.951056,.16246,.262866],[-1,0,0],[-.850651,0,.525731],[-.955423,-.295242,0],[-.951056,-.16246,.262866],[-.864188,.442863,-.238856],[-.951056,.16246,-.262866],[-.809017,.309017,-.5],[-.864188,-.442863,-.238856],[-.951056,-.16246,-.262866],[-.809017,-.309017,-.5],[-.681718,.147621,-.716567],[-.681718,-.147621,-.716567],[-.850651,0,-.525731],[-.688191,.587785,-.425325],[-.587785,.425325,-.688191],[-.425325,.688191,-.587785],[-.425325,-.688191,-.587785],[-.587785,-.425325,-.688191],[-.688191,-.587785,-.425325]];class s extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=new DataView(e),n={},s=["ident","version","skinwidth","skinheight","framesize","num_skins","num_vertices","num_st","num_tris","num_glcmds","num_frames","offset_skins","offset_st","offset_tris","offset_frames","offset_glcmds","offset_end"];for(let r=0;r<s.length;r++)n[s[r]]=t.getInt32(4*r,!0);if(844121161!==n.ident||8!==n.version)return void console.error("Not a valid MD2 file");if(n.offset_end!==t.byteLength)return void console.error("Corrupted MD2 file");const a=new r.BufferGeometry,o=[];let l=n.offset_st;for(let r=0,i=n.num_st;r<i;r++){const e=t.getInt16(l+0,!0),r=t.getInt16(l+2,!0);o.push(e/n.skinwidth,1-r/n.skinheight),l+=4}l=n.offset_tris;const c=[],h=[];for(let r=0,i=n.num_tris;r<i;r++)c.push(t.getUint16(l+0,!0),t.getUint16(l+2,!0),t.getUint16(l+4,!0)),h.push(t.getUint16(l+6,!0),t.getUint16(l+8,!0),t.getUint16(l+10,!0)),l+=12;const u=new r.Vector3,d=new r.Vector3,p=[],f=[];l=n.offset_frames;for(let r=0,E=n.num_frames;r<E;r++){d.set(t.getFloat32(l+0,!0),t.getFloat32(l+4,!0),t.getFloat32(l+8,!0)),u.set(t.getFloat32(l+12,!0),t.getFloat32(l+16,!0),t.getFloat32(l+20,!0)),l+=24;for(let n=0;n<16;n++){const e=t.getUint8(l+n,!0);if(0===e)break;p[n]=e}const e={name:String.fromCharCode.apply(null,p),vertices:[],normals:[]};l+=16;for(let r=0;r<n.num_vertices;r++){let n=t.getUint8(l++,!0),r=t.getUint8(l++,!0),s=t.getUint8(l++,!0);const a=i[t.getUint8(l++,!0)];n=n*d.x+u.x,r=r*d.y+u.y,s=s*d.z+u.z,e.vertices.push(n,s,r),e.normals.push(a[0],a[2],a[1])}f.push(e)}const m=[],g=[],A=[],v=f[0].vertices,y=f[0].normals;for(let r=0,i=c.length;r<i;r++){let e=3*c[r];const t=v[e],n=v[e+1],i=v[e+2];m.push(t,n,i);const s=y[e],a=y[e+1],l=y[e+2];g.push(s,a,l);e=2*h[r];const u=o[e],d=o[e+1];A.push(u,d)}a.setAttribute("position",new r.Float32BufferAttribute(m,3)),a.setAttribute("normal",new r.Float32BufferAttribute(g,3)),a.setAttribute("uv",new r.Float32BufferAttribute(A,2));const x=[],b=[];for(let i=0,E=f.length;i<E;i++){const e=f[i],t=e.name;if(e.vertices.length>0){const n=[];for(let t=0,r=c.length;t<r;t++){const r=3*c[t],i=e.vertices[r],s=e.vertices[r+1],a=e.vertices[r+2];n.push(i,s,a)}const i=new r.Float32BufferAttribute(n,3);i.name=t,x.push(i)}if(e.normals.length>0){const n=[];for(let t=0,r=c.length;t<r;t++){const r=3*c[t],i=e.normals[r],s=e.normals[r+1],a=e.normals[r+2];n.push(i,s,a)}const i=new r.Float32BufferAttribute(n,3);i.name=t,b.push(i)}}return a.morphAttributes.position=x,a.morphAttributes.normal=b,a.morphTargetsRelative=!1,a.animations=r.AnimationClip.CreateClipsFromMorphTargetSequences(f,10),a}}t.MD2Loader=s},74181:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.load(e,(function(e){t(s.parse(e))}),n,i)}parse(e){const t=new DataView(e),n=t.getUint32(0),i=t.getUint32(4);let s=8;const a=new Float32Array(n),o=new Float32Array(n*n).fill(0);for(let r=0;r<n;r++)a[r]=t.getFloat32(s),s+=4,o[n*r+r]=1;const l=new r.NumberKeyframeTrack(".morphTargetInfluences",a,o),c=new r.AnimationClip("default",a[a.length-1],[l]),h=[];for(let u=0;u<n;u++){const e=new Float32Array(3*i);for(let r=0;r<i;r++){const n=3*r;e[n+0]=t.getFloat32(s),s+=4,e[n+1]=t.getFloat32(s),s+=4,e[n+2]=t.getFloat32(s),s+=4}const n=new r.BufferAttribute(e,3);n.name="morph_"+u,h.push(n)}return{morphTargets:h,clip:c}}}t.MDDLoader=i},77741:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(2545),s=n(62717);class a extends r.Loader{constructor(e){super(e),this.loader=new r.FileLoader(this.manager),this.parser=null,this.meshBuilder=new l(this.manager),this.animationBuilder=new u}setAnimationPath(e){return this.animationPath=e,this}load(e,t,n,i){const s=this.meshBuilder.setCrossOrigin(this.crossOrigin);let a;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:r.LoaderUtils.extractUrlBase(e);const o=this._extractExtension(e).toLowerCase();"pmd"===o||"pmx"===o?this["pmd"===o?"loadPMD":"loadPMX"](e,(function(e){t(s.build(e,a,n,i))}),n,i):i&&i(new Error("THREE.MMDLoader: Unknown model file extension ."+o+"."))}loadAnimation(e,t,n,r,i){const s=this.animationBuilder;this.loadVMD(e,(function(e){n(t.isCamera?s.buildCameraAnimation(e):s.build(e,t))}),r,i)}loadWithAnimation(e,t,n,r,i){const s=this;this.load(e,(function(e){s.loadAnimation(t,e,(function(t){n({mesh:e,animation:t})}),r,i)}),r,i)}loadPMD(e,t,n,r){const i=this._getParser();this.loader.setMimeType(void 0).setPath(this.path).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){t(i.parsePmd(e,!0))}),n,r)}loadPMX(e,t,n,r){const i=this._getParser();this.loader.setMimeType(void 0).setPath(this.path).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){t(i.parsePmx(e,!0))}),n,r)}loadVMD(e,t,n,r){const i=Array.isArray(e)?e:[e],s=[],a=i.length,o=this._getParser();this.loader.setMimeType(void 0).setPath(this.animationPath).setResponseType("arraybuffer").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials);for(let l=0,c=i.length;l<c;l++)this.loader.load(i[l],(function(e){s.push(o.parseVmd(e,!0)),s.length===a&&t(o.mergeVmds(s))}),n,r)}loadVPD(e,t,n,r,i){const s=this._getParser();this.loader.setMimeType(t?void 0:"text/plain; charset=shift_jis").setPath(this.animationPath).setResponseType("text").setRequestHeader(this.requestHeader).setWithCredentials(this.withCredentials).load(e,(function(e){n(s.parseVpd(e,!0))}),r,i)}_extractExtension(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1)}_getParser(){return null===this.parser&&(this.parser=new s.Parser),this.parser}}const o=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/bWiiMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh8aBHZBl14e8wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOUlEQVRYR+3WMREAMAwDsYY/yoDI7MLwIiP40+RJklfcCCBAgAABAgTqArfb/QMCCBAgQIAAgbbAB3z/e0F3js2cAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/B5ilMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh81dWyx0gFwKAAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOklEQVRYR+3WoREAMAwDsWb/UQtCy9wxTOQJ/oQ8SXKKGwEECBAgQIBAXeDt7f4BAQQIECBAgEBb4AOz8Hzx7WLY4wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPUlEQVRYR+1XwW7CMAy1+f9fZOMysSEOEweEOPRNdm3HbdOyIhAcklPrOs/PLy9RygBALxzcCDQFmgJNgaZAU6Ap0BR4PwX8gsRMVLssMRH5HcpzJEaWL7EVg9F1IHRlyqQohgVr4FGUlUcMJSjcUlDw0zvjeun70cLWmneoyf7NgBTQSniBTQQSuJAZsOnnaczjIMb5hCiuHKxokCrJfVnrctyZL0PkJAJe1HMil4nxeyi3Ypfn1kX51jpPvo/JeCNC4PhVdHdJw2XjBR8brF8PEIhNVn12AgP7uHsTBguBn53MUZCqv7Lp07Pn5k1Ro+uWmUNn7D+M57rtk7aG0Vo73xyF/fbFf0bPJjDXngnGocDTdFhygZjwUQrMNrDcmZlQT50VJ/g/UwNyHpu778+yW+/ksOz/BFo54P4AsUXMfRq7XWsAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACMElEQVRYR+2Xv4pTQRTGf2dubhLdICiii2KnYKHVolhauKWPoGAnNr6BD6CvIVaihYuI2i1ia0BY0MZGRHQXjZj/mSPnnskfNWiWZUlzJ5k7M2cm833nO5Mziej2DWWJRUoCpQKlAntSQCqgw39/iUWAGmh37jrRnVsKlgpiqmkoGVABA7E57fvY+pJDdgKqF6HzFCSADkDq+F6AHABtQ+UMVE5D7zXod7fFNhTEckTbj5XQgHzNN+5tQvc5NG7C6BNkp6D3EmpXHDR+dQAjFLchW3VS9rlw3JBh+B7ys5Cf9z0GW1C/7P32AyBAOAz1q4jGliIH3YPuBnSfQX4OGreTIgEYQb/pBDtPnEQ4CivXYPAWBk13oHrB54yA9QuSn2H4AcKRpEILDt0BUzj+RLR1V5EqjD66NPRBVpLcQwjHoHYJOhsQv6U4mnzmrIXJCFr4LDwm/xBUoboG9XX4cc9VKdYoSA2yk5NQLJaKDUjTBoveG3Z2TElTxwjNK4M3LEZgUdDdruvcXzKBpStgp2NPiWi3ks9ZXxIoFVi+AvHLdc9TqtjL3/aYjpPlrzOcEnK62Szhimdd7xX232zFDTgtxezOu3WNMRLjiKgjtOhHVMd1loynVHvOgjuIIJMaELEqhJAV/RCSLbWTcfPFakFgFlALTRRvx+ok6Hlp/Q+v3fmx90bMyUzaEAhmM3KvHlXTL5DxnbGf/1M8RNNACLL5MNtPxP/mypJAqcDSFfgFhpYqWUzhTEAAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII="];class l{constructor(e){this.crossOrigin="anonymous",this.geometryBuilder=new c,this.materialBuilder=new h(e)}setCrossOrigin(e){return this.crossOrigin=e,this}build(e,t,n,i){const s=this.geometryBuilder.build(e),a=this.materialBuilder.setCrossOrigin(this.crossOrigin).setResourcePath(t).build(e,s,n,i),o=new r.SkinnedMesh(s,a),l=new r.Skeleton(function(e){const t=e.geometry,n=[];if(t&&void 0!==t.bones){for(let e=0,i=t.bones.length;e<i;e++){const i=t.bones[e],s=new r.Bone;n.push(s),s.name=i.name,s.position.fromArray(i.pos),s.quaternion.fromArray(i.rotq),void 0!==i.scl&&s.scale.fromArray(i.scl)}for(let r=0,i=t.bones.length;r<i;r++){const i=t.bones[r];-1!==i.parent&&null!==i.parent&&void 0!==n[i.parent]?n[i.parent].add(n[r]):e.add(n[r])}}return e.updateMatrixWorld(!0),n}(o));return o.bind(l),o}}class c{build(e){const t=[],n=[],i=[],s=[],a=[],o=[],l=[],c=[],h=[],u=[],d=[],p=[],f=[],m=[];let g=0;const A={};for(let r=0;r<e.metadata.vertexCount;r++){const s=e.vertices[r];for(let e=0,n=s.position.length;e<n;e++)t.push(s.position[e]);for(let e=0,t=s.normal.length;e<t;e++)i.push(s.normal[e]);for(let e=0,t=s.uv.length;e<t;e++)n.push(s.uv[e]);for(let e=0;e<4;e++)l.push(s.skinIndices.length-1>=e?s.skinIndices[e]:0);for(let e=0;e<4;e++)c.push(s.skinWeights.length-1>=e?s.skinWeights[e]:0)}for(let r=0;r<e.metadata.faceCount;r++){const t=e.faces[r];for(let e=0,n=t.indices.length;e<n;e++)s.push(t.indices[e])}for(let r=0;r<e.metadata.materialCount;r++){const t=e.materials[r];a.push({offset:3*g,count:3*t.faceCount}),g+=t.faceCount}for(let r=0;r<e.metadata.rigidBodyCount;r++){const t=e.rigidBodies[r];let n=A[t.boneIndex];n=void 0===n?t.type:Math.max(t.type,n),A[t.boneIndex]=n}for(let r=0;r<e.metadata.boneCount;r++){const t=e.bones[r],n={index:r,transformationClass:t.transformationClass,parent:t.parentIndex,name:t.name,pos:t.position.slice(0,3),rotq:[0,0,0,1],scl:[1,1,1],rigidBodyType:void 0!==A[r]?A[r]:-1};-1!==n.parent&&(n.pos[0]-=e.bones[n.parent].position[0],n.pos[1]-=e.bones[n.parent].position[1],n.pos[2]-=e.bones[n.parent].position[2]),o.push(n)}if("pmd"===e.metadata.format)for(let x=0;x<e.metadata.ikCount;x++){const t=e.iks[x],n={target:t.target,effector:t.effector,iteration:t.iteration,maxAngle:4*t.maxAngle,links:[]};for(let i=0,s=t.links.length;i<s;i++){const s={};s.index=t.links[i].index,s.enabled=!0,e.bones[s.index].name.indexOf("\u3072\u3056")>=0&&(s.limitation=new r.Vector3(1,0,0)),n.links.push(s)}d.push(n)}else for(let x=0;x<e.metadata.boneCount;x++){const t=e.bones[x].ik;if(void 0===t)continue;const n={target:x,effector:t.effector,iteration:t.iteration,maxAngle:t.maxAngle,links:[]};for(let e=0,i=t.links.length;e<i;e++){const i={};if(i.index=t.links[e].index,i.enabled=!0,1===t.links[e].angleLimitation){const n=t.links[e].lowerLimitationAngle,s=t.links[e].upperLimitationAngle,a=-s[0],o=-s[1];s[0]=-n[0],s[1]=-n[1],n[0]=a,n[1]=o,i.rotationMin=(new r.Vector3).fromArray(n),i.rotationMax=(new r.Vector3).fromArray(s)}n.links.push(i)}d.push(n),o[x].ik=n}if("pmx"===e.metadata.format){let t=function(e){e.param&&(p.push(e.param),o[e.param.index].grant=e.param),e.visited=!0;for(let n=0,r=e.children.length;n<r;n++){const r=e.children[n];r.visited||t(r)}};const n={};for(let i=0;i<e.metadata.boneCount;i++){const t=e.bones[i],r=t.grant;if(void 0===r)continue;const s={index:i,parentIndex:r.parentIndex,ratio:r.ratio,isLocal:r.isLocal,affectRotation:r.affectRotation,affectPosition:r.affectPosition,transformationClass:t.transformationClass};n[i]={parent:null,children:[],param:s,visited:!1}}const r={parent:null,children:[],param:null,visited:!1};for(const e in n){const t=n[e],i=n[t.parentIndex]||r;t.parent=i,i.children.push(t)}t(r)}function v(t,n,r){for(let i=0;i<n.elementCount;i++){const s=n.elements[i];let a;a="pmd"===e.metadata.format?e.morphs[0].elements[s.index].index:s.index,t.array[3*a+0]+=s.position[0]*r,t.array[3*a+1]+=s.position[1]*r,t.array[3*a+2]+=s.position[2]*r}}for(let x=0;x<e.metadata.morphCount;x++){const n=e.morphs[x],i={name:n.name},s=new r.Float32BufferAttribute(3*e.metadata.vertexCount,3);s.name=n.name;for(let r=0;r<3*e.metadata.vertexCount;r++)s.array[r]=t[r];if("pmd"===e.metadata.format)0!==x&&v(s,n,1);else if(0===n.type)for(let t=0;t<n.elementCount;t++){const r=e.morphs[n.elements[t].index],i=n.elements[t].ratio;1===r.type&&v(s,r,i)}else 1===n.type?v(s,n,1):2===n.type||3===n.type||4===n.type||5===n.type||6===n.type||7===n.type||n.type;h.push(i),u.push(s)}for(let r=0;r<e.metadata.rigidBodyCount;r++){const t=e.rigidBodies[r],n={};for(const e in t)n[e]=t[e];if("pmx"===e.metadata.format&&-1!==n.boneIndex){const t=e.bones[n.boneIndex];n.position[0]-=t.position[0],n.position[1]-=t.position[1],n.position[2]-=t.position[2]}f.push(n)}for(let r=0;r<e.metadata.constraintCount;r++){const t=e.constraints[r],n={};for(const e in t)n[e]=t[e];const i=f[n.rigidBodyIndex1],s=f[n.rigidBodyIndex2];0!==i.type&&2===s.type&&-1!==i.boneIndex&&-1!==s.boneIndex&&e.bones[s.boneIndex].parentIndex===i.boneIndex&&(s.type=1),m.push(n)}const y=new r.BufferGeometry;y.setAttribute("position",new r.Float32BufferAttribute(t,3)),y.setAttribute("normal",new r.Float32BufferAttribute(i,3)),y.setAttribute("uv",new r.Float32BufferAttribute(n,2)),y.setAttribute("skinIndex",new r.Uint16BufferAttribute(l,4)),y.setAttribute("skinWeight",new r.Float32BufferAttribute(c,4)),y.setIndex(s);for(let r=0,x=a.length;r<x;r++)y.addGroup(a[r].offset,a[r].count,r);return y.bones=o,y.morphTargets=h,y.morphAttributes.position=u,y.morphTargetsRelative=!1,y.userData.MMD={bones:o,iks:d,grants:p,rigidBodies:f,constraints:m,format:e.metadata.format},y.computeBoundingSphere(),y}}class h{constructor(e){this.manager=e,this.textureLoader=new r.TextureLoader(this.manager),this.tgaLoader=null,this.crossOrigin="anonymous",this.resourcePath=void 0}setCrossOrigin(e){return this.crossOrigin=e,this}setResourcePath(e){return this.resourcePath=e,this}build(e,t){const n=[],i={};this.textureLoader.setCrossOrigin(this.crossOrigin);for(let s=0;s<e.metadata.materialCount;s++){const a=e.materials[s],o={userData:{}};if(void 0!==a.name&&(o.name=a.name),o.color=(new r.Color).fromArray(a.diffuse),o.opacity=a.diffuse[3],o.emissive=(new r.Color).fromArray(a.ambient),o.transparent=1!==o.opacity,o.skinning=t.bones.length>0,o.morphTargets=t.morphTargets.length>0,o.fog=!0,o.blending=r.CustomBlending,o.blendSrc=r.SrcAlphaFactor,o.blendDst=r.OneMinusSrcAlphaFactor,o.blendSrcAlpha=r.SrcAlphaFactor,o.blendDstAlpha=r.DstAlphaFactor,"pmx"===e.metadata.format&&1==(1&a.flag)?o.side=r.DoubleSide:o.side=1===o.opacity?r.FrontSide:r.DoubleSide,"pmd"===e.metadata.format){if(a.fileName){const e=a.fileName.split("*");if(o.map=this._loadTexture(e[0],i),e.length>1){const t=e[1].slice(-4).toLowerCase();o.envMap=this._loadTexture(e[1],i),o.combine=".sph"===t?r.MultiplyOperation:r.AddOperation}}const t=-1===a.toonIndex?"toon00.bmp":e.toonTextures[a.toonIndex].fileName;o.gradientMap=this._loadTexture(t,i,{isToonTexture:!0,isDefaultToonTexture:this._isDefaultToonTexture(t)}),o.userData.outlineParameters={thickness:1===a.edgeFlag?.003:0,color:[0,0,0],alpha:1,visible:1===a.edgeFlag}}else{let t,n;-1!==a.textureIndex&&(o.map=this._loadTexture(e.textures[a.textureIndex],i)),-1===a.envTextureIndex||1!==a.envFlag&&2!=a.envFlag||(o.envMap=this._loadTexture(e.textures[a.envTextureIndex],i),o.combine=1===a.envFlag?r.MultiplyOperation:r.AddOperation),-1===a.toonIndex||0!==a.toonFlag?(t="toon"+("0"+(a.toonIndex+1)).slice(-2)+".bmp",n=!0):(t=e.textures[a.toonIndex],n=!1),o.gradientMap=this._loadTexture(t,i,{isToonTexture:!0,isDefaultToonTexture:n}),o.userData.outlineParameters={thickness:a.edgeSize/300,color:a.edgeColor.slice(0,3),alpha:a.edgeColor[3],visible:0!=(16&a.flag)&&a.edgeSize>0}}void 0!==o.map&&(o.transparent||this._checkImageTransparency(o.map,t,s),o.emissive.multiplyScalar(.2)),n.push(new r.MeshToonMaterial(o))}if("pmx"===e.metadata.format){let t=function(e,t){for(let n=0,r=e.length;n<r;n++){const r=e[n];if(-1===r.index)continue;const i=t[r.index];i.opacity!==r.diffuse[3]&&(i.transparent=!0)}};for(let r=0,i=e.morphs.length;r<i;r++){const i=e.morphs[r],s=i.elements;if(0===i.type)for(let r=0,a=s.length;r<a;r++){const i=e.morphs[s[r].index];8===i.type&&t(i.elements,n)}else 8===i.type&&t(s,n)}}return n}_getTGALoader(){if(null===this.tgaLoader){if(void 0===i.TGALoader)throw new Error("THREE.MMDLoader: Import TGALoader");this.tgaLoader=new i.TGALoader(this.manager)}return this.tgaLoader}_isDefaultToonTexture(e){return 10===e.length&&/toon(10|0[0-9])\.bmp/.test(e)}_loadTexture(e,t,n,i,s){const a=this;let l;if(!0===(n=n||{}).isDefaultToonTexture){let t;try{t=parseInt(e.match(/toon([0-9]{2})\.bmp$/)[1])}catch(u){console.warn("THREE.MMDLoader: "+e+" seems like a not right default texture path. Using toon00.bmp instead."),t=0}l=o[t]}else l=this.resourcePath+e;if(void 0!==t[l])return t[l];let c=this.manager.getHandler(l);null===c&&(c=".tga"===e.slice(-4).toLowerCase()?this._getTGALoader():this.textureLoader);const h=c.load(l,(function(e){!0===n.isToonTexture&&(e.image=a._getRotatedImage(e.image),e.magFilter=r.NearestFilter,e.minFilter=r.NearestFilter),e.flipY=!1,e.wrapS=r.RepeatWrapping,e.wrapT=r.RepeatWrapping;for(let t=0;t<h.readyCallbacks.length;t++)h.readyCallbacks[t](h);delete h.readyCallbacks}),i,s);return h.readyCallbacks=[],t[l]=h,h}_getRotatedImage(e){const t=document.createElement("canvas"),n=t.getContext("2d"),r=e.width,i=e.height;return t.width=r,t.height=i,n.clearRect(0,0,r,i),n.translate(r/2,i/2),n.rotate(.5*Math.PI),n.translate(-r/2,-i/2),n.drawImage(e,0,0),n.getImageData(0,0,r,i)}_checkImageTransparency(e,t,n){e.readyCallbacks.push((function(r){function i(e,t){const n=e.width,r=e.height;let i=Math.round(t.x*n)%n,s=Math.round(t.y*r)%r;i<0&&(i+=n),s<0&&(s+=r);const a=s*n+i;return e.data[4*a+3]}const s=void 0!==r.image.data?r.image:function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");return n.drawImage(e,0,0),n.getImageData(0,0,t.width,t.height)}(r.image),a=t.groups[n];(function(e,t,n){const r=e.width,s=e.height;if(e.data.length/(r*s)!=4)return!1;for(let a=0;a<n.length;a+=3){const r={x:0,y:0};for(let s=0;s<3;s++){const o=n[3*a+s],l={x:t[2*o+0],y:t[2*o+1]};if(i(e,l)<253)return!0;r.x+=l.x,r.y+=l.y}if(r.x/=3,r.y/=3,i(e,r)<253)return!0}return!1})(s,t.attributes.uv.array,t.index.array.slice(a.start,a.start+a.count))&&(e.transparent=!0)}))}}class u{build(e,t){const n=this.buildSkeletalAnimation(e,t).tracks,i=this.buildMorphAnimation(e,t).tracks;for(let r=0,s=i.length;r<s;r++)n.push(i[r]);return new r.AnimationClip("",-1,n)}buildSkeletalAnimation(e,t){function n(e,t,n){e.push(t[n+0]/127),e.push(t[n+8]/127),e.push(t[n+4]/127),e.push(t[n+12]/127)}const i=[],s={},a=t.skeleton.bones,o={};for(let r=0,l=a.length;r<l;r++)o[a[r].name]=!0;for(let r=0;r<e.metadata.motionCount;r++){const t=e.motions[r],n=t.boneName;void 0!==o[n]&&(s[n]=s[n]||[],s[n].push(t))}for(const l in s){const e=s[l];e.sort((function(e,t){return e.frameNum-t.frameNum}));const a=[],o=[],c=[],h=[],u=[],d=t.skeleton.getBoneByName(l).position.toArray();for(let t=0,r=e.length;t<r;t++){const r=e[t].frameNum/30,i=e[t].position,s=e[t].rotation,l=e[t].interpolation;a.push(r);for(let e=0;e<3;e++)o.push(d[e]+i[e]);for(let e=0;e<4;e++)c.push(s[e]);for(let e=0;e<3;e++)n(h,l,e);n(u,l,3)}const p=".bones["+l+"]";i.push(this._createTrack(p+".position",r.VectorKeyframeTrack,a,o,h)),i.push(this._createTrack(p+".quaternion",r.QuaternionKeyframeTrack,a,c,u))}return new r.AnimationClip("",-1,i)}buildMorphAnimation(e,t){const n=[],i={},s=t.morphTargetDictionary;for(let r=0;r<e.metadata.morphCount;r++){const t=e.morphs[r],n=t.morphName;void 0!==s[n]&&(i[n]=i[n]||[],i[n].push(t))}for(const a in i){const e=i[a];e.sort((function(e,t){return e.frameNum-t.frameNum}));const t=[],o=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n].frameNum/30),o.push(e[n].weight);n.push(new r.NumberKeyframeTrack(".morphTargetInfluences["+s[a]+"]",t,o))}return new r.AnimationClip("",-1,n)}buildCameraAnimation(e){function t(e,t){e.push(t.x),e.push(t.y),e.push(t.z)}function n(e,t,n){e.push(t[4*n+0]/127),e.push(t[4*n+1]/127),e.push(t[4*n+2]/127),e.push(t[4*n+3]/127)}const i=void 0===e.cameras?[]:e.cameras.slice();i.sort((function(e,t){return e.frameNum-t.frameNum}));const s=[],a=[],o=[],l=[],c=[],h=[],u=[],d=[],p=[],f=new r.Quaternion,m=new r.Euler,g=new r.Vector3,A=new r.Vector3;for(let r=0,b=i.length;r<b;r++){const e=i[r],x=e.frameNum/30,b=e.position,E=e.rotation,_=e.distance,S=e.fov,w=e.interpolation;s.push(x),g.set(0,0,-_),A.set(b[0],b[1],b[2]),m.set(-E[0],-E[1],-E[2]),f.setFromEuler(m),g.add(A),g.applyQuaternion(f),t(a,A),(v=o).push((y=f).x),v.push(y.y),v.push(y.z),v.push(y.w),t(l,g),c.push(S);for(let t=0;t<3;t++)n(h,w,t);n(u,w,3);for(let t=0;t<3;t++)n(d,w,4);n(p,w,5)}var v,y;const x=[];return x.push(this._createTrack("target.position",r.VectorKeyframeTrack,s,a,h)),x.push(this._createTrack(".quaternion",r.QuaternionKeyframeTrack,s,o,u)),x.push(this._createTrack(".position",r.VectorKeyframeTrack,s,l,d)),x.push(this._createTrack(".fov",r.NumberKeyframeTrack,s,c,p)),new r.AnimationClip("",-1,x)}_createTrack(e,t,n,r,i){if(n.length>2){n=n.slice(),r=r.slice(),i=i.slice();const e=r.length/n.length,t=i.length/n.length;let s=1;for(let a=2,o=n.length;a<o;a++){for(let t=0;t<e;t++)if(r[s*e+t]!==r[(s-1)*e+t]||r[s*e+t]!==r[a*e+t]){s++;break}if(a>s){n[s]=n[a];for(let t=0;t<e;t++)r[s*e+t]=r[a*e+t];for(let e=0;e<t;e++)i[s*t+e]=i[a*t+e]}}n.length=s+1,r.length=(s+1)*e,i.length=(s+1)*t}const s=new t(e,n,r);return s.createInterpolant=function(e){return new d(this.times,this.values,this.getValueSize(),e,new Float32Array(i))},s}}class d extends r.Interpolant{constructor(e,t,n,r,i){super(e,t,n,r),this.interpolationParams=i}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=this.interpolationParams,c=e*o,h=c-o,u=i-t<.05?0:(n-t)/(i-t);if(4===o){const t=l[4*e+0],n=l[4*e+1],i=l[4*e+2],o=l[4*e+3],d=this._calculate(t,n,i,o,u);r.Quaternion.slerpFlat(s,0,a,h,a,c,d)}else if(3===o)for(let r=0;r!==o;++r){const t=l[12*e+4*r+0],n=l[12*e+4*r+1],i=l[12*e+4*r+2],o=l[12*e+4*r+3],d=this._calculate(t,n,i,o,u);s[r]=a[h+r]*(1-d)+a[c+r]*d}else{const t=l[4*e+0],n=l[4*e+1],r=l[4*e+2],i=l[4*e+3],o=this._calculate(t,n,r,i,u);s[0]=a[h]*(1-o)+a[c]*o}return s}_calculate(e,t,n,r,i){let s=.5,a=s,o=1-a;const l=Math;let c,h,u;for(let d=0;d<15;d++){c=3*o*o*a,h=3*o*a*a,u=a*a*a;const n=c*e+h*t+u-i;if(l.abs(n)<1e-5)break;s/=2,a+=n<0?s:-s,o=1-a}return c*n+h*r+u}}t.MMDLoader=a},79140:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=""===this.path?r.LoaderUtils.extractUrlBase(e):this.path,o=new r.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split("\n");let r={};const i=/\s+/,a={};for(let s=0;s<n.length;s++){let e=n[s];if(e=e.trim(),0===e.length||"#"===e.charAt(0))continue;const t=e.indexOf(" ");let o=t>=0?e.substring(0,t):e;o=o.toLowerCase();let l=t>=0?e.substring(t+1):"";if(l=l.trim(),"newmtl"===o)r={name:l},a[l]=r;else if("ka"===o||"kd"===o||"ks"===o||"ke"===o){const e=l.split(i,3);r[o]=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]}else r[o]=l}const o=new s(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class s{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:r.FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:r.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const r=e[n],i={};t[n]=i;for(const e in r){let t=!0,n=r[e];const s=e.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[2]&&(t=!1)}t&&(i[s]=n)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],i={name:e,side:this.side};function s(e,n){if(i[e])return;const r=t.getTextureParams(n,i),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(o=r.url)||""===o?"":/^https?:\/\//i.test(o)?o:a+o));var a,o;s.repeat.copy(r.scale),s.offset.copy(r.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,i[e]=s}for(const a in n){const e=n[a];let t;if(""!==e)switch(a.toLowerCase()){case"kd":i.color=(new r.Color).fromArray(e);break;case"ks":i.specular=(new r.Color).fromArray(e);break;case"ke":i.emissive=(new r.Color).fromArray(e);break;case"map_kd":s("map",e);break;case"map_ks":s("specularMap",e);break;case"map_ke":s("emissiveMap",e);break;case"norm":s("normalMap",e);break;case"map_bump":case"bump":s("bumpMap",e);break;case"map_d":s("alphaMap",e),i.transparent=!0;break;case"ns":i.shininess=parseFloat(e);break;case"d":t=parseFloat(e),t<1&&(i.opacity=t,i.transparent=!0);break;case"tr":t=parseFloat(e),this.options&&this.options.invertTrProperty&&(t=1-t),t>0&&(i.opacity=1-t,i.transparent=!0)}}return this.materials[e]=new r.MeshPhongMaterial(i),this.materials[e]}getTextureParams(e,t){const n={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},i=e.split(/\s+/);let s;return s=i.indexOf("-bm"),s>=0&&(t.bumpScale=parseFloat(i[s+1]),i.splice(s,2)),s=i.indexOf("-s"),s>=0&&(n.scale.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),s=i.indexOf("-o"),s>=0&&(n.offset.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,s){const a=void 0!==this.manager?this.manager:r.DefaultLoadingManager;let o=a.getHandler(e);null===o&&(o=new r.TextureLoader(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,s);return void 0!==t&&(l.mapping=t),l}}t.MTLLoader=i},78798:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083),s=n(61350);class a extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){let t=e,n=0;const a=new Int8Array(new Int16Array([1]).buffer)[0]>0,l={};const c=function(e,r){null==r&&(r=1);let i=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,i=2;break;case"sshort":s=Int16Array,i=2;break;case"uint":s=Uint32Array,i=4;break;case"sint":s=Int32Array,i=4;break;case"float":s=Float32Array,i=4;break;case"complex":case"double":s=Float64Array,i=8}let o=new s(t.slice(n,n+=r*i));return true!=a&&(o=function(e,t){const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)for(let e=r+t-1,i=r;e>i;e--,i++){const t=n[i];n[i]=n[e],n[e]=t}return e}(o,i)),1==r?o[0]:o}("uchar",e.byteLength),h=c.length;let u,d=null,p=0;for(u=1;u<h;u++)if(10==c[u-1]&&10==c[u]){d=this.parseChars(c,0,u-2),p=u+1;break}if(function(e){let t,n,i,s,a,c,h,u;const d=e.split(/\r?\n/);for(h=0,u=d.length;h<u;h++)a=d[h],a.match(/NRRD\d+/)?l.isNrrd=!0:a.match(/^#/)||(c=a.match(/(.*):(.*)/))&&(n=c[1].trim(),t=c[2].trim(),i=o[n],i?i.call(l,t):l[n]=t);if(!l.isNrrd)throw new Error("Not an NRRD file");if("bz2"===l.encoding||"bzip2"===l.encoding)throw new Error("Bzip is not supported");if(!l.vectors&&(l.vectors=[new r.Vector3(1,0,0),new r.Vector3(0,1,0),new r.Vector3(0,0,1)],l.spacings))for(s=0;s<=2;s++)isNaN(l.spacings[s])||l.vectors[s].multiplyScalar(l.spacings[s])}(d),t=c.subarray(p),"gz"===l.encoding.substring(0,2))t=i.gunzipSync(new Uint8Array(t));else if("ascii"===l.encoding||"text"===l.encoding||"txt"===l.encoding||"hex"===l.encoding)t=function(e,t,n){let r,i="";t=t||0,n=n||e.length;const s=l.sizes.reduce((function(e,t){return e*t}),1);let a=10;"hex"===l.encoding&&(a=16);const o=new l.__array(s);let c=0,h=parseInt;l.__array!==Float32Array&&l.__array!==Float64Array||(h=parseFloat);for(let l=t;l<n;l++)r=e[l],(r<9||r>13)&&32!==r?i+=String.fromCharCode(r):(""!==i&&(o[c]=h(i,a),c++),i="");return""!==i&&(o[c]=h(i,a),c++),o}(t);else if("raw"===l.encoding){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t[n];t=e}t=t.buffer;const f=new s.Volume;f.header=l,f.data=new l.__array(t);const m=f.computeMinMax(),g=m[0],A=m[1];f.windowLow=g,f.windowHigh=A,f.dimensions=[l.sizes[0],l.sizes[1],l.sizes[2]],f.xLength=f.dimensions[0],f.yLength=f.dimensions[1],f.zLength=f.dimensions[2];const v=new r.Vector3(l.vectors[0][0],l.vectors[0][1],l.vectors[0][2]).length(),y=new r.Vector3(l.vectors[1][0],l.vectors[1][1],l.vectors[1][2]).length(),x=new r.Vector3(l.vectors[2][0],l.vectors[2][1],l.vectors[2][2]).length();f.spacing=[v,y,x],f.matrix=new r.Matrix4;let b=1,E=1;if("left-posterior-superior"==l.space?(b=-1,E=-1):"left-anterior-superior"===l.space&&(b=-1),l.vectors){const e=l.vectors;f.matrix.set(b*e[0][0],b*e[1][0],b*e[2][0],0,E*e[0][1],E*e[1][1],E*e[2][1],0,1*e[0][2],1*e[1][2],1*e[2][2],0,0,0,0,1)}else f.matrix.set(b,0,0,0,0,E,0,0,0,0,1,0,0,0,0,1);return f.inverseMatrix=new r.Matrix4,f.inverseMatrix.copy(f.matrix).invert(),f.RASDimensions=new r.Vector3(f.xLength,f.yLength,f.zLength).applyMatrix4(f.matrix).round().toArray().map(Math.abs),f.lowerThreshold===-1/0&&(f.lowerThreshold=g),f.upperThreshold===1/0&&(f.upperThreshold=A),f}parseChars(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);let r="",i=0;for(i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}}const o={type:function(e){switch(e){case"uchar":case"unsigned char":case"uint8":case"uint8_t":this.__array=Uint8Array;break;case"signed char":case"int8":case"int8_t":this.__array=Int8Array;break;case"short":case"short int":case"signed short":case"signed short int":case"int16":case"int16_t":this.__array=Int16Array;break;case"ushort":case"unsigned short":case"unsigned short int":case"uint16":case"uint16_t":this.__array=Uint16Array;break;case"int":case"signed int":case"int32":case"int32_t":this.__array=Int32Array;break;case"uint":case"unsigned int":case"uint32":case"uint32_t":this.__array=Uint32Array;break;case"float":this.__array=Float32Array;break;case"double":this.__array=Float64Array;break;default:throw new Error("Unsupported NRRD data type: "+e)}return this.type=e},endian:function(e){return this.endian=e},encoding:function(e){return this.encoding=e},dimension:function(e){return this.dim=parseInt(e,10)},sizes:function(e){let t;return this.sizes=function(){const n=e.split(/\s+/),r=[];for(let e=0,i=n.length;e<i;e++)t=n[e],r.push(parseInt(t,10));return r}()},space:function(e){return this.space=e},"space origin":function(e){return this.space_origin=e.split("(")[1].split(")")[0].split(",")},"space directions":function(e){let t,n;const r=e.match(/\(.*?\)/g);return this.vectors=function(){const e=[];for(let i=0,s=r.length;i<s;i++)n=r[i],e.push(function(){const e=n.slice(1,-1).split(/,/),r=[];for(let n=0,i=e.length;n<i;n++)t=e[n],r.push(parseFloat(t));return r}());return e}()},spacings:function(e){let t;const n=e.split(/\s+/);return this.spacings=function(){const e=[];for(let r=0,i=n.length;r<i;r++)t=n[r],e.push(parseFloat(t));return e}()}};t.NRRDLoader=a},13446:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=/^[og]\s*(.+)?/,s=/^mtllib /,a=/^usemtl /,o=/^usemap /,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Vector3;function p(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){const r=this.vertices,i=this.object.geometry.normals;l.fromArray(r,e),c.fromArray(r,t),h.fromArray(r,n),d.subVectors(h,c),u.subVectors(l,c),d.cross(u),d.normalize(),i.push(d.x,d.y,d.z),i.push(d.x,d.y,d.z),i.push(d.x,d.y,d.z)},addColor:function(e,t,n){const r=this.colors,i=this.object.geometry.colors;void 0!==r[e]&&i.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&i.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){const r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,s,a,o,l){const c=this.vertices.length;let h=this.parseVertexIndex(e,c),u=this.parseVertexIndex(t,c),d=this.parseVertexIndex(n,c);if(this.addVertex(h,u,d),this.addColor(h,u,d),void 0!==a&&""!==a){const e=this.normals.length;h=this.parseNormalIndex(a,e),u=this.parseNormalIndex(o,e),d=this.parseNormalIndex(l,e),this.addNormal(h,u,d)}else this.addFaceNormal(h,u,d);if(void 0!==r&&""!==r){const e=this.uvs.length;h=this.parseUVIndex(r,e),u=this.parseUVIndex(i,e),d=this.parseUVIndex(s,e),this.addUV(h,u,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,r=this.uvs.length;for(let i=0,s=e.length;i<s;i++)this.addVertexLine(this.parseVertexIndex(e[i],n));for(let i=0,s=t.length;i<s;i++)this.addUVLine(this.parseUVIndex(t[i],r))}};return e.startObject("",!1),e}class f extends r.Loader{constructor(e){super(e),this.materials=null}load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new p;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));const n=e.split("\n");let l="",c="",h=0,u=[];const d="function"==typeof"".trimLeft;for(let r=0,p=n.length;r<p;r++)if(l=n[r],l=d?l.trimLeft():l.trim(),h=l.length,0!==h&&(c=l.charAt(0),"#"!==c))if("v"===c){const e=l.split(/\s+/);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?t.colors.push(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===c){const e=l.substr(1).trim().split(/\s+/),n=[];for(let t=0,i=e.length;t<i;t++){const r=e[t];if(r.length>0){const e=r.split("/");n.push(e)}}const r=n[0];for(let i=1,s=n.length-1;i<s;i++){const e=n[i],s=n[i+1];t.addFace(r[0],e[0],s[0],r[1],e[1],s[1],r[2],e[2],s[2])}}else if("l"===c){const e=l.substring(1).trim().split(" ");let n=[];const r=[];if(-1===l.indexOf("/"))n=e;else for(let t=0,i=e.length;t<i;t++){const i=e[t].split("/");""!==i[0]&&n.push(i[0]),""!==i[1]&&r.push(i[1])}t.addLineGeometry(n,r)}else if("p"===c){const e=l.substr(1).trim().split(" ");t.addPointGeometry(e)}else if(null!==(u=i.exec(l))){const e=(" "+u[0].substr(1).trim()).substr(1);t.startObject(e)}else if(a.test(l))t.object.startMaterial(l.substring(7).trim(),t.materialLibraries);else if(s.test(l))t.materialLibraries.push(l.substring(7).trim());else if(o.test(l))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===c){if(u=l.split(" "),u.length>1){const e=u[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===l)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+l+'"')}t.finalize();const f=new r.Group;f.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let i=0,s=t.objects.length;i<s;i++){const e=t.objects[i],n=e.geometry,s=e.materials,a="Line"===n.type,o="Points"===n.type;let l=!1;if(0===n.vertices.length)continue;const c=new r.BufferGeometry;c.setAttribute("position",new r.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&c.setAttribute("normal",new r.Float32BufferAttribute(n.normals,3)),n.colors.length>0&&(l=!0,c.setAttribute("color",new r.Float32BufferAttribute(n.colors,3))),!0===n.hasUVIndices&&c.setAttribute("uv",new r.Float32BufferAttribute(n.uvs,2));const h=[];for(let i=0,d=s.length;i<d;i++){const e=s[i],n=e.name+"_"+e.smooth+"_"+l;let c=t.materials[n];if(null!==this.materials)if(c=this.materials.create(e.name),!a||!c||c instanceof r.LineBasicMaterial){if(o&&c&&!(c instanceof r.PointsMaterial)){const e=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(e,c),e.color.copy(c.color),e.map=c.map,c=e}}else{const e=new r.LineBasicMaterial;r.Material.prototype.copy.call(e,c),e.color.copy(c.color),c=e}void 0===c&&(c=a?new r.LineBasicMaterial:o?new r.PointsMaterial({size:1,sizeAttenuation:!1}):new r.MeshPhongMaterial,c.name=e.name,c.flatShading=!e.smooth,c.vertexColors=l,t.materials[n]=c),h.push(c)}let u;if(h.length>1){for(let e=0,t=s.length;e<t;e++){const t=s[e];c.addGroup(t.groupStart,t.groupCount,e)}u=a?new r.LineSegments(c,h):o?new r.Points(c,h):new r.Mesh(c,h)}else u=a?new r.LineSegments(c,h[0]):o?new r.Points(c,h[0]):new r.Mesh(c,h[0]);u.name=e.name,f.add(u)}else if(t.vertices.length>0){const e=new r.PointsMaterial({size:1,sizeAttenuation:!1}),n=new r.BufferGeometry;n.setAttribute("position",new r.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(n.setAttribute("color",new r.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);const i=new r.Points(n,e);f.add(i)}return f}}t.OBJLoader=f},26386:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.littleEndian=!0}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n,e))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){const n=r.LoaderUtils.decodeText(new Uint8Array(e)),i=function(e){const t={},n=e.search(/[\r\n]DATA\s(\S*)\s/i),r=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(n-1));if(t.data=r[1],t.headerLen=r[0].length+n,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(let e=0,n=t.fields.length;e<n;e++)t.count.push(1)}t.offset={};let i=0;for(let s=0,a=t.fields.length;s<a;s++)"ascii"===t.data?t.offset[t.fields[s]]=s:(t.offset[t.fields[s]]=i,i+=t.size[s]*t.count[s]);return t.rowSize=i,t}(n),s=[],a=[],o=[];if("ascii"===i.data){const e=i.offset,t=n.substr(i.headerLen).split("\n");for(let n=0,r=t.length;n<r;n++){if(""===t[n])continue;const r=t[n].split(" ");if(void 0!==e.x&&(s.push(parseFloat(r[e.x])),s.push(parseFloat(r[e.y])),s.push(parseFloat(r[e.z]))),void 0!==e.rgb){const t=parseFloat(r[e.rgb]),n=t>>16&255,i=t>>8&255,s=t>>0&255;o.push(n/255,i/255,s/255)}void 0!==e.normal_x&&(a.push(parseFloat(r[e.normal_x])),a.push(parseFloat(r[e.normal_y])),a.push(parseFloat(r[e.normal_z])))}}if("binary_compressed"===i.data){const t=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),n=t[0],r=t[1],l=function(e,t){const n=e.length,r=new Uint8Array(t);let i,s,a,o=0,l=0;do{if(i=e[o++],i<32){if(i++,l+i>t)throw new Error("Output buffer is not large enough");if(o+i>n)throw new Error("Invalid compressed data");do{r[l++]=e[o++]}while(--i)}else{if(s=i>>5,a=l-((31&i)<<8)-1,o>=n)throw new Error("Invalid compressed data");if(7===s&&(s+=e[o++],o>=n))throw new Error("Invalid compressed data");if(a-=e[o++],l+s+2>t)throw new Error("Output buffer is not large enough");if(a<0)throw new Error("Invalid compressed data");if(a>=l)throw new Error("Invalid compressed data");do{r[l++]=r[a++]}while(2+--s)}}while(o<n);return r}(new Uint8Array(e,i.headerLen+8,n),r),c=new DataView(l.buffer),h=i.offset;for(let e=0;e<i.points;e++)void 0!==h.x&&(s.push(c.getFloat32(i.points*h.x+i.size[0]*e,this.littleEndian)),s.push(c.getFloat32(i.points*h.y+i.size[1]*e,this.littleEndian)),s.push(c.getFloat32(i.points*h.z+i.size[2]*e,this.littleEndian))),void 0!==h.rgb&&(o.push(c.getUint8(i.points*h.rgb+i.size[3]*e+2)/255),o.push(c.getUint8(i.points*h.rgb+i.size[3]*e+1)/255),o.push(c.getUint8(i.points*h.rgb+i.size[3]*e+0)/255)),void 0!==h.normal_x&&(a.push(c.getFloat32(i.points*h.normal_x+i.size[4]*e,this.littleEndian)),a.push(c.getFloat32(i.points*h.normal_y+i.size[5]*e,this.littleEndian)),a.push(c.getFloat32(i.points*h.normal_z+i.size[6]*e,this.littleEndian)))}if("binary"===i.data){const t=new DataView(e,i.headerLen),n=i.offset;for(let e=0,r=0;e<i.points;e++,r+=i.rowSize)void 0!==n.x&&(s.push(t.getFloat32(r+n.x,this.littleEndian)),s.push(t.getFloat32(r+n.y,this.littleEndian)),s.push(t.getFloat32(r+n.z,this.littleEndian))),void 0!==n.rgb&&(o.push(t.getUint8(r+n.rgb+2)/255),o.push(t.getUint8(r+n.rgb+1)/255),o.push(t.getUint8(r+n.rgb+0)/255)),void 0!==n.normal_x&&(a.push(t.getFloat32(r+n.normal_x,this.littleEndian)),a.push(t.getFloat32(r+n.normal_y,this.littleEndian)),a.push(t.getFloat32(r+n.normal_z,this.littleEndian)))}const l=new r.BufferGeometry;s.length>0&&l.setAttribute("position",new r.Float32BufferAttribute(s,3)),a.length>0&&l.setAttribute("normal",new r.Float32BufferAttribute(a,3)),o.length>0&&l.setAttribute("color",new r.Float32BufferAttribute(o,3)),l.computeBoundingSphere();const c=new r.PointsMaterial({size:.005});o.length>0?c.vertexColors=!0:c.color.setHex(16777215*Math.random());const h=new r.Points(l,c);let u=t.split("").reverse().join("");return u=/([^\/]*)/.exec(u),u=u[1].split("").reverse().join(""),h.name=u,h}}t.PCDLoader=i},67071:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function n(e,t,n,r){const i=parseInt(c[r].substr(e,t));if(i){const e=(s=n,l=i,"s"+Math.min(s,l)+"e"+Math.max(s,l));void 0===o[e]&&(a.push([n-1,i-1,1]),o[e]=a.length-1)}var s,l}const i={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},s=[],a=[],o={},l={},c=e.split("\n");for(let r=0,u=c.length;r<u;r++)if("ATOM"===c[r].substr(0,4)||"HETATM"===c[r].substr(0,6)){const e=parseFloat(c[r].substr(30,7)),n=parseFloat(c[r].substr(38,7)),a=parseFloat(c[r].substr(46,7)),o=parseInt(c[r].substr(6,5))-1;let u=t(c[r].substr(76,2)).toLowerCase();""===u&&(u=t(c[r].substr(12,2)).toLowerCase());const d=[e,n,a,i[u],(h=u,h.charAt(0).toUpperCase()+h.substr(1).toLowerCase())];s.push(d),l[o]=d}else if("CONECT"===c[r].substr(0,6)){const e=parseInt(c[r].substr(6,5));n(11,5,e,r),n(16,5,e,r),n(21,5,e,r),n(26,5,e,r)}var h;return function(){const e={geometryAtoms:new r.BufferGeometry,geometryBonds:new r.BufferGeometry,json:{atoms:s}},t=e.geometryAtoms,n=e.geometryBonds,i=[],o=[],c=[];for(let r=0,a=s.length;r<a;r++){const e=s[r],t=e[0],n=e[1],a=e[2];i.push(t,n,a);const l=e[3][0]/255,c=e[3][1]/255,h=e[3][2]/255;o.push(l,c,h)}for(let r=0,s=a.length;r<s;r++){const e=a[r],t=e[0],n=e[1],i=l[t],s=l[n];let o=i[0],h=i[1],u=i[2];c.push(o,h,u),o=s[0],h=s[1],u=s[2],c.push(o,h,u)}return t.setAttribute("position",new r.Float32BufferAttribute(i,3)),t.setAttribute("color",new r.Float32BufferAttribute(o,3)),n.setAttribute("position",new r.Float32BufferAttribute(c,3)),e}()}}t.PDBLoader=i},80353:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.propertyNameMapping={}}load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}setPropertyNameMapping(e){this.propertyNameMapping=e}parse(e){function t(e){let t="",n=0;const r=/ply([\s\S]*)end_header\r?\n/.exec(e);null!==r&&(t=r[1],n=new Blob([r[0]]).size);const i={comments:[],elements:[],headerLength:n,objInfo:""},s=t.split("\n");let a;function o(e,t){const n={type:e[0]};return"list"===n.type?(n.name=e[3],n.countType=e[1],n.itemType=e[2]):n.name=e[1],n.name in t&&(n.name=t[n.name]),n}for(let l=0;l<s.length;l++){let e=s[l];if(e=e.trim(),""===e)continue;const t=e.split(/\s+/),n=t.shift();switch(e=t.join(" "),n){case"format":i.format=t[0],i.version=t[1];break;case"comment":i.comments.push(e);break;case"element":void 0!==a&&i.elements.push(a),a={},a.name=t[0],a.count=parseInt(t[1]),a.properties=[];break;case"property":a.properties.push(o(t,u.propertyNameMapping));break;case"obj_info":i.objInfo=e;break;default:console.log("unhandled",n,t)}}return void 0!==a&&i.elements.push(a),i}function n(e,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(e);case"float":case"double":case"float32":case"float64":return parseFloat(e)}}function i(e,t){const r=t.split(/\s+/),i={};for(let s=0;s<e.length;s++)if("list"===e[s].type){const t=[],a=n(r.shift(),e[s].countType);for(let i=0;i<a;i++)t.push(n(r.shift(),e[s].itemType));i[e[s].name]=t}else i[e[s].name]=n(r.shift(),e[s].type);return i}function s(e,t){const n={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]};let r;let s="";null!==(r=/end_header\s([\s\S]*)$/.exec(e))&&(s=r[1]);const l=s.split("\n");let c=0,h=0;for(let a=0;a<l.length;a++){let e=l[a];if(e=e.trim(),""===e)continue;h>=t.elements[c].count&&(c++,h=0);const r=i(t.elements[c].properties,e);o(n,t.elements[c].name,r),h++}return a(n)}function a(e){let t=new r.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new r.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new r.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new r.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new r.Float32BufferAttribute(e.colors,3)),e.faceVertexUvs.length>0&&(t=t.toNonIndexed(),t.setAttribute("uv",new r.Float32BufferAttribute(e.faceVertexUvs,2))),t.computeBoundingSphere(),t}function o(e,t,n){if("vertex"===t)e.vertices.push(n.x,n.y,n.z),"nx"in n&&"ny"in n&&"nz"in n&&e.normals.push(n.nx,n.ny,n.nz),"s"in n&&"t"in n&&e.uvs.push(n.s,n.t),"red"in n&&"green"in n&&"blue"in n&&e.colors.push(n.red/255,n.green/255,n.blue/255);else if("face"===t){const t=n.vertex_indices||n.vertex_index,r=n.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),r&&6===r.length&&(e.faceVertexUvs.push(r[0],r[1]),e.faceVertexUvs.push(r[2],r[3]),e.faceVertexUvs.push(r[4],r[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3]))}}function l(e,t,n,r){switch(n){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,r),2];case"uint16":case"ushort":return[e.getUint16(t,r),2];case"int32":case"int":return[e.getInt32(t,r),4];case"uint32":case"uint":return[e.getUint32(t,r),4];case"float32":case"float":return[e.getFloat32(t,r),4];case"float64":case"double":return[e.getFloat64(t,r),8]}}function c(e,t,n,r){const i={};let s,a=0;for(let o=0;o<n.length;o++)if("list"===n[o].type){const c=[];s=l(e,t+a,n[o].countType,r);const h=s[0];a+=s[1];for(let i=0;i<h;i++)s=l(e,t+a,n[o].itemType,r),c.push(s[0]),a+=s[1];i[n[o].name]=c}else s=l(e,t+a,n[o].type,r),i[n[o].name]=s[0],a+=s[1];return[i,a]}let h;const u=this;if(e instanceof ArrayBuffer){const n=r.LoaderUtils.decodeText(new Uint8Array(e)),i=t(n);h="ascii"===i.format?s(n,i):function(e,t){const n={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},r="binary_little_endian"===t.format,i=new DataView(e,t.headerLength);let s,l=0;for(let a=0;a<t.elements.length;a++)for(let e=0;e<t.elements[a].count;e++){s=c(i,l,t.elements[a].properties,r),l+=s[1];const e=s[0];o(n,t.elements[a].name,e)}return a(n)}(e,i)}else h=s(e,t(e));return h}}t.PLYLoader=i},28491:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);let i=null;function s(){if(null===i){const e=new ArrayBuffer(2),t=new Uint8Array(e),n=new Uint16Array(e);t[0]=170,t[1]=187,i=43707===n[0]}return i}const a=[null,Float32Array,null,Int8Array,Int16Array,null,Int32Array,Uint8Array,Uint16Array,null,Uint32Array],o={Uint16Array:"getUint16",Uint32Array:"getUint32",Int16Array:"getInt16",Int32Array:"getInt32",Float32Array:"getFloat32",Float64Array:"getFloat64"};function l(e,t,n,r,i){const a=t.BYTES_PER_ELEMENT;let l;if(i===s()||1===a)l=new t(e,n,r);else{const s=new DataView(e,n,r*a),c=o[t.name],h=!i;l=new t(r);for(let e=0;e<r;e++)l[e]=s[c](e*a,h)}return l}class c extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const a=this,o=new r.FileLoader(a.manager);o.setPath(a.path),o.setResponseType("arraybuffer"),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),e=e.replace(/\*/g,s()?"be":"le"),o.load(e,(function(n){try{t(a.parse(n))}catch(r){i?i(r):console.error(r),a.manager.itemError(e)}}),n,i)}parse(e){const t=function(e){const t=new Uint8Array(e),n=t[0];let r=t[1];const i=!!(r>>7&1),s=r>>6&1,o=1==(r>>5&1),c=31&r;let h=0,u=0;if(o?(h=(t[2]<<16)+(t[3]<<8)+t[4],u=(t[5]<<16)+(t[6]<<8)+t[7]):(h=t[2]+(t[3]<<8)+(t[4]<<16),u=t[5]+(t[6]<<8)+(t[7]<<16)),0===n)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==n)throw new Error("PRWM decoder: Unsupported format version: "+n);if(!i){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==u)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}let d=8;const p={};for(let m=0;m<c;m++){let n="";for(;d<t.length;){const e=t[d];if(d++,0===e)break;n+=String.fromCharCode(e)}r=t[d];const i=r>>7&1,s=1+(r>>4&3),c=a[15&r];d++,d=4*Math.ceil(d/4);const u=l(e,c,d,s*h,o);d+=c.BYTES_PER_ELEMENT*s*h,p[n]={type:i,cardinality:s,values:u}}d=4*Math.ceil(d/4);let f=null;return i&&(f=l(e,1===s?Uint32Array:Uint16Array,d,u,o)),{version:n,attributes:p,indices:f}}(e),n=Object.keys(t.attributes),i=new r.BufferGeometry;for(let s=0;s<n.length;s++){const e=t.attributes[n[s]];i.setAttribute(n[s],new r.BufferAttribute(e.values,e.cardinality,e.normalized))}return null!==t.indices&&i.setIndex(new r.BufferAttribute(t.indices,1)),i}static isBigEndianPlatform(){return s()}}t.PRWMLoader=c},91004:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.CompressedTextureLoader{constructor(e){super(e)}parse(e,t){const n=new Uint32Array(e,0,13),i={buffer:e,header:n,loadMipmaps:t};return 55727696===n[0]?function(e){const t=e.header;let n,i;const a=t[12],o=t[2],l=t[6],c=t[7],h=t[10],u=t[11];switch(o){case 0:n=2,i=r.RGB_PVRTC_2BPPV1_Format;break;case 1:n=2,i=r.RGBA_PVRTC_2BPPV1_Format;break;case 2:n=4,i=r.RGB_PVRTC_4BPPV1_Format;break;case 3:n=4,i=r.RGBA_PVRTC_4BPPV1_Format;break;default:console.error("THREE.PVRLoader: Unsupported PVR format:",o)}return e.dataPtr=52+a,e.bpp=n,e.format=i,e.width=c,e.height=l,e.numSurfaces=h,e.numMipmaps=u,e.isCubemap=6===h,s(e)}(i):559044176===n[11]?function(e){const t=e.header,n=t[0],i=t[1],a=t[2],o=t[3],l=t[4],c=t[10],h=t[12],u=24,d=255&l;let p,f;const m=c>0;25===d?(f=m?r.RGBA_PVRTC_4BPPV1_Format:r.RGB_PVRTC_4BPPV1_Format,p=4):d===u?(f=m?r.RGBA_PVRTC_2BPPV1_Format:r.RGB_PVRTC_2BPPV1_Format,p=2):console.error("THREE.PVRLoader: Unknown PVR format:",d);return e.dataPtr=n,e.bpp=p,e.format=f,e.width=a,e.height=i,e.numSurfaces=h,e.numMipmaps=o+1,e.isCubemap=6===h,s(e)}(i):void console.error("THREE.PVRLoader: Unknown PVR format.")}}function s(e){const t={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},n=e.buffer;let r=e.dataPtr,i=0,s=0,a=0,o=0,l=0,c=0;const h=e.bpp,u=e.numSurfaces;2===h?(a=8,o=4):(a=4,o=4),s=a*o*h/8,t.mipmaps.length=e.numMipmaps*u;let d=0;for(;d<e.numMipmaps;){const h=e.width>>d,p=e.height>>d;l=h/a,c=p/o,l<2&&(l=2),c<2&&(c=2),i=l*c*s;for(let s=0;s<u;s++){const a={data:new Uint8Array(n,r,i),width:h,height:p};t.mipmaps[s*e.numMipmaps+d]=a,r+=i}d++}return t}t.PVRLoader=i},31150:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType}parse(e){const t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;let r=e.pos,i=-1,s=0,a="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=o.indexOf("\n"))&&s<t&&r<e.byteLength;)a+=o,s+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i&&(!1!==n&&(e.pos+=s+i+1),a+o.slice(0,i))},i=function(e,t,n,r){const i=e[t+3],s=Math.pow(2,i-128)/255;n[r+0]=e[t+0]*s,n[r+1]=e[t+1]*s,n[r+2]=e[t+2]*s,n[r+3]=1},s=function(e,t,n,i){const s=e[t+3],a=Math.pow(2,s-128)/255;n[i+0]=r.DataUtils.toHalfFloat(Math.min(e[t+0]*a,65504)),n[i+1]=r.DataUtils.toHalfFloat(Math.min(e[t+1]*a,65504)),n[i+2]=r.DataUtils.toHalfFloat(Math.min(e[t+2]*a,65504)),n[i+3]=r.DataUtils.toHalfFloat(1)},a=new Uint8Array(e);a.pos=0;const o=function(e){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,a=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;if(e.pos>=e.byteLength||!(l=n(e)))return t(1,"no header found");if(!(c=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(o.valid|=1,o.programtype=c[1],o.string+=l+"\n";l=n(e),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(r))&&(o.gamma=parseFloat(c[1])),(c=l.match(i))&&(o.exposure=parseFloat(c[1])),(c=l.match(s))&&(o.valid|=2,o.format=c[1]),(c=l.match(a))&&(o.valid|=4,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:t(3,"missing image size specifier"):t(3,"missing format specifier")}(a);if(-1!==o){const e=o.width,n=o.height,l=function(e,n,r){const i=n;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");const s=new Uint8Array(4*n*r);if(!s.length)return t(4,"unable to allocate buffer space");let a=0,o=0;const l=4*i,c=new Uint8Array(4),h=new Uint8Array(l);let u=r;for(;u>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],2!=c[0]||2!=c[1]||(c[2]<<8|c[3])!=i)return t(3,"bad rgbe scanline format");let n,r=0;for(;r<l&&o<e.byteLength;){n=e[o++];const i=n>128;if(i&&(n-=128),0===n||r+n>l)return t(3,"bad scanline data");if(i){const t=e[o++];for(let e=0;e<n;e++)h[r++]=t}else h.set(e.subarray(o,o+n),r),r+=n,o+=n}const d=i;for(let e=0;e<d;e++){let t=0;s[a]=h[e+t],t+=i,s[a+1]=h[e+t],t+=i,s[a+2]=h[e+t],t+=i,s[a+3]=h[e+t],a+=4}u--}return s}(a.subarray(a.pos),e,n);if(-1!==l){let t,a,c;switch(this.type){case r.FloatType:c=l.length/4;const e=new Float32Array(4*c);for(let t=0;t<c;t++)i(l,4*t,e,4*t);t=e,a=r.FloatType;break;case r.HalfFloatType:c=l.length/4;const n=new Uint16Array(4*c);for(let t=0;t<c;t++)s(l,4*t,n,4*t);t=n,a=r.HalfFloatType;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:n,data:t,header:o.string,gamma:o.gamma,exposure:o.exposure,type:a}}}return null}setDataType(e){return this.type=e,this}load(e,t,n,i){return super.load(e,(function(e,n){switch(e.type){case r.FloatType:case r.HalfFloatType:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),n,i)}}t.RGBELoader=i},70658:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);let i;class s extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType,this.maxRange=7}setDataType(e){return this.type=e,this}setMaxRange(e){return this.maxRange=e,this}loadCubemap(e,t,n,i){const s=new r.CubeTexture;let a=0;const o=this;function l(n){o.load(e[n],(function(e){s.images[n]=e,a++,6===a&&(s.needsUpdate=!0,t&&t(s))}),void 0,i)}for(let r=0;r<e.length;++r)l(r);return s.type=this.type,s.format=r.RGBAFormat,s.minFilter=r.LinearFilter,s.generateMipmaps=!1,s}parse(e){!function(){if(i)return i;var e,t,n;i={},i.toRGBA8=function(e){var t=e.width,n=e.height;if(null==e.tabs.acTL)return[i.toRGBA8.decodeImage(e.data,t,n,e).buffer];var r=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var s=t*n*4,a=new Uint8Array(s),o=new Uint8Array(s),l=new Uint8Array(s),c=0;c<e.frames.length;c++){var h=e.frames[c],u=h.rect.x,d=h.rect.y,p=h.rect.width,f=h.rect.height,m=i.toRGBA8.decodeImage(h.data,p,f,e);if(0!=c)for(var g=0;g<s;g++)l[g]=a[g];if(0==h.blend?i._copyTile(m,p,f,a,t,n,u,d,0):1==h.blend&&i._copyTile(m,p,f,a,t,n,u,d,1),r.push(a.buffer.slice(0)),1==h.dispose)i._copyTile(o,p,f,a,t,n,u,d,0);else if(2==h.dispose)for(g=0;g<s;g++)a[g]=l[g]}return r},i.toRGBA8.decodeImage=function(e,t,n,r){var s=t*n,a=i.decode._getBPP(r),o=Math.ceil(t*a/8),l=new Uint8Array(4*s),c=new Uint32Array(l.buffer),h=r.ctype,u=r.depth,d=i._bin.readUshort;if(6==h){var p=s<<2;if(8==u)for(var f=0;f<p;f+=4)l[f]=e[f],l[f+1]=e[f+1],l[f+2]=e[f+2],l[f+3]=e[f+3];if(16==u)for(f=0;f<p;f++)l[f]=e[f<<1]}else if(2==h){var m=r.tabs.tRNS;if(null==m){if(8==u)for(f=0;f<s;f++){var g=3*f;c[f]=255<<24|e[g+2]<<16|e[g+1]<<8|e[g]}if(16==u)for(f=0;f<s;f++)g=6*f,c[f]=255<<24|e[g+4]<<16|e[g+2]<<8|e[g]}else{var A=m[0],v=m[1],y=m[2];if(8==u)for(f=0;f<s;f++){var x=f<<2;g=3*f,c[f]=255<<24|e[g+2]<<16|e[g+1]<<8|e[g],e[g]==A&&e[g+1]==v&&e[g+2]==y&&(l[x+3]=0)}if(16==u)for(f=0;f<s;f++)x=f<<2,g=6*f,c[f]=255<<24|e[g+4]<<16|e[g+2]<<8|e[g],d(e,g)==A&&d(e,g+2)==v&&d(e,g+4)==y&&(l[x+3]=0)}}else if(3==h){var b=r.tabs.PLTE,E=r.tabs.tRNS,_=E?E.length:0;if(1==u)for(var S=0;S<n;S++){var w=S*o,M=S*t;for(f=0;f<t;f++){x=M+f<<2;var C=3*(T=e[w+(f>>3)]>>7-((7&f)<<0)&1);l[x]=b[C],l[x+1]=b[C+1],l[x+2]=b[C+2],l[x+3]=T<_?E[T]:255}}if(2==u)for(S=0;S<n;S++)for(w=S*o,M=S*t,f=0;f<t;f++)x=M+f<<2,C=3*(T=e[w+(f>>2)]>>6-((3&f)<<1)&3),l[x]=b[C],l[x+1]=b[C+1],l[x+2]=b[C+2],l[x+3]=T<_?E[T]:255;if(4==u)for(S=0;S<n;S++)for(w=S*o,M=S*t,f=0;f<t;f++)x=M+f<<2,C=3*(T=e[w+(f>>1)]>>4-((1&f)<<2)&15),l[x]=b[C],l[x+1]=b[C+1],l[x+2]=b[C+2],l[x+3]=T<_?E[T]:255;if(8==u)for(f=0;f<s;f++){var T;x=f<<2,C=3*(T=e[f]),l[x]=b[C],l[x+1]=b[C+1],l[x+2]=b[C+2],l[x+3]=T<_?E[T]:255}}else if(4==h){if(8==u)for(f=0;f<s;f++){x=f<<2;var I=e[B=f<<1];l[x]=I,l[x+1]=I,l[x+2]=I,l[x+3]=e[B+1]}if(16==u)for(f=0;f<s;f++){var B;x=f<<2,I=e[B=f<<2],l[x]=I,l[x+1]=I,l[x+2]=I,l[x+3]=e[B+2]}}else if(0==h)for(A=r.tabs.tRNS?r.tabs.tRNS:-1,S=0;S<n;S++){var R=S*o,P=S*t;if(1==u)for(var D=0;D<t;D++){var L=(I=255*(e[R+(D>>>3)]>>>7-(7&D)&1))==255*A?0:255;c[P+D]=L<<24|I<<16|I<<8|I}else if(2==u)for(D=0;D<t;D++)L=(I=85*(e[R+(D>>>2)]>>>6-((3&D)<<1)&3))==85*A?0:255,c[P+D]=L<<24|I<<16|I<<8|I;else if(4==u)for(D=0;D<t;D++)L=(I=17*(e[R+(D>>>1)]>>>4-((1&D)<<2)&15))==17*A?0:255,c[P+D]=L<<24|I<<16|I<<8|I;else if(8==u)for(D=0;D<t;D++)L=(I=e[R+D])==A?0:255,c[P+D]=L<<24|I<<16|I<<8|I;else if(16==u)for(D=0;D<t;D++)I=e[R+(D<<1)],L=d(e,R+(D<<1))==A?0:255,c[P+D]=L<<24|I<<16|I<<8|I}return l},i.decode=function(e){for(var t,n,r,s,a=new Uint8Array(e),o=8,l=i._bin,c=l.readUshort,h=l.readUint,u={tabs:{},frames:[]},d=new Uint8Array(a.length),p=0,f=0,m=[137,80,78,71,13,10,26,10],g=0;g<8;g++)if(a[g]!=m[g])throw new Error("The input is not a PNG file!");for(;o<a.length;){var A=l.readUint(a,o);o+=4;var v=l.readASCII(a,o,4);if(o+=4,"IHDR"==v)i.decode._IHDR(a,o,u);else if("CgBI"==v)u.tabs[v]=a.slice(o,o+4);else if("IDAT"==v){for(g=0;g<A;g++)d[p+g]=a[o+g];p+=A}else if("acTL"==v)u.tabs[v]={num_frames:h(a,o),num_plays:h(a,o+4)},t=new Uint8Array(a.length);else if("fcTL"==v){var y;0!=f&&((y=u.frames[u.frames.length-1]).data=i.decode._decompress(u,t.slice(0,f),y.rect.width,y.rect.height),f=0);var x={x:h(a,o+12),y:h(a,o+16),width:h(a,o+4),height:h(a,o+8)},b=c(a,o+22);b=c(a,o+20)/(0==b?100:b);var E={rect:x,delay:Math.round(1e3*b),dispose:a[o+24],blend:a[o+25]};u.frames.push(E)}else if("fdAT"==v){for(g=0;g<A-4;g++)t[f+g]=a[o+g+4];f+=A-4}else if("pHYs"==v)u.tabs[v]=[l.readUint(a,o),l.readUint(a,o+4),a[o+8]];else if("cHRM"==v)for(u.tabs[v]=[],g=0;g<8;g++)u.tabs[v].push(l.readUint(a,o+4*g));else if("tEXt"==v||"zTXt"==v){null==u.tabs[v]&&(u.tabs[v]={});var _=l.nextZero(a,o);r=l.readASCII(a,o,_-o);var S=o+A-_-1;"tEXt"==v?n=l.readASCII(a,_+1,S):(s=i.decode._inflate(a.slice(_+2,_+2+S)),n=l.readUTF8(s,0,s.length)),u.tabs[v][r]=n}else if("iTXt"==v){null==u.tabs[v]&&(u.tabs[v]={}),_=0;var w=o;_=l.nextZero(a,w),r=l.readASCII(a,w,_-w);var M=a[w=_+1];w+=2,_=l.nextZero(a,w),l.readASCII(a,w,_-w),w=_+1,_=l.nextZero(a,w),l.readUTF8(a,w,_-w),S=A-((w=_+1)-o),0==M?n=l.readUTF8(a,w,S):(s=i.decode._inflate(a.slice(w,w+S)),n=l.readUTF8(s,0,s.length)),u.tabs[v][r]=n}else if("PLTE"==v)u.tabs[v]=l.readBytes(a,o,A);else if("hIST"==v){var C=u.tabs.PLTE.length/3;for(u.tabs[v]=[],g=0;g<C;g++)u.tabs[v].push(c(a,o+2*g))}else if("tRNS"==v)3==u.ctype?u.tabs[v]=l.readBytes(a,o,A):0==u.ctype?u.tabs[v]=c(a,o):2==u.ctype&&(u.tabs[v]=[c(a,o),c(a,o+2),c(a,o+4)]);else if("gAMA"==v)u.tabs[v]=l.readUint(a,o)/1e5;else if("sRGB"==v)u.tabs[v]=a[o];else if("bKGD"==v)0==u.ctype||4==u.ctype?u.tabs[v]=[c(a,o)]:2==u.ctype||6==u.ctype?u.tabs[v]=[c(a,o),c(a,o+2),c(a,o+4)]:3==u.ctype&&(u.tabs[v]=a[o]);else if("IEND"==v)break;o+=A,l.readUint(a,o),o+=4}return 0!=f&&((y=u.frames[u.frames.length-1]).data=i.decode._decompress(u,t.slice(0,f),y.rect.width,y.rect.height)),u.data=i.decode._decompress(u,d,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},i.decode._decompress=function(e,t,n,r){var s=i.decode._getBPP(e),a=Math.ceil(n*s/8),o=new Uint8Array((a+1+e.interlace)*r);return t=e.tabs.CgBI?i.inflateRaw(t,o):i.decode._inflate(t,o),0==e.interlace?t=i.decode._filterZero(t,e,0,n,r):1==e.interlace&&(t=i.decode._readInterlace(t,e)),t},i.decode._inflate=function(e,t){return i.inflateRaw(new Uint8Array(e.buffer,2,e.length-6),t)},i.inflateRaw=((n={}).H={},n.H.N=function(e,t){var r,i,s=Uint8Array,a=0,o=0,l=0,c=0,h=0,u=0,d=0,p=0,f=0;if(3==e[0]&&0==e[1])return t||new s(0);var m=n.H,g=m.b,A=m.e,v=m.R,y=m.n,x=m.A,b=m.Z,E=m.m,_=null==t;for(_&&(t=new s(e.length>>>2<<5));0==a;)if(a=g(e,f,1),o=g(e,f+1,2),f+=3,0!=o){if(_&&(t=n.H.W(t,p+(1<<17))),1==o&&(r=E.J,i=E.h,u=511,d=31),2==o){l=A(e,f,5)+257,c=A(e,f+5,5)+1,h=A(e,f+10,4)+4,f+=14;for(var S=1,w=0;w<38;w+=2)E.Q[w]=0,E.Q[w+1]=0;for(w=0;w<h;w++){var M=A(e,f+3*w,3);E.Q[1+(E.X[w]<<1)]=M,M>S&&(S=M)}f+=3*h,y(E.Q,S),x(E.Q,S,E.u),r=E.w,i=E.d,f=v(E.u,(1<<S)-1,l+c,e,f,E.v);var C=m.V(E.v,0,l,E.C);u=(1<<C)-1;var T=m.V(E.v,l,c,E.D);d=(1<<T)-1,y(E.C,C),x(E.C,C,r),y(E.D,T),x(E.D,T,i)}for(;;){var I=r[b(e,f)&u];f+=15&I;var B=I>>>4;if(B>>>8==0)t[p++]=B;else{if(256==B)break;var R=p+B-254;if(B>264){var P=E.q[B-257];R=p+(P>>>3)+A(e,f,7&P),f+=7&P}var D=i[b(e,f)&d];f+=15&D;var L=D>>>4,F=E.c[L],U=(F>>>4)+g(e,f,15&F);for(f+=15&F;p<R;)t[p]=t[p++-U],t[p]=t[p++-U],t[p]=t[p++-U],t[p]=t[p++-U];p=R}}}else{0!=(7&f)&&(f+=8-(7&f));var O=4+(f>>>3),N=e[O-4]|e[O-3]<<8;_&&(t=n.H.W(t,p+N)),t.set(new s(e.buffer,e.byteOffset+O,N),p),f=O+N<<3,p+=N}return t.length==p?t:t.slice(0,p)},n.H.W=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(n<<1);return r.set(e,0),r},n.H.R=function(e,t,r,i,s,a){for(var o=n.H.e,l=n.H.Z,c=0;c<r;){var h=e[l(i,s)&t];s+=15&h;var u=h>>>4;if(u<=15)a[c]=u,c++;else{var d=0,p=0;16==u?(p=3+o(i,s,2),s+=2,d=a[c-1]):17==u?(p=3+o(i,s,3),s+=3):18==u&&(p=11+o(i,s,7),s+=7);for(var f=c+p;c<f;)a[c]=d,c++}}return s},n.H.V=function(e,t,n,r){for(var i=0,s=0,a=r.length>>>1;s<n;){var o=e[s+t];r[s<<1]=0,r[1+(s<<1)]=o,o>i&&(i=o),s++}for(;s<a;)r[s<<1]=0,r[1+(s<<1)]=0,s++;return i},n.H.n=function(e,t){for(var r,i,s,a,o=n.H.m,l=e.length,c=o.j,h=0;h<=t;h++)c[h]=0;for(h=1;h<l;h+=2)c[e[h]]++;var u=o.K;for(r=0,c[0]=0,i=1;i<=t;i++)r=r+c[i-1]<<1,u[i]=r;for(s=0;s<l;s+=2)0!=(a=e[s+1])&&(e[s]=u[a],u[a]++)},n.H.A=function(e,t,r){for(var i=e.length,s=n.H.m.r,a=0;a<i;a+=2)if(0!=e[a+1])for(var o=a>>1,l=e[a+1],c=o<<4|l,h=t-l,u=e[a]<<h,d=u+(1<<h);u!=d;)r[s[u]>>>15-t]=c,u++},n.H.l=function(e,t){for(var r=n.H.m.r,i=15-t,s=0;s<e.length;s+=2){var a=e[s]<<t-e[s+1];e[s]=r[a]>>>i}},n.H.M=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},n.H.I=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},n.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},n.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},n.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},n.H.m=(e=Uint16Array,t=Uint32Array,{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}),function(){for(var e=n.H.m,t=0;t<32768;t++){var r=t;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,e.r[t]=(r>>>16|r<<16)>>>17}function i(e,t,n){for(;0!=t--;)e.push(0,n)}for(t=0;t<32;t++)e.q[t]=e.S[t]<<3|e.T[t],e.c[t]=e.p[t]<<4|e.z[t];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),n.H.n(e._,9),n.H.A(e._,9,e.J),n.H.l(e._,9),i(e.$,32,5),n.H.n(e.$,5),n.H.A(e.$,5,e.h),n.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),n.H.N),i.decode._readInterlace=function(e,t){for(var n=t.width,r=t.height,s=i.decode._getBPP(t),a=s>>3,o=Math.ceil(n*s/8),l=new Uint8Array(r*o),c=0,h=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1],f=0;f<7;){for(var m=d[f],g=p[f],A=0,v=0,y=h[f];y<r;)y+=m,v++;for(var x=u[f];x<n;)x+=g,A++;var b=Math.ceil(A*s/8);i.decode._filterZero(e,t,c,A,v);for(var E,_=0,S=h[f];S<r;){for(var w=u[f],M=c+_*b<<3;w<n;){if(1==s&&(E=(E=e[M>>3])>>7-(7&M)&1,l[S*o+(w>>3)]|=E<<7-((7&w)<<0)),2==s&&(E=(E=e[M>>3])>>6-(7&M)&3,l[S*o+(w>>2)]|=E<<6-((3&w)<<1)),4==s&&(E=(E=e[M>>3])>>4-(7&M)&15,l[S*o+(w>>1)]|=E<<4-((1&w)<<2)),s>=8)for(var C=S*o+w*a,T=0;T<a;T++)l[C+T]=e[(M>>3)+T];M+=s,w+=g}_++,S+=m}A*v!=0&&(c+=v*(1+b)),f+=1}return l},i.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},i.decode._filterZero=function(e,t,n,r,s){var a=i.decode._getBPP(t),o=Math.ceil(r*a/8),l=i.decode._paeth;a=Math.ceil(a/8);var c,h,u=e[n],d=0;if(u>1&&(e[n]=[0,0,1][u-2]),3==u)for(d=a;d<o;d++)e[d+1]=e[d+1]+(e[d+1-a]>>>1)&255;for(var p=0;p<s;p++)if(d=0,0==(u=e[(h=(c=n+p*o)+p+1)-1]))for(;d<o;d++)e[c+d]=e[h+d];else if(1==u){for(;d<a;d++)e[c+d]=e[h+d];for(;d<o;d++)e[c+d]=e[h+d]+e[c+d-a]}else if(2==u)for(;d<o;d++)e[c+d]=e[h+d]+e[c+d-o];else if(3==u){for(;d<a;d++)e[c+d]=e[h+d]+(e[c+d-o]>>>1);for(;d<o;d++)e[c+d]=e[h+d]+(e[c+d-o]+e[c+d-a]>>>1)}else{for(;d<a;d++)e[c+d]=e[h+d]+l(0,e[c+d-o],0);for(;d<o;d++)e[c+d]=e[h+d]+l(e[c+d-a],e[c+d-o],e[c+d-a-o])}return e},i.decode._paeth=function(e,t,n){var r=e+t-n,i=r-e,s=r-t,a=r-n;return i*i<=s*s&&i*i<=a*a?e:s*s<=a*a?t:n},i.decode._IHDR=function(e,t,n){var r=i._bin;n.width=r.readUint(e,t),t+=4,n.height=r.readUint(e,t),t+=4,n.depth=e[t],t++,n.ctype=e[t],t++,n.compress=e[t],t++,n.filter=e[t],t++,n.interlace=e[t],t++},i._bin={nextZero:function(e,t){for(;0!=e[t];)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},writeUshort:function(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:function(e,t){return 16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII:function(e,t,n){for(var r="",i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var r,s="",a=0;a<n;a++)s+="%"+i._bin.pad(e[t+a].toString(16));try{r=decodeURIComponent(s)}catch(o){return i._bin.readASCII(e,t,n)}return r}},i._copyTile=function(e,t,n,r,i,s,a,o,l){for(var c=Math.min(t,i),h=Math.min(n,s),u=0,d=0,p=0;p<h;p++)for(var f=0;f<c;f++)if(a>=0&&o>=0?(u=p*t+f<<2,d=(o+p)*i+a+f<<2):(u=(-o+p)*t-a+f<<2,d=p*i+f<<2),0==l)r[d]=e[u],r[d+1]=e[u+1],r[d+2]=e[u+2],r[d+3]=e[u+3];else if(1==l){var m=e[u+3]*(1/255),g=e[u]*m,A=e[u+1]*m,v=e[u+2]*m,y=r[d+3]*(1/255),x=r[d]*y,b=r[d+1]*y,E=r[d+2]*y,_=1-m,S=m+y*_,w=0==S?0:1/S;r[d+3]=255*S,r[d+0]=(g+x*_)*w,r[d+1]=(A+b*_)*w,r[d+2]=(v+E*_)*w}else if(2==l)m=e[u+3],g=e[u],A=e[u+1],v=e[u+2],y=r[d+3],x=r[d],b=r[d+1],E=r[d+2],m==y&&g==x&&A==b&&v==E?(r[d]=0,r[d+1]=0,r[d+2]=0,r[d+3]=0):(r[d]=g,r[d+1]=A,r[d+2]=v,r[d+3]=m);else if(3==l){if(m=e[u+3],g=e[u],A=e[u+1],v=e[u+2],y=r[d+3],x=r[d],b=r[d+1],E=r[d+2],m==y&&g==x&&A==b&&v==E)continue;if(m<220&&y>20)return!1}return!0}}();const t=i.decode(e),n=i.toRGBA8(t)[0],s=new Uint8Array(n),a=t.width*t.height*4,o=this.type===r.HalfFloatType?new Uint16Array(a):new Float32Array(a);for(let i=0;i<s.length;i+=4){const e=s[i+0]/255,t=s[i+1]/255,n=s[i+2]/255,a=s[i+3]/255;this.type===r.HalfFloatType?(o[i+0]=r.DataUtils.toHalfFloat(Math.min(e*a*this.maxRange,65504)),o[i+1]=r.DataUtils.toHalfFloat(Math.min(t*a*this.maxRange,65504)),o[i+2]=r.DataUtils.toHalfFloat(Math.min(n*a*this.maxRange,65504)),o[i+3]=r.DataUtils.toHalfFloat(1)):(o[i+0]=e*a*this.maxRange,o[i+1]=t*a*this.maxRange,o[i+2]=n*a*this.maxRange,o[i+3]=1)}return{width:t.width,height:t.height,data:o,format:r.RGBAFormat,type:this.type,flipY:!0}}}t.RGBMLoader=s},4246:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){function t(e,t,n){for(let r=0,i=e.length;r<i;r++)if(e[r]!==t.getUint8(n+r,!1))return!1;return!0}const n=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}(e);return function(e){const n=new DataView(e);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const r=[115,111,108,105,100];for(let i=0;i<5;i++)if(t(r,n,i))return!1;return!0}(n)?function(e){const t=new DataView(e),n=t.getUint32(80,!0);let i,s,a,o,l,c,h,u,d=!1;for(let r=0;r<70;r++)1129270351==t.getUint32(r,!1)&&82==t.getUint8(r+4)&&61==t.getUint8(r+5)&&(d=!0,o=new Float32Array(3*n*3),l=t.getUint8(r+6)/255,c=t.getUint8(r+7)/255,h=t.getUint8(r+8)/255,u=t.getUint8(r+9)/255);const p=new r.BufferGeometry,f=new Float32Array(3*n*3),m=new Float32Array(3*n*3);for(let r=0;r<n;r++){const e=84+50*r,n=t.getFloat32(e,!0),u=t.getFloat32(e+4,!0),p=t.getFloat32(e+8,!0);if(d){const n=t.getUint16(e+48,!0);0==(32768&n)?(i=(31&n)/31,s=(n>>5&31)/31,a=(n>>10&31)/31):(i=l,s=c,a=h)}for(let l=1;l<=3;l++){const c=e+12*l,h=3*r*3+3*(l-1);f[h]=t.getFloat32(c,!0),f[h+1]=t.getFloat32(c+4,!0),f[h+2]=t.getFloat32(c+8,!0),m[h]=n,m[h+1]=u,m[h+2]=p,d&&(o[h]=i,o[h+1]=s,o[h+2]=a)}}return p.setAttribute("position",new r.BufferAttribute(f,3)),p.setAttribute("normal",new r.BufferAttribute(m,3)),d&&(p.setAttribute("color",new r.BufferAttribute(o,3)),p.hasColors=!0,p.alpha=u),p}(n):function(e){const t=new r.BufferGeometry,n=/solid([\s\S]*?)endsolid/g,i=/facet([\s\S]*?)endfacet/g;let s=0;const a=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,o=new RegExp("vertex"+a+a+a,"g"),l=new RegExp("normal"+a+a+a,"g"),c=[],h=[],u=new r.Vector3;let d,p=0,f=0,m=0;for(;null!==(d=n.exec(e));){f=m;const e=d[0];for(;null!==(d=i.exec(e));){let e=0,t=0;const n=d[0];for(;null!==(d=l.exec(n));)u.x=parseFloat(d[1]),u.y=parseFloat(d[2]),u.z=parseFloat(d[3]),t++;for(;null!==(d=o.exec(n));)c.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),h.push(u.x,u.y,u.z),e++,m++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+s),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+s),s++}const n=f,r=m-f;t.addGroup(n,r,p),p++}return t.setAttribute("position",new r.Float32BufferAttribute(c,3)),t.setAttribute("normal",new r.Float32BufferAttribute(h,3)),t}("string"!=typeof(i=e)?r.LoaderUtils.decodeText(new Uint8Array(i)):i);var i}}t.STLLoader=i},49935:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=this;function n(e,t,n,r,s,a,o,l){if(0==t||0==n)return void e.lineTo(l.x,l.y);r=r*Math.PI/180,t=Math.abs(t),n=Math.abs(n);const c=(o.x-l.x)/2,h=(o.y-l.y)/2,u=Math.cos(r)*c+Math.sin(r)*h,d=-Math.sin(r)*c+Math.cos(r)*h;let p=t*t,f=n*n;const m=u*u,g=d*d,A=m/p+g/f;if(A>1){const e=Math.sqrt(A);p=(t*=e)*t,f=(n*=e)*n}const v=p*g+f*m,y=(p*f-v)/v;let x=Math.sqrt(Math.max(0,y));s===a&&(x=-x);const b=x*t*d/n,E=-x*n*u/t,_=Math.cos(r)*b-Math.sin(r)*E+(o.x+l.x)/2,S=Math.sin(r)*b+Math.cos(r)*E+(o.y+l.y)/2,w=i(1,0,(u-b)/t,(d-E)/n),M=i((u-b)/t,(d-E)/n,(-u-b)/t,(-d-E)/n)%(2*Math.PI);e.currentPath.absellipse(_,S,t,n,w,w+M,0===a,r)}function i(e,t,n,r){const i=e*n+t*r,s=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r);let a=Math.acos(Math.max(-1,Math.min(1,i/s)));return e*r-t*n<0&&(a=-a),a}function s(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute("class")){const t=e.getAttribute("class").split(/\s/).filter(Boolean).map((e=>e.trim()));for(let e=0;e<t.length;e++)n=Object.assign(n,f["."+t[e]])}function r(r,i,s){void 0===s&&(s=function(e){return e.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),e}),e.hasAttribute(r)&&(t[i]=s(e.getAttribute(r))),n[r]&&(t[i]=s(n[r])),e.style&&""!==e.style[r]&&(t[i]=s(e.style[r]))}function i(e){return Math.max(0,Math.min(1,h(e)))}function s(e){return Math.max(0,h(e))}return e.hasAttribute("id")&&(n=Object.assign(n,f["#"+e.getAttribute("id")])),r("fill","fill"),r("fill-opacity","fillOpacity",i),r("fill-rule","fillRule"),r("opacity","opacity",i),r("stroke","stroke"),r("stroke-opacity","strokeOpacity",i),r("stroke-width","strokeWidth",s),r("stroke-linejoin","strokeLineJoin"),r("stroke-linecap","strokeLineCap"),r("stroke-miterlimit","strokeMiterLimit",s),r("visibility","visibility"),t}function a(e,t){return e-(t-e)}function o(e,t,n){if("string"!=typeof e)throw new TypeError("Invalid input: "+typeof e);const r={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let i=0,s=!0,a="",o="";const l=[];function c(e,t,n){const r=new SyntaxError('Unexpected character "'+e+'" at index '+t+".");throw r.partial=n,r}function h(){""!==a&&(""===o?l.push(Number(a)):l.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let u;const d=e.length;for(let p=0;p<d;p++)if(u=e[p],Array.isArray(t)&&t.includes(l.length%n)&&r.FLAGS.test(u))i=1,a=u,h();else{if(0===i){if(r.WHITESPACE.test(u))continue;if(r.DIGIT.test(u)||r.SIGN.test(u)){i=1,a=u;continue}if(r.POINT.test(u)){i=2,a=u;continue}r.COMMA.test(u)&&(s&&c(u,p,l),s=!0)}if(1===i){if(r.DIGIT.test(u)){a+=u;continue}if(r.POINT.test(u)){a+=u,i=2;continue}if(r.EXP.test(u)){i=3;continue}r.SIGN.test(u)&&1===a.length&&r.SIGN.test(a[0])&&c(u,p,l)}if(2===i){if(r.DIGIT.test(u)){a+=u;continue}if(r.EXP.test(u)){i=3;continue}r.POINT.test(u)&&"."===a[a.length-1]&&c(u,p,l)}if(3===i){if(r.DIGIT.test(u)){o+=u;continue}if(r.SIGN.test(u)){if(""===o){o+=u;continue}1===o.length&&r.SIGN.test(o)&&c(u,p,l)}}r.WHITESPACE.test(u)?(h(),i=0,s=!1):r.COMMA.test(u)?(h(),i=0,s=!0):r.SIGN.test(u)?(h(),i=1,a=u):r.POINT.test(u)?(h(),i=2,a=u):c(u,p,l)}return h(),l}const l=["mm","cm","in","pt","pc","px"],c={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function h(e){let n,r="px";if("string"==typeof e||e instanceof String)for(let t=0,i=l.length;t<i;t++){const n=l[t];if(e.endsWith(n)){r=n,e=e.substring(0,e.length-n.length);break}}return"px"===r&&"px"!==t.defaultUnit?n=c.in[t.defaultUnit]/t.defaultDPI:(n=c[r][t.defaultUnit],n<0&&(n=c[r].in*t.defaultDPI)),n*parseFloat(e)}function u(e){const t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function d(e){const t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}const p=[],f={},m=[],g=new r.Matrix3,A=new r.Matrix3,v=new r.Matrix3,y=new r.Matrix3,x=new r.Vector2,b=new r.Vector3,E=new r.Matrix3,_=(new DOMParser).parseFromString(e,"image/svg+xml");!function e(t,i){if(1!==t.nodeType)return;const l=function(e){if(!(e.hasAttribute("transform")||"use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))))return null;const t=function(e){const t=new r.Matrix3,n=g;if("use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))){const n=h(e.getAttribute("x")),r=h(e.getAttribute("y"));t.translate(n,r)}if(e.hasAttribute("transform")){const r=e.getAttribute("transform").split(")");for(let e=r.length-1;e>=0;e--){const i=r[e].trim();if(""===i)continue;const s=i.indexOf("("),a=i.length;if(s>0&&s<a){const e=i.substr(0,s),t=o(i.substr(s+1,a-s-1));switch(n.identity(),e){case"translate":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case"rotate":if(t.length>=1){let e=0,r=0,i=0;e=-t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),A.identity().translate(-r,-i),v.identity().rotate(e),y.multiplyMatrices(v,A),A.identity().translate(r,i),n.multiplyMatrices(A,y)}break;case"scale":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case"skewX":1===t.length&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===t.length&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===t.length&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1)}}t.premultiply(n)}}return t}(e);m.length>0&&t.premultiply(m[m.length-1]);return E.copy(t),m.push(t),t}(t);let c=!0,_=null;switch(t.nodeName){case"svg":break;case"style":!function(e){if(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length)return;for(let t=0;t<e.sheet.cssRules.length;t++){const n=e.sheet.cssRules[t];if(1!==n.type)continue;const r=n.selectorText.split(/,/gm).filter(Boolean).map((e=>e.trim()));for(let e=0;e<r.length;e++)f[r[e]]=Object.assign(f[r[e]]||{},n.style)}}(t);break;case"g":i=s(t,i);break;case"path":i=s(t,i),t.hasAttribute("d")&&(_=function(e){const t=new r.ShapePath,i=new r.Vector2,s=new r.Vector2,l=new r.Vector2;let c=!0,h=!1;const u=e.getAttribute("d"),d=u.match(/[a-df-z][^a-df-z]*/gi);for(let r=0,p=d.length;r<p;r++){const e=d[r],u=e.charAt(0),p=e.substr(1).trim();let f;switch(!0===c&&(h=!0,c=!1),u){case"M":f=o(p);for(let e=0,n=f.length;e<n;e+=2)i.x=f[e+0],i.y=f[e+1],s.x=i.x,s.y=i.y,0===e?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y),0===e&&l.copy(i);break;case"H":f=o(p);for(let e=0,n=f.length;e<n;e++)i.x=f[e],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"V":f=o(p);for(let e=0,n=f.length;e<n;e++)i.y=f[e],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"L":f=o(p);for(let e=0,n=f.length;e<n;e+=2)i.x=f[e+0],i.y=f[e+1],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"C":f=o(p);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(f[e+0],f[e+1],f[e+2],f[e+3],f[e+4],f[e+5]),s.x=f[e+2],s.y=f[e+3],i.x=f[e+4],i.y=f[e+5],0===e&&!0===h&&l.copy(i);break;case"S":f=o(p);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(i.x,s.x),a(i.y,s.y),f[e+0],f[e+1],f[e+2],f[e+3]),s.x=f[e+0],s.y=f[e+1],i.x=f[e+2],i.y=f[e+3],0===e&&!0===h&&l.copy(i);break;case"Q":f=o(p);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(f[e+0],f[e+1],f[e+2],f[e+3]),s.x=f[e+0],s.y=f[e+1],i.x=f[e+2],i.y=f[e+3],0===e&&!0===h&&l.copy(i);break;case"T":f=o(p);for(let e=0,n=f.length;e<n;e+=2){const n=a(i.x,s.x),r=a(i.y,s.y);t.quadraticCurveTo(n,r,f[e+0],f[e+1]),s.x=n,s.y=r,i.x=f[e+0],i.y=f[e+1],0===e&&!0===h&&l.copy(i)}break;case"A":f=o(p,[3,4],7);for(let e=0,r=f.length;e<r;e+=7){if(f[e+5]==i.x&&f[e+6]==i.y)continue;const r=i.clone();i.x=f[e+5],i.y=f[e+6],s.x=i.x,s.y=i.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],r,i),0===e&&!0===h&&l.copy(i)}break;case"m":f=o(p);for(let e=0,n=f.length;e<n;e+=2)i.x+=f[e+0],i.y+=f[e+1],s.x=i.x,s.y=i.y,0===e?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y),0===e&&l.copy(i);break;case"h":f=o(p);for(let e=0,n=f.length;e<n;e++)i.x+=f[e],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"v":f=o(p);for(let e=0,n=f.length;e<n;e++)i.y+=f[e],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"l":f=o(p);for(let e=0,n=f.length;e<n;e+=2)i.x+=f[e+0],i.y+=f[e+1],s.x=i.x,s.y=i.y,t.lineTo(i.x,i.y),0===e&&!0===h&&l.copy(i);break;case"c":f=o(p);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3],i.x+f[e+4],i.y+f[e+5]),s.x=i.x+f[e+2],s.y=i.y+f[e+3],i.x+=f[e+4],i.y+=f[e+5],0===e&&!0===h&&l.copy(i);break;case"s":f=o(p);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(i.x,s.x),a(i.y,s.y),i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3]),s.x=i.x+f[e+0],s.y=i.y+f[e+1],i.x+=f[e+2],i.y+=f[e+3],0===e&&!0===h&&l.copy(i);break;case"q":f=o(p);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(i.x+f[e+0],i.y+f[e+1],i.x+f[e+2],i.y+f[e+3]),s.x=i.x+f[e+0],s.y=i.y+f[e+1],i.x+=f[e+2],i.y+=f[e+3],0===e&&!0===h&&l.copy(i);break;case"t":f=o(p);for(let e=0,n=f.length;e<n;e+=2){const n=a(i.x,s.x),r=a(i.y,s.y);t.quadraticCurveTo(n,r,i.x+f[e+0],i.y+f[e+1]),s.x=n,s.y=r,i.x=i.x+f[e+0],i.y=i.y+f[e+1],0===e&&!0===h&&l.copy(i)}break;case"a":f=o(p,[3,4],7);for(let e=0,r=f.length;e<r;e+=7){if(0==f[e+5]&&0==f[e+6])continue;const r=i.clone();i.x+=f[e+5],i.y+=f[e+6],s.x=i.x,s.y=i.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],r,i),0===e&&!0===h&&l.copy(i)}break;case"Z":case"z":t.currentPath.autoClose=!0,t.currentPath.curves.length>0&&(i.copy(l),t.currentPath.currentPoint.copy(i),c=!0);break;default:console.warn(e)}h=!1}return t}(t));break;case"rect":i=s(t,i),_=function(e){const t=h(e.getAttribute("x")||0),n=h(e.getAttribute("y")||0),i=h(e.getAttribute("rx")||e.getAttribute("ry")||0),s=h(e.getAttribute("ry")||e.getAttribute("rx")||0),a=h(e.getAttribute("width")),o=h(e.getAttribute("height")),l=.448084975506,c=new r.ShapePath;c.moveTo(t+i,n),c.lineTo(t+a-i,n),(0!==i||0!==s)&&c.bezierCurveTo(t+a-i*l,n,t+a,n+s*l,t+a,n+s);c.lineTo(t+a,n+o-s),(0!==i||0!==s)&&c.bezierCurveTo(t+a,n+o-s*l,t+a-i*l,n+o,t+a-i,n+o);c.lineTo(t+i,n+o),(0!==i||0!==s)&&c.bezierCurveTo(t+i*l,n+o,t,n+o-s*l,t,n+o-s);c.lineTo(t,n+s),(0!==i||0!==s)&&c.bezierCurveTo(t,n+s*l,t+i*l,n,t+i,n);return c}(t);break;case"polygon":i=s(t,i),_=function(e){function t(e,t,n){const r=h(t),a=h(n);0===s?i.moveTo(r,a):i.lineTo(r,a),s++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,i=new r.ShapePath;let s=0;return e.getAttribute("points").replace(n,t),i.currentPath.autoClose=!0,i}(t);break;case"polyline":i=s(t,i),_=function(e){function t(e,t,n){const r=h(t),a=h(n);0===s?i.moveTo(r,a):i.lineTo(r,a),s++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,i=new r.ShapePath;let s=0;return e.getAttribute("points").replace(n,t),i.currentPath.autoClose=!1,i}(t);break;case"circle":i=s(t,i),_=function(e){const t=h(e.getAttribute("cx")||0),n=h(e.getAttribute("cy")||0),i=h(e.getAttribute("r")||0),s=new r.Path;s.absarc(t,n,i,0,2*Math.PI);const a=new r.ShapePath;return a.subPaths.push(s),a}(t);break;case"ellipse":i=s(t,i),_=function(e){const t=h(e.getAttribute("cx")||0),n=h(e.getAttribute("cy")||0),i=h(e.getAttribute("rx")||0),s=h(e.getAttribute("ry")||0),a=new r.Path;a.absellipse(t,n,i,s,0,2*Math.PI);const o=new r.ShapePath;return o.subPaths.push(a),o}(t);break;case"line":i=s(t,i),_=function(e){const t=h(e.getAttribute("x1")||0),n=h(e.getAttribute("y1")||0),i=h(e.getAttribute("x2")||0),s=h(e.getAttribute("y2")||0),a=new r.ShapePath;return a.moveTo(t,n),a.lineTo(i,s),a.currentPath.autoClose=!1,a}(t);break;case"defs":case"mask":c=!1;break;case"use":i=s(t,i);const l=t.href.baseVal.substring(1),u=t.viewportElement.getElementById(l);u?e(u,i):console.warn("SVGLoader: 'use node' references non-existent node id: "+l)}if(_&&(void 0!==i.fill&&"none"!==i.fill&&_.color.setStyle(i.fill),function(e,t){function n(e){b.set(e.x,e.y,1).applyMatrix3(t),e.set(b.x,b.y)}const r=function(e){return 0!==e.elements[1]||0!==e.elements[3]}(t),i=e.subPaths;for(let s=0,a=i.length;s<a;s++){const e=i[s].curves;for(let i=0;i<e.length;i++){const s=e[i];s.isLineCurve?(n(s.v1),n(s.v2)):s.isCubicBezierCurve?(n(s.v0),n(s.v1),n(s.v2),n(s.v3)):s.isQuadraticBezierCurve?(n(s.v0),n(s.v1),n(s.v2)):s.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),x.set(s.aX,s.aY),n(x),s.aX=x.x,s.aY=x.y,s.xRadius*=u(t),s.yRadius*=d(t))}}}(_,E),p.push(_),_.userData={node:t,style:i}),c){const n=t.childNodes;for(let t=0;t<n.length;t++)e(n[t],i)}l&&(m.pop(),m.length>0?E.copy(m[m.length-1]):E.identity())}(_.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4});return{paths:p,xml:_.documentElement}}static createShapes(e){const t=999999999,n=0,i=1,s=2,a=3,o=4,l=5,c=6,h={loc:n,t:0};function u(e,t,r,i){const a=e.x,o=t.x,l=r.x,c=i.x,u=e.y,p=t.y,f=r.y,m=i.y,g=(c-l)*(u-f)-(m-f)*(a-l),A=(m-f)*(o-a)-(c-l)*(p-u),v=g/A,y=((o-a)*(u-f)-(p-u)*(a-l))/A;if(0===A&&0!==g||v<=0||v>=1||y<0||y>1)return null;if(0===g&&0===A){for(let l=0;l<2;l++){if(d(0===l?r:i,e,t),h.loc==n){const e=0===l?r:i;return{x:e.x,y:e.y,t:h.t}}if(h.loc==s){return{x:+(a+h.t*(o-a)).toPrecision(10),y:+(u+h.t*(p-u)).toPrecision(10),t:h.t}}}return null}for(let s=0;s<2;s++)if(d(0===s?r:i,e,t),h.loc==n){const e=0===s?r:i;return{x:e.x,y:e.y,t:h.t}}return{x:+(a+v*(o-a)).toPrecision(10),y:+(u+v*(p-u)).toPrecision(10),t:v}}function d(e,t,r){const u=r.x-t.x,d=r.y-t.y,p=e.x-t.x,f=e.y-t.y,m=u*f-p*d;if(e.x===t.x&&e.y===t.y)return h.loc=n,void(h.t=0);if(e.x===r.x&&e.y===r.y)return h.loc=i,void(h.t=1);if(m<-Number.EPSILON)return void(h.loc=a);if(m>Number.EPSILON)return void(h.loc=o);if(u*p<0||d*f<0)return void(h.loc=l);if(Math.sqrt(u*u+d*d)<Math.sqrt(p*p+f*f))return void(h.loc=c);let g;g=0!==u?p/u:f/d,h.loc=s,h.t=g}function p(e,t,n){const i=new r.Vector2;t.getCenter(i);const s=[];return n.forEach((t=>{if(t.boundingBox.containsPoint(i)){(function(e,t){const n=[],i=[];for(let s=1;s<e.length;s++){const a=e[s-1],o=e[s];for(let e=1;e<t.length;e++){const s=u(a,o,t[e-1],t[e]);null!==s&&void 0===n.find((e=>e.t<=s.t+Number.EPSILON&&e.t>=s.t-Number.EPSILON))&&(n.push(s),i.push(new r.Vector2(s.x,s.y)))}}return i})(e,t.points).forEach((e=>{s.push({identifier:t.identifier,isCW:t.isCW,point:e})}))}})),s.sort(((e,t)=>e.point.x-t.point.x)),s}let f=0,m=t,g=-999999999,A=e.subPaths.map((e=>{const n=e.getPoints();let i=-999999999,s=t,a=-999999999,o=t;for(let t=0;t<n.length;t++){const e=n[t];e.y>i&&(i=e.y),e.y<s&&(s=e.y),e.x>a&&(a=e.x),e.x<o&&(o=e.x)}return g<=a&&(g=a+1),m>=o&&(m=o-1),{curves:e.curves,points:n,isCW:r.ShapeUtils.isClockWise(n),identifier:f++,boundingBox:new r.Box2(new r.Vector2(o,s),new r.Vector2(a,i))}}));A=A.filter((e=>e.points.length>1));const v=A.map((t=>function(e,t,n,i,s){null!=s&&""!==s||(s="nonzero");const a=new r.Vector2;e.boundingBox.getCenter(a);const o=p([new r.Vector2(n,a.y),new r.Vector2(i,a.y)],e.boundingBox,t);o.sort(((e,t)=>e.point.x-t.point.x));const l=[],c=[];o.forEach((t=>{t.identifier===e.identifier?l.push(t):c.push(t)}));const h=l[0].point.x,u=[];let d=0;for(;d<c.length&&c[d].point.x<h;)u.length>0&&u[u.length-1]===c[d].identifier?u.pop():u.push(c[d].identifier),d++;if(u.push(e.identifier),"evenodd"===s){const t=u.length%2==0,n=u[u.length-2];return{identifier:e.identifier,isHole:t,for:n}}if("nonzero"===s){let n=!0,r=null,i=null;for(let e=0;e<u.length;e++){const s=u[e];n?(i=t[s].isCW,n=!1,r=s):i!==t[s].isCW&&(i=t[s].isCW,n=!0)}return{identifier:e.identifier,isHole:n,for:r}}console.warn('fill-rule: "'+s+'" is currently not implemented.')}(t,A,m,g,e.userData.style.fillRule))),y=[];return A.forEach((e=>{if(!v[e.identifier].isHole){const t=new r.Shape;t.curves=e.curves;v.filter((t=>t.isHole&&t.for===e.identifier)).forEach((e=>{const n=A[e.identifier],i=new r.Path;i.curves=n.curves,t.holes.push(i)})),y.push(t)}})),y}static getStrokeStyle(e,t,n,r,i){return{strokeColor:t=void 0!==t?t:"#000",strokeWidth:e=void 0!==e?e:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}}static pointsToStroke(e,t,n,s){const a=[],o=[],l=[];if(0===i.pointsToStrokeWithBuffers(e,t,n,s,a,o,l))return null;const c=new r.BufferGeometry;return c.setAttribute("position",new r.Float32BufferAttribute(a,3)),c.setAttribute("normal",new r.Float32BufferAttribute(o,3)),c.setAttribute("uv",new r.Float32BufferAttribute(l,2)),c}static pointsToStrokeWithBuffers(e,t,n,i,s,a,o,l){const c=new r.Vector2,h=new r.Vector2,u=new r.Vector2,d=new r.Vector2,p=new r.Vector2,f=new r.Vector2,m=new r.Vector2,g=new r.Vector2,A=new r.Vector2,v=new r.Vector2,y=new r.Vector2,x=new r.Vector2,b=new r.Vector2,E=new r.Vector2,_=new r.Vector2,S=new r.Vector2,w=new r.Vector2;n=void 0!==n?n:12,i=void 0!==i?i:.001,l=void 0!==l?l:0;const M=(e=function(e){let t=!1;for(let r=1,s=e.length-1;r<s;r++)if(e[r].distanceTo(e[r+1])<i){t=!0;break}if(!t)return e;const n=[];n.push(e[0]);for(let r=1,s=e.length-1;r<s;r++)e[r].distanceTo(e[r+1])>=i&&n.push(e[r]);return n.push(e[e.length-1]),n}(e)).length;if(M<2)return 0;const C=e[0].equals(e[M-1]);let T,I,B=e[0];const R=t.strokeWidth/2,P=1/(M-1);let D,L,F,U,O=0,N=!1,k=0,G=3*l,z=2*l;Q(e[0],e[1],c).multiplyScalar(R),g.copy(e[0]).sub(c),A.copy(e[0]).add(c),v.copy(g),y.copy(A);for(let r=1;r<M;r++){T=e[r],I=r===M-1?C?e[1]:void 0:e[r+1];const n=c;if(Q(B,T,n),u.copy(n).multiplyScalar(R),x.copy(T).sub(u),b.copy(T).add(u),D=O+P,L=!1,void 0!==I){Q(T,I,h),u.copy(h).multiplyScalar(R),E.copy(T).sub(u),_.copy(T).add(u),F=!0,u.subVectors(I,B),n.dot(u)<0&&(F=!1),1===r&&(N=F),u.subVectors(I,T),u.normalize();const e=Math.abs(n.dot(u));if(0!==e){const n=R/e;u.multiplyScalar(-n),d.subVectors(T,B),p.copy(d).setLength(n).add(u),S.copy(p).negate();const r=p.length(),i=d.length();d.divideScalar(i),f.subVectors(I,T);const s=f.length();switch(f.divideScalar(s),d.dot(S)<i&&f.dot(S)<s&&(L=!0),w.copy(p).add(T),S.add(T),U=!1,L?F?(_.copy(S),b.copy(S)):(E.copy(S),x.copy(S)):j(),t.strokeLineJoin){case"bevel":W(F,L,D);break;case"round":X(F,L),F?H(T,x,E,D,0):H(T,_,b,D,1);break;default:const e=R*t.strokeMiterLimit/r;if(e<1){if("miter-clip"!==t.strokeLineJoin){W(F,L,D);break}X(F,L),F?(f.subVectors(w,x).multiplyScalar(e).add(x),m.subVectors(w,E).multiplyScalar(e).add(E),V(x,D,0),V(f,D,0),V(T,D,.5),V(T,D,.5),V(f,D,0),V(m,D,0),V(T,D,.5),V(m,D,0),V(E,D,0)):(f.subVectors(w,b).multiplyScalar(e).add(b),m.subVectors(w,_).multiplyScalar(e).add(_),V(b,D,1),V(f,D,1),V(T,D,.5),V(T,D,.5),V(f,D,1),V(m,D,1),V(T,D,.5),V(m,D,1),V(_,D,1))}else L?(F?(V(A,O,1),V(g,O,0),V(w,D,0),V(A,O,1),V(w,D,0),V(S,D,1)):(V(A,O,1),V(g,O,0),V(w,D,1),V(g,O,0),V(S,D,0),V(w,D,1)),F?E.copy(w):_.copy(w)):F?(V(x,D,0),V(w,D,0),V(T,D,.5),V(T,D,.5),V(w,D,0),V(E,D,0)):(V(b,D,1),V(w,D,1),V(T,D,.5),V(T,D,.5),V(w,D,1),V(_,D,1)),U=!0}}else j()}else j();C||r!==M-1||Y(e[0],v,y,F,!0,O),O=D,B=T,g.copy(E),A.copy(_)}if(C){if(L&&s){let e=w,t=S;N!==F&&(e=S,t=w),F?(U||N)&&(t.toArray(s,0),t.toArray(s,9),U&&e.toArray(s,3)):!U&&N||(t.toArray(s,3),t.toArray(s,9),U&&e.toArray(s,0))}}else Y(T,x,b,F,!1,D);return k;function Q(e,t,n){return n.subVectors(t,e),n.set(-n.y,n.x).normalize()}function V(e,t,n){s&&(s[G]=e.x,s[G+1]=e.y,s[G+2]=0,a&&(a[G]=0,a[G+1]=0,a[G+2]=1),G+=3,o&&(o[z]=t,o[z+1]=n,z+=2)),k+=3}function H(e,t,r,i,s){c.copy(t).sub(e).normalize(),h.copy(r).sub(e).normalize();let a=Math.PI;const o=c.dot(h);Math.abs(o)<1&&(a=Math.abs(Math.acos(o))),a/=n,u.copy(t);for(let l=0,c=n-1;l<c;l++)d.copy(u).rotateAround(e,a),V(u,i,s),V(d,i,s),V(e,i,.5),u.copy(d);V(d,i,s),V(r,i,s),V(e,i,.5)}function j(){V(A,O,1),V(g,O,0),V(x,D,0),V(A,O,1),V(x,D,1),V(b,D,0)}function W(e,t,n){t?e?(V(A,O,1),V(g,O,0),V(x,D,0),V(A,O,1),V(x,D,0),V(S,D,1),V(x,n,0),V(E,n,0),V(S,n,.5)):(V(A,O,1),V(g,O,0),V(b,D,1),V(g,O,0),V(S,D,0),V(b,D,1),V(b,n,1),V(_,n,0),V(S,n,.5)):e?(V(x,n,0),V(E,n,0),V(T,n,.5)):(V(b,n,1),V(_,n,0),V(T,n,.5))}function X(e,t){t&&(e?(V(A,O,1),V(g,O,0),V(x,D,0),V(A,O,1),V(x,D,0),V(S,D,1),V(x,O,0),V(T,D,.5),V(S,D,1),V(T,D,.5),V(E,O,0),V(S,D,1)):(V(A,O,1),V(g,O,0),V(b,D,1),V(g,O,0),V(S,D,0),V(b,D,1),V(b,O,1),V(S,D,0),V(T,D,.5),V(T,D,.5),V(S,D,0),V(_,O,1)))}function Y(e,n,r,i,a,o){switch(t.strokeLineCap){case"round":a?H(e,r,n,o,.5):H(e,n,r,o,.5);break;case"square":if(a)c.subVectors(n,e),h.set(c.y,-c.x),u.addVectors(c,h).add(e),d.subVectors(h,c).add(e),i?(u.toArray(s,3),d.toArray(s,0),d.toArray(s,9)):(u.toArray(s,3),u.toArray(s,9),d.toArray(s,0));else{c.subVectors(r,e),h.set(c.y,-c.x),u.addVectors(c,h).add(e),d.subVectors(h,c).add(e);const t=s.length;i?(u.toArray(s,t-3),d.toArray(s,t-6),d.toArray(s,t-12)):(u.toArray(s,t-6),d.toArray(s,t-3),d.toArray(s,t-12))}}}}}t.SVGLoader=i},78929:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{constructor(e){super(e),this.debug=!1,this.group=null,this.position=0,this.materials=[],this.meshes=[]}load(e,t,n,i){const s=this,a=""===this.path?r.LoaderUtils.extractUrlBase(e):this.path,o=new r.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){this.group=new r.Group,this.position=0,this.materials=[],this.meshes=[],this.readFile(e,t);for(let n=0;n<this.meshes.length;n++)this.group.add(this.meshes[n]);return this.group}readFile(e,t){const n=new DataView(e),r=this.readChunk(n);if(r.id===a||r.id===o||r.id===s){let e=this.nextChunk(n,r);for(;0!==e;){if(e===l){const e=this.readDWord(n);this.debugMessage("3DS file version: "+e)}else e===m?(this.resetPosition(n),this.readMeshData(n,t)):this.debugMessage("Unknown main chunk: "+e.toString(16));e=this.nextChunk(n,r)}}this.debugMessage("Parsed "+this.meshes.length+" meshes")}readMeshData(e,t){const n=this.readChunk(e);let r=this.nextChunk(e,n);for(;0!==r;){if(r===g){const t=+this.readDWord(e);this.debugMessage("Mesh Version: "+t)}else if(r===A){const t=this.readFloat(e);this.debugMessage("Master scale: "+t),this.group.scale.set(t,t,t)}else r===N?(this.debugMessage("Named Object"),this.resetPosition(e),this.readNamedObject(e)):r===v?(this.debugMessage("Material"),this.resetPosition(e),this.readMaterialEntry(e,t)):this.debugMessage("Unknown MDATA chunk: "+r.toString(16));r=this.nextChunk(e,n)}}readNamedObject(e){const t=this.readChunk(e),n=this.readString(e,64);t.cur=this.position;let r=this.nextChunk(e,t);for(;0!==r;){if(r===k){this.resetPosition(e);const t=this.readMesh(e);t.name=n,this.meshes.push(t)}else this.debugMessage("Unknown named object chunk: "+r.toString(16));r=this.nextChunk(e,t)}this.endChunk(t)}readMaterialEntry(e,t){const n=this.readChunk(e);let i=this.nextChunk(e,n);const s=new r.MeshPhongMaterial;for(;0!==i;){if(i===y)s.name=this.readString(e,64),this.debugMessage(" Name: "+s.name);else if(i===C)this.debugMessage(" Wireframe"),s.wireframe=!0;else if(i===T){const t=this.readByte(e);s.wireframeLinewidth=t,this.debugMessage(" Wireframe Thickness: "+t)}else if(i===w)s.side=r.DoubleSide,this.debugMessage(" DoubleSided");else if(i===M)this.debugMessage(" Additive Blending"),s.blending=r.AdditiveBlending;else if(i===b)this.debugMessage(" Diffuse Color"),s.color=this.readColor(e);else if(i===E)this.debugMessage(" Specular Color"),s.specular=this.readColor(e);else if(i===x)this.debugMessage(" Ambient color"),s.color=this.readColor(e);else if(i===_){const t=this.readPercentage(e);s.shininess=100*t,this.debugMessage(" Shininess : "+t)}else if(i===S){const t=this.readPercentage(e);s.opacity=1-t,this.debugMessage(" Transparency : "+t),s.transparent=s.opacity<1}else i===I?(this.debugMessage(" ColorMap"),this.resetPosition(e),s.map=this.readMap(e,t)):i===R?(this.debugMessage(" BumpMap"),this.resetPosition(e),s.bumpMap=this.readMap(e,t)):i===B?(this.debugMessage(" OpacityMap"),this.resetPosition(e),s.alphaMap=this.readMap(e,t)):i===P?(this.debugMessage(" SpecularMap"),this.resetPosition(e),s.specularMap=this.readMap(e,t)):this.debugMessage(" Unknown material chunk: "+i.toString(16));i=this.nextChunk(e,n)}this.endChunk(n),this.materials[s.name]=s}readMesh(e){const t=this.readChunk(e);let n=this.nextChunk(e,t);const i=new r.BufferGeometry,s=new r.MeshPhongMaterial,a=new r.Mesh(i,s);for(a.name="mesh";0!==n;){if(n===G){const t=this.readWord(e);this.debugMessage(" Vertex: "+t);const n=[];for(let r=0;r<t;r++)n.push(this.readFloat(e)),n.push(this.readFloat(e)),n.push(this.readFloat(e));i.setAttribute("position",new r.Float32BufferAttribute(n,3))}else if(n===z)this.resetPosition(e),this.readFaceArray(e,a);else if(n===V){const t=this.readWord(e);this.debugMessage(" UV: "+t);const n=[];for(let r=0;r<t;r++)n.push(this.readFloat(e)),n.push(this.readFloat(e));i.setAttribute("uv",new r.Float32BufferAttribute(n,2))}else if(n===H){this.debugMessage(" Tranformation Matrix (TODO)");const t=[];for(let r=0;r<12;r++)t[r]=this.readFloat(e);const n=new r.Matrix4;n.elements[0]=t[0],n.elements[1]=t[6],n.elements[2]=t[3],n.elements[3]=t[9],n.elements[4]=t[2],n.elements[5]=t[8],n.elements[6]=t[5],n.elements[7]=t[11],n.elements[8]=t[1],n.elements[9]=t[7],n.elements[10]=t[4],n.elements[11]=t[10],n.elements[12]=0,n.elements[13]=0,n.elements[14]=0,n.elements[15]=1,n.transpose();const s=new r.Matrix4;s.copy(n).invert(),i.applyMatrix4(s),n.decompose(a.position,a.quaternion,a.scale)}else this.debugMessage(" Unknown mesh chunk: "+n.toString(16));n=this.nextChunk(e,t)}return this.endChunk(t),i.computeVertexNormals(),a}readFaceArray(e,t){const n=this.readChunk(e),r=this.readWord(e);this.debugMessage(" Faces: "+r);const i=[];for(let o=0;o<r;++o)i.push(this.readWord(e),this.readWord(e),this.readWord(e)),this.readWord(e);t.geometry.setIndex(i);let s=0,a=0;for(;this.position<n.end;){const n=this.readChunk(e);if(n.id===Q){this.debugMessage(" Material Group"),this.resetPosition(e);const n=this.readMaterialGroup(e),r=3*n.index.length;t.geometry.addGroup(a,r,s),a+=r,s++;const i=this.materials[n.name];!1===Array.isArray(t.material)&&(t.material=[]),void 0!==i&&t.material.push(i)}else this.debugMessage(" Unknown face array chunk: "+n.toString(16));this.endChunk(n)}1===t.material.length&&(t.material=t.material[0]),this.endChunk(n)}readMap(e,t){const n=this.readChunk(e);let i=this.nextChunk(e,n),s={};const a=new r.TextureLoader(this.manager);for(a.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);0!==i;){if(i===D){const n=this.readString(e,128);s=a.load(n),this.debugMessage(" File: "+t+n)}else i===U?(s.offset.x=this.readFloat(e),this.debugMessage(" OffsetX: "+s.offset.x)):i===O?(s.offset.y=this.readFloat(e),this.debugMessage(" OffsetY: "+s.offset.y)):i===L?(s.repeat.x=this.readFloat(e),this.debugMessage(" RepeatX: "+s.repeat.x)):i===F?(s.repeat.y=this.readFloat(e),this.debugMessage(" RepeatY: "+s.repeat.y)):this.debugMessage(" Unknown map chunk: "+i.toString(16));i=this.nextChunk(e,n)}return this.endChunk(n),s}readMaterialGroup(e){this.readChunk(e);const t=this.readString(e,64),n=this.readWord(e);this.debugMessage(" Name: "+t),this.debugMessage(" Faces: "+n);const r=[];for(let i=0;i<n;++i)r.push(this.readWord(e));return{name:t,index:r}}readColor(e){const t=this.readChunk(e),n=new r.Color;if(t.id===h||t.id===u){const t=this.readByte(e),r=this.readByte(e),i=this.readByte(e);n.setRGB(t/255,r/255,i/255),this.debugMessage(" Color: "+n.r+", "+n.g+", "+n.b)}else if(t.id===c||t.id===d){const t=this.readFloat(e),r=this.readFloat(e),i=this.readFloat(e);n.setRGB(t,r,i),this.debugMessage(" Color: "+n.r+", "+n.g+", "+n.b)}else this.debugMessage(" Unknown color chunk: "+t.toString(16));return this.endChunk(t),n}readChunk(e){const t={};return t.cur=this.position,t.id=this.readWord(e),t.size=this.readDWord(e),t.end=t.cur+t.size,t.cur+=6,t}endChunk(e){this.position=e.end}nextChunk(e,t){if(t.cur>=t.end)return 0;this.position=t.cur;try{const n=this.readChunk(e);return t.cur+=n.size,n.id}catch(n){return this.debugMessage("Unable to read chunk at "+this.position),0}}resetPosition(){this.position-=6}readByte(e){const t=e.getUint8(this.position,!0);return this.position+=1,t}readFloat(e){try{const t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}}readInt(e){const t=e.getInt32(this.position,!0);return this.position+=4,t}readShort(e){const t=e.getInt16(this.position,!0);return this.position+=2,t}readDWord(e){const t=e.getUint32(this.position,!0);return this.position+=4,t}readWord(e){const t=e.getUint16(this.position,!0);return this.position+=2,t}readString(e,t){let n="";for(let r=0;r<t;r++){const t=this.readByte(e);if(!t)break;n+=String.fromCharCode(t)}return n}readPercentage(e){const t=this.readChunk(e);let n;switch(t.id){case p:n=this.readShort(e)/100;break;case f:n=this.readFloat(e);break;default:this.debugMessage(" Unknown percentage chunk: "+t.toString(16))}return this.endChunk(t),n}debugMessage(e){this.debug&&console.log(e)}}const s=19789,a=15786,o=49725,l=2,c=16,h=17,u=18,d=19,p=48,f=49,m=15677,g=15678,A=256,v=45055,y=40960,x=40976,b=40992,E=41008,_=41024,S=41040,w=41089,M=41091,C=41093,T=41095,I=41472,B=41488,R=41520,P=41476,D=41728,L=41812,F=41814,U=41816,O=41818,N=16384,k=16640,G=16656,z=16672,Q=16688,V=16704,H=16736;t.TDSLoader=i},2545:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.DataTextureLoader{constructor(e){super(e)}parse(e){const t=0,n=1,i=2,s=3,a=9,o=10,l=11,c=48,h=4,u=0,d=1,p=2,f=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let m=0;const g=new Uint8Array(e),A={id_length:g[m++],colormap_type:g[m++],image_type:g[m++],colormap_index:g[m++]|g[m++]<<8,colormap_length:g[m++]|g[m++]<<8,colormap_size:g[m++],origin:[g[m++]|g[m++]<<8,g[m++]|g[m++]<<8],width:g[m++]|g[m++]<<8,height:g[m++]|g[m++]<<8,pixel_size:g[m++],flags:g[m++]};!function(e){switch(e.image_type){case n:case a:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case i:case s:case o:case l:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(A),A.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=A.id_length;let v=!1,y=!1,x=!1;switch(A.image_type){case a:v=!0,y=!0;break;case n:y=!0;break;case o:v=!0;break;case i:break;case l:v=!0,x=!0;break;case s:x=!0}const b=new Uint8Array(A.width*A.height*4),E=function(e,t,n,r,i){let s,a;const o=n.pixel_size>>3,l=n.width*n.height*o;if(t&&(a=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),e){let e,t,n;s=new Uint8Array(l);let a=0;const c=new Uint8Array(o);for(;a<l;)if(e=i[r++],t=1+(127&e),128&e){for(n=0;n<o;++n)c[n]=i[r++];for(n=0;n<t;++n)s.set(c,a+n*o);a+=o*t}else{for(t*=o,n=0;n<t;++n)s[a+n]=i[r++];a+=t}}else s=i.subarray(r,r+=t?n.width*n.height:l);return{pixel_data:s,palettes:a}}(v,y,A,m,g);return function(e,t,n,r,i){let s,a,o,l,m,g;switch((A.flags&c)>>h){default:case p:s=0,o=1,m=t,a=0,l=1,g=n;break;case u:s=0,o=1,m=t,a=n-1,l=-1,g=-1;break;case f:s=t-1,o=-1,m=-1,a=0,l=1,g=n;break;case d:s=t-1,o=-1,m=-1,a=n-1,l=-1,g=-1}if(x)switch(A.pixel_size){case 8:!function(e,t,n,r,i,s,a,o){let l,c,h,u=0;const d=A.width;for(h=t;h!==r;h+=n)for(c=i;c!==a;c+=s,u++)l=o[u],e[4*(c+d*h)+0]=l,e[4*(c+d*h)+1]=l,e[4*(c+d*h)+2]=l,e[4*(c+d*h)+3]=255}(e,a,l,g,s,o,m,r);break;case 16:!function(e,t,n,r,i,s,a,o){let l,c,h=0;const u=A.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,h+=2)e[4*(l+u*c)+0]=o[h+0],e[4*(l+u*c)+1]=o[h+0],e[4*(l+u*c)+2]=o[h+0],e[4*(l+u*c)+3]=o[h+1]}(e,a,l,g,s,o,m,r);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(A.pixel_size){case 8:!function(e,t,n,r,i,s,a,o,l){const c=l;let h,u,d,p=0;const f=A.width;for(d=t;d!==r;d+=n)for(u=i;u!==a;u+=s,p++)h=o[p],e[4*(u+f*d)+3]=255,e[4*(u+f*d)+2]=c[3*h+0],e[4*(u+f*d)+1]=c[3*h+1],e[4*(u+f*d)+0]=c[3*h+2]}(e,a,l,g,s,o,m,r,i);break;case 16:!function(e,t,n,r,i,s,a,o){let l,c,h,u=0;const d=A.width;for(h=t;h!==r;h+=n)for(c=i;c!==a;c+=s,u+=2)l=o[u+0]+(o[u+1]<<8),e[4*(c+d*h)+0]=(31744&l)>>7,e[4*(c+d*h)+1]=(992&l)>>2,e[4*(c+d*h)+2]=(31&l)>>3,e[4*(c+d*h)+3]=32768&l?0:255}(e,a,l,g,s,o,m,r);break;case 24:!function(e,t,n,r,i,s,a,o){let l,c,h=0;const u=A.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,h+=3)e[4*(l+u*c)+3]=255,e[4*(l+u*c)+2]=o[h+0],e[4*(l+u*c)+1]=o[h+1],e[4*(l+u*c)+0]=o[h+2]}(e,a,l,g,s,o,m,r);break;case 32:!function(e,t,n,r,i,s,a,o){let l,c,h=0;const u=A.width;for(c=t;c!==r;c+=n)for(l=i;l!==a;l+=s,h+=4)e[4*(l+u*c)+2]=o[h+0],e[4*(l+u*c)+1]=o[h+1],e[4*(l+u*c)+0]=o[h+2],e[4*(l+u*c)+3]=o[h+3]}(e,a,l,g,s,o,m,r);break;default:console.error("THREE.TGALoader: Format not supported.")}}(b,A.width,A.height,E.pixel_data,E.palettes),{data:b,width:A.width,height:A.height,flipY:!0,generateMipmaps:!0,minFilter:r.LinearMipmapLinearFilter}}}t.TGALoader=i},60716:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(55599);class s extends r.Loader{constructor(e){super(e),this.reversed=!1}load(e,t,n,s){const a=this,o=new r.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(n))}catch(r){s?s(r):console.error(r),a.manager.itemError(e)}}),n,s)}parse(e){function t(e){const t=[];let n;e.forEach((function(e){"m"===e.type.toLowerCase()?(n=[e],t.push(n)):"z"!==e.type.toLowerCase()&&n.push(e)}));const r=[];return t.forEach((function(e){const t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};r.push(t);for(let n=e.length-1;n>0;n--){const t=e[n],i={type:t.type};void 0!==t.x2&&void 0!==t.y2?(i.x1=t.x2,i.y1=t.y2,i.x2=t.x1,i.y2=t.y1):void 0!==t.x1&&void 0!==t.y1&&(i.x1=t.x1,i.y1=t.y1),i.x=e[n-1].x,i.y=e[n-1].y,r.push(i)}})),r}return function(e,n){const r=Math.round,i={},s=1e5/(72*(e.unitsPerEm||2048)),a=e.encoding.cmap.glyphIndexMap,o=Object.keys(a);for(let l=0;l<o.length;l++){const c=o[l],h=e.glyphs.glyphs[a[c]];if(void 0!==c){const e={ha:r(h.advanceWidth*s),x_min:r(h.xMin*s),x_max:r(h.xMax*s),o:""};n&&(h.path.commands=t(h.path.commands)),h.path.commands.forEach((function(t){"c"===t.type.toLowerCase()&&(t.type="b"),e.o+=t.type.toLowerCase()+" ",void 0!==t.x&&void 0!==t.y&&(e.o+=r(t.x*s)+" "+r(t.y*s)+" "),void 0!==t.x1&&void 0!==t.y1&&(e.o+=r(t.x1*s)+" "+r(t.y1*s)+" "),void 0!==t.x2&&void 0!==t.y2&&(e.o+=r(t.x2*s)+" "+r(t.y2*s)+" ")})),i[String.fromCodePoint(h.unicode)]=e}}return{glyphs:i,familyName:e.getEnglishName("fullName"),ascender:r(e.ascender*s),descender:r(e.descender*s),underlinePosition:e.tables.post.underlinePosition,underlineThickness:e.tables.post.underlineThickness,boundingBox:{xMin:e.tables.head.xMin,xMax:e.tables.head.xMax,yMin:e.tables.head.yMin,yMax:e.tables.head.yMax},resolution:1e3,original_font_information:e.tables.name}}(i.parse(e),this.reversed)}}t.TTFLoader=s},59198:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083);class s extends r.Loader{load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=new r.Group,n=i.unzipSync(new Uint8Array(e.slice(16))),s=JSON.parse(i.strFromU8(n["metadata.json"])),o=new DataView(n["data.sketch"].buffer),l=o.getInt32(16,!0),c={};let u=20;for(let r=0;r<l;r++){const e=o.getInt32(u,!0),t=[o.getFloat32(u+4,!0),o.getFloat32(u+8,!0),o.getFloat32(u+12,!0),o.getFloat32(u+16,!0)],n=o.getFloat32(u+20,!0),r=o.getUint32(u+24,!0),i=o.getUint32(u+28,!0);let s=0,a=0;for(let o=0;o<4;o++){const e=1<<o;(r&e)>0&&(s+=4),(i&e)>0&&(a+=4)}u=u+28+s+4;const l=o.getInt32(u,!0),h=new Float32Array(3*l),d=new Float32Array(4*l);u+=4;for(let c=0,p=0;c<h.length;c+=3,p+=4)h[c+0]=o.getFloat32(u+0,!0),h[c+1]=o.getFloat32(u+4,!0),h[c+2]=o.getFloat32(u+8,!0),d[p+0]=o.getFloat32(u+12,!0),d[p+1]=o.getFloat32(u+16,!0),d[p+2]=o.getFloat32(u+20,!0),d[p+3]=o.getFloat32(u+24,!0),u=u+28+a;e in c==!1&&(c[e]=[]),c[e].push([h,d,n,t])}for(const i in c){const e=new a(c[i]),n=h(s.BrushIndex[i]);t.add(new r.Mesh(e,n))}return t}}class a extends r.BufferGeometry{constructor(e){super();const t=[],n=[],i=[],s=new r.Vector3,a=new r.Vector3,o=new r.Quaternion,l=new r.Quaternion,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Vector3;for(const r in e){const p=e[r],f=p[0],m=p[1],g=p[2],A=p[3];a.fromArray(f,0),l.fromArray(m,0);for(let e=3,r=4,v=f.length;e<v;e+=3,r+=4){s.fromArray(f,e),o.fromArray(m,r),c.set(-g,0,0),c.applyQuaternion(o),c.add(s),h.set(g,0,0),h.applyQuaternion(o),h.add(s),u.set(g,0,0),u.applyQuaternion(l),u.add(a),d.set(-g,0,0),d.applyQuaternion(l),d.add(a),t.push(c.x,c.y,-c.z),t.push(h.x,h.y,-h.z),t.push(d.x,d.y,-d.z),t.push(h.x,h.y,-h.z),t.push(u.x,u.y,-u.z),t.push(d.x,d.y,-d.z),a.copy(s),l.copy(o),n.push(...A),n.push(...A),n.push(...A),n.push(...A),n.push(...A),n.push(...A);const p=e/v,y=(e-3)/v;i.push(p,0),i.push(p,1),i.push(y,0),i.push(p,1),i.push(y,1),i.push(y,0)}}this.setAttribute("position",new r.BufferAttribute(new Float32Array(t),3)),this.setAttribute("color",new r.BufferAttribute(new Float32Array(n),4)),this.setAttribute("uv",new r.BufferAttribute(new Float32Array(i),2))}}const o={"89d104cd-d012-426b-b5b3-bbaee63ac43c":"Bubbles","700f3aa8-9a7c-2384-8b8a-ea028905dd8c":"CelVinyl","0f0ff7b2-a677-45eb-a7d6-0cd7206f4816":"ChromaticWave","1161af82-50cf-47db-9706-0c3576d43c43":"CoarseBristles","79168f10-6961-464a-8be1-57ed364c5600":"CoarseBristlesSingleSided","1caa6d7d-f015-3f54-3a4b-8b5354d39f81":"Comet","c8313697-2563-47fc-832e-290f4c04b901":"DiamondHull","4391aaaa-df73-4396-9e33-31e4e4930b27":"Disco","d1d991f2-e7a0-4cf1-b328-f57e915e6260":"DotMarker","6a1cf9f9-032c-45ec-9b1d-a6680bee30f7":"Dots","0d3889f3-3ede-470c-8af4-f44813306126":"DoubleTaperedFlat","0d3889f3-3ede-470c-8af4-de4813306126":"DoubleTaperedMarker","d0262945-853c-4481-9cbd-88586bed93cb":"DuctTape","3ca16e2f-bdcd-4da2-8631-dcef342f40f1":"DuctTapeSingleSided","f6e85de3-6dcc-4e7f-87fd-cee8c3d25d51":"Electricity","02ffb866-7fb2-4d15-b761-1012cefb1360":"Embers","cb92b597-94ca-4255-b017-0e3f42f12f9e":"Fire","2d35bcf0-e4d8-452c-97b1-3311be063130":"Flat","55303bc4-c749-4a72-98d9-d23e68e76e18":"FlatDeprecated","280c0a7a-aad8-416c-a7d2-df63d129ca70":"FlatSingleSided","cf019139-d41c-4eb0-a1d0-5cf54b0a42f3":"Highlighter","6a1cf9f9-032c-45ec-9b6e-a6680bee32e9":"HyperGrid","dce872c2-7b49-4684-b59b-c45387949c5c":"Hypercolor","e8ef32b1-baa8-460a-9c2c-9cf8506794f5":"HypercolorSingleSided","2f212815-f4d3-c1a4-681a-feeaf9c6dc37":"Icing","f5c336cf-5108-4b40-ade9-c687504385ab":"Ink","c0012095-3ffd-4040-8ee1-fc180d346eaa":"InkSingleSided","4a76a27a-44d8-4bfe-9a8c-713749a499b0":"Leaves","ea19de07-d0c0-4484-9198-18489a3c1487":"LeavesSingleSided","2241cd32-8ba2-48a5-9ee7-2caef7e9ed62":"Light","4391aaaa-df81-4396-9e33-31e4e4930b27":"LightWire","d381e0f5-3def-4a0d-8853-31e9200bcbda":"Lofted","429ed64a-4e97-4466-84d3-145a861ef684":"Marker","79348357-432d-4746-8e29-0e25c112e3aa":"MatteHull","b2ffef01-eaaa-4ab5-aa64-95a2c4f5dbc6":"NeonPulse","f72ec0e7-a844-4e38-82e3-140c44772699":"OilPaint","c515dad7-4393-4681-81ad-162ef052241b":"OilPaintSingleSided","f1114e2e-eb8d-4fde-915a-6e653b54e9f5":"Paper","759f1ebd-20cd-4720-8d41-234e0da63716":"PaperSingleSided","e0abbc80-0f80-e854-4970-8924a0863dcc":"Petal","c33714d1-b2f9-412e-bd50-1884c9d46336":"Plasma","ad1ad437-76e2-450d-a23a-e17f8310b960":"Rainbow","faaa4d44-fcfb-4177-96be-753ac0421ba3":"ShinyHull","70d79cca-b159-4f35-990c-f02193947fe8":"Smoke","d902ed8b-d0d1-476c-a8de-878a79e3a34c":"Snow","accb32f5-4509-454f-93f8-1df3fd31df1b":"SoftHighlighter","cf7f0059-7aeb-53a4-2b67-c83d863a9ffa":"Spikes","8dc4a70c-d558-4efd-a5ed-d4e860f40dc3":"Splatter","7a1c8107-50c5-4b70-9a39-421576d6617e":"SplatterSingleSided","0eb4db27-3f82-408d-b5a1-19ebd7d5b711":"Stars","44bb800a-fbc3-4592-8426-94ecb05ddec3":"Streamers","0077f88c-d93a-42f3-b59b-b31c50cdb414":"Taffy","b468c1fb-f254-41ed-8ec9-57030bc5660c":"TaperedFlat","c8ccb53d-ae13-45ef-8afb-b730d81394eb":"TaperedFlatSingleSided","d90c6ad8-af0f-4b54-b422-e0f92abe1b3c":"TaperedMarker","1a26b8c0-8a07-4f8a-9fac-d2ef36e0cad0":"TaperedMarker_Flat","75b32cf0-fdd6-4d89-a64b-e2a00b247b0f":"ThickPaint","fdf0326a-c0d1-4fed-b101-9db0ff6d071f":"ThickPaintSingleSided","4391385a-df73-4396-9e33-31e4e4930b27":"Toon","a8fea537-da7c-4d4b-817f-24f074725d6d":"UnlitHull","d229d335-c334-495a-a801-660ac8a87360":"VelvetInk","10201aa3-ebc2-42d8-84b7-2e63f6eeb8ab":"Waveform","b67c0e81-ce6d-40a8-aeb0-ef036b081aa3":"WetPaint","dea67637-cd1a-27e4-c9b1-52f4bbcb84e5":"WetPaintSingleSided","5347acf0-a8e2-47b6-8346-30c70719d763":"WigglyGraphite","e814fef1-97fd-7194-4a2f-50c2bb918be2":"WigglyGraphiteSingleSided","4391385a-cf83-4396-9e33-31e4e4930b27":"Wire"},l={BloomColor:"\n\t\t\tvec3 BloomColor(vec3 color, float gain) {\n\t\t\t\t// Guarantee that there's at least a little bit of all 3 channels.\n\t\t\t\t// This makes fully-saturated strokes (which only have 2 non-zero\n\t\t\t\t// color channels) eventually clip to white rather than to a secondary.\n\t\t\t\tfloat cmin = length(color.rgb) * .05;\n\t\t\t\tcolor.rgb = max(color.rgb, vec3(cmin, cmin, cmin));\n\t\t\t\t// If we try to remove this pow() from .a, it brightens up\n\t\t\t\t// pressure-sensitive strokes; looks better as-is.\n\t\t\t\tcolor = pow(color, vec3(2.2));\n\t\t\t\tcolor.rgb *= 2. * exp(gain * 10.);\n\t\t\t\treturn color;\n\t\t\t}\n\t\t",LinearToSrgb:"\n\t\t\tvec3 LinearToSrgb(vec3 color) {\n\t\t\t\t// Approximation http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html\n\t\t\t\tvec3 linearColor = color.rgb;\n\t\t\t\tvec3 S1 = sqrt(linearColor);\n\t\t\t\tvec3 S2 = sqrt(S1);\n\t\t\t\tvec3 S3 = sqrt(S2);\n\t\t\t\tcolor.rgb = 0.662002687 * S1 + 0.684122060 * S2 - 0.323583601 * S3 - 0.0225411470 * linearColor;\n\t\t\t\treturn color;\n\t\t\t}\n\t\t",hsv:"\n\t\t\t// uniform sampler2D lookupTex;\n\t\t\tvec4 lookup(vec4 textureColor) {\n\t\t\t\treturn textureColor;\n\t\t\t}\n\n\t\t\tvec3 lookup(vec3 textureColor) {\n\t\t\t\treturn textureColor;\n\t\t\t}\n\n\t\t\tvec3 hsv2rgb( vec3 hsv ) {\n\t\t\t\tvec3 rgb = clamp( abs(mod(hsv.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 );\n\t\t\t\treturn hsv.z * mix( vec3(1.0), rgb, hsv.y);\n\t\t\t}\n\n\t\t\tvec3 rgb2hsv( vec3 rgb ) {\n\t\t\t\tvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\t\t\t\tvec4 p = mix(vec4(rgb.bg, K.wz), vec4(rgb.gb, K.xy), step(rgb.b, rgb.g));\n\t\t\t\tvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n\t\t\t\tfloat d = q.x - min(q.w, q.y);\n\t\t\t\tfloat e = 1.0e-10;\n\n\t\t\t\treturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n\t\t\t}\n\t\t",SrgbToLinear:"\n\t\t\tvec3 SrgbToLinear(vec3 color) {\n\t\t\t\t// Approximation http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html\n\t\t\t\tvec3 sRGB = color.rgb;\n\t\t\t\tcolor.rgb = sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);\n\t\t\t\treturn color;\n\t\t\t}\n\t\t"},c=()=>({Light:{uniforms:{mainTex:{value:(new r.TextureLoader).setPath("./textures/tiltbrush/").loader.load("Light.webp")},alphaTest:{value:.067},emission_gain:{value:.45},alpha:{value:1}},vertexShader:`\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tattribute vec2 uv;\n\t\t\tattribute vec4 color;\n\t\t\tattribute vec3 position;\n\n\t\t\tuniform mat4 modelMatrix;\n\t\t\tuniform mat4 modelViewMatrix;\n\t\t\tuniform mat4 projectionMatrix;\n\t\t\tuniform mat4 viewMatrix;\n\t\t\tuniform mat3 normalMatrix;\n\t\t\tuniform vec3 cameraPosition;\n\n\t\t\tvarying vec2 vUv;\n\t\t\tvarying vec3 vColor;\n\n\t\t\t${l.LinearToSrgb}\n\t\t\t${l.hsv}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvUv = uv;\n\n\t\t\t\tvColor = lookup(color.rgb);\n\n\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t}\n\t\t`,fragmentShader:`\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tuniform float emission_gain;\n\n\t\t\tuniform sampler2D mainTex;\n\t\t\tuniform float alphaTest;\n\n\t\t\tvarying vec2 vUv;\n\t\t\tvarying vec3 vColor;\n\n\t\t\t${l.BloomColor}\n\t\t\t${l.SrgbToLinear}\n\n\t\t\tvoid main(){\n\t\t\t\tvec4 col = texture2D(mainTex, vUv);\n\t\t\t\tvec3 color = vColor;\n\t\t\t\tcolor = BloomColor(color, emission_gain);\n\t\t\t\tcolor = color * col.rgb;\n\t\t\t\tcolor = color * col.a;\n\t\t\t\tcolor = SrgbToLinear(color);\n\t\t\t\tgl_FragColor = vec4(color, 1.0);\n\t\t\t}\n\t\t`,side:2,transparent:!0,depthFunc:2,depthWrite:!0,depthTest:!1,blending:5,blendDst:201,blendDstAlpha:201,blendEquation:100,blendEquationAlpha:100,blendSrc:201,blendSrcAlpha:201}});function h(e){return"Light"===o[e]?new r.RawShaderMaterial(c().Light):new r.MeshBasicMaterial({vertexColors:!0,side:r.DoubleSide})}t.TiltLoader=s},21847:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(79836);class s extends r.Loader{load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=new DataView(e),n=t.getUint32(0,!0),r=t.getUint32(4,!0);if(542658390!==n||150!==r)return void console.error("Not a valid VOX file");const i=[0,4294967295,4291624959,4288282623,4284940287,4281597951,4278255615,4294954239,4291611903,4288269567,4284927231,4281584895,4278242559,4294941183,4291598847,4288256511,4284914175,4281571839,4278229503,4294928127,4291585791,4288243455,4284901119,4281558783,4278216447,4294915071,4291572735,4288230399,4284888063,4281545727,4278203391,4294902015,4291559679,4288217343,4284875007,4281532671,4278190335,4294967244,4291624908,4288282572,4284940236,4281597900,4278255564,4294954188,4291611852,4288269516,4284927180,4281584844,4278242508,4294941132,4291598796,4288256460,4284914124,4281571788,4278229452,4294928076,4291585740,4288243404,4284901068,4281558732,4278216396,4294915020,4291572684,4288230348,4284888012,4281545676,4278203340,4294901964,4291559628,4288217292,4284874956,4281532620,4278190284,4294967193,4291624857,4288282521,4284940185,4281597849,4278255513,4294954137,4291611801,4288269465,4284927129,4281584793,4278242457,4294941081,4291598745,4288256409,4284914073,4281571737,4278229401,4294928025,4291585689,4288243353,4284901017,4281558681,4278216345,4294914969,4291572633,4288230297,4284887961,4281545625,4278203289,4294901913,4291559577,4288217241,4284874905,4281532569,4278190233,4294967142,4291624806,4288282470,4284940134,4281597798,4278255462,4294954086,4291611750,4288269414,4284927078,4281584742,4278242406,4294941030,4291598694,4288256358,4284914022,4281571686,4278229350,4294927974,4291585638,4288243302,4284900966,4281558630,4278216294,4294914918,4291572582,4288230246,4284887910,4281545574,4278203238,4294901862,4291559526,4288217190,4284874854,4281532518,4278190182,4294967091,4291624755,4288282419,4284940083,4281597747,4278255411,4294954035,4291611699,4288269363,4284927027,4281584691,4278242355,4294940979,4291598643,4288256307,4284913971,4281571635,4278229299,4294927923,4291585587,4288243251,4284900915,4281558579,4278216243,4294914867,4291572531,4288230195,4284887859,4281545523,4278203187,4294901811,4291559475,4288217139,4284874803,4281532467,4278190131,4294967040,4291624704,4288282368,4284940032,4281597696,4278255360,4294953984,4291611648,4288269312,4284926976,4281584640,4278242304,4294940928,4291598592,4288256256,4284913920,4281571584,4278229248,4294927872,4291585536,4288243200,4284900864,4281558528,4278216192,4294914816,4291572480,4288230144,4284887808,4281545472,4278203136,4294901760,4291559424,4288217088,4284874752,4281532416,4278190318,4278190301,4278190267,4278190250,4278190216,4278190199,4278190165,4278190148,4278190114,4278190097,4278251008,4278246656,4278237952,4278233600,4278224896,4278220544,4278211840,4278207488,4278198784,4278194432,4293787648,4292673536,4290445312,4289331200,4287102976,4285988864,4283760640,4282646528,4280418304,4279304192,4293848814,4292730333,4290493371,4289374890,4287137928,4286019447,4283782485,4282664004,4280427042,4279308561];let s,a=8;const o=[];for(;a<t.byteLength;){let n="";for(let e=0;e<4;e++)n+=String.fromCharCode(t.getUint8(a++));const r=t.getUint32(a,!0);if(a+=4,a+=4,"SIZE"===n){const e=t.getUint32(a,!0);a+=4;const n=t.getUint32(a,!0);a+=4;const l=t.getUint32(a,!0);a+=4,s={palette:i,size:{x:e,y:n,z:l}},o.push(s),a+=r-12}else if("XYZI"===n){const n=t.getUint32(a,!0);a+=4,s.data=new Uint8Array(e,a,4*n),a+=4*n}else if("RGBA"===n){const e=[0];for(let n=0;n<256;n++)e[n+1]=t.getUint32(a,!0),a+=4;s.palette=e}else a+=r}return o}}class a extends r.Mesh{constructor(e){const t=e.data,n=e.size,i=e.palette,s=[],a=[],o=[0,0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1],l=[1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0],c=[0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1],h=[0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1,0],u=[0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0],d=[0,1,1,1,1,1,0,1,0,1,1,0,0,1,0,1,1,1];function p(e,t,r,i,o,l,c){t-=n.x/2,r-=n.z/2,i+=n.y/2;for(let n=0;n<18;n+=3)s.push(e[n+0]+t,e[n+1]+r,e[n+2]+i),a.push(o,l,c)}const f=n.x,m=n.x*n.y,g=new Uint8Array(n.x*n.y*n.z);for(let r=0;r<t.length;r+=4){g[t[r+0]+t[r+1]*f+t[r+2]*m]=255}let A=!1;for(let r=0;r<t.length;r+=4){const e=t[r+0],s=t[r+1],a=t[r+2],v=i[t[r+3]],y=(v>>0&255)/255,x=(v>>8&255)/255,b=(v>>16&255)/255;(y>0||x>0||b>0)&&(A=!0);const E=e+s*f+a*m;0!==g[E+1]&&e!==n.x-1||p(l,e,a,-s,y,x,b),0!==g[E-1]&&0!==e||p(o,e,a,-s,y,x,b),0!==g[E+f]&&s!==n.y-1||p(h,e,a,-s,y,x,b),0!==g[E-f]&&0!==s||p(c,e,a,-s,y,x,b),0!==g[E+m]&&a!==n.z-1||p(d,e,a,-s,y,x,b),0!==g[E-m]&&0!==a||p(u,e,a,-s,y,x,b)}const v=new r.BufferGeometry;v.setAttribute("position",new r.Float32BufferAttribute(s,3)),v.computeVertexNormals();const y=new r.MeshStandardMaterial;A&&(v.setAttribute("color",new r.Float32BufferAttribute(a,3)),y.vertexColors=!0),super(v,y)}}class o extends i.Data3DTexture{constructor(e){const t=e.data,n=e.size,i=n.x,s=n.x*n.y,a=new Uint8Array(n.x*n.y*n.z);for(let r=0;r<t.length;r+=4){a[t[r+0]+t[r+1]*i+t[r+2]*s]=255}super(a,n.x,n.y,n.z),this.format=r.RedFormat,this.minFilter=r.NearestFilter,this.magFilter=r.LinearFilter,this.unpackAlignment=1,this.needsUpdate=!0}}t.VOXData3DTexture=o,t.VOXLoader=s,t.VOXMesh=a},41163:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(94479);class s extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=""===s.path?r.LoaderUtils.extractUrlBase(e):s.path,o=new r.FileLoader(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,(function(n){try{t(s.parse(n,a))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e,t){const n={};function s(e){e.DEF&&(n[e.DEF]=e);const t=e.fields;for(let n=0,r=t.length;n<r;n++){const e=t[n];if("node"===e.type){const t=e.values;for(let e=0,n=t.length;e<n;e++)s(t[e])}}}function h(e){return e.USE?function(e){const t=n[e],r=h(t);return r.isObject3D||r.isMaterial?r.clone():r}(e.USE):(void 0!==e.build||(e.build=function(e){const t=e.name;let n;switch(t){case"Group":case"Transform":case"Collision":n=function(e){const t=new r.Group,n=e.fields;for(let i=0,s=n.length;i<s;i++){const e=n[i],s=e.name,a=e.values;switch(s){case"bboxCenter":case"bboxSize":case"center":case"collide":case"scaleOrientation":case"proxy":break;case"children":p(a,t);break;case"rotation":const e=new r.Vector3(a[0],a[1],a[2]),n=a[3];t.quaternion.setFromAxisAngle(e,n);break;case"scale":t.scale.set(a[0],a[1],a[2]);break;case"translation":t.position.set(a[0],a[1],a[2]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}return t}(e);break;case"Background":n=function(e){const t=new r.Group;let n,i,s,a;const o=e.fields;for(let r=0,c=o.length;r<c;r++){const e=o[r],t=e.name,l=e.values;switch(t){case"groundAngle":n=l;break;case"groundColor":i=l;break;case"backUrl":case"bottomUrl":case"frontUrl":case"leftUrl":case"rightUrl":case"topUrl":break;case"skyAngle":s=l;break;case"skyColor":a=l;break;default:console.warn("THREE.VRMLLoader: Unknown field:",t)}}const l=1e4;if(a){const e=new r.SphereGeometry(l,32,16),n=new r.MeshBasicMaterial({fog:!1,side:r.BackSide,depthWrite:!1,depthTest:!1});a.length>3?(L(e,l,s,D(a),!0),n.vertexColors=!0):n.color.setRGB(a[0],a[1],a[2]);const i=new r.Mesh(e,n);t.add(i)}if(i&&i.length>0){const e=new r.SphereGeometry(l,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),s=new r.MeshBasicMaterial({fog:!1,side:r.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});L(e,l,n,D(i),!1);const a=new r.Mesh(e,s);t.add(a)}return t.renderOrder=-1/0,t}(e);break;case"Shape":n=function(e){const t=e.fields;let n,i,s=new r.MeshBasicMaterial({color:0});for(let r=0,a=t.length;r<a;r++){const e=t[r],i=e.name,a=e.values;switch(i){case"appearance":null!==a[0]&&(s=h(a[0]));break;case"geometry":null!==a[0]&&(n=h(a[0]));break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}if(n&&n.attributes.position){const e=n._type;if("points"===e){const e=new r.PointsMaterial({color:16777215});void 0!==n.attributes.color?e.vertexColors=!0:s.isMeshPhongMaterial&&e.color.copy(s.emissive),i=new r.Points(n,e)}else if("line"===e){const e=new r.LineBasicMaterial({color:16777215});void 0!==n.attributes.color?e.vertexColors=!0:s.isMeshPhongMaterial&&e.color.copy(s.emissive),i=new r.LineSegments(n,e)}else void 0!==n._solid&&(s.side=n._solid?r.FrontSide:r.DoubleSide),void 0!==n.attributes.color&&(s.vertexColors=!0),i=new r.Mesh(n,s)}else i=new r.Object3D,i.visible=!1;return i}(e);break;case"Appearance":n=function(e){let t,n=new r.MeshPhongMaterial;const i=e.fields;for(let s=0,a=i.length;s<a;s++){const e=i[s],a=e.name,o=e.values;switch(a){case"material":if(null!==o[0]){const e=h(o[0]);e.diffuseColor&&n.color.copy(e.diffuseColor),e.emissiveColor&&n.emissive.copy(e.emissiveColor),e.shininess&&(n.shininess=e.shininess),e.specularColor&&n.specular.copy(e.specularColor),e.transparency&&(n.opacity=1-e.transparency),e.transparency>0&&(n.transparent=!0)}else n=new r.MeshBasicMaterial({color:0});break;case"texture":const e=o[0];null!==e&&("ImageTexture"!==e.name&&"PixelTexture"!==e.name||(n.map=h(e)));break;case"textureTransform":null!==o[0]&&(t=h(o[0]));break;default:console.warn("THREE.VRMLLoader: Unknown field:",a)}}if(n.map){if(n.map.__type){switch(n.map.__type){case c.INTENSITY_ALPHA:n.opacity=1;break;case c.RGB:n.color.set(16777215);break;case c.RGBA:n.color.set(16777215),n.opacity=1}delete n.map.__type}t&&(n.map.center.copy(t.center),n.map.rotation=t.rotation,n.map.repeat.copy(t.scale),n.map.offset.copy(t.translation))}return n}(e);break;case"Material":n=function(e){const t={},n=e.fields;for(let i=0,s=n.length;i<s;i++){const e=n[i],s=e.name,a=e.values;switch(s){case"ambientIntensity":break;case"diffuseColor":t.diffuseColor=new r.Color(a[0],a[1],a[2]);break;case"emissiveColor":case"specularColor":t.emissiveColor=new r.Color(a[0],a[1],a[2]);break;case"shininess":t.shininess=a[0];break;case"transparency":t.transparency=a[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}return t}(e);break;case"ImageTexture":n=function(e){let t,n=r.RepeatWrapping,i=r.RepeatWrapping;const s=e.fields;for(let a=0,o=s.length;a<o;a++){const e=s[a],o=e.name,l=e.values;switch(o){case"url":const e=l[0];e&&(t=F.load(e));break;case"repeatS":!1===l[0]&&(n=r.ClampToEdgeWrapping);break;case"repeatT":!1===l[0]&&(i=r.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader: Unknown field:",o)}}t&&(t.wrapS=n,t.wrapT=i);return t}(e);break;case"PixelTexture":n=function(e){let t,n=r.RepeatWrapping,i=r.RepeatWrapping;const s=e.fields;for(let a=0,o=s.length;a<o;a++){const e=s[a],o=e.name,l=e.values;switch(o){case"image":const e=l[0],s=l[1],a=d(l[2]),c=new Uint8Array(4*e*s),h={r:0,g:0,b:0,a:0};for(let t=3,n=0,r=l.length;t<r;t++,n++){u(l[t],a,h);const e=4*n;c[e+0]=h.r,c[e+1]=h.g,c[e+2]=h.b,c[e+3]=h.a}t=new r.DataTexture(c,e,s),t.needsUpdate=!0,t.__type=a;break;case"repeatS":!1===l[0]&&(n=r.ClampToEdgeWrapping);break;case"repeatT":!1===l[0]&&(i=r.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader: Unknown field:",o)}}t&&(t.wrapS=n,t.wrapT=i);return t}(e);break;case"TextureTransform":n=function(e){const t={center:new r.Vector2,rotation:new r.Vector2,scale:new r.Vector2,translation:new r.Vector2},n=e.fields;for(let r=0,i=n.length;r<i;r++){const e=n[r],i=e.name,s=e.values;switch(i){case"center":t.center.set(s[0],s[1]);break;case"rotation":t.rotation=s[0];break;case"scale":t.scale.set(s[0],s[1]);break;case"translation":t.translation.set(s[0],s[1]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}return t}(e);break;case"IndexedFaceSet":n=function(e){let t,n,i,s,a,o,l,c,u=!0,d=!0,p=0,A=!0,v=!0;const y=e.fields;for(let r=0,f=y.length;r<f;r++){const e=y[r],f=e.name,m=e.values;switch(f){case"color":const e=m[0];null!==e&&(t=h(e));break;case"coord":const r=m[0];null!==r&&(n=h(r));break;case"normal":const g=m[0];null!==g&&(i=h(g));break;case"texCoord":const y=m[0];null!==y&&(s=h(y));break;case"ccw":u=m[0];break;case"colorIndex":a=m;break;case"colorPerVertex":A=m[0];break;case"convex":break;case"coordIndex":o=m;break;case"creaseAngle":p=m[0];break;case"normalIndex":l=m;break;case"normalPerVertex":v=m[0];break;case"solid":d=m[0];break;case"texCoordIndex":c=m;break;default:console.warn("THREE.VRMLLoader: Unknown field:",f)}}if(void 0===o)return console.warn("THREE.VRMLLoader: Missing coordIndex."),new r.BufferGeometry;const x=f(o,u);let b,E,_;if(t)if(!0===A)if(a&&a.length>0){b=w(x,f(a,u),t,3)}else b=T(x,new r.Float32BufferAttribute(t,3));else if(a&&a.length>0){b=M(x,m(g(t,a),o))}else{b=M(x,m(t,o))}if(i)if(!0===v)if(l&&l.length>0){E=w(x,f(l,u),i,3)}else E=T(x,new r.Float32BufferAttribute(i,3));else if(l&&l.length>0){E=M(x,m(g(i,l),o))}else{E=M(x,m(i,o))}else E=R(x,n,p);if(s)if(c&&c.length>0){_=w(x,f(c,u),s,2)}else _=T(x,new r.Float32BufferAttribute(s,2));const S=new r.BufferGeometry,C=T(x,new r.Float32BufferAttribute(n,3));S.setAttribute("position",C),S.setAttribute("normal",E),b&&S.setAttribute("color",b);_&&S.setAttribute("uv",_);return S._solid=d,S._type="mesh",S}(e);break;case"IndexedLineSet":n=function(e){let t,n,i,s,a=!0;const o=e.fields;for(let r=0,p=o.length;r<p;r++){const e=o[r],l=e.name,c=e.values;switch(l){case"color":const e=c[0];null!==e&&(t=h(e));break;case"coord":const r=c[0];null!==r&&(n=h(r));break;case"colorIndex":i=c;break;case"colorPerVertex":a=c[0];break;case"coordIndex":s=c;break;default:console.warn("THREE.VRMLLoader: Unknown field:",l)}}let l;const c=A(s);if(t)if(!0===a)if(i.length>0){l=w(c,A(i),t,3)}else l=T(c,new r.Float32BufferAttribute(t,3));else if(i.length>0){l=C(c,v(g(t,i),s))}else{l=C(c,v(t,s))}const u=new r.BufferGeometry,d=T(c,new r.Float32BufferAttribute(n,3));u.setAttribute("position",d),l&&u.setAttribute("color",l);return u._type="line",u}(e);break;case"PointSet":n=function(e){let t,n;const i=e.fields;for(let r=0,a=i.length;r<a;r++){const e=i[r],s=e.name,a=e.values;switch(s){case"color":const e=a[0];null!==e&&(t=h(e));break;case"coord":const r=a[0];null!==r&&(n=h(r));break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}const s=new r.BufferGeometry;s.setAttribute("position",new r.Float32BufferAttribute(n,3)),t&&s.setAttribute("color",new r.Float32BufferAttribute(t,3));return s._type="points",s}(e);break;case"Box":n=function(e){const t=new r.Vector3(2,2,2),n=e.fields;for(let r=0,i=n.length;r<i;r++){const e=n[r],i=e.name,s=e.values;if("size"===i)t.x=s[0],t.y=s[1],t.z=s[2];else console.warn("THREE.VRMLLoader: Unknown field:",i)}return new r.BoxGeometry(t.x,t.y,t.z)}(e);break;case"Cone":n=function(e){let t=1,n=2,i=!1;const s=e.fields;for(let r=0,a=s.length;r<a;r++){const e=s[r],a=e.name,o=e.values;switch(a){case"bottom":i=!o[0];break;case"bottomRadius":t=o[0];break;case"height":n=o[0];break;case"side":break;default:console.warn("THREE.VRMLLoader: Unknown field:",a)}}return new r.ConeGeometry(t,n,16,1,i)}(e);break;case"Cylinder":n=function(e){let t=1,n=2;const i=e.fields;for(let r=0,s=i.length;r<s;r++){const e=i[r],s=e.name,a=e.values;switch(s){case"bottom":case"side":case"top":break;case"radius":t=a[0];break;case"height":n=a[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",s)}}return new r.CylinderGeometry(t,t,n,16,1)}(e);break;case"Sphere":n=function(e){let t=1;const n=e.fields;for(let r=0,i=n.length;r<i;r++){const e=n[r],i=e.name,s=e.values;if("radius"===i)t=s[0];else console.warn("THREE.VRMLLoader: Unknown field:",i)}return new r.SphereGeometry(t,16,16)}(e);break;case"ElevationGrid":n=function(e){let t,n,i,s,a=!0,o=!0,l=!0,c=!0,u=0,d=2,p=2,f=1,m=1;const g=e.fields;for(let r=0,C=g.length;r<C;r++){const e=g[r],A=e.name,v=e.values;switch(A){case"color":const e=v[0];null!==e&&(t=h(e));break;case"normal":const r=v[0];null!==r&&(n=h(r));break;case"texCoord":const g=v[0];null!==g&&(i=h(g));break;case"height":s=v;break;case"ccw":c=v[0];break;case"colorPerVertex":a=v[0];break;case"creaseAngle":u=v[0];break;case"normalPerVertex":o=v[0];break;case"solid":l=v[0];break;case"xDimension":d=v[0];break;case"xSpacing":f=v[0];break;case"zDimension":p=v[0];break;case"zSpacing":m=v[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",A)}}const A=[],v=[],y=[],x=[];for(let r=0;r<p;r++)for(let e=0;e<d;e++){const l=r*d+e,c=f*r,h=s[l],u=m*e;if(A.push(c,h,u),t&&!0===a){const e=t[3*l+0],n=t[3*l+1],r=t[3*l+2];y.push(e,n,r)}if(n&&!0===o){const e=n[3*l+0],t=n[3*l+1],r=n[3*l+2];v.push(e,t,r)}if(i){const e=i[2*l+0],t=i[2*l+1];x.push(e,t)}else x.push(r/(d-1),e/(p-1))}const b=[];for(let r=0;r<d-1;r++)for(let e=0;e<p-1;e++){const t=r+e*d,n=r+(e+1)*d,i=r+1+(e+1)*d,s=r+1+e*d;!0===c?(b.push(t,i,n),b.push(i,t,s)):(b.push(t,n,i),b.push(i,s,t))}const E=T(b,new r.Float32BufferAttribute(A,3)),_=T(b,new r.Float32BufferAttribute(x,2));let S,w;if(t)if(!1===a){for(let e=0;e<d-1;e++)for(let n=0;n<p-1;n++){const r=e+n*(d-1),i=t[3*r+0],s=t[3*r+1],a=t[3*r+2];y.push(i,s,a),y.push(i,s,a),y.push(i,s,a),y.push(i,s,a),y.push(i,s,a),y.push(i,s,a)}S=new r.Float32BufferAttribute(y,3)}else S=T(b,new r.Float32BufferAttribute(y,3));if(n)if(!1===o){for(let e=0;e<d-1;e++)for(let t=0;t<p-1;t++){const r=e+t*(d-1),i=n[3*r+0],s=n[3*r+1],a=n[3*r+2];v.push(i,s,a),v.push(i,s,a),v.push(i,s,a),v.push(i,s,a),v.push(i,s,a),v.push(i,s,a)}w=new r.Float32BufferAttribute(v,3)}else w=T(b,new r.Float32BufferAttribute(v,3));else w=R(b,A,u);const M=new r.BufferGeometry;M.setAttribute("position",E),M.setAttribute("normal",w),M.setAttribute("uv",_),S&&M.setAttribute("color",S);return M._solid=l,M._type="mesh",M}(e);break;case"Extrusion":n=function(e){let t,n,i=[1,1,1,-1,-1,-1,-1,1,1,1],s=[0,0,0,0,1,0],a=!0,o=!0,l=0,c=!0,h=!0;const u=e.fields;for(let r=0,w=u.length;r<w;r++){const e=u[r],d=e.name,p=e.values;switch(d){case"beginCap":a=p[0];break;case"ccw":o=p[0];break;case"convex":break;case"creaseAngle":l=p[0];break;case"crossSection":i=p;break;case"endCap":c=p[0];break;case"orientation":n=p;break;case"scale":t=p;break;case"solid":h=p[0];break;case"spine":s=p;break;default:console.warn("THREE.VRMLLoader: Unknown field:",d)}}const d=i[0]===i[i.length-2]&&i[1]===i[i.length-1],p=[],f=new r.Vector3,m=new r.Vector3,g=new r.Vector3,A=new r.Vector3,v=new r.Quaternion;for(let r=0,w=0,M=0,C=s.length;r<C;r+=3,w+=2,M+=4){f.fromArray(s,r),m.x=t?t[w+0]:1,m.y=1,m.z=t?t[w+1]:1,g.x=n?n[M+0]:0,g.y=n?n[M+1]:0,g.z=n?n[M+2]:1;const e=n?n[M+3]:0;for(let t=0,n=i.length;t<n;t+=2)A.x=i[t+0],A.y=0,A.z=i[t+1],A.multiply(m),v.setFromAxisAngle(g,e),A.applyQuaternion(v),A.add(f),p.push(A.x,A.y,A.z)}const y=[],x=s.length/3,b=i.length/2;for(let r=0;r<x-1;r++)for(let e=0;e<b-1;e++){const t=e+r*b;let n=e+1+r*b;const i=e+(r+1)*b;let s=e+1+(r+1)*b;e===b-2&&!0===d&&(n=r*b,s=(r+1)*b),!0===o?(y.push(t,n,i),y.push(i,n,s)):(y.push(t,i,n),y.push(i,s,n))}if(!0===a||!0===c){const e=[];for(let s=0,a=i.length;s<a;s+=2)e.push(new r.Vector2(i[s],i[s+1]));const t=r.ShapeUtils.triangulateShape(e,[]),n=[];for(let r=0,i=t.length;r<i;r++){const e=t[r];n.push(e[0],e[1],e[2])}if(!0===a)for(let r=0,i=n.length;r<i;r+=3)!0===o?y.push(n[r+0],n[r+1],n[r+2]):y.push(n[r+0],n[r+2],n[r+1]);if(!0===c){const e=b*(x-1);for(let t=0,r=n.length;t<r;t+=3)!0===o?y.push(e+n[t+0],e+n[t+2],e+n[t+1]):y.push(e+n[t+0],e+n[t+1],e+n[t+2])}}const E=T(y,new r.Float32BufferAttribute(p,3)),_=R(y,p,l),S=new r.BufferGeometry;return S.setAttribute("position",E),S.setAttribute("normal",_),S._solid=h,S._type="mesh",S}(e);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":n=function(e){return e.fields[0].values}(e);break;case"WorldInfo":n=function(e){const t={},n=e.fields;for(let r=0,i=n.length;r<i;r++){const e=n[r],i=e.name,s=e.values;switch(i){case"title":t.title=s[0];break;case"info":t.info=s;break;default:console.warn("THREE.VRMLLoader: Unknown field:",i)}}return t}(e);break;case"Anchor":case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader: Unknown node:",t)}void 0!==n&&void 0!==e.DEF&&!0===n.hasOwnProperty("name")&&(n.name=e.DEF);return n}(e)),e.build)}function u(e,t,n){let r;switch(t){case c.INTENSITY:r=parseInt(e),n.r=r,n.g=r,n.b=r,n.a=1;break;case c.INTENSITY_ALPHA:r=parseInt("0x"+e.substring(2,4)),n.r=r,n.g=r,n.b=r,n.a=parseInt("0x"+e.substring(4,6));break;case c.RGB:n.r=parseInt("0x"+e.substring(2,4)),n.g=parseInt("0x"+e.substring(4,6)),n.b=parseInt("0x"+e.substring(6,8)),n.a=1;break;case c.RGBA:n.r=parseInt("0x"+e.substring(2,4)),n.g=parseInt("0x"+e.substring(4,6)),n.b=parseInt("0x"+e.substring(6,8)),n.a=parseInt("0x"+e.substring(8,10))}}function d(e){let t;switch(e){case 1:t=c.INTENSITY;break;case 2:t=c.INTENSITY_ALPHA;break;case 3:t=c.RGB;break;case 4:t=c.RGBA}return t}function p(e,t){for(let n=0,i=e.length;n<i;n++){const i=h(e[n]);i instanceof r.Object3D&&t.add(i)}}function f(e,t){const n=[];let r=0;for(let i=0,s=e.length;i<s;i++){const a=e[r],o=e[i+(t?1:2)],l=e[i+(t?2:1)];n.push(a,o,l),(-1===e[i+3]||i+3>=s)&&(i+=3,r=i+1)}return n}function m(e,t){const n=[];let r=0;for(let i=0,s=t.length;i<s;i++){const a=3*r,o=e[a],l=e[a+1],c=e[a+2];n.push(o,l,c),(-1===t[i+3]||i+3>=s)&&(i+=3,r++)}return n}function g(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const i=3*t[r],s=e[i],a=e[i+1],o=e[i+2];n.push(s,a,o)}return n}function A(e){const t=[];for(let n=0,r=e.length;n<r;n++){const i=e[n],s=e[n+1];t.push(i,s),(-1===e[n+2]||n+2>=r)&&(n+=2)}return t}function v(e,t){const n=[];let r=0;for(let i=0,s=t.length;i<s;i++){const a=3*r,o=e[a],l=e[a+1],c=e[a+2];n.push(o,l,c),(-1===t[i+2]||i+2>=s)&&(i+=2,r++)}return n}const y=new r.Vector3,x=new r.Vector3,b=new r.Vector3,E=new r.Vector2,_=new r.Vector2,S=new r.Vector2;function w(e,t,n,i){const s=[];for(let r=0,a=e.length;r<a;r+=3){const e=t[r],a=t[r+1],o=t[r+2];2===i?(E.fromArray(n,e*i),_.fromArray(n,a*i),S.fromArray(n,o*i),s.push(E.x,E.y),s.push(_.x,_.y),s.push(S.x,S.y)):(y.fromArray(n,e*i),x.fromArray(n,a*i),b.fromArray(n,o*i),s.push(y.x,y.y,y.z),s.push(x.x,x.y,x.z),s.push(b.x,b.y,b.z))}return new r.Float32BufferAttribute(s,i)}function M(e,t){const n=[];for(let r=0,i=0,s=e.length;r<s;r+=3,i++)y.fromArray(t,3*i),n.push(y.x,y.y,y.z),n.push(y.x,y.y,y.z),n.push(y.x,y.y,y.z);return new r.Float32BufferAttribute(n,3)}function C(e,t){const n=[];for(let r=0,i=0,s=e.length;r<s;r+=2,i++)y.fromArray(t,3*i),n.push(y.x,y.y,y.z),n.push(y.x,y.y,y.z);return new r.Float32BufferAttribute(n,3)}function T(e,t){const n=t.array,i=t.itemSize,s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){a=e[r]*i;for(let e=0;e<i;e++)s[o++]=n[a++]}return new r.Float32BufferAttribute(s,i)}const I=new r.Vector3,B=new r.Vector3;function R(e,t,n){const i=[],s={};for(let r=0,o=e.length;r<o;r+=3){const n=e[r],a=e[r+1],o=e[r+2],c=new l(n,a,o);y.fromArray(t,3*n),x.fromArray(t,3*a),b.fromArray(t,3*o),B.subVectors(b,x),I.subVectors(y,x),B.cross(I),B.normalize(),c.normal.copy(B),void 0===s[n]&&(s[n]=[]),void 0===s[a]&&(s[a]=[]),void 0===s[o]&&(s[o]=[]),s[n].push(c.normal),s[a].push(c.normal),s[o].push(c.normal),i.push(c)}const a=[];for(let r=0,o=i.length;r<o;r++){const e=i[r],o=P(s[e.a],e.normal,n),l=P(s[e.b],e.normal,n),c=P(s[e.c],e.normal,n);y.fromArray(t,3*e.a),x.fromArray(t,3*e.b),b.fromArray(t,3*e.c),a.push(o.x,o.y,o.z),a.push(l.x,l.y,l.z),a.push(c.x,c.y,c.z)}return new r.Float32BufferAttribute(a,3)}function P(e,t,n){const i=new r.Vector3;if(0===n)i.copy(t);else for(let r=0,s=e.length;r<s;r++)e[r].angleTo(t)<n&&i.add(e[r]);return i.normalize()}function D(e){const t=[];for(let n=0,i=e.length;n<i;n+=3)t.push(new r.Color(e[n],e[n+1],e[n+2]));return t}function L(e,t,n,i,s){const a=[],o=!0===s?0:Math.PI;for(let p=0,f=i.length;p<f;p++){let e=0===p?0:n[p-1];e=!0===s?e:o-e;const i=new r.Vector3;i.setFromSphericalCoords(t,e,0),a.push(i)}const l=e.index,c=e.attributes.position,h=new r.BufferAttribute(new Float32Array(3*e.attributes.position.count),3),u=new r.Vector3,d=new r.Color;for(let r=0;r<l.count;r++){const e=l.getX(r);let t,n;u.fromBufferAttribute(c,e);let o=1;for(let r=1;r<a.length;r++){t=r-1,n=r;const e=a[t],i=a[n];if(!0===s){if(u.y<=e.y&&u.y>i.y){o=Math.abs(e.y-u.y)/Math.abs(e.y-i.y);break}}else if(u.y>=e.y&&u.y<i.y){o=Math.abs(e.y-u.y)/Math.abs(e.y-i.y);break}}const p=i[t],f=i[n];d.copy(p).lerp(f,o),h.setXYZ(e,d.r,d.g,d.b)}e.setAttribute("color",h)}const F=new r.TextureLoader(this.manager);if(F.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),-1===e.indexOf("#VRML V2.0"))throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");return function(e){const t=e.nodes,n=new r.Scene;for(let r=0,i=t.length;r<i;r++){s(t[r])}for(let i=0,s=t.length;i<s;i++){const e=t[i],s=h(e);s instanceof r.Object3D&&n.add(s),"WorldInfo"===e.name&&(n.userData.worldInfo=s)}return n}(function(e){const t=function(){const e=i.createToken({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),t=i.createToken({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,longer_alt:e}),n=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],r=i.createToken({name:"Version",pattern:/#VRML.*/,longer_alt:t}),s=i.createToken({name:"NodeName",pattern:new RegExp(n.join("|")),longer_alt:t}),a=i.createToken({name:"DEF",pattern:/DEF/,longer_alt:t}),o=i.createToken({name:"USE",pattern:/USE/,longer_alt:t}),l=i.createToken({name:"ROUTE",pattern:/ROUTE/,longer_alt:t}),c=i.createToken({name:"TO",pattern:/TO/,longer_alt:t}),h=i.createToken({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),u=i.createToken({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),d=i.createToken({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),p=i.createToken({name:"TrueLiteral",pattern:/TRUE/}),f=i.createToken({name:"FalseLiteral",pattern:/FALSE/}),m=i.createToken({name:"NullLiteral",pattern:/NULL/}),g=i.createToken({name:"LSquare",pattern:/\[/}),A=i.createToken({name:"RSquare",pattern:/]/}),v=i.createToken({name:"LCurly",pattern:/{/}),y=i.createToken({name:"RCurly",pattern:/}/}),x=i.createToken({name:"Comment",pattern:/#.*/,group:i.Lexer.SKIPPED}),b=[i.createToken({name:"WhiteSpace",pattern:/[ ,\s]/,group:i.Lexer.SKIPPED}),s,a,o,l,c,p,f,m,r,t,e,h,u,d,g,A,v,y,x],E={};for(let i=0,_=b.length;i<_;i++){const e=b[i];E[e.name]=e}return{tokens:b,tokenVocabulary:E}}(),n=new a(t.tokens),r=new o(t.tokenVocabulary),s=function(e){function t(){e.call(this),this.validateVisitor()}function n(e,t){const n={type:null,values:[]};if(t.node){n.type="node";for(let r=0,i=t.node.length;r<i;r++){const i=t.node[r];n.values.push(e.visit(i))}}if(t.use){n.type="use";for(let r=0,i=t.use.length;r<i;r++){const i=t.use[r];n.values.push(e.visit(i))}}if(t.StringLiteral){n.type="string";for(let e=0,r=t.StringLiteral.length;e<r;e++){const r=t.StringLiteral[e];n.values.push(r.image.replace(/'|"/g,""))}}if(t.NumberLiteral){n.type="number";for(let e=0,r=t.NumberLiteral.length;e<r;e++){const r=t.NumberLiteral[e];n.values.push(parseFloat(r.image))}}if(t.HexLiteral){n.type="hex";for(let e=0,r=t.HexLiteral.length;e<r;e++){const r=t.HexLiteral[e];n.values.push(r.image)}}if(t.TrueLiteral){n.type="boolean";for(let e=0,r=t.TrueLiteral.length;e<r;e++){"TRUE"===t.TrueLiteral[e].image&&n.values.push(!0)}}if(t.FalseLiteral){n.type="boolean";for(let e=0,r=t.FalseLiteral.length;e<r;e++){"FALSE"===t.FalseLiteral[e].image&&n.values.push(!1)}}return t.NullLiteral&&(n.type="null",t.NullLiteral.forEach((function(){n.values.push(null)}))),n}return t.prototype=Object.assign(Object.create(e.prototype),{constructor:t,vrml:function(e){const t={version:this.visit(e.version),nodes:[],routes:[]};for(let n=0,r=e.node.length;n<r;n++){const r=e.node[n];t.nodes.push(this.visit(r))}if(e.route)for(let n=0,r=e.route.length;n<r;n++){const r=e.route[n];t.routes.push(this.visit(r))}return t},version:function(e){return e.Version[0].image},node:function(e){const t={name:e.NodeName[0].image,fields:[]};if(e.field)for(let n=0,r=e.field.length;n<r;n++){const r=e.field[n];t.fields.push(this.visit(r))}return e.def&&(t.DEF=this.visit(e.def[0])),t},field:function(e){const t={name:e.Identifier[0].image,type:null,values:null};let n;return e.singleFieldValue&&(n=this.visit(e.singleFieldValue[0])),e.multiFieldValue&&(n=this.visit(e.multiFieldValue[0])),t.type=n.type,t.values=n.values,t},def:function(e){return(e.Identifier||e.NodeName)[0].image},use:function(e){return{USE:(e.Identifier||e.NodeName)[0].image}},singleFieldValue:function(e){return n(this,e)},multiFieldValue:function(e){return n(this,e)},route:function(e){return{FROM:e.RouteIdentifier[0].image,TO:e.RouteIdentifier[1].image}}}),new t}(r.getBaseCstVisitorConstructor()),l=n.lex(e);r.input=l.tokens;const c=r.vrml();if(r.errors.length>0)throw console.error(r.errors),Error("THREE.VRMLLoader: Parsing errors detected.");return s.visit(c)}(e))}}class a{constructor(e){this.lexer=new i.Lexer(e)}lex(e){const t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}class o extends i.CstParser{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,i=e.RCurly,s=e.LSquare,a=e.RSquare,o=e.Identifier,l=e.RouteIdentifier,c=e.StringLiteral,h=e.HexLiteral,u=e.NumberLiteral,d=e.TrueLiteral,p=e.FalseLiteral,f=e.NullLiteral,m=e.DEF,g=e.USE,A=e.ROUTE,v=e.TO,y=e.NodeName;t.RULE("vrml",(function(){t.SUBRULE(t.version),t.AT_LEAST_ONE((function(){t.SUBRULE(t.node)})),t.MANY((function(){t.SUBRULE(t.route)}))})),t.RULE("version",(function(){t.CONSUME(n)})),t.RULE("node",(function(){t.OPTION((function(){t.SUBRULE(t.def)})),t.CONSUME(y),t.CONSUME(r),t.MANY((function(){t.SUBRULE(t.field)})),t.CONSUME(i)})),t.RULE("field",(function(){t.CONSUME(o),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])})),t.RULE("def",(function(){t.CONSUME(m),t.OR([{ALT:function(){t.CONSUME(o)}},{ALT:function(){t.CONSUME(y)}}])})),t.RULE("use",(function(){t.CONSUME(g),t.OR([{ALT:function(){t.CONSUME(o)}},{ALT:function(){t.CONSUME(y)}}])})),t.RULE("singleFieldValue",(function(){t.AT_LEAST_ONE((function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(c)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(f)}}])}))})),t.RULE("multiFieldValue",(function(){t.CONSUME(s),t.MANY((function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(c)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(f)}}])})),t.CONSUME(a)})),t.RULE("route",(function(){t.CONSUME(A),t.CONSUME(l),t.CONSUME(v),t.CONSUME2(l)})),this.performSelfAnalysis()}}class l{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new r.Vector3}}const c={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};t.VRMLLoader=s},7955:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(20614);class s extends r.Loader{constructor(e){super(e),this.gltfLoader=new i.GLTFLoader(e)}load(e,t,n,r){const i=this;this.gltfLoader.load(e,(function(n){try{i.parse(n,t)}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}setDRACOLoader(e){return this.gltfLoader.setDRACOLoader(e),this}parse(e,t){t(e)}}t.VRMLoader=s},39142:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(8083);class s extends r.Loader{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new r.FileLoader(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){function t(e,t){const n=e.length,r=new Float32Array(n+t.length);return r.set(e),r.set(t,n),r}var n=r.LoaderUtils.decodeText(new Uint8Array(e,0,250)).split("\n");return-1!==n[0].indexOf("xml")?function(e){function n(e){var t,n,r,i,s,a,o="undefined"!=typeof Uint8Array?Uint8Array:Array,l=[],c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=64;for(t=0;t<h;t++);for(t=0;t<h;++t)l[c.charCodeAt(t)]=t;if(l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63,(h=e.length)%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=new o(3*h/4-(s="="===e[h-2]?2:"="===e[h-1]?1:0)),r=s>0?h-4:h;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],a[u++]=(16711680&i)>>16,a[u++]=(65280&i)>>8,a[u++]=255&i;return 2===s?(i=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===s&&(i=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function s(e,r){var s,a,l,c,h=0;if("UInt64"===o.attributes.header_type?h=8:"UInt32"===o.attributes.header_type&&(h=4),"binary"===e.attributes.format&&r){var u,d,p,f,m,g;if("Float32"===e.attributes.type)var A=new Float32Array;else"Int64"===e.attributes.type&&(A=new Int32Array);d=(u=n(e["#text"]))[0];for(var v=1;v<h-1;v++)d|=u[v]<<v*h;for(f=(d+3)*h,g=f+=f%3>0?3-f%3:0,(m=[]).push(g),p=3*h,v=0;v<d;v++){for(var y=u[v*h+p],x=1;x<h-1;x++)y|=u[v*h+p+x]<<8*x;g+=y,m.push(g)}for(v=0;v<m.length-1;v++)b=i.unzlibSync(u.slice(m[v],m[v+1])).buffer,"Float32"===e.attributes.type?A=t(A,b=new Float32Array(b)):"Int64"===e.attributes.type&&(a=b=new Int32Array(b),l=void 0,c=void 0,l=(s=A).length,(c=new Int32Array(l+a.length)).set(s),c.set(a,l),A=c);delete e["#text"],"Int64"===e.attributes.type&&"binary"===e.attributes.format&&(A=A.filter((function(e,t){if(t%2!=1)return!0})))}else{if("binary"!==e.attributes.format||r)if(e["#text"])var b=e["#text"].split(/\s+/).filter((function(e){if(""!==e)return e}));else b=new Int32Array(0).buffer;else b=(b=n(e["#text"])).slice(h).buffer;delete e["#text"],"Float32"===e.attributes.type?A=new Float32Array(b):"Int32"===e.attributes.type?A=new Int32Array(b):"Int64"===e.attributes.type&&(A=new Int32Array(b),"binary"===e.attributes.format&&(A=A.filter((function(e,t){if(t%2!=1)return!0}))))}return A}var a=null;if(window.DOMParser)try{a=(new DOMParser).parseFromString(e,"text/xml")}catch(k){a=null}else{if(!window.ActiveXObject)throw new Error("Cannot parse xml string!");try{if((a=new ActiveXObject("Microsoft.XMLDOM")).async=!1,!a.loadXML())throw new Error(a.parseError.reason+a.parseError.srcText)}catch(k){a=null}}var o=function e(t){var n={};if(1===t.nodeType){if(t.attributes&&t.attributes.length>0){n.attributes={};for(var r=0;r<t.attributes.length;r++){var i=t.attributes.item(r);n.attributes[i.nodeName]=i.nodeValue.trim()}}}else 3===t.nodeType&&(n=t.nodeValue.trim());if(t.hasChildNodes())for(var s=0;s<t.childNodes.length;s++){var a=t.childNodes.item(s),o=a.nodeName;if(void 0===n[o])""!==(c=e(a))&&(n[o]=c);else{if(void 0===n[o].push){var l=n[o];n[o]=[l]}var c;""!==(c=e(a))&&n[o].push(c)}}return n}(a.documentElement),l=[],c=[],h=[];if(o.PolyData){for(var u=o.PolyData.Piece,d=o.attributes.hasOwnProperty("compressor"),p=["PointData","Points","Strips","Polys"],f=0,m=p.length;f<m;){var g=u[p[f]];if(g&&g.DataArray){if("[object Array]"===Object.prototype.toString.call(g.DataArray))var A=g.DataArray;else A=[g.DataArray];for(var v=0,y=A.length;v<y;)"#text"in A[v]&&A[v]["#text"].length>0&&(A[v].text=s(A[v],d)),v++;switch(p[f]){case"PointData":var x=parseInt(u.attributes.NumberOfPoints),b=g.attributes.Normals;if(x>0)for(var E=0,_=A.length;E<_;E++)if(b===A[E].attributes.Name){var S=A[E].attributes.NumberOfComponents;(c=new Float32Array(x*S)).set(A[E].text,0)}break;case"Points":(x=parseInt(u.attributes.NumberOfPoints))>0&&(S=g.DataArray.attributes.NumberOfComponents,(l=new Float32Array(x*S)).set(g.DataArray.text,0));break;case"Strips":var w=parseInt(u.attributes.NumberOfStrips);if(w>0){var M=new Int32Array(g.DataArray[0].text.length),C=new Int32Array(g.DataArray[1].text.length);M.set(g.DataArray[0].text,0),C.set(g.DataArray[1].text,0);var T=w+M.length;h=new Uint32Array(3*T-9*w);var I=0;for(E=0,_=w;E<_;E++){for(var B=[],R=0,P=C[E],D=0;R<P-D;R++)B.push(M[R]),E>0&&(D=C[E-1]);var L=0;for(P=C[E],D=0;L<P-D-2;L++)L%2?(h[I++]=B[L],h[I++]=B[L+2],h[I++]=B[L+1]):(h[I++]=B[L],h[I++]=B[L+1],h[I++]=B[L+2]),E>0&&(D=C[E-1])}}break;case"Polys":var F=parseInt(u.attributes.NumberOfPolys);if(F>0){M=new Int32Array(g.DataArray[0].text.length),C=new Int32Array(g.DataArray[1].text.length),M.set(g.DataArray[0].text,0),C.set(g.DataArray[1].text,0),T=F+M.length,h=new Uint32Array(3*T-9*F),I=0;var U=0;for(E=0,_=F,D=0;E<_;){var O=[];for(R=0,P=C[E];R<P-D;)O.push(M[U++]),R++;for(L=1;L<P-D-1;)h[I++]=O[0],h[I++]=O[L],h[I++]=O[L+1],L++;D=C[++E-1]}}}}f++}var N=new r.BufferGeometry;return N.setIndex(new r.BufferAttribute(h,1)),N.setAttribute("position",new r.BufferAttribute(l,3)),c.length===l.length&&N.setAttribute("normal",new r.BufferAttribute(c,3)),N}throw new Error("Unsupported DATASET type")}(r.LoaderUtils.decodeText(e)):n[2].includes("ASCII")?function(e){var t,n=[],i=[],s=[],a=[],o=/^[^\d.\s-]+/,l=/(\-?\d+\.?[\d\-\+e]*)\s+(\-?\d+\.?[\d\-\+e]*)\s+(\-?\d+\.?[\d\-\+e]*)/g,c=/^(\d+)\s+([\s\d]*)/,h=/^POINTS /,u=/^POLYGONS /,d=/^TRIANGLE_STRIPS /,p=/^POINT_DATA[ ]+(\d+)/,f=/^CELL_DATA[ ]+(\d+)/,m=/^COLOR_SCALARS[ ]+(\w+)[ ]+3/,g=/^NORMALS[ ]+(\w+)[ ]+(\w+)/,A=!1,v=!1,y=!1,x=!1,b=!1,E=!1,_=!1,S=e.split("\n");for(var w in S){var M=S[w].trim();if(0===M.indexOf("DATASET")){var C=M.split(" ")[1];if("POLYDATA"!==C)throw new Error("Unsupported DATASET type: "+C)}else if(A)for(;null!==(t=l.exec(M))&&null===o.exec(M);){var T=parseFloat(t[1]),I=parseFloat(t[2]),B=parseFloat(t[3]);i.push(T,I,B)}else if(v){if(null!==(t=c.exec(M))){var R=parseInt(t[1]),P=t[2].split(/\s+/);if(R>=3)for(var D=parseInt(P[0]),L=1,F=0;F<R-2;++F)U=parseInt(P[L]),O=parseInt(P[L+1]),n.push(D,U,O),L++}}else if(y){if(null!==(t=c.exec(M))){var U,O;if(R=parseInt(t[1]),P=t[2].split(/\s+/),R>=3)for(F=0;F<R-2;F++)F%2==1?(D=parseInt(P[F]),U=parseInt(P[F+2]),O=parseInt(P[F+1]),n.push(D,U,O)):(D=parseInt(P[F]),U=parseInt(P[F+1]),O=parseInt(P[F+2]),n.push(D,U,O))}}else if(x||b)if(E)for(;null!==(t=l.exec(M))&&null===o.exec(M);){var N=parseFloat(t[1]),k=parseFloat(t[2]),G=parseFloat(t[3]);s.push(N,k,G)}else if(_)for(;null!==(t=l.exec(M))&&null===o.exec(M);){var z=parseFloat(t[1]),Q=parseFloat(t[2]),V=parseFloat(t[3]);a.push(z,Q,V)}null!==u.exec(M)?(v=!0,A=!1,y=!1):null!==h.exec(M)?(v=!1,A=!0,y=!1):null!==d.exec(M)?(v=!1,A=!1,y=!0):null!==p.exec(M)?(x=!0,A=!1,v=!1,y=!1):null!==f.exec(M)?(b=!0,A=!1,v=!1,y=!1):null!==m.exec(M)?(E=!0,_=!1,A=!1,v=!1,y=!1):null!==g.exec(M)&&(_=!0,E=!1,A=!1,v=!1,y=!1)}var H=new r.BufferGeometry;if(H.setIndex(n),H.setAttribute("position",new r.Float32BufferAttribute(i,3)),a.length===i.length&&H.setAttribute("normal",new r.Float32BufferAttribute(a,3)),s.length!==n.length)s.length===i.length&&H.setAttribute("color",new r.Float32BufferAttribute(s,3));else{var j=(H=H.toNonIndexed()).attributes.position.count/3;if(s.length===3*j){var W=[];for(w=0;w<j;w++)N=s[3*w+0],k=s[3*w+1],G=s[3*w+2],W.push(N,k,G),W.push(N,k,G),W.push(N,k,G);H.setAttribute("color",new r.Float32BufferAttribute(W,3))}}return H}(r.LoaderUtils.decodeText(e)):function(e){var t,n,i,s,a,o,l,c=new Uint8Array(e),h=new DataView(e),u=[],d=[],p=[],f=0;function m(e,t){for(var n=t,r=e[n],i=[];10!==r;)i.push(String.fromCharCode(r)),r=e[++n];return{start:t,end:n,next:n+1,parsedString:i.join("")}}for(;;){if(0===(l=(o=m(c,f)).parsedString).indexOf("DATASET")){var g=l.split(" ")[1];if("POLYDATA"!==g)throw new Error("Unsupported DATASET type: "+g)}else if(0===l.indexOf("POINTS")){for(t=4*(s=parseInt(l.split(" ")[1],10))*3,u=new Float32Array(3*s),n=o.next,i=0;i<s;i++)u[3*i]=h.getFloat32(n,!1),u[3*i+1]=h.getFloat32(n+4,!1),u[3*i+2]=h.getFloat32(n+8,!1),n+=12;o.next=o.next+t+1}else if(0===l.indexOf("TRIANGLE_STRIPS")){var A=parseInt(l.split(" ")[1],10);t=4*(E=parseInt(l.split(" ")[2],10)),p=new Uint32Array(3*E-9*A);var v=0;for(n=o.next,i=0;i<A;i++){var y=h.getInt32(n,!1),x=[];for(n+=4,a=0;a<y;a++)x.push(h.getInt32(n,!1)),n+=4;for(var b=0;b<y-2;b++)b%2?(p[v++]=x[b],p[v++]=x[b+2],p[v++]=x[b+1]):(p[v++]=x[b],p[v++]=x[b+1],p[v++]=x[b+2])}o.next=o.next+t+1}else if(0===l.indexOf("POLYGONS")){var E;for(A=parseInt(l.split(" ")[1],10),t=4*(E=parseInt(l.split(" ")[2],10)),p=new Uint32Array(3*E-9*A),v=0,n=o.next,i=0;i<A;i++){for(y=h.getInt32(n,!1),x=[],n+=4,a=0;a<y;a++)x.push(h.getInt32(n,!1)),n+=4;for(b=1;b<y-1;b++)p[v++]=x[0],p[v++]=x[b],p[v++]=x[b+1]}o.next=o.next+t+1}else if(0===l.indexOf("POINT_DATA")){for(s=parseInt(l.split(" ")[1],10),o=m(c,o.next),t=4*s*3,d=new Float32Array(3*s),n=o.next,i=0;i<s;i++)d[3*i]=h.getFloat32(n,!1),d[3*i+1]=h.getFloat32(n+4,!1),d[3*i+2]=h.getFloat32(n+8,!1),n+=12;o.next=o.next+t}if((f=o.next)>=c.byteLength)break}var _=new r.BufferGeometry;return _.setIndex(new r.BufferAttribute(p,1)),_.setAttribute("position",new r.BufferAttribute(u,3)),d.length===u.length&&_.setAttribute("normal",new r.BufferAttribute(d,3)),_}(e)}}t.VTKLoader=s},56668:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);var s,a,o,l,c,h,u=(s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=function(){function e(e,t){for(let r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(){s(this,e),this.boneName="",this.BoneIndex=0,this.Indeces=[],this.Weights=[],this.initMatrix=null,this.OffsetMatrix=null},l=function e(){s(this,e),this.animeName="",this.boneName="",this.targetBone=null,this.keyType=4,this.frameStartLv=0,this.keyFrames=[],this.InverseMx=null},c=function(){function e(t){s(this,e),this.fps=30,this.name="xanimation",this.length=0,this.hierarchy=[],this.putFlags=t,void 0===this.putFlags.putPos&&(this.putFlags.putPos=!0),void 0===this.putFlags.putRot&&(this.putFlags.putRot=!0),void 0===this.putFlags.putScl&&(this.putFlags.putScl=!0)}return a(e,[{key:"make",value:function(e){for(let t=0;t<e.length;t++)this.hierarchy.push(this.makeBonekeys(e[t]));this.length=this.hierarchy[0].keys[this.hierarchy[0].keys.length-1].time}},{key:"clone",value:function(){return Object.assign({},this)}},{key:"makeBonekeys",value:function(e){var t={};return t.name=e.boneName,t.parent="",t.keys=this.keyFrameRefactor(e),t.copy=function(){return Object.assign({},this)},t}},{key:"keyFrameRefactor",value:function(e){var t=[];for(let i=0;i<e.keyFrames.length;i++){var n={};n.time=e.keyFrames[i].time*this.fps,e.keyFrames[i].pos&&this.putFlags.putPos&&(n.pos=e.keyFrames[i].pos),e.keyFrames[i].rot&&this.putFlags.putRot&&(n.rot=e.keyFrames[i].rot),e.keyFrames[i].scl&&this.putFlags.putScl&&(n.scl=e.keyFrames[i].scl),e.keyFrames[i].matrix&&(n.matrix=e.keyFrames[i].matrix,this.putFlags.putPos&&(n.pos=(new r.Vector3).setFromMatrixPosition(n.matrix)),this.putFlags.putRot&&(n.rot=(new r.Quaternion).setFromRotationMatrix(n.matrix)),this.putFlags.putScl&&(n.scl=(new r.Vector3).setFromMatrixScale(n.matrix))),t.push(n)}return t}}]),e}(),h=function e(){s(this,e),this.index=0,this.Frame=0,this.time=0,this.matrix=null},function(){function e(t){r.Loader.call(this,t),s(this,e),this.debug=!1,this.texloader=new r.TextureLoader(this.manager),this.url="",this._putMatLength=0,this._nowMat=null,this._nowFrameName="",this.frameHierarchie=[],this.Hierarchies={},this.HieStack=[],this._currentObject={},this._currentFrame={},this._data=null,this.onLoad=null,this.IsUvYReverse=!0,this.Meshes=[],this.animations=[],this.animTicksPerSecond=30,this._currentGeo=null,this._currentAnime=null,this._currentAnimeFrames=null}return a(e,[{key:"_setArgOption",value:function(e){if(e){for(let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t<e.length;t++)switch(t){case 0:this.url=e[t];break;case 1:this.options=e[t]}void 0===this.options&&(this.options={})}}},{key:"load",value:function(e,t,n,i){var s=this;this._setArgOption(e);var a=new r.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(this.url,(function(e){try{s.parse(e,t)}catch(n){i?i(n):console.error(n),s.manager.itemError(s.url)}}),n,i)}},{key:"_readLine",value:function(e){for(var t=0;;){var n=-1;if(-1===(n=e.indexOf("//",t))&&(n=e.indexOf("#",t)),!(n>-1&&n<2))break;var r=-1;t=(r=e.indexOf("\r\n",t))>0?r+2:(r=e.indexOf("\r",t))>0?r+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var n=-1;if(-1===(n=e.indexOf("//",t))&&(n=e.indexOf("#",t)),!(n>-1&&n<2))break;var r=-1;t=(r=e.indexOf("\r\n",t))>0?r+2:(r=e.indexOf("\r",t))>0?r+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;var n=t.byteLength;for(let r=0;r<n;r++)if(t.getUint8(r,!1)>127)return!0;return!1}},{key:"_ensureBinary",value:function(e){if("string"==typeof e){var t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}},{key:"_ensureString",value:function(e){return"string"!=typeof e?r.LoaderUtils.decodeText(new Uint8Array(e)):e}},{key:"parse",value:function(e,t){var n=this._ensureBinary(e);return this._data=this._ensureString(e),this.onLoad=t,this._isBinary(n)?this._parseBinary(n):this._parseASCII()}},{key:"_parseBinary",value:function(e){return this._parseASCII(r.LoaderUtils.decodeText(new Uint8Array(e)))}},{key:"_parseASCII",value:function(){var e;e=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:r.LoaderUtils.extractUrlBase(this.url),this.texloader.setPath(e).setCrossOrigin(this.crossOrigin),this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this._mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var n=t;;){var r=this._data.indexOf("{",n)+1,i=this._data.indexOf("}",n),s=this._data.indexOf("{",r)+1;if(!(r>0&&i>r)){n=-1===r?this._data.length:i+1;break}var a={children:[]},o=this._readLine(this._data.substr(n,r-n-1)).trim(),l=o.split(/ /g);if(l.length>0?(a.type=l[0],l.length>=2?a.name=l[1]:a.name=l[0]+this.Hierarchies.children.length):(a.name=o,a.type=""),"Animation"===a.type){a.data=this._data.substr(s,i-s).trim();var c=this._hierarchieParse(a,i+1);n=c.end,a.children=c.parent.children}else{var h=this._data.lastIndexOf(";",s>0?Math.min(s,i):i);if(a.data=this._data.substr(r,h-r).trim(),s<=0||i<s)n=i+1;else{var u=Math.max(h+1,r),d=this._hierarchieParse(a,u);n=d.end,a.children=d.parent.children}}a.parent=e,"template"!=a.type&&e.children.push(a)}return{parent:e,end:n}}},{key:"_mainloop",value:function(){var e=this;this._mainProc(),this._currentObject.parent||this._currentObject.children.length>0||!this._currentObject.worked?setTimeout((function(){e._mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"_mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":case"VertexDuplicationIndices":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.GeometryData={vertices:[],normals:[],uvs:[],skinIndices:[],skinWeights:[],indices:[],materialIndices:[]},this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new l,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new r.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new r.Bone;if(e.name=this._currentFrame.name,e.applyMatrix4(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(let e in this.HieStack)this.HieStack[e].name===this._currentFrame.parentName&&this.HieStack[e].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,n=0,r=0;;){var i=!1;if(0===n)e=this._readInt1(e).endRead,n=1,(r=this._currentObject.data.indexOf(";;",e)+1)<=0&&(r=this._currentObject.data.length);else{var s=0;switch(t){case 0:s=this._currentObject.data.indexOf(",",e)+1;break;case 1:s=this._currentObject.data.indexOf(";,",e)+1}switch((0===s||s>r)&&(s=r,n=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,s-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,s-e))}break;case"MeshNormals":0===t&&this._readNormalVector1(this._currentObject.data.substr(e,s-e))}e=s+1,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.GeometryData.vertices.push(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])),this._currentGeo.GeometryData.skinIndices.push(0,0,0,0),this._currentGeo.GeometryData.skinWeights.push(1,0,0,0),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.GeometryData.indices.push(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.GeometryData.normals.push(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))}},{key:"_buildGeometry",value:function(){var e=new r.BufferGeometry,t=[],n=[],i=[],s=[],a=[],o=this._currentGeo.GeometryData;for(let r=0,u=o.indices.length;r<u;r++){var l=2*o.indices[r],c=3*o.indices[r],h=4*o.indices[r];t.push(o.vertices[c],o.vertices[c+1],o.vertices[c+2]),n.push(o.normals[c],o.normals[c+1],o.normals[c+2]),s.push(o.skinIndices[h],o.skinIndices[h+1],o.skinIndices[h+2],o.skinIndices[h+3]),a.push(o.skinWeights[h],o.skinWeights[h+1],o.skinWeights[h+2],o.skinWeights[h+3]),i.push(o.uvs[l],o.uvs[l+1])}return e.setAttribute("position",new r.Float32BufferAttribute(t,3)),e.setAttribute("normal",new r.Float32BufferAttribute(n,3)),e.setAttribute("uv",new r.Float32BufferAttribute(i,2)),e.setAttribute("skinIndex",new r.Uint16BufferAttribute(s,4)),e.setAttribute("skinWeight",new r.Float32BufferAttribute(a,4)),this._computeGroups(e,o.materialIndices),e}},{key:"_computeGroups",value:function(e,t){var n,r=[],s=void 0;for(let i=0;i<t.length;i++){var a=t[i];a!==s&&(s=a,void 0!==n&&(n.count=3*i-n.start,r.push(n)),n={start:3*i,materialIndex:s})}void 0!==n&&(n.count=3*i-n.start,r.push(n)),e.groups=r}},{key:"_setMeshTextureCoords",value:function(){for(var e=0,t=0,n=0;;){if(0===t)if(0===n)e=this._readInt1(0).endRead,n=1;else{var r=this._currentObject.data.indexOf(",",e)+1;0===r&&(r=this._currentObject.data.length,t=2,n=0);var i=this._currentObject.data.substr(e,r-e),s=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._currentGeo.GeometryData.uvs.push(parseFloat(s[0]),1-parseFloat(s[1])):this._currentGeo.GeometryData.uvs.push(parseFloat(s[0]),parseFloat(s[1])),e=r+1}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshMaterialList",value:function(){for(var e=0,t=0,n=0;;){if(n<2)e=this._readInt1(e).endRead,n++;else{var r=this._currentObject.data.indexOf(";",e);-1===r&&(r=this._currentObject.data.length,t=3,n=0);var i=this._currentObject.data.substr(e,r-e),s=this._readLine(i.trim()).split(",");for(let e=0;e<s.length;e++)this._currentGeo.GeometryData.materialIndices[e]=parseInt(s[e]);e=this._currentObject.data.length}if(e>=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new r.MeshPhongMaterial({color:16777215*Math.random()});e.side=r.FrontSide,e.name=this._currentObject.name;var t=0,n=this._currentObject.data.indexOf(";;",t),i=this._currentObject.data.substr(t,n-t),s=this._readLine(i.trim()).split(";");e.color.r=parseFloat(s[0]),e.color.g=parseFloat(s[1]),e.color.b=parseFloat(s[2]),t=n+2,n=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,n-t),e.shininess=parseFloat(this._readLine(i)),t=n+1,n=this._currentObject.data.indexOf(";;",t),i=this._currentObject.data.substr(t,n-t);var a=this._readLine(i.trim()).split(";");e.specular.r=parseFloat(a[0]),e.specular.g=parseFloat(a[1]),e.specular.b=parseFloat(a[2]),t=n+2,-1===(n=this._currentObject.data.indexOf(";;",t))&&(n=this._currentObject.data.length),i=this._currentObject.data.substr(t,n-t);var o=this._readLine(i.trim()).split(";");e.emissive.r=parseFloat(o[0]),e.emissive.g=parseFloat(o[1]),e.emissive.b=parseFloat(o[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var c=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(c);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(c),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(c),e.normalScale=new r.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(c);break;case"LightMapFilename":e.lightMap=this.texloader.load(c)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,n=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,n-t);t=n+1,e.boneName=i.substr(1,i.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(n=this._currentObject.data.indexOf(";",t))+1,n=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,n-t);var s=this._readLine(i.trim()).split(",");for(let r=0;r<s.length;r++)e.Indeces.push(parseInt(s[r]));t=n+1,n=this._currentObject.data.indexOf(";",t),i=this._currentObject.data.substr(t,n-t);var a=this._readLine(i.trim()).split(",");for(let r=0;r<a.length;r++)e.Weights.push(parseFloat(a[r]));t=n+1,(n=this._currentObject.data.indexOf(";",t))<=0&&(n=this._currentObject.data.length),i=this._currentObject.data.substr(t,n-t);var l=this._readLine(i.trim()).split(",");e.OffsetMatrix=new r.Matrix4,this._ParseMatrixData(e.OffsetMatrix,l),this._currentGeo.BoneInfs.push(e)}},{key:"_makePutBoneList",value:function(e,t){var n=!1;for(let s in this.HieStack)if(this.HieStack[s].name===e||n){n=!0;var i=new r.Bone;if(i.name=this.HieStack[s].name,i.applyMatrix4(this.HieStack[s].FrameTransformMatrix),i.matrixWorld=i.matrix,i.FrameTransformMatrix=this.HieStack[s].FrameTransformMatrix,i.pos=(new r.Vector3).setFromMatrixPosition(i.FrameTransformMatrix).toArray(),i.rotq=(new r.Quaternion).setFromRotationMatrix(i.FrameTransformMatrix).toArray(),i.scl=(new r.Vector3).setFromMatrixScale(i.FrameTransformMatrix).toArray(),this.HieStack[s].parentName&&this.HieStack[s].parentName.length>0)for(let e=0;e<t.length;e++)if(this.HieStack[s].parentName===t[e].name){t[e].add(i),i.parent=e;break}t.push(i)}}},{key:"_makeOutputGeometry",value:function(){var e=null;if(this._currentGeo.BoneInfs.length>0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(let e=0;e<this._currentGeo.BoneInfs.length;e++){var n=0;for(let i=0;i<t.length;i++)if(t[i].name===this._currentGeo.BoneInfs[e].boneName){n=i,t[i].OffsetMatrix=new r.Matrix4,t[i].OffsetMatrix.copy(this._currentGeo.BoneInfs[e].OffsetMatrix);break}for(let t=0;t<this._currentGeo.BoneInfs[e].Indeces.length;t++){var i=this._currentGeo.BoneInfs[e].Indeces[t],s=this._currentGeo.BoneInfs[e].Weights[t],a=4*i;switch(this._currentGeo.VertexSetedBoneCount[i]){case 0:this._currentGeo.GeometryData.skinIndices[a]=n,this._currentGeo.GeometryData.skinWeights[a]=s;break;case 1:this._currentGeo.GeometryData.skinIndices[a+1]=n,this._currentGeo.GeometryData.skinWeights[a+1]=s;break;case 2:this._currentGeo.GeometryData.skinIndices[a+2]=n,this._currentGeo.GeometryData.skinWeights[a+2]=s;break;case 3:this._currentGeo.GeometryData.skinIndices[a+3]=n,this._currentGeo.GeometryData.skinWeights[a+3]=s}this._currentGeo.VertexSetedBoneCount[i]++,this._currentGeo.VertexSetedBoneCount[i]>4&&console.log("warn! over 4 bone weight! :"+i)}}for(let e=0;e<this._currentGeo.Materials.length;e++)this._currentGeo.Materials[e].skinning=!0;var o=[];for(let e=0;e<t.length;e++)t[e].OffsetMatrix?o.push(t[e].OffsetMatrix):o.push(new r.Matrix4);var l=this._buildGeometry();e=new r.SkinnedMesh(l,1===this._currentGeo.Materials.length?this._currentGeo.Materials[0]:this._currentGeo.Materials),this._initSkeleton(e,t,o)}else{var c=this._buildGeometry();e=new r.Mesh(c,1===this._currentGeo.Materials.length?this._currentGeo.Materials[0]:this._currentGeo.Materials)}e.name=this._currentGeo.name;var h=new r.Matrix4,u=this._currentGeo.baseFrame.putBone;if(u&&u.parent){for(;u=u.parent;)h.multiply(u.FrameTransformMatrix);e.applyMatrix4(h)}this.Meshes.push(e)}},{key:"_initSkeleton",value:function(e,t,n){var i,s,a,o,l=[];for(a=0,o=t.length;a<o;a++)s=t[a],i=new r.Bone,l.push(i),i.name=s.name,i.position.fromArray(s.pos),i.quaternion.fromArray(s.rotq),void 0!==s.scl&&i.scale.fromArray(s.scl);for(a=0,o=t.length;a<o;a++)-1!==(s=t[a]).parent&&null!==s.parent&&void 0!==l[s.parent]?l[s.parent].add(l[a]):e.add(l[a]);e.updateMatrixWorld(!0);var c=new r.Skeleton(l,n);e.bind(c,e.matrixWorld)}},{key:"_readAnimationKey",value:function(){var e=0,t=this._currentObject.data.indexOf(";",e),n=this._currentObject.data.substr(e,t-e);e=t+1;var i=parseInt(this._readLine(n));e=(t=this._currentObject.data.indexOf(";",e))+1,n=this._currentObject.data.substr(e);var s=this._readLine(n.trim()).split(";;,");for(let u=0;u<s.length;u++){var a=s[u].split(";"),o=new h;if(o.type=i,o.Frame=parseInt(a[0]),o.index=this._currentAnimeFrames.keyFrames.length,o.time=o.Frame,4!=i){var l=!1;for(let e=0;e<this._currentAnimeFrames.keyFrames.length;e++)if(this._currentAnimeFrames.keyFrames[e].Frame===o.Frame){o=this._currentAnimeFrames.keyFrames[e],l=!0;break}var c=a[2].split(",");switch(i){case 0:o.rot=new r.Quaternion(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3]),-1*parseFloat(c[0]));break;case 1:o.scl=new r.Vector3(parseFloat(c[0]),parseFloat(c[1]),parseFloat(c[2]));break;case 2:o.pos=new r.Vector3(parseFloat(c[0]),parseFloat(c[1]),parseFloat(c[2]))}l||this._currentAnimeFrames.keyFrames.push(o)}else o.matrix=new r.Matrix4,this._ParseMatrixData(o.matrix,a[2].split(",")),this._currentAnimeFrames.keyFrames.push(o)}}},{key:"_makeOutputAnimation",value:function(){var e=new c(this.options);e.fps=this.animTicksPerSecond,e.name=this._currentAnime.name,e.make(this._currentAnime.AnimeFrames),this.animations.push(e)}},{key:"assignAnimation",value:function(e,t){var n=e,i=t;if(n||(n=this.Meshes[0]),i||(i=this.animations[0]),!n||!i)return null;var s={};s.fps=i.fps,s.name=i.name,s.length=i.length,s.hierarchy=[];for(let r=0;r<n.skeleton.bones.length;r++){var a=!1;for(let e=0;e<i.hierarchy.length;e++)if(n.skeleton.bones[r].name===i.hierarchy[e].name){a=!0;var o=i.hierarchy[e].copy();if(o.parent=-1,n.skeleton.bones[r].parent&&"Bone"===n.skeleton.bones[r].parent.type)for(let e=0;e<s.hierarchy.length;e++)s.hierarchy[e].name===n.skeleton.bones[r].parent.name&&(o.parent=e,o.parentName=n.skeleton.bones[r].parent.name);s.hierarchy.push(o);break}if(!a){var l=i.hierarchy[0].copy();l.name=n.skeleton.bones[r].name,l.parent=-1;for(let e=0;e<l.keys.length;e++)l.keys[e].pos&&l.keys[e].pos.set(0,0,0),l.keys[e].scl&&l.keys[e].scl.set(1,1,1),l.keys[e].rot&&l.keys[e].rot.set(0,0,0,1);s.hierarchy.push(l)}}return n.geometry.animations||(n.geometry.animations=[]),n.geometry.animations.push(r.AnimationClip.parseAnimation(s,n.skeleton.bones)),n.animationMixer||(n.animationMixer=new r.AnimationMixer(n)),s}},{key:"_ParseMatrixData",value:function(e,t){e.set(parseFloat(t[0]),parseFloat(t[4]),parseFloat(t[8]),parseFloat(t[12]),parseFloat(t[1]),parseFloat(t[5]),parseFloat(t[9]),parseFloat(t[13]),parseFloat(t[2]),parseFloat(t[6]),parseFloat(t[10]),parseFloat(t[14]),parseFloat(t[3]),parseFloat(t[7]),parseFloat(t[11]),parseFloat(t[15]))}}]),e}());t.XLoader=u},25452:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Loader{load(e,t,n,i){const s=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(s.parse(n))}catch(r){i?i(r):console.error(r),s.manager.itemError(e)}}),n,i)}parse(e){const t=e.split("\n"),n=[],i=[];for(let r of t){if(r=r.trim(),"#"===r.charAt(0))continue;const e=r.split(/\s+/);3===e.length&&(n.push(parseFloat(e[0])),n.push(parseFloat(e[1])),n.push(parseFloat(e[2]))),6===e.length&&(n.push(parseFloat(e[0])),n.push(parseFloat(e[1])),n.push(parseFloat(e[2])),i.push(parseFloat(e[3])/255),i.push(parseFloat(e[4])/255),i.push(parseFloat(e[5])/255))}const s=new r.BufferGeometry;return s.setAttribute("position",new r.Float32BufferAttribute(n,3)),i.length>0&&s.setAttribute("color",new r.Float32BufferAttribute(i,3)),s}}t.XYZLoader=i},40876:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(90153),i=n(30997);class s{constructor(e){this.dv=new DataView(e),this.offset=0,this._textDecoder=new TextDecoder,this._bytes=new Uint8Array(e)}size(){return this.dv.buffer.byteLength}setOffset(e){e>0&&e<this.dv.buffer.byteLength?this.offset=e:console.error("LWOLoader: invalid buffer offset")}endOfFile(){return this.offset>=this.size()}skip(e){this.offset+=e}getUint8(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e}getUint16(){var e=this.dv.getUint16(this.offset);return this.offset+=2,e}getInt32(){var e=this.dv.getInt32(this.offset,!1);return this.offset+=4,e}getUint32(){var e=this.dv.getUint32(this.offset,!1);return this.offset+=4,e}getUint64(){return 4294967296*this.getUint32()+this.getUint32()}getFloat32(){var e=this.dv.getFloat32(this.offset,!1);return this.offset+=4,e}getFloat32Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat64());return t}getVariableLengthIndex(){var e=this.getUint8();return 255===e?65536*this.getUint8()+256*this.getUint8()+this.getUint8():256*e+this.getUint8()}getIDTag(){return this.getString(4)}getString(e){if(0===e)return;const t=this.offset;let n,r;return e?(r=e,n=this._textDecoder.decode(new Uint8Array(this.dv.buffer,t,e))):(r=this._bytes.indexOf(0,t)-t,n=this._textDecoder.decode(new Uint8Array(this.dv.buffer,t,r)),r++,r+=r%2),this.skip(r),n}getStringArray(e){var t=this.getString(e);return(t=t.split("\0")).filter(Boolean)}}class a{constructor(){this.active=!1,this.depth=0,this.formList=[]}enable(){this.active=!0}log(){if(this.active){var e;switch(this.node){case 0:e="FORM";break;case 1:e="CHK";break;case 2:e="S-CHK"}console.log("| ".repeat(this.depth)+e,this.nodeID,`( ${this.offset} ) -> ( ${this.dataOffset+this.length} )`,0==this.node?" {":"",this.skipped?"SKIPPED":"",0==this.node&&this.skipped?"}":""),0!=this.node||this.skipped||(this.depth+=1,this.formList.push(this.dataOffset+this.length)),this.skipped=!1}}closeForms(){if(this.active)for(var e=this.formList.length-1;e>=0;e--)this.offset>=this.formList[e]&&(this.depth-=1,console.log("| ".repeat(this.depth)+"}"),this.formList.splice(-1,1))}}function o(e){return e.length+1+((e.length+1)%2?1:0)}t.IFFParser=class{constructor(){this.debugger=new a}parse(e){if(this.reader=new s(e),this.tree={materials:{},layers:[],tags:[],textures:[]},this.currentLayer=this.tree,this.currentForm=this.tree,this.parseTopForm(),void 0!==this.tree.format){if("LWO2"===this.tree.format)for(this.parser=new r.LWO2Parser(this);!this.reader.endOfFile();)this.parser.parseBlock();else if("LWO3"===this.tree.format)for(this.parser=new i.LWO3Parser(this);!this.reader.endOfFile();)this.parser.parseBlock();return this.debugger.offset=this.reader.offset,this.debugger.closeForms(),this.tree}}parseTopForm(){if(this.debugger.offset=this.reader.offset,"FORM"===this.reader.getIDTag()){var e=this.reader.getUint32();this.debugger.dataOffset=this.reader.offset,this.debugger.length=e;var t=this.reader.getIDTag();("LWO2"===t||"LWO3"===t)&&(this.tree.format=t),this.debugger.node=0,this.debugger.nodeID=t,this.debugger.log()}else console.warn("LWOLoader: Top-level FORM missing.")}parseForm(e){var t=this.reader.getIDTag();switch(t){case"ISEQ":case"ANIM":case"STCC":case"VPVL":case"VPRM":case"NROT":case"WRPW":case"WRPH":case"FUNC":case"FALL":case"OPAC":case"GRAD":case"ENVS":case"VMOP":case"VMBG":case"OMAX":case"STEX":case"CKBG":case"CKEY":case"VMLA":case"VMLB":this.debugger.skipped=!0,this.skipForm(e);break;case"META":case"NNDS":case"NODS":case"NDTA":case"ADAT":case"AOVS":case"BLOK":case"IBGC":case"IOPC":case"IIMG":case"TXTR":this.debugger.length=4,this.debugger.skipped=!0;break;case"IFAL":case"ISCL":case"IPOS":case"IROT":case"IBMP":case"IUTD":case"IVTD":this.parseTextureNodeAttribute(t);break;case"ENVL":this.parseEnvelope(e);break;case"CLIP":"LWO2"===this.tree.format?this.parseForm(e):this.parseClip(e);break;case"STIL":this.parseImage();break;case"XREF":this.reader.skip(8),this.currentForm.referenceTexture={index:this.reader.getUint32(),refName:this.reader.getString()};break;case"IMST":this.parseImageStateForm(e);break;case"SURF":this.parseSurfaceForm(e);break;case"VALU":this.parseValueForm(e);break;case"NTAG":this.parseSubNode(e);break;case"ATTR":case"SATR":this.setupForm("attributes",e);break;case"NCON":this.parseConnections(e);break;case"SSHA":this.parentForm=this.currentForm,this.currentForm=this.currentSurface,this.setupForm("surfaceShader",e);break;case"SSHD":this.setupForm("surfaceShaderData",e);break;case"ENTR":this.parseEntryForm(e);break;case"IMAP":this.parseImageMap(e);break;case"TAMP":this.parseXVAL("amplitude",e);break;case"TMAP":this.setupForm("textureMap",e);break;case"CNTR":this.parseXVAL3("center",e);break;case"SIZE":this.parseXVAL3("scale",e);break;case"ROTA":this.parseXVAL3("rotation",e);break;default:this.parseUnknownForm(t,e)}this.debugger.node=0,this.debugger.nodeID=t,this.debugger.log()}setupForm(e,t){this.currentForm||(this.currentForm=this.currentNode),this.currentFormEnd=this.reader.offset+t,this.parentForm=this.currentForm,this.currentForm[e]?(console.warn("LWOLoader: form already exists on parent: ",e,this.currentForm),this.currentForm=this.currentForm[e]):(this.currentForm[e]={},this.currentForm=this.currentForm[e])}skipForm(e){this.reader.skip(e-4)}parseUnknownForm(e,t){var n,r,i;console.warn("LWOLoader: unknown FORM encountered: "+e,t),n=this.reader.dv.buffer,r=this.reader.offset,i=t-4,console.log((new TextDecoder).decode(new Uint8Array(n,r,i))),this.reader.skip(t-4)}parseSurfaceForm(e){this.reader.skip(8);var t=this.reader.getString(),n={attributes:{},connections:{},name:t,inputName:t,nodes:{},source:this.reader.getString()};this.tree.materials[t]=n,this.currentSurface=n,this.parentForm=this.tree.materials,this.currentForm=n,this.currentFormEnd=this.reader.offset+e}parseSurfaceLwo2(e){var t=this.reader.getString(),n={attributes:{},connections:{},name:t,nodes:{},source:this.reader.getString()};this.tree.materials[t]=n,this.currentSurface=n,this.parentForm=this.tree.materials,this.currentForm=n,this.currentFormEnd=this.reader.offset+e}parseSubNode(e){this.reader.skip(8);var t={name:this.reader.getString()};this.currentForm=t,this.currentNode=t,this.currentFormEnd=this.reader.offset+e}parseConnections(e){this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.currentForm=this.currentSurface.connections}parseEntryForm(e){this.reader.skip(8);var t=this.reader.getString();this.currentForm=this.currentNode.attributes,this.setupForm(t,e)}parseValueForm(){this.reader.skip(8);var e=this.reader.getString();"double"===e?this.currentForm.value=this.reader.getUint64():"int"===e?this.currentForm.value=this.reader.getUint32():"vparam"===e?(this.reader.skip(24),this.currentForm.value=this.reader.getFloat64()):"vparam3"===e&&(this.reader.skip(24),this.currentForm.value=this.reader.getFloat64Array(3))}parseImageStateForm(){this.reader.skip(8),this.currentForm.mipMapLevel=this.reader.getFloat32()}parseImageMap(e){this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.currentForm.maps||(this.currentForm.maps=[]);var t={};this.currentForm.maps.push(t),this.currentForm=t,this.reader.skip(10)}parseTextureNodeAttribute(e){switch(this.reader.skip(28),this.reader.skip(20),e){case"ISCL":this.currentNode.scale=this.reader.getFloat32Array(3);break;case"IPOS":this.currentNode.position=this.reader.getFloat32Array(3);break;case"IROT":this.currentNode.rotation=this.reader.getFloat32Array(3);break;case"IFAL":this.currentNode.falloff=this.reader.getFloat32Array(3);break;case"IBMP":this.currentNode.amplitude=this.reader.getFloat32();break;case"IUTD":this.currentNode.uTiles=this.reader.getFloat32();break;case"IVTD":this.currentNode.vTiles=this.reader.getFloat32()}this.reader.skip(2)}parseEnvelope(e){this.reader.skip(e-4)}parseClip(e){if("FORM"===this.reader.getIDTag())return this.reader.skip(16),void(this.currentNode.fileName=this.reader.getString());this.reader.setOffset(this.reader.offset-4),this.currentFormEnd=this.reader.offset+e,this.parentForm=this.currentForm,this.reader.skip(8);var t={index:this.reader.getUint32()};this.tree.textures.push(t),this.currentForm=t}parseClipLwo2(e){for(var t={index:this.reader.getUint32(),fileName:""};;){var n=this.reader.getIDTag(),r=this.reader.getUint16();if("STIL"===n){t.fileName=this.reader.getString();break}if(r>=e)break}this.tree.textures.push(t),this.currentForm=t}parseImage(){this.reader.skip(8),this.currentForm.fileName=this.reader.getString()}parseXVAL(e,t){var n=this.reader.offset+t-4;this.reader.skip(8),this.currentForm[e]=this.reader.getFloat32(),this.reader.setOffset(n)}parseXVAL3(e,t){var n=this.reader.offset+t-4;this.reader.skip(8),this.currentForm[e]={x:this.reader.getFloat32(),y:this.reader.getFloat32(),z:this.reader.getFloat32()},this.reader.setOffset(n)}parseObjectTag(){this.tree.objectTags||(this.tree.objectTags={}),this.tree.objectTags[this.reader.getIDTag()]={tagString:this.reader.getString()}}parseLayer(e){var t={number:this.reader.getUint16(),flags:this.reader.getUint16(),pivot:this.reader.getFloat32Array(3),name:this.reader.getString()};this.tree.layers.push(t),this.currentLayer=t;var n=16+o(this.currentLayer.name);this.currentLayer.parent=n<e?this.reader.getUint16():-1}parsePoints(e){this.currentPoints=[];for(var t=0;t<e/4;t+=3)this.currentPoints.push(this.reader.getFloat32(),this.reader.getFloat32(),-this.reader.getFloat32())}parseVertexMapping(e,t){var n=this.reader.offset+e,r=this.reader.getString();if(this.reader.offset!==n){this.reader.setOffset(this.reader.offset-o(r));var i=this.reader.getIDTag();this.reader.getUint16();var s=this.reader.getString(),a=e-6-o(s);switch(i){case"TXUV":this.parseUVMapping(s,n,t);break;case"MORF":case"SPOT":this.parseMorphTargets(s,n,i);break;case"APSL":case"NORM":case"WGHT":case"MNVW":case"PICK":case"RGB ":case"RGBA":this.reader.skip(a);break;default:console.warn("LWOLoader: unknown vertex map type: "+i),this.reader.skip(a)}}else this.currentForm.UVChannel=r}parseUVMapping(e,t,n){for(var r=[],i=[],s=[];this.reader.offset<t;)r.push(this.reader.getVariableLengthIndex()),n&&i.push(this.reader.getVariableLengthIndex()),s.push(this.reader.getFloat32(),this.reader.getFloat32());n?(this.currentLayer.discontinuousUVs||(this.currentLayer.discontinuousUVs={}),this.currentLayer.discontinuousUVs[e]={uvIndices:r,polyIndices:i,uvs:s}):(this.currentLayer.uvs||(this.currentLayer.uvs={}),this.currentLayer.uvs[e]={uvIndices:r,uvs:s})}parseMorphTargets(e,t,n){var r=[],i=[];for(n="MORF"===n?"relative":"absolute";this.reader.offset<t;)r.push(this.reader.getVariableLengthIndex()),i.push(this.reader.getFloat32(),this.reader.getFloat32(),-this.reader.getFloat32());this.currentLayer.morphTargets||(this.currentLayer.morphTargets={}),this.currentLayer.morphTargets[e]={indices:r,points:i,type:n}}parsePolygonList(e){for(var t=this.reader.offset+e,n=this.reader.getIDTag(),r=[],i=[];this.reader.offset<t;){var s=this.reader.getUint16();s&=1023,i.push(s);for(var a=0;a<s;a++)r.push(this.reader.getVariableLengthIndex())}var o={type:n,vertexIndices:r,polygonDimensions:i,points:this.currentPoints};1===i[0]?o.type="points":2===i[0]&&(o.type="lines"),this.currentLayer.geometry=o}parseTagStrings(e){this.tree.tags=this.reader.getStringArray(e)}parsePolygonTagMapping(e){var t=this.reader.offset+e;"SURF"===this.reader.getIDTag()?this.parseMaterialIndices(t):this.reader.skip(e-4)}parseMaterialIndices(e){for(this.currentLayer.geometry.materialIndices=[];this.reader.offset<e;){var t=this.reader.getVariableLengthIndex(),n=this.reader.getUint16();this.currentLayer.geometry.materialIndices.push(t,n)}}parseUnknownCHUNK(e,t){console.warn("LWOLoader: unknown chunk type: "+e+" length: "+t);var n=this.reader.getString(t);this.currentForm[e]=n}}},90153:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LWO2Parser=class{constructor(e){this.IFF=e}parseBlock(){this.IFF.debugger.offset=this.IFF.reader.offset,this.IFF.debugger.closeForms();const e=this.IFF.reader.getIDTag();let t=this.IFF.reader.getUint32();switch(t>this.IFF.reader.dv.byteLength-this.IFF.reader.offset&&(this.IFF.reader.offset-=4,t=this.IFF.reader.getUint16()),this.IFF.debugger.dataOffset=this.IFF.reader.offset,this.IFF.debugger.length=t,e){case"FORM":this.IFF.parseForm(t);break;case"ICON":case"VMPA":case"BBOX":case"NORM":case"PRE ":case"POST":case"KEY ":case"SPAN":case"TIME":case"CLRS":case"CLRA":case"FILT":case"DITH":case"CONT":case"BRIT":case"SATR":case"HUE ":case"GAMM":case"NEGA":case"IFLT":case"PFLT":case"PROJ":case"AXIS":case"AAST":case"PIXB":case"AUVO":case"STCK":case"PROC":case"VALU":case"FUNC":case"PNAM":case"INAM":case"GRST":case"GREN":case"GRPT":case"FKEY":case"IKEY":case"CSYS":case"OPAQ":case"CMAP":case"NLOC":case"NZOM":case"NVER":case"NSRV":case"NVSK":case"NCRD":case"WRPW":case"WRPH":case"NMOD":case"NSEL":case"NPRW":case"NPLA":case"NODS":case"VERS":case"ENUM":case"TAG ":case"OPAC":case"CGMD":case"CGTY":case"CGST":case"CGEN":case"CGTS":case"CGTE":case"OSMP":case"OMDE":case"OUTR":case"FLAG":case"TRNL":case"GLOW":case"GVAL":case"SHRP":case"RFOP":case"RSAN":case"TROP":case"RBLR":case"TBLR":case"CLRH":case"CLRF":case"ADTR":case"LINE":case"ALPH":case"VCOL":case"ENAB":case"TMAP":this.IFF.debugger.skipped=!0,this.IFF.reader.skip(t);break;case"SURF":this.IFF.parseSurfaceLwo2(t);break;case"CLIP":this.IFF.parseClipLwo2(t);break;case"IPIX":case"IMIP":case"IMOD":case"AMOD":case"IINV":case"INCR":case"IAXS":case"IFOT":case"ITIM":case"IWRL":case"IUTI":case"IINX":case"IINY":case"IINZ":case"IREF":4===t?this.IFF.currentNode[e]=this.IFF.reader.getInt32():this.IFF.reader.skip(t);break;case"OTAG":this.IFF.parseObjectTag();break;case"LAYR":this.IFF.parseLayer(t);break;case"PNTS":this.IFF.parsePoints(t);break;case"VMAP":this.IFF.parseVertexMapping(t);break;case"AUVU":case"AUVN":this.IFF.reader.skip(t-1),this.IFF.reader.getVariableLengthIndex();break;case"POLS":this.IFF.parsePolygonList(t);break;case"TAGS":this.IFF.parseTagStrings(t);break;case"PTAG":this.IFF.parsePolygonTagMapping(t);break;case"VMAD":this.IFF.parseVertexMapping(t,!0);break;case"DESC":this.IFF.currentForm.description=this.IFF.reader.getString();break;case"TEXT":case"CMNT":case"NCOM":this.IFF.currentForm.comment=this.IFF.reader.getString();break;case"NAME":this.IFF.currentForm.channelName=this.IFF.reader.getString();break;case"WRAP":this.IFF.currentForm.wrap={w:this.IFF.reader.getUint16(),h:this.IFF.reader.getUint16()};break;case"IMAG":const n=this.IFF.reader.getVariableLengthIndex();this.IFF.currentForm.imageIndex=n;break;case"OREF":this.IFF.currentForm.referenceObject=this.IFF.reader.getString();break;case"ROID":this.IFF.currentForm.referenceObjectID=this.IFF.reader.getUint32();break;case"SSHN":this.IFF.currentSurface.surfaceShaderName=this.IFF.reader.getString();break;case"AOVN":this.IFF.currentSurface.surfaceCustomAOVName=this.IFF.reader.getString();break;case"NSTA":this.IFF.currentForm.disabled=this.IFF.reader.getUint16();break;case"NRNM":this.IFF.currentForm.realName=this.IFF.reader.getString();break;case"NNME":this.IFF.currentForm.refName=this.IFF.reader.getString(),this.IFF.currentSurface.nodes[this.IFF.currentForm.refName]=this.IFF.currentForm;break;case"INME":this.IFF.currentForm.nodeName||(this.IFF.currentForm.nodeName=[]),this.IFF.currentForm.nodeName.push(this.IFF.reader.getString());break;case"IINN":this.IFF.currentForm.inputNodeName||(this.IFF.currentForm.inputNodeName=[]),this.IFF.currentForm.inputNodeName.push(this.IFF.reader.getString());break;case"IINM":this.IFF.currentForm.inputName||(this.IFF.currentForm.inputName=[]),this.IFF.currentForm.inputName.push(this.IFF.reader.getString());break;case"IONM":this.IFF.currentForm.inputOutputName||(this.IFF.currentForm.inputOutputName=[]),this.IFF.currentForm.inputOutputName.push(this.IFF.reader.getString());break;case"FNAM":this.IFF.currentForm.fileName=this.IFF.reader.getString();break;case"CHAN":4===t?this.IFF.currentForm.textureChannel=this.IFF.reader.getIDTag():this.IFF.reader.skip(t);break;case"SMAN":const r=this.IFF.reader.getFloat32();this.IFF.currentSurface.attributes.smooth=!(r<0);break;case"COLR":this.IFF.currentSurface.attributes.Color={value:this.IFF.reader.getFloat32Array(3)},this.IFF.reader.skip(2);break;case"LUMI":this.IFF.currentSurface.attributes.Luminosity={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"SPEC":this.IFF.currentSurface.attributes.Specular={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"DIFF":this.IFF.currentSurface.attributes.Diffuse={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"REFL":this.IFF.currentSurface.attributes.Reflection={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"GLOS":this.IFF.currentSurface.attributes.Glossiness={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"TRAN":this.IFF.currentSurface.attributes.opacity=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"BUMP":this.IFF.currentSurface.attributes.bumpStrength=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"SIDE":this.IFF.currentSurface.attributes.side=this.IFF.reader.getUint16();break;case"RIMG":this.IFF.currentSurface.attributes.reflectionMap=this.IFF.reader.getVariableLengthIndex();break;case"RIND":this.IFF.currentSurface.attributes.refractiveIndex=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"TIMG":this.IFF.currentSurface.attributes.refractionMap=this.IFF.reader.getVariableLengthIndex();break;case"IMAP":this.IFF.reader.skip(2);break;case"IUVI":this.IFF.currentNode.UVChannel=this.IFF.reader.getString(t);break;case"IUTL":this.IFF.currentNode.widthWrappingMode=this.IFF.reader.getUint32();break;case"IVTL":this.IFF.currentNode.heightWrappingMode=this.IFF.reader.getUint32();break;case"BLOK":break;default:this.IFF.parseUnknownCHUNK(e,t)}"FORM"!=e&&(this.IFF.debugger.node=1,this.IFF.debugger.nodeID=e,this.IFF.debugger.log()),this.IFF.reader.offset>=this.IFF.currentFormEnd&&(this.IFF.currentForm=this.IFF.parentForm)}}},30997:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.LWO3Parser=class{constructor(e){this.IFF=e}parseBlock(){this.IFF.debugger.offset=this.IFF.reader.offset,this.IFF.debugger.closeForms();const e=this.IFF.reader.getIDTag(),t=this.IFF.reader.getUint32();switch(this.IFF.debugger.dataOffset=this.IFF.reader.offset,this.IFF.debugger.length=t,e){case"FORM":this.IFF.parseForm(t);break;case"ICON":case"VMPA":case"BBOX":case"NORM":case"PRE ":case"POST":case"KEY ":case"SPAN":case"TIME":case"CLRS":case"CLRA":case"FILT":case"DITH":case"CONT":case"BRIT":case"SATR":case"HUE ":case"GAMM":case"NEGA":case"IFLT":case"PFLT":case"PROJ":case"AXIS":case"AAST":case"PIXB":case"STCK":case"VALU":case"PNAM":case"INAM":case"GRST":case"GREN":case"GRPT":case"FKEY":case"IKEY":case"CSYS":case"OPAQ":case"CMAP":case"NLOC":case"NZOM":case"NVER":case"NSRV":case"NCRD":case"NMOD":case"NSEL":case"NPRW":case"NPLA":case"VERS":case"ENUM":case"TAG ":case"CGMD":case"CGTY":case"CGST":case"CGEN":case"CGTS":case"CGTE":case"OSMP":case"OMDE":case"OUTR":case"FLAG":case"TRNL":case"SHRP":case"RFOP":case"RSAN":case"TROP":case"RBLR":case"TBLR":case"CLRH":case"CLRF":case"ADTR":case"GLOW":case"LINE":case"ALPH":case"VCOL":case"ENAB":this.IFF.debugger.skipped=!0,this.IFF.reader.skip(t);break;case"IPIX":case"IMIP":case"IMOD":case"AMOD":case"IINV":case"INCR":case"IAXS":case"IFOT":case"ITIM":case"IWRL":case"IUTI":case"IINX":case"IINY":case"IINZ":case"IREF":4===t?this.IFF.currentNode[e]=this.IFF.reader.getInt32():this.IFF.reader.skip(t);break;case"OTAG":this.IFF.parseObjectTag();break;case"LAYR":this.IFF.parseLayer(t);break;case"PNTS":this.IFF.parsePoints(t);break;case"VMAP":this.IFF.parseVertexMapping(t);break;case"POLS":this.IFF.parsePolygonList(t);break;case"TAGS":this.IFF.parseTagStrings(t);break;case"PTAG":this.IFF.parsePolygonTagMapping(t);break;case"VMAD":this.IFF.parseVertexMapping(t,!0);break;case"DESC":this.IFF.currentForm.description=this.IFF.reader.getString();break;case"TEXT":case"CMNT":case"NCOM":this.IFF.currentForm.comment=this.IFF.reader.getString();break;case"NAME":this.IFF.currentForm.channelName=this.IFF.reader.getString();break;case"WRAP":this.IFF.currentForm.wrap={w:this.IFF.reader.getUint16(),h:this.IFF.reader.getUint16()};break;case"IMAG":const n=this.IFF.reader.getVariableLengthIndex();this.IFF.currentForm.imageIndex=n;break;case"OREF":this.IFF.currentForm.referenceObject=this.IFF.reader.getString();break;case"ROID":this.IFF.currentForm.referenceObjectID=this.IFF.reader.getUint32();break;case"SSHN":this.IFF.currentSurface.surfaceShaderName=this.IFF.reader.getString();break;case"AOVN":this.IFF.currentSurface.surfaceCustomAOVName=this.IFF.reader.getString();break;case"NSTA":this.IFF.currentForm.disabled=this.IFF.reader.getUint16();break;case"NRNM":this.IFF.currentForm.realName=this.IFF.reader.getString();break;case"NNME":this.IFF.currentForm.refName=this.IFF.reader.getString(),this.IFF.currentSurface.nodes[this.IFF.currentForm.refName]=this.IFF.currentForm;break;case"INME":this.IFF.currentForm.nodeName||(this.IFF.currentForm.nodeName=[]),this.IFF.currentForm.nodeName.push(this.IFF.reader.getString());break;case"IINN":this.IFF.currentForm.inputNodeName||(this.IFF.currentForm.inputNodeName=[]),this.IFF.currentForm.inputNodeName.push(this.IFF.reader.getString());break;case"IINM":this.IFF.currentForm.inputName||(this.IFF.currentForm.inputName=[]),this.IFF.currentForm.inputName.push(this.IFF.reader.getString());break;case"IONM":this.IFF.currentForm.inputOutputName||(this.IFF.currentForm.inputOutputName=[]),this.IFF.currentForm.inputOutputName.push(this.IFF.reader.getString());break;case"FNAM":this.IFF.currentForm.fileName=this.IFF.reader.getString();break;case"CHAN":4===t?this.IFF.currentForm.textureChannel=this.IFF.reader.getIDTag():this.IFF.reader.skip(t);break;case"SMAN":const r=this.IFF.reader.getFloat32();this.IFF.currentSurface.attributes.smooth=!(r<0);break;case"COLR":this.IFF.currentSurface.attributes.Color={value:this.IFF.reader.getFloat32Array(3)},this.IFF.reader.skip(2);break;case"LUMI":this.IFF.currentSurface.attributes.Luminosity={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"SPEC":this.IFF.currentSurface.attributes.Specular={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"DIFF":this.IFF.currentSurface.attributes.Diffuse={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"REFL":this.IFF.currentSurface.attributes.Reflection={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"GLOS":this.IFF.currentSurface.attributes.Glossiness={value:this.IFF.reader.getFloat32()},this.IFF.reader.skip(2);break;case"TRAN":this.IFF.currentSurface.attributes.opacity=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"BUMP":this.IFF.currentSurface.attributes.bumpStrength=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"SIDE":this.IFF.currentSurface.attributes.side=this.IFF.reader.getUint16();break;case"RIMG":this.IFF.currentSurface.attributes.reflectionMap=this.IFF.reader.getVariableLengthIndex();break;case"RIND":this.IFF.currentSurface.attributes.refractiveIndex=this.IFF.reader.getFloat32(),this.IFF.reader.skip(2);break;case"TIMG":this.IFF.currentSurface.attributes.refractionMap=this.IFF.reader.getVariableLengthIndex();break;case"IMAP":this.IFF.currentSurface.attributes.imageMapIndex=this.IFF.reader.getUint32();break;case"IUVI":this.IFF.currentNode.UVChannel=this.IFF.reader.getString(t);break;case"IUTL":this.IFF.currentNode.widthWrappingMode=this.IFF.reader.getUint32();break;case"IVTL":this.IFF.currentNode.heightWrappingMode=this.IFF.reader.getUint32();break;default:this.IFF.parseUnknownCHUNK(e,t)}"FORM"!=e&&(this.IFF.debugger.node=1,this.IFF.debugger.nodeID=e,this.IFF.debugger.log()),this.IFF.reader.offset>=this.IFF.currentFormEnd&&(this.IFF.currentForm=this.IFF.parentForm)}}},84145:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Vector3,a=new r.Vector3;class o{constructor(e=new r.Vector3(0,0,0),t=new r.Vector3(0,1,0),n=1){this.start=e,this.end=t,this.radius=n}clone(){return new o(this.start.clone(),this.end.clone(),this.radius)}set(e,t,n){this.start.copy(e),this.end.copy(t),this.radius=n}copy(e){this.start.copy(e.start),this.end.copy(e.end),this.radius=e.radius}getCenter(e){return e.copy(this.end).add(this.start).multiplyScalar(.5)}translate(e){this.start.add(e),this.end.add(e)}checkAABBAxis(e,t,n,r,i,s,a,o,l){return(i-e<l||i-n<l)&&(e-s<l||n-s<l)&&(a-t<l||a-r<l)&&(t-o<l||r-o<l)}intersectsBox(e){return this.checkAABBAxis(this.start.x,this.start.y,this.end.x,this.end.y,e.min.x,e.max.x,e.min.y,e.max.y,this.radius)&&this.checkAABBAxis(this.start.x,this.start.z,this.end.x,this.end.z,e.min.x,e.max.x,e.min.z,e.max.z,this.radius)&&this.checkAABBAxis(this.start.y,this.start.z,this.end.y,this.end.z,e.min.y,e.max.y,e.min.z,e.max.z,this.radius)}lineLineMinimumPoints(e,t){const n=i.copy(e.end).sub(e.start),r=s.copy(t.end).sub(t.start),o=a.copy(t.start).sub(e.start),l=n.dot(r),c=n.dot(n),h=r.dot(r),u=r.dot(o),d=n.dot(o);let p,f;const m=c*h-l*l;if(Math.abs(m)<1e-10){const e=-u/h,t=(l-u)/h;Math.abs(e-.5)<Math.abs(t-.5)?(p=0,f=e):(p=1,f=t)}else p=(u*l+d*h)/m,f=(p*l-u)/h;f=Math.max(0,Math.min(1,f)),p=Math.max(0,Math.min(1,p));return[n.multiplyScalar(p).add(e.start),r.multiplyScalar(f).add(t.start)]}}t.Capsule=o},79888:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={};t.ColorConverter=class{static setHSV(e,t,n,i){return t=r.MathUtils.euclideanModulo(t,1),n=r.MathUtils.clamp(n,0,1),i=r.MathUtils.clamp(i,0,1),e.setHSL(t,n*i/((t=(2-n)*i)<1?t:2-t),.5*t)}static getHSV(e,t){return e.getHSL(i),i.s*=i.l<.5?i.l:1-i.l,t.h=i.h,t.s=2*i.s/(i.l+i.s),t.v=i.l+i.s,t}static setCMYK(e,t,n,r,i){const s=(1-t)*(1-i),a=(1-n)*(1-i),o=(1-r)*(1-i);return e.setRGB(s,a,o)}static getCMYK(e,t){const n=e.r,r=e.g,i=e.b,s=1-Math.max(n,r,i),a=(1-n-s)/(1-s),o=(1-r-s)/(1-s),l=(1-i-s)/(1-s);return t.c=a,t.m=o,t.y=l,t.k=s,t}}},90515:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Line3,a=new r.Plane,o=new r.Vector3,l=new r.Triangle;class c{constructor(){this.normal=new r.Vector3,this.midpoint=new r.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=0,this.edge=null}static create(e,t,n){const r=new c,i=new h(e,r),s=new h(t,r),a=new h(n,r);return i.next=a.prev=s,s.next=i.prev=a,a.next=s.prev=i,r.edge=i,r.compute()}getEdge(e){let t=this.edge;for(;e>0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),n=this.edge.next.head();return l.set(e.point,t.point,n.point),l.getNormal(this.normal),l.getMidpoint(this.midpoint),this.area=l.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class h{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return null!==t?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return null!==t?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class u{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class d{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,null===t.prev?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,null===t.next?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return null===this.head?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(null===this.head?this.head=e:this.tail.next=e,e.prev=this.tail;null!==e.next;)e=e.next;return this.tail=e,this}remove(e){return null===e.prev?this.head=e.next:e.prev.next=e.next,null===e.next?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return null===e.prev?this.head=t.next:e.prev.next=t.next,null===t.next?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return null===this.head}}t.ConvexHull=class{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new d,this.unassigned=new d,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.vertices.push(new u(e[t]));this.compute()}return this}setFromObject(e){const t=[];return e.updateMatrixWorld(!0),e.traverse((function(e){const n=e.geometry;if(void 0!==n){const i=n.attributes.position;if(void 0!==i)for(let n=0,s=i.count;n<s;n++){const s=new r.Vector3;s.fromBufferAttribute(i,n).applyMatrix4(e.matrixWorld),t.push(s)}}})),this.setFromPoints(t)}containsPoint(e){const t=this.faces;for(let n=0,r=t.length;n<r;n++){if(t[n].distanceToPoint(e)>this.tolerance)return!1}return!0}intersectRay(e,t){const n=this.faces;let r=-1/0,i=1/0;for(let s=0,a=n.length;s<a;s++){const t=n[s],a=t.distanceToPoint(e.origin),o=t.normal.dot(e.direction);if(a>0&&o>=0)return null;const l=0!==o?-a/o:0;if(!(l<=0)&&(o>0?i=Math.min(l,i):r=Math.max(l,r),r>i))return null}return r!==-1/0?e.at(r,t):e.at(i,t),t}intersectsRay(e){return null!==this.intersectRay(e,i)}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,null===t.outside?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(null!==e.next&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(null!==e.outside){const t=e.outside;let n=e.outside;for(;null!==n.next&&n.next.face===e;)n=n.next;return this.assigned.removeSubList(t,n),t.prev=n.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const n=this.removeAllVerticesFromFace(e);if(void 0!==n)if(void 0===t)this.unassigned.appendChain(n);else{let e=n;do{const n=e.next;t.distanceToPoint(e.point)>this.tolerance?this.addVertexToFace(e,t):this.unassigned.append(e),e=n}while(null!==e)}return this}resolveUnassignedPoints(e){if(!1===this.unassigned.isEmpty()){let t=this.unassigned.first();do{const n=t.next;let r=this.tolerance,i=null;for(let s=0;s<e.length;s++){const n=e[s];if(0===n.mark){const e=n.distanceToPoint(t.point);if(e>r&&(r=e,i=n),r>1e3*this.tolerance)break}}null!==i&&this.addVertexToFace(t,i),t=n}while(null!==t)}return this}computeExtremes(){const e=new r.Vector3,t=new r.Vector3,n=[],i=[];for(let r=0;r<3;r++)n[r]=i[r]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let r=0,s=this.vertices.length;r<s;r++){const s=this.vertices[r],a=s.point;for(let t=0;t<3;t++)a.getComponent(t)<e.getComponent(t)&&(e.setComponent(t,a.getComponent(t)),n[t]=s);for(let e=0;e<3;e++)a.getComponent(e)>t.getComponent(e)&&(t.setComponent(e,a.getComponent(e)),i[e]=s)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:n,max:i}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),n=t.min,r=t.max;let i=0,l=0;for(let s=0;s<3;s++){const e=r[s].point.getComponent(s)-n[s].point.getComponent(s);e>i&&(i=e,l=s)}const h=n[l],u=r[l];let d,p;i=0,s.set(h.point,u.point);for(let a=0,c=this.vertices.length;a<c;a++){const t=e[a];if(t!==h&&t!==u){s.closestPointToPoint(t.point,!0,o);const e=o.distanceToSquared(t.point);e>i&&(i=e,d=t)}}i=-1,a.setFromCoplanarPoints(h.point,u.point,d.point);for(let s=0,o=this.vertices.length;s<o;s++){const t=e[s];if(t!==h&&t!==u&&t!==d){const e=Math.abs(a.distanceToPoint(t.point));e>i&&(i=e,p=t)}}const f=[];if(a.distanceToPoint(p.point)<0){f.push(c.create(h,u,d),c.create(p,u,h),c.create(p,d,u),c.create(p,h,d));for(let e=0;e<3;e++){const t=(e+1)%3;f[e+1].getEdge(2).setTwin(f[0].getEdge(t)),f[e+1].getEdge(1).setTwin(f[t+1].getEdge(0))}}else{f.push(c.create(h,d,u),c.create(p,h,u),c.create(p,u,d),c.create(p,d,h));for(let e=0;e<3;e++){const t=(e+1)%3;f[e+1].getEdge(2).setTwin(f[0].getEdge((3-e)%3)),f[e+1].getEdge(0).setTwin(f[t+1].getEdge(1))}}for(let s=0;s<4;s++)this.faces.push(f[s]);for(let s=0,a=e.length;s<a;s++){const t=e[s];if(t!==h&&t!==u&&t!==d&&t!==p){i=this.tolerance;let e=null;for(let n=0;n<4;n++){const r=this.faces[n].distanceToPoint(t.point);r>i&&(i=r,e=this.faces[n])}null!==e&&this.addVertexToFace(t,e)}}return this}reindexFaces(){const e=[];for(let t=0;t<this.faces.length;t++){const n=this.faces[t];0===n.mark&&e.push(n)}return this.faces=e,this}nextVertexToAdd(){if(!1===this.assigned.isEmpty()){let e,t=0;const n=this.assigned.first().face;let r=n.outside;do{const i=n.distanceToPoint(r.point);i>t&&(t=i,e=r),r=r.next}while(null!==r&&r.face===n);return e}}computeHorizon(e,t,n,r){let i;this.deleteFaceVertices(n),n.mark=1,i=null===t?t=n.getEdge(0):t.next;do{const t=i.twin,n=t.face;0===n.mark&&(n.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,t,n,r):r.push(i)),i=i.next}while(i!==t);return this}addAdjoiningFace(e,t){const n=c.create(e,t.tail(),t.head());return this.faces.push(n),n.getEdge(-1).setTwin(t.twin),n.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let n=null,r=null;for(let i=0;i<t.length;i++){const s=t[i],a=this.addAdjoiningFace(e,s);null===n?n=a:a.next.setTwin(r),this.newFaces.push(a.face),r=a}return n.next.setTwin(r),this}addVertexToHull(e){const t=[];return this.unassigned.clear(),this.removeVertexFromFace(e,e.face),this.computeHorizon(e.point,null,e.face,t),this.addNewFaces(e,t),this.resolveUnassignedPoints(this.newFaces),this}cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}compute(){let e;for(this.computeInitialHull();void 0!==(e=this.nextVertexToAdd());)this.addVertexToHull(e);return this.reindexFaces(),this.cleanup(),this}},t.Face=c,t.HalfEdge=h,t.VertexList=d,t.VertexNode=u},57829:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=function(){const e=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)e[256+t]=e[t];return e}();function r(e){return e*e*e*(e*(6*e-15)+10)}function i(e,t,n){return t+e*(n-t)}function s(e,t,n,r){const i=15&e,s=i<8?t:n,a=i<4?n:12==i||14==i?t:r;return(0==(1&i)?s:-s)+(0==(2&i)?a:-a)}t.ImprovedNoise=class{noise(e,t,a){const o=Math.floor(e),l=Math.floor(t),c=Math.floor(a),h=255&o,u=255&l,d=255&c,p=(e-=o)-1,f=(t-=l)-1,m=(a-=c)-1,g=r(e),A=r(t),v=r(a),y=n[h]+u,x=n[y]+d,b=n[y+1]+d,E=n[h+1]+u,_=n[E]+d,S=n[E+1]+d;return i(v,i(A,i(g,s(n[x],e,t,a),s(n[_],p,t,a)),i(g,s(n[b],e,f,a),s(n[S],p,f,a))),i(A,i(g,s(n[x+1],e,t,m),s(n[_+1],p,t,m)),i(g,s(n[b+1],e,f,m),s(n[S+1],p,f,m))))}}},83828:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);const i={rainbow:[[0,255],[.2,65535],[.5,65280],[.8,16776960],[1,16711680]],cooltowarm:[[0,3952322],[.2,10206463],[.5,14474460],[.8,16163717],[1,11797542]],blackbody:[[0,0],[.2,7864320],[.5,15086080],[.8,16776960],[1,16777215]],grayscale:[[0,0],[.2,4210752],[.5,8355712],[.8,12566463],[1,16777215]]};t.ColorMapKeywords=i,t.Lut=class{constructor(e,t=32){this.isLut=!0,this.lut=[],this.map=[],this.n=0,this.minV=0,this.maxV=1,this.setColorMap(e,t)}set(e){return!0===e.isLut&&this.copy(e),this}setMin(e){return this.minV=e,this}setMax(e){return this.maxV=e,this}setColorMap(e,t=32){this.map=i[e]||i.rainbow,this.n=t;const n=1/this.n,s=new r.Color,a=new r.Color;this.lut.length=0,this.lut.push(new r.Color(this.map[0][1]));for(let i=1;i<t;i++){const e=i*n;for(let t=0;t<this.map.length-1;t++)if(e>this.map[t][0]&&e<=this.map[t+1][0]){const n=this.map[t][0],i=this.map[t+1][0];s.setHex(this.map[t][1],"linear-srgb"),a.setHex(this.map[t+1][1],"linear-srgb");const o=(new r.Color).lerpColors(s,a,(e-n)/(i-n));this.lut.push(o)}}return this.lut.push(new r.Color(this.map[this.map.length-1][1])),this}copy(e){return this.lut=e.lut,this.map=e.map,this.n=e.n,this.minV=e.minV,this.maxV=e.maxV,this}getColor(e){e=((e=r.MathUtils.clamp(e,this.minV,this.maxV))-this.minV)/(this.maxV-this.minV);const t=Math.round(e*this.n);return this.lut[t]}addColorMap(e,t){return i[e]=t,this}createCanvas(){const e=document.createElement("canvas");return e.width=1,e.height=this.n,this.updateCanvas(e),e}updateCanvas(e){const t=e.getContext("2d",{alpha:!1}),n=t.getImageData(0,0,1,this.n),i=n.data;let s=0;const a=1/this.n,o=new r.Color,l=new r.Color,c=new r.Color;for(let r=1;r>=0;r-=a)for(let e=this.map.length-1;e>=0;e--)if(r<this.map[e][0]&&r>=this.map[e-1][0]){const t=this.map[e-1][0],n=this.map[e][0];o.setHex(this.map[e-1][1],"linear-srgb"),l.setHex(this.map[e][1],"linear-srgb"),c.lerpColors(o,l,(r-t)/(n-t)),i[4*s]=Math.round(255*c.r),i[4*s+1]=Math.round(255*c.g),i[4*s+2]=Math.round(255*c.b),i[4*s+3]=255,s+=1}return t.putImageData(n,0,0),e}}},17570:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Triangle,s=new r.Vector3;t.MeshSurfaceSampler=class{constructor(e){let t=e.geometry;t.index&&(console.warn("THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry."),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.colorAttribute=this.geometry.getAttribute("color"),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){const e=this.positionAttribute,t=this.weightAttribute,n=new Float32Array(e.count/3);for(let s=0;s<e.count;s+=3){let r=1;t&&(r=t.getX(s)+t.getX(s+1)+t.getX(s+2)),i.a.fromBufferAttribute(e,s),i.b.fromBufferAttribute(e,s+1),i.c.fromBufferAttribute(e,s+2),r*=i.getArea(),n[s/3]=r}this.distribution=new Float32Array(e.count/3);let r=0;for(let i=0;i<n.length;i++)r+=n[i],this.distribution[i]=r;return this}setRandomGenerator(e){return this.randomFunction=e,this}sample(e,t,n){const r=this.sampleFaceIndex();return this.sampleFace(r,e,t,n)}sampleFaceIndex(){const e=this.distribution[this.distribution.length-1];return this.binarySearch(this.randomFunction()*e)}binarySearch(e){const t=this.distribution;let n=0,r=t.length-1,i=-1;for(;n<=r;){const s=Math.ceil((n+r)/2);if(0===s||t[s-1]<=e&&t[s]>e){i=s;break}e<t[s]?r=s-1:n=s+1}return i}sampleFace(e,t,n,r){let a=this.randomFunction(),o=this.randomFunction();return a+o>1&&(a=1-a,o=1-o),i.a.fromBufferAttribute(this.positionAttribute,3*e),i.b.fromBufferAttribute(this.positionAttribute,3*e+1),i.c.fromBufferAttribute(this.positionAttribute,3*e+2),t.set(0,0,0).addScaledVector(i.a,a).addScaledVector(i.b,o).addScaledVector(i.c,1-(a+o)),void 0!==n&&i.getNormal(n),void 0!==r&&void 0!==this.colorAttribute&&(i.a.fromBufferAttribute(this.colorAttribute,3*e),i.b.fromBufferAttribute(this.colorAttribute,3*e+1),i.c.fromBufferAttribute(this.colorAttribute,3*e+2),s.set(0,0,0).addScaledVector(i.a,a).addScaledVector(i.b,o).addScaledVector(i.c,1-(a+o)),r.r=s.x,r.g=s.y,r.b=s.z),this}}},17458:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={c:null,u:[new r.Vector3,new r.Vector3,new r.Vector3],e:[]},s={c:null,u:[new r.Vector3,new r.Vector3,new r.Vector3],e:[]},a=[[],[],[]],o=[[],[],[]],l=[],c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Vector3,p=new r.Vector3,f=new r.Vector3,m=new r.Matrix3,g=new r.Box3,A=new r.Matrix4,v=new r.Matrix4,y=new r.Ray;class x{constructor(e=new r.Vector3,t=new r.Vector3,n=new r.Matrix3){this.center=e,this.halfSize=t,this.rotation=n}set(e,t,n){return this.center=e,this.halfSize=t,this.rotation=n,this}copy(e){return this.center.copy(e.center),this.halfSize.copy(e.halfSize),this.rotation.copy(e.rotation),this}clone(){return(new this.constructor).copy(this)}getSize(e){return e.copy(this.halfSize).multiplyScalar(2)}clampPoint(e,t){const n=this.halfSize;d.subVectors(e,this.center),this.rotation.extractBasis(c,h,u),t.copy(this.center);const i=r.MathUtils.clamp(d.dot(c),-n.x,n.x);t.add(c.multiplyScalar(i));const s=r.MathUtils.clamp(d.dot(h),-n.y,n.y);t.add(h.multiplyScalar(s));const a=r.MathUtils.clamp(d.dot(u),-n.z,n.z);return t.add(u.multiplyScalar(a)),t}containsPoint(e){return d.subVectors(e,this.center),this.rotation.extractBasis(c,h,u),Math.abs(d.dot(c))<=this.halfSize.x&&Math.abs(d.dot(h))<=this.halfSize.y&&Math.abs(d.dot(u))<=this.halfSize.z}intersectsBox3(e){return this.intersectsOBB(b.fromBox3(e))}intersectsSphere(e){return this.clampPoint(e.center,f),f.distanceToSquared(e.center)<=e.radius*e.radius}intersectsOBB(e,t=Number.EPSILON){i.c=this.center,i.e[0]=this.halfSize.x,i.e[1]=this.halfSize.y,i.e[2]=this.halfSize.z,this.rotation.extractBasis(i.u[0],i.u[1],i.u[2]),s.c=e.center,s.e[0]=e.halfSize.x,s.e[1]=e.halfSize.y,s.e[2]=e.halfSize.z,e.rotation.extractBasis(s.u[0],s.u[1],s.u[2]);for(let o=0;o<3;o++)for(let e=0;e<3;e++)a[o][e]=i.u[o].dot(s.u[e]);d.subVectors(s.c,i.c),l[0]=d.dot(i.u[0]),l[1]=d.dot(i.u[1]),l[2]=d.dot(i.u[2]);for(let i=0;i<3;i++)for(let e=0;e<3;e++)o[i][e]=Math.abs(a[i][e])+t;let n,r;for(let a=0;a<3;a++)if(n=i.e[a],r=s.e[0]*o[a][0]+s.e[1]*o[a][1]+s.e[2]*o[a][2],Math.abs(l[a])>n+r)return!1;for(let c=0;c<3;c++)if(n=i.e[0]*o[0][c]+i.e[1]*o[1][c]+i.e[2]*o[2][c],r=s.e[c],Math.abs(l[0]*a[0][c]+l[1]*a[1][c]+l[2]*a[2][c])>n+r)return!1;return n=i.e[1]*o[2][0]+i.e[2]*o[1][0],r=s.e[1]*o[0][2]+s.e[2]*o[0][1],!(Math.abs(l[2]*a[1][0]-l[1]*a[2][0])>n+r)&&(n=i.e[1]*o[2][1]+i.e[2]*o[1][1],r=s.e[0]*o[0][2]+s.e[2]*o[0][0],!(Math.abs(l[2]*a[1][1]-l[1]*a[2][1])>n+r)&&(n=i.e[1]*o[2][2]+i.e[2]*o[1][2],r=s.e[0]*o[0][1]+s.e[1]*o[0][0],!(Math.abs(l[2]*a[1][2]-l[1]*a[2][2])>n+r)&&(n=i.e[0]*o[2][0]+i.e[2]*o[0][0],r=s.e[1]*o[1][2]+s.e[2]*o[1][1],!(Math.abs(l[0]*a[2][0]-l[2]*a[0][0])>n+r)&&(n=i.e[0]*o[2][1]+i.e[2]*o[0][1],r=s.e[0]*o[1][2]+s.e[2]*o[1][0],!(Math.abs(l[0]*a[2][1]-l[2]*a[0][1])>n+r)&&(n=i.e[0]*o[2][2]+i.e[2]*o[0][2],r=s.e[0]*o[1][1]+s.e[1]*o[1][0],!(Math.abs(l[0]*a[2][2]-l[2]*a[0][2])>n+r)&&(n=i.e[0]*o[1][0]+i.e[1]*o[0][0],r=s.e[1]*o[2][2]+s.e[2]*o[2][1],!(Math.abs(l[1]*a[0][0]-l[0]*a[1][0])>n+r)&&(n=i.e[0]*o[1][1]+i.e[1]*o[0][1],r=s.e[0]*o[2][2]+s.e[2]*o[2][0],!(Math.abs(l[1]*a[0][1]-l[0]*a[1][1])>n+r)&&(n=i.e[0]*o[1][2]+i.e[1]*o[0][2],r=s.e[0]*o[2][1]+s.e[1]*o[2][0],!(Math.abs(l[1]*a[0][2]-l[0]*a[1][2])>n+r)))))))))}intersectsPlane(e){this.rotation.extractBasis(c,h,u);const t=this.halfSize.x*Math.abs(e.normal.dot(c))+this.halfSize.y*Math.abs(e.normal.dot(h))+this.halfSize.z*Math.abs(e.normal.dot(u)),n=e.normal.dot(this.center)-e.constant;return Math.abs(n)<=t}intersectRay(e,t){return this.getSize(p),g.setFromCenterAndSize(d.set(0,0,0),p),A.setFromMatrix3(this.rotation),A.setPosition(this.center),v.copy(A).invert(),y.copy(e).applyMatrix4(v),y.intersectBox(g,t)?t.applyMatrix4(A):null}intersectsRay(e){return null!==this.intersectRay(e,d)}fromBox3(e){return e.getCenter(this.center),e.getSize(this.halfSize).multiplyScalar(.5),this.rotation.identity(),this}equals(e){return e.center.equals(this.center)&&e.halfSize.equals(this.halfSize)&&e.rotation.equals(this.rotation)}applyMatrix4(e){const t=e.elements;let n=d.set(t[0],t[1],t[2]).length();const r=d.set(t[4],t[5],t[6]).length(),i=d.set(t[8],t[9],t[10]).length();e.determinant()<0&&(n=-n),m.setFromMatrix4(e);const s=1/n,a=1/r,o=1/i;return m.elements[0]*=s,m.elements[1]*=s,m.elements[2]*=s,m.elements[3]*=a,m.elements[4]*=a,m.elements[5]*=a,m.elements[6]*=o,m.elements[7]*=o,m.elements[8]*=o,this.rotation.multiply(m),this.halfSize.x*=n,this.halfSize.y*=r,this.halfSize.z*=i,d.setFromMatrixPosition(e),this.center.add(d),this}}const b=new x;t.OBB=x},30252:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(84145),s=new r.Vector3,a=new r.Vector3,o=new r.Plane,l=new r.Line3,c=new r.Line3,h=new r.Sphere,u=new i.Capsule;class d{constructor(e){this.triangles=[],this.box=e,this.subTrees=[]}addTriangle(e){return this.bounds||(this.bounds=new r.Box3),this.bounds.min.x=Math.min(this.bounds.min.x,e.a.x,e.b.x,e.c.x),this.bounds.min.y=Math.min(this.bounds.min.y,e.a.y,e.b.y,e.c.y),this.bounds.min.z=Math.min(this.bounds.min.z,e.a.z,e.b.z,e.c.z),this.bounds.max.x=Math.max(this.bounds.max.x,e.a.x,e.b.x,e.c.x),this.bounds.max.y=Math.max(this.bounds.max.y,e.a.y,e.b.y,e.c.y),this.bounds.max.z=Math.max(this.bounds.max.z,e.a.z,e.b.z,e.c.z),this.triangles.push(e),this}calcBox(){return this.box=this.bounds.clone(),this.box.min.x-=.01,this.box.min.y-=.01,this.box.min.z-=.01,this}split(e){if(!this.box)return;const t=[],n=a.copy(this.box.max).sub(this.box.min).multiplyScalar(.5);for(let a=0;a<2;a++)for(let e=0;e<2;e++)for(let i=0;i<2;i++){const o=new r.Box3,l=s.set(a,e,i);o.min.copy(this.box.min).add(l.multiply(n)),o.max.copy(o.min).add(n),t.push(new d(o))}let i;for(;i=this.triangles.pop();)for(let e=0;e<t.length;e++)t[e].box.intersectsTriangle(i)&&t[e].triangles.push(i);for(let r=0;r<t.length;r++){const n=t[r].triangles.length;n>8&&e<16&&t[r].split(e+1),0!==n&&this.subTrees.push(t[r])}return this}build(){return this.calcBox(),this.split(0),this}getRayTriangles(e,t){for(let n=0;n<this.subTrees.length;n++){const r=this.subTrees[n];if(e.intersectsBox(r.box))if(r.triangles.length>0)for(let e=0;e<r.triangles.length;e++)-1===t.indexOf(r.triangles[e])&&t.push(r.triangles[e]);else r.getRayTriangles(e,t)}return t}triangleCapsuleIntersect(e,t){t.getPlane(o);const n=o.distanceToPoint(e.start)-e.radius,r=o.distanceToPoint(e.end)-e.radius;if(n>0&&r>0||n<-e.radius&&r<-e.radius)return!1;const i=Math.abs(n/(Math.abs(n)+Math.abs(r))),a=s.copy(e.start).lerp(e.end,i);if(t.containsPoint(a))return{normal:o.normal.clone(),point:a.clone(),depth:Math.abs(Math.min(n,r))};const h=e.radius*e.radius,u=l.set(e.start,e.end),d=[[t.a,t.b],[t.b,t.c],[t.c,t.a]];for(let s=0;s<d.length;s++){const t=c.set(d[s][0],d[s][1]),[n,r]=e.lineLineMinimumPoints(u,t);if(n.distanceToSquared(r)<h)return{normal:n.clone().sub(r).normalize(),point:r.clone(),depth:e.radius-n.distanceTo(r)}}return!1}triangleSphereIntersect(e,t){if(t.getPlane(o),!e.intersectsPlane(o))return!1;const n=Math.abs(o.distanceToSphere(e)),r=e.radius*e.radius-n*n,i=o.projectPoint(e.center,s);if(t.containsPoint(e.center))return{normal:o.normal.clone(),point:i.clone(),depth:Math.abs(o.distanceToSphere(e))};const c=[[t.a,t.b],[t.b,t.c],[t.c,t.a]];for(let s=0;s<c.length;s++){l.set(c[s][0],c[s][1]),l.closestPointToPoint(i,!0,a);const t=a.distanceToSquared(e.center);if(t<r)return{normal:e.center.clone().sub(a).normalize(),point:a.clone(),depth:e.radius-Math.sqrt(t)}}return!1}getSphereTriangles(e,t){for(let n=0;n<this.subTrees.length;n++){const r=this.subTrees[n];if(e.intersectsBox(r.box))if(r.triangles.length>0)for(let e=0;e<r.triangles.length;e++)-1===t.indexOf(r.triangles[e])&&t.push(r.triangles[e]);else r.getSphereTriangles(e,t)}}getCapsuleTriangles(e,t){for(let n=0;n<this.subTrees.length;n++){const r=this.subTrees[n];if(e.intersectsBox(r.box))if(r.triangles.length>0)for(let e=0;e<r.triangles.length;e++)-1===t.indexOf(r.triangles[e])&&t.push(r.triangles[e]);else r.getCapsuleTriangles(e,t)}}sphereIntersect(e){h.copy(e);const t=[];let n,r=!1;this.getSphereTriangles(e,t);for(let i=0;i<t.length;i++)(n=this.triangleSphereIntersect(h,t[i]))&&(r=!0,h.center.add(n.normal.multiplyScalar(n.depth)));if(r){const t=h.center.clone().sub(e.center),n=t.length();return{normal:t.normalize(),depth:n}}return!1}capsuleIntersect(e){u.copy(e);const t=[];let n,i=!1;this.getCapsuleTriangles(u,t);for(let r=0;r<t.length;r++)(n=this.triangleCapsuleIntersect(u,t[r]))&&(i=!0,u.translate(n.normal.multiplyScalar(n.depth)));if(i){const t=u.getCenter(new r.Vector3).sub(e.getCenter(s)),n=t.length();return{normal:t.normalize(),depth:n}}return!1}rayIntersect(e){if(0===e.direction.length())return;const t=[];let n,r,i=1e100;this.getRayTriangles(e,t);for(let a=0;a<t.length;a++){const o=e.intersectTriangle(t[a].a,t[a].b,t[a].c,!0,s);if(o){const s=o.sub(e.origin).length();i>s&&(r=o.clone().add(e.origin),i=s,n=t[a])}}return i<1e100&&{distance:i,triangle:n,position:r}}fromGraphNode(e){return e.updateWorldMatrix(!0,!0),e.traverse((e=>{if(!0===e.isMesh){let t,n=!1;null!==e.geometry.index?(n=!0,t=e.geometry.toNonIndexed()):t=e.geometry;const i=t.getAttribute("position");for(let s=0;s<i.count;s+=3){const t=(new r.Vector3).fromBufferAttribute(i,s),n=(new r.Vector3).fromBufferAttribute(i,s+1),a=(new r.Vector3).fromBufferAttribute(i,s+2);t.applyMatrix4(e.matrixWorld),n.applyMatrix4(e.matrixWorld),a.applyMatrix4(e.matrixWorld),this.addTriangle(new r.Triangle(t,n,a))}n&&t.dispose()}})),this.build(),this}}t.Octree=d},84181:(e,t)=>{"use strict";var n=Object.defineProperty,r=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.SimplexNoise=class{constructor(e=Math){r(this,"grad3",[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]),r(this,"grad4",[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]]),r(this,"p",[]),r(this,"perm",[]),r(this,"simplex",[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]),r(this,"dot",((e,t,n)=>e[0]*t+e[1]*n)),r(this,"dot3",((e,t,n,r)=>e[0]*t+e[1]*n+e[2]*r)),r(this,"dot4",((e,t,n,r,i)=>e[0]*t+e[1]*n+e[2]*r+e[3]*i)),r(this,"noise",((e,t)=>{let n,r,i;const s=(e+t)*(.5*(Math.sqrt(3)-1)),a=Math.floor(e+s),o=Math.floor(t+s),l=(3-Math.sqrt(3))/6,c=(a+o)*l,h=e-(a-c),u=t-(o-c);let d=0,p=1;h>u&&(d=1,p=0);const f=h-d+l,m=u-p+l,g=h-1+2*l,A=u-1+2*l,v=255&a,y=255&o,x=this.perm[v+this.perm[y]]%12,b=this.perm[v+d+this.perm[y+p]]%12,E=this.perm[v+1+this.perm[y+1]]%12;let _=.5-h*h-u*u;_<0?n=0:(_*=_,n=_*_*this.dot(this.grad3[x],h,u));let S=.5-f*f-m*m;S<0?r=0:(S*=S,r=S*S*this.dot(this.grad3[b],f,m));let w=.5-g*g-A*A;return w<0?i=0:(w*=w,i=w*w*this.dot(this.grad3[E],g,A)),70*(n+r+i)})),r(this,"noise3d",((e,t,n)=>{let r,i,s,a;const o=(e+t+n)*(1/3),l=Math.floor(e+o),c=Math.floor(t+o),h=Math.floor(n+o),u=1/6,d=(l+c+h)*u,p=e-(l-d),f=t-(c-d),m=n-(h-d);let g,A,v,y,x,b;p>=f?f>=m?(g=1,A=0,v=0,y=1,x=1,b=0):p>=m?(g=1,A=0,v=0,y=1,x=0,b=1):(g=0,A=0,v=1,y=1,x=0,b=1):f<m?(g=0,A=0,v=1,y=0,x=1,b=1):p<m?(g=0,A=1,v=0,y=0,x=1,b=1):(g=0,A=1,v=0,y=1,x=1,b=0);const E=p-g+u,_=f-A+u,S=m-v+u,w=p-y+2*u,M=f-x+2*u,C=m-b+2*u,T=p-1+.5,I=f-1+.5,B=m-1+.5,R=255&l,P=255&c,D=255&h,L=this.perm[R+this.perm[P+this.perm[D]]]%12,F=this.perm[R+g+this.perm[P+A+this.perm[D+v]]]%12,U=this.perm[R+y+this.perm[P+x+this.perm[D+b]]]%12,O=this.perm[R+1+this.perm[P+1+this.perm[D+1]]]%12;let N=.6-p*p-f*f-m*m;N<0?r=0:(N*=N,r=N*N*this.dot3(this.grad3[L],p,f,m));let k=.6-E*E-_*_-S*S;k<0?i=0:(k*=k,i=k*k*this.dot3(this.grad3[F],E,_,S));let G=.6-w*w-M*M-C*C;G<0?s=0:(G*=G,s=G*G*this.dot3(this.grad3[U],w,M,C));let z=.6-T*T-I*I-B*B;return z<0?a=0:(z*=z,a=z*z*this.dot3(this.grad3[O],T,I,B)),32*(r+i+s+a)})),r(this,"noise4d",((e,t,n,r)=>{const i=this.grad4,s=this.simplex,a=this.perm,o=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20;let c,h,u,d,p;const f=(e+t+n+r)*o,m=Math.floor(e+f),g=Math.floor(t+f),A=Math.floor(n+f),v=Math.floor(r+f),y=(m+g+A+v)*l,x=e-(m-y),b=t-(g-y),E=n-(A-y),_=r-(v-y),S=(x>b?32:0)+(x>E?16:0)+(b>E?8:0)+(x>_?4:0)+(b>_?2:0)+(E>_?1:0);let w,M,C,T,I,B,R,P,D,L,F,U;w=s[S][0]>=3?1:0,M=s[S][1]>=3?1:0,C=s[S][2]>=3?1:0,T=s[S][3]>=3?1:0,I=s[S][0]>=2?1:0,B=s[S][1]>=2?1:0,R=s[S][2]>=2?1:0,P=s[S][3]>=2?1:0,D=s[S][0]>=1?1:0,L=s[S][1]>=1?1:0,F=s[S][2]>=1?1:0,U=s[S][3]>=1?1:0;const O=x-w+l,N=b-M+l,k=E-C+l,G=_-T+l,z=x-I+2*l,Q=b-B+2*l,V=E-R+2*l,H=_-P+2*l,j=x-D+3*l,W=b-L+3*l,X=E-F+3*l,Y=_-U+3*l,q=x-1+4*l,K=b-1+4*l,J=E-1+4*l,Z=_-1+4*l,$=255&m,ee=255&g,te=255&A,ne=255&v,re=a[$+a[ee+a[te+a[ne]]]]%32,ie=a[$+w+a[ee+M+a[te+C+a[ne+T]]]]%32,se=a[$+I+a[ee+B+a[te+R+a[ne+P]]]]%32,ae=a[$+D+a[ee+L+a[te+F+a[ne+U]]]]%32,oe=a[$+1+a[ee+1+a[te+1+a[ne+1]]]]%32;let le=.6-x*x-b*b-E*E-_*_;le<0?c=0:(le*=le,c=le*le*this.dot4(i[re],x,b,E,_));let ce=.6-O*O-N*N-k*k-G*G;ce<0?h=0:(ce*=ce,h=ce*ce*this.dot4(i[ie],O,N,k,G));let he=.6-z*z-Q*Q-V*V-H*H;he<0?u=0:(he*=he,u=he*he*this.dot4(i[se],z,Q,V,H));let ue=.6-j*j-W*W-X*X-Y*Y;ue<0?d=0:(ue*=ue,d=ue*ue*this.dot4(i[ae],j,W,X,Y));let de=.6-q*q-K*K-J*J-Z*Z;return de<0?p=0:(de*=de,p=de*de*this.dot4(i[oe],q,K,J,Z)),27*(c+h+u+d+p)}));for(let t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());for(let t=0;t<512;t++)this.perm[t]=this.p[255&t]}}},30864:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(92018),s=new r.Vector3;class a{constructor(e=1.4,t=1e-4){this.minSizeForBreak=e,this.smallDelta=t,this.tempLine1=new r.Line3,this.tempPlane1=new r.Plane,this.tempPlane2=new r.Plane,this.tempPlane_Cut=new r.Plane,this.tempCM1=new r.Vector3,this.tempCM2=new r.Vector3,this.tempVector3=new r.Vector3,this.tempVector3_2=new r.Vector3,this.tempVector3_3=new r.Vector3,this.tempVector3_P0=new r.Vector3,this.tempVector3_P1=new r.Vector3,this.tempVector3_P2=new r.Vector3,this.tempVector3_N0=new r.Vector3,this.tempVector3_N1=new r.Vector3,this.tempVector3_AB=new r.Vector3,this.tempVector3_CB=new r.Vector3,this.tempResultObjects={object1:null,object2:null},this.segments=[];for(let n=0;n<900;n++)this.segments[n]=!1}prepareBreakableObject(e,t,n,r,i){const s=e.userData;s.mass=t,s.velocity=n.clone(),s.angularVelocity=r.clone(),s.breakable=i}subdivideByImpact(e,t,n,r,i){const s=[],a=this.tempPlane1,o=this.tempPlane2;this.tempVector3.addVectors(t,n),a.setFromCoplanarPoints(t,e.position,this.tempVector3);const l=i+r,c=this;return function i(h,u,d,p){if(Math.random()<.05*p||p>l)return void s.push(h);let f=Math.PI;0===p?(o.normal.copy(a.normal),o.constant=a.constant):p<=r?(f=(d-u)*(.2+.6*Math.random())+u,c.tempVector3_2.copy(e.position).sub(t).applyAxisAngle(n,f).add(t),o.setFromCoplanarPoints(t,c.tempVector3,c.tempVector3_2)):(f=(.5*(1&p)+.2*(2-Math.random()))*Math.PI,c.tempVector3_2.copy(t).sub(h.position).applyAxisAngle(n,f).add(h.position),c.tempVector3_3.copy(n).add(h.position),o.setFromCoplanarPoints(h.position,c.tempVector3_3,c.tempVector3_2)),c.cutByPlane(h,o,c.tempResultObjects);const m=c.tempResultObjects.object1,g=c.tempResultObjects.object2;m&&i(m,u,f,p+1),g&&i(g,f,d,p+1)}(e,0,2*Math.PI,0),s}cutByPlane(e,t,n){const s=e.geometry,o=s.attributes.position.array,l=s.attributes.normal.array,c=o.length/3;let h=c/3,u=s.getIndex();function d(e,t){const n=3*e+t;return u?u[n]:n}u&&(u=u.array,h=u.length/3);const p=[],f=[],m=this.smallDelta,g=c*c;for(let r=0;r<g;r++)this.segments[r]=!1;const A=this.tempVector3_P0,v=this.tempVector3_P1,y=this.tempVector3_N0,x=this.tempVector3_N1;for(let r=0;r<h-1;r++){const e=d(r,0),t=d(r,1),n=d(r,2);y.set(l[e],l[e]+1,l[e]+2);for(let i=r+1;i<h;i++){const r=d(i,0),s=d(i,1),a=d(i,2);x.set(l[r],l[r]+1,l[r]+2);1-y.dot(x)<m&&(e===r||e===s||e===a?t===r||t===s||t===a?(this.segments[e*c+t]=!0,this.segments[t*c+e]=!0):(this.segments[n*c+e]=!0,this.segments[e*c+n]=!0):t!==r&&t!==s&&t!==a||(this.segments[n*c+t]=!0,this.segments[t*c+n]=!0))}}const b=this.tempPlane_Cut;e.updateMatrix(),a.transformPlaneToLocalSpace(t,e.matrix,b);for(let i=0;i<h;i++){const e=d(i,0),t=d(i,1),s=d(i,2);for(let i=0;i<3;i++){const a=0===i?e:1===i?t:s,l=0===i?t:1===i?s:e;if(this.segments[a*c+l])continue;this.segments[a*c+l]=!0,this.segments[l*c+a]=!0,A.set(o[3*a],o[3*a+1],o[3*a+2]),v.set(o[3*l],o[3*l+1],o[3*l+2]);let h=0,u=b.distanceToPoint(A);u>m?(h=2,f.push(A.clone())):u<-m?(h=1,p.push(A.clone())):(h=3,p.push(A.clone()),f.push(A.clone()));let d=0;if(u=b.distanceToPoint(v),u>m?(d=2,f.push(v.clone())):u<-m?(d=1,p.push(v.clone())):(d=3,p.push(v.clone()),f.push(v.clone())),1===h&&2===d||2===h&&1===d){this.tempLine1.start.copy(A),this.tempLine1.end.copy(v);let e=new r.Vector3;if(e=b.intersectLine(this.tempLine1,e),null===e)return console.error("Internal error: segment does not intersect plane."),n.segmentedObject1=null,n.segmentedObject2=null,0;p.push(e),f.push(e.clone())}}}const E=.5*e.userData.mass;this.tempCM1.set(0,0,0);let _=0;const S=p.length;if(S>0){for(let e=0;e<S;e++)this.tempCM1.add(p[e]);this.tempCM1.divideScalar(S);for(let e=0;e<S;e++){const t=p[e];t.sub(this.tempCM1),_=Math.max(_,t.x,t.y,t.z)}this.tempCM1.add(e.position)}this.tempCM2.set(0,0,0);let w=0;const M=f.length;if(M>0){for(let e=0;e<M;e++)this.tempCM2.add(f[e]);this.tempCM2.divideScalar(M);for(let e=0;e<M;e++){const t=f[e];t.sub(this.tempCM2),w=Math.max(w,t.x,t.y,t.z)}this.tempCM2.add(e.position)}let C=null,T=null,I=0;return S>4&&(C=new r.Mesh(new i.ConvexGeometry(p),e.material),C.position.copy(this.tempCM1),C.quaternion.copy(e.quaternion),this.prepareBreakableObject(C,E,e.userData.velocity,e.userData.angularVelocity,2*_>this.minSizeForBreak),I++),M>4&&(T=new r.Mesh(new i.ConvexGeometry(f),e.material),T.position.copy(this.tempCM2),T.quaternion.copy(e.quaternion),this.prepareBreakableObject(T,E,e.userData.velocity,e.userData.angularVelocity,2*w>this.minSizeForBreak),I++),n.object1=C,n.object2=T,I}static transformFreeVector(e,t){const n=e.x,r=e.y,i=e.z,s=t.elements;return e.x=s[0]*n+s[4]*r+s[8]*i,e.y=s[1]*n+s[5]*r+s[9]*i,e.z=s[2]*n+s[6]*r+s[10]*i,e}static transformFreeVectorInverse(e,t){const n=e.x,r=e.y,i=e.z,s=t.elements;return e.x=s[0]*n+s[1]*r+s[2]*i,e.y=s[4]*n+s[5]*r+s[6]*i,e.z=s[8]*n+s[9]*r+s[10]*i,e}static transformTiedVectorInverse(e,t){const n=e.x,r=e.y,i=e.z,s=t.elements;return e.x=s[0]*n+s[1]*r+s[2]*i-s[12],e.y=s[4]*n+s[5]*r+s[6]*i-s[13],e.z=s[8]*n+s[9]*r+s[10]*i-s[14],e}static transformPlaneToLocalSpace(e,t,n){n.normal.copy(e.normal),n.constant=e.constant;const r=a.transformTiedVectorInverse(e.coplanarPoint(s),t);a.transformFreeVectorInverse(n.normal,t),n.constant=-r.dot(n.normal)}}t.ConvexObjectBreaker=a},58532:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.GPUComputationRenderer=class{constructor(e,t,n){this.variables=[],this.currentTextureIndex=0;let i=r.FloatType;const s=new r.Scene,a=new r.Camera;a.position.z=1;const o={passThruTexture:{value:null}},l=u("uniform sampler2D passThruTexture;\n\nvoid main() {\n\n\tvec2 uv = gl_FragCoord.xy / resolution.xy;\n\n\tgl_FragColor = texture2D( passThruTexture, uv );\n\n}\n",o),c=new r.Mesh(new r.PlaneGeometry(2,2),l);function h(n){n.defines.resolution="vec2( "+e.toFixed(1)+", "+t.toFixed(1)+" )"}function u(e,t){t=t||{};const n=new r.ShaderMaterial({uniforms:t,vertexShader:"void main()\t{\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:e});return h(n),n}s.add(c),this.setDataType=function(e){return i=e,this},this.addVariable=function(e,t,n){const i={name:e,initialValueTexture:n,material:this.createShaderMaterial(t),dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:r.NearestFilter,magFilter:r.NearestFilter};return this.variables.push(i),i},this.setVariableDependencies=function(e,t){e.dependencies=t},this.init=function(){if(!1===n.capabilities.isWebGL2&&!1===n.extensions.has("OES_texture_float"))return"No OES_texture_float support for float textures.";if(0===n.capabilities.maxVertexTextures)return"No support for vertex shader textures.";for(let n=0;n<this.variables.length;n++){const r=this.variables[n];r.renderTargets[0]=this.createRenderTarget(e,t,r.wrapS,r.wrapT,r.minFilter,r.magFilter),r.renderTargets[1]=this.createRenderTarget(e,t,r.wrapS,r.wrapT,r.minFilter,r.magFilter),this.renderTexture(r.initialValueTexture,r.renderTargets[0]),this.renderTexture(r.initialValueTexture,r.renderTargets[1]);const i=r.material,s=i.uniforms;if(null!==r.dependencies)for(let e=0;e<r.dependencies.length;e++){const t=r.dependencies[e];if(t.name!==r.name){let e=!1;for(let n=0;n<this.variables.length;n++)if(t.name===this.variables[n].name){e=!0;break}if(!e)return"Variable dependency not found. Variable="+r.name+", dependency="+t.name}s[t.name]={value:null},i.fragmentShader="\nuniform sampler2D "+t.name+";\n"+i.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){const e=this.currentTextureIndex,t=0===this.currentTextureIndex?1:0;for(let n=0,r=this.variables.length;n<r;n++){const r=this.variables[n];if(null!==r.dependencies){const t=r.material.uniforms;for(let n=0,i=r.dependencies.length;n<i;n++){const i=r.dependencies[n];t[i.name].value=i.renderTargets[e].texture}}this.doRenderTarget(r.material,r.renderTargets[t])}this.currentTextureIndex=t},this.getCurrentRenderTarget=function(e){return e.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(e){return e.renderTargets[0===this.currentTextureIndex?1:0]},this.dispose=function(){c.geometry.dispose(),c.material.dispose();const e=this.variables;for(let t=0;t<e.length;t++){const n=e[t];n.initialValueTexture&&n.initialValueTexture.dispose();const r=n.renderTargets;for(let e=0;e<r.length;e++){r[e].dispose()}}},this.addResolutionDefine=h,this.createShaderMaterial=u,this.createRenderTarget=function(n,s,a,o,l,c){n=n||e,s=s||t,a=a||r.ClampToEdgeWrapping,o=o||r.ClampToEdgeWrapping,l=l||r.NearestFilter,c=c||r.NearestFilter;return new r.WebGLRenderTarget(n,s,{wrapS:a,wrapT:o,minFilter:l,magFilter:c,format:r.RGBAFormat,type:i,depthBuffer:!1})},this.createTexture=function(){const n=new Float32Array(e*t*4),i=new r.DataTexture(n,e,t,r.RGBAFormat,r.FloatType);return i.needsUpdate=!0,i},this.renderTexture=function(e,t){o.passThruTexture.value=e,this.doRenderTarget(l,t),o.passThruTexture.value=null},this.doRenderTarget=function(e,t){const i=n.getRenderTarget(),o=n.xr.enabled,h=n.shadowMap.autoUpdate,u=n.outputColorSpace,d=n.toneMapping;n.xr.enabled=!1,n.shadowMap.autoUpdate=!1,"outputColorSpace"in n?n.outputColorSpace="srgb-linear":n.encoding=3e3,n.toneMapping=r.NoToneMapping,c.material=e,n.setRenderTarget(t),n.render(s,a),c.material=l,n.xr.enabled=o,n.shadowMap.autoUpdate=h,n.outputColorSpace=u,n.toneMapping=d,n.setRenderTarget(i)}}}},37753:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Quaternion,a=new r.Vector3,o=new r.Vector3,l=new r.Quaternion,c=new r.Vector3;class h extends r.Object3D{constructor(){super()}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null!==this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(o,l,c),this.matrix.decompose(i,s,a),this.matrixWorld.compose(o,s,c)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(let t=0,n=this.children.length;t<n;t++)this.children[t].updateMatrixWorld(e)}}t.Gyroscope=h},4618:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(28057);t.MD2Character=class{constructor(){this.scale=1,this.animationFPS=6,this.root=new r.Object3D,this.meshBody=null,this.meshWeapon=null,this.skinsBody=[],this.skinsWeapon=[],this.weapons=[],this.activeAnimation=null,this.mixer=null,this.onLoadComplete=function(){},this.loadCounter=0}loadParts(e){const t=this;function n(e,t){const n=new r.MeshLambertMaterial({color:16755200,wireframe:!0,morphTargets:!0,morphNormals:!0}),i=new r.MeshLambertMaterial({color:16777215,wireframe:!1,map:t,morphTargets:!0,morphNormals:!0}),s=new r.Mesh(e,i);return s.rotation.y=-Math.PI/2,s.castShadow=!0,s.receiveShadow=!0,s.materialTexture=i,s.materialWireframe=n,s}function s(e,t){const n=new r.TextureLoader,i=[];for(let s=0;s<t.length;s++)i[s]=n.load(e+t[s],a),i[s].mapping=r.UVMapping,i[s].name=t[s],"colorSpace"in i[s]?i[s].colorSpace="srgb":i[s].encoding=3001;return i}function a(){t.loadCounter-=1,0===t.loadCounter&&t.onLoadComplete()}this.loadCounter=2*e.weapons.length+e.skins.length+1;const o=[];for(let r=0;r<e.weapons.length;r++)o[r]=e.weapons[r][1];this.skinsBody=s(e.baseUrl+"skins/",e.skins),this.skinsWeapon=s(e.baseUrl+"skins/",o);const l=new i.MD2Loader;l.load(e.baseUrl+e.body,(function(e){const i=new r.Box3;i.setFromBufferAttribute(e.attributes.position),t.root.position.y=-t.scale*i.min.y;const s=n(e,t.skinsBody[0]);s.scale.set(t.scale,t.scale,t.scale),t.root.add(s),t.meshBody=s,t.meshBody.clipOffset=0,t.activeAnimationClipName=s.geometry.animations[0].name,t.mixer=new r.AnimationMixer(s),a()}));const c=function(e,r){return function(i){const s=n(i,t.skinsWeapon[e]);s.scale.set(t.scale,t.scale,t.scale),s.visible=!1,s.name=r,t.root.add(s),t.weapons[e]=s,t.meshWeapon=s,a()}};for(let r=0;r<e.weapons.length;r++)l.load(e.baseUrl+e.weapons[r][0],c(r,e.weapons[r][0]))}setPlaybackRate(e){this.mixer.timeScale=0!==e?1/e:0}setWireframe(e){e?(this.meshBody&&(this.meshBody.material=this.meshBody.materialWireframe),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialWireframe)):(this.meshBody&&(this.meshBody.material=this.meshBody.materialTexture),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialTexture))}setSkin(e){this.meshBody&&!1===this.meshBody.material.wireframe&&(this.meshBody.material.map=this.skinsBody[e])}setWeapon(e){for(let n=0;n<this.weapons.length;n++)this.weapons[n].visible=!1;const t=this.weapons[e];t&&(t.visible=!0,this.meshWeapon=t,this.syncWeaponAnimation())}setAnimation(e){if(this.meshBody){this.meshBody.activeAction&&(this.meshBody.activeAction.stop(),this.meshBody.activeAction=null);const t=this.mixer.clipAction(e,this.meshBody);t&&(this.meshBody.activeAction=t.play())}this.activeClipName=e,this.syncWeaponAnimation()}syncWeaponAnimation(){const e=this.activeClipName;if(this.meshWeapon){this.meshWeapon.activeAction&&(this.meshWeapon.activeAction.stop(),this.meshWeapon.activeAction=null);const t=this.mixer.clipAction(e,this.meshWeapon);t&&(this.meshWeapon.activeAction=t.syncWith(this.meshBody.activeAction).play())}}update(e){this.mixer&&this.mixer.update(e)}}},36455:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(28057),s=n(46863);t.MD2CharacterComplex=class{constructor(){this.scale=1,this.animationFPS=6,this.transitionFrames=15,this.maxSpeed=275,this.maxReverseSpeed=-275,this.frontAcceleration=600,this.backAcceleration=600,this.frontDecceleration=600,this.angularSpeed=2.5,this.root=new r.Object3D,this.meshBody=null,this.meshWeapon=null,this.controls=null,this.skinsBody=[],this.skinsWeapon=[],this.weapons=[],this.currentSkin=void 0,this.onLoadComplete=function(){},this.meshes=[],this.animations={},this.loadCounter=0,this.speed=0,this.bodyOrientation=0,this.walkSpeed=this.maxSpeed,this.crouchSpeed=.5*this.maxSpeed,this.activeAnimation=null,this.oldAnimation=null}enableShadows(e){for(let t=0;t<this.meshes.length;t++)this.meshes[t].castShadow=e,this.meshes[t].receiveShadow=e}setVisible(e){for(let t=0;t<this.meshes.length;t++)this.meshes[t].visible=e,this.meshes[t].visible=e}shareParts(e){this.animations=e.animations,this.walkSpeed=e.walkSpeed,this.crouchSpeed=e.crouchSpeed,this.skinsBody=e.skinsBody,this.skinsWeapon=e.skinsWeapon;const t=this._createPart(e.meshBody.geometry,this.skinsBody[0]);t.scale.set(this.scale,this.scale,this.scale),this.root.position.y=e.root.position.y,this.root.add(t),this.meshBody=t,this.meshes.push(t);for(let n=0;n<e.weapons.length;n++){const t=this._createPart(e.weapons[n].geometry,this.skinsWeapon[n]);t.scale.set(this.scale,this.scale,this.scale),t.visible=!1,t.name=e.weapons[n].name,this.root.add(t),this.weapons[n]=t,this.meshWeapon=t,this.meshes.push(t)}}loadParts(e){const t=this;function n(e,t){const n=new r.TextureLoader,i=[];for(let a=0;a<t.length;a++)i[a]=n.load(e+t[a],s),i[a].mapping=r.UVMapping,i[a].name=t[a],"colorSpace"in i[a]?i[a].colorSpace="srgb":i[a].encoding=3001;return i}function s(){t.loadCounter-=1,0===t.loadCounter&&t.onLoadComplete()}this.animations=e.animations,this.walkSpeed=e.walkSpeed,this.crouchSpeed=e.crouchSpeed,this.loadCounter=2*e.weapons.length+e.skins.length+1;const a=[];for(let r=0;r<e.weapons.length;r++)a[r]=e.weapons[r][1];this.skinsBody=n(e.baseUrl+"skins/",e.skins),this.skinsWeapon=n(e.baseUrl+"skins/",a);const o=new i.MD2Loader;o.load(e.baseUrl+e.body,(function(e){const n=new r.Box3;n.setFromBufferAttribute(e.attributes.position),t.root.position.y=-t.scale*n.min.y;const i=t._createPart(e,t.skinsBody[0]);i.scale.set(t.scale,t.scale,t.scale),t.root.add(i),t.meshBody=i,t.meshes.push(i),s()}));const l=function(e,n){return function(r){const i=t._createPart(r,t.skinsWeapon[e]);i.scale.set(t.scale,t.scale,t.scale),i.visible=!1,i.name=n,t.root.add(i),t.weapons[e]=i,t.meshWeapon=i,t.meshes.push(i),s()}};for(let r=0;r<e.weapons.length;r++)o.load(e.baseUrl+e.weapons[r][0],l(r,e.weapons[r][0]))}setPlaybackRate(e){this.meshBody&&(this.meshBody.duration=this.meshBody.baseDuration/e),this.meshWeapon&&(this.meshWeapon.duration=this.meshWeapon.baseDuration/e)}setWireframe(e){e?(this.meshBody&&(this.meshBody.material=this.meshBody.materialWireframe),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialWireframe)):(this.meshBody&&(this.meshBody.material=this.meshBody.materialTexture),this.meshWeapon&&(this.meshWeapon.material=this.meshWeapon.materialTexture))}setSkin(e){this.meshBody&&!1===this.meshBody.material.wireframe&&(this.meshBody.material.map=this.skinsBody[e],this.currentSkin=e)}setWeapon(e){for(let n=0;n<this.weapons.length;n++)this.weapons[n].visible=!1;const t=this.weapons[e];t&&(t.visible=!0,this.meshWeapon=t,this.activeAnimation&&(t.playAnimation(this.activeAnimation),this.meshWeapon.setAnimationTime(this.activeAnimation,this.meshBody.getAnimationTime(this.activeAnimation))))}setAnimation(e){e!==this.activeAnimation&&e&&(this.meshBody&&(this.meshBody.setAnimationWeight(e,0),this.meshBody.playAnimation(e),this.oldAnimation=this.activeAnimation,this.activeAnimation=e,this.blendCounter=this.transitionFrames),this.meshWeapon&&(this.meshWeapon.setAnimationWeight(e,0),this.meshWeapon.playAnimation(e)))}update(e){this.controls&&this.updateMovementModel(e),this.animations&&(this.updateBehaviors(),this.updateAnimations(e))}updateAnimations(e){let t=1;this.blendCounter>0&&(t=(this.transitionFrames-this.blendCounter)/this.transitionFrames,this.blendCounter-=1),this.meshBody&&(this.meshBody.update(e),this.meshBody.setAnimationWeight(this.activeAnimation,t),this.meshBody.setAnimationWeight(this.oldAnimation,1-t)),this.meshWeapon&&(this.meshWeapon.update(e),this.meshWeapon.setAnimationWeight(this.activeAnimation,t),this.meshWeapon.setAnimationWeight(this.oldAnimation,1-t))}updateBehaviors(){const e=this.controls,t=this.animations;let n,r;e.crouch?(n=t.crouchMove,r=t.crouchIdle):(n=t.move,r=t.idle),e.jump&&(n=t.jump,r=t.jump),e.attack&&(e.crouch?(n=t.crouchAttack,r=t.crouchAttack):(n=t.attack,r=t.attack)),(e.moveForward||e.moveBackward||e.moveLeft||e.moveRight)&&this.activeAnimation!==n&&this.setAnimation(n),Math.abs(this.speed)<.2*this.maxSpeed&&!(e.moveLeft||e.moveRight||e.moveForward||e.moveBackward)&&this.activeAnimation!==r&&this.setAnimation(r),e.moveForward&&(this.meshBody&&(this.meshBody.setAnimationDirectionForward(this.activeAnimation),this.meshBody.setAnimationDirectionForward(this.oldAnimation)),this.meshWeapon&&(this.meshWeapon.setAnimationDirectionForward(this.activeAnimation),this.meshWeapon.setAnimationDirectionForward(this.oldAnimation))),e.moveBackward&&(this.meshBody&&(this.meshBody.setAnimationDirectionBackward(this.activeAnimation),this.meshBody.setAnimationDirectionBackward(this.oldAnimation)),this.meshWeapon&&(this.meshWeapon.setAnimationDirectionBackward(this.activeAnimation),this.meshWeapon.setAnimationDirectionBackward(this.oldAnimation)))}updateMovementModel(e){function t(e){return 1===e?1:1-Math.pow(2,-10*e)}const n=this.controls;n.crouch?this.maxSpeed=this.crouchSpeed:this.maxSpeed=this.walkSpeed,this.maxReverseSpeed=-this.maxSpeed,n.moveForward&&(this.speed=r.MathUtils.clamp(this.speed+e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),n.moveBackward&&(this.speed=r.MathUtils.clamp(this.speed-e*this.backAcceleration,this.maxReverseSpeed,this.maxSpeed));if(n.moveLeft&&(this.bodyOrientation+=e*this.angularSpeed,this.speed=r.MathUtils.clamp(this.speed+1*e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),n.moveRight&&(this.bodyOrientation-=e*this.angularSpeed,this.speed=r.MathUtils.clamp(this.speed+1*e*this.frontAcceleration,this.maxReverseSpeed,this.maxSpeed)),!n.moveForward&&!n.moveBackward)if(this.speed>0){const n=t(this.speed/this.maxSpeed);this.speed=r.MathUtils.clamp(this.speed-n*e*this.frontDecceleration,0,this.maxSpeed)}else{const n=t(this.speed/this.maxReverseSpeed);this.speed=r.MathUtils.clamp(this.speed+n*e*this.backAcceleration,this.maxReverseSpeed,0)}const i=this.speed*e;this.root.position.x+=Math.sin(this.bodyOrientation)*i,this.root.position.z+=Math.cos(this.bodyOrientation)*i,this.root.rotation.y=this.bodyOrientation}_createPart(e,t){const n=new r.MeshLambertMaterial({color:16755200,wireframe:!0,morphTargets:!0,morphNormals:!0}),i=new r.MeshLambertMaterial({color:16777215,wireframe:!1,map:t,morphTargets:!0,morphNormals:!0}),a=new s.MorphBlendMesh(e,i);return a.rotation.y=-Math.PI/2,a.materialTexture=i,a.materialWireframe=n,a.autoCreateAnimations(this.animationFPS),a}}},73653:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t){super(e,t),this.type="MorphAnimMesh",this.mixer=new r.AnimationMixer(this),this.activeAction=null}setDirectionForward(){this.mixer.timeScale=1}setDirectionBackward(){this.mixer.timeScale=-1}playAnimation(e,t){this.activeAction&&(this.activeAction.stop(),this.activeAction=null);const n=r.AnimationClip.findByName(this,e);if(!n)throw new Error("THREE.MorphAnimMesh: animations["+e+"] undefined in .playAnimation()");{const e=this.mixer.clipAction(n);e.timeScale=n.tracks.length*t/n.duration,this.activeAction=e.play()}}updateAnimation(e){this.mixer.update(e)}copy(e,t){return super.copy(e,t),this.mixer=new r.AnimationMixer(this),this}}t.MorphAnimMesh=i},46863:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t){super(e,t),this.animationsMap={},this.animationsList=[];const n=Object.keys(this.morphTargetDictionary).length,r="__default",i=n-1,s=n/1;this.createAnimation(r,0,i,s),this.setAnimationWeight(r,1)}createAnimation(e,t,n,r){const i={start:t,end:n,length:n-t+1,fps:r,duration:(n-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=i,this.animationsList.push(i)}autoCreateAnimations(e){const t=/([a-z]+)_?(\d+)/i;let n;const r={};let i=0;for(const s in this.morphTargetDictionary){const e=s.match(t);if(e&&e.length>1){const t=e[1];r[t]||(r[t]={start:1/0,end:-1/0});const s=r[t];i<s.start&&(s.start=i),i>s.end&&(s.end=i),n||(n=t)}i++}for(const s in r){const t=r[s];this.createAnimation(s,t.start,t.end,e)}this.firstAnimation=n}setAnimationDirectionForward(e){const t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)}setAnimationDirectionBackward(e){const t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)}setAnimationFPS(e,t){const n=this.animationsMap[e];n&&(n.fps=t,n.duration=(n.end-n.start)/n.fps)}setAnimationDuration(e,t){const n=this.animationsMap[e];n&&(n.duration=t,n.fps=(n.end-n.start)/n.duration)}setAnimationWeight(e,t){const n=this.animationsMap[e];n&&(n.weight=t)}setAnimationTime(e,t){const n=this.animationsMap[e];n&&(n.time=t)}getAnimationTime(e){let t=0;const n=this.animationsMap[e];return n&&(t=n.time),t}getAnimationDuration(e){let t=-1;const n=this.animationsMap[e];return n&&(t=n.duration),t}playAnimation(e){const t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")}stopAnimation(e){const t=this.animationsMap[e];t&&(t.active=!1)}update(e){for(let t=0,n=this.animationsList.length;t<n;t++){const n=this.animationsList[t];if(!n.active)continue;const i=n.duration/n.length;n.time+=n.direction*e,n.mirroredLoop?(n.time>n.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));const s=n.start+r.MathUtils.clamp(Math.floor(n.time/i),0,n.length-1),a=n.weight;s!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*a,this.morphTargetInfluences[s]=0,n.lastFrame=n.currentFrame,n.currentFrame=s);let o=n.time%i/i;n.directionBackwards&&(o=1-o),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=o*a,this.morphTargetInfluences[n.lastFrame]=(1-o)*a):this.morphTargetInfluences[n.currentFrame]=a}}}t.MorphBlendMesh=i},29667:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(85581);t.ProgressiveLightMap=class{constructor(e,t=1024){this.renderer=e,this.res=t,this.lightMapContainers=[],this.compiled=!1,this.scene=new r.Scene,this.scene.background=null,this.tinyTarget=new r.WebGLRenderTarget(1,1),this.buffer1Active=!1,this.firstUpdate=!0,this.warned=!1;const n=/(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent)?alfFloatType:r.FloatType;this.progressiveLightMap1=new r.WebGLRenderTarget(this.res,this.res,{type:n}),this.progressiveLightMap2=new r.WebGLRenderTarget(this.res,this.res,{type:n}),this.uvMat=new r.MeshPhongMaterial,this.uvMat.uniforms={},this.uvMat.onBeforeCompile=e=>{e.vertexShader="#define USE_LIGHTMAP\n"+e.vertexShader.slice(0,-1)+"\tgl_Position = vec4((uv2 - 0.5) * 2.0, 1.0, 1.0); }";const t=e.fragmentShader.indexOf("void main() {");e.fragmentShader="varying vec2 vUv2;\n"+e.fragmentShader.slice(0,t)+"\tuniform sampler2D previousShadowMap;\n\tuniform float averagingWindow;\n"+e.fragmentShader.slice(t-1,-1)+"\nvec3 texelOld = texture2D(previousShadowMap, vUv2).rgb;\n\t\t\t\tgl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/averagingWindow);\n\t\t\t}",e.uniforms.previousShadowMap={value:this.progressiveLightMap1.texture},e.uniforms.averagingWindow={value:100},this.uvMat.uniforms=e.uniforms,this.uvMat.userData.shader=e,this.compiled=!0}}addObjectsToLightMap(e){this.uv_boxes=[];const t=3/this.res;for(let r=0;r<e.length;r++){const n=e[r];n.isLight?this.scene.attach(n):n.geometry.hasAttribute("uv")?(null==this.blurringPlane&&this._initializeBlurPlane(this.res,this.progressiveLightMap1),n.material.lightMap=this.progressiveLightMap2.texture,n.material.dithering=!0,n.castShadow=!0,n.receiveShadow=!0,n.renderOrder=1e3+r,this.uv_boxes.push({w:1+2*t,h:1+2*t,index:r}),this.lightMapContainers.push({basicMat:n.material,object:n}),this.compiled=!1):console.warn("All lightmap objects need UVs!")}const n=i(this.uv_boxes);this.uv_boxes.forEach((r=>{const i=e[r.index].geometry.getAttribute("uv").clone();for(let e=0;e<i.array.length;e+=i.itemSize)i.array[e]=(i.array[e]+r.x+t)/n.w,i.array[e+1]=(i.array[e+1]+r.y+t)/n.h;e[r.index].geometry.setAttribute("uv2",i),e[r.index].geometry.getAttribute("uv2").needsUpdate=!0}))}update(e,t=100,n=!0){if(null==this.blurringPlane)return;const r=this.renderer.getRenderTarget();this.blurringPlane.visible=n;for(let a=0;a<this.lightMapContainers.length;a++)this.lightMapContainers[a].object.oldScene=this.lightMapContainers[a].object.parent,this.scene.attach(this.lightMapContainers[a].object);this.firstUpdate&&(this.renderer.setRenderTarget(this.tinyTarget),this.renderer.render(this.scene,e),this.firstUpdate=!1);for(let a=0;a<this.lightMapContainers.length;a++)this.uvMat.uniforms.averagingWindow={value:t},this.lightMapContainers[a].object.material=this.uvMat,this.lightMapContainers[a].object.oldFrustumCulled=this.lightMapContainers[a].object.frustumCulled,this.lightMapContainers[a].object.frustumCulled=!1;const i=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,s=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1;this.renderer.setRenderTarget(i),this.uvMat.uniforms.previousShadowMap={value:s.texture},this.blurringPlane.material.uniforms.previousShadowMap={value:s.texture},this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e);for(let a=0;a<this.lightMapContainers.length;a++)this.lightMapContainers[a].object.frustumCulled=this.lightMapContainers[a].object.oldFrustumCulled,this.lightMapContainers[a].object.material=this.lightMapContainers[a].basicMat,this.lightMapContainers[a].object.oldScene.attach(this.lightMapContainers[a].object);this.renderer.setRenderTarget(r)}showDebugLightmap(e,t=void 0){0!=this.lightMapContainers.length?(null==this.labelMesh&&(this.labelMaterial=new r.MeshBasicMaterial({map:this.progressiveLightMap1.texture,side:r.DoubleSide}),this.labelPlane=new r.PlaneGeometry(100,100),this.labelMesh=new r.Mesh(this.labelPlane,this.labelMaterial),this.labelMesh.position.y=250,this.lightMapContainers[0].object.parent.add(this.labelMesh)),null!=t&&this.labelMesh.position.copy(t),this.labelMesh.visible=e):this.warned||(console.warn("Call this after adding the objects!"),this.warned=!0)}_initializeBlurPlane(e,t=null){const n=new r.MeshBasicMaterial;n.uniforms={previousShadowMap:{value:null},pixelOffset:{value:1/e},polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:3},n.onBeforeCompile=r=>{r.vertexShader="#define USE_UV\n"+r.vertexShader.slice(0,-1)+"\tgl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";const i=r.fragmentShader.indexOf("void main() {");r.fragmentShader="#define USE_UV\n"+r.fragmentShader.slice(0,i)+"\tuniform sampler2D previousShadowMap;\n\tuniform float pixelOffset;\n"+r.fragmentShader.slice(i-1,-1)+"\tgl_FragColor.rgb = (\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, 0.0 )).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( 0.0 , pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( 0.0 , -pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, 0.0 )).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2( pixelOffset, -pixelOffset)).rgb +\n\t\t\t texture2D(previousShadowMap, vUv + vec2(-pixelOffset, -pixelOffset)).rgb)/8.0;\n\t\t}",r.uniforms.previousShadowMap={value:t.texture},r.uniforms.pixelOffset={value:.5/e},n.uniforms=r.uniforms,n.userData.shader=r,this.compiled=!0},this.blurringPlane=new r.Mesh(new r.PlaneGeometry(1,1),n),this.blurringPlane.name="Blurring Plane",this.blurringPlane.frustumCulled=!1,this.blurringPlane.renderOrder=0,this.blurringPlane.material.depthWrite=!1,this.scene.add(this.blurringPlane)}}},91248:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.BufferGeometry{constructor(e,t){super();const n=[],i=[],s=[],a=[1,1,1],o=[1,1,0],l=new r.Vector3(0,1,0),c=new r.Vector3,h=new r.Vector3,u=new r.Quaternion,d=new r.Quaternion;d.setFromAxisAngle(l,Math.PI/2);const p=new r.Vector3,f=new r.Vector3;f.copy(e.getPointAt(0));const m=[new r.Vector3(-.225,0,0),new r.Vector3(0,-.05,0),new r.Vector3(0,-.175,0),new r.Vector3(0,-.05,0),new r.Vector3(.225,0,0),new r.Vector3(0,-.175,0)],g=2*Math.PI;let A=5;const v=[];for(let D=0;D<A;D++){const e=D/A*g;v.push(new r.Vector3(.06*Math.sin(e),.06*Math.cos(e),0))}A=6;const y=[];for(let D=0;D<A;D++){const e=D/A*g;y.push(new r.Vector3(.025*Math.sin(e),.025*Math.cos(e),0))}const x=new r.Vector3,b=new r.Vector3;function E(e,t){b.set(0,0,-1).applyQuaternion(u);for(let r=0;r<e.length;r++)x.copy(e[r]),x.applyQuaternion(u),x.add(p),n.push(x.x,x.y,x.z),i.push(b.x,b.y,b.z),s.push(t[0],t[1],t[2]);b.set(0,0,1).applyQuaternion(u);for(let r=e.length-1;r>=0;r--)x.copy(e[r]),x.applyQuaternion(u),x.add(p),n.push(x.x,x.y,x.z),i.push(b.x,b.y,b.z),s.push(t[0],t[1],t[2])}const _=new r.Vector3,S=new r.Vector3,w=new r.Vector3,M=new r.Vector3,C=new r.Vector3,T=new r.Vector3,I=new r.Vector3,B=new r.Vector3;function R(e,t,r){for(let a=0,o=e.length;a<o;a++){const l=e[a],c=e[(a+1)%o];_.copy(l).add(t),_.applyQuaternion(u),_.add(p),S.copy(c).add(t),S.applyQuaternion(u),S.add(p),w.copy(c).add(t),w.applyQuaternion(d),w.add(f),M.copy(l).add(t),M.applyQuaternion(d),M.add(f),n.push(_.x,_.y,_.z),n.push(S.x,S.y,S.z),n.push(M.x,M.y,M.z),n.push(S.x,S.y,S.z),n.push(w.x,w.y,w.z),n.push(M.x,M.y,M.z),C.copy(l),C.applyQuaternion(u),C.normalize(),T.copy(c),T.applyQuaternion(u),T.normalize(),I.copy(c),I.applyQuaternion(d),I.normalize(),B.copy(l),B.applyQuaternion(d),B.normalize(),i.push(C.x,C.y,C.z),i.push(T.x,T.y,T.z),i.push(B.x,B.y,B.z),i.push(T.x,T.y,T.z),i.push(I.x,I.y,I.z),i.push(B.x,B.y,B.z),s.push(r[0],r[1],r[2]),s.push(r[0],r[1],r[2]),s.push(r[0],r[1],r[2]),s.push(r[0],r[1],r[2]),s.push(r[0],r[1],r[2]),s.push(r[0],r[1],r[2])}}const P=new r.Vector3;for(let r=1;r<=t;r++){p.copy(e.getPointAt(r/t)),l.set(0,1,0),c.subVectors(p,f).normalize(),h.crossVectors(l,c).normalize(),l.crossVectors(c,h);const n=Math.atan2(c.x,c.z);u.setFromAxisAngle(l,n),r%2==0&&E(m,o),R(v,P.set(0,-.125,0),o),R(y,P.set(.2,0,0),a),R(y,P.set(-.2,0,0),a),f.copy(p),d.copy(u)}this.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.setAttribute("normal",new r.BufferAttribute(new Float32Array(i),3)),this.setAttribute("color",new r.BufferAttribute(new Float32Array(s),3))}}class s extends r.BufferGeometry{constructor(e,t){super();const n=[],i=[],s=new r.Quaternion,a=new r.Vector3(0,1,0),o=new r.Vector3,l=new r.Vector3,c=[new r.Vector3(0,.05,-.05),new r.Vector3(0,.05,.05),new r.Vector3(0,-.05,0)],h=[new r.Vector3(-.05,0,.05),new r.Vector3(-.05,0,-.05),new r.Vector3(.05,0,0)],u=[new r.Vector3(.05,0,-.05),new r.Vector3(.05,0,.05),new r.Vector3(-.05,0,0)],d=new r.Vector3,p=new r.Vector3,f=new r.Vector3,m=new r.Vector3,g=new r.Vector3,A=new r.Vector3,v=new r.Vector3,y=new r.Vector3;function x(e,t,r){for(let a=0,o=e.length;a<o;a++){const l=e[a],c=e[(a+1)%o];d.copy(l),d.applyQuaternion(s),d.add(t),p.copy(c),p.applyQuaternion(s),p.add(t),f.copy(c),f.applyQuaternion(s),f.add(r),m.copy(l),m.applyQuaternion(s),m.add(r),n.push(d.x,d.y,d.z),n.push(p.x,p.y,p.z),n.push(m.x,m.y,m.z),n.push(p.x,p.y,p.z),n.push(f.x,f.y,f.z),n.push(m.x,m.y,m.z),g.copy(l),g.applyQuaternion(s),g.normalize(),A.copy(c),A.applyQuaternion(s),A.normalize(),v.copy(c),v.applyQuaternion(s),v.normalize(),y.copy(l),y.applyQuaternion(s),y.normalize(),i.push(g.x,g.y,g.z),i.push(A.x,A.y,A.z),i.push(y.x,y.y,y.z),i.push(A.x,A.y,A.z),i.push(v.x,v.y,v.z),i.push(y.x,y.y,y.z)}}const b=new r.Vector3,E=new r.Vector3;for(let r=1;r<=t;r++){o.copy(e.getPointAt(r/t)),l.copy(e.getTangentAt(r/t));const n=Math.atan2(l.x,l.z);s.setFromAxisAngle(a,n),o.y>10?(b.set(-.75,-.35,0),b.applyQuaternion(s),b.add(o),E.set(.75,-.35,0),E.applyQuaternion(s),E.add(o),x(c,b,E),b.set(-.7,-.3,0),b.applyQuaternion(s),b.add(o),E.set(-.7,-o.y,0),E.applyQuaternion(s),E.add(o),x(h,b,E),b.set(.7,-.3,0),b.applyQuaternion(s),b.add(o),E.set(.7,-o.y,0),E.applyQuaternion(s),E.add(o),x(u,b,E)):(b.set(0,-.2,0),b.applyQuaternion(s),b.add(o),E.set(0,-o.y,0),E.applyQuaternion(s),E.add(o),x(u,b,E))}this.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.setAttribute("normal",new r.BufferAttribute(new Float32Array(i),3))}}class a extends r.BufferGeometry{constructor(e,t){super();const n=[],i=new r.Vector3(0,1,0),s=new r.Vector3,a=new r.Quaternion,o=new r.Quaternion;o.setFromAxisAngle(i,Math.PI/2);const l=new r.Vector3,c=new r.Vector3;c.copy(e.getPointAt(0)),c.y=0;const h=new r.Vector3,u=new r.Vector3,d=new r.Vector3,p=new r.Vector3;for(let r=1;r<=t;r++){l.copy(e.getPointAt(r/t)),l.y=0,s.subVectors(l,c);const f=Math.atan2(s.x,s.z);a.setFromAxisAngle(i,f),h.set(-.3,0,0),h.applyQuaternion(a),h.add(l),u.set(.3,0,0),u.applyQuaternion(a),u.add(l),d.set(.3,0,0),d.applyQuaternion(o),d.add(c),p.set(-.3,0,0),p.applyQuaternion(o),p.add(c),n.push(h.x,h.y,h.z),n.push(u.x,u.y,u.z),n.push(p.x,p.y,p.z),n.push(u.x,u.y,u.z),n.push(d.x,d.y,d.z),n.push(p.x,p.y,p.z),c.copy(l),o.copy(a)}this.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3))}}class o extends r.BufferGeometry{constructor(){super();const e=[];for(let t=0;t<100;t++){const t=800*Math.random()-400,n=50*Math.random()+50,r=800*Math.random()-400,i=40*Math.random()+20;e.push(t-i,n,r-i),e.push(t+i,n,r-i),e.push(t-i,n,r+i),e.push(t+i,n,r-i),e.push(t+i,n,r+i),e.push(t-i,n,r+i)}this.setAttribute("position",new r.BufferAttribute(new Float32Array(e),3))}}class l extends r.BufferGeometry{constructor(e){super();const t=[],n=[],i=new r.Raycaster;i.ray.direction.set(0,-1,0);const s=new r.Color;for(let r=0;r<2e3;r++){const r=500*Math.random()-250,a=500*Math.random()-250;i.ray.origin.set(r,50,a);const o=i.intersectObject(e);if(0===o.length)continue;const l=o[0].point.y,c=5*Math.random()+.5;let h=Math.random()*Math.PI*2;t.push(r+Math.sin(h),l,a+Math.cos(h)),t.push(r,l+c,a),t.push(r+Math.sin(h+Math.PI),l,a+Math.cos(h+Math.PI)),h+=Math.PI/2,t.push(r+Math.sin(h),l,a+Math.cos(h)),t.push(r,l+c,a),t.push(r+Math.sin(h+Math.PI),l,a+Math.cos(h+Math.PI));const u=.1*Math.random();for(let e=0;e<6;e++)s.setRGB(.2+u,.4+u,0,"srgb"),n.push(s.r,s.g,s.b)}this.setAttribute("position",new r.BufferAttribute(new Float32Array(t),3)),this.setAttribute("color",new r.BufferAttribute(new Float32Array(n),3))}}t.RollerCoasterGeometry=i,t.RollerCoasterLiftersGeometry=s,t.RollerCoasterShadowGeometry=a,t.SkyGeometry=o,t.TreesGeometry=l},90648:(e,t)=>{"use strict";var n=Object.defineProperty,r=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function i(){!1===document.hidden&&this.reset()}t.Timer=class{constructor(){r(this,"_previousTime"),r(this,"_currentTime"),r(this,"_delta"),r(this,"_elapsed"),r(this,"_timescale"),r(this,"_useFixedDelta"),r(this,"_fixedDelta"),r(this,"_usePageVisibilityAPI"),r(this,"_pageVisibilityHandler"),this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI="undefined"!=typeof document&&void 0!==document.hidden}connect(){return this._usePageVisibilityAPI&&(this._pageVisibilityHandler=i.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1)),this}dispose(){return this._usePageVisibilityAPI&&this._pageVisibilityHandler&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}disableFixedDelta(){return this._useFixedDelta=!1,this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsedTime(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=1e3*e,this}setTimescale(e){return this._timescale=e,this}update(){return!0===this._useFixedDelta?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}get elapsedTime(){return this.getElapsedTime()}_now(){return("undefined"==typeof performance?Date:performance).now()}}},70599:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.TubePainter=function(){const e=3e6,t=new r.BufferAttribute(new Float32Array(e),3);t.usage=r.DynamicDrawUsage;const n=new r.BufferAttribute(new Float32Array(e),3);n.usage=r.DynamicDrawUsage;const i=new r.BufferAttribute(new Float32Array(e),3);i.usage=r.DynamicDrawUsage;const s=new r.BufferGeometry;s.setAttribute("position",t),s.setAttribute("normal",n),s.setAttribute("color",i),s.drawRange.count=0;const a=new r.MeshStandardMaterial({vertexColors:!0}),o=new r.Mesh(s,a);o.frustumCulled=!1;const l=new r.Vector3,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,d=new r.Color(16777215);let p=1;function f(e,a,o,f){if(0===e.distanceToSquared(a))return;let m=s.drawRange.count;const g=function(e){const t=2*Math.PI,n=[],i=.01*e;for(let s=0;s<10;s++){const e=s/10*t;n.push(new r.Vector3(Math.sin(e)*i,Math.cos(e)*i,0))}return n}(p);for(let r=0,s=g.length;r<s;r++){const p=g[r],A=g[(r+1)%s];l.copy(p).applyMatrix4(f).add(a),c.copy(A).applyMatrix4(f).add(a),h.copy(A).applyMatrix4(o).add(e),u.copy(p).applyMatrix4(o).add(e),l.toArray(t.array,3*(m+0)),c.toArray(t.array,3*(m+1)),u.toArray(t.array,3*(m+2)),c.toArray(t.array,3*(m+3)),h.toArray(t.array,3*(m+4)),u.toArray(t.array,3*(m+5)),l.copy(p).applyMatrix4(f).normalize(),c.copy(A).applyMatrix4(f).normalize(),h.copy(A).applyMatrix4(o).normalize(),u.copy(p).applyMatrix4(o).normalize(),l.toArray(n.array,3*(m+0)),c.toArray(n.array,3*(m+1)),u.toArray(n.array,3*(m+2)),c.toArray(n.array,3*(m+3)),h.toArray(n.array,3*(m+4)),u.toArray(n.array,3*(m+5)),d.toArray(i.array,3*(m+0)),d.toArray(i.array,3*(m+1)),d.toArray(i.array,3*(m+2)),d.toArray(i.array,3*(m+3)),d.toArray(i.array,3*(m+4)),d.toArray(i.array,3*(m+5)),m+=6}s.drawRange.count=m}const m=new r.Vector3(0,1,0),g=new r.Vector3,A=new r.Vector3,v=new r.Matrix4,y=new r.Matrix4;let x=0;return{mesh:o,moveTo:function(e){g.copy(e),v.lookAt(A,g,m),A.copy(e),y.copy(v)},lineTo:function(e){g.copy(e),v.lookAt(A,g,m),f(g,A,v,y),A.copy(g),y.copy(v)},setSize:function(e){p=e},update:function(){const e=x,r=s.drawRange.count;e!==r&&(t.updateRange.offset=3*e,t.updateRange.count=3*(r-e),t.needsUpdate=!0,n.updateRange.offset=3*e,n.updateRange.count=3*(r-e),n.needsUpdate=!0,i.updateRange.offset=3*e,i.updateRange.count=3*(r-e),i.needsUpdate=!0,x=s.drawRange.count)}}}},61350:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(94117);t.Volume=class{constructor(e,t,n,i,s){if(void 0!==e){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(n)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":default:this.data=new Uint8Array(s);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(s);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(s);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(s);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(s);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(s);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(s);break;case"Float64":case"float64":case"double":this.data=new Float64Array(s)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new r.Matrix3,this.matrix.identity();let a=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return a},set:function(e){a=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});let o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[],this.segmentation=!1}getData(e,t,n){return this.data[n*this.xLength*this.yLength+t*this.xLength+e]}access(e,t,n){return n*this.xLength*this.yLength+t*this.xLength+e}reverseAccess(e){const t=Math.floor(e/(this.yLength*this.xLength)),n=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-n*this.xLength,n,t]}map(e,t){const n=this.data.length;t=t||this;for(let r=0;r<n;r++)this.data[r]=e.call(t,this.data[r],r,this.data);return this}extractPerpendicularPlane(e,t){let n,i,s,a;const o=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=(new r.Matrix4).identity(),u=this,d=new r.Vector3(this.xLength,this.yLength,this.zLength);switch(e){case"x":o.set(1,0,0),l.set(0,0,-1),c.set(0,-1,0),n=this.spacing[this.axisOrder.indexOf("z")],i=this.spacing[this.axisOrder.indexOf("y")],a=new r.Vector3(t,0,0),h.multiply((new r.Matrix4).makeRotationY(Math.PI/2)),s=(u.RASDimensions[0]-1)/2,h.setPosition(new r.Vector3(t-s,0,0));break;case"y":o.set(0,1,0),l.set(1,0,0),c.set(0,0,1),n=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("z")],a=new r.Vector3(0,t,0),h.multiply((new r.Matrix4).makeRotationX(-Math.PI/2)),s=(u.RASDimensions[1]-1)/2,h.setPosition(new r.Vector3(0,t-s,0));break;default:o.set(0,0,1),l.set(1,0,0),c.set(0,-1,0),n=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("y")],a=new r.Vector3(0,0,t),s=(u.RASDimensions[2]-1)/2,h.setPosition(new r.Vector3(0,0,t-s))}let p,f;this.segmentation||(l.applyMatrix4(u.inverseMatrix).normalize(),c.applyMatrix4(u.inverseMatrix).normalize(),o.applyMatrix4(u.inverseMatrix).normalize()),l.arglet="i",c.arglet="j",p=Math.floor(Math.abs(l.dot(d))),f=Math.floor(Math.abs(c.dot(d)));const m=Math.abs(p*n),g=Math.abs(f*i);a=Math.abs(Math.round(a.applyMatrix4(u.inverseMatrix).dot(o)));const A=[new r.Vector3(1,0,0),new r.Vector3(0,1,0),new r.Vector3(0,0,1)],v=[l,c,o].find((function(e){return Math.abs(e.dot(A[0]))>.9})),y=[l,c,o].find((function(e){return Math.abs(e.dot(A[1]))>.9})),x=[l,c,o].find((function(e){return Math.abs(e.dot(A[2]))>.9}));return{iLength:p,jLength:f,sliceAccess:function(e,t){const n=v===o?a:"i"===v.arglet?e:t,r=y===o?a:"i"===y.arglet?e:t,i=x===o?a:"i"===x.arglet?e:t,s=v.dot(A[0])>0?n:u.xLength-1-n,l=y.dot(A[1])>0?r:u.yLength-1-r,c=x.dot(A[2])>0?i:u.zLength-1-i;return u.access(s,l,c)},matrix:h,planeWidth:m,planeHeight:g}}extractSlice(e,t){const n=new i.VolumeSlice(this,t,e);return this.sliceList.push(n),n}repaintAllSlices(){return this.sliceList.forEach((function(e){e.repaint()})),this}computeMinMax(){let e=1/0,t=-1/0;const n=this.data.length;let r=0;for(r=0;r<n;r++)if(!isNaN(this.data[r])){const n=this.data[r];e=Math.min(e,n),t=Math.max(t,n)}return this.min=e,this.max=t,[e,t]}}},94117:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.VolumeSlice=class{constructor(e,t,n){const i=this;this.volume=e,t=t||0,Object.defineProperty(this,"index",{get:function(){return t},set:function(e){return t=e,i.geometryNeedsUpdate=!0,t}}),this.axis=n||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const s=new r.Texture(this.canvas);s.minFilter=r.LinearFilter,s.wrapS=s.wrapT=r.ClampToEdgeWrapping,"colorSpace"in s?s.colorSpace="srgb":s.encoding=3001;const a=new r.MeshBasicMaterial({map:s,side:r.DoubleSide,transparent:!0});this.mesh=new r.Mesh(this.geometry,a),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,t=this.jLength,n=this.sliceAccess,r=this.volume,i=this.canvasBuffer,s=this.ctxBuffer,a=s.getImageData(0,0,e,t),o=a.data,l=r.data,c=r.upperThreshold,h=r.lowerThreshold,u=r.windowLow,d=r.windowHigh;let p=0;if("label"===r.dataType)for(let f=0;f<t;f++)for(let t=0;t<e;t++){let e=l[n(t,f)];e=e>=this.colorMap.length?e%this.colorMap.length+1:e;const r=this.colorMap[e];o[4*p]=r>>24&255,o[4*p+1]=r>>16&255,o[4*p+2]=r>>8&255,o[4*p+3]=255&r,p++}else for(let f=0;f<t;f++)for(let t=0;t<e;t++){let e=l[n(t,f)],r=255;r=c>=e&&h<=e?r:0,e=Math.floor(255*(e-u)/(d-u)),e=e>255?255:e<0?0:0|e,o[4*p]=e,o[4*p+1]=e,o[4*p+2]=e,o[4*p+3]=r,p++}s.putImageData(a,0,0),this.ctx.drawImage(i,0,0,e,t,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new r.PlaneGeometry(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}},17101:(e,t)=>{"use strict";let n,r;function i(e){const t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n=document.createElement("div");n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0";let r='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';return r=t[e]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),n.innerHTML=r,n}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getErrorMessage=i,t.getWebGL2ErrorMessage=function(){return i(2)},t.getWebGLErrorMessage=function(){return i(1)},t.isWebGL2Available=function(){var e;if(void 0!==r)return r;try{let t;const n=document.createElement("canvas");return r=!(!window.WebGL2RenderingContext||!(t=n.getContext("webgl2"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),r}catch(t){return r=!1}},t.isWebGLAvailable=function(){var e;if(void 0!==n)return n;try{let t;const r=document.createElement("canvas");return n=!(!window.WebGLRenderingContext||!(t=r.getContext("webgl"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),n}catch(t){return n=!1}}},29022:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=1024,o=(e=1)=>{const t=new Float32Array(4096*e*4),n=new s.DataTexture(t,a,4*e,s.RGBAFormat,s.FloatType);return n.wrapS=s.RepeatWrapping,n.wrapT=s.RepeatWrapping,n.magFilter=s.NearestFilter,n.needsUpdate=!0,n},l=(e,t,n=0)=>{const r=Math.floor(1024);t.arcLengthDivisions=r/2,t.updateArcLengths();const i=t.getSpacedPoints(r),s=t.computeFrenetFrames(r,!0);for(let o=0;o<r;o++){const t=Math.floor(o/a),r=o%a;let l=i[o];c(e,r,l.x,l.y,l.z,0+t+4*n),l=s.tangents[o],c(e,r,l.x,l.y,l.z,1+t+4*n),l=s.normals[o],c(e,r,l.x,l.y,l.z,2+t+4*n),l=s.binormals[o],c(e,r,l.x,l.y,l.z,3+t+4*n)}e.needsUpdate=!0},c=(e,t,n,r,i,s)=>{const a=e.image,{data:o}=a,l=4096*s;o[4*t+l+0]=n,o[4*t+l+1]=r,o[4*t+l+2]=i,o[4*t+l+3]=1},h=e=>({spineTexture:{value:e},pathOffset:{type:"f",value:0},pathSegment:{type:"f",value:1},spineOffset:{type:"f",value:161},spineLength:{type:"f",value:400},flow:{type:"i",value:1}});function u(e,t,n=1){e.__ok||(e.__ok=!0,e.onBeforeCompile=e=>{if(e.__modified)return;e.__modified=!0,Object.assign(e.uniforms,t);const r=`\n\t\tuniform sampler2D spineTexture;\n\t\tuniform float pathOffset;\n\t\tuniform float pathSegment;\n\t\tuniform float spineOffset;\n\t\tuniform float spineLength;\n\t\tuniform int flow;\n\n\t\tfloat textureLayers = ${4*n}.;\n\t\tfloat textureStacks = 1.;\n\n\t\t${e.vertexShader}\n\t\t`.replace("#include <beginnormal_vertex>","").replace("#include <defaultnormal_vertex>","").replace("#include <begin_vertex>","").replace(/void\s*main\s*\(\)\s*\{/,"\n void main() {\n #include <beginnormal_vertex>\n\n vec4 worldPos = modelMatrix * vec4(position, 1.);\n\n bool bend = flow > 0;\n float xWeight = bend ? 0. : 1.;\n\n #ifdef USE_INSTANCING\n float pathOffsetFromInstanceMatrix = instanceMatrix[3][2];\n float spineLengthFromInstanceMatrix = instanceMatrix[3][0];\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLengthFromInstanceMatrix : 0.;\n float mt = (spinePortion * pathSegment + pathOffset + pathOffsetFromInstanceMatrix)*textureStacks;\n #else\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLength : 0.;\n float mt = (spinePortion * pathSegment + pathOffset)*textureStacks;\n #endif\n\n mt = mod(mt, textureStacks);\n float rowOffset = floor(mt);\n\n #ifdef USE_INSTANCING\n rowOffset += instanceMatrix[3][1] * 4.;\n #endif\n\n vec3 spinePos = texture2D(spineTexture, vec2(mt, (0. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 a = texture2D(spineTexture, vec2(mt, (1. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 b = texture2D(spineTexture, vec2(mt, (2. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 c = texture2D(spineTexture, vec2(mt, (3. + rowOffset + 0.5) / textureLayers)).xyz;\n mat3 basis = mat3(a, b, c);\n\n vec3 transformed = basis\n * vec3(worldPos.x * xWeight, worldPos.y * 1., worldPos.z * 1.)\n + spinePos;\n\n vec3 transformedNormal = normalMatrix * (basis * objectNormal);\n\t\t\t").replace("#include <project_vertex>","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;");e.vertexShader=r})}class d{constructor(e,t=1){i(this,"curveArray"),i(this,"curveLengthArray"),i(this,"object3D"),i(this,"splineTexure"),i(this,"uniforms");const n=e.clone(),r=o(t),a=h(r);n.traverse((e=>{(e instanceof s.Mesh||e instanceof s.InstancedMesh)&&(e.material=e.material.clone(),u(e.material,a,t))})),this.curveArray=new Array(t),this.curveLengthArray=new Array(t),this.object3D=n,this.splineTexure=r,this.uniforms=a}updateCurve(e,t){if(e>=this.curveArray.length)throw Error("Index out of range for Flow");const n=t.getLength();this.uniforms.spineLength.value=n,this.curveLengthArray[e]=n,this.curveArray[e]=t,l(this.splineTexure,t,e)}moveAlongCurve(e){this.uniforms.pathOffset.value+=e}}const p=new s.Matrix4;t.Flow=d,t.InstancedFlow=class extends d{constructor(e,t,n,r){const a=new s.InstancedMesh(n,r,e);a.instanceMatrix.setUsage(s.DynamicDrawUsage),a.frustumCulled=!1,super(a,t),i(this,"offsets"),i(this,"whichCurve"),this.offsets=new Array(e).fill(0),this.whichCurve=new Array(e).fill(0)}writeChanges(e){p.makeTranslation(this.curveLengthArray[this.whichCurve[e]],this.whichCurve[e],this.offsets[e]),this.object3D.setMatrixAt(e,p),this.object3D.instanceMatrix.needsUpdate=!0}moveIndividualAlongCurve(e,t){this.offsets[e]+=t,this.writeChanges(e)}setCurve(e,t){if(isNaN(t))throw Error("curve index being set is Not a Number (NaN)");this.whichCurve[e]=t,this.writeChanges(e)}},t.getUniforms=h,t.initSplineTexture=o,t.modifyShader=u,t.updateSplineTexture=l},80101:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(66552);t.EdgeSplitModifier=class{constructor(){i(this,"A",new s.Vector3),i(this,"B",new s.Vector3),i(this,"C",new s.Vector3),i(this,"positions",[]),i(this,"normals",new Float32Array),i(this,"indexes",[]),i(this,"pointToIndexMap",[]),i(this,"splitIndexes",[]),i(this,"oldNormals",[]),i(this,"computeNormals",(()=>{this.normals=new Float32Array(3*this.indexes.length);for(let e=0;e<this.indexes.length;e+=3){let t=this.indexes[e];this.A.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),t=this.indexes[e+1],this.B.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),t=this.indexes[e+2],this.C.set(this.positions[3*t],this.positions[3*t+1],this.positions[3*t+2]),this.C.sub(this.B),this.A.sub(this.B);const n=this.C.cross(this.A).normalize();for(let r=0;r<3;r++)this.normals[3*(e+r)]=n.x,this.normals[3*(e+r)+1]=n.y,this.normals[3*(e+r)+2]=n.z}})),i(this,"mapPositionsToIndexes",(()=>{this.pointToIndexMap=Array(this.positions.length/3);for(let e=0;e<this.indexes.length;e++){const t=this.indexes[e];null==this.pointToIndexMap[t]&&(this.pointToIndexMap[t]=[]),this.pointToIndexMap[t].push(e)}})),i(this,"edgeSplitToGroups",((e,t,n)=>{this.A.set(this.normals[3*n],this.normals[3*n+1],this.normals[3*n+2]).normalize();const r={splitGroup:[],currentGroup:[n]};for(let i of e)i!==n&&(this.B.set(this.normals[3*i],this.normals[3*i+1],this.normals[3*i+2]).normalize(),this.B.dot(this.A)<t?r.splitGroup.push(i):r.currentGroup.push(i));return r})),i(this,"edgeSplit",((e,t,n=null)=>{if(0===e.length)return;const r=[];for(let s of e)r.push(this.edgeSplitToGroups(e,t,s));let i=r[0];for(let s of r)s.currentGroup.length>i.currentGroup.length&&(i=s);null!=n&&this.splitIndexes.push({original:n,indexes:i.currentGroup}),i.splitGroup.length&&this.edgeSplit(i.splitGroup,t,n||i.currentGroup[0])})),i(this,"modify",((e,t,n=!0)=>{let r=!1;if(e.attributes.normal&&(r=!0,e=e.clone(),!0===n&&null!==e.index&&(this.oldNormals=e.attributes.normal.array),e.deleteAttribute("normal")),null==e.index){if(void 0===a)throw"THREE.EdgeSplitModifier relies on BufferGeometryUtils";e=a.mergeVertices(e)}this.indexes=e.index.array,this.positions=e.getAttribute("position").array,this.computeNormals(),this.mapPositionsToIndexes(),this.splitIndexes=[];for(let s of this.pointToIndexMap)this.edgeSplit(s,Math.cos(t)-.001);const i={};for(let a of Object.keys(e.attributes)){const t=e.attributes[a],n=new t.array.constructor((this.indexes.length+this.splitIndexes.length)*t.itemSize);n.set(t.array),i[a]=new s.BufferAttribute(n,t.itemSize,t.normalized)}const o=new Uint32Array(this.indexes.length);o.set(this.indexes);for(let s=0;s<this.splitIndexes.length;s++){const e=this.splitIndexes[s],t=this.indexes[e.original];for(let n of Object.values(i))for(let e=0;e<n.itemSize;e++)n.array[(this.indexes.length+s)*n.itemSize+e]=n.array[t*n.itemSize+e];for(let n of e.indexes)o[n]=this.indexes.length+s}(e=new s.BufferGeometry).setIndex(new s.BufferAttribute(o,1));for(let s of Object.keys(i))e.setAttribute(s,i[s]);if(r&&(e.computeVertexNormals(),null!==this.oldNormals)){const t=new Array(this.oldNormals.length/3).fill(!1);for(let e of this.splitIndexes)t[e.original]=!0;for(let n=0;n<t.length;n++)if(!1===t[n])for(let t=0;t<3;t++)e.attributes.normal.array[3*n+t]=this.oldNormals[3*n+t]}return e}))}}},25386:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(66552),o=new s.Vector3,l=new s.Vector3;function c(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class h{constructor(e,t){i(this,"position"),i(this,"id"),i(this,"faces"),i(this,"neighbors"),i(this,"collapseCost"),i(this,"collapseNeighbor"),i(this,"minCost",0),i(this,"totalCost",0),i(this,"costCount",0),this.position=e,this.id=t,this.faces=[],this.neighbors=[],this.collapseCost=0,this.collapseNeighbor=null}addUniqueNeighbor(e){var t,n;t=this.neighbors,n=e,-1===t.indexOf(n)&&t.push(n)}removeIfNonNeighbor(e){const t=this.neighbors,n=this.faces,r=t.indexOf(e);if(-1!==r){for(let t=0;t<n.length;t++)if(n[t].hasVertex(e))return;t.splice(r,1)}}}class u{constructor(e,t,n,r,a,o){i(this,"a"),i(this,"b"),i(this,"c"),i(this,"v1"),i(this,"v2"),i(this,"v3"),i(this,"normal",new s.Vector3),this.a=r,this.b=a,this.c=o,this.v1=e,this.v2=t,this.v3=n,this.computeNormal(),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(n),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(n),n.faces.push(this),n.addUniqueNeighbor(e),n.addUniqueNeighbor(t)}computeNormal(){const e=this.v1.position,t=this.v2.position,n=this.v3.position;o.subVectors(n,t),l.subVectors(e,t),o.cross(l).normalize(),this.normal.copy(o)}hasVertex(e){return e===this.v1||e===this.v2||e===this.v3}replaceVertex(e,t){e===this.v1?this.v1=t:e===this.v2?this.v2=t:e===this.v3&&(this.v3=t),c(e.faces,this),t.faces.push(this),e.removeIfNonNeighbor(this.v1),this.v1.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v2),this.v2.removeIfNonNeighbor(e),e.removeIfNonNeighbor(this.v3),this.v3.removeIfNonNeighbor(e),this.v1.addUniqueNeighbor(this.v2),this.v1.addUniqueNeighbor(this.v3),this.v2.addUniqueNeighbor(this.v1),this.v2.addUniqueNeighbor(this.v3),this.v3.addUniqueNeighbor(this.v1),this.v3.addUniqueNeighbor(this.v2),this.computeNormal()}}t.SimplifyModifier=class{constructor(){i(this,"computeEdgeCollapseCost",((e,t)=>{const n=t.position.distanceTo(e.position);let r=0;const i=[];let s,a,o,l=e.faces.length;for(s=0;s<l;s++)a=e.faces[s],a.hasVertex(t)&&i.push(a);for(s=0;s<l;s++){let t=1;a=e.faces[s];for(let e=0;e<i.length;e++){o=i[e];const n=a.normal.dot(o.normal);t=Math.min(t,(1.001-n)/2)}r=Math.max(r,t)}i.length<2&&(r=1);return n*r+0})),i(this,"computeEdgeCostAtVertex",(e=>{if(0===e.neighbors.length)return e.collapseNeighbor=null,void(e.collapseCost=-.01);e.collapseCost=1e5,e.collapseNeighbor=null;for(let t=0;t<e.neighbors.length;t++){const n=this.computeEdgeCollapseCost(e,e.neighbors[t]);e.collapseNeighbor||(e.collapseNeighbor=e.neighbors[t],e.collapseCost=n,e.minCost=n,e.totalCost=0,e.costCount=0),e.costCount++,e.totalCost+=n,n<e.minCost&&(e.collapseNeighbor=e.neighbors[t],e.minCost=n)}e.collapseCost=e.totalCost/e.costCount})),i(this,"removeFace",((e,t)=>{c(t,e),e.v1&&c(e.v1.faces,e),e.v2&&c(e.v2.faces,e),e.v3&&c(e.v3.faces,e);const n=[e.v1,e.v2,e.v3];let r,i;for(let s=0;s<3;s++)r=n[s],i=n[(s+1)%3],r&&i&&(r.removeIfNonNeighbor(i),i.removeIfNonNeighbor(r))})),i(this,"collapse",((e,t,n,r)=>{if(!r)return void this.removeVertex(n,e);let i;const s=[];for(i=0;i<n.neighbors.length;i++)s.push(n.neighbors[i]);for(i=n.faces.length-1;i>=0;i--)n.faces[i].hasVertex(r)&&this.removeFace(n.faces[i],t);for(i=n.faces.length-1;i>=0;i--)n.faces[i].replaceVertex(n,r);for(this.removeVertex(n,e),i=0;i<s.length;i++)this.computeEdgeCostAtVertex(s[i])})),i(this,"minimumCostEdge",(e=>{let t=e[0];for(let n=0;n<e.length;n++)e[n].collapseCost<t.collapseCost&&(t=e[n]);return t})),i(this,"modify",((e,t)=>{const n=(e=e.clone()).attributes;for(let s in n)"position"!==s&&e.deleteAttribute(s);const r=[],i=[],o=(e=a.mergeVertices(e)).getAttribute("position");for(let a=0;a<o.count;a++){const e=(new s.Vector3).fromBufferAttribute(o,a),t=new h(e,a);r.push(t)}const l=e.getIndex();if(null!==l)for(let s=0;s<l.count;s+=3){const e=l.getX(s),t=l.getX(s+1),n=l.getX(s+2),a=new u(r[e],r[t],r[n],e,t,n);i.push(a)}else for(let s=0;s<o.count;s+=3){const e=s,t=s+1,n=s+2,a=new u(r[e],r[t],r[n],e,t,n);i.push(a)}for(let s=0,a=r.length;s<a;s++)this.computeEdgeCostAtVertex(r[s]);let c,d=t;for(;d--;){if(c=this.minimumCostEdge(r),!c){console.log("THREE.SimplifyModifier: No next vertex");break}this.collapse(r,i,c,c.collapseNeighbor)}const p=new s.BufferGeometry,f=[];let m=[];for(let s=0;s<r.length;s++){const e=r[s].position;f.push(e.x,e.y,e.z)}for(let s=0;s<i.length;s++){const e=i[s],t=r.indexOf(e.v1),n=r.indexOf(e.v2),a=r.indexOf(e.v3);m.push(t,n,a)}return p.setAttribute("position",new s.Float32BufferAttribute(f,3)),p.setIndex(m),p}))}removeVertex(e,t){for(console.assert(0===e.faces.length);e.neighbors.length;){c(e.neighbors.pop().neighbors,e)}c(t,e)}}},80466:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);t.TessellateModifier=class{constructor(e=.1,t=6){i(this,"maxEdgeLength"),i(this,"maxIterations"),i(this,"modify",(e=>{null!==e.index&&(e=e.toNonIndexed());const t=this.maxIterations,n=this.maxEdgeLength*this.maxEdgeLength,r=new s.Vector3,i=new s.Vector3,a=new s.Vector3,o=new s.Vector3,l=[r,i,a,o],c=new s.Vector3,h=new s.Vector3,u=new s.Vector3,d=new s.Vector3,p=[c,h,u,d],f=new s.Color,m=new s.Color,g=new s.Color,A=new s.Color,v=[f,m,g,A],y=new s.Vector2,x=new s.Vector2,b=new s.Vector2,E=new s.Vector2,_=[y,x,b,E],S=new s.Vector2,w=new s.Vector2,M=new s.Vector2,C=new s.Vector2,T=[S,w,M,C],I=e.attributes,B=void 0!==I.normal,R=void 0!==I.color,P=void 0!==I.uv,D=void 0!==I.uv2;let L=I.position.array,F=B?I.normal.array:null,U=R?I.color.array:null,O=P?I.uv.array:null,N=D?I.uv2.array:null,k=L,G=F,z=U,Q=O,V=N,H=0,j=!0;function W(e,t,n){const r=l[e],i=l[t],s=l[n];if(k.push(r.x,r.y,r.z),k.push(i.x,i.y,i.z),k.push(s.x,s.y,s.z),B){const r=p[e],i=p[t],s=p[n];G.push(r.x,r.y,r.z),G.push(i.x,i.y,i.z),G.push(s.x,s.y,s.z)}if(R){const r=v[e],i=v[t],s=v[n];z.push(r.r,r.g,r.b),z.push(i.r,i.g,i.b),z.push(s.r,s.g,s.b)}if(P){const r=_[e],i=_[t],s=_[n];Q.push(r.x,r.y),Q.push(i.x,i.y),Q.push(s.x,s.y)}if(D){const r=T[e],i=T[t],s=T[n];V.push(r.x,r.y),V.push(i.x,i.y),V.push(s.x,s.y)}}for(;j&&H<t;){H++,j=!1,L=k,k=[],B&&(F=G,G=[]),R&&(U=z,z=[]),P&&(O=Q,Q=[]),D&&(N=V,V=[]);for(let e=0,t=0,s=L.length;e<s;e+=9,t+=6){r.fromArray(L,e+0),i.fromArray(L,e+3),a.fromArray(L,e+6),B&&F&&(c.fromArray(F,e+0),h.fromArray(F,e+3),u.fromArray(F,e+6)),R&&U&&(f.fromArray(U,e+0),m.fromArray(U,e+3),g.fromArray(U,e+6)),P&&O&&(y.fromArray(O,t+0),x.fromArray(O,t+2),b.fromArray(O,t+4)),D&&N&&(S.fromArray(N,t+0),w.fromArray(N,t+2),M.fromArray(N,t+4));const s=r.distanceToSquared(i),l=i.distanceToSquared(a),p=r.distanceToSquared(a);s>n||l>n||p>n?(j=!0,s>=l&&s>=p?(o.lerpVectors(r,i,.5),B&&d.lerpVectors(c,h,.5),R&&A.lerpColors(f,m,.5),P&&E.lerpVectors(y,x,.5),D&&C.lerpVectors(S,w,.5),W(0,3,2),W(3,1,2)):l>=s&&l>=p?(o.lerpVectors(i,a,.5),B&&d.lerpVectors(h,u,.5),R&&A.lerpColors(m,g,.5),P&&E.lerpVectors(x,b,.5),D&&C.lerpVectors(w,M,.5),W(0,1,3),W(3,2,0)):(o.lerpVectors(r,a,.5),B&&d.lerpVectors(c,u,.5),R&&A.lerpColors(f,g,.5),P&&E.lerpVectors(y,b,.5),D&&C.lerpVectors(S,M,.5),W(0,1,3),W(3,1,2))):W(0,1,2)}}const X=new s.BufferGeometry;return X.setAttribute("position",new s.Float32BufferAttribute(k,3)),B&&X.setAttribute("normal",new s.Float32BufferAttribute(G,3)),R&&X.setAttribute("color",new s.Float32BufferAttribute(z,3)),P&&X.setAttribute("uv",new s.Float32BufferAttribute(Q,2)),D&&X.setAttribute("uv2",new s.Float32BufferAttribute(V,2)),X})),this.maxEdgeLength=e,this.maxIterations=t}}},89930:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a="_batch_id_",o=new s.Matrix4,l=(new s.Matrix4).set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),c=`\n#ifdef BATCHING\n\tattribute float ${a};\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\n\t}\n#endif\n`,h=`\n#ifdef BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( ${a} );\n#endif\n`;function u(e,t,n=0){const r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let s=0;s<i;s++)for(let i=0;i<r;i++)t.setComponent(s+n,i,e.getComponent(s,i))}else t.array.set(e.array,n*r);t.needsUpdate=!0}class d extends s.Mesh{constructor(e,t,n=2*t,r){super(new s.BufferGeometry,r),i(this,"_vertexStarts"),i(this,"_vertexCounts"),i(this,"_indexStarts"),i(this,"_indexCounts"),i(this,"_reservedRanges"),i(this,"_visible"),i(this,"_active"),i(this,"_maxGeometryCount"),i(this,"_maxVertexCount"),i(this,"_maxIndexCount"),i(this,"_geometryInitialized"),i(this,"_geometryCount"),i(this,"_matrices"),i(this,"_matricesTexture"),i(this,"_customUniforms"),this._vertexStarts=[],this._vertexCounts=[],this._indexStarts=[],this._indexCounts=[],this._reservedRanges=[],this._visible=[],this._active=[],this._maxGeometryCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._geometryInitialized=!1,this._geometryCount=0,this._matrices=[],this._matricesTexture=null,this.frustumCulled=!1,this._customUniforms={batchingTexture:{value:null}},this._initMatricesTexture(),this._initShader(),this.onBeforeRender=function(){this.material.defines&&(this.material.defines.BATCHING=!0)},this.onAfterRender=function(){this.material.defines&&(this.material.defines.BATCHING=!1)}}_initMatricesTexture(){let e=Math.sqrt(4*this._maxGeometryCount);e=s.MathUtils.ceilPowerOfTwo(e),e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new s.DataTexture(t,e,e,s.RGBAFormat,s.FloatType);this._matricesTexture=n,this._customUniforms.batchingTexture.value=this._matricesTexture}_initShader(){const e=this.material,t=e.onBeforeCompile,n=this._customUniforms;e.onBeforeCompile=function(e,r){e.vertexShader=e.vertexShader.replace("#include <skinning_pars_vertex>","#include <skinning_pars_vertex>\n"+c).replace("#include <uv_vertex>","#include <uv_vertex>\n"+h).replace("#include <skinnormal_vertex>","#include <skinnormal_vertex>\n\n#ifdef BATCHING\n\tobjectNormal = vec4( batchingMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( batchingMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif\n").replace("#include <skinning_vertex>","#include <skinning_vertex>\n\n#ifdef BATCHING\n\ttransformed = ( batchingMatrix * vec4( transformed, 1.0 ) ).xyz;\n#endif\n");for(const t in n)e.uniforms[t]=n[t];t.call(this,e,r)},e.defines=e.defines||{},e.defines.BATCHING=!1}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxGeometryCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(const r in e.attributes){const i=e.getAttribute(r),{array:s,itemSize:a,normalized:o}=i,l=new s.constructor(n*a),c=new i.constructor(l,a,o);c.setUsage(i.usage),t.setAttribute(r,c)}if(null!==e.getIndex()){const e=n>65536?new Uint32Array(i):new Uint16Array(i);t.setIndex(new s.BufferAttribute(e,1))}const o=r>65536?new Uint32Array(n):new Uint16Array(n);t.setAttribute(a,new s.BufferAttribute(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(a))throw new Error(`BatchedMesh: Geometry cannot use attribute "${a}"`);const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(n===a)continue;if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}getGeometryCount(){return this._geometryCount}getVertexCount(){const e=this._reservedRanges;if(0===e.length)return 0;{const t=e[e.length-1];return t.vertexStart+t.vertexCount}}getIndexCount(){const e=this._reservedRanges;if(null===this.geometry.getIndex()||0===e.length)return 0;{const t=e[e.length-1];return t.indexStart+t.indexCount}}addGeometry(e,t=-1,n=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const l=this._reservedRanges;if(0!==this._geometryCount&&(i=l[l.length-1]),r.vertexCount=-1===t?e.getAttribute("position").count:t,r.vertexStart=null===i?0:i.vertexStart+i.vertexCount,null!==e.getIndex()&&(r.indexCount=-1===n?e.getIndex().count:n,r.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==r.indexStart&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const c=this._indexCounts,h=this._indexStarts,u=this._vertexCounts,d=this._vertexStarts,p=this._visible,f=this._active,m=this._matricesTexture,g=this._matrices,A=this._matricesTexture.image.data;p.push(!0),f.push(!0);const v=this._geometryCount;this._geometryCount++,g.push(new s.Matrix4),o.toArray(A,16*v),m.needsUpdate=!0,l.push(r),d.push(r.vertexStart),u.push(r.vertexCount),null!==e.getIndex()&&(h.push(r.indexCount),c.push(r.indexCount));const y=this.geometry.getAttribute(a);for(let s=0;s<r.vertexCount;s++)y.setX(r.vertexStart+s,v);return y.needsUpdate=!0,this.setGeometryAt(v,e),v}applyGeometry(e){return this.addGeometry(e)}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this._reservedRanges[e];if(null!==t.getIndex()&&t.getIndex().count>n.indexCount||t.attributes.position.count>n.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const r=this.geometry,i=t.getAttribute("position"),s=null!==r.getIndex(),o=r.getIndex(),l=t.getIndex(),c=n.vertexStart,h=n.vertexCount;for(const d in r.attributes){if(d===a)continue;const e=t.getAttribute(d),n=r.getAttribute(d);u(e,n,c);const i=e.itemSize;for(let t=e.count,r=h;t<r;t++){const e=c+t;for(let t=0;t<i;t++)n.setComponent(e,t,0)}n.needsUpdate=!0}if(this._vertexCounts[e]=i.count,s){const t=n.indexStart;for(let e=0;e<l.count;e++)o.setX(t+e,c+l.getX(e));for(let e=l.count,r=n.indexCount;e<r;e++)o.setX(t+e,c);o.needsUpdate=!0,this._indexCounts[e]=l.count}return e}deleteGeometry(e){const t=this._active,n=this._matricesTexture,r=n.image.data;return e>=t.length||!1===t[e]||(t[e]=!1,l.toArray(r,16*e),n.needsUpdate=!0),this}optimize(){throw new Error("BatchedMesh: Optimize function not implemented.")}setMatrixAt(e,t){const n=this._visible,r=this._active,i=this._matricesTexture,s=this._matrices,a=i.image.data;return e>=s.length||!1===r[e]||(!0===n[e]&&(t.toArray(a,16*e),i.needsUpdate=!0),s[e].copy(t)),this}getMatrixAt(e,t){const n=this._matrices,r=this._active;return e>=n.length||!1===r[e]?t:t.copy(n[e])}setVisibleAt(e,t){const n=this._visible,r=this._active,i=this._matricesTexture,s=this._matrices,a=i.image.data;return e>=n.length||!1===r[e]||n[e]===t||(!0===t?s[e].toArray(a,16*e):l.toArray(a,16*e),i.needsUpdate=!0,n[e]=t),this}getVisibleAt(e){const t=this._visible,n=this._active;return!(e>=t.length||!1===n[e])&&t[e]}raycast(){console.warn("BatchedMesh: Raycast function not implemented.")}copy(){throw new Error("BatchedMesh: Copy function not implemented.")}toJSON(){throw new Error("BatchedMesh: toJSON function not implemented.")}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}}t.BatchedMesh=d},29888:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t){var n,i;const s=(a=e)&&a.isCubeTexture;var a;const o=(null!=(i=s?null==(n=e.image[0])?void 0:n.width:e.image.width)?i:1024)/4,l=Math.floor(Math.log2(o)),c=Math.pow(2,l),h=[s?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH "+1/(3*Math.max(c,112)),"#define CUBEUV_TEXEL_HEIGHT "+1/(4*c),`#define CUBEUV_MAX_MIP ${l}.0`].join("\n")+`\n #define ENVMAP_TYPE_CUBE_UV\n varying vec3 vWorldPosition;\n uniform float radius;\n uniform float height;\n uniform float angle;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube map;\n #else\n uniform sampler2D map;\n #endif\n // From: https://www.shadertoy.com/view/4tsBD7\n float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n {\n float d = dot ( rd, n );\n \n if( d > 0.0 ) { return 1e6; }\n \n vec3 o = ro - c;\n float t = - dot( n, o ) / d;\n vec3 q = o + rd * t;\n \n return ( dot( q, q ) < r * r ) ? t : 1e6;\n }\n // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n {\n vec3 oc = ro - ce;\n float b = dot( oc, rd );\n float c = dot( oc, oc ) - ra * ra;\n float h = b * b - c;\n \n if( h < 0.0 ) { return -1.0; }\n \n h = sqrt( h );\n \n return - b + h;\n }\n vec3 project() \n {\n vec3 p = normalize( vWorldPosition );\n vec3 camPos = cameraPosition;\n camPos.y -= height;\n float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n if( intersection > 0.0 ) {\n \n vec3 h = vec3( 0.0, - height, 0.0 );\n float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n } else {\n p = vec3( 0.0, 1.0, 0.0 );\n }\n return p;\n }\n #include <common>\n #include <cube_uv_reflection_fragment>\n void main() \n {\n vec3 projectedWorldPosition = project();\n \n #ifdef ENVMAP_TYPE_CUBE\n vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n #else\n vec3 direction = normalize( projectedWorldPosition );\n vec2 uv = equirectUv( direction );\n vec3 outcolor = texture2D( map, uv ).rgb;\n #endif\n gl_FragColor = vec4( outcolor, 1.0 );\n #include <tonemapping_fragment>\n #include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n }\n `,u={map:{value:e},height:{value:(null==t?void 0:t.height)||15},radius:{value:(null==t?void 0:t.radius)||100}};super(new r.IcosahedronGeometry(1,16),new r.ShaderMaterial({uniforms:u,fragmentShader:h,vertexShader:"\n varying vec3 vWorldPosition;\n void main() \n {\n vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n vWorldPosition = worldPosition.xyz;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",side:r.DoubleSide}))}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}t.GroundProjectedEnv=i},17564:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=new s.BufferGeometry,o=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),l=new s.InterleavedBuffer(o,5);a.setIndex([0,1,2,0,2,3]),a.setAttribute("position",new s.InterleavedBufferAttribute(l,3,0,!1)),a.setAttribute("uv",new s.InterleavedBufferAttribute(l,2,3,!1));const c=class extends s.Mesh{constructor(){super(c.Geometry,new s.MeshBasicMaterial({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const e=new s.Vector3,t=new s.Vector3,n=new s.DataTexture(new Uint8Array(768),16,16,s.RGBAFormat);n.minFilter=s.NearestFilter,n.magFilter=s.NearestFilter,n.wrapS=s.ClampToEdgeWrapping,n.wrapT=s.ClampToEdgeWrapping;const r=new s.DataTexture(new Uint8Array(768),16,16,s.RGBAFormat);r.minFilter=s.NearestFilter,r.magFilter=s.NearestFilter,r.wrapS=s.ClampToEdgeWrapping,r.wrapT=s.ClampToEdgeWrapping;const i=c.Geometry,a=new s.RawShaderMaterial({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );\n\n\t\t\t\t}",depthTest:!0,depthWrite:!1,transparent:!1}),o=new s.RawShaderMaterial({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\t\t\t\tattribute vec2 uv;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUV = uv;\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUV );\n\n\t\t\t\t}",depthTest:!1,depthWrite:!1,transparent:!1}),l=new s.Mesh(i,a),h=[],d=u.Shader,p=new s.RawShaderMaterial({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new s.Color(16777215)},scale:{value:new s.Vector2},screenPosition:{value:new s.Vector3}},vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.AdditiveBlending,transparent:!0,depthWrite:!1}),f=new s.Mesh(i,p);this.addElement=function(e){h.push(e)};const m=new s.Vector2,g=new s.Vector2,A=new s.Box2,v=new s.Vector4;this.onBeforeRender=function(s,c,u){s.getCurrentViewport(v);const d=v.w/v.z,y=v.z/2,x=v.w/2;let b=16/v.w;if(m.set(b*d,b),A.min.set(v.x,v.y),A.max.set(v.x+(v.z-16),v.y+(v.w-16)),t.setFromMatrixPosition(this.matrixWorld),t.applyMatrix4(u.matrixWorldInverse),!(t.z>0)&&(e.copy(t).applyMatrix4(u.projectionMatrix),g.x=v.x+e.x*y+y-8,g.y=v.y+e.y*x+x-8,A.containsPoint(g))){s.copyFramebufferToTexture(g,n);let t=a.uniforms;t.scale.value=m,t.screenPosition.value=e,s.renderBufferDirect(u,null,i,a,l,null),s.copyFramebufferToTexture(g,r),t=o.uniforms,t.scale.value=m,t.screenPosition.value=e,s.renderBufferDirect(u,null,i,o,l,null);const c=2*-e.x,d=2*-e.y;for(let n=0,r=h.length;n<r;n++){const t=h[n],r=p.uniforms;r.color.value.copy(t.color),r.map.value=t.texture,r.screenPosition.value.x=e.x+c*t.distance,r.screenPosition.value.y=e.y+d*t.distance,b=t.size/v.w;const a=v.w/v.z;r.scale.value.set(b*a,b),p.uniformsNeedUpdate=!0,s.renderBufferDirect(u,null,i,p,f,null)}}},this.dispose=function(){a.dispose(),o.dispose(),p.dispose(),n.dispose(),r.dispose();for(let e=0,t=h.length;e<t;e++)h[e].texture.dispose()}}};let h=c;i(h,"Geometry",a);class u{constructor(e,t=1,n=0,r=new s.Color(16777215)){this.texture=e,this.size=t,this.distance=n,this.color=r}}i(u,"Shader",{uniforms:{map:{value:null},occlusionMap:{value:null},color:{value:null},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform vec3 screenPosition;\n\t\tuniform vec2 scale;\n\n\t\tuniform sampler2D occlusionMap;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvUV = uv;\n\n\t\t\tvec2 pos = position.xy;\n\n\t\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\n\n\t\t\tvVisibility = visibility.r / 9.0;\n\t\t\tvVisibility *= 1.0 - visibility.g / 9.0;\n\t\t\tvVisibility *= visibility.b / 9.0;\n\n\t\t\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform sampler2D map;\n\t\tuniform vec3 color;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texture = texture2D( map, vUV );\n\t\t\ttexture.a *= vVisibility;\n\t\t\tgl_FragColor = texture;\n\t\t\tgl_FragColor.rgb *= color;\n\n\t\t}"}),t.Lensflare=h,t.LensflareElement=u},8294:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(42095);class s extends r.Object3D{constructor(e={}){super(),this.isLightningStorm=!0,this.stormParams=e,e.size=void 0!==e.size?e.size:1e3,e.minHeight=void 0!==e.minHeight?e.minHeight:80,e.maxHeight=void 0!==e.maxHeight?e.maxHeight:100,e.maxSlope=void 0!==e.maxSlope?e.maxSlope:1.1,e.maxLightnings=void 0!==e.maxLightnings?e.maxLightnings:3,e.lightningMinPeriod=void 0!==e.lightningMinPeriod?e.lightningMinPeriod:3,e.lightningMaxPeriod=void 0!==e.lightningMaxPeriod?e.lightningMaxPeriod:7,e.lightningMinDuration=void 0!==e.lightningMinDuration?e.lightningMinDuration:1,e.lightningMaxDuration=void 0!==e.lightningMaxDuration?e.lightningMaxDuration:2.5,this.lightningParameters=i.LightningStrike.copyParameters(e.lightningParameters,e.lightningParameters),this.lightningParameters.isEternal=!1,this.lightningMaterial=void 0!==e.lightningMaterial?e.lightningMaterial:new r.MeshBasicMaterial({color:11599871}),void 0!==e.onRayPosition?this.onRayPosition=e.onRayPosition:this.onRayPosition=function(t,n){n.set((Math.random()-.5)*e.size,0,(Math.random()-.5)*e.size);const i=r.MathUtils.lerp(e.minHeight,e.maxHeight,Math.random());t.set(e.maxSlope*(2*Math.random()-1),1,e.maxSlope*(2*Math.random()-1)).multiplyScalar(i).add(n)},this.onLightningDown=e.onLightningDown,this.inited=!1,this.nextLightningTime=0,this.lightningsMeshes=[],this.deadLightningsMeshes=[];for(let t=0;t<this.stormParams.maxLightnings;t++){const e=new i.LightningStrike(i.LightningStrike.copyParameters({},this.lightningParameters)),t=new r.Mesh(e,this.lightningMaterial);this.deadLightningsMeshes.push(t)}}update(e){if(this.inited||(this.nextLightningTime=this.getNextLightningTime(e)*Math.random(),this.inited=!0),e>=this.nextLightningTime){const t=this.deadLightningsMeshes.pop();if(t){const n=i.LightningStrike.copyParameters(t.geometry.rayParameters,this.lightningParameters);n.birthTime=e,n.deathTime=e+r.MathUtils.lerp(this.stormParams.lightningMinDuration,this.stormParams.lightningMaxDuration,Math.random()),this.onRayPosition(n.sourceOffset,n.destOffset),n.noiseSeed=Math.random(),this.add(t),this.lightningsMeshes.push(t)}this.nextLightningTime=this.getNextLightningTime(e)}let t=0,n=this.lightningsMeshes.length;for(;t<n;){const r=this.lightningsMeshes[t],s=r.geometry,a=s.state;s.update(e),a===i.LightningStrike.RAY_PROPAGATING&&s.state>a&&this.onLightningDown&&this.onLightningDown(s),s.state===i.LightningStrike.RAY_EXTINGUISHED?(this.lightningsMeshes.splice(this.lightningsMeshes.indexOf(r),1),this.deadLightningsMeshes.push(r),this.remove(r),n--):t++}}getNextLightningTime(e){return e+r.MathUtils.lerp(this.stormParams.lightningMinPeriod,this.stormParams.lightningMaxPeriod,Math.random())/(this.stormParams.maxLightnings+1)}copy(e,t){return super.copy(e,t),this.stormParams.size=e.stormParams.size,this.stormParams.minHeight=e.stormParams.minHeight,this.stormParams.maxHeight=e.stormParams.maxHeight,this.stormParams.maxSlope=e.stormParams.maxSlope,this.stormParams.maxLightnings=e.stormParams.maxLightnings,this.stormParams.lightningMinPeriod=e.stormParams.lightningMinPeriod,this.stormParams.lightningMaxPeriod=e.stormParams.lightningMaxPeriod,this.stormParams.lightningMinDuration=e.stormParams.lightningMinDuration,this.stormParams.lightningMaxDuration=e.stormParams.lightningMaxDuration,this.lightningParameters=i.LightningStrike.copyParameters({},e.lightningParameters),this.lightningMaterial=e.stormParams.lightningMaterial,this.onLightningDown=e.onLightningDown,this}clone(){return new this.constructor(this.stormParams).copy(this)}}t.LightningStorm=s},14514:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t,n=!1,i=!1,o=1e4){const l=new r.BufferGeometry;super(l,t),this.isMarchingCubes=!0;const c=this,h=new Float32Array(36),u=new Float32Array(36),d=new Float32Array(36);function p(e,t,n){return e+(t-e)*n}function f(e,t,n,r,i,s,a,o,l,f){const m=(n-a)/(o-a),g=c.normal_cache;h[t+0]=r+m*c.delta,h[t+1]=i,h[t+2]=s,u[t+0]=p(g[e+0],g[e+3],m),u[t+1]=p(g[e+1],g[e+4],m),u[t+2]=p(g[e+2],g[e+5],m),d[t+0]=p(c.palette[3*l+0],c.palette[3*f+0],m),d[t+1]=p(c.palette[3*l+1],c.palette[3*f+1],m),d[t+2]=p(c.palette[3*l+2],c.palette[3*f+2],m)}function m(e,t,n,r,i,s,a,o,l,f){const m=(n-a)/(o-a),g=c.normal_cache;h[t+0]=r,h[t+1]=i+m*c.delta,h[t+2]=s;const A=e+3*c.yd;u[t+0]=p(g[e+0],g[A+0],m),u[t+1]=p(g[e+1],g[A+1],m),u[t+2]=p(g[e+2],g[A+2],m),d[t+0]=p(c.palette[3*l+0],c.palette[3*f+0],m),d[t+1]=p(c.palette[3*l+1],c.palette[3*f+1],m),d[t+2]=p(c.palette[3*l+2],c.palette[3*f+2],m)}function g(e,t,n,r,i,s,a,o,l,f){const m=(n-a)/(o-a),g=c.normal_cache;h[t+0]=r,h[t+1]=i,h[t+2]=s+m*c.delta;const A=e+3*c.zd;u[t+0]=p(g[e+0],g[A+0],m),u[t+1]=p(g[e+1],g[A+1],m),u[t+2]=p(g[e+2],g[A+2],m),d[t+0]=p(c.palette[3*l+0],c.palette[3*f+0],m),d[t+1]=p(c.palette[3*l+1],c.palette[3*f+1],m),d[t+2]=p(c.palette[3*l+2],c.palette[3*f+2],m)}function A(e){const t=3*e;0===c.normal_cache[t]&&(c.normal_cache[t+0]=c.field[e-1]-c.field[e+1],c.normal_cache[t+1]=c.field[e-c.yd]-c.field[e+c.yd],c.normal_cache[t+2]=c.field[e-c.zd]-c.field[e+c.zd])}function v(e,t,n,r,i){const o=r+1,l=r+c.yd,p=r+c.zd,v=o+c.yd,x=o+c.zd,b=r+c.yd+c.zd,E=o+c.yd+c.zd;let _=0;const S=c.field[r],w=c.field[o],M=c.field[l],C=c.field[v],T=c.field[p],I=c.field[x],B=c.field[b],R=c.field[E];S<i&&(_|=1),w<i&&(_|=2),M<i&&(_|=8),C<i&&(_|=4),T<i&&(_|=16),I<i&&(_|=32),B<i&&(_|=128),R<i&&(_|=64);const P=s[_];if(0===P)return 0;const D=c.delta,L=e+D,F=t+D,U=n+D;1&P&&(A(r),A(o),f(3*r,0,i,e,t,n,S,w,r,o)),2&P&&(A(o),A(v),m(3*o,3,i,L,t,n,w,C,o,v)),4&P&&(A(l),A(v),f(3*l,6,i,e,F,n,M,C,l,v)),8&P&&(A(r),A(l),m(3*r,9,i,e,t,n,S,M,r,l)),16&P&&(A(p),A(x),f(3*p,12,i,e,t,U,T,I,p,x)),32&P&&(A(x),A(E),m(3*x,15,i,L,t,U,I,R,x,E)),64&P&&(A(b),A(E),f(3*b,18,i,e,F,U,B,R,b,E)),128&P&&(A(p),A(b),m(3*p,21,i,e,t,U,T,B,p,b)),256&P&&(A(r),A(p),g(3*r,24,i,e,t,n,S,T,r,p)),512&P&&(A(o),A(x),g(3*o,27,i,L,t,n,w,I,o,x)),1024&P&&(A(v),A(E),g(3*v,30,i,L,F,n,C,R,v,E)),2048&P&&(A(l),A(b),g(3*l,33,i,e,F,n,M,B,l,b)),_<<=4;let O,N,k,G=0,z=0;for(;-1!=a[_+z];)O=_+z,N=O+1,k=O+2,y(h,u,d,3*a[O],3*a[N],3*a[k]),z+=3,G++;return G}function y(e,t,n,r,i,s){const a=3*c.count;if(c.positionArray[a+0]=e[r],c.positionArray[a+1]=e[r+1],c.positionArray[a+2]=e[r+2],c.positionArray[a+3]=e[i],c.positionArray[a+4]=e[i+1],c.positionArray[a+5]=e[i+2],c.positionArray[a+6]=e[s],c.positionArray[a+7]=e[s+1],c.positionArray[a+8]=e[s+2],!0===c.material.flatShading){const e=(t[r+0]+t[i+0]+t[s+0])/3,n=(t[r+1]+t[i+1]+t[s+1])/3,o=(t[r+2]+t[i+2]+t[s+2])/3;c.normalArray[a+0]=e,c.normalArray[a+1]=n,c.normalArray[a+2]=o,c.normalArray[a+3]=e,c.normalArray[a+4]=n,c.normalArray[a+5]=o,c.normalArray[a+6]=e,c.normalArray[a+7]=n,c.normalArray[a+8]=o}else c.normalArray[a+0]=t[r+0],c.normalArray[a+1]=t[r+1],c.normalArray[a+2]=t[r+2],c.normalArray[a+3]=t[i+0],c.normalArray[a+4]=t[i+1],c.normalArray[a+5]=t[i+2],c.normalArray[a+6]=t[s+0],c.normalArray[a+7]=t[s+1],c.normalArray[a+8]=t[s+2];if(c.enableUvs){const t=2*c.count;c.uvArray[t+0]=e[r+0],c.uvArray[t+1]=e[r+2],c.uvArray[t+2]=e[i+0],c.uvArray[t+3]=e[i+2],c.uvArray[t+4]=e[s+0],c.uvArray[t+5]=e[s+2]}c.enableColors&&(c.colorArray[a+0]=n[r+0],c.colorArray[a+1]=n[r+1],c.colorArray[a+2]=n[r+2],c.colorArray[a+3]=n[i+0],c.colorArray[a+4]=n[i+1],c.colorArray[a+5]=n[i+2],c.colorArray[a+6]=n[s+0],c.colorArray[a+7]=n[s+1],c.colorArray[a+8]=n[s+2]),c.count+=3}this.enableUvs=n,this.enableColors=i,this.init=function(e){this.resolution=e,this.isolation=80,this.size=e,this.size2=this.size*this.size,this.size3=this.size2*this.size,this.halfsize=this.size/2,this.delta=2/this.size,this.yd=this.size,this.zd=this.size2,this.field=new Float32Array(this.size3),this.normal_cache=new Float32Array(3*this.size3),this.palette=new Float32Array(3*this.size3),this.count=0;const t=3*o;this.positionArray=new Float32Array(3*t);const n=new r.BufferAttribute(this.positionArray,3);n.setUsage(r.DynamicDrawUsage),l.setAttribute("position",n),this.normalArray=new Float32Array(3*t);const i=new r.BufferAttribute(this.normalArray,3);if(i.setUsage(r.DynamicDrawUsage),l.setAttribute("normal",i),this.enableUvs){this.uvArray=new Float32Array(2*t);const e=new r.BufferAttribute(this.uvArray,2);e.setUsage(r.DynamicDrawUsage),l.setAttribute("uv",e)}if(this.enableColors){this.colorArray=new Float32Array(3*t);const e=new r.BufferAttribute(this.colorArray,3);e.setUsage(r.DynamicDrawUsage),l.setAttribute("color",e)}l.boundingSphere=new r.Sphere(new r.Vector3,1)},this.addBall=function(e,t,n,i,s,a){const o=Math.sign(i);i=Math.abs(i);const l=!(null==a);let c=new r.Color(e,t,n);if(l)try{c=a instanceof r.Color?a:Array.isArray(a)?new r.Color(Math.min(Math.abs(a[0]),1),Math.min(Math.abs(a[1]),1),Math.min(Math.abs(a[2]),1)):new r.Color(a)}catch(R){c=new r.Color(e,t,n)}const h=this.size*Math.sqrt(i/s),u=n*this.size,d=t*this.size,p=e*this.size;let f=Math.floor(u-h);f<1&&(f=1);let m=Math.floor(u+h);m>this.size-1&&(m=this.size-1);let g=Math.floor(d-h);g<1&&(g=1);let A=Math.floor(d+h);A>this.size-1&&(A=this.size-1);let v=Math.floor(p-h);v<1&&(v=1);let y,x,b,E,_,S,w,M,C,T,I,B=Math.floor(p+h);for(B>this.size-1&&(B=this.size-1),b=f;b<m;b++)for(_=this.size2*b,M=b/this.size-n,C=M*M,x=g;x<A;x++)for(E=_+this.size*x,w=x/this.size-t,T=w*w,y=v;y<B;y++)if(S=y/this.size-e,I=i/(1e-6+S*S+T+C)-s,I>0){this.field[E+y]+=I*o;const e=Math.sqrt((y-p)*(y-p)+(x-d)*(x-d)+(b-u)*(b-u))/h,t=1-e*e*e*(e*(6*e-15)+10);this.palette[3*(E+y)+0]+=c.r*t,this.palette[3*(E+y)+1]+=c.g*t,this.palette[3*(E+y)+2]+=c.b*t}},this.addPlaneX=function(e,t){const n=this.size,r=this.yd,i=this.zd,s=this.field;let a,o,l,c,h,u,d,p=n*Math.sqrt(e/t);for(p>n&&(p=n),a=0;a<p;a++)if(u=a/n,c=u*u,h=e/(1e-4+c)-t,h>0)for(o=0;o<n;o++)for(d=a+o*r,l=0;l<n;l++)s[i*l+d]+=h},this.addPlaneY=function(e,t){const n=this.size,r=this.yd,i=this.zd,s=this.field;let a,o,l,c,h,u,d,p,f=n*Math.sqrt(e/t);for(f>n&&(f=n),o=0;o<f;o++)if(u=o/n,c=u*u,h=e/(1e-4+c)-t,h>0)for(d=o*r,a=0;a<n;a++)for(p=d+a,l=0;l<n;l++)s[i*l+p]+=h},this.addPlaneZ=function(e,t){const n=this.size,r=this.yd,i=this.zd,s=this.field;let a,o,l,c,h,u,d,p,f=n*Math.sqrt(e/t);for(f>n&&(f=n),l=0;l<f;l++)if(u=l/n,c=u*u,h=e/(1e-4+c)-t,h>0)for(d=i*l,o=0;o<n;o++)for(p=d+o*r,a=0;a<n;a++)s[p+a]+=h},this.setCell=function(e,t,n,r){const i=this.size2*n+this.size*t+e;this.field[i]=r},this.getCell=function(e,t,n){const r=this.size2*n+this.size*t+e;return this.field[r]},this.blur=function(e=1){const t=this.field,n=t.slice(),r=this.size,i=this.size2;for(let s=0;s<r;s++)for(let a=0;a<r;a++)for(let o=0;o<r;o++){const l=i*o+r*a+s;let c=n[l],h=1;for(let t=-1;t<=1;t+=2){const l=t+s;if(!(l<0||l>=r))for(let t=-1;t<=1;t+=2){const s=t+a;if(!(s<0||s>=r))for(let t=-1;t<=1;t+=2){const a=t+o;if(a<0||a>=r)continue;h++,c+=e*(n[i*a+r*s+l]-c)/h}}}t[l]=c}},this.reset=function(){for(let e=0;e<this.size3;e++)this.normal_cache[3*e]=0,this.field[e]=0,this.palette[3*e]=this.palette[3*e+1]=this.palette[3*e+2]=0},this.update=function(){this.count=0;const e=this.size-2;for(let t=1;t<e;t++){const n=this.size2*t,r=(t-this.halfsize)/this.halfsize;for(let t=1;t<e;t++){const i=n+this.size*t,s=(t-this.halfsize)/this.halfsize;for(let t=1;t<e;t++){v((t-this.halfsize)/this.halfsize,s,r,i+t,this.isolation)}}}this.geometry.setDrawRange(0,this.count),l.getAttribute("position").needsUpdate=!0,l.getAttribute("normal").needsUpdate=!0,this.enableUvs&&(l.getAttribute("uv").needsUpdate=!0),this.enableColors&&(l.getAttribute("color").needsUpdate=!0),this.count/3>o&&console.warn("THREE.MarchingCubes: Geometry buffers too small for rendering. Please create an instance with a higher poly count.")},this.init(e)}}const s=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]),a=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1,9,2,10,9,0,2,8,4,7,-1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1,8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1,9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1,4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1,3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1,1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1,4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1,4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1,5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1,2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1,9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1,0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1,2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1,10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1,4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1,5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1,5,4,8,5,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1,0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1,1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1,10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1,8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1,2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1,9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1,2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1,11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1,9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1,5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1,11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1,11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1,1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1,9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1,5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1,2,3,11,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1,0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1,5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1,6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1,0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1,3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1,6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1,1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1,10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1,6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,-1,-1,-1,1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1,8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1,7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1,3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1,0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1,9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1,8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1,5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1,0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1,6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1,10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1,10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1,1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1,0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1,0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1,3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1,6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1,9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1,8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1,3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1,6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1,0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1,10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1,10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1,1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1,2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1,7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1,7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1,2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1,1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1,11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1,8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1,0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1,7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1,10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1,2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1,6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1,7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1,2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1,1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1,10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1,10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1,0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1,7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1,6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1,8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1,9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1,6,8,4,6,11,8,2,10,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1,4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1,10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1,8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1,1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1,8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1,10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1,4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1,10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,5,11,7,6,-1,-1,-1,-1,-1,-1,-1,5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1,11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1,9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1,6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1,7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1,3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1,7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1,3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1,6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1,9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1,1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1,4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,-1,7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1,6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1,3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1,0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1,6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1,0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1,11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1,6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1,5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1,9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1,1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1,1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1,10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1,0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1,5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1,10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1,11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1,9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1,7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1,2,5,10,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1,9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1,9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1,1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1,9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1,9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1,0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1,10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1,2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1,0,4,11,0,11,3,4,5,11,2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);t.MarchingCubes=i,t.edgeTable=s,t.triTable=a},75488:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(65236),a=class extends i.Mesh{constructor(e,t={}){super(e),this.isReflector=!0,this.type="Reflector",this.camera=new i.PerspectiveCamera;const n=this,r=void 0!==t.color?new i.Color(t.color):new i.Color(8355711),s=t.textureWidth||512,o=t.textureHeight||512,l=t.clipBias||0,c=t.shader||a.ReflectorShader,h=void 0!==t.multisample?t.multisample:4,u=new i.Plane,d=new i.Vector3,p=new i.Vector3,f=new i.Vector3,m=new i.Matrix4,g=new i.Vector3(0,0,-1),A=new i.Vector4,v=new i.Vector3,y=new i.Vector3,x=new i.Vector4,b=new i.Matrix4,E=this.camera,_=new i.WebGLRenderTarget(s,o,{samples:h,type:i.HalfFloatType}),S=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});S.uniforms.tDiffuse.value=_.texture,S.uniforms.color.value=r,S.uniforms.textureMatrix.value=b,this.material=S,this.onBeforeRender=function(e,t,r){if(p.setFromMatrixPosition(n.matrixWorld),f.setFromMatrixPosition(r.matrixWorld),m.extractRotation(n.matrixWorld),d.set(0,0,1),d.applyMatrix4(m),v.subVectors(p,f),v.dot(d)>0)return;v.reflect(d).negate(),v.add(p),m.extractRotation(r.matrixWorld),g.set(0,0,-1),g.applyMatrix4(m),g.add(f),y.subVectors(p,g),y.reflect(d).negate(),y.add(p),E.position.copy(v),E.up.set(0,1,0),E.up.applyMatrix4(m),E.up.reflect(d),E.lookAt(y),E.far=r.far,E.updateMatrixWorld(),E.projectionMatrix.copy(r.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(E.projectionMatrix),b.multiply(E.matrixWorldInverse),b.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(d,p),u.applyMatrix4(E.matrixWorldInverse),A.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const s=E.projectionMatrix;x.x=(Math.sign(A.x)+s.elements[8])/s.elements[0],x.y=(Math.sign(A.y)+s.elements[9])/s.elements[5],x.z=-1,x.w=(1+s.elements[10])/s.elements[14],A.multiplyScalar(2/A.dot(x)),s.elements[2]=A.x,s.elements[6]=A.y,s.elements[10]=A.z+1-l,s.elements[14]=A.w,n.visible=!1;const a=e.getRenderTarget(),o=e.xr.enabled,c=e.shadowMap.autoUpdate,h=e.toneMapping;let S=!1;S="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=i.NoToneMapping,e.setRenderTarget(_),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,E),e.xr.enabled=o,e.shadowMap.autoUpdate=c,e.toneMapping=h,"outputColorSpace"in e?e.outputColorSpace=S?"srgb":"srgb-linear":e.outputEncoding=S?3001:3e3,e.setRenderTarget(a);const w=r.viewport;void 0!==w&&e.state.viewport(w),n.visible=!0},this.getRenderTarget=function(){return _},this.dispose=function(){_.dispose(),n.material.dispose()}}};let o=a;var l,c,h;l=o,c="ReflectorShader",h={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:"\n\t\tuniform mat4 textureMatrix;\n\t\tvarying vec4 vUv;\n\n\t\t#include <common>\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t#include <logdepthbuf_vertex>\n\n\t\t}",fragmentShader:`\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\t\tvarying vec4 vUv;\n\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <${s.version>=154?"colorspace_fragment":"encodings_fragment"}>\n\n\t\t}`},((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(l,"symbol"!=typeof c?c+"":c,h),t.Reflector=o},92664:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=class extends i.Mesh{constructor(e,t={}){super(e),this.isReflectorForSSRPass=!0,this.type="ReflectorForSSRPass";const n=this,r=void 0!==t.color?new i.Color(t.color):new i.Color(8355711),a=t.textureWidth||512,o=t.textureHeight||512,l=t.clipBias||0,c=t.shader||s.ReflectorShader,h=!0===t.useDepthTexture,u=new i.Vector3(0,1,0),d=new i.Vector3,p=new i.Vector3;n.needsUpdate=!1,n.maxDistance=s.ReflectorShader.uniforms.maxDistance.value,n.opacity=s.ReflectorShader.uniforms.opacity.value,n.color=r,n.resolution=t.resolution||new i.Vector2(window.innerWidth,window.innerHeight),n._distanceAttenuation=s.ReflectorShader.defines.DISTANCE_ATTENUATION,Object.defineProperty(n,"distanceAttenuation",{get:()=>n._distanceAttenuation,set(e){n._distanceAttenuation!==e&&(n._distanceAttenuation=e,n.material.defines.DISTANCE_ATTENUATION=e,n.material.needsUpdate=!0)}}),n._fresnel=s.ReflectorShader.defines.FRESNEL,Object.defineProperty(n,"fresnel",{get:()=>n._fresnel,set(e){n._fresnel!==e&&(n._fresnel=e,n.material.defines.FRESNEL=e,n.material.needsUpdate=!0)}});const f=new i.Vector3,m=new i.Vector3,g=new i.Vector3,A=new i.Matrix4,v=new i.Vector3(0,0,-1),y=new i.Vector3,x=new i.Vector3,b=new i.Matrix4,E=new i.PerspectiveCamera;let _;h&&(_=new i.DepthTexture,_.type=i.UnsignedShortType,_.minFilter=i.NearestFilter,_.magFilter=i.NearestFilter);const S={depthTexture:h?_:null,type:i.HalfFloatType},w=new i.WebGLRenderTarget(a,o,S),M=new i.ShaderMaterial({transparent:h,defines:Object.assign({},s.ReflectorShader.defines,{useDepthTexture:h}),uniforms:i.UniformsUtils.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});M.uniforms.tDiffuse.value=w.texture,M.uniforms.color.value=n.color,M.uniforms.textureMatrix.value=b,h&&(M.uniforms.tDepth.value=w.depthTexture),this.material=M;const C=[new i.Plane(new i.Vector3(0,1,0),l)];this.doRender=function(e,t,r){if(M.uniforms.maxDistance.value=n.maxDistance,M.uniforms.color.value=n.color,M.uniforms.opacity.value=n.opacity,d.copy(r.position).normalize(),p.copy(d).reflect(u),M.uniforms.fresnelCoe.value=(d.dot(p)+1)/2,m.setFromMatrixPosition(n.matrixWorld),g.setFromMatrixPosition(r.matrixWorld),A.extractRotation(n.matrixWorld),f.set(0,0,1),f.applyMatrix4(A),y.subVectors(m,g),y.dot(f)>0)return;y.reflect(f).negate(),y.add(m),A.extractRotation(r.matrixWorld),v.set(0,0,-1),v.applyMatrix4(A),v.add(g),x.subVectors(m,v),x.reflect(f).negate(),x.add(m),E.position.copy(y),E.up.set(0,1,0),E.up.applyMatrix4(A),E.up.reflect(f),E.lookAt(x),E.far=r.far,E.updateMatrixWorld(),E.projectionMatrix.copy(r.projectionMatrix),M.uniforms.virtualCameraNear.value=r.near,M.uniforms.virtualCameraFar.value=r.far,M.uniforms.virtualCameraMatrixWorld.value=E.matrixWorld,M.uniforms.virtualCameraProjectionMatrix.value=r.projectionMatrix,M.uniforms.virtualCameraProjectionMatrixInverse.value=r.projectionMatrixInverse,M.uniforms.resolution.value=n.resolution,b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(E.projectionMatrix),b.multiply(E.matrixWorldInverse),b.multiply(n.matrixWorld);const i=e.getRenderTarget(),s=e.xr.enabled,a=e.shadowMap.autoUpdate,o=e.clippingPlanes;e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.clippingPlanes=C,e.setRenderTarget(w),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,E),e.xr.enabled=s,e.shadowMap.autoUpdate=a,e.clippingPlanes=o,e.setRenderTarget(i);const l=r.viewport;void 0!==l&&e.state.viewport(l)},this.getRenderTarget=function(){return w}}};let a=s;var o,l,c;o=a,l="ReflectorShader",c={defines:{DISTANCE_ATTENUATION:!0,FRESNEL:!0},uniforms:{color:{value:null},tDiffuse:{value:null},tDepth:{value:null},textureMatrix:{value:new i.Matrix4},maxDistance:{value:180},opacity:{value:.5},fresnelCoe:{value:null},virtualCameraNear:{value:null},virtualCameraFar:{value:null},virtualCameraProjectionMatrix:{value:new i.Matrix4},virtualCameraMatrixWorld:{value:new i.Matrix4},virtualCameraProjectionMatrixInverse:{value:new i.Matrix4},resolution:{value:new i.Vector2}},vertexShader:"\n\t\tuniform mat4 textureMatrix;\n\t\tvarying vec4 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform sampler2D tDepth;\n\t\tuniform float maxDistance;\n\t\tuniform float opacity;\n\t\tuniform float fresnelCoe;\n\t\tuniform float virtualCameraNear;\n\t\tuniform float virtualCameraFar;\n\t\tuniform mat4 virtualCameraProjectionMatrix;\n\t\tuniform mat4 virtualCameraProjectionMatrixInverse;\n\t\tuniform mat4 virtualCameraMatrixWorld;\n\t\tuniform vec2 resolution;\n\t\tvarying vec4 vUv;\n\t\t#include <packing>\n\t\tfloat blendOverlay( float base, float blend ) {\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\t\t}\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\t\t}\n\t\tfloat getDepth( const in vec2 uv ) {\n\t\t\treturn texture2D( tDepth, uv ).x;\n\t\t}\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\treturn perspectiveDepthToViewZ( depth, virtualCameraNear, virtualCameraFar );\n\t\t}\n\t\tvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n\t\t\tvec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n\t\t\tclipPosition *= clipW; //clip\n\t\t\treturn ( virtualCameraProjectionMatrixInverse * clipPosition ).xyz;//view\n\t\t}\n\t\tvoid main() {\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\t#ifdef useDepthTexture\n\t\t\t\tvec2 uv=(gl_FragCoord.xy-.5)/resolution.xy;\n\t\t\t\tuv.x=1.-uv.x;\n\t\t\t\tfloat depth = texture2DProj( tDepth, vUv ).r;\n\t\t\t\tfloat viewZ = getViewZ( depth );\n\t\t\t\tfloat clipW = virtualCameraProjectionMatrix[2][3] * viewZ+virtualCameraProjectionMatrix[3][3];\n\t\t\t\tvec3 viewPosition=getViewPosition( uv, depth, clipW );\n\t\t\t\tvec3 worldPosition=(virtualCameraMatrixWorld*vec4(viewPosition,1)).xyz;\n\t\t\t\tif(worldPosition.y>maxDistance) discard;\n\t\t\t\tfloat op=opacity;\n\t\t\t\t#ifdef DISTANCE_ATTENUATION\n\t\t\t\t\tfloat ratio=1.-(worldPosition.y/maxDistance);\n\t\t\t\t\tfloat attenuation=ratio*ratio;\n\t\t\t\t\top=opacity*attenuation;\n\t\t\t\t#endif\n\t\t\t\t#ifdef FRESNEL\n\t\t\t\t\top*=fresnelCoe;\n\t\t\t\t#endif\n\t\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), op );\n\t\t\t#else\n\t\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\t\t\t#endif\n\t\t}\n\t"},((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(o,"symbol"!=typeof l?l+"":l,c),t.ReflectorForSSRPass=a},91909:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(75488);class i extends r.Reflector{constructor(e,t){super(e,t),this.geometry.setDrawRange(0,0)}}t.ReflectorRTT=i},86307:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(65236),a=class extends i.Mesh{constructor(e,t={}){super(e),this.isRefractor=!0,this.type="Refractor",this.camera=new i.PerspectiveCamera;const n=this,r=void 0!==t.color?new i.Color(t.color):new i.Color(8355711),s=t.textureWidth||512,o=t.textureHeight||512,l=t.clipBias||0,c=t.shader||a.RefractorShader,h=void 0!==t.multisample?t.multisample:4,u=this.camera;u.matrixAutoUpdate=!1,u.userData.refractor=!0;const d=new i.Plane,p=new i.Matrix4,f=new i.WebGLRenderTarget(s,o,{samples:h,type:i.HalfFloatType});this.material=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,transparent:!0}),this.material.uniforms.color.value=r,this.material.uniforms.tDiffuse.value=f.texture,this.material.uniforms.textureMatrix.value=p;const m=function(){const e=new i.Vector3,t=new i.Vector3,r=new i.Matrix4,s=new i.Vector3,a=new i.Vector3;return function(i){return e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(i.matrixWorld),s.subVectors(e,t),r.extractRotation(n.matrixWorld),a.set(0,0,1),a.applyMatrix4(r),s.dot(a)<0}}(),g=function(){const e=new i.Vector3,t=new i.Vector3,r=new i.Quaternion,s=new i.Vector3;return function(){n.matrixWorld.decompose(t,r,s),e.set(0,0,1).applyQuaternion(r).normalize(),e.negate(),d.setFromNormalAndCoplanarPoint(e,t)}}(),A=function(){const e=new i.Plane,t=new i.Vector4,n=new i.Vector4;return function(r){u.matrixWorld.copy(r.matrixWorld),u.matrixWorldInverse.copy(u.matrixWorld).invert(),u.projectionMatrix.copy(r.projectionMatrix),u.far=r.far,e.copy(d),e.applyMatrix4(u.matrixWorldInverse),t.set(e.normal.x,e.normal.y,e.normal.z,e.constant);const i=u.projectionMatrix;n.x=(Math.sign(t.x)+i.elements[8])/i.elements[0],n.y=(Math.sign(t.y)+i.elements[9])/i.elements[5],n.z=-1,n.w=(1+i.elements[10])/i.elements[14],t.multiplyScalar(2/t.dot(n)),i.elements[2]=t.x,i.elements[6]=t.y,i.elements[10]=t.z+1-l,i.elements[14]=t.w}}();this.onBeforeRender=function(e,t,r){!0!==r.userData.refractor&&!0!=!m(r)&&(g(),function(e){p.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),p.multiply(e.projectionMatrix),p.multiply(e.matrixWorldInverse),p.multiply(n.matrixWorld)}(r),A(r),function(e,t,r){n.visible=!1;const s=e.getRenderTarget(),a=e.xr.enabled,o=e.shadowMap.autoUpdate,l=e.toneMapping;let c=!1;c="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=i.NoToneMapping,e.setRenderTarget(f),!1===e.autoClear&&e.clear(),e.render(t,u),e.xr.enabled=a,e.shadowMap.autoUpdate=o,e.toneMapping=l,e.setRenderTarget(s),"outputColorSpace"in e?e.outputColorSpace=c?"srgb":"srgb-linear":e.outputEncoding=c?3001:3e3;const h=r.viewport;void 0!==h&&e.state.viewport(h),n.visible=!0}(e,t,r))},this.getRenderTarget=function(){return f},this.dispose=function(){f.dispose(),n.material.dispose()}}};let o=a;var l,c,h;l=o,c="RefractorShader",h={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:"\n\n\t\tuniform mat4 textureMatrix;\n\n\t\tvarying vec4 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:`\n\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec4 vUv;\n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <${s.version>=154?"colorspace_fragment":"encodings_fragment"}>\n\n\t\t}`},((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(l,"symbol"!=typeof c?c+"":c,h),t.Refractor=o},16558:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Matrix4;class s extends r.Mesh{constructor(e){const t=new r.MeshBasicMaterial({color:0,transparent:!0,opacity:.6,depthWrite:!1,stencilWrite:!0,stencilFunc:r.EqualStencilFunc,stencilRef:0,stencilZPass:r.IncrementStencilOp});super(e.geometry,t),this.isShadowMesh=!0,this.meshMatrix=e.matrixWorld,this.frustumCulled=!1,this.matrixAutoUpdate=!1}update(e,t){const n=e.normal.x*t.x+e.normal.y*t.y+e.normal.z*t.z+-e.constant*t.w,r=i.elements;r[0]=n-t.x*e.normal.x,r[4]=-t.x*e.normal.y,r[8]=-t.x*e.normal.z,r[12]=-t.x*-e.constant,r[1]=-t.y*e.normal.x,r[5]=n-t.y*e.normal.y,r[9]=-t.y*e.normal.z,r[13]=-t.y*-e.constant,r[2]=-t.z*e.normal.x,r[6]=-t.z*e.normal.y,r[10]=n-t.z*e.normal.z,r[14]=-t.z*-e.constant,r[3]=-t.w*e.normal.x,r[7]=-t.w*e.normal.y,r[11]=-t.w*e.normal.z,r[15]=n-t.w*-e.constant,this.matrix.multiplyMatrices(i,this.meshMatrix)}}t.ShadowMesh=s},79047:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(65236),o={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new s.Vector3},up:{value:new s.Vector3(0,1,0)}},vertexShader:"\n uniform vec3 sunPosition;\n uniform float rayleigh;\n uniform float turbidity;\n uniform float mieCoefficient;\n uniform vec3 up;\n\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n // constants for atmospheric scattering\n const float e = 2.71828182845904523536028747135266249775724709369995957;\n const float pi = 3.141592653589793238462643383279502884197169;\n\n // wavelength of used primaries, according to preetham\n const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n // mie stuff\n // K coefficient for the primaries\n const float v = 4.0;\n const vec3 K = vec3( 0.686, 0.678, 0.666 );\n // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n // earth shadow hack\n // cutoffAngle = pi / 1.95;\n const float cutoffAngle = 1.6110731556870734;\n const float steepness = 1.5;\n const float EE = 1000.0;\n\n float sunIntensity( float zenithAngleCos ) {\n zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n }\n\n vec3 totalMie( float T ) {\n float c = ( 0.2 * T ) * 10E-18;\n return 0.434 * c * MieConst;\n }\n\n void main() {\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position.z = gl_Position.w; // set z to camera.far\n\n vSunDirection = normalize( sunPosition );\n\n vSunE = sunIntensity( dot( vSunDirection, up ) );\n\n vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n // extinction (absorbtion + out scattering)\n // rayleigh coefficients\n vBetaR = totalRayleigh * rayleighCoefficient;\n\n // mie coefficients\n vBetaM = totalMie( turbidity ) * mieCoefficient;\n\n }\n ",fragmentShader:`\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n uniform float mieDirectionalG;\n uniform vec3 up;\n\n const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n // constants for atmospheric scattering\n const float pi = 3.141592653589793238462643383279502884197169;\n\n const float n = 1.0003; // refractive index of air\n const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n // optical length at zenith for molecules\n const float rayleighZenithLength = 8.4E3;\n const float mieZenithLength = 1.25E3;\n // 66 arc seconds -> degrees, and the cosine of that\n const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n // 3.0 / ( 16.0 * pi )\n const float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n // 1.0 / ( 4.0 * pi )\n const float ONE_OVER_FOURPI = 0.07957747154594767;\n\n float rayleighPhase( float cosTheta ) {\n return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n }\n\n float hgPhase( float cosTheta, float g ) {\n float g2 = pow( g, 2.0 );\n float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n }\n\n void main() {\n\n vec3 direction = normalize( vWorldPosition - cameraPos );\n\n // optical length\n // cutoff angle at 90 to avoid singularity in next formula.\n float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n float sR = rayleighZenithLength * inverse;\n float sM = mieZenithLength * inverse;\n\n // combined extinction factor\n vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n // in scattering\n float cosTheta = dot( direction, vSunDirection );\n\n float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n vec3 betaRTheta = vBetaR * rPhase;\n\n float mPhase = hgPhase( cosTheta, mieDirectionalG );\n vec3 betaMTheta = vBetaM * mPhase;\n\n vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n // nightsky\n float theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n float phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n vec3 L0 = vec3( 0.1 ) * Fex;\n\n // composition + solar disc\n float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n L0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n gl_FragColor = vec4( retColor, 1.0 );\n\n #include <tonemapping_fragment>\n #include <${a.version>=154?"colorspace_fragment":"encodings_fragment"}>\n\n }\n `},l=new s.ShaderMaterial({name:"SkyShader",fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:s.UniformsUtils.clone(o.uniforms),side:s.BackSide,depthWrite:!1});class c extends s.Mesh{constructor(){super(new s.BoxGeometry(1,1,1),l)}}i(c,"SkyShader",o),i(c,"material",l),t.Sky=c},52359:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Mesh{constructor(e,t={}){super(e),this.isWater=!0;const n=this,i=void 0!==t.textureWidth?t.textureWidth:512,s=void 0!==t.textureHeight?t.textureHeight:512,a=void 0!==t.clipBias?t.clipBias:0,o=void 0!==t.alpha?t.alpha:1,l=void 0!==t.time?t.time:0,c=void 0!==t.waterNormals?t.waterNormals:null,h=void 0!==t.sunDirection?t.sunDirection:new r.Vector3(.70707,.70707,0),u=new r.Color(void 0!==t.sunColor?t.sunColor:16777215),d=new r.Color(void 0!==t.waterColor?t.waterColor:8355711),p=void 0!==t.eye?t.eye:new r.Vector3(0,0,0),f=void 0!==t.distortionScale?t.distortionScale:20,m=void 0!==t.side?t.side:r.FrontSide,g=void 0!==t.fog&&t.fog,A=new r.Plane,v=new r.Vector3,y=new r.Vector3,x=new r.Vector3,b=new r.Matrix4,E=new r.Vector3(0,0,-1),_=new r.Vector4,S=new r.Vector3,w=new r.Vector3,M=new r.Vector4,C=new r.Matrix4,T=new r.PerspectiveCamera,I=new r.WebGLRenderTarget(i,s),B={uniforms:r.UniformsUtils.merge([r.UniformsLib.fog,r.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new r.Matrix4},sunColor:{value:new r.Color(8355711)},sunDirection:{value:new r.Vector3(.70707,.70707,0)},eye:{value:new r.Vector3},waterColor:{value:new r.Color(5592405)}}]),vertexShader:"\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}",fragmentShader:`\n\t\t\t\tuniform sampler2D mirrorSampler;\n\t\t\t\tuniform float alpha;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform float size;\n\t\t\t\tuniform float distortionScale;\n\t\t\t\tuniform sampler2D normalSampler;\n\t\t\t\tuniform vec3 sunColor;\n\t\t\t\tuniform vec3 sunDirection;\n\t\t\t\tuniform vec3 eye;\n\t\t\t\tuniform vec3 waterColor;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\tvec4 getNoise( vec2 uv ) {\n\t\t\t\t\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\t\t\t\t\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\t\t\t\t\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\t\t\t\t\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\t\t\t\t\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv1 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv2 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv3 );\n\t\t\t\t\treturn noise * 0.5 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tvoid sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n\t\t\t\t\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n\t\t\t\t\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n\t\t\t\t\tspecularColor += pow( direction, shiny ) * sunColor * spec;\n\t\t\t\t\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <packing>\n\t\t\t\t#include <bsdfs>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <lights_pars_begin>\n\t\t\t\t#include <shadowmap_pars_fragment>\n\t\t\t\t#include <shadowmask_pars_fragment>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\tvec4 noise = getNoise( worldPosition.xz * size );\n\t\t\t\t\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\n\t\t\t\t\tvec3 diffuseLight = vec3(0.0);\n\t\t\t\t\tvec3 specularLight = vec3(0.0);\n\n\t\t\t\t\tvec3 worldToEye = eye-worldPosition.xyz;\n\t\t\t\t\tvec3 eyeDirection = normalize( worldToEye );\n\t\t\t\t\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n\n\t\t\t\t\tfloat distance = length(worldToEye);\n\n\t\t\t\t\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\t\t\t\t\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\n\t\t\t\t\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\t\t\t\t\tfloat rf0 = 0.3;\n\t\t\t\t\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\t\t\t\t\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\t\t\t\t\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n\t\t\t\t\tvec3 outgoingLight = albedo;\n\t\t\t\t\tgl_FragColor = vec4( outgoingLight, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <${parseInt(r.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n\t\t\t\t\t#include <fog_fragment>\t\n\t\t\t\t}`},R=new r.ShaderMaterial({fragmentShader:B.fragmentShader,vertexShader:B.vertexShader,uniforms:r.UniformsUtils.clone(B.uniforms),lights:!0,side:m,fog:g});R.uniforms.mirrorSampler.value=I.texture,R.uniforms.textureMatrix.value=C,R.uniforms.alpha.value=o,R.uniforms.time.value=l,R.uniforms.normalSampler.value=c,R.uniforms.sunColor.value=u,R.uniforms.waterColor.value=d,R.uniforms.sunDirection.value=h,R.uniforms.distortionScale.value=f,R.uniforms.eye.value=p,n.material=R,n.onBeforeRender=function(e,t,r){if(y.setFromMatrixPosition(n.matrixWorld),x.setFromMatrixPosition(r.matrixWorld),b.extractRotation(n.matrixWorld),v.set(0,0,1),v.applyMatrix4(b),S.subVectors(y,x),S.dot(v)>0)return;S.reflect(v).negate(),S.add(y),b.extractRotation(r.matrixWorld),E.set(0,0,-1),E.applyMatrix4(b),E.add(x),w.subVectors(y,E),w.reflect(v).negate(),w.add(y),T.position.copy(S),T.up.set(0,1,0),T.up.applyMatrix4(b),T.up.reflect(v),T.lookAt(w),T.far=r.far,T.updateMatrixWorld(),T.projectionMatrix.copy(r.projectionMatrix),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(T.projectionMatrix),C.multiply(T.matrixWorldInverse),A.setFromNormalAndCoplanarPoint(v,y),A.applyMatrix4(T.matrixWorldInverse),_.set(A.normal.x,A.normal.y,A.normal.z,A.constant);const i=T.projectionMatrix;M.x=(Math.sign(_.x)+i.elements[8])/i.elements[0],M.y=(Math.sign(_.y)+i.elements[9])/i.elements[5],M.z=-1,M.w=(1+i.elements[10])/i.elements[14],_.multiplyScalar(2/_.dot(M)),i.elements[2]=_.x,i.elements[6]=_.y,i.elements[10]=_.z+1-a,i.elements[14]=_.w,p.setFromMatrixPosition(r.matrixWorld);const s=e.getRenderTarget(),o=e.xr.enabled,l=e.shadowMap.autoUpdate;n.visible=!1,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(I),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,T),n.visible=!0,e.xr.enabled=o,e.shadowMap.autoUpdate=l,e.setRenderTarget(s);const c=r.viewport;void 0!==c&&e.state.viewport(c)}}}t.Water=i},95034:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(75488),a=n(86307),o=n(65236),l=class extends i.Mesh{constructor(e,t={}){super(e),this.isWater=!0,this.type="Water";const n=this,r=void 0!==t.color?new i.Color(t.color):new i.Color(16777215),o=t.textureWidth||512,c=t.textureHeight||512,h=t.clipBias||0,u=t.flowDirection||new i.Vector2(1,0),d=t.flowSpeed||.03,p=t.reflectivity||.02,f=t.scale||1,m=t.shader||l.WaterShader,g=void 0!==t.encoding?t.encoding:3e3,A=t.flowMap||void 0,v=t.normalMap0,y=t.normalMap1,x=.15,b=.075,E=new i.Matrix4,_=new i.Clock;if(void 0===s.Reflector)return void console.error("THREE.Water: Required component Reflector not found.");if(void 0===a.Refractor)return void console.error("THREE.Water: Required component Refractor not found.");const S=new s.Reflector(e,{textureWidth:o,textureHeight:c,clipBias:h,encoding:g}),w=new a.Refractor(e,{textureWidth:o,textureHeight:c,clipBias:h,encoding:g});S.matrixAutoUpdate=!1,w.matrixAutoUpdate=!1,this.material=new i.ShaderMaterial({uniforms:i.UniformsUtils.merge([i.UniformsLib.fog,m.uniforms]),vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,transparent:!0,fog:!0}),void 0!==A?(this.material.defines.USE_FLOWMAP="",this.material.uniforms.tFlowMap={type:"t",value:A}):this.material.uniforms.flowDirection={type:"v2",value:u},v.wrapS=v.wrapT=i.RepeatWrapping,y.wrapS=y.wrapT=i.RepeatWrapping,this.material.uniforms.tReflectionMap.value=S.getRenderTarget().texture,this.material.uniforms.tRefractionMap.value=w.getRenderTarget().texture,this.material.uniforms.tNormalMap0.value=v,this.material.uniforms.tNormalMap1.value=y,this.material.uniforms.color.value=r,this.material.uniforms.reflectivity.value=p,this.material.uniforms.textureMatrix.value=E,this.material.uniforms.config.value.x=0,this.material.uniforms.config.value.y=b,this.material.uniforms.config.value.z=b,this.material.uniforms.config.value.w=f,this.onBeforeRender=function(e,t,r){!function(e){E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(e.projectionMatrix),E.multiply(e.matrixWorldInverse),E.multiply(n.matrixWorld)}(r),function(){const e=_.getDelta(),t=n.material.uniforms.config;t.value.x+=d*e,t.value.y=t.value.x+b,t.value.x>=x?(t.value.x=0,t.value.y=b):t.value.y>=x&&(t.value.y=t.value.y-x)}(),n.visible=!1,S.matrixWorld.copy(n.matrixWorld),w.matrixWorld.copy(n.matrixWorld),S.onBeforeRender(e,t,r),w.onBeforeRender(e,t,r),n.visible=!0}}};let c=l;var h,u,d;h=c,u="WaterShader",d={uniforms:{color:{value:null},reflectivity:{value:0},tReflectionMap:{value:null},tRefractionMap:{value:null},tNormalMap0:{value:null},tNormalMap1:{value:null},textureMatrix:{value:null},config:{value:new i.Vector4}},vertexShader:"\n\n\t\t#include <common>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tuniform mat4 textureMatrix;\n\n\t\tvarying vec4 vCoord;\n\t\tvarying vec2 vUv;\n\t\tvarying vec3 vToEye;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tvCoord = textureMatrix * vec4( position, 1.0 );\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvToEye = cameraPosition - worldPosition.xyz;\n\n\t\t\tvec4 mvPosition = viewMatrix * worldPosition; // used in fog_vertex\n\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}",fragmentShader:`\n\n\t\t#include <common>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tuniform sampler2D tReflectionMap;\n\t\tuniform sampler2D tRefractionMap;\n\t\tuniform sampler2D tNormalMap0;\n\t\tuniform sampler2D tNormalMap1;\n\n\t\t#ifdef USE_FLOWMAP\n\t\t\tuniform sampler2D tFlowMap;\n\t\t#else\n\t\t\tuniform vec2 flowDirection;\n\t\t#endif\n\n\t\tuniform vec3 color;\n\t\tuniform float reflectivity;\n\t\tuniform vec4 config;\n\n\t\tvarying vec4 vCoord;\n\t\tvarying vec2 vUv;\n\t\tvarying vec3 vToEye;\n\n\t\tvoid main() {\n\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\tfloat flowMapOffset0 = config.x;\n\t\t\tfloat flowMapOffset1 = config.y;\n\t\t\tfloat halfCycle = config.z;\n\t\t\tfloat scale = config.w;\n\n\t\t\tvec3 toEye = normalize( vToEye );\n\n\t\t\t// determine flow direction\n\t\t\tvec2 flow;\n\t\t\t#ifdef USE_FLOWMAP\n\t\t\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;\n\t\t\t#else\n\t\t\t\tflow = flowDirection;\n\t\t\t#endif\n\t\t\tflow.x *= - 1.0;\n\n\t\t\t// sample normal maps (distort uvs with flowdata)\n\t\t\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );\n\t\t\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );\n\n\t\t\t// linear interpolate to get the final normal color\n\t\t\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;\n\t\t\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );\n\n\t\t\t// calculate normal vector\n\t\t\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n\n\t\t\t// calculate the fresnel term to blend reflection and refraction maps\n\t\t\tfloat theta = max( dot( toEye, normal ), 0.0 );\n\t\t\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );\n\n\t\t\t// calculate final uv coords\n\t\t\tvec3 coord = vCoord.xyz / vCoord.w;\n\t\t\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;\n\n\t\t\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );\n\t\t\tvec4 refractColor = texture2D( tRefractionMap, uv );\n\n\t\t\t// multiply water color with the mix of both textures\n\t\t\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <${o.version>=154?"colorspace_fragment":"encodings_fragment"}>\n\t\t\t#include <fog_fragment>\n\n\t\t}`},((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(h,"symbol"!=typeof u?u+"":u,d),t.Water2=c},49693:(e,t)=>{"use strict";function n(e,t,n,r){const i=t.x(),s=t.y(),a=t.z(),o=t.w(),l=i+i,c=s+s,h=a+a,u=i*l,d=i*c,p=i*h,f=s*c,m=s*h,g=a*h,A=o*l,v=o*c,y=o*h;n[r+0]=1-(f+g),n[r+1]=d+y,n[r+2]=p-v,n[r+3]=0,n[r+4]=d-y,n[r+5]=1-(u+g),n[r+6]=m+A,n[r+7]=0,n[r+8]=p+v,n[r+9]=m-A,n[r+10]=1-(u+f),n[r+11]=0,n[r+12]=e.x(),n[r+13]=e.y(),n[r+14]=e.z(),n[r+15]=1}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.AmmoPhysics=async function(){if("Ammo"in window==!1)return void console.error("AmmoPhysics: Couldn't find Ammo.js");const e=await Ammo(),t=new e.btDefaultCollisionConfiguration,r=new e.btCollisionDispatcher(t),i=new e.btDbvtBroadphase,s=new e.btSequentialImpulseConstraintSolver,a=new e.btDiscreteDynamicsWorld(r,i,s,t);a.setGravity(new e.btVector3(0,-9.8,0));const o=new e.btTransform,l=[],c=new WeakMap;let h=0;return setInterval((function(){const e=performance.now();if(h>0){const t=(e-h)/1e3;a.stepSimulation(t,10)}h=e;for(let t=0,r=l.length;t<r;t++){const e=l[t];if(e.isInstancedMesh){const t=e.instanceMatrix.array,r=c.get(e);for(let e=0;e<r.length;e++){r[e].getMotionState().getWorldTransform(o);n(o.getOrigin(),o.getRotation(),t,16*e)}e.instanceMatrix.needsUpdate=!0}else if(e.isMesh){c.get(e).getMotionState().getWorldTransform(o);const t=o.getOrigin(),n=o.getRotation();e.position.set(t.x(),t.y(),t.z()),e.quaternion.set(n.x(),n.y(),n.z(),n.w())}}}),1e3/60),{addMesh:function(t,n=0){const r=function(t){const n=t.parameters;if("BoxGeometry"===t.type){const t=void 0!==n.width?n.width/2:.5,r=void 0!==n.height?n.height/2:.5,i=void 0!==n.depth?n.depth/2:.5,s=new e.btBoxShape(new e.btVector3(t,r,i));return s.setMargin(.05),s}if("SphereGeometry"===t.type||"IcosahedronGeometry"===t.type){const t=void 0!==n.radius?n.radius:1,r=new e.btSphereShape(t);return r.setMargin(.05),r}return null}(t.geometry);null!==r&&(t.isInstancedMesh?function(t,n,r){const i=t.instanceMatrix.array,s=[];for(let o=0;o<t.count;o++){const t=16*o,l=new e.btTransform;l.setFromOpenGLMatrix(i.slice(t,t+16));const c=new e.btDefaultMotionState(l),h=new e.btVector3(0,0,0);r.calculateLocalInertia(n,h);const u=new e.btRigidBodyConstructionInfo(n,c,r,h),d=new e.btRigidBody(u);a.addRigidBody(d),s.push(d)}n>0&&(t.instanceMatrix.setUsage(35048),l.push(t),c.set(t,s))}(t,n,r):t.isMesh&&function(t,n,r){const i=t.position,s=t.quaternion,o=new e.btTransform;o.setIdentity(),o.setOrigin(new e.btVector3(i.x,i.y,i.z)),o.setRotation(new e.btQuaternion(s.x,s.y,s.z,s.w));const h=new e.btDefaultMotionState(o),u=new e.btVector3(0,0,0);r.calculateLocalInertia(n,u);const d=new e.btRigidBodyConstructionInfo(n,h,r,u),p=new e.btRigidBody(d);a.addRigidBody(p),n>0&&(l.push(t),c.set(t,p))}(t,n,r))},setMeshPosition:function(t,n,r=0){if(t.isInstancedMesh){const i=c.get(t)[r];i.setAngularVelocity(new e.btVector3(0,0,0)),i.setLinearVelocity(new e.btVector3(0,0,0)),o.setIdentity(),o.setOrigin(new e.btVector3(n.x,n.y,n.z)),i.setWorldTransform(o)}else if(t.isMesh){const r=c.get(t);r.setAngularVelocity(new e.btVector3(0,0,0)),r.setLinearVelocity(new e.btVector3(0,0,0)),o.setIdentity(),o.setOrigin(new e.btVector3(n.x,n.y,n.z)),r.setWorldTransform(o)}}}}},69265:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190),s=n(83453),a=n(48123),o=n(51867);class l extends i.Pass{constructor(e,t){super(),this.resolution=void 0!==t?t:256,this.needsInit=!0,this.adaptive=void 0===e||!!e,this.luminanceRT=null,this.previousLuminanceRT=null,this.currentLuminanceRT=null;const n=s.CopyShader;this.copyUniforms=r.UniformsUtils.clone(n.uniforms),this.materialCopy=new r.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,blending:r.NoBlending,depthTest:!1}),this.materialLuminance=new r.ShaderMaterial({uniforms:r.UniformsUtils.clone(a.LuminosityShader.uniforms),vertexShader:a.LuminosityShader.vertexShader,fragmentShader:a.LuminosityShader.fragmentShader,blending:r.NoBlending}),this.adaptLuminanceShader={defines:{MIP_LEVEL_1X1:(Math.log(this.resolution)/Math.log(2)).toFixed(1)},uniforms:{lastLum:{value:null},currentLum:{value:null},minLuminance:{value:.01},delta:{value:.016},tau:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D lastLum;\n\t\t\t\tuniform sampler2D currentLum;\n\t\t\t\tuniform float minLuminance;\n\t\t\t\tuniform float delta;\n\t\t\t\tuniform float tau;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 lastLum = texture2D( lastLum, vUv, MIP_LEVEL_1X1 );\n\t\t\t\t\tvec4 currentLum = texture2D( currentLum, vUv, MIP_LEVEL_1X1 );\n\n\t\t\t\t\tfloat fLastLum = max( minLuminance, lastLum.r );\n\t\t\t\t\tfloat fCurrentLum = max( minLuminance, currentLum.r );\n\n\t\t\t\t\t//The adaption seems to work better in extreme lighting differences\n\t\t\t\t\t//if the input luminance is squared.\n\t\t\t\t\tfCurrentLum *= fCurrentLum;\n\n\t\t\t\t\t// Adapt the luminance using Pattanaik's technique\n\t\t\t\t\tfloat fAdaptedLum = fLastLum + (fCurrentLum - fLastLum) * (1.0 - exp(-delta * tau));\n\t\t\t\t\t// \"fAdaptedLum = sqrt(fAdaptedLum);\n\t\t\t\t\tgl_FragColor.r = fAdaptedLum;\n\t\t\t\t}"},this.materialAdaptiveLum=new r.ShaderMaterial({uniforms:r.UniformsUtils.clone(this.adaptLuminanceShader.uniforms),vertexShader:this.adaptLuminanceShader.vertexShader,fragmentShader:this.adaptLuminanceShader.fragmentShader,defines:Object.assign({},this.adaptLuminanceShader.defines),blending:r.NoBlending}),this.materialToneMap=new r.ShaderMaterial({uniforms:r.UniformsUtils.clone(o.ToneMapShader.uniforms),vertexShader:o.ToneMapShader.vertexShader,fragmentShader:o.ToneMapShader.fragmentShader,blending:r.NoBlending}),this.fsQuad=new i.FullScreenQuad(null)}render(e,t,n,r){this.needsInit&&(this.reset(e),this.luminanceRT.texture.type=n.texture.type,this.previousLuminanceRT.texture.type=n.texture.type,this.currentLuminanceRT.texture.type=n.texture.type,this.needsInit=!1),this.adaptive&&(this.fsQuad.material=this.materialLuminance,this.materialLuminance.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(this.currentLuminanceRT),this.fsQuad.render(e),this.fsQuad.material=this.materialAdaptiveLum,this.materialAdaptiveLum.uniforms.delta.value=r,this.materialAdaptiveLum.uniforms.lastLum.value=this.previousLuminanceRT.texture,this.materialAdaptiveLum.uniforms.currentLum.value=this.currentLuminanceRT.texture,e.setRenderTarget(this.luminanceRT),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.luminanceRT.texture,e.setRenderTarget(this.previousLuminanceRT),this.fsQuad.render(e)),this.fsQuad.material=this.materialToneMap,this.materialToneMap.uniforms.tDiffuse.value=n.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}reset(){this.luminanceRT&&this.luminanceRT.dispose(),this.currentLuminanceRT&&this.currentLuminanceRT.dispose(),this.previousLuminanceRT&&this.previousLuminanceRT.dispose(),this.luminanceRT=new r.WebGLRenderTarget(this.resolution,this.resolution),this.luminanceRT.texture.name="AdaptiveToneMappingPass.l",this.luminanceRT.texture.generateMipmaps=!1,this.previousLuminanceRT=new r.WebGLRenderTarget(this.resolution,this.resolution),this.previousLuminanceRT.texture.name="AdaptiveToneMappingPass.pl",this.previousLuminanceRT.texture.generateMipmaps=!1;const e={minFilter:r.LinearMipmapLinearFilter,generateMipmaps:!0};this.currentLuminanceRT=new r.WebGLRenderTarget(this.resolution,this.resolution,e),this.currentLuminanceRT.texture.name="AdaptiveToneMappingPass.cl",this.adaptive&&(this.materialToneMap.defines.ADAPTED_LUMINANCE="",this.materialToneMap.uniforms.luminanceMap.value=this.luminanceRT.texture),this.fsQuad.material=new r.MeshBasicMaterial({color:7829367}),this.materialLuminance.needsUpdate=!0,this.materialAdaptiveLum.needsUpdate=!0,this.materialToneMap.needsUpdate=!0}setAdaptive(e){e?(this.adaptive=!0,this.materialToneMap.defines.ADAPTED_LUMINANCE="",this.materialToneMap.uniforms.luminanceMap.value=this.luminanceRT.texture):(this.adaptive=!1,delete this.materialToneMap.defines.ADAPTED_LUMINANCE,this.materialToneMap.uniforms.luminanceMap.value=null),this.materialToneMap.needsUpdate=!0}setAdaptionRate(e){e&&(this.materialAdaptiveLum.uniforms.tau.value=Math.abs(e))}setMinLuminance(e){e&&(this.materialToneMap.uniforms.minLuminance.value=e,this.materialAdaptiveLum.uniforms.minLuminance.value=e)}setMaxLuminance(e){e&&(this.materialToneMap.uniforms.maxLuminance.value=e)}setAverageLuminance(e){e&&(this.materialToneMap.uniforms.averageLuminance.value=e)}setMiddleGrey(e){e&&(this.materialToneMap.uniforms.middleGrey.value=e)}dispose(){this.luminanceRT&&this.luminanceRT.dispose(),this.previousLuminanceRT&&this.previousLuminanceRT.dispose(),this.currentLuminanceRT&&this.currentLuminanceRT.dispose(),this.materialLuminance&&this.materialLuminance.dispose(),this.materialAdaptiveLum&&this.materialAdaptiveLum.dispose(),this.materialCopy&&this.materialCopy.dispose(),this.materialToneMap&&this.materialToneMap.dispose()}}t.AdaptiveToneMappingPass=l},23918:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(49190),o=n(70382);class l extends a.Pass{constructor(e=.96,t=o.AfterimageShader){super(),i(this,"shader"),i(this,"uniforms"),i(this,"textureComp"),i(this,"textureOld"),i(this,"shaderMaterial"),i(this,"compFsQuad"),i(this,"copyFsQuad"),this.shader=t,this.uniforms=s.UniformsUtils.clone(t.uniforms),this.uniforms.damp.value=e,this.textureComp=new s.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:s.LinearFilter,magFilter:s.NearestFilter,format:s.RGBAFormat}),this.textureOld=new s.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:s.LinearFilter,magFilter:s.NearestFilter,format:s.RGBAFormat}),this.shaderMaterial=new s.ShaderMaterial({uniforms:this.uniforms,vertexShader:this.shader.vertexShader,fragmentShader:this.shader.fragmentShader}),this.compFsQuad=new a.FullScreenQuad(this.shaderMaterial);let n=new s.MeshBasicMaterial;this.copyFsQuad=new a.FullScreenQuad(n)}render(e,t,n){this.uniforms.tOld.value=this.textureOld.texture,this.uniforms.tNew.value=n.texture,e.setRenderTarget(this.textureComp),this.compFsQuad.render(e),this.copyFsQuad.material.map=this.textureComp.texture,this.renderToScreen?(e.setRenderTarget(null),this.copyFsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.copyFsQuad.render(e));let r=this.textureOld;this.textureOld=this.textureComp,this.textureComp=r}setSize(e,t){this.textureComp.setSize(e,t),this.textureOld.setSize(e,t)}}t.AfterimagePass=l},62788:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(59564);class l extends s.Pass{constructor(e=1,t=25,n=4,r=256){super(),i(this,"renderTargetX"),i(this,"renderTargetY"),i(this,"materialCombine"),i(this,"materialConvolution"),i(this,"fsQuad"),i(this,"combineUniforms"),i(this,"convolutionUniforms"),i(this,"blurX",new a.Vector2(.001953125,0)),i(this,"blurY",new a.Vector2(0,.001953125)),this.renderTargetX=new a.WebGLRenderTarget(r,r),this.renderTargetX.texture.name="BloomPass.x",this.renderTargetY=new a.WebGLRenderTarget(r,r),this.renderTargetY.texture.name="BloomPass.y",this.combineUniforms=a.UniformsUtils.clone(c.uniforms),this.combineUniforms.strength.value=e,this.materialCombine=new a.ShaderMaterial({uniforms:this.combineUniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,blending:a.AdditiveBlending,transparent:!0}),void 0===o.ConvolutionShader&&console.error("BloomPass relies on ConvolutionShader");const l=o.ConvolutionShader;this.convolutionUniforms=a.UniformsUtils.clone(l.uniforms),this.convolutionUniforms.uImageIncrement.value=this.blurX,this.convolutionUniforms.cKernel.value=o.ConvolutionShader.buildKernel(n),this.materialConvolution=new a.ShaderMaterial({uniforms:this.convolutionUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,defines:{KERNEL_SIZE_FLOAT:t.toFixed(1),KERNEL_SIZE_INT:t.toFixed(0)}}),this.needsSwap=!1,this.fsQuad=new s.FullScreenQuad(this.materialConvolution)}render(e,t,n,r,i){i&&e.state.buffers.stencil.setTest(!1),this.fsQuad.material=this.materialConvolution,this.convolutionUniforms.tDiffuse.value=n.texture,this.convolutionUniforms.uImageIncrement.value=this.blurX,e.setRenderTarget(this.renderTargetX),e.clear(),this.fsQuad.render(e),this.convolutionUniforms.tDiffuse.value=this.renderTargetX.texture,this.convolutionUniforms.uImageIncrement.value=this.blurY,e.setRenderTarget(this.renderTargetY),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCombine,this.combineUniforms.tDiffuse.value=this.renderTargetY.texture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.clear&&e.clear(),this.fsQuad.render(e)}}const c={uniforms:{tDiffuse:{value:null},strength:{value:1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"\n uniform float strength;\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n gl_FragColor = strength * texel;\n }"};t.BloomPass=l},98263:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(73500);class l extends s.Pass{constructor(e,t,n){super(),i(this,"scene"),i(this,"camera"),i(this,"renderTargetDepth"),i(this,"materialDepth"),i(this,"materialBokeh"),i(this,"fsQuad"),i(this,"_oldClearColor"),i(this,"uniforms"),this.scene=e,this.camera=t;const r=void 0!==n.focus?n.focus:1,l=void 0!==n.aspect?n.aspect:t.aspect,c=void 0!==n.aperture?n.aperture:.025,h=void 0!==n.maxblur?n.maxblur:1,u=n.width||window.innerWidth||1,d=n.height||window.innerHeight||1;this.renderTargetDepth=new a.WebGLRenderTarget(u,d,{minFilter:a.NearestFilter,magFilter:a.NearestFilter}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new a.MeshDepthMaterial,this.materialDepth.depthPacking=a.RGBADepthPacking,this.materialDepth.blending=a.NoBlending,void 0===o.BokehShader&&console.error("BokehPass relies on BokehShader");const p=o.BokehShader,f=a.UniformsUtils.clone(p.uniforms);f.tDepth.value=this.renderTargetDepth.texture,f.focus.value=r,f.aspect.value=l,f.aperture.value=c,f.maxblur.value=h,f.nearClip.value=t.near,f.farClip.value=t.far,this.materialBokeh=new a.ShaderMaterial({defines:Object.assign({},p.defines),uniforms:f,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}),this.uniforms=f,this.needsSwap=!1,this.fsQuad=new s.FullScreenQuad(this.materialBokeh),this._oldClearColor=new a.Color}render(e,t,n){this.scene.overrideMaterial=this.materialDepth,e.getClearColor(this._oldClearColor);const r=e.getClearAlpha(),i=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.tColor.value=n.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this._oldClearColor),e.setClearAlpha(r),e.autoClear=i}}t.BokehPass=l},51761:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232);class o extends s.Pass{constructor(e,t){super(),i(this,"clearColor"),i(this,"clearAlpha"),i(this,"_oldClearColor"),this.needsSwap=!1,this.clearColor=void 0!==e?e:0,this.clearAlpha=void 0!==t?t:0,this._oldClearColor=new a.Color}render(e,t,n){let r;this.clearColor&&(e.getClearColor(this._oldClearColor),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),e.setRenderTarget(this.renderToScreen?null:n),e.clear(),this.clearColor&&e.setClearColor(this._oldClearColor,r)}}t.ClearPass=o},72449:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190);class s extends i.Pass{constructor(e,t,n=1){super(),this.camera=e,this.needsSwap=!1,this.cubeShader=r.ShaderLib.cube,this.cubeMesh=new r.Mesh(new r.BoxGeometry(10,10,10),new r.ShaderMaterial({uniforms:r.UniformsUtils.clone(this.cubeShader.uniforms),vertexShader:this.cubeShader.vertexShader,fragmentShader:this.cubeShader.fragmentShader,depthTest:!1,depthWrite:!1,side:r.BackSide})),Object.defineProperty(this.cubeMesh.material,"envMap",{get:function(){return this.uniforms.tCube.value}}),this.tCube=t,this.opacity=n,this.cubeScene=new r.Scene,this.cubeCamera=new r.PerspectiveCamera,this.cubeScene.add(this.cubeMesh)}render(e,t,n){const r=e.autoClear;e.autoClear=!1,this.cubeCamera.projectionMatrix.copy(this.camera.projectionMatrix),this.cubeCamera.quaternion.setFromRotationMatrix(this.camera.matrixWorld),this.cubeMesh.material.uniforms.tCube.value=this.tCube,this.cubeMesh.material.uniforms.tFlip.value=this.tCube.isCubeTexture&&!1===this.tCube.isRenderTargetTexture?-1:1,this.cubeMesh.material.uniforms.opacity.value=this.opacity,this.cubeMesh.material.transparent=this.opacity<1,e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(),e.render(this.cubeScene,this.cubeCamera),e.autoClear=r}dispose(){this.cubeMesh.geometry.dispose(),this.cubeMesh.material.dispose()}}t.CubeTexturePass=s},17214:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(15479);class l extends s.Pass{constructor(e,t,n){super(),i(this,"material"),i(this,"fsQuad"),i(this,"uniforms"),void 0===o.DotScreenShader&&console.error("THREE.DotScreenPass relies on THREE.DotScreenShader");const r=o.DotScreenShader;this.uniforms=a.UniformsUtils.clone(r.uniforms),void 0!==e&&this.uniforms.center.value.copy(e),void 0!==t&&(this.uniforms.angle.value=t),void 0!==n&&(this.uniforms.scale.value=n),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}),this.fsQuad=new s.FullScreenQuad(this.material)}render(e,t,n){this.uniforms.tDiffuse.value=n.texture,this.uniforms.tSize.value.set(n.width,n.height),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}t.DotScreenPass=l},1258:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(83453),o=n(18921),l=n(81362);t.EffectComposer=class{constructor(e,t){if(i(this,"renderer"),i(this,"_pixelRatio"),i(this,"_width"),i(this,"_height"),i(this,"renderTarget1"),i(this,"renderTarget2"),i(this,"writeBuffer"),i(this,"readBuffer"),i(this,"renderToScreen"),i(this,"passes",[]),i(this,"copyPass"),i(this,"clock"),this.renderer=e,void 0===t){const n={minFilter:s.LinearFilter,magFilter:s.LinearFilter,format:s.RGBAFormat},r=e.getSize(new s.Vector2);this._pixelRatio=e.getPixelRatio(),this._width=r.width,this._height=r.height,(t=new s.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,void 0===a.CopyShader&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===o.ShaderPass&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new o.ShaderPass(a.CopyShader),this.copyPass.material.blending=s.NoBlending,this.clock=new s.Clock}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;const r=this.passes.length;for(let i=0;i<r;i++){const t=this.passes[i];if(!1!==t.enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),t.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==l.MaskPass&&(t instanceof l.MaskPass?n=!0:t instanceof l.ClearMaskPass&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new s.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let i=0;i<this.passes.length;i++)this.passes[i].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}}},20591:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(29076);class l extends s.Pass{constructor(e,t,n,r){super(),i(this,"material"),i(this,"fsQuad"),i(this,"uniforms"),void 0===o.FilmShader&&console.error("THREE.FilmPass relies on FilmShader");const l=o.FilmShader;this.uniforms=a.UniformsUtils.clone(l.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}),void 0!==r&&(this.uniforms.grayscale.value=r),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==n&&(this.uniforms.sCount.value=n),this.fsQuad=new s.FullScreenQuad(this.material)}render(e,t,n,r){this.uniforms.tDiffuse.value=n.texture,this.uniforms.time.value+=r,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}t.FilmPass=l},88511:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(59305);class l extends s.Pass{constructor(e=64){super(),i(this,"material"),i(this,"fsQuad"),i(this,"goWild"),i(this,"curF"),i(this,"randX"),i(this,"uniforms"),this.uniforms=a.UniformsUtils.clone(o.DigitalGlitch.uniforms),this.uniforms.tDisp.value=this.generateHeightmap(e),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:o.DigitalGlitch.vertexShader,fragmentShader:o.DigitalGlitch.fragmentShader}),this.fsQuad=new s.FullScreenQuad(this.material),this.goWild=!1,this.curF=0,this.generateTrigger()}render(e,t,n){!1===e.capabilities.isWebGL2&&(this.uniforms.tDisp.value.format=a.LuminanceFormat),this.uniforms.tDiffuse.value=n.texture,this.uniforms.seed.value=Math.random(),this.uniforms.byp.value=0,this.curF%this.randX==0||1==this.goWild?(this.uniforms.amount.value=Math.random()/30,this.uniforms.angle.value=a.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.seed_x.value=a.MathUtils.randFloat(-1,1),this.uniforms.seed_y.value=a.MathUtils.randFloat(-1,1),this.uniforms.distortion_x.value=a.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=a.MathUtils.randFloat(0,1),this.curF=0,this.generateTrigger()):this.curF%this.randX<this.randX/5?(this.uniforms.amount.value=Math.random()/90,this.uniforms.angle.value=a.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.distortion_x.value=a.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=a.MathUtils.randFloat(0,1),this.uniforms.seed_x.value=a.MathUtils.randFloat(-.3,.3),this.uniforms.seed_y.value=a.MathUtils.randFloat(-.3,.3)):0==this.goWild&&(this.uniforms.byp.value=1),this.curF++,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}generateTrigger(){this.randX=a.MathUtils.randInt(120,240)}generateHeightmap(e){const t=new Float32Array(e*e),n=e*e;for(let i=0;i<n;i++){const e=a.MathUtils.randFloat(0,1);t[i]=e}const r=new a.DataTexture(t,e,e,a.RedFormat,a.FloatType);return r.needsUpdate=!0,r}}t.GlitchPass=l},5050:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(79169);class l extends s.Pass{constructor(e,t,n){super(),i(this,"material"),i(this,"fsQuad"),i(this,"uniforms"),void 0===o.HalftoneShader&&console.error("THREE.HalftonePass requires HalftoneShader"),this.uniforms=a.UniformsUtils.clone(o.HalftoneShader.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,fragmentShader:o.HalftoneShader.fragmentShader,vertexShader:o.HalftoneShader.vertexShader}),this.uniforms.width.value=e,this.uniforms.height.value=t;for(const r in n)n.hasOwnProperty(r)&&this.uniforms.hasOwnProperty(r)&&(this.uniforms[r].value=n[r]);this.fsQuad=new s.FullScreenQuad(this.material)}render(e,t,n){this.material.uniforms.tDiffuse.value=n.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}setSize(e,t){this.uniforms.width.value=e,this.uniforms.height.value=t}}t.HalftonePass=l},834:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(18921),i={defines:{USE_3DTEXTURE:1},uniforms:{lut3d:{value:null},lut:{value:null},lutSize:{value:0},tDiffuse:{value:null},intensity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}\n\n\t",fragmentShader:"\n\n\t\tuniform float lutSize;\n\t\t#if USE_3DTEXTURE\n\t\tprecision highp sampler3D;\n\t\tuniform sampler3D lut3d;\n\t\t#else\n\t\tuniform sampler2D lut;\n\n\t\tvec3 lutLookup( sampler2D tex, float size, vec3 rgb ) {\n\n\t\t\tfloat sliceHeight = 1.0 / size;\n\t\t\tfloat yPixelHeight = 1.0 / ( size * size );\n\n\t\t\t// Get the slices on either side of the sample\n\t\t\tfloat slice = rgb.b * size;\n\t\t\tfloat interp = fract( slice );\n\t\t\tfloat slice0 = slice - interp;\n\t\t\tfloat centeredInterp = interp - 0.5;\n\n\t\t\tfloat slice1 = slice0 + sign( centeredInterp );\n\n\t\t\t// Pull y sample in by half a pixel in each direction to avoid color\n\t\t\t// bleeding from adjacent slices.\n\t\t\tfloat greenOffset = clamp( rgb.g * sliceHeight, yPixelHeight * 0.5, sliceHeight - yPixelHeight * 0.5 );\n\n\t\t\tvec2 uv0 = vec2(\n\t\t\t\trgb.r,\n\t\t\t\tslice0 * sliceHeight + greenOffset\n\t\t\t);\n\t\t\tvec2 uv1 = vec2(\n\t\t\t\trgb.r,\n\t\t\t\tslice1 * sliceHeight + greenOffset\n\t\t\t);\n\n\t\t\tvec3 sample0 = texture2D( tex, uv0 ).rgb;\n\t\t\tvec3 sample1 = texture2D( tex, uv1 ).rgb;\n\n\t\t\treturn mix( sample0, sample1, abs( centeredInterp ) );\n\n\t\t}\n\t\t#endif\n\n\t\tvarying vec2 vUv;\n\t\tuniform float intensity;\n\t\tuniform sampler2D tDiffuse;\n\t\tvoid main() {\n\n\t\t\tvec4 val = texture2D( tDiffuse, vUv );\n\t\t\tvec4 lutVal;\n\n\t\t\t// pull the sample in by half a pixel so the sample begins\n\t\t\t// at the center of the edge pixels.\n\t\t\tfloat pixelWidth = 1.0 / lutSize;\n\t\t\tfloat halfPixelWidth = 0.5 / lutSize;\n\t\t\tvec3 uvw = vec3( halfPixelWidth ) + val.rgb * ( 1.0 - pixelWidth );\n\n\t\t\t#if USE_3DTEXTURE\n\n\t\t\tlutVal = vec4( texture( lut3d, uvw ).rgb, val.a );\n\n\t\t\t#else\n\n\t\t\tlutVal = vec4( lutLookup( lut, lutSize, uvw ), val.a );\n\n\t\t\t#endif\n\n\t\t\tgl_FragColor = vec4( mix( val, lutVal, intensity ) );\n\n\t\t}\n\n\t"};class s extends r.ShaderPass{set lut(e){const t=this.material;if(e!==this.lut&&(t.uniforms.lut3d.value=null,t.uniforms.lut.value=null,e)){const n=e.isData3DTexture?1:0;n!==t.defines.USE_3DTEXTURE&&(t.defines.USE_3DTEXTURE=n,t.needsUpdate=!0),t.uniforms.lutSize.value=e.image.width,e.isData3DTexture?t.uniforms.lut3d.value=e:t.uniforms.lut.value=e}}get lut(){return this.material.uniforms.lut.value||this.material.uniforms.lut3d.value}set intensity(e){this.material.uniforms.intensity.value=e}get intensity(){return this.material.uniforms.intensity.value}constructor(e={}){super(i),this.lut=e.lut||null,this.intensity="intensity"in e?e.intensity:1}}t.LUTPass=s},81362:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190);class a extends s.Pass{constructor(e,t){super(),i(this,"scene"),i(this,"camera"),i(this,"inverse"),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class o extends s.Pass{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}t.ClearMaskPass=o,t.MaskPass=a},79666:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(49190),a=n(85232),o=n(83453);class l extends s.Pass{constructor(e,t,n,r){super(),i(this,"renderScene"),i(this,"renderCamera"),i(this,"selectedObjects"),i(this,"visibleEdgeColor"),i(this,"hiddenEdgeColor"),i(this,"edgeGlow"),i(this,"usePatternTexture"),i(this,"edgeThickness"),i(this,"edgeStrength"),i(this,"downSampleRatio"),i(this,"pulsePeriod"),i(this,"resolution"),i(this,"renderTargetMaskBuffer"),i(this,"depthMaterial"),i(this,"prepareMaskMaterial"),i(this,"renderTargetDepthBuffer"),i(this,"renderTargetMaskDownSampleBuffer"),i(this,"renderTargetBlurBuffer1"),i(this,"renderTargetBlurBuffer2"),i(this,"edgeDetectionMaterial"),i(this,"renderTargetEdgeBuffer1"),i(this,"renderTargetEdgeBuffer2"),i(this,"separableBlurMaterial1"),i(this,"separableBlurMaterial2"),i(this,"overlayMaterial"),i(this,"materialCopy"),i(this,"oldClearAlpha"),i(this,"fsQuad"),i(this,"tempPulseColor1"),i(this,"tempPulseColor2"),i(this,"textureMatrix"),i(this,"patternTexture"),i(this,"_visibilityCache"),i(this,"_oldClearColor"),i(this,"copyUniforms"),i(this,"BlurDirectionX",new a.Vector2(1,0)),i(this,"BlurDirectionY",new a.Vector2(0,1)),this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new a.Color(1,1,1),this.hiddenEdgeColor=new a.Color(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);const l=Math.round(this.resolution.x/this.downSampleRatio),c=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.side=a.DoubleSide,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=a.DoubleSide,this.prepareMaskMaterial.fragmentShader=function(e,t){const n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new a.WebGLRenderTarget(l,c),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new a.WebGLRenderTarget(l,c),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new a.WebGLRenderTarget(Math.round(l/2),Math.round(c/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new a.WebGLRenderTarget(l,c),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new a.WebGLRenderTarget(Math.round(l/2),Math.round(c/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(l,c),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(l/2),Math.round(c/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===o.CopyShader&&console.error("THREE.OutlinePass relies on CopyShader");const h=o.CopyShader;this.copyUniforms=a.UniformsUtils.clone(h.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,blending:a.NoBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new a.Color,this.oldClearAlpha=1,this.fsQuad=new s.FullScreenQuad(this.materialCopy),this.tempPulseColor1=new a.Color,this.tempPulseColor2=new a.Color,this.textureMatrix=new a.Matrix4}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(e,t){this.renderTargetMaskBuffer.setSize(e,t),this.renderTargetDepthBuffer.setSize(e,t);let n=Math.round(e/this.downSampleRatio),r=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(n,r),this.renderTargetBlurBuffer1.setSize(n,r),this.renderTargetEdgeBuffer1.setSize(n,r),this.separableBlurMaterial1.uniforms.texSize.value.set(n,r),n=Math.round(n/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(n,r),this.renderTargetEdgeBuffer2.setSize(n,r),this.separableBlurMaterial2.uniforms.texSize.value.set(n,r)}changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function n(n){n.isMesh&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}for(let r=0;r<this.selectedObjects.length;r++){this.selectedObjects[r].traverse(n)}}changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,n=[];function r(e){e.isMesh&&n.push(e)}for(let i=0;i<this.selectedObjects.length;i++){this.selectedObjects[i].traverse(r)}this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){let i=!1;for(let e=0;e<n.length;e++){if(n[e].id===r.id){i=!0;break}}if(!1===i){const n=r.visible;!1!==e&&!0!==t.get(r)||(r.visible=e),t.set(r,n)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,n,r,i){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,i&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=this.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=this.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=this.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=this.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tvoid main() {\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\t\t\t\t\tvPosition = mvPosition;\n\t\t\t\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\t\t\t\tvoid main() {\n\t\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\t\t\t\t}"})}getEdgeDetectionMaterial(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}getSeperableBlurMaterial(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}getOverlayMaterial(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}t.OutlinePass=l},49190:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);t.FullScreenQuad=class{constructor(e){i(this,"camera",new s.OrthographicCamera(-1,1,1,-1,0,1)),i(this,"geometry",new s.PlaneGeometry(2,2)),i(this,"mesh"),this.mesh=new s.Mesh(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}},t.Pass=class{constructor(){i(this,"enabled",!0),i(this,"needsSwap",!0),i(this,"clear",!1),i(this,"renderToScreen",!1)}setSize(e,t){}render(e,t,n,r,i){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}},27251:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(49190);class o extends a.Pass{constructor(e,t,n,r,a=0){super(),i(this,"scene"),i(this,"camera"),i(this,"overrideMaterial"),i(this,"clearColor"),i(this,"clearAlpha"),i(this,"clearDepth",!1),i(this,"_oldClearColor",new s.Color),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=a,this.clear=!0,this.needsSwap=!1}render(e,t,n){let r,i=e.autoClear;e.autoClear=!1;let s=null;void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,r),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=i}}t.RenderPass=o},17497:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190);class s extends i.Pass{constructor(e,t,n,s,o={}){var l,c;super(),this.pixelSize=t,this.resolution=new r.Vector2,this.renderResolution=new r.Vector2,this.setSize(e.x,e.y),this.fsQuad=new i.FullScreenQuad(this.material()),this.scene=n,this.camera=s,this.normalEdgeStrength=null!=(l=o.normalEdgeStrength)?l:.3,this.depthEdgeStrength=null!=(c=o.depthEdgeStrength)?c:.4,this.rgbRenderTarget=a(this.renderResolution,r.RGBAFormat,!0),this.normalRenderTarget=a(this.renderResolution,r.RGBAFormat,!1),this.normalMaterial=new r.MeshNormalMaterial}dispose(){this.rgbRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.fsQuad.dispose()}setSize(e,t){var n,r,i;this.resolution.set(e,t),this.renderResolution.set(e/this.pixelSize|0,t/this.pixelSize|0);const{x:s,y:a}=this.renderResolution;null==(n=this.rgbRenderTarget)||n.setSize(s,a),null==(r=this.normalRenderTarget)||r.setSize(s,a),null==(i=this.fsQuad)||i.material.uniforms.resolution.value.set(s,a,1/s,1/a)}setPixelSize(e){this.pixelSize=e,this.setSize(this.resolution.x,this.resolution.y)}render(e,t){const n=this.fsQuad.material.uniforms;n.normalEdgeStrength.value=this.normalEdgeStrength,n.depthEdgeStrength.value=this.depthEdgeStrength,e.setRenderTarget(this.rgbRenderTarget),e.render(this.scene,this.camera);const r=this.scene.overrideMaterial;e.setRenderTarget(this.normalRenderTarget),this.scene.overrideMaterial=this.normalMaterial,e.render(this.scene,this.camera),this.scene.overrideMaterial=r,n.tDiffuse.value=this.rgbRenderTarget.texture,n.tDepth.value=this.rgbRenderTarget.depthTexture,n.tNormal.value=this.normalRenderTarget.texture,this.renderToScreen?e.setRenderTarget(null):(e.setRenderTarget(t),this.clear&&e.clear()),this.fsQuad.render(e)}material(){return new r.ShaderMaterial({uniforms:{tDiffuse:{value:null},tDepth:{value:null},tNormal:{value:null},resolution:{value:new r.Vector4(this.renderResolution.x,this.renderResolution.y,1/this.renderResolution.x,1/this.renderResolution.y)},normalEdgeStrength:{value:0},depthEdgeStrength:{value:0}},vertexShader:"\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t\t",fragmentShader:"\n\t\t\t\tuniform sampler2D tDiffuse;\n\t\t\t\tuniform sampler2D tDepth;\n\t\t\t\tuniform sampler2D tNormal;\n\t\t\t\tuniform vec4 resolution;\n\t\t\t\tuniform float normalEdgeStrength;\n\t\t\t\tuniform float depthEdgeStrength;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tfloat getDepth(int x, int y) {\n\n\t\t\t\t\treturn texture2D( tDepth, vUv + vec2(x, y) * resolution.zw ).r;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 getNormal(int x, int y) {\n\n\t\t\t\t\treturn texture2D( tNormal, vUv + vec2(x, y) * resolution.zw ).rgb * 2.0 - 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tfloat depthEdgeIndicator(float depth, vec3 normal) {\n\n\t\t\t\t\tfloat diff = 0.0;\n\t\t\t\t\tdiff += clamp(getDepth(1, 0) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(-1, 0) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(0, 1) - depth, 0.0, 1.0);\n\t\t\t\t\tdiff += clamp(getDepth(0, -1) - depth, 0.0, 1.0);\n\t\t\t\t\treturn floor(smoothstep(0.01, 0.02, diff) * 2.) / 2.;\n\n\t\t\t\t}\n\n\t\t\t\tfloat neighborNormalEdgeIndicator(int x, int y, float depth, vec3 normal) {\n\n\t\t\t\t\tfloat depthDiff = getDepth(x, y) - depth;\n\t\t\t\t\tvec3 neighborNormal = getNormal(x, y);\n\t\t\t\t\t\n\t\t\t\t\t// Edge pixels should yield to faces who's normals are closer to the bias normal.\n\t\t\t\t\tvec3 normalEdgeBias = vec3(1., 1., 1.); // This should probably be a parameter.\n\t\t\t\t\tfloat normalDiff = dot(normal - neighborNormal, normalEdgeBias);\n\t\t\t\t\tfloat normalIndicator = clamp(smoothstep(-.01, .01, normalDiff), 0.0, 1.0);\n\t\t\t\t\t\n\t\t\t\t\t// Only the shallower pixel should detect the normal edge.\n\t\t\t\t\tfloat depthIndicator = clamp(sign(depthDiff * .25 + .0025), 0.0, 1.0);\n\n\t\t\t\t\treturn (1.0 - dot(normal, neighborNormal)) * depthIndicator * normalIndicator;\n\n\t\t\t\t}\n\n\t\t\t\tfloat normalEdgeIndicator(float depth, vec3 normal) {\n\t\t\t\t\t\n\t\t\t\t\tfloat indicator = 0.0;\n\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(0, -1, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(0, 1, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(-1, 0, depth, normal);\n\t\t\t\t\tindicator += neighborNormalEdgeIndicator(1, 0, depth, normal);\n\n\t\t\t\t\treturn step(0.1, indicator);\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\t\t\tfloat depth = 0.0;\n\t\t\t\t\tvec3 normal = vec3(0.0);\n\n\t\t\t\t\tif (depthEdgeStrength > 0.0 || normalEdgeStrength > 0.0) {\n\n\t\t\t\t\t\tdepth = getDepth(0, 0);\n\t\t\t\t\t\tnormal = getNormal(0, 0);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat dei = 0.0;\n\t\t\t\t\tif (depthEdgeStrength > 0.0) \n\t\t\t\t\t\tdei = depthEdgeIndicator(depth, normal);\n\n\t\t\t\t\tfloat nei = 0.0; \n\t\t\t\t\tif (normalEdgeStrength > 0.0) \n\t\t\t\t\t\tnei = normalEdgeIndicator(depth, normal);\n\n\t\t\t\t\tfloat Strength = dei > 0.0 ? (1.0 - depthEdgeStrength * dei) : (1.0 + normalEdgeStrength * nei);\n\n\t\t\t\t\tgl_FragColor = texel * Strength;\n\n\t\t\t\t}\n\t\t\t\t"})}}function a(e,t,n){const i=new r.WebGLRenderTarget(e.x,e.y,n?{depthTexture:new r.DepthTexture(e.x,e.y),depthBuffer:!0}:void 0);return i.texture.format=t,i.texture.minFilter=r.NearestFilter,i.texture.magFilter=r.NearestFilter,i.texture.generateMipmaps=!1,i.stencilBuffer=!1,i}t.RenderPixelatedPass=s},96665:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(49190),a=n(24730),o=n(86170),l=n(83453),c=n(65149);class h extends s.Pass{constructor(e,t,n=!1,r=!1,h=new i.Vector2(256,256)){let u;super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=n,this.supportsNormalTexture=r,this.originalClearColor=new i.Color,this._oldClearColor=new i.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=new i.Vector2(h.x,h.y),this.saoRenderTarget=new i.WebGLRenderTarget(this.resolution.x,this.resolution.y,{type:i.HalfFloatType}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new i.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension&&(u=new i.DepthTexture,u.type=i.UnsignedShortType,this.beautyRenderTarget.depthTexture=u,this.beautyRenderTarget.depthBuffer=!0),this.depthMaterial=new i.MeshDepthMaterial,this.depthMaterial.depthPacking=i.RGBADepthPacking,this.depthMaterial.blending=i.NoBlending,this.normalMaterial=new i.MeshNormalMaterial,this.normalMaterial.blending=i.NoBlending,this.saoMaterial=new i.ShaderMaterial({defines:Object.assign({},a.SAOShader.defines),fragmentShader:a.SAOShader.fragmentShader,vertexShader:a.SAOShader.vertexShader,uniforms:i.UniformsUtils.clone(a.SAOShader.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?u:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=i.NoBlending,this.vBlurMaterial=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(o.DepthLimitedBlurShader.uniforms),defines:Object.assign({},o.DepthLimitedBlurShader.defines),vertexShader:o.DepthLimitedBlurShader.vertexShader,fragmentShader:o.DepthLimitedBlurShader.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?u:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=i.NoBlending,this.hBlurMaterial=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(o.DepthLimitedBlurShader.uniforms),defines:Object.assign({},o.DepthLimitedBlurShader.defines),vertexShader:o.DepthLimitedBlurShader.vertexShader,fragmentShader:o.DepthLimitedBlurShader.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?u:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=i.NoBlending,this.materialCopy=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(l.CopyShader.uniforms),vertexShader:l.CopyShader.vertexShader,fragmentShader:l.CopyShader.fragmentShader,blending:i.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=i.CustomBlending,this.materialCopy.blendSrc=i.DstColorFactor,this.materialCopy.blendDst=i.ZeroFactor,this.materialCopy.blendEquation=i.AddEquation,this.materialCopy.blendSrcAlpha=i.DstAlphaFactor,this.materialCopy.blendDstAlpha=i.ZeroFactor,this.materialCopy.blendEquationAlpha=i.AddEquation,this.depthCopy=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(c.UnpackDepthRGBAShader.uniforms),vertexShader:c.UnpackDepthRGBAShader.vertexShader,fragmentShader:c.UnpackDepthRGBAShader.fragmentShader,blending:i.NoBlending}),this.fsQuad=new s.FullScreenQuad(null)}render(e,t,n){if(this.renderToScreen&&(this.materialCopy.blending=i.NoBlending,this.materialCopy.uniforms.tDiffuse.value=n.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1===this.params.output)return;e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const r=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;const s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(o.BlurShaderUtils.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new i.Vector2(0,1)),o.BlurShaderUtils.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new i.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));let a=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,a=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?a.blending=i.CustomBlending:a.blending=i.NoBlending,this.renderPass(e,a,this.renderToScreen?null:n),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}renderPass(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}dispose(){this.saoRenderTarget.dispose(),this.blurIntermediateRenderTarget.dispose(),this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.depthRenderTarget.dispose(),this.depthMaterial.dispose(),this.normalMaterial.dispose(),this.saoMaterial.dispose(),this.vBlurMaterial.dispose(),this.hBlurMaterial.dispose(),this.materialCopy.dispose(),this.depthCopy.dispose(),this.fsQuad.dispose()}}var u;((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(h,"symbol"!=typeof(u="OUTPUT")?u+"":u,{Beauty:1,Default:0,SAO:2,Depth:3,Normal:4}),t.SAOPass=h},7679:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190),s=n(27407);class a extends i.Pass{constructor(e,t){super(),this.edgesRT=new r.WebGLRenderTarget(e,t,{depthBuffer:!1}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new r.WebGLRenderTarget(e,t,{depthBuffer:!1}),this.weightsRT.texture.name="SMAAPass.weights";const n=this,a=new Image;a.src=this.getAreaTexture(),a.onload=function(){n.areaTexture.needsUpdate=!0},this.areaTexture=new r.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=a,this.areaTexture.minFilter=r.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.flipY=!1;const o=new Image;o.src=this.getSearchTexture(),o.onload=function(){n.searchTexture.needsUpdate=!0},this.searchTexture=new r.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=r.NearestFilter,this.searchTexture.minFilter=r.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.flipY=!1,void 0===s.SMAAEdgesShader&&console.error("THREE.SMAAPass relies on SMAAShader"),this.uniformsEdges=r.UniformsUtils.clone(s.SMAAEdgesShader.uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new r.ShaderMaterial({defines:Object.assign({},s.SMAAEdgesShader.defines),uniforms:this.uniformsEdges,vertexShader:s.SMAAEdgesShader.vertexShader,fragmentShader:s.SMAAEdgesShader.fragmentShader}),this.uniformsWeights=r.UniformsUtils.clone(s.SMAAWeightsShader.uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new r.ShaderMaterial({defines:Object.assign({},s.SMAAWeightsShader.defines),uniforms:this.uniformsWeights,vertexShader:s.SMAAWeightsShader.vertexShader,fragmentShader:s.SMAAWeightsShader.fragmentShader}),this.uniformsBlend=r.UniformsUtils.clone(s.SMAABlendShader.uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new r.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:s.SMAABlendShader.vertexShader,fragmentShader:s.SMAABlendShader.fragmentShader}),this.needsSwap=!1,this.fsQuad=new i.FullScreenQuad(null)}render(e,t,n){this.uniformsEdges.tDiffuse.value=n.texture,this.fsQuad.material=this.materialEdges,e.setRenderTarget(this.edgesRT),this.clear&&e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialWeights,e.setRenderTarget(this.weightsRT),this.clear&&e.clear(),this.fsQuad.render(e),this.uniformsBlend.tColor.value=n.texture,this.fsQuad.material=this.materialBlend,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}setSize(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)}getAreaTexture(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="}getSearchTexture(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}t.SMAAPass=a},44652:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190),s=n(83453);class a extends i.Pass{constructor(e,t,n,a){super(),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==n?n:0,this.clearAlpha=void 0!==a?a:0,this._oldClearColor=new r.Color;const o=s.CopyShader;this.copyUniforms=r.UniformsUtils.clone(o.uniforms),this.copyMaterial=new r.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,premultipliedAlpha:!0,blending:r.AdditiveBlending}),this.fsQuad=new i.FullScreenQuad(this.copyMaterial)}dispose(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null),this.copyMaterial.dispose(),this.fsQuad.dispose()}setSize(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)}render(e,t,n){this.sampleRenderTarget||(this.sampleRenderTarget=new r.WebGLRenderTarget(n.width,n.height,{type:r.HalfFloatType}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");const i=o[Math.max(0,Math.min(this.sampleLevel,5))],s=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);const a=e.getClearAlpha(),l=1/i.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;const c={fullWidth:n.width,fullHeight:n.height,offsetX:0,offsetY:0,width:n.width,height:n.height},h=Object.assign({},this.camera.view);h.enabled&&Object.assign(c,h);for(let r=0;r<i.length;r++){const n=i[r];this.camera.setViewOffset&&this.camera.setViewOffset(c.fullWidth,c.fullHeight,c.offsetX+.0625*n[0],c.offsetY+.0625*n[1],c.width,c.height);let s=l;if(this.unbiased){s+=.03125*((r+.5)/i.length-.5)}this.copyUniforms.opacity.value=s,e.setClearColor(this.clearColor,this.clearAlpha),e.setRenderTarget(this.sampleRenderTarget),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.renderToScreen?null:t),0===r&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e)}this.camera.setViewOffset&&h.enabled?this.camera.setViewOffset(h.fullWidth,h.fullHeight,h.offsetX,h.offsetY,h.width,h.height):this.camera.clearViewOffset&&this.camera.clearViewOffset(),e.autoClear=s,e.setClearColor(this._oldClearColor,a)}}const o=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];t.SSAARenderPass=a},44441:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(49190),a=n(84181),o=n(48463),l=n(83453),c=class extends s.Pass{constructor(e,t,n,r){super(),this.width=void 0!==n?n:512,this.height=void 0!==r?r:512,this.clear=!0,this.camera=t,this.scene=e,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this._visibilityCache=new Map,this.generateSampleKernel(),this.generateRandomKernelRotations();const a=new i.DepthTexture;a.format=i.DepthStencilFormat,a.type=i.UnsignedInt248Type,this.beautyRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.normalRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,depthTexture:a}),this.ssaoRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),void 0===o.SSAOShader&&console.error("THREE.SSAOPass: The pass relies on SSAOShader."),this.ssaoMaterial=new i.ShaderMaterial({defines:Object.assign({},o.SSAOShader.defines),uniforms:i.UniformsUtils.clone(o.SSAOShader.uniforms),vertexShader:o.SSAOShader.vertexShader,fragmentShader:o.SSAOShader.fragmentShader,blending:i.NoBlending}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new i.MeshNormalMaterial,this.normalMaterial.blending=i.NoBlending,this.blurMaterial=new i.ShaderMaterial({defines:Object.assign({},o.SSAOBlurShader.defines),uniforms:i.UniformsUtils.clone(o.SSAOBlurShader.uniforms),vertexShader:o.SSAOBlurShader.vertexShader,fragmentShader:o.SSAOBlurShader.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new i.ShaderMaterial({defines:Object.assign({},o.SSAODepthShader.defines),uniforms:i.UniformsUtils.clone(o.SSAODepthShader.uniforms),vertexShader:o.SSAODepthShader.vertexShader,fragmentShader:o.SSAODepthShader.fragmentShader,blending:i.NoBlending}),this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(l.CopyShader.uniforms),vertexShader:l.CopyShader.vertexShader,fragmentShader:l.CopyShader.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:i.DstColorFactor,blendDst:i.ZeroFactor,blendEquation:i.AddEquation,blendSrcAlpha:i.DstAlphaFactor,blendDstAlpha:i.ZeroFactor,blendEquationAlpha:i.AddEquation}),this.fsQuad=new s.FullScreenQuad(null),this.originalClearColor=new i.Color}dispose(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(!1===e.capabilities.isWebGL2&&(this.noiseTexture.format=i.LuminanceFormat),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case c.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case c.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case c.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case c.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case c.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case c.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=i.CustomBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,n,r,i){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t)}generateSampleKernel(){const e=this.kernelSize,t=this.kernel;for(let n=0;n<e;n++){const r=new i.Vector3;r.x=2*Math.random()-1,r.y=2*Math.random()-1,r.z=Math.random(),r.normalize();let s=n/e;s=i.MathUtils.lerp(.1,1,s*s),r.multiplyScalar(s),t.push(r)}}generateRandomKernelRotations(){void 0===a.SimplexNoise&&console.error("THREE.SSAOPass: The pass relies on SimplexNoise.");const e=new a.SimplexNoise,t=new Float32Array(16);for(let n=0;n<16;n++){const r=2*Math.random()-1,i=2*Math.random()-1,s=0;t[n]=e.noise3d(r,i,s)}this.noiseTexture=new i.DataTexture(t,4,4,i.RedFormat,i.FloatType),this.noiseTexture.wrapS=i.RepeatWrapping,this.noiseTexture.wrapT=i.RepeatWrapping,this.noiseTexture.needsUpdate=!0}overrideVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){t.set(e,e.visible),(e.isPoints||e.isLine)&&(e.visible=!1)}))}restoreVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse((function(e){const n=t.get(e);e.visible=n})),t.clear()}};let h=c;var u;((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(h,"symbol"!=typeof(u="OUTPUT")?u+"":u,{Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5}),t.SSAOPass=h},18526:(e,t,n)=>{"use strict";var r=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const i=n(85232),s=n(49190),a=n(30424),o=n(83453),l=class extends s.Pass{constructor({renderer:e,scene:t,camera:n,width:r,height:l,selects:c,bouncing:h=!1,groundReflector:u}){super(),this.width=void 0!==r?r:512,this.height=void 0!==l?l:512,this.clear=!0,this.renderer=e,this.scene=t,this.camera=n,this.groundReflector=u,this.opacity=a.SSRShader.uniforms.opacity.value,this.output=0,this.maxDistance=a.SSRShader.uniforms.maxDistance.value,this.thickness=a.SSRShader.uniforms.thickness.value,this.tempColor=new i.Color,this._selects=c,this.selective=Array.isArray(this._selects),Object.defineProperty(this,"selects",{get(){return this._selects},set(e){this._selects!==e&&(this._selects=e,Array.isArray(e)?(this.selective=!0,this.ssrMaterial.defines.SELECTIVE=!0,this.ssrMaterial.needsUpdate=!0):(this.selective=!1,this.ssrMaterial.defines.SELECTIVE=!1,this.ssrMaterial.needsUpdate=!0))}}),this._bouncing=h,Object.defineProperty(this,"bouncing",{get(){return this._bouncing},set(e){this._bouncing!==e&&(this._bouncing=e,this.ssrMaterial.uniforms.tDiffuse.value=e?this.prevRenderTarget.texture:this.beautyRenderTarget.texture)}}),this.blur=!0,this._distanceAttenuation=a.SSRShader.defines.DISTANCE_ATTENUATION,Object.defineProperty(this,"distanceAttenuation",{get(){return this._distanceAttenuation},set(e){this._distanceAttenuation!==e&&(this._distanceAttenuation=e,this.ssrMaterial.defines.DISTANCE_ATTENUATION=e,this.ssrMaterial.needsUpdate=!0)}}),this._fresnel=a.SSRShader.defines.FRESNEL,Object.defineProperty(this,"fresnel",{get(){return this._fresnel},set(e){this._fresnel!==e&&(this._fresnel=e,this.ssrMaterial.defines.FRESNEL=e,this.ssrMaterial.needsUpdate=!0)}}),this._infiniteThick=a.SSRShader.defines.INFINITE_THICK,Object.defineProperty(this,"infiniteThick",{get(){return this._infiniteThick},set(e){this._infiniteThick!==e&&(this._infiniteThick=e,this.ssrMaterial.defines.INFINITE_THICK=e,this.ssrMaterial.needsUpdate=!0)}});const d=new i.DepthTexture;d.type=i.UnsignedShortType,d.minFilter=i.NearestFilter,d.magFilter=i.NearestFilter,this.beautyRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType,depthTexture:d,depthBuffer:!0}),this.prevRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter}),this.normalRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType}),this.metalnessRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType}),this.ssrRenderTarget=new i.WebGLRenderTarget(this.width,this.height,{minFilter:i.NearestFilter,magFilter:i.NearestFilter}),this.blurRenderTarget=this.ssrRenderTarget.clone(),this.blurRenderTarget2=this.ssrRenderTarget.clone(),this.ssrMaterial=new i.ShaderMaterial({defines:Object.assign({},a.SSRShader.defines,{MAX_STEP:Math.sqrt(this.width*this.width+this.height*this.height)}),uniforms:i.UniformsUtils.clone(a.SSRShader.uniforms),vertexShader:a.SSRShader.vertexShader,fragmentShader:a.SSRShader.fragmentShader,blending:i.NoBlending}),this.ssrMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssrMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssrMaterial.defines.SELECTIVE=this.selective,this.ssrMaterial.needsUpdate=!0,this.ssrMaterial.uniforms.tMetalness.value=this.metalnessRenderTarget.texture,this.ssrMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.ssrMaterial.uniforms.cameraNear.value=this.camera.near,this.ssrMaterial.uniforms.cameraFar.value=this.camera.far,this.ssrMaterial.uniforms.thickness.value=this.thickness,this.ssrMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new i.MeshNormalMaterial,this.normalMaterial.blending=i.NoBlending,this.metalnessOnMaterial=new i.MeshBasicMaterial({color:"white"}),this.metalnessOffMaterial=new i.MeshBasicMaterial({color:"black"}),this.blurMaterial=new i.ShaderMaterial({defines:Object.assign({},a.SSRBlurShader.defines),uniforms:i.UniformsUtils.clone(a.SSRBlurShader.uniforms),vertexShader:a.SSRBlurShader.vertexShader,fragmentShader:a.SSRBlurShader.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.blurMaterial2=new i.ShaderMaterial({defines:Object.assign({},a.SSRBlurShader.defines),uniforms:i.UniformsUtils.clone(a.SSRBlurShader.uniforms),vertexShader:a.SSRBlurShader.vertexShader,fragmentShader:a.SSRBlurShader.fragmentShader}),this.blurMaterial2.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.blurMaterial2.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new i.ShaderMaterial({defines:Object.assign({},a.SSRDepthShader.defines),uniforms:i.UniformsUtils.clone(a.SSRDepthShader.uniforms),vertexShader:a.SSRDepthShader.vertexShader,fragmentShader:a.SSRDepthShader.fragmentShader,blending:i.NoBlending}),this.depthRenderMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new i.ShaderMaterial({uniforms:i.UniformsUtils.clone(o.CopyShader.uniforms),vertexShader:o.CopyShader.vertexShader,fragmentShader:o.CopyShader.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendEquation:i.AddEquation,blendSrcAlpha:i.SrcAlphaFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor,blendEquationAlpha:i.AddEquation}),this.fsQuad=new s.FullScreenQuad(null),this.originalClearColor=new i.Color}dispose(){this.beautyRenderTarget.dispose(),this.prevRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.metalnessRenderTarget.dispose(),this.ssrRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.blurRenderTarget2.dispose(),this.normalMaterial.dispose(),this.metalnessOnMaterial.dispose(),this.metalnessOffMaterial.dispose(),this.blurMaterial.dispose(),this.blurMaterial2.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(e,t){switch(e.setRenderTarget(this.beautyRenderTarget),e.clear(),this.groundReflector&&(this.groundReflector.visible=!1,this.groundReflector.doRender(this.renderer,this.scene,this.camera),this.groundReflector.visible=!0),e.render(this.scene,this.camera),this.groundReflector&&(this.groundReflector.visible=!1),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,0,0),this.selective&&this.renderMetalness(e,this.metalnessOnMaterial,this.metalnessRenderTarget,0,0),this.ssrMaterial.uniforms.opacity.value=this.opacity,this.ssrMaterial.uniforms.maxDistance.value=this.maxDistance,this.ssrMaterial.uniforms.thickness.value=this.thickness,this.renderPass(e,this.ssrMaterial,this.ssrRenderTarget),this.blur&&(this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.renderPass(e,this.blurMaterial2,this.blurRenderTarget2)),this.output){case l.OUTPUT.Default:this.bouncing?(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=i.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.prevRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t)):(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=i.NormalBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t));break;case l.OUTPUT.SSR:this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.bouncing&&(this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=i.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget));break;case l.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case l.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case l.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case l.OUTPUT.Metalness:this.copyMaterial.uniforms.tDiffuse.value=this.metalnessRenderTarget.texture,this.copyMaterial.blending=i.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSRPass: Unknown output type.")}}renderPass(e,t,n,r,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const s=e.getClearAlpha(this.tempColor),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderOverride(e,t,n,r,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const s=e.getClearAlpha(this.tempColor),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}renderMetalness(e,t,n,r,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));const s=e.getClearAlpha(this.tempColor),a=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,null!=r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.traverseVisible((e=>{e._SSRPassBackupMaterial=e.material,this._selects.includes(e)?e.material=this.metalnessOnMaterial:e.material=this.metalnessOffMaterial})),e.render(this.scene,this.camera),this.scene.traverseVisible((e=>{e.material=e._SSRPassBackupMaterial})),e.autoClear=a,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)}setSize(e,t){this.width=e,this.height=t,this.ssrMaterial.defines.MAX_STEP=Math.sqrt(e*e+t*t),this.ssrMaterial.needsUpdate=!0,this.beautyRenderTarget.setSize(e,t),this.prevRenderTarget.setSize(e,t),this.ssrRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.metalnessRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.blurRenderTarget2.setSize(e,t),this.ssrMaterial.uniforms.resolution.value.set(e,t),this.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t),this.blurMaterial2.uniforms.resolution.value.set(e,t)}};let c=l;var h;((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(c,"symbol"!=typeof(h="OUTPUT")?h+"":h,{Default:0,SSR:1,Beauty:3,Depth:4,Normal:5,Metalness:7}),t.SSRPass=c},64753:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190),s=n(83453);class a extends i.Pass{constructor(e){super(),void 0===s.CopyShader&&console.error("THREE.SavePass relies on CopyShader");const t=s.CopyShader;this.textureID="tDiffuse",this.uniforms=r.UniformsUtils.clone(t.uniforms),this.material=new r.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,blending:r.NoBlending}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new r.WebGLRenderTarget(window.innerWidth,window.innerHeight),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.fsQuad=new i.FullScreenQuad(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),e.setRenderTarget(this.renderTarget),this.clear&&e.clear(),this.fsQuad.render(e)}}t.SavePass=a},18921:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(49190);class o extends a.Pass{constructor(e,t="tDiffuse"){super(),i(this,"textureID"),i(this,"uniforms"),i(this,"material"),i(this,"fsQuad"),this.textureID=t,e instanceof s.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):(this.uniforms=s.UniformsUtils.clone(e.uniforms),this.material=new s.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new a.FullScreenQuad(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}t.ShaderPass=o},98060:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(44652);class s extends i.SSAARenderPass{constructor(e,t,n,r){super(e,t,n,r),this.sampleLevel=0,this.accumulate=!1,this.accumulateIndex=-1}render(e,t,n,i){if(!1===this.accumulate)return super.render(e,t,n,i),void(this.accumulateIndex=-1);const s=a[5];void 0===this.sampleRenderTarget&&(this.sampleRenderTarget=new r.WebGLRenderTarget(n.width,n.height,{type:r.HalfFloatType}),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),void 0===this.holdRenderTarget&&(this.holdRenderTarget=new r.WebGLRenderTarget(n.width,n.height,{type:r.HalfFloatType}),this.holdRenderTarget.texture.name="TAARenderPass.hold"),-1===this.accumulateIndex&&(super.render(e,this.holdRenderTarget,n,i),this.accumulateIndex=0);const o=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);const l=e.getClearAlpha(),c=1/s.length;if(this.accumulateIndex>=0&&this.accumulateIndex<s.length){this.copyUniforms.opacity.value=c,this.copyUniforms.tDiffuse.value=t.texture;const r=Math.pow(2,this.sampleLevel);for(let i=0;i<r;i++){const r=s[this.accumulateIndex];if(this.camera.setViewOffset&&this.camera.setViewOffset(n.width,n.height,.0625*r[0],.0625*r[1],n.width,n.height),e.setRenderTarget(t),e.setClearColor(this.clearColor,this.clearAlpha),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.sampleRenderTarget),0===this.accumulateIndex&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e),this.accumulateIndex++,this.accumulateIndex>=s.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}e.setClearColor(this.clearColor,this.clearAlpha);const h=this.accumulateIndex*c;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.setRenderTarget(t),this.fsQuad.render(e)),e.autoClear=o,e.setClearColor(this._oldClearColor,l)}dispose(){super.dispose(),void 0!==this.sampleRenderTarget&&this.sampleRenderTarget.dispose(),void 0!==this.holdRenderTarget&&this.holdRenderTarget.dispose()}}const a=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];t.TAARenderPass=s},70866:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(49190),s=n(83453);class a extends i.Pass{constructor(e,t){super();const n=s.CopyShader;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=r.UniformsUtils.clone(n.uniforms),this.material=new r.ShaderMaterial({uniforms:this.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,depthTest:!1,depthWrite:!1,premultipliedAlpha:!0}),this.needsSwap=!1,this.fsQuad=new i.FullScreenQuad(null)}render(e,t,n){const r=e.autoClear;e.autoClear=!1,this.fsQuad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(),this.fsQuad.render(e),e.autoClear=r}dispose(){this.material.dispose(),this.fsQuad.dispose()}}t.TexturePass=a},24064:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(49190),o=n(83453),l=n(78440),c=class extends a.Pass{constructor(e,t,n,r){super(),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=r,this.resolution=void 0!==e?new s.Vector2(e.x,e.y):new s.Vector2(256,256),this.clearColor=new s.Color(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let i=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new s.WebGLRenderTarget(i,c,{type:s.HalfFloatType}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let a=0;a<this.nMips;a++){const e=new s.WebGLRenderTarget(i,c,{type:s.HalfFloatType});e.texture.name="UnrealBloomPass.h"+a,e.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(e);const t=new s.WebGLRenderTarget(i,c,{type:s.HalfFloatType});t.texture.name="UnrealBloomPass.v"+a,t.texture.generateMipmaps=!1,this.renderTargetsVertical.push(t),i=Math.round(i/2),c=Math.round(c/2)}const h=l.LuminosityHighPassShader;this.highPassUniforms=s.UniformsUtils.clone(h.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new s.ShaderMaterial({uniforms:this.highPassUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const u=[3,5,7,9,11];i=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);for(let a=0;a<this.nMips;a++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(u[a])),this.separableBlurMaterials[a].uniforms.texSize.value=new s.Vector2(i,c),i=Math.round(i/2),c=Math.round(c/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new s.Vector3(1,1,1),new s.Vector3(1,1,1),new s.Vector3(1,1,1),new s.Vector3(1,1,1),new s.Vector3(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;const d=o.CopyShader;this.copyUniforms=s.UniformsUtils.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new s.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new s.Color,this.oldClearAlpha=1,this.basic=new s.MeshBasicMaterial,this.fsQuad=new a.FullScreenQuad(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.materialCopy.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),r=Math.round(t/2);this.renderTargetBright.setSize(n,r);for(let i=0;i<this.nMips;i++)this.renderTargetsHorizontal[i].setSize(n,r),this.renderTargetsVertical[i].setSize(n,r),this.separableBlurMaterials[i].uniforms.texSize.value=new s.Vector2(n,r),n=Math.round(n/2),r=Math.round(r/2)}render(e,t,n,r,i){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const s=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),i&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let a=this.renderTargetBright;for(let o=0;o<this.nMips;o++)this.fsQuad.material=this.separableBlurMaterials[o],this.separableBlurMaterials[o].uniforms.colorTexture.value=a.texture,this.separableBlurMaterials[o].uniforms.direction.value=c.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[o]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[o].uniforms.colorTexture.value=this.renderTargetsHorizontal[o].texture,this.separableBlurMaterials[o].uniforms.direction.value=c.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[o]),e.clear(),this.fsQuad.render(e),a=this.renderTargetsVertical[o];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,i&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=s}getSeperableBlurMaterial(e){return new s.ShaderMaterial({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new s.Vector2(.5,.5)},direction:{value:new s.Vector2(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(e){return new s.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}};let h=c;i(h,"BlurDirectionX",new s.Vector2(1,0)),i(h,"BlurDirectionY",new s.Vector2(0,1)),t.UnrealBloomPass=h},4437:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(49190);class o extends a.Pass{constructor(){super(),i(this,"material"),i(this,"fsQuad"),i(this,"factor"),i(this,"time"),i(this,"uniforms"),this.uniforms=s.UniformsUtils.clone({tex:{value:null},time:{value:0},factor:{value:0},resolution:{value:new s.Vector2(64,64)}}),this.material=new s.ShaderMaterial({uniforms:this.uniforms,vertexShader:"\n varying vec2 vUv;\n void main(){ \n vUv = uv; \n vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewPosition;\n }",fragmentShader:"\n uniform float time;\n uniform float factor;\n uniform vec2 resolution;\n uniform sampler2D tex;\n varying vec2 vUv;\n void main() { \n vec2 uv1 = vUv;\n vec2 uv = gl_FragCoord.xy/resolution.xy;\n float frequency = 6.0 * factor;\n float amplitude = 0.015 * factor;\n float x = uv1.y * frequency + time * .7; \n float y = uv1.x * frequency + time * .3;\n uv1.x += cos(x+y) * amplitude * cos(y);\n uv1.y += sin(x-y) * amplitude * cos(y);\n vec4 rgba = texture2D(tex, uv1);\n gl_FragColor = rgba;\n }"}),this.fsQuad=new a.FullScreenQuad(this.material),this.factor=0,this.time=0}render(e,t,n){this.uniforms.tex.value=n.texture,this.uniforms.time.value=this.time,this.uniforms.factor.value=this.factor,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}}t.WaterPass=o},58688:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i extends r.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new r.Vector2(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const s=new r.Vector3,a=new r.Matrix4,o=new r.Matrix4,l=new r.Vector3,c=new r.Vector3;t.CSS2DObject=i,t.CSS2DRenderer=class{constructor(e={}){const t=this;let n,r,i,h;const u={objects:new WeakMap},d=void 0!==e.element?e.element:document.createElement("div");function p(e,n,r){if(e.isCSS2DObject){s.setFromMatrixPosition(e.matrixWorld),s.applyMatrix4(o);const a=!0===e.visible&&s.z>=-1&&s.z<=1&&!0===e.layers.test(r.layers);if(e.element.style.display=!0===a?"":"none",!0===a){e.onBeforeRender(t,n,r);const a=e.element;a.style.transform="translate("+-100*e.center.x+"%,"+-100*e.center.y+"%)translate("+(s.x*i+i)+"px,"+(-s.y*h+h)+"px)",a.parentNode!==d&&d.appendChild(a),e.onAfterRender(t,n,r)}const l={distanceToCameraSquared:f(r,e)};u.objects.set(e,l)}for(let t=0,i=e.children.length;t<i;t++)p(e.children[t],n,r)}function f(e,t){return l.setFromMatrixPosition(e.matrixWorld),c.setFromMatrixPosition(t.matrixWorld),l.distanceToSquared(c)}d.style.overflow="hidden",this.domElement=d,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),a.copy(t.matrixWorldInverse),o.multiplyMatrices(t.projectionMatrix,a),p(e,e,t),function(e){const t=function(e){const t=[];return e.traverse((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;return u.objects.get(e).distanceToCameraSquared-u.objects.get(t).distanceToCameraSquared})),n=t.length;for(let r=0,i=t.length;r<i;r++)t[r].element.style.zIndex=n-r}(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,h=r/2,d.style.width=e+"px",d.style.height=t+"px"}}}},16429:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Vector3,s=new r.Quaternion,a=new r.Vector3;class o extends r.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}const l=new r.Matrix4,c=new r.Matrix4;t.CSS3DObject=o,t.CSS3DRenderer=class{constructor(e={}){const t=this;let n,r,o,h;const u={camera:{style:""},objects:new WeakMap},d=void 0!==e.element?e.element:document.createElement("div");d.style.overflow="hidden",this.domElement=d;const p=document.createElement("div");p.style.transformOrigin="0 0",p.style.pointerEvents="none",d.appendChild(p);const f=document.createElement("div");function m(e){return Math.abs(e)<1e-10?0:e}function g(e){const t=e.elements;return"matrix3d("+m(t[0])+","+m(-t[1])+","+m(t[2])+","+m(t[3])+","+m(t[4])+","+m(-t[5])+","+m(t[6])+","+m(t[7])+","+m(t[8])+","+m(-t[9])+","+m(t[10])+","+m(t[11])+","+m(t[12])+","+m(-t[13])+","+m(t[14])+","+m(t[15])+")"}function A(e){const t=e.elements;return"translate(-50%,-50%)"+("matrix3d("+m(t[0])+","+m(t[1])+","+m(t[2])+","+m(t[3])+","+m(-t[4])+","+m(-t[5])+","+m(-t[6])+","+m(-t[7])+","+m(t[8])+","+m(t[9])+","+m(t[10])+","+m(t[11])+","+m(t[12])+","+m(t[13])+","+m(t[14])+","+m(t[15])+")")}function v(e,n,r,o){if(e.isCSS3DObject){const o=!0===e.visible&&!0===e.layers.test(r.layers);if(e.element.style.display=!0===o?"":"none",!0===o){let o;e.onBeforeRender(t,n,r),e.isCSS3DSprite?(l.copy(r.matrixWorldInverse),l.transpose(),0!==e.rotation2D&&l.multiply(c.makeRotationZ(e.rotation2D)),e.matrixWorld.decompose(i,s,a),l.setPosition(i),l.scale(a),l.elements[3]=0,l.elements[7]=0,l.elements[11]=0,l.elements[15]=1,o=A(l)):o=A(e.matrixWorld);const h=e.element,d=u.objects.get(e);if(void 0===d||d.style!==o){h.style.transform=o;const t={style:o};u.objects.set(e,t)}h.parentNode!==f&&f.appendChild(h),e.onAfterRender(t,n,r)}}for(let t=0,i=e.children.length;t<i;t++)v(e.children[t],n,r)}f.style.transformStyle="preserve-3d",p.appendChild(f),this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){const i=t.projectionMatrix.elements[5]*h;let s,a;t.view&&t.view.enabled?(p.style.transform=`translate( ${-t.view.offsetX*(n/t.view.width)}px, ${-t.view.offsetY*(r/t.view.height)}px )`,p.style.transform+=`scale( ${t.view.fullWidth/t.view.width}, ${t.view.fullHeight/t.view.height} )`):p.style.transform="",!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),t.isOrthographicCamera&&(s=-(t.right+t.left)/2,a=(t.top+t.bottom)/2);const l=t.view&&t.view.enabled?t.view.height/t.view.fullHeight:1,c=t.isOrthographicCamera?`scale( ${l} )scale(`+i+")translate("+m(s)+"px,"+m(a)+"px)"+g(t.matrixWorldInverse):`scale( ${l} )translateZ(`+i+"px)"+g(t.matrixWorldInverse),d=(t.isPerspectiveCamera?"perspective("+i+"px) ":"")+c+"translate("+o+"px,"+h+"px)";u.camera.style!==d&&(f.style.transform=d,u.camera.style=d),v(e,e,t)},this.setSize=function(e,t){n=e,r=t,o=n/2,h=r/2,d.style.width=e+"px",d.style.height=t+"px",p.style.width=e+"px",p.style.height=t+"px",f.style.width=e+"px",f.style.height=t+"px"}}},t.CSS3DSprite=class extends o{constructor(e){super(e),this.isCSS3DSprite=!0,this.rotation2D=0}copy(e,t){return super.copy(e,t),this.rotation2D=e.rotation2D,this}}},35404:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i{constructor(){this.id=0,this.object=null,this.z=0,this.renderOrder=0}}class s{constructor(){this.id=0,this.v1=new a,this.v2=new a,this.v3=new a,this.normalModel=new r.Vector3,this.vertexNormalsModel=[new r.Vector3,new r.Vector3,new r.Vector3],this.vertexNormalsLength=0,this.color=new r.Color,this.material=null,this.uvs=[new r.Vector2,new r.Vector2,new r.Vector2],this.z=0,this.renderOrder=0}}class a{constructor(){this.position=new r.Vector3,this.positionWorld=new r.Vector3,this.positionScreen=new r.Vector4,this.visible=!0}copy(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)}}class o{constructor(){this.id=0,this.v1=new a,this.v2=new a,this.vertexColors=[new r.Color,new r.Color],this.material=null,this.z=0,this.renderOrder=0}}class l{constructor(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new r.Vector2,this.material=null,this.renderOrder=0}}t.Projector=class{constructor(){let e,t,n,c,h,u,d,p,f,m,g,A=0,v=0,y=0,x=0,b=0;const E={objects:[],lights:[],elements:[]},_=new r.Vector3,S=new r.Vector4,w=new r.Box3(new r.Vector3(-1,-1,-1),new r.Vector3(1,1,1)),M=new r.Box3,C=new Array(3),T=new r.Matrix4,I=new r.Matrix4,B=new r.Matrix4,R=new r.Frustum,P=[],D=[],L=[],F=[],U=[];const O=new function(){const e=[],t=[],i=[];let l=null;const f=new r.Matrix3;function m(e){const t=e.position,n=e.positionWorld,r=e.positionScreen;n.copy(t).applyMatrix4(g),r.copy(n).applyMatrix4(I);const i=1/r.w;r.x*=i,r.y*=i,r.z*=i,e.visible=r.x>=-1&&r.x<=1&&r.y>=-1&&r.y<=1&&r.z>=-1&&r.z<=1}function A(e,t,n){return!0===e.visible||!0===t.visible||!0===n.visible||(C[0]=e.positionScreen,C[1]=t.positionScreen,C[2]=n.positionScreen,w.intersectsBox(M.setFromPoints(C)))}function b(e,t,n){return(n.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(n.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}return{setObject:function(n){l=n,f.getNormalMatrix(l.matrixWorld),e.length=0,t.length=0,i.length=0},projectVertex:m,checkTriangleVisibility:A,checkBackfaceCulling:b,pushVertex:function(e,t,r){n=function(){if(c===v){const e=new a;return D.push(e),v++,c++,e}return D[c++]}(),n.position.set(e,t,r),m(n)},pushNormal:function(t,n,r){e.push(t,n,r)},pushColor:function(e,n,r){t.push(e,n,r)},pushUv:function(e,t){i.push(e,t)},pushLine:function(e,n){const r=D[e],i=D[n];r.positionScreen.copy(r.position).applyMatrix4(B),i.positionScreen.copy(i.position).applyMatrix4(B),!0===function(e,t){let n=0,r=1;const i=e.z+e.w,s=t.z+t.w,a=-e.z+e.w,o=-t.z+t.w;return i>=0&&s>=0&&a>=0&&o>=0||!(i<0&&s<0||a<0&&o<0)&&(i<0?n=Math.max(n,i/(i-s)):s<0&&(r=Math.min(r,i/(i-s))),a<0?n=Math.max(n,a/(a-o)):o<0&&(r=Math.min(r,a/(a-o))),!(r<n)&&(e.lerp(t,n),t.lerp(e,1-r),!0))}(r.positionScreen,i.positionScreen)&&(r.positionScreen.multiplyScalar(1/r.positionScreen.w),i.positionScreen.multiplyScalar(1/i.positionScreen.w),d=function(){if(p===x){const e=new o;return F.push(e),x++,p++,e}return F[p++]}(),d.id=l.id,d.v1.copy(r),d.v2.copy(i),d.z=Math.max(r.positionScreen.z,i.positionScreen.z),d.renderOrder=l.renderOrder,d.material=l.material,l.material.vertexColors&&(d.vertexColors[0].fromArray(t,3*e),d.vertexColors[1].fromArray(t,3*n)),E.elements.push(d))},pushTriangle:function(n,a,o,c){const d=D[n],p=D[a],m=D[o];if(!1!==A(d,p,m)&&(c.side===r.DoubleSide||!0===b(d,p,m))){h=function(){if(u===y){const e=new s;return L.push(e),y++,u++,e}return L[u++]}(),h.id=l.id,h.v1.copy(d),h.v2.copy(p),h.v3.copy(m),h.z=(d.positionScreen.z+p.positionScreen.z+m.positionScreen.z)/3,h.renderOrder=l.renderOrder,_.subVectors(m.position,p.position),S.subVectors(d.position,p.position),_.cross(S),h.normalModel.copy(_),h.normalModel.applyMatrix3(f).normalize();for(let t=0;t<3;t++){const n=h.vertexNormalsModel[t];n.fromArray(e,3*arguments[t]),n.applyMatrix3(f).normalize();h.uvs[t].fromArray(i,2*arguments[t])}h.vertexNormalsLength=3,h.material=c,c.vertexColors&&h.color.fromArray(t,3*n),E.elements.push(h)}}}};function N(e){if(!1===e.visible)return;if(e.isLight)E.lights.push(e);else if(e.isMesh||e.isLine||e.isPoints){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===R.intersectsObject(e))return;k(e)}else if(e.isSprite){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===R.intersectsSprite(e))return;k(e)}const t=e.children;for(let n=0,r=t.length;n<r;n++)N(t[n])}function k(n){e=function(){if(t===A){const e=new i;return P.push(e),A++,t++,e}return P[t++]}(),e.id=n.id,e.object=n,_.setFromMatrixPosition(n.matrixWorld),_.applyMatrix4(I),e.z=_.z,e.renderOrder=n.renderOrder,E.objects.push(e)}function G(e,t,n){const r=1/e.w;e.z*=r,e.z>=-1&&e.z<=1&&(f=function(){if(m===b){const e=new l;return U.push(e),b++,m++,e}return U[m++]}(),f.id=t.id,f.x=e.x*r,f.y=e.y*r,f.z=e.z,f.renderOrder=t.renderOrder,f.object=t,f.rotation=t.rotation,f.scale.x=t.scale.x*Math.abs(f.x-(e.x+n.projectionMatrix.elements[0])/(e.w+n.projectionMatrix.elements[12])),f.scale.y=t.scale.y*Math.abs(f.y-(e.y+n.projectionMatrix.elements[5])/(e.w+n.projectionMatrix.elements[13])),f.material=t.material,E.elements.push(f))}function z(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}this.projectScene=function(e,n,r,i){u=0,p=0,m=0,E.elements.length=0,!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===n.parent&&!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),T.copy(n.matrixWorldInverse),I.multiplyMatrices(n.projectionMatrix,T),R.setFromProjectionMatrix(I),t=0,E.objects.length=0,E.lights.length=0,N(e),!0===r&&E.objects.sort(z);const s=E.objects;for(let t=0,a=s.length;t<a;t++){const e=s[t].object,r=e.geometry;if(O.setObject(e),g=e.matrixWorld,c=0,e.isMesh){let t=e.material;const n=Array.isArray(t),i=r.attributes,s=r.groups;if(void 0===i.position)continue;const a=i.position.array;for(let o=0,l=a.length;o<l;o+=3){let t=a[o],n=a[o+1],i=a[o+2];const s=r.morphAttributes.position;if(void 0!==s){const l=r.morphTargetsRelative,c=e.morphTargetInfluences;for(let e=0,r=s.length;e<r;e++){const r=c[e];if(0===r)continue;const h=s[e];l?(t+=h.getX(o/3)*r,n+=h.getY(o/3)*r,i+=h.getZ(o/3)*r):(t+=(h.getX(o/3)-a[o])*r,n+=(h.getY(o/3)-a[o+1])*r,i+=(h.getZ(o/3)-a[o+2])*r)}}O.pushVertex(t,n,i)}if(void 0!==i.normal){const e=i.normal.array;for(let t=0,n=e.length;t<n;t+=3)O.pushNormal(e[t],e[t+1],e[t+2])}if(void 0!==i.color){const e=i.color.array;for(let t=0,n=e.length;t<n;t+=3)O.pushColor(e[t],e[t+1],e[t+2])}if(void 0!==i.uv){const e=i.uv.array;for(let t=0,n=e.length;t<n;t+=2)O.pushUv(e[t],e[t+1])}if(null!==r.index){const i=r.index.array;if(s.length>0)for(let r=0;r<s.length;r++){const a=s[r];if(t=!0===n?e.material[a.materialIndex]:e.material,void 0!==t)for(let e=a.start,n=a.start+a.count;e<n;e+=3)O.pushTriangle(i[e],i[e+1],i[e+2],t)}else for(let e=0,n=i.length;e<n;e+=3)O.pushTriangle(i[e],i[e+1],i[e+2],t)}else if(s.length>0)for(let r=0;r<s.length;r++){const i=s[r];if(t=!0===n?e.material[i.materialIndex]:e.material,void 0!==t)for(let e=i.start,n=i.start+i.count;e<n;e+=3)O.pushTriangle(e,e+1,e+2,t)}else for(let e=0,r=a.length/3;e<r;e+=3)O.pushTriangle(e,e+1,e+2,t)}else if(e.isLine){B.multiplyMatrices(I,g);const t=r.attributes;if(void 0!==t.position){const n=t.position.array;for(let e=0,t=n.length;e<t;e+=3)O.pushVertex(n[e],n[e+1],n[e+2]);if(void 0!==t.color){const e=t.color.array;for(let t=0,n=e.length;t<n;t+=3)O.pushColor(e[t],e[t+1],e[t+2])}if(null!==r.index){const e=r.index.array;for(let t=0,n=e.length;t<n;t+=2)O.pushLine(e[t],e[t+1])}else{const t=e.isLineSegments?2:1;for(let e=0,r=n.length/3-1;e<r;e+=t)O.pushLine(e,e+1)}}}else if(e.isPoints){B.multiplyMatrices(I,g);const t=r.attributes;if(void 0!==t.position){const r=t.position.array;for(let t=0,i=r.length;t<i;t+=3)S.set(r[t],r[t+1],r[t+2],1),S.applyMatrix4(B),G(S,e,n)}}else e.isSprite&&(e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),S.set(g.elements[12],g.elements[13],g.elements[14],1),S.applyMatrix4(I),G(S,e,n))}return!0===i&&E.elements.sort(z),E}}},t.RenderableFace=s,t.RenderableLine=o,t.RenderableObject=i,t.RenderableSprite=l,t.RenderableVertex=a},77600:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(35404);class s extends r.Object3D{constructor(e){super(),this.isSVGObject=!0,this.node=e}}t.SVGObject=s,t.SVGRenderer=class{constructor(){let e,t,n,s,a,o,l,c,h,u,d,p,f,m=0,g=null,A=1;const v=this,y=new r.Box2,x=new r.Box2,b=new r.Color,E=new r.Color,_=new r.Color,S=new r.Color,w=new r.Color,M=new r.Color,C=new r.Vector3,T=new r.Vector3,I=new r.Vector3,B=new r.Matrix3,R=new r.Matrix4,P=new r.Matrix4,D=[],L=new i.Projector,F=document.createElementNS("http://www.w3.org/2000/svg","svg");function U(){for(m=0;F.childNodes.length>0;)F.removeChild(F.childNodes[0])}function O(e){return null!==g?e.toFixed(g):e}function N(e,t,n){let r=t.scale.x*o,i=t.scale.y*l;n.isPointsMaterial&&(r*=n.size,i*=n.size);const s="M"+O(e.x-.5*r)+","+O(e.y-.5*i)+"h"+O(r)+"v"+O(i)+"h"+O(-r)+"z";let a="";(n.isSpriteMaterial||n.isPointsMaterial)&&(a="fill:"+n.color.getStyle()+";fill-opacity:"+n.opacity),Q(a,s)}function k(e,t,n){const r="M"+O(e.positionScreen.x)+","+O(e.positionScreen.y)+"L"+O(t.positionScreen.x)+","+O(t.positionScreen.y);if(n.isLineBasicMaterial){let e="fill:none;stroke:"+n.color.getStyle()+";stroke-opacity:"+n.opacity+";stroke-width:"+n.linewidth+";stroke-linecap:"+n.linecap;n.isLineDashedMaterial&&(e=e+";stroke-dasharray:"+n.dashSize+","+n.gapSize),Q(e,r)}}function G(e,t,r,i,s){v.info.render.vertices+=3,v.info.render.faces++;const a="M"+O(e.positionScreen.x)+","+O(e.positionScreen.y)+"L"+O(t.positionScreen.x)+","+O(t.positionScreen.y)+"L"+O(r.positionScreen.x)+","+O(r.positionScreen.y)+"z";let o="";s.isMeshBasicMaterial?(b.copy(s.color),s.vertexColors&&b.multiply(i.color)):s.isMeshLambertMaterial||s.isMeshPhongMaterial||s.isMeshStandardMaterial?(E.copy(s.color),s.vertexColors&&E.multiply(i.color),b.copy(_),T.copy(e.positionWorld).add(t.positionWorld).add(r.positionWorld).divideScalar(3),function(e,t,n,r){for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.color;if(s.isDirectionalLight){const e=C.setFromMatrixPosition(s.matrixWorld).normalize();let t=n.dot(e);if(t<=0)continue;t*=s.intensity,r.r+=a.r*t,r.g+=a.g*t,r.b+=a.b*t}else if(s.isPointLight){const e=C.setFromMatrixPosition(s.matrixWorld);let i=n.dot(C.subVectors(e,t).normalize());if(i<=0)continue;if(i*=0==s.distance?1:1-Math.min(t.distanceTo(e)/s.distance,1),0==i)continue;i*=s.intensity,r.r+=a.r*i,r.g+=a.g*i,r.b+=a.b*i}}}(n,T,i.normalModel,b),b.multiply(E).add(s.emissive)):s.isMeshNormalMaterial&&(I.copy(i.normalModel).applyMatrix3(B).normalize(),b.setRGB(I.x,I.y,I.z).multiplyScalar(.5).addScalar(.5)),o=s.wireframe?"fill:none;stroke:"+b.getStyle()+";stroke-opacity:"+s.opacity+";stroke-width:"+s.wireframeLinewidth+";stroke-linecap:"+s.wireframeLinecap+";stroke-linejoin:"+s.wireframeLinejoin:"fill:"+b.getStyle()+";fill-opacity:"+s.opacity,Q(o,a)}function z(e,t,n){let r=t.x-e.x,i=t.y-e.y;const s=r*r+i*i;if(0===s)return;const a=n/Math.sqrt(s);r*=a,i*=a,t.x+=r,t.y+=i,e.x-=r,e.y-=i}function Q(e,t){f===e?p+=t:(V(),f=e,p=t)}function V(){p&&(d=function(e){if(null==D[e])return D[e]=document.createElementNS("http://www.w3.org/2000/svg","path"),0==A&&D[e].setAttribute("shape-rendering","crispEdges"),D[e];return D[e]}(m++),d.setAttribute("d",p),d.setAttribute("style",f),F.appendChild(d)),p="",f=""}this.domElement=F,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.overdraw=.5,this.info={render:{vertices:0,faces:0}},this.setQuality=function(e){switch(e){case"high":A=1;break;case"low":A=0}},this.setClearColor=function(e){M.set(e)},this.setPixelRatio=function(){},this.setSize=function(e,t){s=e,a=t,o=s/2,l=a/2,F.setAttribute("viewBox",-o+" "+-l+" "+s+" "+a),F.setAttribute("width",s),F.setAttribute("height",a),y.min.set(-o,-l),y.max.set(o,l)},this.getSize=function(){return{width:s,height:a}},this.setPrecision=function(e){g=e},this.clear=function(){U(),F.style.backgroundColor=M.getStyle()},this.render=function(s,a){if(a instanceof r.Camera==!1)return void console.error("THREE.SVGRenderer.render: camera is not an instance of Camera.");const d=s.background;d&&d.isColor?(U(),F.style.backgroundColor=d.getStyle()):!0===this.autoClear&&this.clear(),v.info.render.vertices=0,v.info.render.faces=0,R.copy(a.matrixWorldInverse),P.multiplyMatrices(a.projectionMatrix,R),e=L.projectScene(s,a,this.sortObjects,this.sortElements),t=e.elements,n=e.lights,B.getNormalMatrix(a.matrixWorldInverse),function(e){_.setRGB(0,0,0),S.setRGB(0,0,0),w.setRGB(0,0,0);for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.color;n.isAmbientLight?(_.r+=r.r,_.g+=r.g,_.b+=r.b):n.isDirectionalLight?(S.r+=r.r,S.g+=r.g,S.b+=r.b):n.isPointLight&&(w.r+=r.r,w.g+=r.g,w.b+=r.b)}}(n),p="",f="";for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.material;if(void 0!==r&&0!==r.opacity)if(x.makeEmpty(),n instanceof i.RenderableSprite)c=n,c.x*=o,c.y*=-l,N(c,n,r);else if(n instanceof i.RenderableLine)c=n.v1,h=n.v2,c.positionScreen.x*=o,c.positionScreen.y*=-l,h.positionScreen.x*=o,h.positionScreen.y*=-l,x.setFromPoints([c.positionScreen,h.positionScreen]),!0===y.intersectsBox(x)&&k(c,h,r);else if(n instanceof i.RenderableFace){if(c=n.v1,h=n.v2,u=n.v3,c.positionScreen.z<-1||c.positionScreen.z>1)continue;if(h.positionScreen.z<-1||h.positionScreen.z>1)continue;if(u.positionScreen.z<-1||u.positionScreen.z>1)continue;c.positionScreen.x*=o,c.positionScreen.y*=-l,h.positionScreen.x*=o,h.positionScreen.y*=-l,u.positionScreen.x*=o,u.positionScreen.y*=-l,this.overdraw>0&&(z(c.positionScreen,h.positionScreen,this.overdraw),z(h.positionScreen,u.positionScreen,this.overdraw),z(u.positionScreen,c.positionScreen,this.overdraw)),x.setFromPoints([c.positionScreen,h.positionScreen,u.positionScreen]),!0===y.intersectsBox(x)&&G(c,h,u,n,r)}}V(),s.traverseVisible((function(e){if(e.isSVGObject){if(C.setFromMatrixPosition(e.matrixWorld),C.applyMatrix4(P),C.z<-1||C.z>1)return;const t=C.x*o,n=-C.y*l,r=e.node;r.setAttribute("transform","translate("+t+","+n+")"),F.appendChild(r)}}))}}}},42333:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},exposure:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define saturate(a) clamp( a, 0.0, 1.0 )","uniform sampler2D tDiffuse;","uniform float exposure;","varying vec2 vUv;","vec3 RRTAndODTFit( vec3 v ) {","\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;","\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;","\treturn a / b;","}","vec3 ACESFilmicToneMapping( vec3 color ) {","\tconst mat3 ACESInputMat = mat3(","\t\tvec3( 0.59719, 0.07600, 0.02840 ),","\t\tvec3( 0.35458, 0.90834, 0.13383 ),","\t\tvec3( 0.04823, 0.01566, 0.83777 )","\t);","\tconst mat3 ACESOutputMat = mat3(","\t\tvec3( 1.60475, -0.10208, -0.00327 ),","\t\tvec3( -0.53108, 1.10813, -0.07276 ),","\t\tvec3( -0.07367, -0.00605, 1.07602 )","\t);","\tcolor = ACESInputMat * color;","\tcolor = RRTAndODTFit( color );","\tcolor = ACESOutputMat * color;","\treturn saturate( color );","}","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\ttex.rgb *= exposure / 0.6;","\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );","}"].join("\n")};t.ACESFilmicToneMappingShader=n},70382:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{damp:{value:.96},tOld:{value:null},tNew:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float damp;","uniform sampler2D tOld;","uniform sampler2D tNew;","varying vec2 vUv;","vec4 when_gt( vec4 x, float y ) {","\treturn max( sign( x - y ), 0.0 );","}","void main() {","\tvec4 texelOld = texture2D( tOld, vUv );","\tvec4 texelNew = texture2D( tNew, vUv );","\ttexelOld *= damp * when_gt( texelOld, 0.1 );","\tgl_FragColor = max(texelNew, texelOld);","}"].join("\n")};t.AfterimageShader=n},17853:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{},vertexShader:["void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.BasicShader=n},18260:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 base = texture2D( tDiffuse, vUv );","\tvec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","\tfloat lum = dot( lumCoeff, base.rgb );","\tvec3 blend = vec3( lum );","\tfloat L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","\tvec3 result1 = 2.0 * base.rgb * blend;","\tvec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","\tvec3 newColor = mix( result1, result2, L );","\tfloat A2 = opacity * base.a;","\tvec3 mixRGB = A2 * newColor.rgb;","\tmixRGB += ( ( 1.0 - A2 ) * base.rgb );","\tgl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.BleachBypassShader=n},69556:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","\tvec4 texel1 = texture2D( tDiffuse1, vUv );","\tvec4 texel2 = texture2D( tDiffuse2, vUv );","\tgl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.BlendShader=n},73500:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={defines:{DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},aspect:{value:1},aperture:{value:.025},maxblur:{value:.01},nearClip:{value:1},farClip:{value:1e3}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")};t.BokehShader=n},67971:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(n(85232).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float penta(vec2 coords) {","\t//pentagonal shape","\tfloat scale = float(rings) - 1.3;","\tvec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","\tvec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","\tvec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","\tvec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","\tvec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","\tvec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","\tvec4 one = vec4( 1.0 );","\tvec4 P = vec4((coords),vec2(scale, scale));","\tvec4 dist = vec4(0.0);","\tfloat inorout = -4.0;","\tdist.x = dot( P, HS0 );","\tdist.y = dot( P, HS1 );","\tdist.z = dot( P, HS2 );","\tdist.w = dot( P, HS3 );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dot( dist, one );","\tdist.x = dot( P, HS4 );","\tdist.y = HS5.w - abs( P.z );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dist.x;","\treturn clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","\t// Depth buffer blur","\tfloat d = 0.0;","\tfloat kernel[9];","\tvec2 offset[9];","\tvec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","\toffset[0] = vec2(-wh.x,-wh.y);","\toffset[1] = vec2( 0.0, -wh.y);","\toffset[2] = vec2( wh.x -wh.y);","\toffset[3] = vec2(-wh.x, 0.0);","\toffset[4] = vec2( 0.0, 0.0);","\toffset[5] = vec2( wh.x, 0.0);","\toffset[6] = vec2(-wh.x, wh.y);","\toffset[7] = vec2( 0.0, wh.y);","\toffset[8] = vec2( wh.x, wh.y);","\tkernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","\tkernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","\tkernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","\tfor( int i=0; i<9; i++ ) {","\t\tfloat tmp = texture2D(tDepth, coords + offset[i]).r;","\t\td += tmp * kernel[i];","\t}","\treturn d;","}","vec3 color(vec2 coords,float blur) {","\t//processing the sample","\tvec3 col = vec3(0.0);","\tvec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","\tcol.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","\tcol.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","\tcol.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","\tvec3 lumcoeff = vec3(0.299,0.587,0.114);","\tfloat lum = dot(col.rgb, lumcoeff);","\tfloat thresh = max((lum-threshold)*gain, 0.0);","\treturn col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","\tfloat edge = 0.002*depth; //distance based edge smoothing","\tfloat m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","\tfloat e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","\tcol = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","\tcol = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","\treturn col;","}","float linearize(float depth) {","\treturn -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","\tfloat dist = distance(vUv.xy, vec2(0.5,0.5));","\tdist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","\treturn clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","\tfloat rings2 = float(rings);","\tfloat step = PI*2.0 / float(ringsamples);","\tfloat pw = cos(j*step)*i;","\tfloat ph = sin(j*step)*i;","\tfloat p = 1.0;","\tif (pentagon) {","\t\tp = penta(vec2(pw,ph));","\t}","\tcol += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","\treturn 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","\t//scene depth calculation","\tfloat depth = linearize(texture2D(tDepth,vUv.xy).x);","\t// Blur depth?","\tif ( depthblur ) {","\t\tdepth = linearize(bdepth(vUv.xy));","\t}","\t//focal plane calculation","\tfloat fDepth = focalDepth;","\tif (shaderFocus) {","\t\tfDepth = linearize(texture2D(tDepth,focusCoords).x);","\t}","\t// dof blur factor calculation","\tfloat blur = 0.0;","\tif (manualdof) {","\t\tfloat a = depth-fDepth; // Focal plane","\t\tfloat b = (a-fdofstart)/fdofdist; // Far DoF","\t\tfloat c = (-a-ndofstart)/ndofdist; // Near Dof","\t\tblur = (a>0.0) ? b : c;","\t} else {","\t\tfloat f = focalLength; // focal length in mm","\t\tfloat d = fDepth*1000.0; // focal plane in mm","\t\tfloat o = depth*1000.0; // depth in mm","\t\tfloat a = (o*f)/(o-f);","\t\tfloat b = (d*f)/(d-f);","\t\tfloat c = (d-f)/(d*fstop*CoC);","\t\tblur = abs(a-b)*c;","\t}","\tblur = clamp(blur,0.0,1.0);","\t// calculation of pattern for dithering","\tvec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","\t// getting blur x and y step factor","\tfloat w = (1.0/textureWidth)*blur*maxblur+noise.x;","\tfloat h = (1.0/textureHeight)*blur*maxblur+noise.y;","\t// calculation of final color","\tvec3 col = vec3(0.0);","\tif(blur < 0.05) {","\t\t//some optimization thingy","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t} else {","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t\tfloat s = 1.0;","\t\tint ringsamples;","\t\tfor (int i = 1; i <= rings; i++) {","\t\t\t/*unboxstart*/","\t\t\tringsamples = i * samples;","\t\t\tfor (int j = 0 ; j < maxringsamples ; j++) {","\t\t\t\tif (j >= ringsamples) break;","\t\t\t\ts += gather(float(i), float(j), ringsamples, col, w, h, blur);","\t\t\t}","\t\t\t/*unboxend*/","\t\t}","\t\tcol /= s; //divide by sample count","\t}","\tif (showFocus) {","\t\tcol = debugFocus(col, blur, depth);","\t}","\tif (vignetting) {","\t\tcol *= vignette();","\t}","\tgl_FragColor.rgb = col;","\tgl_FragColor.a = 1.0;","} "].join("\n")},i={uniforms:{mNear:{value:1},mFar:{value:1e3}},vertexShader:["varying float vViewZDepth;","void main() {","\t#include <begin_vertex>","\t#include <project_vertex>","\tvViewZDepth = - mvPosition.z;","}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","varying float vViewZDepth;","void main() {","\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );","\tgl_FragColor = vec4( vec3( color ), 1.0 );","} "].join("\n")};t.BokehDepthShader=i,t.BokehShader2=r},49890:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb += brightness;","\tif (contrast > 0.0) {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","\t} else {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","\t}","}"].join("\n")};t.BrightnessContrastShader=n},67618:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{tDiffuse:{value:null},powRGB:{value:new r.Vector3(2,2,2)},mulRGB:{value:new r.Vector3(1,1,1)},addRGB:{value:new r.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.ColorCorrectionShader=i},2474:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{tDiffuse:{value:null},color:{value:new(n(85232).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tgl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.ColorifyShader=r},59564:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(n(85232).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvec2 imageCoord = vUv;","\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","\t\timageCoord += uImageIncrement;","\t}","\tgl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){const t=Math.min(2*Math.ceil(3*e)+1,25),n=.5*(t-1),r=new Array(t);let i=0;for(let o=0;o<t;++o)r[o]=(s=o-n,a=e,Math.exp(-s*s/(2*a*a))),i+=r[o];var s,a;for(let o=0;o<t;++o)r[o]/=i;return r}};t.ConvolutionShader=r},83453:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};t.CopyShader=n},55175:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","\tvec4 depth = texture2D( tDepth, vUv );","\tfloat factor = depth.x - focus;","\tvec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","\tgl_FragColor = col;","\tgl_FragColor.a = 1.0;","}"].join("\n")};t.DOFMipMapShader=n},86170:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new r.Vector2(512,512)},sampleUvOffsets:{value:[new r.Vector2(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:["#include <common>","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","#include <packing>","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")},s={createSampleWeights:(e,t)=>{const n=[];for(let s=0;s<=e;s++)n.push((r=s,i=t,Math.exp(-r*r/(i*i*2))/(Math.sqrt(2*Math.PI)*i)));var r,i;return n},createSampleOffsets:(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push(t.clone().multiplyScalar(r));return n},configure:(e,t,n,r)=>{e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=s.createSampleOffsets(t,r),e.uniforms.sampleWeights.value=s.createSampleWeights(t,n),e.needsUpdate=!0}};t.BlurShaderUtils=s,t.DepthLimitedBlurShader=i},59305:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:"varying vec2 vUv;\n void main() {\n \t vUv = uv;\n \t gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform int byp; //should we apply the glitch ?\n uniform sampler2D tDiffuse;\n uniform sampler2D tDisp;\n uniform float amount;\n uniform float angle;\n uniform float seed;\n uniform float seed_x;\n uniform float seed_y;\n uniform float distortion_x;\n uniform float distortion_y;\n uniform float col_s;\n\n varying vec2 vUv;\n\n float rand(vec2 co){\n \t return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n }\n\n void main() {\n \tif(byp<1) {\n \t\tvec2 p = vUv;\n \t\tfloat xs = floor(gl_FragCoord.x / 0.5);\n \t\tfloat ys = floor(gl_FragCoord.y / 0.5);\n //based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch\n \t\tvec4 normal = texture2D (tDisp, p*seed*seed);\n \t\tif(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {\n \t\t\tif(seed_x>0.){\n \t\t\t\tp.y = 1. - (p.y + distortion_y);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.y = distortion_y;\n \t\t\t}\n \t\t}\n \t\tif(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {\n \t\t\tif(seed_y>0.){\n \t\t\t\tp.x=distortion_x;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.x = 1. - (p.x + distortion_x);\n \t\t\t}\n \t\t}\n \t\tp.x+=normal.x*seed_x*(seed/5.);\n \t\tp.y+=normal.y*seed_y*(seed/5.);\n //base from RGB shift shader\n \t\tvec2 offset = amount * vec2( cos(angle), sin(angle));\n \t\tvec4 cr = texture2D(tDiffuse, p + offset);\n \t\tvec4 cga = texture2D(tDiffuse, p);\n \t\tvec4 cb = texture2D(tDiffuse, p - offset);\n \t\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\n //add noise\n \t\tvec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);\n \t\tgl_FragColor = gl_FragColor+ snow;\n \t}\n \telse {\n \t\tgl_FragColor=texture2D (tDiffuse, vUv);\n \t}\n }"};t.DigitalGlitch=n},15479:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{tDiffuse:{value:null},tSize:{value:new r.Vector2(256,256)},center:{value:new r.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","\tfloat s = sin( angle ), c = cos( angle );","\tvec2 tex = vUv * tSize - center;","\tvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","\treturn ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat average = ( color.r + color.g + color.b ) / 3.0;","\tgl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.DotScreenShader=i},85832:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{tDiffuse:{value:null},resolution:{value:new(n(85232).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.FXAAShader=r},29076:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.FilmShader=n},13855:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color, org, tmp, add;","\tfloat sample_dist, f;","\tvec2 vin;","\tvec2 uv = vUv;","\tadd = color = org = texture2D( tDiffuse, uv );","\tvin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","\tsample_dist = dot( vin, vin ) * 2.0;","\tf = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","\tvec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tcolor = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","\tcolor = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","\tgl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.FocusShader=n},37272:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{tDiffuse:{value:null},aspect:{value:new(n(85232).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","\tG[0] = g0,","\tG[1] = g1,","\tG[2] = g2,","\tG[3] = g3,","\tG[4] = g4,","\tG[5] = g5,","\tG[6] = g6,","\tG[7] = g7,","\tG[8] = g8;","\tmat3 I;","\tfloat cnv[9];","\tvec3 sample;","\tfor (float i=0.0; i<3.0; i++) {","\t\tfor (float j=0.0; j<3.0; j++) {","\t\t\tsample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","\t\t\tI[int(i)][int(j)] = length(sample);","\t\t}","\t}","\tfor (int i=0; i<9; i++) {","\t\tfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","\t\tcnv[i] = dp3 * dp3;","\t}","\tfloat M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","\tfloat S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","\tgl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.FreiChenShader=r},29839:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvReflect = reflect( I, worldNormal );","\tvRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","\tvRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","\tvRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","\tvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","\tvec4 refractedColor = vec4( 1.0 );","\trefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","\trefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","\trefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","\tgl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.FresnelShader=n},85402:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\tgl_FragColor = LinearTosRGB( tex );","}"].join("\n")};t.GammaCorrectionShader=n},50044:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{tInput:{value:null}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tInput;","void main() {","\tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );","}"].join("\n")},s={uniforms:{tInput:{value:null},fStepSize:{value:1},vSunPositionScreenSpace:{value:new r.Vector3}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define TAPS_PER_PASS 6.0","varying vec2 vUv;","uniform sampler2D tInput;","uniform vec3 vSunPositionScreenSpace;","uniform float fStepSize;","void main() {","\tvec2 delta = vSunPositionScreenSpace.xy - vUv;","\tfloat dist = length( delta );","\tvec2 stepv = fStepSize * delta / dist;","\tfloat iters = dist/fStepSize;","\tvec2 uv = vUv.xy;","\tfloat col = 0.0;","\tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );","\tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tgl_FragColor = vec4( col/TAPS_PER_PASS );","\tgl_FragColor.a = 1.0;","}"].join("\n")},a={uniforms:{tColors:{value:null},tGodRays:{value:null},fGodRayIntensity:{value:.69}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tColors;","uniform sampler2D tGodRays;","uniform float fGodRayIntensity;","void main() {","\tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );","\tgl_FragColor.a = 1.0;","}"].join("\n")},o={uniforms:{vSunPositionScreenSpace:{value:new r.Vector3},fAspect:{value:1},sunColor:{value:new r.Color(16772608)},bgColor:{value:new r.Color(0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform vec3 vSunPositionScreenSpace;","uniform float fAspect;","uniform vec3 sunColor;","uniform vec3 bgColor;","void main() {","\tvec2 diff = vUv - vSunPositionScreenSpace.xy;","\tdiff.x *= fAspect;","\tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );","\tprop = 0.35 * pow( 1.0 - prop, 3.0 );","\tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;","\tgl_FragColor.w = 1.0;","}"].join("\n")};t.GodRaysCombineShader=a,t.GodRaysDepthMaskShader=i,t.GodRaysFakeSunShader=o,t.GodRaysGenerateShader=s},79169:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")};t.HalftoneShader=n},37211:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "};t.HorizontalBlurShader=n},39032:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat hh = h * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")};t.HorizontalTiltShiftShader=n},43098:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tfloat angle = hue * 3.14159265;","\tfloat s = sin(angle), c = cos(angle);","\tvec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","\tfloat len = length(gl_FragColor.rgb);","\tgl_FragColor.rgb = vec3(","\t\tdot(gl_FragColor.rgb, weights.xyz),","\t\tdot(gl_FragColor.rgb, weights.zxy),","\t\tdot(gl_FragColor.rgb, weights.yzx)","\t);","\tfloat average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","\tif (saturation > 0.0) {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","\t} else {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","\t}","}"].join("\n")};t.HueSaturationShader=n},29983:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 p = vUv - 0.5;","\tfloat r = length(p);","\tfloat a = atan(p.y, p.x) + angle;","\tfloat tau = 2. * 3.1416 ;","\ta = mod(a, tau/sides);","\ta = abs(a - tau/sides/2.) ;","\tp = r * vec2(cos(a), sin(a));","\tvec4 color = texture2D(tDiffuse, p + 0.5);","\tgl_FragColor = color;","}"].join("\n")};t.KaleidoShader=n},78440:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new(n(85232).Color)(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.LuminosityHighPassShader=r},48123:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tfloat l = linearToRelativeLuminance( texel.rgb );","\tgl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.LuminosityShader=n},69277:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","\tvec2 p = vUv;","\tif (side == 0){","\t\tif (p.x > 0.5) p.x = 1.0 - p.x;","\t}else if (side == 1){","\t\tif (p.x < 0.5) p.x = 1.0 - p.x;","\t}else if (side == 2){","\t\tif (p.y < 0.5) p.y = 1.0 - p.y;","\t}else if (side == 3){","\t\tif (p.y > 0.5) p.y = 1.0 - p.y;","\t} ","\tvec4 color = texture2D(tDiffuse, p);","\tgl_FragColor = color;","}"].join("\n")};t.MirrorShader=n},29176:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{heightMap:{value:null},resolution:{value:new r.Vector2(512,512)},scale:{value:new r.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","\tfloat val = texture2D( heightMap, vUv ).x;","\tfloat valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","\tfloat valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","\tgl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.NormalMapShader=i},94640:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","\tvUv = uv;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvViewPosition = -mvPosition.xyz;","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;","\t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","\t\treturn vUv - texCoordOffset;","\t}","#else","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","\t\tfloat layerHeight = 1.0 / numLayers;","\t\tfloat currentLayerHeight = 0.0;","\t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;","\t\tvec2 currentTextureCoords = vUv;","\t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\tfor ( int i = 0; i < 30; i += 1 ) {","\t\t\tif ( heightFromTexture <= currentLayerHeight ) {","\t\t\t\tbreak;","\t\t\t}","\t\t\tcurrentLayerHeight += layerHeight;","\t\t\tcurrentTextureCoords -= dtex;","\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t}","\t\t#ifdef USE_STEEP_PARALLAX","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_RELIEF_PARALLAX )","\t\t\tvec2 deltaTexCoord = dtex / 2.0;","\t\t\tfloat deltaHeight = layerHeight / 2.0;","\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\tconst int numSearches = 5;","\t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {","\t\t\t\tdeltaTexCoord /= 2.0;","\t\t\t\tdeltaHeight /= 2.0;","\t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t\t\tif( heightFromTexture > currentLayerHeight ) {","\t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight += deltaHeight;","\t\t\t\t} else {","\t\t\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\t\t}","\t\t\t}","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_OCLUSION_PARALLAX )","\t\t\tvec2 prevTCoords = currentTextureCoords + dtex;","\t\t\tfloat nextH = heightFromTexture - currentLayerHeight;","\t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","\t\t\tfloat weight = nextH / ( nextH - prevH );","\t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","\t\t#else","\t\t\treturn vUv;","\t\t#endif","\t}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","\tvec2 texDx = dFdx( vUv );","\tvec2 texDy = dFdy( vUv );","\tvec3 vSigmaX = dFdx( surfPosition );","\tvec3 vSigmaY = dFdy( surfPosition );","\tvec3 vR1 = cross( vSigmaY, surfNormal );","\tvec3 vR2 = cross( surfNormal, vSigmaX );","\tfloat fDet = dot( vSigmaX, vR1 );","\tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","\tvec3 vProjVtex;","\tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","\tvProjVtex.z = dot( surfNormal, viewPosition );","\treturn parallaxMap( vProjVtex );","}","void main() {","\tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","\tgl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.ParallaxShader=n},79203:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.PixelShader=n},16025:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 offset = amount * vec2( cos(angle), sin(angle));","\tvec4 cr = texture2D(tDiffuse, vUv + offset);","\tvec4 cga = texture2D(tDiffuse, vUv);","\tvec4 cb = texture2D(tDiffuse, vUv - offset);","\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.RGBShiftShader=n},24730:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new r.Vector2(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new r.Matrix4},cameraInverseProjectionMatrix:{value:new r.Matrix4},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include <packing>","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.SAOShader=i},27407:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new r.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","\tvOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","\tvUv = uv;","\tSMAAEdgeDetectionVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","\tvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","\tvec4 delta;","\tvec3 C = texture2D( colorTex, texcoord ).rgb;","\tvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","\tvec3 t = abs( C - Cleft );","\tdelta.x = max( max( t.r, t.g ), t.b );","\tvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","\tt = abs( C - Ctop );","\tdelta.y = max( max( t.r, t.g ), t.b );","\tvec2 edges = step( threshold, delta.xy );","\tif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","\t\tdiscard;","\tvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","\tt = abs( C - Cright );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","\tt = abs( C - Cbottom );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","\tvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","\tt = abs( C - Cleftleft );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","\tt = abs( C - Ctoptop );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tmaxDelta = max( max( maxDelta, delta.z ), delta.w );","\tedges.xy *= step( 0.5 * maxDelta, delta.xy );","\treturn vec4( edges, 0.0, 0.0 );","}","void main() {","\tgl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},s={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new r.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","\tvPixcoord = texcoord / resolution;","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","\tvOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","\tvUv = uv;","\tSMAABlendingWeightCalculationVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","#if __VERSION__ == 100","vec2 round( vec2 x ) {","\treturn sign( x ) * floor( abs( x ) + 0.5 );","}","#endif","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","\te.r = bias + e.r * scale;","\treturn 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x += 0.25 * resolution.x;","\ttexcoord.x += resolution.x;","\ttexcoord.x += 2.0 * resolution.x;","\ttexcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","\treturn texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x -= 0.25 * resolution.x;","\ttexcoord.x -= resolution.x;","\ttexcoord.x -= 2.0 * resolution.x;","\ttexcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","\treturn texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y -= 0.25 * resolution.y;","\ttexcoord.y -= resolution.y;","\ttexcoord.y -= 2.0 * resolution.y;","\ttexcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","\treturn texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y += 0.25 * resolution.y;","\ttexcoord.y += resolution.y;","\ttexcoord.y += 2.0 * resolution.y;","\ttexcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","\treturn texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","\tvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","\ttexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","\ttexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","\treturn texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","\tvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","\tvec2 e = texture2D( edgesTex, texcoord ).rg;","\tif ( e.g > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","\t\tcoords.y = offset[ 1 ].y;","\t\td.x = coords.x;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;","\t\tcoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","\t\td.y = coords.x;","\t\td = d / resolution.x - pixcoord.x;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","\t\tweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","\t}","\tif ( e.r > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","\t\tcoords.x = offset[ 0 ].x;","\t\td.x = coords.y;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;","\t\tcoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","\t\td.y = coords.y;","\t\td = d / resolution.y - pixcoord.y;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","\t\tweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","\t}","\treturn weights;","}","void main() {","\tgl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},a={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new r.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","\tvUv = uv;","\tSMAANeighborhoodBlendingVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","\tvec4 a;","\ta.xz = texture2D( blendTex, texcoord ).xz;","\ta.y = texture2D( blendTex, offset[ 1 ].zw ).g;","\ta.w = texture2D( blendTex, offset[ 1 ].xy ).a;","\tif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","\t\treturn texture2D( colorTex, texcoord, 0.0 );","\t} else {","\t\tvec2 offset;","\t\toffset.x = a.a > a.b ? a.a : -a.b;","\t\toffset.y = a.g > a.r ? -a.g : a.r;","\t\tif ( abs( offset.x ) > abs( offset.y )) {","\t\t\toffset.y = 0.0;","\t\t} else {","\t\t\toffset.x = 0.0;","\t\t}","\t\tvec4 C = texture2D( colorTex, texcoord, 0.0 );","\t\ttexcoord += sign( offset ) * resolution;","\t\tvec4 Cop = texture2D( colorTex, texcoord, 0.0 );","\t\tfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","\t\tC.xyz = pow(C.xyz, vec3(2.2));","\t\tCop.xyz = pow(Cop.xyz, vec3(2.2));","\t\tvec4 mixed = mix(C, Cop, s);","\t\tmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","\t\treturn mixed;","\t}","}","void main() {","\tgl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")};t.SMAABlendShader=a,t.SMAAEdgesShader=i,t.SMAAWeightsShader=s},48463:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new r.Vector2},cameraProjectionMatrix:{value:new r.Matrix4},cameraInverseProjectionMatrix:{value:new r.Matrix4},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tNormal;","uniform sampler2D tDepth;","uniform sampler2D tNoise;","uniform vec3 kernel[ KERNEL_SIZE ];","uniform vec2 resolution;","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float kernelRadius;","uniform float minDistance;","uniform float maxDistance;","varying vec2 vUv;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\treturn texture2D( tDepth, screenPosition ).x;","}","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec2 screenPosition ) {","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","}","void main() {","\tfloat depth = getDepth( vUv );","\tfloat viewZ = getViewZ( depth );","\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );","\tvec3 viewNormal = getViewNormal( vUv );"," vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );","\tvec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;","\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );","\tvec3 bitangent = cross( viewNormal, tangent );","\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );"," float occlusion = 0.0;"," for ( int i = 0; i < KERNEL_SIZE; i ++ ) {","\t\tvec3 sampleVector = kernelMatrix * kernel[ i ];","\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );","\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );","\t\tsamplePointNDC /= samplePointNDC.w;","\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;","\t\tfloat realDepth = getLinearDepth( samplePointUv );","\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );","\t\tfloat delta = sampleDepth - realDepth;","\t\tif ( delta > minDistance && delta < maxDistance ) {","\t\t\tocclusion += 1.0;","\t\t}","\t}","\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );","\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );","}"].join("\n")},s={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","varying vec2 vUv;","#include <packing>","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","void main() {","\tfloat depth = getLinearDepth( vUv );","\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );","}"].join("\n")},a={uniforms:{tDiffuse:{value:null},resolution:{value:new r.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texelSize = ( 1.0 / resolution );","\tfloat result = 0.0;","\tfor ( int i = - 2; i <= 2; i ++ ) {","\t\tfor ( int j = - 2; j <= 2; j ++ ) {","\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;","\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;","\t\t}","\t}","\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );","}"].join("\n")};t.SSAOBlurShader=a,t.SSAODepthShader=s,t.SSAOShader=i},30424:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={defines:{MAX_STEP:0,isPerspectiveCamera:!0,isDistanceAttenuation:!0,isFresnel:!0,isInfiniteThick:!1,isSelective:!1},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tMetalness:{value:null},tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new r.Vector2},cameraProjectionMatrix:{value:new r.Matrix4},cameraInverseProjectionMatrix:{value:new r.Matrix4},opacity:{value:.5},maxDistance:{value:180},cameraRange:{value:0},surfDist:{value:.007},thickTolerance:{value:.03}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\t\t// precision highp float;\n\t\tprecision highp sampler2D;\n\t\tvarying vec2 vUv;\n\t\tuniform sampler2D tDepth;\n\t\tuniform sampler2D tNormal;\n\t\tuniform sampler2D tMetalness;\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float cameraRange;\n\t\tuniform vec2 resolution;\n\t\tuniform float opacity;\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform float maxDistance;\n\t\tuniform float surfDist;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\t\tuniform float thickTolerance;\n\t\t#include <packing>\n\t\tfloat pointToLineDistance(vec3 x0, vec3 x1, vec3 x2) {\n\t\t\t//x0: point, x1: linePointA, x2: linePointB\n\t\t\t//https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html\n\t\t\treturn length(cross(x0-x1,x0-x2))/length(x2-x1);\n\t\t}\n\t\tfloat pointPlaneDistance(vec3 point,vec3 planePoint,vec3 planeNormal){\n\t\t\t// https://mathworld.wolfram.com/Point-PlaneDistance.html\n\t\t\t//// https://en.wikipedia.org/wiki/Plane_(geometry)\n\t\t\t//// http://paulbourke.net/geometry/pointlineplane/\n\t\t\tfloat a=planeNormal.x,b=planeNormal.y,c=planeNormal.z;\n\t\t\tfloat x0=point.x,y0=point.y,z0=point.z;\n\t\t\tfloat x=planePoint.x,y=planePoint.y,z=planePoint.z;\n\t\t\tfloat d=-(a*x+b*y+c*z);\n\t\t\tfloat distance=(a*x0+b*y0+c*z0+d)/sqrt(a*a+b*b+c*c);\n\t\t\treturn distance;\n\t\t}\n\t\tfloat getDepth( const in vec2 uv ) {\n\t\t\treturn texture2D( tDepth, uv ).x;\n\t\t}\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\t\tvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n\t\t\tvec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n\t\t\tclipPosition *= clipW; //clip\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;//view\n\t\t}\n\t\tvec3 getViewNormal( const in vec2 uv ) {\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, uv ).xyz );\n\t\t}\n\t\tvec2 viewPositionToXY(vec3 viewPosition){\n\t\t\tvec2 xy;\n\t\t\tvec4 clip=cameraProjectionMatrix*vec4(viewPosition,1);\n\t\t\txy=clip.xy;//clip\n\t\t\tfloat clipW=clip.w;\n\t\t\txy/=clipW;//NDC\n\t\t\txy=(xy+1.)/2.;//uv\n\t\t\txy*=resolution;//screen\n\t\t\treturn xy;\n\t\t}\n\t\tvoid main(){\n\t\t\t#ifdef isSelective\n\t\t\t\tfloat metalness=texture2D(tMetalness,vUv).r;\n\t\t\t\tif(metalness==0.) return;\n\t\t\t#endif\n\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tfloat viewZ = getViewZ( depth );\n\t\t\tif(-viewZ>=cameraFar) return;\n\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ+cameraProjectionMatrix[3][3];\n\t\t\tvec3 viewPosition=getViewPosition( vUv, depth, clipW );\n\n\t\t\tvec2 d0=gl_FragCoord.xy;\n\t\t\tvec2 d1;\n\n\t\t\tvec3 viewNormal=getViewNormal( vUv );\n\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tvec3 viewIncidenceDir=normalize(viewPosition);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#else\n\t\t\t\tvec3 viewIncidenceDir=vec3(0,0,-1);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#endif\n\n\t\t\tfloat maxReflectRayLen=maxDistance/dot(-viewIncidenceDir,viewNormal);\n\t\t\t// dot(a,b)==length(a)*length(b)*cos(theta) // https://www.mathsisfun.com/algebra/vectors-dot-product.html\n\t\t\t// if(a.isNormalized&&b.isNormalized) dot(a,b)==cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen=cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen==dot(a,b)\n\t\t\t// maxReflectRayLen==maxDistance/dot(a,b)\n\n\t\t\tvec3 d1viewPosition=viewPosition+viewReflectDir*maxReflectRayLen;\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tif(d1viewPosition.z>-cameraNear){\n\t\t\t\t\t//https://tutorial.math.lamar.edu/Classes/CalcIII/EqnsOfLines.aspx\n\t\t\t\t\tfloat t=(-cameraNear-viewPosition.z)/viewReflectDir.z;\n\t\t\t\t\td1viewPosition=viewPosition+viewReflectDir*t;\n\t\t\t\t}\n\t\t\t#endif\n\t\t\td1=viewPositionToXY(d1viewPosition);\n\n\t\t\tfloat totalLen=length(d1-d0);\n\t\t\tfloat xLen=d1.x-d0.x;\n\t\t\tfloat yLen=d1.y-d0.y;\n\t\t\tfloat totalStep=max(abs(xLen),abs(yLen));\n\t\t\tfloat xSpan=xLen/totalStep;\n\t\t\tfloat ySpan=yLen/totalStep;\n\t\t\tfor(float i=0.;i<MAX_STEP;i++){\n\t\t\t\tif(i>=totalStep) break;\n\t\t\t\tvec2 xy=vec2(d0.x+i*xSpan,d0.y+i*ySpan);\n\t\t\t\tif(xy.x<0.||xy.x>resolution.x||xy.y<0.||xy.y>resolution.y) break;\n\t\t\t\tfloat s=length(xy-d0)/totalLen;\n\t\t\t\tvec2 uv=xy/resolution;\n\n\t\t\t\tfloat d = getDepth(uv);\n\t\t\t\tfloat vZ = getViewZ( d );\n\t\t\t\tif(-vZ>=cameraFar) continue;\n\t\t\t\tfloat cW = cameraProjectionMatrix[2][3] * vZ+cameraProjectionMatrix[3][3];\n\t\t\t\tvec3 vP=getViewPosition( uv, d, cW );\n\n\t\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\t\t// https://www.comp.nus.edu.sg/~lowkl/publications/lowk_persp_interp_techrep.pdf\n\t\t\t\t\tfloat recipVPZ=1./viewPosition.z;\n\t\t\t\t\tfloat viewReflectRayZ=1./(recipVPZ+s*(1./d1viewPosition.z-recipVPZ));\n\t\t\t\t\tfloat sD=surfDist*cW;\n\t\t\t\t#else\n\t\t\t\t\tfloat viewReflectRayZ=viewPosition.z+s*(d1viewPosition.z-viewPosition.z);\n\t\t\t\t\tfloat sD=surfDist;\n\t\t\t\t#endif\n\t\t\t\tif(viewReflectRayZ-sD>vZ) continue;\n\n\t\t\t\t#ifdef isInfiniteThick\n\t\t\t\t\tif(viewReflectRayZ+thickTolerance*clipW<vP.z) break;\n\t\t\t\t#endif\n\t\t\t\tfloat away=pointToLineDistance(vP,viewPosition,d1viewPosition);\n\n\t\t\t\tfloat op=opacity;\n\n\t\t\t\tif(away<sD){\n\t\t\t\t\tvec3 vN=getViewNormal( uv );\n\t\t\t\t\tif(dot(viewReflectDir,vN)>=0.) continue;\n\t\t\t\t\tfloat distance=pointPlaneDistance(vP,viewPosition,viewNormal);\n\t\t\t\t\tif(distance>maxDistance) break;\n\t\t\t\t\t#ifdef isDistanceAttenuation\n\t\t\t\t\t\tfloat ratio=1.-(distance/maxDistance);\n\t\t\t\t\t\tfloat attenuation=ratio*ratio;\n\t\t\t\t\t\top=opacity*attenuation;\n\t\t\t\t\t#endif\n\t\t\t\t\t#ifdef isFresnel\n\t\t\t\t\t\tfloat fresnel=(dot(viewIncidenceDir,viewReflectDir)+1.)/2.;\n\t\t\t\t\t\top*=fresnel;\n\t\t\t\t\t#endif\n\t\t\t\t\tvec4 reflectColor=texture2D(tDiffuse,uv);\n\t\t\t\t\tgl_FragColor.xyz=reflectColor.xyz;\n\t\t\t\t\tgl_FragColor.a=op;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"},s={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDepth;\n\n uniform float cameraNear;\n uniform float cameraFar;\n\n varying vec2 vUv;\n\n #include <packing>\n\n\t\tfloat getLinearDepth( const in vec2 uv ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, uv ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, uv ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n void main() {\n\n \tfloat depth = getLinearDepth( vUv );\n\t\t\tfloat d = 1.0 - depth;\n\t\t\t// d=(d-.999)*1000.;\n \tgl_FragColor = vec4( vec3( d ), 1.0 );\n\n }\n\n "},a={uniforms:{tDiffuse:{value:null},resolution:{value:new r.Vector2},opacity:{value:.5}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform vec2 resolution;\n varying vec2 vUv;\n void main() {\n\t\t\t//reverse engineering from PhotoShop blur filter, then change coefficient\n\n \tvec2 texelSize = ( 1.0 / resolution );\n\n\t\t\tvec4 c=texture2D(tDiffuse,vUv);\n\n\t\t\tvec2 offset;\n\n\t\t\toffset=(vec2(-1,0))*texelSize;\n\t\t\tvec4 cl=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(1,0))*texelSize;\n\t\t\tvec4 cr=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,-1))*texelSize;\n\t\t\tvec4 cb=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,1))*texelSize;\n\t\t\tvec4 ct=texture2D(tDiffuse,vUv+offset);\n\n\t\t\t// float coeCenter=.5;\n\t\t\t// float coeSide=.125;\n\t\t\tfloat coeCenter=.2;\n\t\t\tfloat coeSide=.2;\n\t\t\tfloat a=c.a*coeCenter+cl.a*coeSide+cr.a*coeSide+cb.a*coeSide+ct.a*coeSide;\n\t\t\tvec3 rgb=(c.rgb*c.a*coeCenter+cl.rgb*cl.a*coeSide+cr.rgb*cr.a*coeSide+cb.rgb*cb.a*coeSide+ct.rgb*ct.a*coeSide)/a;\n\t\t\tgl_FragColor=vec4(rgb,a);\n\n\t\t}\n\t"};t.SSRBlurShader=a,t.SSRDepthShader=s,t.SSRShader=i},83222:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tvec3 c = color.rgb;","\tcolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","\tcolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","\tcolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","\tgl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.SepiaShader=n},66155:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{tDiffuse:{value:null},resolution:{value:new(n(85232).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","\tconst mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","\tconst mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","\tfloat tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","\tfloat tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","\tfloat tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","\tfloat tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","\tfloat tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","\tfloat tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","\tfloat tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","\tfloat tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","\tfloat tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","\tfloat valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","\t\tGx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","\t\tGx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","\tfloat valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","\t\tGy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","\t\tGy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","\tfloat G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","\tgl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.SobelOperatorShader=r},61621:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);let i;function s(){if(i)return i;const e=r.ShaderChunk.meshphong_frag.slice(0,r.ShaderChunk.meshphong_frag.indexOf("void main() {")),t=r.ShaderChunk.meshphong_frag.slice(r.ShaderChunk.meshphong_frag.indexOf("void main() {"));return i={uniforms:r.UniformsUtils.merge([r.ShaderLib.phong.uniforms,{thicknessMap:{value:null},thicknessColor:{value:new r.Color(16777215)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:`\n #define USE_UV\n ${r.ShaderChunk.meshphong_vert}\n `,fragmentShader:`\n #define USE_UV',\n #define SUBSURFACE',\n\n ${e}\n\n uniform sampler2D thicknessMap;\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n \tvec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;\n \tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n \tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n \tvec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n \treflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n\n ${t.replace("#include <lights_fragment_begin>",r.ShaderChunk.lights_fragment_begin.replace(/RE_Direct\( directLight, geometry, material, reflectedLight \);/g,"\n RE_Direct( directLight, geometry, material, reflectedLight );\n\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n "))}\n `},i}const a={get uniforms(){return s().uniforms},set uniforms(e){s().uniforms=e},get vertexShader(){return s().vertexShader},set vertexShader(e){s().vertexShader=e},get fragmentShader(){return s().vertexShader},set fragmentShader(e){s().vertexShader=e}};t.SubsurfaceScatteringShader=a},60206:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","\tvec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","\tgl_FragColor = newTex;","}"].join("\n")};t.TechnicolorShader=n},51867:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","\tuniform sampler2D luminanceMap;","#else","\tuniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","\t#ifdef ADAPTED_LUMINANCE","\t\tfloat fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","\t#else","\t\tfloat fLumAvg = averageLuminance;","\t#endif","\tfloat fLumPixel = linearToRelativeLuminance( vColor );","\tfloat fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","\tfloat fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","\treturn fLumCompressed * vColor;","}","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.ToneMapShader=n},55658:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{uDirLightPos:{value:new r.Vector3},uDirLightColor:{value:new r.Color(15658734)},uAmbientLightColor:{value:new r.Color(328965)},uBaseColor:{value:new r.Color(16777215)}},vertexShader:["varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvNormal = normalize( normalMatrix * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvRefract = refract( normalize( I ), worldNormal, 1.02 );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tfloat intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );","\tintensity += length(lightWeighting) * 0.2;","\tfloat cameraWeighting = dot( normalize( vNormal ), vRefract );","\tintensity += pow( 1.0 - length( cameraWeighting ), 6.0 );","\tintensity = intensity * 0.2 + 0.3;","\tif ( intensity < 0.50 ) {","\t\tgl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );","\t} else {","\t\tgl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );","}","}"].join("\n")},s={uniforms:{uDirLightPos:{value:new r.Vector3},uDirLightColor:{value:new r.Color(15658734)},uAmbientLightColor:{value:new r.Color(328965)},uBaseColor:{value:new r.Color(15658734)},uLineColor1:{value:new r.Color(8421504)},uLineColor2:{value:new r.Color(0)},uLineColor3:{value:new r.Color(0)},uLineColor4:{value:new r.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);","\tfloat light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {","\t\tgl_FragColor *= vec4( uLineColor1, 1.0 );","\t}","\tif ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {","\t\tgl_FragColor *= vec4( uLineColor2, 1.0 );","\t}","}"].join("\n")},a={uniforms:{uDirLightPos:{value:new r.Vector3},uDirLightColor:{value:new r.Color(15658734)},uAmbientLightColor:{value:new r.Color(328965)},uBaseColor:{value:new r.Color(16777215)},uLineColor1:{value:new r.Color(0)},uLineColor2:{value:new r.Color(0)},uLineColor3:{value:new r.Color(0)},uLineColor4:{value:new r.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(lightWeighting) < 1.00 ) {","\t\tif ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.75 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor2, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor3, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.3465 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor4, 1.0 );","\t}","\t}","}"].join("\n")},o={uniforms:{uDirLightPos:{value:new r.Vector3},uDirLightColor:{value:new r.Color(15658734)},uAmbientLightColor:{value:new r.Color(328965)},uBaseColor:{value:new r.Color(16777215)},uLineColor1:{value:new r.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","gl_FragColor = vec4( uBaseColor, 1.0 );","if ( length(lightWeighting) < 1.00 ) {","\t\tif ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","}"].join("\n")};t.ToonShader1=i,t.ToonShader2=s,t.ToonShaderDotted=o,t.ToonShaderHatching=a},60310:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r={uniforms:{texture:{value:null},delta:{value:new(n(85232).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","\tvec4 color = vec4( 0.0 );","\tfloat total = 0.0;","\tfloat offset = rand( vUv );","\tfor ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","\t\tfloat percent = ( t + offset - 0.5 ) / ITERATIONS;","\t\tfloat weight = 1.0 - abs( percent );","\t\tcolor += texture2D( texture, vUv + delta * percent ) * weight;","\t\ttotal += weight;","\t}","\tgl_FragColor = color / total;","}"].join("\n")};t.TriangleBlurShader=r},65149:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include <packing>","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.UnpackDepthRGBAShader=n},94989:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "};t.VerticalBlurShader=n},19076:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat vv = v * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")};t.VerticalTiltShiftShader=n},74354:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","\tgl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.VignetteShader=n},16832:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={uniforms:{u_size:{value:new r.Vector3(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new r.Vector2(1,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:["\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tvarying vec3 v_position;","\t\tvoid main() {","\t\t\t\tmat4 viewtransformf = modelViewMatrix;","\t\t\t\tmat4 viewtransformi = inverse(modelViewMatrix);","\t\t\t\tvec4 position4 = vec4(position, 1.0);","\t\t\t\tvec4 pos_in_cam = viewtransformf * position4;","\t\t\t\tpos_in_cam.z = -pos_in_cam.w;","\t\t\t\tv_nearpos = viewtransformi * pos_in_cam;","\t\t\t\tpos_in_cam.z = pos_in_cam.w;","\t\t\t\tv_farpos = viewtransformi * pos_in_cam;","\t\t\t\tv_position = position;","\t\t\t\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;","\t\t}"].join("\n"),fragmentShader:["\t\tprecision highp float;","\t\tprecision mediump sampler3D;","\t\tuniform vec3 u_size;","\t\tuniform int u_renderstyle;","\t\tuniform float u_renderthreshold;","\t\tuniform vec2 u_clim;","\t\tuniform sampler3D u_data;","\t\tuniform sampler2D u_cmdata;","\t\tvarying vec3 v_position;","\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tconst int MAX_STEPS = 887;\t// 887 for 512^3, 1774 for 1024^3","\t\tconst int REFINEMENT_STEPS = 4;","\t\tconst float relative_step_size = 1.0;","\t\tconst vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);","\t\tconst vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);","\t\tconst vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);","\t\tconst float shininess = 40.0;","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tvoid cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tfloat sample1(vec3 texcoords);","\t\tvec4 apply_colormap(float val);","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);","\t\tvoid main() {","\t\t\t\tvec3 farpos = v_farpos.xyz / v_farpos.w;","\t\t\t\tvec3 nearpos = v_nearpos.xyz / v_nearpos.w;","\t\t\t\tvec3 view_ray = normalize(nearpos.xyz - farpos.xyz);","\t\t\t\tfloat distance = dot(nearpos - v_position, view_ray);","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.x) / view_ray.x,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.x - 0.5 - v_position.x) / view_ray.x));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.y) / view_ray.y,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.y - 0.5 - v_position.y) / view_ray.y));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.z) / view_ray.z,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.z - 0.5 - v_position.z) / view_ray.z));","\t\t\t\tvec3 front = v_position + view_ray * distance;","\t\t\t\tint nsteps = int(-distance / relative_step_size + 0.5);","\t\t\t\tif ( nsteps < 1 )","\t\t\t\t\t\tdiscard;","\t\t\t\tvec3 step = ((v_position - front) / u_size) / float(nsteps);","\t\t\t\tvec3 start_loc = front / u_size;","\t\t\t\tif (u_renderstyle == 0)","\t\t\t\t\t\tcast_mip(start_loc, step, nsteps, view_ray);","\t\t\t\telse if (u_renderstyle == 1)","\t\t\t\t\t\tcast_iso(start_loc, step, nsteps, view_ray);","\t\t\t\tif (gl_FragColor.a < 0.05)","\t\t\t\t\t\tdiscard;","\t\t}","\t\tfloat sample1(vec3 texcoords) {","\t\t\t\t/* Sample float value from a 3D texture. Assumes intensity data. */","\t\t\t\treturn texture(u_data, texcoords.xyz).r;","\t\t}","\t\tvec4 apply_colormap(float val) {","\t\t\t\tval = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);","\t\t\t\treturn texture2D(u_cmdata, vec2(val, 0.5));","\t\t}","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {","\t\t\t\tfloat max_val = -1e6;","\t\t\t\tint max_i = 100;","\t\t\t\tvec3 loc = start_loc;","\t\t\t\tfor (int iter=0; iter<MAX_STEPS; iter++) {","\t\t\t\t\t\tif (iter >= nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > max_val) {","\t\t\t\t\t\t\t\tmax_val = val;","\t\t\t\t\t\t\t\tmax_i = iter;","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t\t\tvec3 iloc = start_loc + step * (float(max_i) - 0.5);","\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\tfor (int i=0; i<REFINEMENT_STEPS; i++) {","\t\t\t\t\t\tmax_val = max(max_val, sample1(iloc));","\t\t\t\t\t\tiloc += istep;","\t\t\t\t}","\t\t\t\tgl_FragColor = apply_colormap(max_val);","\t\t}","\t\tvoid cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {","\t\t\t\tgl_FragColor = vec4(0.0);\t// init transparent","\t\t\t\tvec4 color3 = vec4(0.0);\t// final color","\t\t\t\tvec3 dstep = 1.5 / u_size;\t// step to sample derivative","\t\t\t\tvec3 loc = start_loc;","\t\t\t\tfloat low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);","\t\t\t\tfor (int iter=0; iter<MAX_STEPS; iter++) {","\t\t\t\t\t\tif (iter >= nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > low_threshold) {","\t\t\t\t\t\t\t\tvec3 iloc = loc - 0.5 * step;","\t\t\t\t\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\t\t\t\t\tfor (int i=0; i<REFINEMENT_STEPS; i++) {","\t\t\t\t\t\t\t\t\t\tval = sample1(iloc);","\t\t\t\t\t\t\t\t\t\tif (val > u_renderthreshold) {","\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = add_lighting(val, iloc, dstep, view_ray);","\t\t\t\t\t\t\t\t\t\t\t\treturn;","\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\tiloc += istep;","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t}","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)","\t\t{","\t\t\t\tvec3 V = normalize(view_ray);","\t\t\t\tvec3 N;","\t\t\t\tfloat val1, val2;","\t\t\t\tval1 = sample1(loc + vec3(-step[0], 0.0, 0.0));","\t\t\t\tval2 = sample1(loc + vec3(+step[0], 0.0, 0.0));","\t\t\t\tN[0] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, -step[1], 0.0));","\t\t\t\tval2 = sample1(loc + vec3(0.0, +step[1], 0.0));","\t\t\t\tN[1] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, 0.0, -step[2]));","\t\t\t\tval2 = sample1(loc + vec3(0.0, 0.0, +step[2]));","\t\t\t\tN[2] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tfloat gm = length(N); // gradient magnitude","\t\t\t\tN = normalize(N);","\t\t\t\tfloat Nselect = float(dot(N, V) > 0.0);","\t\t\t\tN = (2.0 * Nselect - 1.0) * N;\t// ==\tNselect * N - (1.0-Nselect)*N;","\t\t\t\tvec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tfor (int i=0; i<1; i++)","\t\t\t\t{","\t\t\t\t\t\tvec3 L = normalize(view_ray);\t//lightDirs[i];","\t\t\t\t\t\tfloat lightEnabled = float( length(L) > 0.0 );","\t\t\t\t\t\tL = normalize(L + (1.0 - lightEnabled));","\t\t\t\t\t\tfloat lambertTerm = clamp(dot(N, L), 0.0, 1.0);","\t\t\t\t\t\tvec3 H = normalize(L+V); // Halfway vector","\t\t\t\t\t\tfloat specularTerm = pow(max(dot(H, N), 0.0), shininess);","\t\t\t\t\t\tfloat mask1 = lightEnabled;","\t\t\t\t\t\tambient_color +=\tmask1 * ambient_color;\t// * gl_LightSource[i].ambient;","\t\t\t\t\t\tdiffuse_color +=\tmask1 * lambertTerm;","\t\t\t\t\t\tspecular_color += mask1 * specularTerm * specular_color;","\t\t\t\t}","\t\t\t\tvec4 final_color;","\t\t\t\tvec4 color = apply_colormap(val);","\t\t\t\tfinal_color = color * (ambient_color + diffuse_color) + specular_color;","\t\t\t\tfinal_color.a = color.a;","\t\t\t\treturn final_color;","\t\t}"].join("\n")};t.VolumeRenderShader1=i},169:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n={uniforms:{color:{value:null},time:{value:0},tDiffuse:{value:null},tDudv:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.WaterRefractionShader=n},99100:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.FlakesTexture=class{constructor(e=512,t=512){const n=document.createElement("canvas");n.width=e,n.height=t;const r=n.getContext("2d");r.fillStyle="rgb(127,127,255)",r.fillRect(0,0,e,t);for(let i=0;i<4e3;i++){const n=Math.random()*e,i=Math.random()*t,s=3*Math.random()+3;let a=2*Math.random()-1,o=2*Math.random()-1,l=1.5;const c=Math.sqrt(a*a+o*o+l*l);a/=c,o/=c,l/=c,r.fillStyle="rgb("+(127*a+127)+","+(127*o+127)+","+255*l+")",r.beginPath(),r.arc(n,i,s,0,2*Math.PI),r.fill()}return n}}},91455:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.getWithKey=(e,t)=>e[t]},66552:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(91455),s=e=>{let t,n,i,s=0;if(e.forEach((e=>(void 0===t&&(t=e.array.constructor),t!==e.array.constructor?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null):(void 0===n&&(n=e.itemSize),n!==e.itemSize?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null):(void 0===i&&(i=e.normalized),i!==e.normalized?(console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null):void(s+=e.array.length)))))),t&&n){const a=new t(s);let o=0;return e.forEach((e=>{a.set(e.array,o),o+=e.array.length})),new r.BufferAttribute(a,n,i)}};t.computeMorphedAttributes=function(e){if(!0!==e.geometry.isBufferGeometry)return console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry."),null;const t=new r.Vector3,n=new r.Vector3,i=new r.Vector3,s=new r.Vector3,a=new r.Vector3,o=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3;function u(e,r,u,d,p,f,m,g,A){t.fromBufferAttribute(u,f),n.fromBufferAttribute(u,m),i.fromBufferAttribute(u,g);const v=e.morphTargetInfluences;if(r.morphTargets&&d&&v){l.set(0,0,0),c.set(0,0,0),h.set(0,0,0);for(let e=0,r=d.length;e<r;e++){const r=v[e],u=d[e];0!==r&&(s.fromBufferAttribute(u,f),a.fromBufferAttribute(u,m),o.fromBufferAttribute(u,g),p?(l.addScaledVector(s,r),c.addScaledVector(a,r),h.addScaledVector(o,r)):(l.addScaledVector(s.sub(t),r),c.addScaledVector(a.sub(n),r),h.addScaledVector(o.sub(i),r)))}t.add(l),n.add(c),i.add(h)}e.isSkinnedMesh&&(e.boneTransform(f,t),e.boneTransform(m,n),e.boneTransform(g,i)),A[3*f+0]=t.x,A[3*f+1]=t.y,A[3*f+2]=t.z,A[3*m+0]=n.x,A[3*m+1]=n.y,A[3*m+2]=n.z,A[3*g+0]=i.x,A[3*g+1]=i.y,A[3*g+2]=i.z}const d=e.geometry,p=e.material;let f,m,g;const A=d.index,v=d.attributes.position,y=d.morphAttributes.position,x=d.morphTargetsRelative,b=d.attributes.normal,E=d.morphAttributes.position,_=d.groups,S=d.drawRange;let w,M,C,T,I,B,R,P;const D=new Float32Array(v.count*v.itemSize),L=new Float32Array(b.count*b.itemSize);if(null!==A)if(Array.isArray(p))for(w=0,C=_.length;w<C;w++)for(I=_[w],B=p[I.materialIndex],R=Math.max(I.start,S.start),P=Math.min(I.start+I.count,S.start+S.count),M=R,T=P;M<T;M+=3)f=A.getX(M),m=A.getX(M+1),g=A.getX(M+2),u(e,B,v,y,x,f,m,g,D),u(e,B,b,E,x,f,m,g,L);else for(R=Math.max(0,S.start),P=Math.min(A.count,S.start+S.count),w=R,C=P;w<C;w+=3)f=A.getX(w),m=A.getX(w+1),g=A.getX(w+2),u(e,p,v,y,x,f,m,g,D),u(e,p,b,E,x,f,m,g,L);else if(void 0!==v)if(Array.isArray(p))for(w=0,C=_.length;w<C;w++)for(I=_[w],B=p[I.materialIndex],R=Math.max(I.start,S.start),P=Math.min(I.start+I.count,S.start+S.count),M=R,T=P;M<T;M+=3)f=M,m=M+1,g=M+2,u(e,B,v,y,x,f,m,g,D),u(e,B,b,E,x,f,m,g,L);else for(R=Math.max(0,S.start),P=Math.min(v.count,S.start+S.count),w=R,C=P;w<C;w+=3)f=w,m=w+1,g=w+2,u(e,p,v,y,x,f,m,g,D),u(e,p,b,E,x,f,m,g,L);return{positionAttribute:v,normalAttribute:b,morphedPositionAttribute:new r.Float32BufferAttribute(D,3),morphedNormalAttribute:new r.Float32BufferAttribute(L,3)}},t.estimateBytesUsed=function(e){let t=0;for(let r in e.attributes){const n=e.getAttribute(r);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const n=e.getIndex();return t+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,t},t.interleaveAttributes=e=>{let t,n=0,s=0;for(let r=0,i=e.length;r<i;++r){const i=e[r];if(void 0===t&&(t=i.array.constructor),t!==i.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=i.array.length,s+=i.itemSize}const a=new r.InterleavedBuffer(new t(n),s);let o=0;const l=[],c=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let u=0,d=e.length;u<d;u++){const t=e[u],n=t.itemSize,s=t.count,d=new r.InterleavedBufferAttribute(a,n,o,t.normalized);l.push(d),o+=n;for(let e=0;e<s;e++)for(let r=0;r<n;r++){i.getWithKey(d,h[r])(e,i.getWithKey(t,c[r])(e))}}return l},t.mergeBufferAttributes=s,t.mergeBufferGeometries=(e,t)=>{const n=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),o={},l={},c=e[0].morphTargetsRelative,h=new r.BufferGeometry;let u=0;if(e.forEach(((e,r)=>{let s=0;if(n!==(null!==e.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let t in e.attributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[t]&&(o[t]=[]),o[t].push(e.attributes[t]),s++}if(s!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+". Make sure all geometries have the same number of attributes."),null;if(c!==e.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let t in e.morphAttributes){if(!a.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+". .morphAttributes must be consistent throughout all geometries."),null;void 0===l[t]&&(l[t]=[]),l[t].push(e.morphAttributes[t])}if(h.userData.mergedUserData=h.userData.mergedUserData||[],h.userData.mergedUserData.push(e.userData),t){let t;if(e.index)t=e.index.count;else{if(void 0===e.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+r+". The geometry must have either an index or a position attribute"),null;t=e.attributes.position.count}h.addGroup(u,t,r),u+=t}})),n){let t=0;const n=[];e.forEach((e=>{const r=e.index;for(let i=0;i<r.count;++i)n.push(r.getX(i)+t);t+=e.attributes.position.count})),h.setIndex(n)}for(let r in o){const e=s(o[r]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+r+" attribute."),null;h.setAttribute(r,e)}for(let r in l){const e=l[r][0].length;if(0===e)break;h.morphAttributes=h.morphAttributes||{},h.morphAttributes[r]=[];for(let t=0;t<e;++t){const e=[];for(let i=0;i<l[r].length;++i)e.push(l[r][i][t]);const n=s(e);if(!n)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+r+" morphAttribute."),null;h.morphAttributes[r].push(n)}}return h},t.mergeVertices=function(e,t=1e-4){t=Math.max(t,Number.EPSILON);const n={},i=e.getIndex(),s=e.getAttribute("position"),a=i?i.count:s.count;let o=0;const l=Object.keys(e.attributes),c={},h={},u=[],d=["getX","getY","getZ","getW"];for(let r=0,g=l.length;r<g;r++){const t=l[r];c[t]=[];const n=e.morphAttributes[t];n&&(h[t]=new Array(n.length).fill(0).map((()=>[])))}const p=Math.log10(1/t),f=Math.pow(10,p);for(let r=0;r<a;r++){const t=i?i.getX(r):r;let s="";for(let n=0,r=l.length;n<r;n++){const r=l[n],i=e.getAttribute(r),a=i.itemSize;for(let e=0;e<a;e++)s+=~~(i[d[e]](t)*f)+","}if(s in n)u.push(n[s]);else{for(let n=0,r=l.length;n<r;n++){const r=l[n],i=e.getAttribute(r),s=e.morphAttributes[r],a=i.itemSize,o=c[r],u=h[r];for(let e=0;e<a;e++){const n=d[e];if(o.push(i[n](t)),s)for(let e=0,r=s.length;e<r;e++)u[e].push(s[e][n](t))}}n[s]=o,u.push(o),o++}}const m=e.clone();for(let g=0,A=l.length;g<A;g++){const t=l[g],n=e.getAttribute(t),i=new n.array.constructor(c[t]),s=new r.BufferAttribute(i,n.itemSize,n.normalized);if(m.setAttribute(t,s),t in h)for(let a=0;a<h[t].length;a++){const n=e.morphAttributes[t][a],i=new n.array.constructor(h[t][a]),s=new r.BufferAttribute(i,n.itemSize,n.normalized);m.morphAttributes[t][a]=s}}return m.setIndex(u),m},t.toCreasedNormals=function(e,t=Math.PI/3){const n=Math.cos(t),i=100*(1+1e-10),s=[new r.Vector3,new r.Vector3,new r.Vector3],a=new r.Vector3,o=new r.Vector3,l=new r.Vector3,c=new r.Vector3;function h(e){return`${~~(e.x*i)},${~~(e.y*i)},${~~(e.z*i)}`}const u=e.index?e.toNonIndexed():e,d=u.attributes.position,p={};for(let g=0,A=d.count/3;g<A;g++){const e=3*g,t=s[0].fromBufferAttribute(d,e+0),n=s[1].fromBufferAttribute(d,e+1),i=s[2].fromBufferAttribute(d,e+2);a.subVectors(i,n),o.subVectors(t,n);const l=(new r.Vector3).crossVectors(a,o).normalize();for(let r=0;r<3;r++){const e=h(s[r]);e in p||(p[e]=[]),p[e].push(l)}}const f=new Float32Array(3*d.count),m=new r.BufferAttribute(f,3,!1);for(let r=0,g=d.count/3;r<g;r++){const e=3*r,t=s[0].fromBufferAttribute(d,e+0),i=s[1].fromBufferAttribute(d,e+1),u=s[2].fromBufferAttribute(d,e+2);a.subVectors(u,i),o.subVectors(t,i),l.crossVectors(a,o).normalize();for(let r=0;r<3;r++){const t=p[h(s[r])];c.set(0,0,0);for(let e=0,r=t.length;e<r;e++){const r=t[e];l.dot(r)>n&&c.add(r)}c.normalize(),m.setXYZ(e+r,c.x,c.y,c.z)}}return u.setAttribute("normal",m),u},t.toTrianglesDrawMode=function(e,t){if(t===r.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===r.TriangleFanDrawMode||t===r.TriangleStripDrawMode){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const i=n.count-2,s=[];if(n)if(t===r.TriangleFanDrawMode)for(let e=1;e<=i;e++)s.push(n.getX(0)),s.push(n.getX(e)),s.push(n.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(s.push(n.getX(e)),s.push(n.getX(e+1)),s.push(n.getX(e+2))):(s.push(n.getX(e+2)),s.push(n.getX(e+1)),s.push(n.getX(e)));s.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=e.clone();return a.setIndex(s),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}},69651:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);var i={compressNormals:function(e,t){e.geometry||console.error("Mesh must contain geometry. ");const n=e.geometry.attributes.normal;if(n||console.error("Geometry must contain normal attribute. "),n.isPacked)return;3!=n.itemSize&&console.error("normal.itemSize is not 3, which cannot be encoded. ");const i=n.array,a=n.count;let o;if("DEFAULT"==t){o=new Uint8Array(3*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.defaultEncode(i[e],i[e+1],i[e+2],1);o[e+0]=t[0],o[e+1]=t[1],o[e+2]=t[2]}e.geometry.setAttribute("normal",new r.BufferAttribute(o,3,!0)),e.geometry.attributes.normal.bytes=1*o.length}else if("OCT1Byte"==t){o=new Int8Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.octEncodeBest(i[e],i[e+1],i[e+2],1);o[e/3*2+0]=t[0],o[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new r.BufferAttribute(o,2,!0)),e.geometry.attributes.normal.bytes=1*o.length}else if("OCT2Byte"==t){o=new Int16Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.octEncodeBest(i[e],i[e+1],i[e+2],2);o[e/3*2+0]=t[0],o[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new r.BufferAttribute(o,2,!0)),e.geometry.attributes.normal.bytes=2*o.length}else if("ANGLES"==t){o=new Uint16Array(2*a);for(let e=0;e<i.length;e+=3){const t=this.EncodingFuncs.anglesEncode(i[e],i[e+1],i[e+2]);o[e/3*2+0]=t[0],o[e/3*2+1]=t[1]}e.geometry.setAttribute("normal",new r.BufferAttribute(o,2,!0)),e.geometry.attributes.normal.bytes=2*o.length}else console.error("Unrecognized encoding method, should be `DEFAULT` or `ANGLES` or `OCT`. ");e.geometry.attributes.normal.needsUpdate=!0,e.geometry.attributes.normal.isPacked=!0,e.geometry.attributes.normal.packingMethod=t,e.material instanceof s||(e.material=(new s).copy(e.material)),"ANGLES"==t&&(e.material.defines.USE_PACKED_NORMAL=0),"OCT1Byte"==t&&(e.material.defines.USE_PACKED_NORMAL=1),"OCT2Byte"==t&&(e.material.defines.USE_PACKED_NORMAL=1),"DEFAULT"==t&&(e.material.defines.USE_PACKED_NORMAL=2)},compressPositions:function(e){e.geometry||console.error("Mesh must contain geometry. ");const t=e.geometry.attributes.position;if(t||console.error("Geometry must contain position attribute. "),t.isPacked)return;3!=t.itemSize&&console.error("position.itemSize is not 3, which cannot be packed. ");const n=t.array,i=this.EncodingFuncs.quantizedEncode(n,2),a=i.quantized,o=i.decodeMat;null==e.geometry.boundingBox&&e.geometry.computeBoundingBox(),null==e.geometry.boundingSphere&&e.geometry.computeBoundingSphere(),e.geometry.setAttribute("position",new r.BufferAttribute(a,3)),e.geometry.attributes.position.isPacked=!0,e.geometry.attributes.position.needsUpdate=!0,e.geometry.attributes.position.bytes=2*a.length,e.material instanceof s||(e.material=(new s).copy(e.material)),e.material.defines.USE_PACKED_POSITION=0,e.material.uniforms.quantizeMatPos.value=o,e.material.uniforms.quantizeMatPos.needsUpdate=!0},compressUvs:function(e){e.geometry||console.error("Mesh must contain geometry property. ");const t=e.geometry.attributes.uv;if(t||console.error("Geometry must contain uv attribute. "),t.isPacked)return;const n={min:1/0,max:-1/0},i=t.array;for(let r=0;r<i.length;r++)n.min=Math.min(n.min,i[r]),n.max=Math.max(n.max,i[r]);let a;if(n.min>=-1&&n.max<=1){a=new Uint16Array(i.length);for(let e=0;e<i.length;e+=2){const t=this.EncodingFuncs.defaultEncode(i[e],i[e+1],0,2);a[e]=t[0],a[e+1]=t[1]}e.geometry.setAttribute("uv",new r.BufferAttribute(a,2,!0)),e.geometry.attributes.uv.isPacked=!0,e.geometry.attributes.uv.needsUpdate=!0,e.geometry.attributes.uv.bytes=2*a.length,e.material instanceof s||(e.material=(new s).copy(e.material)),e.material.defines.USE_PACKED_UV=0}else a=this.EncodingFuncs.quantizedEncodeUV(i,2),e.geometry.setAttribute("uv",new r.BufferAttribute(a.quantized,2)),e.geometry.attributes.uv.isPacked=!0,e.geometry.attributes.uv.needsUpdate=!0,e.geometry.attributes.uv.bytes=2*a.quantized.length,e.material instanceof s||(e.material=(new s).copy(e.material)),e.material.defines.USE_PACKED_UV=1,e.material.uniforms.quantizeMatUV.value=a.decodeMat,e.material.uniforms.quantizeMatUV.needsUpdate=!0},EncodingFuncs:{defaultEncode:function(e,t,n,r){if(1==r){const r=Math.round(.5*(e+1)*255),i=Math.round(.5*(t+1)*255),s=Math.round(.5*(n+1)*255);return new Uint8Array([r,i,s])}if(2==r){const r=Math.round(.5*(e+1)*65535),i=Math.round(.5*(t+1)*65535),s=Math.round(.5*(n+1)*65535);return new Uint16Array([r,i,s])}console.error("number of bytes must be 1 or 2")},defaultDecode:function(e,t){return 1==t?[e[0]/255*2-1,e[1]/255*2-1,e[2]/255*2-1]:2==t?[e[0]/65535*2-1,e[1]/65535*2-1,e[2]/65535*2-1]:void console.error("number of bytes must be 1 or 2")},anglesEncode:function(e,t,n){const r=parseInt(.5*(1+Math.atan2(t,e)/Math.PI)*65535),i=parseInt(.5*(1+n)*65535);return new Uint16Array([r,i])},octEncodeBest:function(e,t,n,r){var i,s,a,o,l;return a=i=c(e,t,n,"floor","floor"),s=h(i),l=u(e,t,n,s),s=h(i=c(e,t,n,"ceil","floor")),(o=u(e,t,n,s))>l&&(a=i,l=o),s=h(i=c(e,t,n,"floor","ceil")),(o=u(e,t,n,s))>l&&(a=i,l=o),s=h(i=c(e,t,n,"ceil","ceil")),(o=u(e,t,n,s))>l&&(a=i),a;function c(e,t,i,s,a){var o=e/(Math.abs(e)+Math.abs(t)+Math.abs(i)),l=t/(Math.abs(e)+Math.abs(t)+Math.abs(i));if(n<0){var c=(1-Math.abs(l))*(o>=0?1:-1),h=(1-Math.abs(o))*(l>=0?1:-1);o=c,l=h;var u=1-Math.abs(o)-Math.abs(l);u>0&&(u+=.001,o+=o>0?u/2:-u/2,l+=l>0?u/2:-u/2)}return 1==r?new Int8Array([Math[s](127.5*o+(o<0?1:0)),Math[a](127.5*l+(l<0?1:0))]):2==r?new Int16Array([Math[s](32767.5*o+(o<0?1:0)),Math[a](32767.5*l+(l<0?1:0))]):void 0}function h(e){var t=e[0],n=e[1];1==r?(t/=t<0?127:128,n/=n<0?127:128):2==r&&(t/=t<0?32767:32768,n/=n<0?32767:32768);var i=1-Math.abs(t)-Math.abs(n);if(i<0){var s=t;t=(1-Math.abs(n))*(t>=0?1:-1),n=(1-Math.abs(s))*(n>=0?1:-1)}var a=Math.sqrt(t*t+n*n+i*i);return[t/a,n/a,i/a]}function u(e,t,n,r){return e*r[0]+t*r[1]+n*r[2]}},quantizedEncode:function(e,t){let n,i;1==t?(n=new Uint8Array(e.length),i=255):2==t?(n=new Uint16Array(e.length),i=65535):console.error("number of bytes error! ");const s=new r.Matrix4,a=new Float32Array(3),o=new Float32Array(3);a[0]=a[1]=a[2]=Number.MAX_VALUE,o[0]=o[1]=o[2]=-Number.MAX_VALUE;for(let r=0;r<e.length;r+=3)a[0]=Math.min(a[0],e[r+0]),a[1]=Math.min(a[1],e[r+1]),a[2]=Math.min(a[2],e[r+2]),o[0]=Math.max(o[0],e[r+0]),o[1]=Math.max(o[1],e[r+1]),o[2]=Math.max(o[2],e[r+2]);s.scale(new r.Vector3((o[0]-a[0])/i,(o[1]-a[1])/i,(o[2]-a[2])/i)),s.elements[12]=a[0],s.elements[13]=a[1],s.elements[14]=a[2],s.transpose();const l=new Float32Array([o[0]!==a[0]?i/(o[0]-a[0]):0,o[1]!==a[1]?i/(o[1]-a[1]):0,o[2]!==a[2]?i/(o[2]-a[2]):0]);for(let r=0;r<e.length;r+=3)n[r+0]=Math.floor((e[r+0]-a[0])*l[0]),n[r+1]=Math.floor((e[r+1]-a[1])*l[1]),n[r+2]=Math.floor((e[r+2]-a[2])*l[2]);return{quantized:n,decodeMat:s}},quantizedEncodeUV:function(e,t){let n,i;1==t?(n=new Uint8Array(e.length),i=255):2==t?(n=new Uint16Array(e.length),i=65535):console.error("number of bytes error! ");const s=new r.Matrix3,a=new Float32Array(2),o=new Float32Array(2);a[0]=a[1]=Number.MAX_VALUE,o[0]=o[1]=-Number.MAX_VALUE;for(let r=0;r<e.length;r+=2)a[0]=Math.min(a[0],e[r+0]),a[1]=Math.min(a[1],e[r+1]),o[0]=Math.max(o[0],e[r+0]),o[1]=Math.max(o[1],e[r+1]);s.scale((o[0]-a[0])/i,(o[1]-a[1])/i),s.elements[6]=a[0],s.elements[7]=a[1],s.transpose();const l=new Float32Array([o[0]!==a[0]?i/(o[0]-a[0]):0,o[1]!==a[1]?i/(o[1]-a[1]):0]);for(let r=0;r<e.length;r+=2)n[r+0]=Math.floor((e[r+0]-a[0])*l[0]),n[r+1]=Math.floor((e[r+1]-a[1])*l[1]);return{quantized:n,decodeMat:s}}}};class s extends r.MeshPhongMaterial{constructor(e){super(),this.defines={},this.type="PackedPhongMaterial",this.uniforms=r.UniformsUtils.merge([r.ShaderLib.phong.uniforms,{quantizeMatPos:{value:null},quantizeMatUV:{value:null}}]),this.vertexShader=["#define PHONG","varying vec3 vViewPosition;","#ifndef FLAT_SHADED","varying vec3 vNormal;","#endif",r.ShaderChunk.common,r.ShaderChunk.uv_pars_vertex,r.ShaderChunk.uv2_pars_vertex,r.ShaderChunk.displacementmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.fog_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,r.ShaderChunk.clipping_planes_pars_vertex,"#ifdef USE_PACKED_NORMAL\n\t\t\t\t\t#if USE_PACKED_NORMAL == 0\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat x = packedNormal.x * 2.0 - 1.0;\n\t\t\t\t\t\t\tfloat y = packedNormal.y * 2.0 - 1.0;\n\t\t\t\t\t\t\tvec2 scth = vec2(sin(x * PI), cos(x * PI));\n\t\t\t\t\t\t\tvec2 scphi = vec2(sqrt(1.0 - y * y), y);\n\t\t\t\t\t\t\treturn normalize( vec3(scth.y * scphi.x, scth.x * scphi.x, scphi.y) );\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_NORMAL == 1\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec3 v = vec3(packedNormal.xy, 1.0 - abs(packedNormal.x) - abs(packedNormal.y));\n\t\t\t\t\t\t\tif (v.z < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tv.xy = (1.0 - abs(v.yx)) * vec2((v.x >= 0.0) ? +1.0 : -1.0, (v.y >= 0.0) ? +1.0 : -1.0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_NORMAL == 2\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec3 v = (packedNormal * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\tuniform mat4 quantizeMatPos;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tuniform mat3 quantizeMatUV;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 0\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = (packedUV * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = ( vec3(packedUV, 1.0) * quantizeMatUV ).xy;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","void main() {",r.ShaderChunk.uv_vertex,"#ifdef USE_UV\n\t\t\t\t\t#ifdef USE_PACKED_UV\n\t\t\t\t\t\tvUv = decodeUV(vUv);\n\t\t\t\t\t#endif\n\t\t\t\t#endif",r.ShaderChunk.uv2_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.beginnormal_vertex,"#ifdef USE_PACKED_NORMAL\n\t\t\t\t\tobjectNormal = decodeNormal(objectNormal);\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_TANGENT\n\t\t\t\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t\t\t\t#endif\n\t\t\t\t",r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","\tvNormal = normalize( transformedNormal );","#endif",r.ShaderChunk.begin_vertex,"#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\ttransformed = ( vec4(transformed, 1.0) * quantizeMatPos ).xyz;\n\t\t\t\t\t#endif\n\t\t\t\t#endif",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.displacementmap_vertex,r.ShaderChunk.project_vertex,r.ShaderChunk.logdepthbuf_vertex,r.ShaderChunk.clipping_planes_vertex,"vViewPosition = - mvPosition.xyz;",r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.shadowmap_vertex,r.ShaderChunk.fog_vertex,"}"].join("\n"),this.fragmentShader=["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",r.ShaderChunk.common,r.ShaderChunk.packing,r.ShaderChunk.dithering_pars_fragment,r.ShaderChunk.color_pars_fragment,r.ShaderChunk.uv_pars_fragment,r.ShaderChunk.uv2_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.alphamap_pars_fragment,r.ShaderChunk.aomap_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.emissivemap_pars_fragment,r.ShaderChunk.envmap_common_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.cube_uv_reflection_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.bsdfs,r.ShaderChunk.lights_pars_begin,r.ShaderChunk.lights_phong_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.bumpmap_pars_fragment,r.ShaderChunk.normalmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,r.ShaderChunk.clipping_planes_pars_fragment,"void main() {",r.ShaderChunk.clipping_planes_fragment,"vec4 diffuseColor = vec4( diffuse, opacity );","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );","vec3 totalEmissiveRadiance = emissive;",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.map_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.alphamap_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,r.ShaderChunk.normal_fragment_begin,r.ShaderChunk.normal_fragment_maps,r.ShaderChunk.emissivemap_fragment,r.ShaderChunk.lights_phong_fragment,r.ShaderChunk.lights_fragment_begin,r.ShaderChunk.lights_fragment_maps,r.ShaderChunk.lights_fragment_end,r.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;",r.ShaderChunk.envmap_fragment,"gl_FragColor = vec4( outgoingLight, diffuseColor.a );",r.ShaderChunk.tonemapping_fragment,parseInt(r.REVISION.replace(/\D+/g,""))>=154?r.ShaderChunk.colorspace_fragment:r.ShaderChunk.encodings_fragment,r.ShaderChunk.fog_fragment,r.ShaderChunk.premultiplied_alpha_fragment,r.ShaderChunk.dithering_fragment,"}"].join("\n"),this.setValues(e)}}t.GeometryCompressionUtils=i,t.PackedPhongMaterial=s},83912:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=(e=new r.Vector3(0,0,0),t=10,n=1,s=0,a=1,o=2,l=3)=>{const c=t/2,h=[new r.Vector3(e.x-c,e.y,e.z-c),new r.Vector3(e.x-c,e.y,e.z+c),new r.Vector3(e.x+c,e.y,e.z+c),new r.Vector3(e.x+c,e.y,e.z-c)],u=[h[s],h[a],h[o],h[l]];if(0<=--n){const e=[];return Array.prototype.push.apply(e,i(u[0],c,n,s,l,o,a)),Array.prototype.push.apply(e,i(u[1],c,n,s,a,o,l)),Array.prototype.push.apply(e,i(u[2],c,n,s,a,o,l)),Array.prototype.push.apply(e,i(u[3],c,n,o,a,s,l)),e}return u},s=(e=new r.Vector3(0,0,0),t=10,n=1,i=0,a=1,o=2,l=3,c=4,h=5,u=6,d=7)=>{const p=t/2,f=[new r.Vector3(e.x-p,e.y+p,e.z-p),new r.Vector3(e.x-p,e.y+p,e.z+p),new r.Vector3(e.x-p,e.y-p,e.z+p),new r.Vector3(e.x-p,e.y-p,e.z-p),new r.Vector3(e.x+p,e.y-p,e.z-p),new r.Vector3(e.x+p,e.y-p,e.z+p),new r.Vector3(e.x+p,e.y+p,e.z+p),new r.Vector3(e.x+p,e.y+p,e.z-p)],m=[f[i],f[a],f[o],f[l],f[c],f[h],f[u],f[d]];if(--n>=0){const e=[];return Array.prototype.push.apply(e,s(m[0],p,n,i,l,c,d,u,h,o,a)),Array.prototype.push.apply(e,s(m[1],p,n,i,d,u,a,o,h,c,l)),Array.prototype.push.apply(e,s(m[2],p,n,i,d,u,a,o,h,c,l)),Array.prototype.push.apply(e,s(m[3],p,n,o,l,i,a,u,d,c,h)),Array.prototype.push.apply(e,s(m[4],p,n,o,l,i,a,u,d,c,h)),Array.prototype.push.apply(e,s(m[5],p,n,c,l,o,h,u,a,i,d)),Array.prototype.push.apply(e,s(m[6],p,n,c,l,o,h,u,a,i,d)),Array.prototype.push.apply(e,s(m[7],p,n,u,h,o,a,i,l,c,d)),e}return m},a={hilbert3D:s,gosper:(e=1)=>function(e){let t=0,n=0,r=0;const i=[0,0,0],s=e.fractal;for(let a=0,o=s.length;a<o;a++){const o=s[a];"+"===o?r+=e.angle:"-"===o?r-=e.angle:"F"===o&&(t+=e.size*Math.cos(r),n+=-e.size*Math.sin(r),i.push(t,n,0))}return i}({fractal:function(e){let t="",n=e.axiom;for(let r=0,i=e.steps;0<=i?r<i:r>i;0<=i?r++:r--){t="";for(let r=0,i=n.length;r<i;r++){const i=n[r];i in e.rules?t+=e.rules[i]:t+=i}n=t}return t}({axiom:"A",steps:4,rules:{A:"A+BF++BF-FA--FAFA-BF+",B:"-FA+BFBF++BF+FA--FA-B"}}),size:e,angle:Math.PI/3}),hilbert2D:i};t.GeometryUtils=a},60995:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232);var a,o=((a=new s.RawShaderMaterial({uniforms:{roughnessMap:{value:null},normalMap:{value:null},texelSize:{value:new s.Vector2(1,1)}},vertexShader:"\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tattribute vec3 position;\n\t\t\tattribute vec2 uv;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvUv = uv;\n\n\t\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t\t}\n\t\t",fragmentShader:"\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tuniform sampler2D roughnessMap;\n\t\t\tuniform sampler2D normalMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec4 envMapTexelToLinear( vec4 a ) { return a; }\n\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tfloat roughnessToVariance( float roughness ) {\n\n\t\t\t\tfloat variance = 0.0;\n\n\t\t\t\tif ( roughness >= r1 ) {\n\n\t\t\t\t\tvariance = ( r0 - roughness ) * ( v1 - v0 ) / ( r0 - r1 ) + v0;\n\n\t\t\t\t} else if ( roughness >= r4 ) {\n\n\t\t\t\t\tvariance = ( r1 - roughness ) * ( v4 - v1 ) / ( r1 - r4 ) + v1;\n\n\t\t\t\t} else if ( roughness >= r5 ) {\n\n\t\t\t\t\tvariance = ( r4 - roughness ) * ( v5 - v4 ) / ( r4 - r5 ) + v4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfloat roughness2 = roughness * roughness;\n\n\t\t\t\t\tvariance = 1.79 * roughness2 * roughness2;\n\n\t\t\t\t}\n\n\t\t\t\treturn variance;\n\n\t\t\t}\n\n\t\t\tfloat varianceToRoughness( float variance ) {\n\n\t\t\t\tfloat roughness = 0.0;\n\n\t\t\t\tif ( variance >= v1 ) {\n\n\t\t\t\t\troughness = ( v0 - variance ) * ( r1 - r0 ) / ( v0 - v1 ) + r0;\n\n\t\t\t\t} else if ( variance >= v4 ) {\n\n\t\t\t\t\troughness = ( v1 - variance ) * ( r4 - r1 ) / ( v1 - v4 ) + r1;\n\n\t\t\t\t} else if ( variance >= v5 ) {\n\n\t\t\t\t\troughness = ( v4 - variance ) * ( r5 - r4 ) / ( v4 - v5 ) + r4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\troughness = pow( 0.559 * variance, 0.25 ); // 0.559 = 1.0 / 1.79\n\n\t\t\t\t}\n\n\t\t\t\treturn roughness;\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = texture2D( roughnessMap, vUv, - 1.0 );\n\n\t\t\t\tif ( texelSize.x == 0.0 ) return;\n\n\t\t\t\tfloat roughness = gl_FragColor.g;\n\n\t\t\t\tfloat variance = roughnessToVariance( roughness );\n\n\t\t\t\tvec3 avgNormal;\n\n\t\t\t\tfor ( float x = - 1.0; x < 2.0; x += 2.0 ) {\n\n\t\t\t\t\tfor ( float y = - 1.0; y < 2.0; y += 2.0 ) {\n\n\t\t\t\t\t\tvec2 uv = vUv + vec2( x, y ) * 0.25 * texelSize;\n\n\t\t\t\t\t\tavgNormal += normalize( texture2D( normalMap, uv, - 1.0 ).xyz - 0.5 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvariance += 1.0 - 0.25 * length( avgNormal );\n\n\t\t\t\tgl_FragColor.g = varianceToRoughness( variance );\n\n\t\t\t}\n\t\t",blending:s.NoBlending,depthTest:!1,depthWrite:!1})).type="RoughnessMipmapper",a),l=new s.Mesh(new s.PlaneGeometry(2,2),o),c=new s.OrthographicCamera(0,1,0,1,0,1),h=null;t.RoughnessMipmapper=class{constructor(e){i(this,"generateMipmaps",(function(e){if("roughnessMap"in e!=!1){var{roughnessMap:t,normalMap:n}=e;if(null!==t&&null!==n&&t.generateMipmaps&&!e.userData.roughnessUpdated){e.userData.roughnessUpdated=!0;var r=Math.max(t.image.width,n.image.width),i=Math.max(t.image.height,n.image.height);if(s.MathUtils.isPowerOfTwo(r)&&s.MathUtils.isPowerOfTwo(i)){var a=this._renderer.getRenderTarget(),u=this._renderer.autoClear;if(this._renderer.autoClear=!1,null!==h&&h.width===r&&h.height===i||(null!==h&&h.dispose(),(h=new s.WebGLRenderTarget(r,i,{depthBuffer:!1})).scissorTest=!0),r!==t.image.width||i!==t.image.height){var d={wrapS:t.wrapS,wrapT:t.wrapT,magFilter:t.magFilter,minFilter:t.minFilter,depthBuffer:!1},p=new s.WebGLRenderTarget(r,i,d);p.texture.generateMipmaps=!0,this._renderer.setRenderTarget(p),e.roughnessMap=p.texture,e.metalnessMap==t&&(e.metalnessMap=e.roughnessMap),e.aoMap==t&&(e.aoMap=e.roughnessMap)}o.uniforms.roughnessMap.value=t,o.uniforms.normalMap.value=n;var f=new s.Vector2(0,0),m=o.uniforms.texelSize.value;for(let t=0;r>=1&&i>=1;++t,r/=2,i/=2)m.set(1/r,1/i),0==t&&m.set(0,0),h.viewport.set(f.x,f.y,r,i),h.scissor.set(f.x,f.y,r,i),this._renderer.setRenderTarget(h),this._renderer.render(l,c),this._renderer.copyFramebufferToTexture(f,e.roughnessMap,t),o.uniforms.roughnessMap.value=e.roughnessMap;t!==e.roughnessMap&&t.dispose(),this._renderer.setRenderTarget(a),this._renderer.autoClear=u}}}})),i(this,"dispose",(function(){o.dispose(),l.geometry.dispose(),null!=h&&h.dispose()})),this._renderer=e,this._renderer.compile(l,c)}}},63833:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i={createMeshesFromInstancedMesh:function(e){const t=new r.Group,n=e.count,i=e.geometry,s=e.material;for(let a=0;a<n;a++){const n=new r.Mesh(i,s);e.getMatrixAt(a,n.matrix),n.matrix.decompose(n.position,n.quaternion,n.scale),t.add(n)}return t.copy(e),t.updateMatrixWorld(),t},createMultiMaterialObject:function(e,t){const n=new r.Group;for(let i=0,s=t.length;i<s;i++)n.add(new r.Mesh(e,t[i]));return n},detach:function(e,t,n){console.warn("THREE.SceneUtils: detach() has been deprecated. Use scene.attach( child ) instead."),n.attach(e)},attach:function(e,t,n){console.warn("THREE.SceneUtils: attach() has been deprecated. Use parent.attach( child ) instead."),n.attach(e)}};t.SceneUtils=i},96244:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(65149);t.ShadowMapViewer=class{constructor(e){const t=this,n=void 0!==e.name&&""!==e.name;let s;const a=10,o=10,l=256,c=256,h=new r.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,1,10);h.position.set(0,0,2);const u=new r.Scene,d=i.UnpackDepthRGBAShader,p=r.UniformsUtils.clone(d.uniforms),f=new r.ShaderMaterial({uniforms:p,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader}),m=new r.PlaneGeometry(l,c),g=new r.Mesh(m,f);let A,v;if(u.add(g),n){A=document.createElement("canvas");const t=A.getContext("2d");t.font="Bold 20px Arial";const n=t.measureText(e.name).width;A.width=n,A.height=25,t.font="Bold 20px Arial",t.fillStyle="rgba( 255, 0, 0, 1 )",t.fillText(e.name,0,20);const i=new r.Texture(A);i.magFilter=r.LinearFilter,i.minFilter=r.LinearFilter,i.needsUpdate=!0;const s=new r.MeshBasicMaterial({map:i,side:r.DoubleSide});s.transparent=!0;const a=new r.PlaneGeometry(A.width,A.height);v=new r.Mesh(a,s),u.add(v)}this.enabled=!0,this.size={width:l,height:c,set:function(e,n){this.width=e,this.height=n,g.scale.set(this.width/l,this.height/c,1),t.position.set(t.position.x,t.position.y)}},this.position={x:a,y:o,set:function(e,r){this.x=e,this.y=r;const i=t.size.width,s=t.size.height;g.position.set(-window.innerWidth/2+i/2+this.x,window.innerHeight/2-s/2-this.y,0),n&&v.position.set(g.position.x,g.position.y-t.size.height/2+A.height/2,0)}},this.render=function(t){this.enabled&&(p.tDiffuse.value=e.shadow.map.texture,s=t.autoClear,t.autoClear=!1,t.clearDepth(),t.render(u,h),t.autoClear=s)},this.updateForWindowResize=function(){this.enabled&&(h.left=window.innerWidth/-2,h.right=window.innerWidth/2,h.top=window.innerHeight/2,h.bottom=window.innerHeight/-2,h.updateProjectionMatrix(),this.update())},this.update=function(){this.position.set(this.position.x,this.position.y),this.size.set(this.size.width,this.size.height)},this.update()}}},14024:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);function i(e,t,n={}){const i=new r.Vector3,o=new r.Quaternion,l=new r.Vector3,c=new r.Matrix4,h=new r.Matrix4,u=new r.Matrix4;n.preserveMatrix=void 0===n.preserveMatrix||n.preserveMatrix,n.preservePosition=void 0===n.preservePosition||n.preservePosition,n.preserveHipPosition=void 0!==n.preserveHipPosition&&n.preserveHipPosition,n.useTargetMatrix=void 0!==n.useTargetMatrix&&n.useTargetMatrix,n.hip=void 0!==n.hip?n.hip:"hip",n.names=n.names||{};const d=t.isObject3D?t.skeleton.bones:a(t),p=e.isObject3D?e.skeleton.bones:a(e);let f,m,g,A,v;if(e.isObject3D?e.skeleton.pose():(n.useTargetMatrix=!0,n.preserveMatrix=!1),n.preservePosition){v=[];for(let e=0;e<p.length;e++)v.push(p[e].position.clone())}if(n.preserveMatrix){e.updateMatrixWorld(),e.matrixWorld.identity();for(let t=0;t<e.children.length;++t)e.children[t].updateMatrixWorld(!0)}if(n.offsets){f=[];for(let e=0;e<p.length;++e)m=p[e],g=n.names[m.name]||m.name,n.offsets[g]&&(m.matrix.multiply(n.offsets[g]),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()),f.push(m.matrixWorld.clone())}for(let r=0;r<p.length;++r){if(m=p[r],g=n.names[m.name]||m.name,A=s(g,d),u.copy(m.matrixWorld),A){if(A.updateMatrixWorld(),n.useTargetMatrix?h.copy(A.matrixWorld):(h.copy(e.matrixWorld).invert(),h.multiply(A.matrixWorld)),l.setFromMatrixScale(h),h.scale(l.set(1/l.x,1/l.y,1/l.z)),u.makeRotationFromQuaternion(o.setFromRotationMatrix(h)),e.isObject3D){const t=p.indexOf(m),n=f?f[t]:c.copy(e.skeleton.boneInverses[t]).invert();u.multiply(n)}u.copyPosition(h)}m.parent&&m.parent.isBone?(m.matrix.copy(m.parent.matrixWorld).invert(),m.matrix.multiply(u)):m.matrix.copy(u),n.preserveHipPosition&&g===n.hip&&m.matrix.setPosition(i.set(0,m.position.y,0)),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()}if(n.preservePosition)for(let r=0;r<p.length;++r)m=p[r],g=n.names[m.name]||m.name,g!==n.hip&&m.position.copy(v[r]);n.preserveMatrix&&e.updateMatrixWorld(!0)}function s(e,t){for(let n=0,r=a(t);n<r.length;n++)if(e===r[n].name)return r[n]}function a(e){return Array.isArray(e)?e:e.bones}function o(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)o(e.children[r],t.children[r],n)}const l={retarget:i,retargetClip:function(e,t,n,o={}){o.useFirstFramePosition=void 0!==o.useFirstFramePosition&&o.useFirstFramePosition,o.fps=void 0!==o.fps?o.fps:30,o.names=o.names||[],t.isObject3D||(t=function(e){const t=new r.SkeletonHelper(e.bones[0]);return t.skeleton=e,t}(t));const l=Math.round(n.duration*(o.fps/1e3)*1e3),c=1/o.fps,h=[],u=new r.AnimationMixer(t),d=a(e.skeleton),p=[];let f,m,g,A,v;u.clipAction(n).play(),u.update(0),t.updateMatrixWorld();for(let r=0;r<l;++r){const n=r*c;i(e,t,o);for(let e=0;e<d.length;++e)v=o.names[d[e].name]||d[e].name,g=s(v,t.skeleton),g&&(m=d[e],A=p[e]=p[e]||{bone:m},o.hip===v&&(A.pos||(A.pos={times:new Float32Array(l),values:new Float32Array(3*l)}),o.useFirstFramePosition&&(0===r&&(f=m.position.clone()),m.position.sub(f)),A.pos.times[r]=n,m.position.toArray(A.pos.values,3*r)),A.quat||(A.quat={times:new Float32Array(l),values:new Float32Array(4*l)}),A.quat.times[r]=n,m.quaternion.toArray(A.quat.values,4*r));u.update(c),t.updateMatrixWorld()}for(let i=0;i<p.length;++i)A=p[i],A&&(A.pos&&h.push(new r.VectorKeyframeTrack(".bones["+A.bone.name+"].position",A.pos.times,A.pos.values)),h.push(new r.QuaternionKeyframeTrack(".bones["+A.bone.name+"].quaternion",A.quat.times,A.quat.values)));return u.uncacheAction(n),new r.AnimationClip(n.name,-1,h)},clone:function(e){const t=new Map,n=new Map,r=e.clone();return o(e,r,(function(e,r){t.set(r,e),n.set(e,r)})),r.traverse((function(e){if(!e.isSkinnedMesh)return;const r=e,i=t.get(e),s=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=s.map((function(e){return n.get(e)})),r.bind(r.skeleton,r.bindMatrix)})),r}};t.SkeletonUtils=l},13979:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);t.UVsDebug=function(e,t=1024){const n=new r.Vector2,i=new r.Vector2,s=[new r.Vector2,new r.Vector2,new r.Vector2],a=[],o=document.createElement("canvas"),l=t,c=t;o.width=l,o.height=c;const h=o.getContext("2d");h.lineWidth=1,h.strokeStyle="rgb( 63, 63, 63 )",h.textAlign="center",h.fillStyle="rgb( 255, 255, 255 )",h.fillRect(0,0,l,c);const u=e.index,d=e.attributes.uv;if(u)for(let r=0,f=u.count;r<f;r+=3)a[0]=u.getX(r),a[1]=u.getX(r+1),a[2]=u.getX(r+2),s[0].fromBufferAttribute(d,a[0]),s[1].fromBufferAttribute(d,a[1]),s[2].fromBufferAttribute(d,a[2]),p(a,s,r/3);else for(let r=0,f=d.count;r<f;r+=3)a[0]=r,a[1]=r+1,a[2]=r+2,s[0].fromBufferAttribute(d,a[0]),s[1].fromBufferAttribute(d,a[1]),s[2].fromBufferAttribute(d,a[2]),p(a,s,r/3);return o;function p(e,t,r){h.beginPath(),n.set(0,0);for(let i=0,s=t.length;i<s;i++){const e=t[i];n.x+=e.x,n.y+=e.y,0===i?h.moveTo(e.x*(l-2)+.5,(1-e.y)*(c-2)+.5):h.lineTo(e.x*(l-2)+.5,(1-e.y)*(c-2)+.5)}h.closePath(),h.stroke(),n.divideScalar(t.length),h.font="18px Arial",h.fillStyle="rgb( 63, 63, 63 )",h.fillText(r,n.x*l,(1-n.y)*c),n.x>.95&&h.fillText(r,n.x%1*l,(1-n.y)*c),h.font="12px Arial",h.fillStyle="rgb( 191, 191, 191 )";for(let s=0,a=t.length;s<a;s++){const r=t[s];i.addVectors(n,r).divideScalar(2);const a=e[s];h.fillText("abc"[s]+a,i.x*l,(1-i.y)*c),i.x>.95&&h.fillText("abc"[s]+a,i.x%1*l,(1-i.y)*c)}}}},83088:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.WorkerPool=class{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:t,msg:n,transfer:r}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(n,r)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise((n=>{const r=this._getIdleWorker();-1!==r?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})}))}dispose(){this.workers.forEach((e=>e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}},57382:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.ARButton=class{static createButton(e,t={}){const n=document.createElement("button");function r(){n.style.display="",n.style.cursor="auto",n.style.left="calc(50% - 75px)",n.style.width="150px",n.onmouseenter=null,n.onmouseleave=null,n.onclick=null,n.textContent="AR NOT SUPPORTED"}function i(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return n.id="ARButton",n.style.display="none",i(n),navigator.xr.isSessionSupported("immersive-ar").then((function(i){i?function(){if(void 0===t.domOverlay){const e=document.createElement("div");e.style.display="none",document.body.appendChild(e);const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","38px"),n.setAttribute("height","38px"),n.style.position="absolute",n.style.right="20px",n.style.top="20px",n.addEventListener("click",(function(){null==r||r.end()})),e.appendChild(n);const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M 12,12 L 28,28 M 28,12 12,28"),i.setAttribute("stroke","#fff"),i.setAttribute("stroke-width","2px"),n.appendChild(i),void 0===t.optionalFeatures&&(t.optionalFeatures=[]),t.optionalFeatures.push("dom-overlay"),t.domOverlay={root:e}}let r=null;async function i(i){i.addEventListener("end",s),e.xr.setReferenceSpaceType("local"),await e.xr.setSession(i),n.textContent="STOP AR",t.domOverlay.root.style.display="",r=i}function s(){r.removeEventListener("end",s),n.textContent="START AR",t.domOverlay.root.style.display="none",r=null}n.style.display="",n.style.cursor="pointer",n.style.left="calc(50% - 50px)",n.style.width="100px",n.textContent="START AR",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.5"},n.onclick=()=>{null===r?navigator.xr.requestSession("immersive-ar",t).then(i):r.end()}}():r()})).catch(r),n;{const e=document.createElement("a");return!1===window.isSecureContext?(e.href=document.location.href.replace(/^http:/,"https:"),e.innerHTML="WEBXR NEEDS HTTPS"):(e.href="https://immersiveweb.dev/",e.innerHTML="WEBXR NOT AVAILABLE"),e.style.left="calc(50% - 90px)",e.style.width="180px",e.style.textDecoration="none",i(e),e}}}},73162:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(19453);class o extends s.Object3D{constructor(e,t,n){super(),i(this,"controller"),i(this,"motionController"),i(this,"envMap"),i(this,"mesh"),i(this,"xrInputSource"),this.controller=e,this.motionController=null,this.envMap=null,this.mesh=null,this.xrInputSource=null,e.addEventListener("connected",(r=>{const i=r.data;i.hand&&!this.motionController&&(this.xrInputSource=i,this.motionController=new a.XRHandMeshModel(this,e,void 0,i.handedness,"left"===i.handedness?t:n))})),e.addEventListener("disconnected",(()=>{this.dispose()}))}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&this.motionController.updateMesh()}getPointerPosition(){const e=this.controller.joints["index-finger-tip"];return e?e.position:null}intersectBoxObject(e){const t=this.getPointerPosition();if(t){const n=new s.Sphere(t,.01),r=(new s.Box3).setFromObject(e);return n.intersectsBox(r)}return!1}checkButton(e){this.intersectBoxObject(e)?e.onPress():e.onClear(),e.isPressed()&&e.whilePressed()}dispose(){this.clear(),this.motionController=null}}t.OculusHandModel=o},65483:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const i=r(n(85232)),s=.01,a=.4,o=.01,l=.003,c=16,h=12,u=new i.Vector3(0,1,0),d=new i.Vector3(0,0,1);class p extends i.Object3D{constructor(e,t){super(),this.hand=e,this.controller=t,this.motionController=null,this.envMap=null,this.mesh=null,this.pointerGeometry=null,this.pointerMesh=null,this.pointerObject=null,this.pinched=!1,this.attached=!1,this.cursorObject=null,this.raycaster=null,this._onConnected=this._onConnected.bind(this),this._onDisconnected=this._onDisconnected.bind(this),this.hand.addEventListener("connected",this._onConnected),this.hand.addEventListener("disconnected",this._onDisconnected)}_onConnected(e){const t=e.data;t.hand&&(this.visible=!0,this.xrInputSource=t,this.createPointer())}_onDisconnected(){var e,t;this.visible=!1,this.xrInputSource=null,null==(e=this.pointerGeometry)||e.dispose(),null==(t=this.pointerMesh)||t.material.dispose(),this.clear()}_drawVerticesRing(e,t,n){const r=t.clone();for(var i=0;i<c;i++){r.applyAxisAngle(d,2*Math.PI/c);const t=n*c+i;e[3*t]=r.x,e[3*t+1]=r.y,e[3*t+2]=r.z}}_updatePointerVertices(e){const t=this.pointerGeometry.attributes.position.array,n=new i.Vector3(.002,0,-1*(.035-e));this._drawVerticesRing(t,n,0);const r=new i.Vector3(Math.sin(110*Math.PI/180)*e,Math.cos(110*Math.PI/180)*e,0);for(var s=0;s<h;s++)this._drawVerticesRing(t,r,s+1),r.applyAxisAngle(u,110*Math.PI/180/-24);const a=new i.Vector3(0,0,-1*(.035-e));t[624]=a.x,t[625]=a.y,t[626]=a.z;const o=new i.Vector3(0,0,e);t[627]=o.x,t[628]=o.y,t[629]=o.z,this.pointerGeometry.setAttribute("position",new i.Float32BufferAttribute(t,3))}createPointer(){var e,t;const n=new Array(630).fill(0),r=[];for(this.pointerGeometry=new i.BufferGeometry,this.pointerGeometry.setAttribute("position",new i.Float32BufferAttribute(n,3)),this._updatePointerVertices(o),e=0;e<h;e++){for(t=0;t<15;t++)r.push(e*c+t,e*c+t+1,(e+1)*c+t),r.push(e*c+t+1,(e+1)*c+t+1,(e+1)*c+t);r.push((e+1)*c-1,e*c,(e+2)*c-1),r.push(e*c,(e+1)*c,(e+2)*c-1)}for(e=0;e<15;e++)r.push(208,e+1,e),r.push(209,e+192,e+192+1);r.push(208,0,15),r.push(209,207,192);const s=new i.MeshBasicMaterial;s.transparent=!0,s.opacity=a,this.pointerGeometry.setIndex(r),this.pointerMesh=new i.Mesh(this.pointerGeometry,s),this.pointerMesh.position.set(0,0,-.01),this.pointerObject=new i.Object3D,this.pointerObject.add(this.pointerMesh),this.raycaster=new i.Raycaster;const l=new i.SphereGeometry(.02,10,10),u=new i.MeshBasicMaterial;u.transparent=!0,u.opacity=a,this.cursorObject=new i.Mesh(l,u),this.pointerObject.add(this.cursorObject),this.add(this.pointerObject)}_updateRaycaster(){if(this.raycaster){const e=this.pointerObject.matrixWorld,t=new i.Matrix4;t.identity().extractRotation(e),this.raycaster.ray.origin.setFromMatrixPosition(e),this.raycaster.ray.direction.set(0,0,-1).applyMatrix4(t)}}_updatePointer(){this.pointerObject.visible=this.controller.visible;const e=this.hand.joints["index-finger-tip"],t=this.hand.joints["thumb-tip"],n=e.position.distanceTo(t.position),r=e.position.clone().add(t.position).multiplyScalar(.5);this.pointerObject.position.copy(r),this.pointerObject.quaternion.copy(this.controller.quaternion),this.pinched=n<=.02;const i=(n-s)/.04,c=(n-s)/.01;if(i>1)this._updatePointerVertices(o),this.pointerMesh.position.set(0,0,-.01),this.pointerMesh.material.opacity=a;else if(i>0){const e=.007*i+l;this._updatePointerVertices(e),c<1?(this.pointerMesh.position.set(0,0,-1*e-.02*(1-c)),this.pointerMesh.material.opacity=a+.6*(1-c)):(this.pointerMesh.position.set(0,0,-1*e),this.pointerMesh.material.opacity=a)}else this._updatePointerVertices(l),this.pointerMesh.position.set(0,0,-.023),this.pointerMesh.material.opacity=1;this.cursorObject.material.opacity=this.pointerMesh.material.opacity}updateMatrixWorld(e){super.updateMatrixWorld(e),this.pointerGeometry&&(this._updatePointer(),this._updateRaycaster())}isPinched(){return this.pinched}setAttached(e){this.attached=e}isAttached(){return this.attached}intersectObject(e,t=!0){if(this.raycaster)return this.raycaster.intersectObject(e,t)}intersectObjects(e,t=!0){if(this.raycaster)return this.raycaster.intersectObjects(e,t)}checkIntersections(e,t=!1){if(this.raycaster&&!this.attached){const n=this.raycaster.intersectObjects(e,t),r=new i.Vector3(0,0,-1);if(n.length>0){const e=n[0].distance;this.cursorObject.position.copy(r.multiplyScalar(e))}else this.cursorObject.position.copy(r.multiplyScalar(1.5))}}setCursor(e){const t=new i.Vector3(0,0,-1);this.raycaster&&!this.attached&&this.cursorObject.position.copy(t.multiplyScalar(e))}dispose(){this._onDisconnected(),this.hand.removeEventListener("connected",this._onConnected),this.hand.removeEventListener("disconnected",this._onDisconnected)}}t.OculusHandPointerModel=p},79752:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const i=r(n(85232));t.createText=function(e,t){const n=document.createElement("canvas"),r=n.getContext("2d");let s=null;const a=100;r.font="normal 100px Arial",s=r.measureText(e);const o=s.width;n.width=o,n.height=a,r.font="normal 100px Arial",r.textAlign="center",r.textBaseline="middle",r.fillStyle="#ffffff",r.fillText(e,o/2,50);const l=new i.Texture(n);l.needsUpdate=!0;const c=new i.MeshBasicMaterial({color:16777215,side:i.DoubleSide,map:l,transparent:!0}),h=new i.PlaneGeometry(t*o/a,t);return new i.Mesh(h,c)}},93177:(e,t)=>{"use strict";var n=Object.defineProperty;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=class{static createButton(e,t={}){const n=document.createElement("button");function i(){n.style.display="",n.style.cursor="auto",n.style.left="calc(50% - 75px)",n.style.width="150px",n.onmouseenter=null,n.onmouseleave=null,n.onclick=null,n.textContent="VR NOT SUPPORTED"}function s(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return s(n),n.id="VRButton",n.style.display="none",navigator.xr.isSessionSupported("immersive-vr").then((s=>{s?function(){let r=null;async function i(t){t.addEventListener("end",s),await e.xr.setSession(t),n.textContent="EXIT VR",r=t}function s(){r.removeEventListener("end",s),n.textContent="ENTER VR",r=null}n.style.display="",n.style.cursor="pointer",n.style.left="calc(50% - 50px)",n.style.width="100px",n.textContent="ENTER VR",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.5"},n.onclick=()=>{var e;if(null===r){const n=[t.optionalFeatures,"local-floor","bounded-floor","hand-tracking"].flat().filter(Boolean);null==(e=navigator.xr)||e.requestSession("immersive-vr",{...t,optionalFeatures:n}).then(i)}else r.end()}}():i(),s&&r.xrSessionIsGranted&&n.click()})),n;{const e=document.createElement("a");return!1===window.isSecureContext?(e.href=document.location.href.replace(/^http:/,"https:"),e.innerHTML="WEBXR NEEDS HTTPS"):(e.href="https://immersiveweb.dev/",e.innerHTML="WEBXR NOT AVAILABLE"),e.style.left="calc(50% - 90px)",e.style.width="180px",e.style.textDecoration="none",s(e),e}}static registerSessionGrantedListener(){"undefined"!=typeof navigator&&"xr"in navigator&&navigator.xr.addEventListener("sessiongranted",(()=>{r.xrSessionIsGranted=!0}))}};let i=r;var s;((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(i,"symbol"!=typeof(s="xrSessionIsGranted")?s+"":s,!1),i.registerSessionGrantedListener(),t.VRButton=i},28265:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(85232),a=n(20614),o=n(48490),l=(e,t)=>{t.traverse((t=>{t instanceof s.Mesh&&"envMap"in t.material&&(t.material.envMap=e,t.material.needsUpdate=!0)}))};class c extends s.Object3D{constructor(){super(),i(this,"envMap"),i(this,"motionController"),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e||(this.envMap=e,l(this.envMap,this)),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach((e=>{Object.values(e.visualResponses).forEach((e=>{const{valueNode:t,minNode:n,maxNode:r,value:i,valueNodeProperty:s}=e;t&&(s===o.MotionControllerConstants.VisualResponseProperty.VISIBILITY&&"boolean"==typeof i?t.visible=i:s===o.MotionControllerConstants.VisualResponseProperty.TRANSFORM&&n&&r&&"number"==typeof i&&(t.quaternion.slerpQuaternions(n.quaternion,r.quaternion,i),t.position.lerpVectors(n.position,r.position,i)))}))})))}}function h(e,t){!function(e,t){Object.values(e.components).forEach((e=>{const{type:n,touchPointNodeName:r,visualResponses:i}=e;if(n===o.MotionControllerConstants.ComponentType.TOUCHPAD&&r)if(e.touchPointNode=t.getObjectByName(r),e.touchPointNode){const t=new s.SphereGeometry(.001),n=new s.MeshBasicMaterial({color:255}),r=new s.Mesh(t,n);e.touchPointNode.add(r)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`);Object.values(i).forEach((e=>{const{valueNodeName:n,minNodeName:r,maxNodeName:i,valueNodeProperty:s}=e;if(s===o.MotionControllerConstants.VisualResponseProperty.TRANSFORM&&r&&i){if(e.minNode=t.getObjectByName(r),e.maxNode=t.getObjectByName(i),!e.minNode)return void console.warn(`Could not find ${r} in the model`);if(!e.maxNode)return void console.warn(`Could not find ${i} in the model`)}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn(`Could not find ${n} in the model`)}))}))}(e.motionController,t),e.envMap&&l(e.envMap,t),e.add(t)}t.XRControllerModelFactory=class{constructor(e=null){i(this,"gltfLoader"),i(this,"path"),i(this,"_assetCache"),this.gltfLoader=e,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new a.GLTFLoader)}createControllerModel(e){const t=new c;let n=null;const r=e=>{const r=e.data;"tracked-pointer"===r.targetRayMode&&r.gamepad&&o.fetchProfile(r,this.path,"generic-trigger").then((({profile:e,assetPath:i})=>{if(!i)throw new Error("no asset path");t.motionController=new o.MotionController(r,e,i);const s=t.motionController.assetUrl,a=this._assetCache[s];if(a)n=a.scene.clone(),h(t,n);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,(e=>{t.motionController?(this._assetCache[s]=e,n=e.scene.clone(),h(t,n)):console.warn("motionController gone while gltf load, bailing...")}),(()=>{}),(()=>{throw new Error(`Asset ${s} missing or malformed.`)}))}})).catch((e=>{console.warn(e)}))};e.addEventListener("connected",r);const i=()=>{e.removeEventListener("connected",r),e.removeEventListener("disconnected",i),t.motionController=null,n&&t.remove(n),n=null};return e.addEventListener("disconnected",i),t}}},2327:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232);class i{constructor(e,t,n,i,s){this.xrLight=e,this.renderer=t,this.lightProbe=n,this.xrWebGLBinding=null,this.estimationStartCallback=s,this.frameCallback=this.onXRFrame.bind(this);const a=t.xr.getSession();if(i&&"XRWebGLBinding"in window){const n=new r.WebGLCubeRenderTarget(16);e.environment=n.texture;const i=t.getContext();switch(a.preferredReflectionFormat){case"srgba8":i.getExtension("EXT_sRGB");break;case"rgba16f":i.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(a,i),this.lightProbe.addEventListener("reflectionchange",(()=>{this.updateReflection()}))}a.requestAnimationFrame(this.frameCallback)}updateReflection(){const e=this.renderer.properties.get(this.xrLight.environment);if(e){const t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);const n=t.getLightEstimate(this.lightProbe);if(n){this.xrLight.lightProbe.sh.fromArray(n.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const e=Math.max(1,Math.max(n.primaryLightIntensity.x,Math.max(n.primaryLightIntensity.y,n.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(n.primaryLightIntensity.x/e,n.primaryLightIntensity.y/e,n.primaryLightIntensity.z/e),this.xrLight.directionalLight.intensity=e,this.xrLight.directionalLight.position.copy(n.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class s extends r.Group{constructor(e,t=!0){super(),this.lightProbe=new r.LightProbe,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new r.DirectionalLight,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let n=null,s=!1;e.xr.addEventListener("sessionstart",(()=>{const r=e.xr.getSession();"requestLightProbe"in r&&r.requestLightProbe({reflectionFormat:r.preferredReflectionFormat}).then((r=>{n=new i(this,e,r,t,(()=>{s=!0,this.dispatchEvent({type:"estimationstart"})}))}))})),e.xr.addEventListener("sessionend",(()=>{n&&(n.dispose(),n=null),s&&this.dispatchEvent({type:"estimationend"})})),this.dispose=()=>{n&&(n.dispose(),n=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}t.XREstimatedLight=s},19453:(e,t,n)=>{"use strict";var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const s=n(20614);t.XRHandMeshModel=class{constructor(e,t,n="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/",r,a){i(this,"controller"),i(this,"handModel"),i(this,"bones"),this.controller=t,this.handModel=e,this.bones=[];const o=new s.GLTFLoader;a||o.setPath(n),o.load(null!=a?a:`${r}.glb`,(e=>{const t=e.scene.children[0];this.handModel.add(t);const n=t.getObjectByProperty("type","SkinnedMesh");n.frustumCulled=!1,n.castShadow=!0,n.receiveShadow=!0;["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach((e=>{const n=t.getObjectByName(e);void 0!==n?n.jointName=e:console.warn(`Couldn't find ${e} in ${r} hand mesh`),this.bones.push(n)}))}))}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const n=this.bones[t];if(n){const t=e[n.jointName];if(t.visible){const e=t.position;n.position.copy(e),n.quaternion.copy(t.quaternion)}}}}}},11225:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=n(12888),s=n(19453);class a extends r.Object3D{constructor(e){super(),this.controller=e,this.motionController=null,this.envMap=null,this.mesh=null}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&this.motionController.updateMesh()}}t.XRHandModelFactory=class{constructor(){this.path=null}setPath(e){return this.path=e,this}createHandModel(e,t){const n=new a(e);return e.addEventListener("connected",(r=>{const a=r.data;a.hand&&!n.motionController&&(n.xrInputSource=a,void 0===t||"spheres"===t?n.motionController=new i.XRHandPrimitiveModel(n,e,this.path,a.handedness,{primitive:"sphere"}):"boxes"===t?n.motionController=new i.XRHandPrimitiveModel(n,e,this.path,a.handedness,{primitive:"box"}):"mesh"===t&&(n.motionController=new s.XRHandMeshModel(n,e,this.path,a.handedness)))})),e.addEventListener("disconnected",(()=>{})),n}}},12888:(e,t,n)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=n(85232),i=new r.Matrix4,s=new r.Vector3;t.XRHandPrimitiveModel=class{constructor(e,t,n,i,s){let a;this.controller=t,this.handModel=e,this.envMap=null,s&&s.primitive&&"sphere"!==s.primitive?"box"===s.primitive&&(a=new r.BoxGeometry(1,1,1)):a=new r.SphereGeometry(1,10,10);const o=new r.MeshStandardMaterial;this.handMesh=new r.InstancedMesh(a,o,30),this.handMesh.instanceMatrix.setUsage(r.DynamicDrawUsage),this.handMesh.castShadow=!0,this.handMesh.receiveShadow=!0,this.handModel.add(this.handMesh),this.joints=["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"]}updateMesh(){const e=this.controller.joints;let t=0;for(let n=0;n<this.joints.length;n++){const r=e[this.joints[n]];r.visible&&(s.setScalar(r.jointRadius||.008),i.compose(r.position,r.quaternion,s),this.handMesh.setMatrixAt(n,i),t++)}this.handMesh.count=t,this.handMesh.instanceMatrix.needsUpdate=!0}}},85232:(e,t)=>{"use strict";const n="152",r=1,i=2,s=3,a=0,o=1,l=100,c=0,h=1,u=2,d=0,p=1,f=2,m=3,g=4,A=5,v=300,y=301,x=302,b=303,E=304,_=306,S=1e3,w=1001,M=1002,C=1003,T=1004,I=1005,B=1006,R=1007,P=1008,D=1009,L=1012,F=1014,U=1015,O=1016,N=1020,k=1023,G=1026,z=1027,Q=33776,V=33777,H=33778,j=33779,W=35840,X=35841,Y=35842,q=35843,K=37492,J=37496,Z=37808,$=37809,ee=37810,te=37811,ne=37812,re=37813,ie=37814,se=37815,ae=37816,oe=37817,le=37818,ce=37819,he=37820,ue=37821,de=36492,pe=36284,fe=36285,me=36286,ge=2300,Ae=2301,ve=2302,ye=2400,xe=2401,be=2402,Ee=2500,_e=2501,Se=3e3,we=3001,Me="",Ce="srgb",Te="srgb-linear",Ie="display-p3",Be=7680,Re=35044,Pe="300 es",De=1035;class Le{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.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 n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const Fe=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Ue=1234567;const Oe=Math.PI/180,Ne=180/Math.PI;function ke(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Fe[255&e]+Fe[e>>8&255]+Fe[e>>16&255]+Fe[e>>24&255]+"-"+Fe[255&t]+Fe[t>>8&255]+"-"+Fe[t>>16&15|64]+Fe[t>>24&255]+"-"+Fe[63&n|128]+Fe[n>>8&255]+"-"+Fe[n>>16&255]+Fe[n>>24&255]+Fe[255&r]+Fe[r>>8&255]+Fe[r>>16&255]+Fe[r>>24&255]).toLowerCase()}function Ge(e,t,n){return Math.max(t,Math.min(n,e))}function ze(e,t){return(e%t+t)%t}function Qe(e,t,n){return(1-n)*e+n*t}function Ve(e){return 0==(e&e-1)&&0!==e}function He(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function je(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function We(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 Xe(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 Ye={DEG2RAD:Oe,RAD2DEG:Ne,generateUUID:ke,clamp:Ge,euclideanModulo:ze,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Qe,damp:function(e,t,n,r){return Qe(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(ze(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(Ue=e);let t=Ue+=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(e){return e*Oe},radToDeg:function(e){return e*Ne},isPowerOfTwo:Ve,ceilPowerOfTwo:He,floorPowerOfTwo:je,setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((t+r)/2),h=a((t+r)/2),u=s((t-r)/2),d=a((t-r)/2),p=s((r-t)/2),f=a((r-t)/2);switch(i){case"XYX":e.set(o*h,l*u,l*d,o*c);break;case"YZY":e.set(l*d,o*h,l*u,o*c);break;case"ZXZ":e.set(l*u,l*d,o*h,o*c);break;case"XZX":e.set(o*h,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*h,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Xe,denormalize:We};class qe{constructor(e=0,t=0){qe.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,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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 n=this.dot(e)/t;return Math.acos(Ge(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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 n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ke{constructor(){Ke.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,n,r,i,s,a,o,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.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 n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],A=r[1],v=r[4],y=r[7],x=r[2],b=r[5],E=r[8];return i[0]=s*f+a*A+o*x,i[3]=s*m+a*v+o*b,i[6]=s*g+a*y+o*E,i[1]=l*f+c*A+h*x,i[4]=l*m+c*v+h*b,i[7]=l*g+c*y+h*E,i[2]=u*f+d*A+p*x,i[5]=u*m+d*v+p*b,i[8]=u*g+d*y+p*E,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],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-n*i*c+n*a*o+r*i*l-r*s*o}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=c*s-a*l,u=a*o-c*i,d=l*i-s*o,p=t*h+n*u+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(r*l-c*n)*f,e[2]=(a*n-r*s)*f,e[3]=u*f,e[4]=(c*t-r*o)*f,e[5]=(r*i-a*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(s*t-n*i)*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,n,r,i,s,a){const o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Je.makeScale(e,t)),this}rotate(e){return this.premultiply(Je.makeRotation(-e)),this}translate(e,t){return this.premultiply(Je.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),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Je=new Ke;function Ze(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const $e={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function et(e,t){return new $e[e](t)}function tt(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}const nt={};function rt(e){e in nt||(nt[e]=!0,console.warn(e))}function it(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function st(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const at=(new Ke).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),ot=(new Ke).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const lt={[Te]:e=>e,[Ce]:e=>e.convertSRGBToLinear(),[Ie]:function(e){return e.convertSRGBToLinear().applyMatrix3(ot)}},ct={[Te]:e=>e,[Ce]:e=>e.convertLinearToSRGB(),[Ie]:function(e){return e.applyMatrix3(at).convertLinearToSRGB()}},ht={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 Te},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const r=lt[t],i=ct[n];if(void 0===r||void 0===i)throw new Error(`Unsupported color space conversion, "${t}" to "${n}".`);return i(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let ut;class dt{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===ut&&(ut=tt("canvas")),ut.width=e.width,ut.height=e.height;const n=ut.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ut}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=tt("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*it(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*it(t[e]/255)):t[e]=it(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class pt{constructor(e=null){this.isSource=!0,this.uuid=ke(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(ft(r[t].image)):e.push(ft(r[t]))}else e=ft(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function ft(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?dt.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let mt=0;class gt extends Le{constructor(e=gt.DEFAULT_IMAGE,t=gt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,s=1008,a=1023,o=1009,l=gt.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:mt++}),this.uuid=ke(),this.name="",this.source=new pt(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new qe(0,0),this.repeat=new qe(1,1),this.center=new qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(rt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===we?Ce:Me),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==v)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case S:e.x=e.x-Math.floor(e.x);break;case w:e.x=e.x<0?0:1;break;case M: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 S:e.y=e.y-Math.floor(e.y);break;case w:e.y=e.y<0?0:1;break;case M: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 rt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ce?we:Se}set encoding(e){rt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===we?Ce:Me}}gt.DEFAULT_IMAGE=null,gt.DEFAULT_MAPPING=v,gt.DEFAULT_ANISOTROPY=1;class At{constructor(e=0,t=0,n=0,r=1){At.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}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,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,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,n,r,i;const s=.01,a=.1,o=e.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)<s&&Math.abs(h-f)<s&&Math.abs(p-m)<s){if(Math.abs(c+u)<a&&Math.abs(h+f)<a&&Math.abs(p+m)<a&&Math.abs(l+d+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,A=(g+1)/2,v=(c+u)/4,y=(h+f)/4,x=(p+m)/4;return e>o&&e>A?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):o>A?o<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=v/r,i=x/r):A<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(A),n=y/i,r=x/i),this.set(n,r,i,t),this}let A=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(A)<.001&&(A=1),this.x=(m-p)/A,this.y=(h-f)/A,this.z=(u-c)/A,this.w=Math.acos((l+d+g-1)/2),this}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.w=Math.min(this.w,e.w),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.w=Math.max(this.w,e.w),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.w=Math.max(e.w,Math.min(t.w,this.w)),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.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),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.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}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.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}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}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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class vt extends Le{constructor(e=1,t=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new At(0,0,e,t),this.scissorTest=!1,this.viewport=new At(0,0,e,t);const r={width:e,height:t,depth:1};void 0!==n.encoding&&(rt("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===we?Ce:Me),this.texture=new gt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:B,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new pt(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class yt extends gt{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=C,this.minFilter=C,this.wrapR=w,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class xt extends gt{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=C,this.minFilter=C,this.wrapR=w,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class bt{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,s,a){let o=n[r+0],l=n[r+1],c=n[r+2],h=n[r+3];const u=i[s+0],d=i[s+1],p=i[s+2],f=i[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===a)return e[t+0]=u,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(h!==f||o!==u||l!==d||c!==p){let e=1-a;const t=o*u+l*d+c*p+h*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,a=Math.sin(a*s)/i}const i=a*n;if(o=o*e+u*i,l=l*e+d*i,c=c*e+p*i,h=h*e+f*i,e===1-a){const e=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,r,i,s){const a=n[r],o=n[r+1],l=n[r+2],c=n[r+3],h=i[s],u=i[s+1],d=i[s+2],p=i[s+3];return e[t]=a*p+c*h+o*d-l*u,e[t+1]=o*p+c*u+l*h-a*d,e[t+2]=l*p+c*d+a*u-o*h,e[t+3]=c*p-a*h-o*u-l*d,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,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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 n=e._x,r=e._y,i=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(r/2),h=a(i/2),u=o(n/2),d=o(r/2),p=o(i/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],a=t[5],o=t[9],l=t[2],c=t[6],h=t[10],u=n+a+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-o)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>a&&n>h){const e=2*Math.sqrt(1+n-a-h);this._w=(c-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(a>h){const e=2*Math.sqrt(1+a-n-h);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+h-n-a);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ge(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),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 n=e._x,r=e._y,i=e._z,s=e._w,a=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+s*a+r*l-i*o,this._y=r*c+s*o+i*a-n*l,this._z=i*c+s*l+n*o-r*a,this._w=s*c-n*a-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let a=s*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=r*h+this._y*u,this._z=i*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}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 Et{constructor(e=0,t=0,n=0){Et.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,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(St.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(St.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*r-a*n,c=o*n+a*t-i*r,h=o*r+i*n-s*t,u=-i*t-s*n-a*r;return this.x=l*o+u*-i+c*-a-h*-s,this.y=c*o+u*-s+h*-i-l*-a,this.z=h*o+u*-a+l*-s-c*-i,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,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-i*a,this.y=i*s-n*o,this.z=n*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _t.copy(this).projectOnVector(e),this.sub(_t)}reflect(e){return this.sub(_t.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 n=this.dot(e)/t;return Math.acos(Ge(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,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(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _t=new Et,St=new bt;class wt{constructor(e=new Et(1/0,1/0,1/0),t=new Et(-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,n=e.length;t<n;t+=3)this.expandByPoint(Ct.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Ct.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Ct.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){if(e.updateWorldMatrix(!1,!1),void 0!==e.boundingBox)null===e.boundingBox&&e.computeBoundingBox(),Tt.copy(e.boundingBox),Tt.applyMatrix4(e.matrixWorld),this.union(Tt);else{const n=e.geometry;if(void 0!==n)if(t&&void 0!==n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,r=t.count;n<r;n++)Ct.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(Ct)}else null===n.boundingBox&&n.computeBoundingBox(),Tt.copy(n.boundingBox),Tt.applyMatrix4(e.matrixWorld),this.union(Tt)}const n=e.children;for(let r=0,i=n.length;r<i;r++)this.expandByObject(n[r],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.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.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ct),Ct.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ft),Ut.subVectors(this.max,Ft),It.subVectors(e.a,Ft),Bt.subVectors(e.b,Ft),Rt.subVectors(e.c,Ft),Pt.subVectors(Bt,It),Dt.subVectors(Rt,Bt),Lt.subVectors(It,Rt);let t=[0,-Pt.z,Pt.y,0,-Dt.z,Dt.y,0,-Lt.z,Lt.y,Pt.z,0,-Pt.x,Dt.z,0,-Dt.x,Lt.z,0,-Lt.x,-Pt.y,Pt.x,0,-Dt.y,Dt.x,0,-Lt.y,Lt.x,0];return!!kt(t,It,Bt,Rt,Ut)&&(t=[1,0,0,0,1,0,0,0,1],!!kt(t,It,Bt,Rt,Ut)&&(Ot.crossVectors(Pt,Dt),t=[Ot.x,Ot.y,Ot.z],kt(t,It,Bt,Rt,Ut)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ct).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Ct).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()||(Mt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Mt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Mt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Mt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Mt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Mt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Mt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Mt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Mt)),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 Mt=[new Et,new Et,new Et,new Et,new Et,new Et,new Et,new Et],Ct=new Et,Tt=new wt,It=new Et,Bt=new Et,Rt=new Et,Pt=new Et,Dt=new Et,Lt=new Et,Ft=new Et,Ut=new Et,Ot=new Et,Nt=new Et;function kt(e,t,n,r,i){for(let s=0,a=e.length-3;s<=a;s+=3){Nt.fromArray(e,s);const a=i.x*Math.abs(Nt.x)+i.y*Math.abs(Nt.y)+i.z*Math.abs(Nt.z),o=t.dot(Nt),l=n.dot(Nt),c=r.dot(Nt);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Gt=new wt,zt=new Et,Qt=new Et;class Vt{constructor(e=new Et,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Gt.setFromPoints(e).getCenter(n);let r=0;for(let i=0,s=e.length;i<s;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.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;zt.subVectors(e,this.center);const t=zt.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(zt,n/e),this.radius+=n}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):(Qt.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(zt.copy(e.center).add(Qt)),this.expandByPoint(zt.copy(e.center).sub(Qt))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Ht=new Et,jt=new Et,Wt=new Et,Xt=new Et,Yt=new Et,qt=new Et,Kt=new Et;class Jt{constructor(e=new Et,t=new Et(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,Ht)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ht.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ht.copy(this.origin).addScaledVector(this.direction,t),Ht.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){jt.copy(e).add(t).multiplyScalar(.5),Wt.copy(t).sub(e).normalize(),Xt.copy(this.origin).sub(jt);const i=.5*e.distanceTo(t),s=-this.direction.dot(Wt),a=Xt.dot(this.direction),o=-Xt.dot(Wt),l=Xt.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=i*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*i+a)),u=h>0?-i:Math.min(Math.max(-i,-o),i),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-i,-o),i),d=u*(u+2*o)+l):(h=Math.max(0,-(s*i+a)),u=h>0?i:Math.min(Math.max(-i,-o),i),d=-h*h+u*(u+2*o)+l);else u=s>0?-i:i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(jt).addScaledVector(Wt,u),d}intersectSphere(e,t){Ht.subVectors(e.center,this.origin);const n=Ht.dot(this.direction),r=Ht.dot(Ht)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,t):this.at(a,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 n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,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 n,r,i,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,r=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,r=(e.min.x-u.x)*l),c>=0?(i=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(i=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),n>s||i>r?null:((i>n||isNaN(n))&&(n=i),(s<r||isNaN(r))&&(r=s),h>=0?(a=(e.min.z-u.z)*h,o=(e.max.z-u.z)*h):(a=(e.max.z-u.z)*h,o=(e.min.z-u.z)*h),n>o||a>r?null:((a>n||n!=n)&&(n=a),(o<r||r!=r)&&(r=o),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,Ht)}intersectTriangle(e,t,n,r,i){Yt.subVectors(t,e),qt.subVectors(n,e),Kt.crossVectors(Yt,qt);let s,a=this.direction.dot(Kt);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Xt.subVectors(this.origin,e);const o=s*this.direction.dot(qt.crossVectors(Xt,qt));if(o<0)return null;const l=s*this.direction.dot(Yt.cross(Xt));if(l<0)return null;if(o+l>a)return null;const c=-s*Xt.dot(Kt);return c<0?null:this.at(c/a,i)}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 Zt{constructor(){Zt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,n,r,i,s,a,o,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 Zt).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/$t.setFromMatrixColumn(e,0).length(),i=1/$t.setFromMatrixColumn(e,1).length(),s=1/$t.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(r),l=Math.sin(r),c=Math.cos(i),h=Math.sin(i);if("XYZ"===e.order){const e=s*c,n=s*h,r=a*c,i=a*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*o}else if("YXZ"===e.order){const e=o*c,n=o*h,r=l*c,i=l*h;t[0]=e+i*a,t[4]=r*a-n,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*c,n=o*h,r=l*c,i=l*h;t[0]=e-i*a,t[4]=-s*h,t[8]=r+n*a,t[1]=n+r*a,t[5]=s*c,t[9]=i-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*c,n=s*h,r=a*c,i=a*h;t[0]=o*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*h,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=i-e*h,t[8]=r*h+n,t[1]=h,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*h+r,t[10]=e-i*h}else if("XZY"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+i,t[5]=s*c,t[9]=n*h-r,t[2]=r*h-n,t[6]=a*c,t[10]=i*h+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(tn,e,nn)}lookAt(e,t,n){const r=this.elements;return an.subVectors(e,t),0===an.lengthSq()&&(an.z=1),an.normalize(),rn.crossVectors(n,an),0===rn.lengthSq()&&(1===Math.abs(n.z)?an.x+=1e-4:an.z+=1e-4,an.normalize(),rn.crossVectors(n,an)),rn.normalize(),sn.crossVectors(an,rn),r[0]=rn.x,r[4]=sn.x,r[8]=an.x,r[1]=rn.y,r[5]=sn.y,r[9]=an.y,r[2]=rn.z,r[6]=sn.z,r[10]=an.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],A=n[3],v=n[7],y=n[11],x=n[15],b=r[0],E=r[4],_=r[8],S=r[12],w=r[1],M=r[5],C=r[9],T=r[13],I=r[2],B=r[6],R=r[10],P=r[14],D=r[3],L=r[7],F=r[11],U=r[15];return i[0]=s*b+a*w+o*I+l*D,i[4]=s*E+a*M+o*B+l*L,i[8]=s*_+a*C+o*R+l*F,i[12]=s*S+a*T+o*P+l*U,i[1]=c*b+h*w+u*I+d*D,i[5]=c*E+h*M+u*B+d*L,i[9]=c*_+h*C+u*R+d*F,i[13]=c*S+h*T+u*P+d*U,i[2]=p*b+f*w+m*I+g*D,i[6]=p*E+f*M+m*B+g*L,i[10]=p*_+f*C+m*R+g*F,i[14]=p*S+f*T+m*P+g*U,i[3]=A*b+v*w+y*I+x*D,i[7]=A*E+v*M+y*B+x*L,i[11]=A*_+v*C+y*R+x*F,i[15]=A*S+v*T+y*P+x*U,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],n=e[4],r=e[8],i=e[12],s=e[1],a=e[5],o=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+i*o*h-r*l*h-i*a*u+n*l*u+r*a*d-n*o*d)+e[7]*(+t*o*d-t*l*u+i*s*u-r*s*d+r*l*c-i*o*c)+e[11]*(+t*l*h-t*a*d-i*s*h+n*s*d+i*a*c-n*l*c)+e[15]*(-r*a*c-t*o*h+t*a*u+r*s*h-n*s*u+n*o*c)}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,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],A=h*m*l-f*u*l+f*o*d-a*m*d-h*o*g+a*u*g,v=p*u*l-c*m*l-p*o*d+s*m*d+c*o*g-s*u*g,y=c*f*l-p*h*l+p*a*d-s*f*d-c*a*g+s*h*g,x=p*h*o-c*f*o-p*a*u+s*f*u+c*a*m-s*h*m,b=t*A+n*v+r*y+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/b;return e[0]=A*E,e[1]=(f*u*i-h*m*i-f*r*d+n*m*d+h*r*g-n*u*g)*E,e[2]=(a*m*i-f*o*i+f*r*l-n*m*l-a*r*g+n*o*g)*E,e[3]=(h*o*i-a*u*i-h*r*l+n*u*l+a*r*d-n*o*d)*E,e[4]=v*E,e[5]=(c*m*i-p*u*i+p*r*d-t*m*d-c*r*g+t*u*g)*E,e[6]=(p*o*i-s*m*i-p*r*l+t*m*l+s*r*g-t*o*g)*E,e[7]=(s*u*i-c*o*i+c*r*l-t*u*l-s*r*d+t*o*d)*E,e[8]=y*E,e[9]=(p*h*i-c*f*i-p*n*d+t*f*d+c*n*g-t*h*g)*E,e[10]=(s*f*i-p*a*i+p*n*l-t*f*l-s*n*g+t*a*g)*E,e[11]=(c*a*i-s*h*i-c*n*l+t*h*l+s*n*d-t*a*d)*E,e[12]=x*E,e[13]=(c*f*r-p*h*r+p*n*u-t*f*u-c*n*m+t*h*m)*E,e[14]=(p*a*r-s*f*r-p*n*o+t*f*o+s*n*m-t*a*m)*E,e[15]=(s*h*r-c*a*r+c*n*o-t*h*o-s*n*u+t*a*u)*E,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,a=e.y,o=e.z,l=i*s,c=i*a;return this.set(l*s+n,l*a-r*o,l*o+r*a,0,l*a+r*o,c*a+n,c*o-r*s,0,l*o-r*a,c*o+r*s,i*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,a=t._z,o=t._w,l=i+i,c=s+s,h=a+a,u=i*l,d=i*c,p=i*h,f=s*c,m=s*h,g=a*h,A=o*l,v=o*c,y=o*h,x=n.x,b=n.y,E=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+y)*x,r[2]=(p-v)*x,r[3]=0,r[4]=(d-y)*b,r[5]=(1-(u+g))*b,r[6]=(m+A)*b,r[7]=0,r[8]=(p+v)*E,r[9]=(m-A)*E,r[10]=(1-(u+f))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=$t.set(r[0],r[1],r[2]).length();const s=$t.set(r[4],r[5],r[6]).length(),a=$t.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],en.copy(this);const o=1/i,l=1/s,c=1/a;return en.elements[0]*=o,en.elements[1]*=o,en.elements[2]*=o,en.elements[4]*=l,en.elements[5]*=l,en.elements[6]*=l,en.elements[8]*=c,en.elements[9]*=c,en.elements[10]*=c,t.setFromRotationMatrix(en),n.x=i,n.y=s,n.z=a,this}makePerspective(e,t,n,r,i,s){const a=this.elements,o=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),u=-(s+i)/(s-i),d=-2*s*i/(s-i);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,s){const a=this.elements,o=1/(t-e),l=1/(n-r),c=1/(s-i),h=(t+e)*o,u=(n+r)*l,d=(s+i)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const $t=new Et,en=new Zt,tn=new Et(0,0,0),nn=new Et(1,1,1),rn=new Et,sn=new Et,an=new Et,on=new Zt,ln=new bt;class cn{constructor(e=0,t=0,n=0,r=cn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}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,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],o=r[1],l=r[5],c=r[9],h=r[2],u=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(Ge(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ge(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,i),this._z=0);break;case"ZXY":this._x=Math.asin(Ge(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-Ge(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Ge(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Ge(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return on.makeRotationFromQuaternion(e),this.setFromRotationMatrix(on,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ln.setFromEuler(this),this.setFromQuaternion(ln,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}}cn.DEFAULT_ORDER="XYZ";class hn{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let un=0;const dn=new Et,pn=new bt,fn=new Zt,mn=new Et,gn=new Et,An=new Et,vn=new bt,yn=new Et(1,0,0),xn=new Et(0,1,0),bn=new Et(0,0,1),En={type:"added"},_n={type:"removed"};class Sn extends Le{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:un++}),this.uuid=ke(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Sn.DEFAULT_UP.clone();const e=new Et,t=new cn,n=new bt,r=new Et(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Zt},normalMatrix:{value:new Ke}}),this.matrix=new Zt,this.matrixWorld=new Zt,this.matrixAutoUpdate=Sn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=Sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new hn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return pn.setFromAxisAngle(e,t),this.quaternion.multiply(pn),this}rotateOnWorldAxis(e,t){return pn.setFromAxisAngle(e,t),this.quaternion.premultiply(pn),this}rotateX(e){return this.rotateOnAxis(yn,e)}rotateY(e){return this.rotateOnAxis(xn,e)}rotateZ(e){return this.rotateOnAxis(bn,e)}translateOnAxis(e,t){return dn.copy(e).applyQuaternion(this.quaternion),this.position.add(dn.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(yn,e)}translateY(e){return this.translateOnAxis(xn,e)}translateZ(e){return this.translateOnAxis(bn,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(fn.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?mn.copy(e):mn.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),gn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?fn.lookAt(gn,mn,this.up):fn.lookAt(mn,gn,this.up),this.quaternion.setFromRotationMatrix(fn),r&&(fn.extractRotation(r.matrixWorld),pn.setFromRotationMatrix(fn),this.quaternion.premultiply(pn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(En)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_n)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(_n)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),fn.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),fn.multiply(e.parent.matrixWorld)),e.applyMatrix4(fn),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t){let n=[];this[e]===t&&n.push(this);for(let r=0,i=this.children.length;r<i;r++){const i=this.children[r].getObjectsByProperty(e,t);i.length>0&&(n=n.concat(i))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gn,e,An),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gn,vn,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 n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){const r=t[n];!0!==r.matrixWorldAutoUpdate&&!0!==e||r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){const n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),c=s(e.animations),h=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}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 n=0;n<e.children.length;n++){const t=e.children[n];this.add(t.clone())}return this}}Sn.DEFAULT_UP=new Et(0,1,0),Sn.DEFAULT_MATRIX_AUTO_UPDATE=!0,Sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const wn=new Et,Mn=new Et,Cn=new Et,Tn=new Et,In=new Et,Bn=new Et,Rn=new Et,Pn=new Et,Dn=new Et,Ln=new Et;let Fn=!1;class Un{constructor(e=new Et,t=new Et,n=new Et){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),wn.subVectors(e,t),r.cross(wn);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){wn.subVectors(r,t),Mn.subVectors(n,t),Cn.subVectors(e,t);const s=wn.dot(wn),a=wn.dot(Mn),o=wn.dot(Cn),l=Mn.dot(Mn),c=Mn.dot(Cn),h=s*l-a*a;if(0===h)return i.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Tn),Tn.x>=0&&Tn.y>=0&&Tn.x+Tn.y<=1}static getUV(e,t,n,r,i,s,a,o){return!1===Fn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fn=!0),this.getInterpolation(e,t,n,r,i,s,a,o)}static getInterpolation(e,t,n,r,i,s,a,o){return this.getBarycoord(e,t,n,r,Tn),o.setScalar(0),o.addScaledVector(i,Tn.x),o.addScaledVector(s,Tn.y),o.addScaledVector(a,Tn.z),o}static isFrontFacing(e,t,n,r){return wn.subVectors(n,t),Mn.subVectors(e,t),wn.cross(Mn).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 wn.subVectors(this.c,this.b),Mn.subVectors(this.a,this.b),.5*wn.cross(Mn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Un.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Un.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return!1===Fn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fn=!0),Un.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}getInterpolation(e,t,n,r,i){return Un.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Un.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Un.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,a;In.subVectors(r,n),Bn.subVectors(i,n),Pn.subVectors(e,n);const o=In.dot(Pn),l=Bn.dot(Pn);if(o<=0&&l<=0)return t.copy(n);Dn.subVectors(e,r);const c=In.dot(Dn),h=Bn.dot(Dn);if(c>=0&&h<=c)return t.copy(r);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),t.copy(n).addScaledVector(In,s);Ln.subVectors(e,i);const d=In.dot(Ln),p=Bn.dot(Ln);if(p>=0&&d<=p)return t.copy(i);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),t.copy(n).addScaledVector(Bn,a);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Rn.subVectors(i,r),a=(h-c)/(h-c+(d-p)),t.copy(r).addScaledVector(Rn,a);const g=1/(m+f+u);return s=f*g,a=u*g,t.copy(n).addScaledVector(In,s).addScaledVector(Bn,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let On=0;class Nn extends Le{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:On++}),this.uuid=ke(),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=l,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 n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n: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 n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==a&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}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 n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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 kn={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},Gn={h:0,s:0,l:0},zn={h:0,s:0,l:0};function Qn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class Vn{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}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=Ce){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ht.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=ht.workingColorSpace){return this.r=e,this.g=t,this.b=n,ht.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=ht.workingColorSpace){if(e=ze(e,1),t=Ge(t,0,1),n=Ge(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Qn(i,r,e+1/3),this.g=Qn(i,r,e),this.b=Qn(i,r,e-1/3)}return ht.toWorkingColorSpace(this,r),this}setStyle(e,t=Ce){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=r[1],a=r[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===i)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=Ce){const n=kn[e.toLowerCase()];return void 0!==n?this.setHex(n,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=it(e.r),this.g=it(e.g),this.b=it(e.b),this}copyLinearToSRGB(e){return this.r=st(e.r),this.g=st(e.g),this.b=st(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ce){return ht.fromWorkingColorSpace(Hn.copy(this),e),65536*Math.round(Ge(255*Hn.r,0,255))+256*Math.round(Ge(255*Hn.g,0,255))+Math.round(Ge(255*Hn.b,0,255))}getHexString(e=Ce){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ht.workingColorSpace){ht.fromWorkingColorSpace(Hn.copy(this),t);const n=Hn.r,r=Hn.g,i=Hn.b,s=Math.max(n,r,i),a=Math.min(n,r,i);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=c<=.5?e/(s+a):e/(2-s-a),s){case n:o=(r-i)/e+(r<i?6:0);break;case r:o=(i-n)/e+2;break;case i:o=(n-r)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=ht.workingColorSpace){return ht.fromWorkingColorSpace(Hn.copy(this),t),e.r=Hn.r,e.g=Hn.g,e.b=Hn.b,e}getStyle(e=Ce){ht.fromWorkingColorSpace(Hn.copy(this),e);const t=Hn.r,n=Hn.g,r=Hn.b;return e!==Ce?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(Gn),Gn.h+=e,Gn.s+=t,Gn.l+=n,this.setHSL(Gn.h,Gn.s,Gn.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Gn),e.getHSL(zn);const n=Qe(Gn.h,zn.h,t),r=Qe(Gn.s,zn.s,t),i=Qe(Gn.l,zn.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Hn=new Vn;Vn.NAMES=kn;class jn extends Nn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Vn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=c,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Wn=Xn();function Xn(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const e=l-127;e<-27?(r[l]=0,r[256|l]=32768,i[l]=24,i[256|l]=24):e<-14?(r[l]=1024>>-e-14,r[256|l]=1024>>-e-14|32768,i[l]=-e-1,i[256|l]=-e-1):e<=15?(r[l]=e+15<<10,r[256|l]=e+15<<10|32768,i[l]=13,i[256|l]=13):e<128?(r[l]=31744,r[256|l]=64512,i[l]=24,i[256|l]=24):(r[l]=31744,r[256|l]=64512,i[l]=13,i[256|l]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0==(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,s[l]=e|t}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function Yn(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Ge(e,-65504,65504),Wn.floatView[0]=e;const t=Wn.uint32View[0],n=t>>23&511;return Wn.baseTable[n]+((8388607&t)>>Wn.shiftTable[n])}function qn(e){const t=e>>10;return Wn.uint32View[0]=Wn.mantissaTable[Wn.offsetTable[t]+(1023&e)]+Wn.exponentTable[t],Wn.floatView[0]}const Kn={toHalfFloat:Yn,fromHalfFloat:qn},Jn=new Et,Zn=new qe;class $n{constructor(e,t,n=!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=n,this.usage=Re,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,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Zn.fromBufferAttribute(this,t),Zn.applyMatrix3(e),this.setXY(t,Zn.x,Zn.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Jn.fromBufferAttribute(this,t),Jn.applyMatrix3(e),this.setXYZ(t,Jn.x,Jn.y,Jn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Jn.fromBufferAttribute(this,t),Jn.applyMatrix4(e),this.setXYZ(t,Jn.x,Jn.y,Jn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Jn.fromBufferAttribute(this,t),Jn.applyNormalMatrix(e),this.setXYZ(t,Jn.x,Jn.y,Jn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Jn.fromBufferAttribute(this,t),Jn.transformDirection(e),this.setXYZ(t,Jn.x,Jn.y,Jn.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=We(t,this.array)),t}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=We(t,this.array)),t}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=We(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=We(t,this.array)),t}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Re&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class er extends $n{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class tr extends $n{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class nr extends $n{constructor(e,t,n){super(new Float32Array(e),t,n)}}let rr=0;const ir=new Zt,sr=new Sn,ar=new Et,or=new wt,lr=new wt,cr=new Et;class hr extends Le{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rr++}),this.uuid=ke(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Ze(e)?tr:er)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Ke).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return ir.makeRotationFromQuaternion(e),this.applyMatrix4(ir),this}rotateX(e){return ir.makeRotationX(e),this.applyMatrix4(ir),this}rotateY(e){return ir.makeRotationY(e),this.applyMatrix4(ir),this}rotateZ(e){return ir.makeRotationZ(e),this.applyMatrix4(ir),this}translate(e,t,n){return ir.makeTranslation(e,t,n),this.applyMatrix4(ir),this}scale(e,t,n){return ir.makeScale(e,t,n),this.applyMatrix4(ir),this}lookAt(e){return sr.lookAt(e),sr.updateMatrix(),this.applyMatrix4(sr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ar).negate(),this.translate(ar.x,ar.y,ar.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new nr(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new wt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Et(-1/0,-1/0,-1/0),new Et(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const e=t[n];or.setFromBufferAttribute(e),this.morphTargetsRelative?(cr.addVectors(this.boundingBox.min,or.min),this.boundingBox.expandByPoint(cr),cr.addVectors(this.boundingBox.max,or.max),this.boundingBox.expandByPoint(cr)):(this.boundingBox.expandByPoint(or.min),this.boundingBox.expandByPoint(or.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Vt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new Et,1/0);if(e){const n=this.boundingSphere.center;if(or.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const n=t[e];lr.setFromBufferAttribute(n),this.morphTargetsRelative?(cr.addVectors(or.min,lr.min),or.expandByPoint(cr),cr.addVectors(or.max,lr.max),or.expandByPoint(cr)):(or.expandByPoint(lr.min),or.expandByPoint(lr.max))}or.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)cr.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(cr));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],a=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)cr.fromBufferAttribute(s,t),a&&(ar.fromBufferAttribute(e,t),cr.add(ar)),r=Math.max(r,n.distanceToSquared(cr))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,s=t.uv.array,a=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new $n(new Float32Array(4*a),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let w=0;w<a;w++)l[w]=new Et,c[w]=new Et;const h=new Et,u=new Et,d=new Et,p=new qe,f=new qe,m=new qe,g=new Et,A=new Et;function v(e,t,n){h.fromArray(r,3*e),u.fromArray(r,3*t),d.fromArray(r,3*n),p.fromArray(s,2*e),f.fromArray(s,2*t),m.fromArray(s,2*n),u.sub(h),d.sub(h),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(i),A.copy(d).multiplyScalar(f.x).addScaledVector(u,-m.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(A),c[t].add(A),c[n].add(A))}let y=this.groups;0===y.length&&(y=[{start:0,count:n.length}]);for(let w=0,M=y.length;w<M;++w){const e=y[w],t=e.start;for(let r=t,i=t+e.count;r<i;r+=3)v(n[r+0],n[r+1],n[r+2])}const x=new Et,b=new Et,E=new Et,_=new Et;function S(e){E.fromArray(i,3*e),_.copy(E);const t=l[e];x.copy(t),x.sub(E.multiplyScalar(E.dot(t))).normalize(),b.crossVectors(_,t);const n=b.dot(c[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=n}for(let w=0,M=y.length;w<M;++w){const e=y[w],t=e.start;for(let r=t,i=t+e.count;r<i;r+=3)S(n[r+0]),S(n[r+1]),S(n[r+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new $n(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new Et,i=new Et,s=new Et,a=new Et,o=new Et,l=new Et,c=new Et,h=new Et;if(e)for(let u=0,d=e.count;u<d;u+=3){const d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),s.fromBufferAttribute(t,f),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),a.fromBufferAttribute(n,d),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),a.add(c),o.add(c),l.add(c),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,u=t.count;e<u;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)cr.fromBufferAttribute(e,t),cr.normalize(),e.setXYZ(t,cr.x,cr.y,cr.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let a=0,o=0;for(let l=0,c=t.length;l<c;l++){a=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(let e=0;e<r;e++)s[o++]=n[a++]}return new $n(s,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new hr,n=this.index.array,r=this.attributes;for(const a in r){const i=e(r[a],n);t.setAttribute(a,i)}const i=this.morphAttributes;for(const a in i){const r=[],s=i[a];for(let t=0,i=s.length;t<i;t++){const i=e(s[t],n);r.push(i)}t.morphAttributes[a]=r}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,o=s.length;a<o;a++){const e=s[a];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);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 n=this.attributes;for(const o in n){const t=n[o];e.data.attributes[o]=t.toJSON(e.data)}const r={};let i=!1;for(const o in this.morphAttributes){const t=this.morphAttributes[o],n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n.push(i.toJSON(e.data))}n.length>0&&(r[o]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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 n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r<i;r++)e.push(n[r].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let l=0,c=s.length;l<c;l++){const e=s[l];this.addGroup(e.start,e.count,e.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ur=new Zt,dr=new Jt,pr=new Vt,fr=new Et,mr=new Et,gr=new Et,Ar=new Et,vr=new Et,yr=new Et,xr=new qe,br=new qe,Er=new qe,_r=new Et,Sr=new Et,wr=new Et,Mr=new Et,Cr=new Et;class Tr extends Sn{constructor(e=new hr,t=new jn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,s=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(i&&a){yr.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=a[n],o=i[n];0!==r&&(vr.fromBufferAttribute(o,e),s?yr.addScaledVector(vr,r):yr.addScaledVector(vr.sub(t),r))}t.add(yr)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),pr.copy(n.boundingSphere),pr.applyMatrix4(i),dr.copy(e.ray).recast(e.near),!1===pr.containsPoint(dr.origin)){if(null===dr.intersectSphere(pr,fr))return;if(dr.origin.distanceToSquared(fr)>(e.far-e.near)**2)return}ur.copy(i).invert(),dr.copy(e.ray).applyMatrix4(ur),null!==n.boundingBox&&!1===dr.intersectsBox(n.boundingBox)||this._computeIntersections(e,t)}}_computeIntersections(e,t){let n;const r=this.geometry,i=this.material,s=r.index,a=r.attributes.position,o=r.attributes.uv,l=r.attributes.uv1,c=r.attributes.normal,h=r.groups,u=r.drawRange;if(null!==s)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const r=h[d],a=i[r.materialIndex];for(let i=Math.max(r.start,u.start),h=Math.min(s.count,Math.min(r.start+r.count,u.start+u.count));i<h;i+=3){const h=s.getX(i),u=s.getX(i+1),d=s.getX(i+2);n=Ir(this,a,e,dr,o,l,c,h,u,d),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=r.materialIndex,t.push(n))}}else{for(let r=Math.max(0,u.start),a=Math.min(s.count,u.start+u.count);r<a;r+=3){const a=s.getX(r),h=s.getX(r+1),u=s.getX(r+2);n=Ir(this,i,e,dr,o,l,c,a,h,u),n&&(n.faceIndex=Math.floor(r/3),t.push(n))}}else if(void 0!==a)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const r=h[d],s=i[r.materialIndex];for(let i=Math.max(r.start,u.start),h=Math.min(a.count,Math.min(r.start+r.count,u.start+u.count));i<h;i+=3){n=Ir(this,s,e,dr,o,l,c,i,i+1,i+2),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=r.materialIndex,t.push(n))}}else{for(let r=Math.max(0,u.start),s=Math.min(a.count,u.start+u.count);r<s;r+=3){n=Ir(this,i,e,dr,o,l,c,r,r+1,r+2),n&&(n.faceIndex=Math.floor(r/3),t.push(n))}}}}function Ir(e,t,n,r,i,s,l,c,h,u){e.getVertexPosition(c,mr),e.getVertexPosition(h,gr),e.getVertexPosition(u,Ar);const d=function(e,t,n,r,i,s,l,c){let h;if(h=t.side===o?r.intersectTriangle(l,s,i,!0,c):r.intersectTriangle(i,s,l,t.side===a,c),null===h)return null;Cr.copy(c),Cr.applyMatrix4(e.matrixWorld);const u=n.ray.origin.distanceTo(Cr);return u<n.near||u>n.far?null:{distance:u,point:Cr.clone(),object:e}}(e,t,n,r,mr,gr,Ar,Mr);if(d){i&&(xr.fromBufferAttribute(i,c),br.fromBufferAttribute(i,h),Er.fromBufferAttribute(i,u),d.uv=Un.getInterpolation(Mr,mr,gr,Ar,xr,br,Er,new qe)),s&&(xr.fromBufferAttribute(s,c),br.fromBufferAttribute(s,h),Er.fromBufferAttribute(s,u),d.uv1=Un.getInterpolation(Mr,mr,gr,Ar,xr,br,Er,new qe),d.uv2=d.uv1),l&&(_r.fromBufferAttribute(l,c),Sr.fromBufferAttribute(l,h),wr.fromBufferAttribute(l,u),d.normal=Un.getInterpolation(Mr,mr,gr,Ar,_r,Sr,wr,new Et),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));const e={a:c,b:h,c:u,normal:new Et,materialIndex:0};Un.getNormal(mr,gr,Ar,e.normal),d.face=e}return d}class Br extends hr{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const a=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(e,t,n,r,i,s,p,f,m,g,A){const v=s/m,y=p/g,x=s/2,b=p/2,E=f/2,_=m+1,S=g+1;let w=0,M=0;const C=new Et;for(let a=0;a<S;a++){const s=a*y-b;for(let o=0;o<_;o++){const u=o*v-x;C[e]=u*r,C[t]=s*i,C[n]=E,l.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,c.push(C.x,C.y,C.z),h.push(o/m),h.push(1-a/g),w+=1}}for(let a=0;a<g;a++)for(let e=0;e<m;e++){const t=u+e+_*a,n=u+e+_*(a+1),r=u+(e+1)+_*(a+1),i=u+(e+1)+_*a;o.push(t,n,i),o.push(n,r,i),M+=6}a.addGroup(d,M,A),d+=M,u+=w}p("z","y","x",-1,-1,n,t,e,s,i,0),p("z","y","x",1,-1,n,t,-e,s,i,1),p("x","z","y",1,1,e,n,t,r,s,2),p("x","z","y",1,-1,e,n,-t,r,s,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(o),this.setAttribute("position",new nr(l,3)),this.setAttribute("normal",new nr(c,3)),this.setAttribute("uv",new nr(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Br(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Rr(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Pr(e){const t={};for(let n=0;n<e.length;n++){const r=Rr(e[n]);for(const e in r)t[e]=r[e]}return t}function Dr(e){return null===e.getRenderTarget()?e.outputColorSpace:Te}const Lr={clone:Rr,merge:Pr};class Fr extends Nn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Rr(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Ur extends Sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Zt,this.projectionMatrix=new Zt,this.projectionMatrixInverse=new Zt}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 Or extends Ur{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,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*Oe*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ne*Math.atan(Math.tan(.5*Oe*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,n,r,i,s){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=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Oe*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;i+=s.offsetX*r/e,t-=s.offsetY*n/a,r*=s.width/e,n*=s.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,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 Nr=-90;class kr extends Sn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n;const r=new Or(Nr,1,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);const i=new Or(Nr,1,e,t);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(-1,0,0),this.add(i);const s=new Or(Nr,1,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);const a=new Or(Nr,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const o=new Or(Nr,1,e,t);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);const l=new Or(Nr,1,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,s,a,o,l]=this.children,c=e.getRenderTarget(),h=e.toneMapping,u=e.xr.enabled;e.toneMapping=d,e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,o),n.texture.generateMipmaps=p,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=h,e.xr.enabled=u,n.texture.needsPMREMUpdate=!0}}class Gr extends gt{constructor(e,t,n,r,i,s,a,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:y,n,r,i,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class zr extends vt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];void 0!==t.encoding&&(rt("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===we?Ce:Me),this.texture=new Gr(r,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:B}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 n={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 <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\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 <common>\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"},r=new Br(5,5,5),i=new Fr({name:"CubemapFromEquirect",uniforms:Rr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:o,blending:0});i.uniforms.tEquirect.value=t;const s=new Tr(r,i),a=t.minFilter;t.minFilter===P&&(t.minFilter=B);return new kr(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,r);e.setRenderTarget(i)}}const Qr=new Et,Vr=new Et,Hr=new Ke;class jr{constructor(e=new Et(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,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Qr.subVectors(n,t).cross(Vr.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,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 n=e.delta(Qr),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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 n=t||Hr.getNormalMatrix(e),r=this.coplanarPoint(Qr).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 Wr=new Vt,Xr=new Et;class Yr{constructor(e=new jr,t=new jr,n=new jr,r=new jr,i=new jr,s=new jr){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],A=n[14],v=n[15];return t[0].setComponents(a-r,h-o,f-u,v-m).normalize(),t[1].setComponents(a+r,h+o,f+u,v+m).normalize(),t[2].setComponents(a+i,h+l,f+d,v+g).normalize(),t[3].setComponents(a-i,h-l,f-d,v-g).normalize(),t[4].setComponents(a-s,h-c,f-p,v-A).normalize(),t[5].setComponents(a+s,h+c,f+p,v+A).normalize(),this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Wr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Wr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wr)}intersectsSprite(e){return Wr.center.set(0,0,0),Wr.radius=.7071067811865476,Wr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wr)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Xr.x=r.normal.x>0?e.max.x:e.min.x,Xr.y=r.normal.y>0?e.max.y:e.min.y,Xr.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xr)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function qr(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Kr(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=r.get(t);void 0===s?r.set(t,function(t,r){const i=t.array,s=t.usage,a=e.createBuffer();let o;if(e.bindBuffer(r,a),e.bufferData(r,i,s),t.onUploadCallback(),i instanceof Float32Array)o=e.FLOAT;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=e.HALF_FLOAT}else o=e.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=e.SHORT;else if(i instanceof Uint32Array)o=e.UNSIGNED_INT;else if(i instanceof Int32Array)o=e.INT;else if(i instanceof Int8Array)o=e.BYTE;else if(i instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=e.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):s.version<t.version&&(!function(t,r,i){const s=r.array,a=r.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,s):(n?e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count):e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count)),a.count=-1),r.onUploadCallback()}(s.buffer,t,i),s.version=t.version)}}}class Jr extends hr{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,s=t/2,a=Math.floor(n),o=Math.floor(r),l=a+1,c=o+1,h=e/a,u=t/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const e=g*u-s;for(let t=0;t<l;t++){const n=t*h-i;p.push(n,-e,0),f.push(0,0,1),m.push(t/a),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<a;e++){const t=e+l*g,n=e+l*(g+1),r=e+1+l*(g+1),i=e+1+l*g;d.push(t,n,i),d.push(n,r,i)}this.setIndex(d),this.setAttribute("position",new nr(p,3)),this.setAttribute("normal",new nr(f,3)),this.setAttribute("uv",new nr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jr(e.width,e.height,e.widthSegments,e.heightSegments)}}const Zr={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 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\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#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, 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 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_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\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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 <cube_uv_reflection_fragment>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\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 <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\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 <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\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 <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\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 <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},$r={common:{diffuse:{value:new Vn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ke},alphaMap:{value:null},alphaMapTransform:{value:new Ke},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ke}},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 Ke}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ke}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ke},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ke},normalScale:{value:new qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ke},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ke}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ke}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ke}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Vn(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 Vn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ke}},sprite:{diffuse:{value:new Vn(16777215)},opacity:{value:1},center:{value:new qe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ke},alphaMap:{value:null},alphaTest:{value:0}}},ei={basic:{uniforms:Pr([$r.common,$r.specularmap,$r.envmap,$r.aomap,$r.lightmap,$r.fog]),vertexShader:Zr.meshbasic_vert,fragmentShader:Zr.meshbasic_frag},lambert:{uniforms:Pr([$r.common,$r.specularmap,$r.envmap,$r.aomap,$r.lightmap,$r.emissivemap,$r.bumpmap,$r.normalmap,$r.displacementmap,$r.fog,$r.lights,{emissive:{value:new Vn(0)}}]),vertexShader:Zr.meshlambert_vert,fragmentShader:Zr.meshlambert_frag},phong:{uniforms:Pr([$r.common,$r.specularmap,$r.envmap,$r.aomap,$r.lightmap,$r.emissivemap,$r.bumpmap,$r.normalmap,$r.displacementmap,$r.fog,$r.lights,{emissive:{value:new Vn(0)},specular:{value:new Vn(1118481)},shininess:{value:30}}]),vertexShader:Zr.meshphong_vert,fragmentShader:Zr.meshphong_frag},standard:{uniforms:Pr([$r.common,$r.envmap,$r.aomap,$r.lightmap,$r.emissivemap,$r.bumpmap,$r.normalmap,$r.displacementmap,$r.roughnessmap,$r.metalnessmap,$r.fog,$r.lights,{emissive:{value:new Vn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag},toon:{uniforms:Pr([$r.common,$r.aomap,$r.lightmap,$r.emissivemap,$r.bumpmap,$r.normalmap,$r.displacementmap,$r.gradientmap,$r.fog,$r.lights,{emissive:{value:new Vn(0)}}]),vertexShader:Zr.meshtoon_vert,fragmentShader:Zr.meshtoon_frag},matcap:{uniforms:Pr([$r.common,$r.bumpmap,$r.normalmap,$r.displacementmap,$r.fog,{matcap:{value:null}}]),vertexShader:Zr.meshmatcap_vert,fragmentShader:Zr.meshmatcap_frag},points:{uniforms:Pr([$r.points,$r.fog]),vertexShader:Zr.points_vert,fragmentShader:Zr.points_frag},dashed:{uniforms:Pr([$r.common,$r.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zr.linedashed_vert,fragmentShader:Zr.linedashed_frag},depth:{uniforms:Pr([$r.common,$r.displacementmap]),vertexShader:Zr.depth_vert,fragmentShader:Zr.depth_frag},normal:{uniforms:Pr([$r.common,$r.bumpmap,$r.normalmap,$r.displacementmap,{opacity:{value:1}}]),vertexShader:Zr.meshnormal_vert,fragmentShader:Zr.meshnormal_frag},sprite:{uniforms:Pr([$r.sprite,$r.fog]),vertexShader:Zr.sprite_vert,fragmentShader:Zr.sprite_frag},background:{uniforms:{uvTransform:{value:new Ke},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Zr.background_vert,fragmentShader:Zr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Zr.backgroundCube_vert,fragmentShader:Zr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Zr.cube_vert,fragmentShader:Zr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zr.equirect_vert,fragmentShader:Zr.equirect_frag},distanceRGBA:{uniforms:Pr([$r.common,$r.displacementmap,{referencePosition:{value:new Et},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zr.distanceRGBA_vert,fragmentShader:Zr.distanceRGBA_frag},shadow:{uniforms:Pr([$r.lights,$r.fog,{color:{value:new Vn(0)},opacity:{value:1}}]),vertexShader:Zr.shadow_vert,fragmentShader:Zr.shadow_frag}};ei.physical={uniforms:Pr([ei.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ke},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ke},clearcoatNormalScale:{value:new qe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ke},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ke},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ke},sheen:{value:0},sheenColor:{value:new Vn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ke},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ke},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ke},transmissionSamplerSize:{value:new qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ke},attenuationDistance:{value:0},attenuationColor:{value:new Vn(0)},specularColor:{value:new Vn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ke},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ke}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag};const ti={r:0,b:0,g:0};function ni(e,t,n,r,i,s,l){const c=new Vn(0);let h,u,d=!0===s?0:1,p=null,f=0,m=null;function g(t,n){t.getRGB(ti,Dr(e)),r.buffers.color.setClear(ti.r,ti.g,ti.b,n,l)}return{getClearColor:function(){return c},setClearColor:function(e,t=1){c.set(e),d=t,g(c,d)},getClearAlpha:function(){return d},setClearAlpha:function(e){d=e,g(c,d)},render:function(s,A){let v=!1,y=!0===A.isScene?A.background:null;if(y&&y.isTexture){y=(A.backgroundBlurriness>0?n:t).get(y)}switch(null===y?g(c,d):y&&y.isColor&&(g(y,1),v=!0),e.xr.getEnvironmentBlendMode()){case"opaque":v=!0;break;case"additive":r.buffers.color.setClear(0,0,0,1,l),v=!0;break;case"alpha-blend":r.buffers.color.setClear(0,0,0,0,l),v=!0}(e.autoClear||v)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===_)?(void 0===u&&(u=new Tr(new Br(1,1,1),new Fr({name:"BackgroundCubeMaterial",uniforms:Rr(ei.backgroundCube.uniforms),vertexShader:ei.backgroundCube.vertexShader,fragmentShader:ei.backgroundCube.fragmentShader,side:o,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=y.colorSpace!==Ce,p===y&&f===y.version&&m===e.toneMapping||(u.material.needsUpdate=!0,p=y,f=y.version,m=e.toneMapping),u.layers.enableAll(),s.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(void 0===h&&(h=new Tr(new Jr(2,2),new Fr({name:"BackgroundMaterial",uniforms:Rr(ei.background.uniforms),vertexShader:ei.background.vertexShader,fragmentShader:ei.background.fragmentShader,side:a,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,h.material.toneMapped=y.colorSpace!==Ce,!0===y.matrixAutoUpdate&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&f===y.version&&m===e.toneMapping||(h.material.needsUpdate=!0,p=y,f=y.version,m=e.toneMapping),h.layers.enableAll(),s.unshift(h,h.geometry,h.material,0,0,null))}}}function ri(e,t,n,r){const i=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(t){return r.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let s=0;s<i;s++)t[s]=0,n[s]=0,r[s]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function m(e){g(e,0)}function g(n,i){const s=c.newAttributes,a=c.enabledAttributes,o=c.attributeDivisors;if(s[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),o[n]!==i){(r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),o[n]=i}}function A(){const t=c.newAttributes,n=c.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function v(t,n,i,s,a,o){!0!==r.isWebGL2||i!==e.INT&&i!==e.UNSIGNED_INT?e.vertexAttribPointer(t,n,i,s,a,o):e.vertexAttribIPointer(t,n,i,a,o)}function y(){x(),h=!0,c!==l&&(c=l,u(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,d,y,x){let b=!1;if(a){const t=function(t,n,i){const a=!0===i.wireframe;let l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let h=c[a];void 0===h&&(h=p(r.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[a]=h);return h}(y,d,l);c!==t&&(c=t,u(c.object)),b=function(e,t,n,r){const i=c.attributes,s=t.attributes;let a=0;const o=n.getAttributes();for(const l in o){if(o[l].location>=0){const t=i[l];let n=s[l];if(void 0===n&&("instanceMatrix"===l&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(n=e.instanceColor)),void 0===t)return!0;if(t.attribute!==n)return!0;if(n&&t.data!==n.data)return!0;a++}}return c.attributesNum!==a||c.index!==r}(i,y,d,x),b&&function(e,t,n,r){const i={},s=t.attributes;let a=0;const o=n.getAttributes();for(const l in o){if(o[l].location>=0){let t=s[l];void 0===t&&("instanceMatrix"===l&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(t=e.instanceColor));const n={};n.attribute=t,t&&t.data&&(n.data=t.data),i[l]=n,a++}}c.attributes=i,c.attributesNum=a,c.index=r}(i,y,d,x)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===e||(c.geometry=y.id,c.program=d.id,c.wireframe=e,b=!0)}null!==x&&n.update(x,e.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(i,s,a,o){if(!1===r.isWebGL2&&(i.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const t in c){const r=c[t];if(r.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&i.instanceMatrix&&(s=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(s=i.instanceColor)),void 0!==s){const t=s.normalized,a=s.itemSize,l=n.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,l=n.stride,d=s.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,h,t,l*u,(d+a/r.locationSize*e)*u)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,s.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,h,t,a*u,a/r.locationSize*e*u)}}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r.location,n);break;case 3:e.vertexAttrib3fv(r.location,n);break;case 4:e.vertexAttrib4fv(r.location,n);break;default:e.vertexAttrib1fv(r.location,n)}}}}A()}(i,l,d,y),null!==x&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in o){const t=o[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;const t=o[e.id];for(const n in t){const e=t[n];for(const t in e)d(e[t].object),delete e[t];delete t[n]}delete o[e.id]},releaseStatesOfProgram:function(e){for(const t in o){const n=o[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:A}}function ii(e,t,n,r){const i=r.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,r){e.drawArrays(s,t,r),n.update(r,s,1)},this.renderInstances=function(r,a,o){if(0===o)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,r,a,o),n.update(a,s,o)}}function si(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),A=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,y=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?e.getParameter(e.MAX_SAMPLES):0}}function ai(e){const t=this;let n=null,r=0,i=!1,s=!1;const a=new jr,o=new Ke,l={value:null,needsUpdate:!1};function c(e,n,r,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=r+4*s,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let n=0,l=r;n!==s;++n,l+=4)a.copy(e[n]).applyMatrix4(i,o),a.normal.toArray(c,l),c[l+3]=a.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(a,o,h){const u=a.clippingPlanes,d=a.clipIntersection,p=a.clipShadows,f=e.get(a);if(!i||null===u||0===u.length||s&&!p)s?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=s?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=c(u,o,t,h);for(let r=0;r!==t;++r)i[r]=n[r];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function oi(e){let t=new WeakMap;function n(e,t){return t===b?e.mapping=y:t===E&&(e.mapping=x),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const s=i.mapping;if(s===b||s===E){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const s=i.image;if(s&&s.height>0){const a=new zr(s.height/2);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class li extends Ur{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,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,n,r,i,s){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=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,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),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,a=r+t,o=r-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;i+=e*this.view.offsetX,s=i+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,a,o,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 ci=[.125,.215,.35,.446,.526,.582],hi=20,ui=new li,di=new Vn;let pi=null;const fi=(1+Math.sqrt(5))/2,mi=1/fi,gi=[new Et(1,1,1),new Et(-1,1,1),new Et(1,1,-1),new Et(-1,1,-1),new Et(0,fi,mi),new Et(0,fi,-mi),new Et(mi,0,fi),new Et(-mi,0,fi),new Et(fi,mi,0),new Et(-fi,mi,0)];class Ai{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,n=.1,r=100){pi=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=bi(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=xi(),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;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(pi),e.scissorTest=!1,yi(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===y||e.mapping===x?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),pi=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:B,minFilter:B,generateMipmaps:!1,type:O,format:k,colorSpace:Te,depthBuffer:!1},r=vi(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=vi(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+ci.length;for(let a=0;a<s;a++){const s=Math.pow(2,i);n.push(s);let o=1/s;a>e-4?o=ci[a-e+4-1]:0===a&&(o=0),r.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),v=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];A.set(r,f*p*e),v.set(u,m*p*e);const i=[e,e,e,e,e,e];y.set(i,g*p*e)}const x=new hr;x.setAttribute("position",new $n(A,f)),x.setAttribute("uv",new $n(v,m)),x.setAttribute("faceIndex",new $n(y,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(hi),i=new Et(0,1,0),s=new Fr({name:"SphericalGaussianBlur",defines:{n:hi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ei(),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 <cube_uv_reflection_fragment>\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 s}(r,e,t)}return r}_compileMaterial(e){const t=new Tr(this._lodPlanes[0],e);this._renderer.compile(t,ui)}_sceneToCubeUV(e,t,n,r){const i=new Or(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,h=l.toneMapping;l.getClearColor(di),l.toneMapping=d,l.autoClear=!1;const u=new jn({name:"PMREM.Background",side:o,depthWrite:!1,depthTest:!1}),p=new Tr(new Br,u);let f=!1;const m=e.background;m?m.isColor&&(u.color.copy(m),e.background=null,f=!0):(u.color.copy(di),f=!0);for(let o=0;o<6;o++){const t=o%3;0===t?(i.up.set(0,s[o],0),i.lookAt(a[o],0,0)):1===t?(i.up.set(0,0,s[o]),i.lookAt(0,a[o],0)):(i.up.set(0,s[o],0),i.lookAt(0,0,a[o]));const n=this._cubeSize;yi(r,t*n,o>2?n:0,n,n),l.setRenderTarget(r),f&&l.render(p,i),l.render(e,i)}p.geometry.dispose(),p.material.dispose(),l.toneMapping=h,l.autoClear=c,e.background=m}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===y||e.mapping===x;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=bi()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=xi());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new Tr(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const a=this._cubeSize;yi(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,ui)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const t=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),n=gi[(r-1)%gi.length];this._blur(e,r-1,r,t,n)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Tr(this._lodPlanes[r],l),h=l.uniforms,u=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):hi;f>hi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let y=0;y<hi;++y){const e=y/p,t=Math.exp(-e*e/2);m.push(t),0===y?g+=t:y<f&&(g+=2*t)}for(let y=0;y<m.length;y++)m[y]=m[y]/g;h.envMap.value=e.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===s,a&&(h.poleAxis.value=a);const{_lodMax:A}=this;h.dTheta.value=d,h.mipInt.value=A-n;const v=this._sizeLods[r];yi(t,3*v*(r>A-4?r-A+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(c,ui)}}function vi(e,t,n){const r=new vt(e,t,n);return r.texture.mapping=_,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function yi(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function xi(){return new Fr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ei(),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 <common>\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 bi(){return new Fr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ei(),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 Ei(){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 _i(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,a=s===b||s===E,o=s===y||s===x;if(a||o){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new Ai(e)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const s=i.image;if(a&&s&&s.height>0||o&&s&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(s)){null===n&&(n=new Ai(e));const s=a?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,s),i.addEventListener("dispose",r),s.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Si(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function wi(e,t,n,r){const i={},s=new WeakMap;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const n in o.attributes)t.remove(o.attributes[n]);o.removeEventListener("dispose",a),delete i[o.id];const l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const o=new(Ze(n)?tr:er)(n,1);o.version=a;const l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const s in r)t.update(r[s],e.ARRAY_BUFFER);const i=n.morphAttributes;for(const s in i){const n=i[s];for(let r=0,i=n.length;r<i;r++)t.update(n[r],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return s.get(e)}}}function Mi(e,t,n,r){const i=r.isWebGL2;let s,a,o;this.setMode=function(e){s=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(s,r,a,t*o),n.update(r,s,1)},this.renderInstances=function(r,l,c){if(0===c)return;let h,u;if(i)h=e,u="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](s,l,a,r*o,c),n.update(l,s,c)}}function Ci(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function Ti(e,t){return e[0]-t[0]}function Ii(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Bi(e,t,n){const r={},i=new Float32Array(8),s=new WeakMap,a=new At,o=[];for(let l=0;l<8;l++)o[l]=[l,0];return{update:function(l,c,h){const u=l.morphTargetInfluences;if(!0===t.isWebGL2){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=void 0!==d?d.length:0;let f=s.get(c);if(void 0===f||f.count!==p){void 0!==f&&f.texture.dispose();const A=void 0!==c.morphAttributes.position,v=void 0!==c.morphAttributes.normal,y=void 0!==c.morphAttributes.color,x=c.morphAttributes.position||[],b=c.morphAttributes.normal||[],E=c.morphAttributes.color||[];let _=0;!0===A&&(_=1),!0===v&&(_=2),!0===y&&(_=3);let S=c.attributes.position.count*_,w=1;S>t.maxTextureSize&&(w=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const M=new Float32Array(S*w*4*p),C=new yt(M,S,w,p);C.type=U,C.needsUpdate=!0;const T=4*_;for(let B=0;B<p;B++){const R=x[B],P=b[B],D=E[B],L=S*w*4*B;for(let F=0;F<R.count;F++){const O=F*T;!0===A&&(a.fromBufferAttribute(R,F),M[L+O+0]=a.x,M[L+O+1]=a.y,M[L+O+2]=a.z,M[L+O+3]=0),!0===v&&(a.fromBufferAttribute(P,F),M[L+O+4]=a.x,M[L+O+5]=a.y,M[L+O+6]=a.z,M[L+O+7]=0),!0===y&&(a.fromBufferAttribute(D,F),M[L+O+8]=a.x,M[L+O+9]=a.y,M[L+O+10]=a.z,M[L+O+11]=4===D.itemSize?a.w:1)}}function I(){C.dispose(),s.delete(c),c.removeEventListener("dispose",I)}f={count:p,texture:C,size:new qe(S,w)},s.set(c,f),c.addEventListener("dispose",I)}let m=0;for(let N=0;N<u.length;N++)m+=u[N];const g=c.morphTargetsRelative?1:1-m;h.getUniforms().setValue(e,"morphTargetBaseInfluence",g),h.getUniforms().setValue(e,"morphTargetInfluences",u),h.getUniforms().setValue(e,"morphTargetsTexture",f.texture,n),h.getUniforms().setValue(e,"morphTargetsTextureSize",f.size)}else{const k=void 0===u?0:u.length;let G=r[c.id];if(void 0===G||G.length!==k){G=[];for(let j=0;j<k;j++)G[j]=[j,0];r[c.id]=G}for(let W=0;W<k;W++){const X=G[W];X[0]=W,X[1]=u[W]}G.sort(Ii);for(let Y=0;Y<8;Y++)Y<k&&G[Y][1]?(o[Y][0]=G[Y][0],o[Y][1]=G[Y][1]):(o[Y][0]=Number.MAX_SAFE_INTEGER,o[Y][1]=0);o.sort(Ti);const z=c.morphAttributes.position,Q=c.morphAttributes.normal;let V=0;for(let q=0;q<8;q++){const K=o[q],J=K[0],Z=K[1];J!==Number.MAX_SAFE_INTEGER&&Z?(z&&c.getAttribute("morphTarget"+q)!==z[J]&&c.setAttribute("morphTarget"+q,z[J]),Q&&c.getAttribute("morphNormal"+q)!==Q[J]&&c.setAttribute("morphNormal"+q,Q[J]),i[q]=Z,V+=Z):(z&&!0===c.hasAttribute("morphTarget"+q)&&c.deleteAttribute("morphTarget"+q),Q&&!0===c.hasAttribute("morphNormal"+q)&&c.deleteAttribute("morphNormal"+q),i[q]=0)}const H=c.morphTargetsRelative?1:1-V;h.getUniforms().setValue(e,"morphTargetBaseInfluence",H),h.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function Ri(e,t,n,r){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(a){const o=r.render.frame,l=a.geometry,c=t.get(a,l);return i.get(c)!==o&&(t.update(c),i.set(c,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),n.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,e.ARRAY_BUFFER)),c},dispose:function(){i=new WeakMap}}}const Pi=new gt,Di=new yt,Li=new xt,Fi=new Gr,Ui=[],Oi=[],Ni=new Float32Array(16),ki=new Float32Array(9),Gi=new Float32Array(4);function zi(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=Ui[i];if(void 0===s&&(s=new Float32Array(i),Ui[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function Qi(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Vi(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function Hi(e,t){let n=Oi[t];void 0===n&&(n=new Int32Array(t),Oi[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function ji(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Wi(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Qi(n,t))return;e.uniform2fv(this.addr,t),Vi(n,t)}}function Xi(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Qi(n,t))return;e.uniform3fv(this.addr,t),Vi(n,t)}}function Yi(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Qi(n,t))return;e.uniform4fv(this.addr,t),Vi(n,t)}}function qi(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Qi(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Vi(n,t)}else{if(Qi(n,r))return;Gi.set(r),e.uniformMatrix2fv(this.addr,!1,Gi),Vi(n,r)}}function Ki(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Qi(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Vi(n,t)}else{if(Qi(n,r))return;ki.set(r),e.uniformMatrix3fv(this.addr,!1,ki),Vi(n,r)}}function Ji(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Qi(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Vi(n,t)}else{if(Qi(n,r))return;Ni.set(r),e.uniformMatrix4fv(this.addr,!1,Ni),Vi(n,r)}}function Zi(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function $i(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Qi(n,t))return;e.uniform2iv(this.addr,t),Vi(n,t)}}function es(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Qi(n,t))return;e.uniform3iv(this.addr,t),Vi(n,t)}}function ts(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Qi(n,t))return;e.uniform4iv(this.addr,t),Vi(n,t)}}function ns(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function rs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Qi(n,t))return;e.uniform2uiv(this.addr,t),Vi(n,t)}}function is(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Qi(n,t))return;e.uniform3uiv(this.addr,t),Vi(n,t)}}function ss(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Qi(n,t))return;e.uniform4uiv(this.addr,t),Vi(n,t)}}function as(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(t||Pi,i)}function os(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Li,i)}function ls(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Fi,i)}function cs(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Di,i)}function hs(e,t){e.uniform1fv(this.addr,t)}function us(e,t){const n=zi(t,this.size,2);e.uniform2fv(this.addr,n)}function ds(e,t){const n=zi(t,this.size,3);e.uniform3fv(this.addr,n)}function ps(e,t){const n=zi(t,this.size,4);e.uniform4fv(this.addr,n)}function fs(e,t){const n=zi(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function ms(e,t){const n=zi(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function gs(e,t){const n=zi(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function As(e,t){e.uniform1iv(this.addr,t)}function vs(e,t){e.uniform2iv(this.addr,t)}function ys(e,t){e.uniform3iv(this.addr,t)}function xs(e,t){e.uniform4iv(this.addr,t)}function bs(e,t){e.uniform1uiv(this.addr,t)}function Es(e,t){e.uniform2uiv(this.addr,t)}function _s(e,t){e.uniform3uiv(this.addr,t)}function Ss(e,t){e.uniform4uiv(this.addr,t)}function ws(e,t,n){const r=this.cache,i=t.length,s=Hi(n,i);Qi(r,s)||(e.uniform1iv(this.addr,s),Vi(r,s));for(let a=0;a!==i;++a)n.setTexture2D(t[a]||Pi,s[a])}function Ms(e,t,n){const r=this.cache,i=t.length,s=Hi(n,i);Qi(r,s)||(e.uniform1iv(this.addr,s),Vi(r,s));for(let a=0;a!==i;++a)n.setTexture3D(t[a]||Li,s[a])}function Cs(e,t,n){const r=this.cache,i=t.length,s=Hi(n,i);Qi(r,s)||(e.uniform1iv(this.addr,s),Vi(r,s));for(let a=0;a!==i;++a)n.setTextureCube(t[a]||Fi,s[a])}function Ts(e,t,n){const r=this.cache,i=t.length,s=Hi(n,i);Qi(r,s)||(e.uniform1iv(this.addr,s),Vi(r,s));for(let a=0;a!==i;++a)n.setTexture2DArray(t[a]||Di,s[a])}class Is{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return ji;case 35664:return Wi;case 35665:return Xi;case 35666:return Yi;case 35674:return qi;case 35675:return Ki;case 35676:return Ji;case 5124:case 35670:return Zi;case 35667:case 35671:return $i;case 35668:case 35672:return es;case 35669:case 35673:return ts;case 5125:return ns;case 36294:return rs;case 36295:return is;case 36296:return ss;case 35678:case 36198:case 36298:case 36306:case 35682:return as;case 35679:case 36299:case 36307:return os;case 35680:case 36300:case 36308:case 36293:return ls;case 36289:case 36303:case 36311:case 36292:return cs}}(t.type)}}class Bs{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return hs;case 35664:return us;case 35665:return ds;case 35666:return ps;case 35674:return fs;case 35675:return ms;case 35676:return gs;case 5124:case 35670:return As;case 35667:case 35671:return vs;case 35668:case 35672:return ys;case 35669:case 35673:return xs;case 5125:return bs;case 36294:return Es;case 36295:return _s;case 36296:return Ss;case 35678:case 36198:case 36298:case 36306:case 35682:return ws;case 35679:case 36299:case 36307:return Ms;case 35680:case 36300:case 36308:case 36293:return Cs;case 36289:case 36303:case 36311:case 36292:return Ts}}(t.type)}}class Rs{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}}}const Ps=/(\w+)(\])?(\[|\.)?/g;function Ds(e,t){e.seq.push(t),e.map[t.id]=t}function Ls(e,t,n){const r=e.name,i=r.length;for(Ps.lastIndex=0;;){const s=Ps.exec(r),a=Ps.lastIndex;let o=s[1];const l="]"===s[2],c=s[3];if(l&&(o|=0),void 0===c||"["===c&&a+2===i){Ds(n,void 0===c?new Is(o,e,t):new Bs(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new Rs(o),Ds(n,e)),n=e}}}class Fs{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);Ls(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],a=n[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function Us(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let Os=0;function Ns(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let a=i;a<s;a++){const e=a+1;r.push(`${e===t?">":" "} ${e}: ${n[a]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function ks(e,t){const n=function(e){switch(e){case Te:return["Linear","( value )"];case Ce:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Gs(e,t){let n;switch(t){case p:n="Linear";break;case f:n="Reinhard";break;case m:n="OptimizedCineon";break;case g:n="ACESFilmic";break;case A:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function zs(e){return""!==e}function Qs(e,t){const n=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,n).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 Vs(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Hs=/^[ \t]*#include +<([\w\d./]+)>/gm;function js(e){return e.replace(Hs,Ws)}function Ws(e,t){const n=Zr[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return js(n)}const Xs=/#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 Ys(e){return e.replace(Xs,qs)}function qs(e,t,n,r){let i="";for(let s=parseInt(t);s<parseInt(n);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Ks(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Js(e,t,n,a){const o=e.getContext(),l=n.defines;let p=n.vertexShader,f=n.fragmentShader;const m=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===r?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===i?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===s&&(t="SHADOWMAP_TYPE_VSM"),t}(n),g=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case y:case x:t="ENVMAP_TYPE_CUBE";break;case _:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),A=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===x&&(t="ENVMAP_MODE_REFRACTION");return t}(n),v=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case c:t="ENVMAP_BLENDING_MULTIPLY";break;case h:t="ENVMAP_BLENDING_MIX";break;case u:t="ENVMAP_BLENDING_ADD"}return t}(n),b=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),E=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.normalMapTangentSpace||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(zs).join("\n")}(n),S=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(l),w=o.createProgram();let M,C,T=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(M=[S].filter(zs).join("\n"),M.length>0&&(M+="\n"),C=[E,S].filter(zs).join("\n"),C.length>0&&(C+="\n")):(M=[Ks(n),"#define SHADER_NAME "+n.shaderName,S,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+A:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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(zs).join("\n"),C=[E,Ks(n),"#define SHADER_NAME "+n.shaderName,S,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.envMap?"#define "+A:"",n.envMap?"#define "+v:"",b?"#define CUBEUV_TEXEL_WIDTH "+b.texelWidth:"",b?"#define CUBEUV_TEXEL_HEIGHT "+b.texelHeight:"",b?"#define CUBEUV_MAX_MIP "+b.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==d?"#define TONE_MAPPING":"",n.toneMapping!==d?Zr.tonemapping_pars_fragment:"",n.toneMapping!==d?Gs("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Zr.encodings_pars_fragment,ks("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(zs).join("\n")),p=js(p),p=Qs(p,n),p=Vs(p,n),f=js(f),f=Qs(f,n),f=Vs(f,n),p=Ys(p),f=Ys(f),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(T="#version 300 es\n",M=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+M,C=["#define varying in",n.glslVersion===Pe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Pe?"":"#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"+C);const I=T+M+p,B=T+C+f,R=Us(o,o.VERTEX_SHADER,I),P=Us(o,o.FRAGMENT_SHADER,B);if(o.attachShader(w,R),o.attachShader(w,P),void 0!==n.index0AttributeName?o.bindAttribLocation(w,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(w,0,"position"),o.linkProgram(w),e.debug.checkShaderErrors){const t=o.getProgramInfoLog(w).trim(),n=o.getShaderInfoLog(R).trim(),r=o.getShaderInfoLog(P).trim();let i=!0,s=!0;if(!1===o.getProgramParameter(w,o.LINK_STATUS))if(i=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(o,w,R,P);else{const e=Ns(o,R,"vertex"),n=Ns(o,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+o.getError()+" - VALIDATE_STATUS "+o.getProgramParameter(w,o.VALIDATE_STATUS)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+n)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==n&&""!==r||(s=!1);s&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:n,prefix:M},fragmentShader:{log:r,prefix:C}})}let D,L;return o.deleteShader(R),o.deleteShader(P),this.getUniforms=function(){return void 0===D&&(D=new Fs(o,w)),D},this.getAttributes=function(){return void 0===L&&(L=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let a=1;r.type===e.FLOAT_MAT2&&(a=2),r.type===e.FLOAT_MAT3&&(a=3),r.type===e.FLOAT_MAT4&&(a=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}(o,w)),L},this.destroy=function(){a.releaseStatesOfProgram(this),o.deleteProgram(w),this.program=void 0},this.name=n.shaderName,this.id=Os++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=R,this.fragmentShader=P,this}let Zs=0;class $s{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new ea(e),t.set(e,n)),n}}class ea{constructor(e){this.id=Zs++,this.code=e,this.usedTimes=0}}function ta(e,t,n,r,i,s,a){const l=new hn,c=new $s,h=[],u=i.isWebGL2,p=i.logarithmicDepthBuffer,f=i.vertexTextures;let m=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function A(e){return 1===e?"uv1":2===e?"uv2":3===e?"uv3":"uv"}return{getParameters:function(s,l,h,v,y){const x=v.fog,b=y.geometry,E=s.isMeshStandardMaterial?v.environment:null,S=(s.isMeshStandardMaterial?n:t).get(s.envMap||E),w=S&&S.mapping===_?S.image.height:null,M=g[s.type];null!==s.precision&&(m=i.getMaxPrecision(s.precision),m!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",m,"instead."));const C=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,T=void 0!==C?C.length:0;let I,B,R,P,D=0;if(void 0!==b.morphAttributes.position&&(D=1),void 0!==b.morphAttributes.normal&&(D=2),void 0!==b.morphAttributes.color&&(D=3),M){const e=ei[M];I=e.vertexShader,B=e.fragmentShader}else I=s.vertexShader,B=s.fragmentShader,c.update(s),R=c.getVertexShaderID(s),P=c.getFragmentShaderID(s);const L=e.getRenderTarget(),F=!0===y.isInstancedMesh,U=!!s.map,O=!!s.matcap,N=!!S,k=!!s.aoMap,G=!!s.lightMap,z=!!s.bumpMap,Q=!!s.normalMap,V=!!s.displacementMap,H=!!s.emissiveMap,j=!!s.metalnessMap,W=!!s.roughnessMap,X=s.clearcoat>0,Y=s.iridescence>0,q=s.sheen>0,K=s.transmission>0,J=X&&!!s.clearcoatMap,Z=X&&!!s.clearcoatNormalMap,$=X&&!!s.clearcoatRoughnessMap,ee=Y&&!!s.iridescenceMap,te=Y&&!!s.iridescenceThicknessMap,ne=q&&!!s.sheenColorMap,re=q&&!!s.sheenRoughnessMap,ie=!!s.specularMap,se=!!s.specularColorMap,ae=!!s.specularIntensityMap,oe=K&&!!s.transmissionMap,le=K&&!!s.thicknessMap,ce=!!s.gradientMap,he=!!s.alphaMap,ue=s.alphaTest>0,de=!!s.extensions,pe=!!b.attributes.uv1,fe=!!b.attributes.uv2,me=!!b.attributes.uv3;return{isWebGL2:u,shaderID:M,shaderName:s.type,vertexShader:I,fragmentShader:B,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:P,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:F,instancingColor:F&&null!==y.instanceColor,supportsVertexTextures:f,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:Te,map:U,matcap:O,envMap:N,envMapMode:N&&S.mapping,envMapCubeUVHeight:w,aoMap:k,lightMap:G,bumpMap:z,normalMap:Q,displacementMap:f&&V,emissiveMap:H,normalMapObjectSpace:Q&&1===s.normalMapType,normalMapTangentSpace:Q&&0===s.normalMapType,metalnessMap:j,roughnessMap:W,clearcoat:X,clearcoatMap:J,clearcoatNormalMap:Z,clearcoatRoughnessMap:$,iridescence:Y,iridescenceMap:ee,iridescenceThicknessMap:te,sheen:q,sheenColorMap:ne,sheenRoughnessMap:re,specularMap:ie,specularColorMap:se,specularIntensityMap:ae,transmission:K,transmissionMap:oe,thicknessMap:le,gradientMap:ce,opaque:!1===s.transparent&&1===s.blending,alphaMap:he,alphaTest:ue,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:k&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:z&&A(s.bumpMap.channel),normalMapUv:Q&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:j&&A(s.metalnessMap.channel),roughnessMapUv:W&&A(s.roughnessMap.channel),clearcoatMapUv:J&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:Z&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:$&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ee&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:te&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ne&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:re&&A(s.sheenRoughnessMap.channel),specularMapUv:ie&&A(s.specularMap.channel),specularColorMapUv:se&&A(s.specularColorMap.channel),specularIntensityMapUv:ae&&A(s.specularIntensityMap.channel),transmissionMapUv:oe&&A(s.transmissionMap.channel),thicknessMapUv:le&&A(s.thicknessMap.channel),alphaMapUv:he&&A(s.alphaMap.channel),vertexTangents:Q&&!!b.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,vertexUv1s:pe,vertexUv2s:fe,vertexUv3s:me,pointsUvs:!0===y.isPoints&&!!b.attributes.uv&&(U||he),fog:!!x,useFog:!0===s.fog,fogExp2:x&&x.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:p,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:T,morphTextureStride:D,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:d,useLegacyLights:e.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:s.side===o,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:de&&!0===s.extensions.derivatives,extensionFragDepth:de&&!0===s.extensions.fragDepth,extensionDrawBuffers:de&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:de&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(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.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)}(n,t),function(e,t){l.disableAll(),t.isWebGL2&&l.enable(0);t.supportsVertexTextures&&l.enable(1);t.instancing&&l.enable(2);t.instancingColor&&l.enable(3);t.matcap&&l.enable(4);t.envMap&&l.enable(5);t.normalMapObjectSpace&&l.enable(6);t.normalMapTangentSpace&&l.enable(7);t.clearcoat&&l.enable(8);t.iridescence&&l.enable(9);t.alphaTest&&l.enable(10);t.vertexColors&&l.enable(11);t.vertexAlphas&&l.enable(12);t.vertexUv1s&&l.enable(13);t.vertexUv2s&&l.enable(14);t.vertexUv3s&&l.enable(15);t.vertexTangents&&l.enable(16);e.push(l.mask),l.disableAll(),t.fog&&l.enable(0);t.useFog&&l.enable(1);t.flatShading&&l.enable(2);t.logarithmicDepthBuffer&&l.enable(3);t.skinning&&l.enable(4);t.morphTargets&&l.enable(5);t.morphNormals&&l.enable(6);t.morphColors&&l.enable(7);t.premultipliedAlpha&&l.enable(8);t.shadowMapEnabled&&l.enable(9);t.useLegacyLights&&l.enable(10);t.doubleSided&&l.enable(11);t.flipSided&&l.enable(12);t.useDepthPacking&&l.enable(13);t.dithering&&l.enable(14);t.transmission&&l.enable(15);t.sheen&&l.enable(16);t.opaque&&l.enable(17);t.pointsUvs&&l.enable(18);e.push(l.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=g[e.type];let n;if(t){const e=ei[t];n=Lr.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,i=h.length;e<i;e++){const t=h[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new Js(e,n,t,s),h.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=h.indexOf(e);h[t]=h[h.length-1],h.pop(),e.destroy()}},releaseShaderCache:function(e){c.remove(e)},programs:h,dispose:function(){c.dispose()}}}function na(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function ra(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function ia(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function sa(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,a,o,l,c){const h=s(e,t,a,o,l,c);a.transmission>0?r.push(h):!0===a.transparent?i.push(h):n.push(h)},unshift:function(e,t,a,o,l,c){const h=s(e,t,a,o,l,c);a.transmission>0?r.unshift(h):!0===a.transparent?i.unshift(h):n.unshift(h)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||ra),r.length>1&&r.sort(t||ia),i.length>1&&i.sort(t||ia)}}}function aa(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new sa,e.set(t,[i])):n>=r.length?(i=new sa,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function oa(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Et,color:new Vn};break;case"SpotLight":n={position:new Et,direction:new Et,color:new Vn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Et,color:new Vn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Et,skyColor:new Vn,groundColor:new Vn};break;case"RectAreaLight":n={color:new Vn,position:new Et,halfWidth:new Et,halfHeight:new Et}}return e[t.id]=n,n}}}let la=0;function ca(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function ha(e,t){const n=new oa,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qe,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={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 l=0;l<9;l++)i.probe.push(new Et);const s=new Et,a=new Zt,o=new Zt;return{setup:function(s,a){let o=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,A=0,v=0,y=0;s.sort(ca);const x=!0===a?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],a=t.color,b=t.intensity,E=t.distance,_=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=a.r*b*x,l+=a.g*b*x,c+=a.b*b*x;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],b);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[h]=n,i.directionalShadowMap[h]=_,i.directionalShadowMatrix[h]=t.shadow.matrix,m++}i.directional[h]=e,h++}else if(t.isSpotLight){const e=n.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(a).multiplyScalar(b*x),e.distance=E,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[d]=e;const s=t.shadow;if(t.map&&(i.spotLightMap[v]=t.map,v++,s.updateMatrices(t),t.castShadow&&y++),i.spotLightMatrix[d]=s.matrix,t.castShadow){const e=r.get(t);e.shadowBias=s.bias,e.shadowNormalBias=s.normalBias,e.shadowRadius=s.radius,e.shadowMapSize=s.mapSize,i.spotShadow[d]=e,i.spotShadowMap[d]=_,A++}d++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(a).multiplyScalar(b),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=_,i.pointShadowMatrix[u]=t.shadow.matrix,g++}i.point[u]=e,u++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(b*x),e.groundColor.copy(t.groundColor).multiplyScalar(b*x),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=$r.LTC_FLOAT_1,i.rectAreaLTC2=$r.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=$r.LTC_HALF_1,i.rectAreaLTC2=$r.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=l,i.ambient[2]=c;const b=i.hash;b.directionalLength===h&&b.pointLength===u&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===A&&b.numSpotMaps===v||(i.directional.length=h,i.spot.length=d,i.rectArea.length=p,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=A+v-y,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=y,b.directionalLength=h,b.pointLength=u,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=A,b.numSpotMaps=v,i.version=la++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,h=0;const u=t.matrixWorldInverse;for(let d=0,p=e.length;d<p;d++){const t=e[d];if(t.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),n++}else if(t.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),l++}else if(t.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),o.identity(),a.copy(t.matrixWorld),a.premultiply(u),o.extractRotation(a),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),r++}else if(t.isHemisphereLight){const e=i.hemi[h];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(u),h++}}},state:i}}function ua(e,t){const n=new ha(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function da(e,t){let n=new WeakMap;return{get:function(r,i=0){const s=n.get(r);let a;return void 0===s?(a=new ua(e,t),n.set(r,[a])):i>=s.length?(a=new ua(e,t),s.push(a)):a=s[i],a},dispose:function(){n=new WeakMap}}}class pa extends Nn{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 fa extends Nn{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 ma(e,t,n){let i=new Yr;const l=new qe,c=new qe,h=new At,u=new pa({depthPacking:3201}),d=new fa,p={},f=n.maxTextureSize,m={[a]:o,[o]:a,2:2},g=new Fr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new qe},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 <packing>\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}"}),A=g.clone();A.defines.HORIZONTAL_PASS=1;const v=new hr;v.setAttribute("position",new $n(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Tr(v,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=r;let b=this.type;function E(n,r){const i=t.update(y);g.defines.VSM_SAMPLES!==n.blurSamples&&(g.defines.VSM_SAMPLES=n.blurSamples,A.defines.VSM_SAMPLES=n.blurSamples,g.needsUpdate=!0,A.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new vt(l.x,l.y)),g.uniforms.shadow_pass.value=n.map.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,g,y,null),A.uniforms.shadow_pass.value=n.mapPass.texture,A.uniforms.resolution.value=n.mapSize,A.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,A,y,null)}function _(t,n,r,i){let a=null;const o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?d:u,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=a.uuid,t=n.uuid;let r=p[e];void 0===r&&(r={},p[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:m[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=r}return a}function S(n,r,a,o,l){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===s)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let s=0,c=t.length;s<c;s++){const c=t[s],h=i[c.materialIndex];if(h&&h.visible){const t=_(n,h,o,l);e.renderBufferDirect(a,null,r,t,n,c)}}}else if(i.visible){const t=_(n,i,o,l);e.renderBufferDirect(a,null,r,t,n,null)}}const c=n.children;for(let e=0,t=c.length;e<t;e++)S(c[e],r,a,o,l)}this.render=function(t,n,r){if(!1===x.enabled)return;if(!1===x.autoUpdate&&!1===x.needsUpdate)return;if(0===t.length)return;const a=e.getRenderTarget(),o=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const p=b!==s&&this.type===s,m=b===s&&this.type!==s;for(let g=0,A=t.length;g<A;g++){const a=t[g],o=a.shadow;if(void 0===o){console.warn("THREE.WebGLShadowMap:",a,"has no shadow.");continue}if(!1===o.autoUpdate&&!1===o.needsUpdate)continue;l.copy(o.mapSize);const u=o.getFrameExtents();if(l.multiply(u),c.copy(o.mapSize),(l.x>f||l.y>f)&&(l.x>f&&(c.x=Math.floor(f/u.x),l.x=c.x*u.x,o.mapSize.x=c.x),l.y>f&&(c.y=Math.floor(f/u.y),l.y=c.y*u.y,o.mapSize.y=c.y)),null===o.map||!0===p||!0===m){const e=this.type!==s?{minFilter:C,magFilter:C}:{};null!==o.map&&o.map.dispose(),o.map=new vt(l.x,l.y,e),o.map.texture.name=a.name+".shadowMap",o.camera.updateProjectionMatrix()}e.setRenderTarget(o.map),e.clear();const A=o.getViewportCount();for(let e=0;e<A;e++){const t=o.getViewport(e);h.set(c.x*t.x,c.y*t.y,c.x*t.z,c.y*t.w),d.viewport(h),o.updateMatrices(a,e),i=o.getFrustum(),S(n,r,o.camera,a,this.type)}!0!==o.isPointLightShadow&&this.type===s&&E(o,r),o.needsUpdate=!1}b=this.type,x.needsUpdate=!1,e.setRenderTarget(a,o,u)}}function ga(e,t,n){const r=n.isWebGL2;const i=new function(){let t=!1;const n=new At;let r=null;const i=new At(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),n.set(t,r,s,a),!1===i.equals(n)&&(e.clearColor(t,r,s,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},s=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?Q(e.DEPTH_TEST):V(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},a=new function(){let t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?Q(e.STENCIL_TEST):V(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&s===a||(e.stencilFunc(t,n,a),r=t,i=n,s=a)},setOp:function(t,n,r){a===t&&o===n&&l===r||(e.stencilOp(t,n,r),a=t,o=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null}}},c=new WeakMap,h=new WeakMap;let u={},d={},p=new WeakMap,f=[],m=null,g=!1,A=null,v=null,y=null,x=null,b=null,E=null,_=null,S=!1,w=null,M=null,C=null,T=null,I=null;const B=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let R=!1,P=0;const D=e.getParameter(e.VERSION);-1!==D.indexOf("WebGL")?(P=parseFloat(/^WebGL (\d)/.exec(D)[1]),R=P>=1):-1!==D.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),R=P>=2);let L=null,F={};const U=e.getParameter(e.SCISSOR_BOX),O=e.getParameter(e.VIEWPORT),N=(new At).fromArray(U),k=(new At).fromArray(O);function G(t,n,i,s){const a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let l=0;l<i;l++)!r||t!==e.TEXTURE_3D&&t!==e.TEXTURE_2D_ARRAY?e.texImage2D(n+l,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage3D(n,0,e.RGBA,1,1,s,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const z={};function Q(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function V(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}z[e.TEXTURE_2D]=G(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=G(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(z[e.TEXTURE_2D_ARRAY]=G(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=G(e.TEXTURE_3D,e.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),s.setClear(1),a.setClear(0),Q(e.DEPTH_TEST),s.setFunc(3),X(!1),Y(1),Q(e.CULL_FACE),W(0);const H={[l]:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};if(r)H[103]=e.MIN,H[104]=e.MAX;else{const e=t.get("EXT_blend_minmax");null!==e&&(H[103]=e.MIN_EXT,H[104]=e.MAX_EXT)}const j={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA};function W(t,n,r,i,s,a,o,c){if(0!==t){if(!1===g&&(Q(e.BLEND),g=!0),5===t)s=s||n,a=a||r,o=o||i,n===v&&s===b||(e.blendEquationSeparate(H[n],H[s]),v=n,b=s),r===y&&i===x&&a===E&&o===_||(e.blendFuncSeparate(j[r],j[i],j[a],j[o]),y=r,x=i,E=a,_=o),A=t,S=!1;else if(t!==A||c!==S){if(v===l&&b===l||(e.blendEquation(e.FUNC_ADD),v=l,b=l),c)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}y=null,x=null,E=null,_=null,A=t,S=c}}else!0===g&&(V(e.BLEND),g=!1)}function X(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function Y(t){0!==t?(Q(e.CULL_FACE),t!==M&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):V(e.CULL_FACE),M=t}function q(t,n,r){t?(Q(e.POLYGON_OFFSET_FILL),T===n&&I===r||(e.polygonOffset(n,r),T=n,I=r)):V(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:s,stencil:a},enable:Q,disable:V,bindFramebuffer:function(t,n){return d[t]!==n&&(e.bindFramebuffer(t,n),d[t]=n,r&&(t===e.DRAW_FRAMEBUFFER&&(d[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(d[e.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let s=f,a=!1;if(r)if(s=p.get(i),void 0===s&&(s=[],p.set(i,s)),r.isWebGLMultipleRenderTargets){const t=r.texture;if(s.length!==t.length||s[0]!==e.COLOR_ATTACHMENT0){for(let n=0,r=t.length;n<r;n++)s[n]=e.COLOR_ATTACHMENT0+n;s.length=t.length,a=!0}}else s[0]!==e.COLOR_ATTACHMENT0&&(s[0]=e.COLOR_ATTACHMENT0,a=!0);else s[0]!==e.BACK&&(s[0]=e.BACK,a=!0);a&&(n.isWebGL2?e.drawBuffers(s):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(t){return m!==t&&(e.useProgram(t),m=t,!0)},setBlending:W,setMaterial:function(t,n){2===t.side?V(e.CULL_FACE):Q(e.CULL_FACE);let r=t.side===o;n&&(r=!r),X(r),1===t.blending&&!1===t.transparent?W(0):W(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),i.setMask(t.colorWrite);const l=t.stencilWrite;a.setTest(l),l&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),q(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?Q(e.SAMPLE_ALPHA_TO_COVERAGE):V(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:X,setCullFace:Y,setLineWidth:function(t){t!==C&&(R&&e.lineWidth(t),C=t)},setPolygonOffset:q,setScissorTest:function(t){t?Q(e.SCISSOR_TEST):V(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+B-1),L!==t&&(e.activeTexture(t),L=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===L?e.TEXTURE0+B-1:L);let i=F[r];void 0===i&&(i={type:void 0,texture:void 0},F[r]=i),i.type===t&&i.texture===n||(L!==r&&(e.activeTexture(r),L=r),e.bindTexture(t,n||z[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=F[L];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(t,n){let r=h.get(n);void 0===r&&(r=new WeakMap,h.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=h.get(n).get(t);c.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),c.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===N.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),N.copy(t))},viewport:function(t){!1===k.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),k.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),!0===r&&(e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),u={},L=null,F={},d={},p=new WeakMap,f=[],m=null,g=!1,A=null,v=null,y=null,x=null,b=null,E=null,_=null,S=!1,w=null,M=null,C=null,T=null,I=null,N.set(0,0,e.canvas.width,e.canvas.height),k.set(0,0,e.canvas.width,e.canvas.height),i.reset(),s.reset(),a.reset()}}}function Aa(e,t,n,r,i,s,a){const o=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,h=i.maxTextureSize,u=i.maxSamples,d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let A=!1;try{A="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(ae){}function v(e,t){return A?new OffscreenCanvas(e,t):tt("canvas")}function y(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?je:Math.floor,s=r(i*e.width),a=r(i*e.height);void 0===m&&(m=v(s,a));const o=n?v(s,a):m;o.width=s,o.height=a;return o.getContext("2d").drawImage(e,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return Ve(e.width)&&Ve(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==C&&e.minFilter!==B}function E(t){e.generateMipmap(t)}function _(n,r,i,s,a=!1){if(!1===o)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;return r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RGBA&&(i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=s===Ce&&!1===a?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)),l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function Q(e,t,n){return!0===b(e,n)||e.isFramebufferTexture&&e.minFilter!==C&&e.minFilter!==B?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 V(t){return t===C||t===T||t===I?e.NEAREST:e.LINEAR}function H(e){const t=e.target;t.removeEventListener("dispose",H),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=g.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&W(e),0===Object.keys(i).length&&g.delete(n)}r.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function j(t){const n=t.target;n.removeEventListener("dispose",j),function(t){const n=t.texture,i=r.get(t),s=r.get(n);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++)e.deleteFramebuffer(i.__webglFramebuffer[r]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[r]);else{if(e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let o=0,l=n.length;o<l;o++){const t=r.get(n[o]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),a.memory.textures--),r.remove(n[o])}r.remove(n),r.remove(t)}(n)}function W(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete g.get(i)[n.__cacheKey],a.memory.textures--}let X=0;function Y(t,i){const s=r.get(t);if(t.isVideoTexture&&function(e){const t=a.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__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 $(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const q={[S]:e.REPEAT,[w]:e.CLAMP_TO_EDGE,[M]:e.MIRRORED_REPEAT},K={[C]:e.NEAREST,[T]:e.NEAREST_MIPMAP_NEAREST,[I]:e.NEAREST_MIPMAP_LINEAR,[B]:e.LINEAR,[R]:e.LINEAR_MIPMAP_NEAREST,[P]:e.LINEAR_MIPMAP_LINEAR};function J(n,s,a){if(a?(e.texParameteri(n,e.TEXTURE_WRAP_S,q[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,q[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,q[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,K[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,K[s.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),s.wrapS===w&&s.wrapT===w||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,V(s.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,V(s.minFilter)),s.minFilter!==C&&s.minFilter!==B&&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 a=t.get("EXT_texture_filter_anisotropic");if(s.magFilter===C)return;if(s.minFilter!==I&&s.minFilter!==P)return;if(s.type===U&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&s.type===O&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||r.get(s).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy)}}function Z(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",H));const i=n.source;let s=g.get(i);void 0===s&&(s={},g.set(i,s));const o=function(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()}(n);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&W(n)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function $(t,i,a){let l=e.TEXTURE_2D;(i.isDataArrayTexture||i.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),i.isData3DTexture&&(l=e.TEXTURE_3D);const c=Z(t,i),u=i.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+a);const d=r.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+a),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=function(e){return!o&&(e.wrapS!==w||e.wrapT!==w||e.minFilter!==C&&e.minFilter!==B)}(i)&&!1===x(i.image);let r=y(i.image,t,!1,h);r=se(i,r);const p=x(r)||o,f=s.convert(i.format,i.colorSpace);let m,g=s.convert(i.type),A=_(i.internalFormat,f,g,i.colorSpace);J(l,i,p);const v=i.mipmaps,S=o&&!0!==i.isVideoTexture,M=void 0===d.__version||!0===c,T=Q(i,r,p);if(i.isDepthTexture)A=e.DEPTH_COMPONENT,o?A=i.type===U?e.DEPTH_COMPONENT32F:i.type===F?e.DEPTH_COMPONENT24:i.type===N?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:i.type===U&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===G&&A===e.DEPTH_COMPONENT&&i.type!==L&&i.type!==F&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=F,g=s.convert(i.type)),i.format===z&&A===e.DEPTH_COMPONENT&&(A=e.DEPTH_STENCIL,i.type!==N&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=N,g=s.convert(i.type))),M&&(S?n.texStorage2D(e.TEXTURE_2D,1,A,r.width,r.height):n.texImage2D(e.TEXTURE_2D,0,A,r.width,r.height,0,f,g,null));else if(i.isDataTexture)if(v.length>0&&p){S&&M&&n.texStorage2D(e.TEXTURE_2D,T,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],S?n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,f,g,m.data);i.generateMipmaps=!1}else S?(M&&n.texStorage2D(e.TEXTURE_2D,T,A,r.width,r.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,f,g,r.data)):n.texImage2D(e.TEXTURE_2D,0,A,r.width,r.height,0,f,g,r.data);else if(i.isCompressedTexture)if(i.isCompressedArrayTexture){S&&M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,T,A,v[0].width,v[0].height,r.depth);for(let t=0,s=v.length;t<s;t++)m=v[t],i.format!==k?null!==f?S?n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,r.depth,f,m.data,0,0):n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,A,m.width,m.height,r.depth,0,m.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S?n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,r.depth,f,g,m.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,A,m.width,m.height,r.depth,0,f,g,m.data)}else{S&&M&&n.texStorage2D(e.TEXTURE_2D,T,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],i.format!==k?null!==f?S?n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,m.data):n.compressedTexImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S?n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,f,g,m.data)}else if(i.isDataArrayTexture)S?(M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,T,A,r.width,r.height,r.depth),n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,r.width,r.height,r.depth,f,g,r.data)):n.texImage3D(e.TEXTURE_2D_ARRAY,0,A,r.width,r.height,r.depth,0,f,g,r.data);else if(i.isData3DTexture)S?(M&&n.texStorage3D(e.TEXTURE_3D,T,A,r.width,r.height,r.depth),n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,r.width,r.height,r.depth,f,g,r.data)):n.texImage3D(e.TEXTURE_3D,0,A,r.width,r.height,r.depth,0,f,g,r.data);else if(i.isFramebufferTexture){if(M)if(S)n.texStorage2D(e.TEXTURE_2D,T,A,r.width,r.height);else{let t=r.width,i=r.height;for(let r=0;r<T;r++)n.texImage2D(e.TEXTURE_2D,r,A,t,i,0,f,g,null),t>>=1,i>>=1}}else if(v.length>0&&p){S&&M&&n.texStorage2D(e.TEXTURE_2D,T,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],S?n.texSubImage2D(e.TEXTURE_2D,t,0,0,f,g,m):n.texImage2D(e.TEXTURE_2D,t,A,f,g,m);i.generateMipmaps=!1}else S?(M&&n.texStorage2D(e.TEXTURE_2D,T,A,r.width,r.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,f,g,r)):n.texImage2D(e.TEXTURE_2D,0,A,f,g,r);b(i,p)&&E(l),d.__version=u.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function ee(t,i,a,o,l){const c=s.convert(a.format,a.colorSpace),h=s.convert(a.type),u=_(a.internalFormat,c,h,a.colorSpace);r.get(i).__hasExternalTextures||(l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,0,u,i.width,i.height,i.depth,0,c,h,null):n.texImage2D(l,0,u,i.width,i.height,0,c,h,null)),n.bindFramebuffer(e.FRAMEBUFFER,t),ie(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,r.get(a).__webglTexture,0,re(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,l,r.get(a).__webglTexture,0),n.bindFramebuffer(e.FRAMEBUFFER,null)}function te(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let i=e.DEPTH_COMPONENT16;if(r||ie(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===U?i=e.DEPTH_COMPONENT32F:t.type===F&&(i=e.DEPTH_COMPONENT24));const r=re(n);ie(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,r,i,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,r,i,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,i,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=re(n);r&&!1===ie(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):ie(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i<t.length;i++){const a=t[i],o=s.convert(a.format,a.colorSpace),l=s.convert(a.type),c=_(a.internalFormat,o,l,a.colorSpace),h=re(n);r&&!1===ie(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,h,c,n.width,n.height):ie(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,h,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function ne(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),Y(i.depthTexture,0);const s=r.get(i.depthTexture).__webglTexture,a=re(i);if(i.depthTexture.format===G)ie(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,a):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else{if(i.depthTexture.format!==z)throw new Error("Unknown depthTexture format");ie(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,a):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),te(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),te(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function re(e){return Math.min(u,e.samples)}function ie(e){const n=r.get(e);return o&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function se(e,n){const r=e.colorSpace,i=e.format,s=e.type;return!0===e.isCompressedTexture||e.format===De||r!==Te&&r!==Me&&(r===Ce?!1===o?!0===t.has("EXT_sRGB")&&i===k?(e.format=De,e.minFilter=B,e.generateMipmaps=!1):n=dt.sRGBToLinear(n):i===k&&s===D||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}this.allocateTextureUnit=function(){const e=X;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),X+=1,e},this.resetTextureUnits=function(){X=0},this.setTexture2D=Y,this.setTexture2DArray=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?$(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?$(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,i,a){if(6!==i.image.length)return;const l=Z(t,i),h=i.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+a);const u=r.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+a),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=i.isCompressedTexture||i.image[0].isCompressedTexture,r=i.image[0]&&i.image[0].isDataTexture,d=[];for(let e=0;e<6;e++)d[e]=t||r?r?i.image[e].image:i.image[e]:y(i.image[e],!1,!0,c),d[e]=se(i,d[e]);const p=d[0],f=x(p)||o,m=s.convert(i.format,i.colorSpace),g=s.convert(i.type),A=_(i.internalFormat,m,g,i.colorSpace),v=o&&!0!==i.isVideoTexture,S=void 0===u.__version||!0===l;let w,M=Q(i,p,f);if(J(e.TEXTURE_CUBE_MAP,i,f),t){v&&S&&n.texStorage2D(e.TEXTURE_CUBE_MAP,M,A,p.width,p.height);for(let t=0;t<6;t++){w=d[t].mipmaps;for(let r=0;r<w.length;r++){const s=w[r];i.format!==k?null!==m?v?n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,s.width,s.height,m,s.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,A,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,s.width,s.height,m,g,s.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,A,s.width,s.height,0,m,g,s.data)}}}else{w=i.mipmaps,v&&S&&(w.length>0&&M++,n.texStorage2D(e.TEXTURE_CUBE_MAP,M,A,d[0].width,d[0].height));for(let t=0;t<6;t++)if(r){v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,d[t].width,d[t].height,m,g,d[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,A,d[t].width,d[t].height,0,m,g,d[t].data);for(let r=0;r<w.length;r++){const i=w[r].image[t].image;v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,m,g,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,A,i.width,i.height,0,m,g,i.data)}}else{v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m,g,d[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,A,m,g,d[t]);for(let r=0;r<w.length;r++){const i=w[r];v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,m,g,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,A,m,g,i.image[t])}}}b(i,f)&&E(e.TEXTURE_CUBE_MAP),u.__version=h.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(a,t,i):n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)},this.rebindTextures=function(t,n,i){const s=r.get(t);void 0!==n&&ee(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),void 0!==i&&ne(t)},this.setupRenderTarget=function(t){const l=t.texture,c=r.get(t),h=r.get(l);t.addEventListener("dispose",j),!0!==t.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=e.createTexture()),h.__version=l.version,a.memory.textures++);const u=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=x(t)||o;if(u){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&t.samples>0&&!1===ie(t)){const r=d?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<r.length;n++){const i=r[n];c.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const a=s.convert(i.format,i.colorSpace),o=s.convert(i.type),l=_(i.internalFormat,a,o,i.colorSpace,!0===t.isXRRenderTarget),h=re(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,h,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,c.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),te(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,h.__webglTexture),J(e.TEXTURE_CUBE_MAP,l,p);for(let n=0;n<6;n++)ee(c.__webglFramebuffer[n],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n);b(l,p)&&E(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){const i=t.texture;for(let s=0,a=i.length;s<a;s++){const a=i[s],o=r.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),J(e.TEXTURE_2D,a,p),ee(c.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+s,e.TEXTURE_2D),b(a,p)&&E(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(o?r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,h.__webglTexture),J(r,l,p),ee(c.__webglFramebuffer,t,l,e.COLOR_ATTACHMENT0,r),b(l,p)&&E(r),n.unbindTexture()}t.depthBuffer&&ne(t)},this.updateRenderTargetMipmap=function(t){const i=x(t)||o,s=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let a=0,o=s.length;a<o;a++){const o=s[a];if(b(o,i)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=r.get(o).__webglTexture;n.bindTexture(i,s),E(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(o&&t.samples>0&&!1===ie(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,a=t.height;let o=e.COLOR_BUFFER_BIT;const l=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=r.get(t),u=!0===t.isWebGLMultipleRenderTargets;if(u)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let n=0;n<i.length;n++){l.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&l.push(c);const d=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===d&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),u&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,h.__webglColorRenderbuffer[n]),!0===d&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[c]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[c])),u){const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,e.NEAREST),p&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,h.__webglColorRenderbuffer[t]);const s=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=ne,this.setupFrameBufferTexture=ee,this.useMultisampledRTT=ie}function va(e,t,n){const r=n.isWebGL2;return{convert:function(n,i=""){let s;if(n===D)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===L)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(n===F)return e.UNSIGNED_INT;if(n===U)return e.FLOAT;if(n===O)return r?e.HALF_FLOAT:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(1021===n)return e.ALPHA;if(n===k)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===G)return e.DEPTH_COMPONENT;if(n===z)return e.DEPTH_STENCIL;if(n===De)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(n===Q||n===V||n===H||n===j)if(i===Ce){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(n===Q)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===V)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===H)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===j)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(n===Q)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===V)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===H)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===j)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===W||n===X||n===Y||n===q){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(n===W)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===X)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Y)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===q)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===K||n===J){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(n===K)return i===Ce?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===J)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(n===Z||n===$||n===ee||n===te||n===ne||n===re||n===ie||n===se||n===ae||n===oe||n===le||n===ce||n===he||n===ue){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(n===Z)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===$)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ee)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===te)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ne)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===re)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ie)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===se)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ae)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===oe)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===le)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ce)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===he)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===ue)return i===Ce?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===de){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(n===de)return i===Ce?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(36283===n||n===pe||n===fe||n===me){if(s=t.get("EXT_texture_compression_rgtc"),null===s)return null;if(n===de)return s.COMPRESSED_RED_RGTC1_EXT;if(n===pe)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===fe)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===me)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===N?r?e.UNSIGNED_INT_24_8:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}class ya extends Or{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class xa extends Sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const ba={type:"move"};class Ea{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new xa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new xa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Et,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Et),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new xa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Et,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Et),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const s of e.hand.values()){const e=t.getJointPose(s,n),r=this._getHandJoint(l,s);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],a=r.position.distanceTo(i.position),o=.02,c=.005;l.inputState.pinching&&a>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(ba)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new xa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class _a extends gt{constructor(e,t,n,r,i,s,a,o,l,c){if((c=void 0!==c?c:G)!==G&&c!==z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===G&&(n=F),void 0===n&&c===z&&(n=N),super(null,r,i,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:C,this.minFilter=void 0!==o?o:C,this.flipY=!1,this.generateMipmaps=!1}}class Sa extends Le{constructor(e,t){super();const n=this;let r=null,i=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=t.getContextAttributes();let m=null,g=null;const A=[],v=[],y=new Set,x=new Map,b=new Or;b.layers.enable(1),b.viewport=new At;const E=new Or;E.layers.enable(2),E.viewport=new At;const _=[b,E],S=new ya;S.layers.enable(1),S.layers.enable(2);let w=null,M=null;function C(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const n=A[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||s),n.dispatchEvent({type:e.type,data:e.inputSource}))}function T(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",T),r.removeEventListener("inputsourceschange",I);for(let e=0;e<A.length;e++){const t=v[e];null!==t&&(v[e]=null,A[e].disconnect(t))}w=null,M=null,e.setRenderTarget(m),d=null,u=null,h=null,r=null,g=null,U.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function I(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=v.indexOf(n);r>=0&&(v[r]=null,A[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=v.indexOf(n);if(-1===r){for(let e=0;e<A.length;e++){if(e>=v.length){v.push(n),r=e;break}if(null===v[e]){v[e]=n,r=e;break}}if(-1===r)break}const i=A[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=A[e];return void 0===t&&(t=new Ea,A[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=A[e];return void 0===t&&(t=new Ea,A[e]=t),t.getGripSpace()},this.getHand=function(e){let t=A[e];return void 0===t&&(t=new Ea,A[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(c){if(r=c,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",T),r.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),g=new vt(d.framebufferWidth,d.framebufferHeight,{format:k,type:D,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=f.stencil?z:G,s=f.stencil?N:F);const o={colorFormat:t.RGBA8,depthFormat:a,scaleFactor:i};h=new XRWebGLBinding(r,t),u=h.createProjectionLayer(o),r.updateRenderState({layers:[u]}),g=new vt(u.textureWidth,u.textureHeight,{format:k,type:D,depthTexture:new _a(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0});e.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await r.requestReferenceSpace(a),U.setContext(r),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const B=new Et,R=new Et;function P(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===r)return;S.near=E.near=b.near=e.near,S.far=E.far=b.far=e.far,w===S.near&&M===S.far||(r.updateRenderState({depthNear:S.near,depthFar:S.far}),w=S.near,M=S.far);const t=e.parent,n=S.cameras;P(S,t);for(let r=0;r<n.length;r++)P(n[r],t);2===n.length?function(e,t,n){B.setFromMatrixPosition(t.matrixWorld),R.setFromMatrixPosition(n.matrixWorld);const r=B.distanceTo(R),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],h=(i[8]-1)/i[0],u=(s[8]+1)/s[0],d=a*h,p=a*u,f=r/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=a+f,A=o+f,v=d-m,y=p+(r-m),x=l*o/A*g,b=c*o/A*g;e.projectionMatrix.makePerspective(v,y,x,b,g,A),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(S,b,E):S.projectionMatrix.copy(b.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0);const r=e.children;for(let i=0,s=r.length;i<s;i++)r[i].updateMatrixWorld(!0);e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*Ne*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,S,t)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==u||null!==d)return o},this.setFoveation=function(e){o=e,null!==u&&(u.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.getPlanes=function(){return y};let L=null;const U=new qr;U.setAnimationLoop((function(t,r){if(c=r.getViewerPose(l||s),p=r,null!==c){const t=c.views;null!==d&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let n=!1;t.length!==S.cameras.length&&(S.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==d)s=d.getViewport(i);else{const t=h.getViewSubImage(u,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,u.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let a=_[r];void 0===a&&(a=new Or,a.layers.enable(r),a.viewport=new At,_[r]=a),a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(i.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&(S.matrix.copy(a.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),!0===n&&S.cameras.push(a)}}for(let e=0;e<A.length;e++){const t=v[e],n=A[e];null!==t&&void 0!==n&&n.update(t,r,l||s)}if(L&&L(t,r),r.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:r.detectedPlanes});let e=null;for(const t of y)r.detectedPlanes.has(t)||(null===e&&(e=[]),e.push(t));if(null!==e)for(const t of e)y.delete(t),x.delete(t),n.dispatchEvent({type:"planeremoved",data:t});for(const t of r.detectedPlanes)if(y.has(t)){const e=x.get(t);t.lastChangedTime>e&&(x.set(t,t.lastChangedTime),n.dispatchEvent({type:"planechanged",data:t}))}else y.add(t),x.set(t,r.lastChangedTime),n.dispatchEvent({type:"planeadded",data:t})}p=null})),this.setAnimationLoop=function(e){L=e},this.dispose=function(){}}}function wa(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===o&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===o&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const s=t.get(i).envMap;if(s&&(r.envMap.value=s,r.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const t=!0===e.useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*t,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Dr(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,s,a,l){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,r){e.metalness.value=r.metalness,r.metalnessMap&&(e.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,e.metalnessMapTransform));e.roughness.value=r.roughness,r.roughnessMap&&(e.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,e.roughnessMapTransform));const i=t.get(r).envMap;i&&(e.envMapIntensity.value=r.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){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,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(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,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(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,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,l)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,a):i.isSpriteMaterial?function(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,n(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 Ma(e,t,n,r){let i={},s={},a=[];const o=n.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,n){const r=e.value;if(void 0===n[t]){if("number"==typeof r)n[t]=r;else{const e=Array.isArray(r)?r:[r],i=[];for(let t=0;t<e.length;t++)i.push(e[t].clone());n[t]=i}return!0}if("number"==typeof r){if(n[t]!==r)return n[t]=r,!0}else{const e=Array.isArray(n[t])?n[t]:[n[t]],i=Array.isArray(r)?r:[r];for(let t=0;t<e.length;t++){const n=e[t];if(!1===n.equals(i[t]))return n.copy(i[t]),!0}}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function h(t){const n=t.target;n.removeEventListener("dispose",h);const r=a.indexOf(n.__bindingPointIndex);a.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,u){let d=i[n.id];void 0===d&&(!function(e){const t=e.uniforms;let n=0;const r=16;let i=0;for(let s=0,a=t.length;s<a;s++){const e=t[s],a={boundary:0,storage:0},o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,n=o.length;t<n;t++){const e=c(o[t]);a.boundary+=e.boundary,a.storage+=e.storage}if(e.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,s>0){i=n%r;0!==i&&r-i-a.boundary<0&&(n+=r-i,e.__offset=n)}n+=a.storage}i=n%r,i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),d=function(t){const n=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=d,n.addEventListener("dispose",h));const p=u.program;r.updateUBOMapping(n,p);const f=t.render.frame;s[n.id]!==f&&(!function(t){const n=i[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let i=0,a=r.length;i<a;i++){const t=r[i];if(!0===l(t,i,s)){const n=t.__offset,r=Array.isArray(t.value)?t.value:[t.value];let i=0;for(let s=0;s<r.length;s++){const a=r[s],o=c(a);"number"==typeof a?(t.__data[0]=a,e.bufferSubData(e.UNIFORM_BUFFER,n+i,t.__data)):a.isMatrix3?(t.__data[0]=a.elements[0],t.__data[1]=a.elements[1],t.__data[2]=a.elements[2],t.__data[3]=a.elements[0],t.__data[4]=a.elements[3],t.__data[5]=a.elements[4],t.__data[6]=a.elements[5],t.__data[7]=a.elements[0],t.__data[8]=a.elements[6],t.__data[9]=a.elements[7],t.__data[10]=a.elements[8],t.__data[11]=a.elements[0]):(a.toArray(t.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=f)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);a=[],i={},s={}}}}function Ca(){const e=tt("canvas");return e.style.display="block",e}class Ta{constructor(e={}){const{canvas:t=Ca(),context:r=null,depth:i=!0,stencil:s=!0,alpha:l=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:f=!1}=e;let m;this.isWebGLRenderer=!0,m=null!==r?r.getContextAttributes().alpha:l;let g=null,A=null;const v=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=Ce,this.useLegacyLights=!0,this.toneMapping=d,this.toneMappingExposure=1;const x=this;let b=!1,E=0,_=0,S=null,w=-1,M=null;const C=new At,T=new At;let I=null,B=t.width,R=t.height,L=1,F=null,N=null;const G=new At(0,0,B,R),z=new At(0,0,B,R);let Q=!1;const V=new Yr;let H=!1,j=!1,W=null;const X=new Zt,Y=new Et,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function K(){return null===S?L:1}let J,Z,$,ee,te,ne,re,ie,se,ae,oe,le,ce,he,ue,de,pe,fe,me,ge,Ae,ve,ye,xe,be=r;function Ee(e,n){for(let r=0;r<e.length;r++){const i=e[r],s=t.getContext(i,n);if(null!==s)return s}return null}try{const e={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:p,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${n}`),t.addEventListener("webglcontextlost",we,!1),t.addEventListener("webglcontextrestored",Me,!1),t.addEventListener("webglcontextcreationerror",Ie,!1),null===be){const t=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&t.shift(),be=Ee(t,e),null===be)throw Ee(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===be.getShaderPrecisionFormat&&(be.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ze){throw console.error("THREE.WebGLRenderer: "+ze.message),ze}function _e(){J=new Si(be),Z=new si(be,J,e),J.init(Z),ve=new va(be,J,Z),$=new ga(be,J,Z),ee=new Ci(be),te=new na,ne=new Aa(be,J,$,te,Z,ve,ee),re=new oi(x),ie=new _i(x),se=new Kr(be,Z),ye=new ri(be,J,se,Z),ae=new wi(be,se,ee,ye),oe=new Ri(be,ae,se,ee),me=new Bi(be,Z,ne),de=new ai(te),le=new ta(x,re,ie,J,Z,ye,de),ce=new wa(x,te),he=new aa,ue=new da(J,Z),fe=new ni(x,re,ie,$,oe,m,h),pe=new ma(x,oe,Z),xe=new Ma(be,ee,Z,$),ge=new ii(be,J,ee,Z),Ae=new Mi(be,J,ee,Z),ee.programs=le.programs,x.capabilities=Z,x.extensions=J,x.properties=te,x.renderLists=he,x.shadowMap=pe,x.state=$,x.info=ee}_e();const Se=new Sa(x,be);function we(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const e=ee.autoReset,t=pe.enabled,n=pe.autoUpdate,r=pe.needsUpdate,i=pe.type;_e(),ee.autoReset=e,pe.enabled=t,pe.autoUpdate=n,pe.needsUpdate=r,pe.type=i}function Ie(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Be(e){const t=e.target;t.removeEventListener("dispose",Be),function(e){(function(e){const t=te.get(e).programs;void 0!==t&&(t.forEach((function(e){le.releaseProgram(e)})),e.isShaderMaterial&&le.releaseShaderCache(e))})(e),te.remove(e)}(t)}this.xr=Se,this.getContext=function(){return be},this.getContextAttributes=function(){return be.getContextAttributes()},this.forceContextLoss=function(){const e=J.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=J.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(e){void 0!==e&&(L=e,this.setSize(B,R,!1))},this.getSize=function(e){return e.set(B,R)},this.setSize=function(e,n,r=!0){Se.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(B=e,R=n,t.width=Math.floor(e*L),t.height=Math.floor(n*L),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(B*L,R*L).floor()},this.setDrawingBufferSize=function(e,n,r){B=e,R=n,L=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(C)},this.getViewport=function(e){return e.copy(G)},this.setViewport=function(e,t,n,r){e.isVector4?G.set(e.x,e.y,e.z,e.w):G.set(e,t,n,r),$.viewport(C.copy(G).multiplyScalar(L).floor())},this.getScissor=function(e){return e.copy(z)},this.setScissor=function(e,t,n,r){e.isVector4?z.set(e.x,e.y,e.z,e.w):z.set(e,t,n,r),$.scissor(T.copy(z).multiplyScalar(L).floor())},this.getScissorTest=function(){return Q},this.setScissorTest=function(e){$.setScissorTest(Q=e)},this.setOpaqueSort=function(e){F=e},this.setTransparentSort=function(e){N=e},this.getClearColor=function(e){return e.copy(fe.getClearColor())},this.setClearColor=function(){fe.setClearColor.apply(fe,arguments)},this.getClearAlpha=function(){return fe.getClearAlpha()},this.setClearAlpha=function(){fe.setClearAlpha.apply(fe,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;e&&(r|=be.COLOR_BUFFER_BIT),t&&(r|=be.DEPTH_BUFFER_BIT),n&&(r|=be.STENCIL_BUFFER_BIT),be.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",we,!1),t.removeEventListener("webglcontextrestored",Me,!1),t.removeEventListener("webglcontextcreationerror",Ie,!1),he.dispose(),ue.dispose(),te.dispose(),re.dispose(),ie.dispose(),oe.dispose(),ye.dispose(),xe.dispose(),le.dispose(),Se.dispose(),Se.removeEventListener("sessionstart",Pe),Se.removeEventListener("sessionend",De),W&&(W.dispose(),W=null),Le.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=q);const a=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,n,r,i){!0!==t.isScene&&(t=q);ne.resetTextureUnits();const s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Te,l=(r.isMeshStandardMaterial?ie:re).get(r.envMap||a),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!r.normalMap&&!!n.attributes.tangent,u=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,f=!!n.morphAttributes.color,m=r.toneMapped?x.toneMapping:d,g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,y=te.get(r),b=A.state.lights;if(!0===H&&(!0===j||e!==M)){const t=e===M&&r.id===w;de.setState(r,e,t)}let E=!1;r.version===y.__version?y.needsLights&&y.lightsStateVersion!==b.state.version||y.outputColorSpace!==o||i.isInstancedMesh&&!1===y.instancing?E=!0:i.isInstancedMesh||!0!==y.instancing?i.isSkinnedMesh&&!1===y.skinning?E=!0:i.isSkinnedMesh||!0!==y.skinning?y.envMap!==l||!0===r.fog&&y.fog!==s?E=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===de.numPlanes&&y.numIntersection===de.numIntersection?(y.vertexAlphas!==c||y.vertexTangents!==h||y.morphTargets!==u||y.morphNormals!==p||y.morphColors!==f||y.toneMapping!==m||!0===Z.isWebGL2&&y.morphTargetsCount!==v)&&(E=!0):E=!0:E=!0:E=!0:(E=!0,y.__version=r.version);let _=y.currentProgram;!0===E&&(_=ke(r,t,i));let C=!1,T=!1,I=!1;const B=_.getUniforms(),P=y.uniforms;$.useProgram(_.program)&&(C=!0,T=!0,I=!0);r.id!==w&&(w=r.id,T=!0);if(C||M!==e){if(B.setValue(be,"projectionMatrix",e.projectionMatrix),Z.logarithmicDepthBuffer&&B.setValue(be,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),M!==e&&(M=e,T=!0,I=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=B.map.cameraPosition;void 0!==t&&t.setValue(be,Y.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&B.setValue(be,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&B.setValue(be,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){B.setOptional(be,i,"bindMatrix"),B.setOptional(be,i,"bindMatrixInverse");const e=i.skeleton;e&&(Z.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),B.setValue(be,"boneTexture",e.boneTexture,ne),B.setValue(be,"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 D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===Z.isWebGL2)&&me.update(i,n,_);(T||y.receiveShadow!==i.receiveShadow)&&(y.receiveShadow=i.receiveShadow,B.setValue(be,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);T&&(B.setValue(be,"toneMappingExposure",x.toneMappingExposure),y.needsLights&&(U=I,(F=P).ambientLightColor.needsUpdate=U,F.lightProbe.needsUpdate=U,F.directionalLights.needsUpdate=U,F.directionalLightShadows.needsUpdate=U,F.pointLights.needsUpdate=U,F.pointLightShadows.needsUpdate=U,F.spotLights.needsUpdate=U,F.spotLightShadows.needsUpdate=U,F.rectAreaLights.needsUpdate=U,F.hemisphereLights.needsUpdate=U),s&&!0===r.fog&&ce.refreshFogUniforms(P,s),ce.refreshMaterialUniforms(P,r,L,R,W),Fs.upload(be,y.uniformsList,P,ne));var F,U;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Fs.upload(be,y.uniformsList,P,ne),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&B.setValue(be,"center",i.center);if(B.setValue(be,"modelViewMatrix",i.modelViewMatrix),B.setValue(be,"normalMatrix",i.normalMatrix),B.setValue(be,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++)if(Z.isWebGL2){const n=e[t];xe.update(n,_),xe.bind(n,_)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return _}(e,t,n,r,i);$.setMaterial(r,a);let l=n.index,c=1;!0===r.wireframe&&(l=ae.getWireframeAttribute(n),c=2);const h=n.drawRange,u=n.attributes.position;let p=h.start*c,f=(h.start+h.count)*c;null!==s&&(p=Math.max(p,s.start*c),f=Math.min(f,(s.start+s.count)*c)),null!==l?(p=Math.max(p,0),f=Math.min(f,l.count)):null!=u&&(p=Math.max(p,0),f=Math.min(f,u.count));const m=f-p;if(m<0||m===1/0)return;let g;ye.setup(i,r,o,n,l);let v=ge;if(null!==l&&(g=se.get(l),v=Ae,v.setIndex(g)),i.isMesh)!0===r.wireframe?($.setLineWidth(r.wireframeLinewidth*K()),v.setMode(be.LINES)):v.setMode(be.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),$.setLineWidth(e*K()),i.isLineSegments?v.setMode(be.LINES):i.isLineLoop?v.setMode(be.LINE_LOOP):v.setMode(be.LINE_STRIP)}else i.isPoints?v.setMode(be.POINTS):i.isSprite&&v.setMode(be.TRIANGLES);if(i.isInstancedMesh)v.renderInstances(p,m,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(p,m,t)}else v.render(p,m)},this.compile=function(e,t){function n(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=o,e.needsUpdate=!0,ke(e,t,n),e.side=a,e.needsUpdate=!0,ke(e,t,n),e.side=2):ke(e,t,n)}A=ue.get(e),A.init(),y.push(A),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(A.pushLight(e),e.castShadow&&A.pushShadow(e))})),A.setupLights(x.useLegacyLights),e.traverse((function(t){const r=t.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){n(r[i],e,t)}else n(r,e,t)})),y.pop(),A=null};let Re=null;function Pe(){Le.stop()}function De(){Le.start()}const Le=new qr;function Fe(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)A.pushLight(e),e.castShadow&&A.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||V.intersectsSprite(e)){r&&Y.setFromMatrixPosition(e.matrixWorld).applyMatrix4(X);const t=oe.update(e),i=e.material;i.visible&&g.push(e,t,i,n,Y.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||V.intersectsObject(e))){e.isSkinnedMesh&&e.skeleton.frame!==ee.render.frame&&(e.skeleton.update(),e.skeleton.frame=ee.render.frame);const t=oe.update(e),i=e.material;if(r&&(null===t.boundingSphere&&t.computeBoundingSphere(),Y.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(X)),Array.isArray(i)){const r=t.groups;for(let s=0,a=r.length;s<a;s++){const a=r[s],o=i[a.materialIndex];o&&o.visible&&g.push(e,t,o,n,Y.z,a)}}else i.visible&&g.push(e,t,i,n,Y.z,null)}const i=e.children;for(let s=0,a=i.length;s<a;s++)Fe(i[s],t,n,r)}function Ue(e,t,n,r){const i=e.opaque,s=e.transmissive,a=e.transparent;A.setupLightsView(n),!0===H&&de.setGlobalState(x.clippingPlanes,n),s.length>0&&function(e,t,n,r){if(null===W){const e=Z.isWebGL2;W=new vt(1024,1024,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")?O:D,minFilter:P,samples:e&&!0===c?4:0})}const i=x.getRenderTarget();x.setRenderTarget(W),x.clear();const s=x.toneMapping;x.toneMapping=d,Oe(e,n,r),ne.updateMultisampleRenderTarget(W),ne.updateRenderTargetMipmap(W);let a=!1;for(let l=0,c=t.length;l<c;l++){const e=t[l],i=e.object,s=e.geometry,c=e.material,h=e.group;if(2===c.side&&i.layers.test(r.layers)){const e=c.side;c.side=o,c.needsUpdate=!0,Ne(i,n,r,s,c,h),c.side=e,c.needsUpdate=!0,a=!0}}!0===a&&(ne.updateMultisampleRenderTarget(W),ne.updateRenderTargetMipmap(W));x.setRenderTarget(i),x.toneMapping=s}(i,s,t,n),r&&$.viewport(C.copy(r)),i.length>0&&Oe(i,t,n),s.length>0&&Oe(s,t,n),a.length>0&&Oe(a,t,n),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Oe(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.object,o=s.geometry,l=null===r?s.material:r,c=s.group;a.layers.test(n.layers)&&Ne(a,t,n,o,l,c)}}function Ne(e,t,n,r,i,s){e.onBeforeRender(x,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(x,t,n,r,e,s),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=o,i.needsUpdate=!0,x.renderBufferDirect(n,t,r,i,e,s),i.side=a,i.needsUpdate=!0,x.renderBufferDirect(n,t,r,i,e,s),i.side=2):x.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(x,t,n,r,i,s)}function ke(e,t,n){!0!==t.isScene&&(t=q);const r=te.get(e),i=A.state.lights,s=A.state.shadowsArray,a=i.state.version,o=le.getParameters(e,i.state,s,t,n),l=le.getProgramCacheKey(o);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ie:re).get(e.envMap||r.environment),void 0===c&&(e.addEventListener("dispose",Be),c=new Map,r.programs=c);let h=c.get(l);if(void 0!==h){if(r.currentProgram===h&&r.lightsStateVersion===a)return Ge(e,o),h}else o.uniforms=le.getUniforms(e),e.onBuild(n,o,x),e.onBeforeCompile(o,x),h=le.acquireProgram(o,l),c.set(l,h),r.uniforms=o.uniforms;const u=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(u.clippingPlanes=de.uniform),Ge(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=h.getUniforms(),p=Fs.seqWithValue(d.seq,u);return r.currentProgram=h,r.uniformsList=p,h}function Ge(e,t){const n=te.get(e);n.outputColorSpace=t.outputColorSpace,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Le.setAnimationLoop((function(e){Re&&Re(e)})),"undefined"!=typeof self&&Le.setContext(self),this.setAnimationLoop=function(e){Re=e,Se.setAnimationLoop(e),null===e?Le.stop():Le.start()},Se.addEventListener("sessionstart",Pe),Se.addEventListener("sessionend",De),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Se.enabled&&!0===Se.isPresenting&&(!0===Se.cameraAutoUpdate&&Se.updateCamera(t),t=Se.getCamera()),!0===e.isScene&&e.onBeforeRender(x,e,t,S),A=ue.get(e,y.length),A.init(),y.push(A),X.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),V.setFromProjectionMatrix(X),j=this.localClippingEnabled,H=de.init(this.clippingPlanes,j),g=he.get(e,v.length),g.init(),v.push(g),Fe(e,t,0,x.sortObjects),g.finish(),!0===x.sortObjects&&g.sort(F,N),!0===H&&de.beginShadows();const n=A.state.shadowsArray;if(pe.render(n,e,t),!0===H&&de.endShadows(),!0===this.info.autoReset&&this.info.reset(),fe.render(g,e),A.setupLights(x.useLegacyLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Ue(g,e,r,r.viewport)}}else Ue(g,e,t);null!==S&&(ne.updateMultisampleRenderTarget(S),ne.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(x,e,t),ye.resetDefaultState(),w=-1,M=null,y.pop(),A=y.length>0?y[y.length-1]:null,v.pop(),g=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){te.get(e.texture).__webglTexture=t,te.get(e.depthTexture).__webglTexture=n;const r=te.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=te.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){S=e,E=t,_=n;let r=!0,i=null,s=!1,a=!1;if(e){const n=te.get(e);void 0!==n.__useDefaultFramebuffer?($.bindFramebuffer(be.FRAMEBUFFER,null),r=!1):void 0===n.__webglFramebuffer?ne.setupRenderTarget(e):n.__hasExternalTextures&&ne.rebindTextures(e,te.get(e.texture).__webglTexture,te.get(e.depthTexture).__webglTexture);const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=te.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=l[t],s=!0):i=Z.isWebGL2&&e.samples>0&&!1===ne.useMultisampledRTT(e)?te.get(e).__webglMultisampledFramebuffer:l,C.copy(e.viewport),T.copy(e.scissor),I=e.scissorTest}else C.copy(G).multiplyScalar(L).floor(),T.copy(z).multiplyScalar(L).floor(),I=Q;if($.bindFramebuffer(be.FRAMEBUFFER,i)&&Z.drawBuffers&&r&&$.drawBuffers(e,i),$.viewport(C),$.scissor(T),$.setScissorTest(I),s){const r=te.get(e.texture);be.framebufferTexture2D(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,be.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){const r=te.get(e.texture),i=t||0;be.framebufferTextureLayer(be.FRAMEBUFFER,be.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=te.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){$.bindFramebuffer(be.FRAMEBUFFER,o);try{const a=e.texture,o=a.format,l=a.type;if(o!==k&&ve.convert(o)!==be.getParameter(be.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===O&&(J.has("EXT_color_buffer_half_float")||Z.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===D||ve.convert(l)===be.getParameter(be.IMPLEMENTATION_COLOR_READ_TYPE)||l===U&&(Z.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&be.readPixels(t,n,r,i,ve.convert(o),ve.convert(l),s)}finally{const e=null!==S?te.get(S).__webglFramebuffer:null;$.bindFramebuffer(be.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),s=Math.floor(t.image.height*r);ne.setTexture2D(t,0),be.copyTexSubImage2D(be.TEXTURE_2D,n,0,0,e.x,e.y,i,s),$.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,s=t.image.height,a=ve.convert(n.format),o=ve.convert(n.type);ne.setTexture2D(n,0),be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,n.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?be.texSubImage2D(be.TEXTURE_2D,r,e.x,e.y,i,s,a,o,t.image.data):t.isCompressedTexture?be.compressedTexSubImage2D(be.TEXTURE_2D,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):be.texSubImage2D(be.TEXTURE_2D,r,e.x,e.y,a,o,t.image),0===r&&n.generateMipmaps&&be.generateMipmap(be.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=ve.convert(r.format),c=ve.convert(r.type);let h;if(r.isData3DTexture)ne.setTexture3D(r,0),h=be.TEXTURE_3D;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ne.setTexture2DArray(r,0),h=be.TEXTURE_2D_ARRAY}be.pixelStorei(be.UNPACK_FLIP_Y_WEBGL,r.flipY),be.pixelStorei(be.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),be.pixelStorei(be.UNPACK_ALIGNMENT,r.unpackAlignment);const u=be.getParameter(be.UNPACK_ROW_LENGTH),d=be.getParameter(be.UNPACK_IMAGE_HEIGHT),p=be.getParameter(be.UNPACK_SKIP_PIXELS),f=be.getParameter(be.UNPACK_SKIP_ROWS),m=be.getParameter(be.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;be.pixelStorei(be.UNPACK_ROW_LENGTH,g.width),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,g.height),be.pixelStorei(be.UNPACK_SKIP_PIXELS,e.min.x),be.pixelStorei(be.UNPACK_SKIP_ROWS,e.min.y),be.pixelStorei(be.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?be.texSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),be.compressedTexSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,g.data)):be.texSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,c,g),be.pixelStorei(be.UNPACK_ROW_LENGTH,u),be.pixelStorei(be.UNPACK_IMAGE_HEIGHT,d),be.pixelStorei(be.UNPACK_SKIP_PIXELS,p),be.pixelStorei(be.UNPACK_SKIP_ROWS,f),be.pixelStorei(be.UNPACK_SKIP_IMAGES,m),0===i&&r.generateMipmaps&&be.generateMipmap(h),$.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?ne.setTextureCube(e,0):e.isData3DTexture?ne.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ne.setTexture2DArray(e,0):ne.setTexture2D(e,0),$.unbindTexture()},this.resetState=function(){E=0,_=0,S=null,$.reset(),ye.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}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Ce?we:Se}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===we?Ce:Te}}class Ia extends Ta{}Ia.prototype.isWebGL1Renderer=!0;class Ba{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Vn(e),this.density=t}clone(){return new Ba(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ra{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Vn(e),this.near=t,this.far=n}clone(){return new Ra(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Pa extends Sn{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 Da{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Re,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ke()}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,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ke()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ke()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const La=new Et;class Fa{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)La.fromBufferAttribute(this,t),La.applyMatrix4(e),this.setXYZ(t,La.x,La.y,La.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)La.fromBufferAttribute(this,t),La.applyNormalMatrix(e),this.setXYZ(t,La.x,La.y,La.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)La.fromBufferAttribute(this,t),La.transformDirection(e),this.setXYZ(t,La.x,La.y,La.z);return this}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=We(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=We(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=We(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=We(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new $n(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fa(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Ua extends Nn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Vn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Oa;const Na=new Et,ka=new Et,Ga=new Et,za=new qe,Qa=new qe,Va=new Zt,Ha=new Et,ja=new Et,Wa=new Et,Xa=new qe,Ya=new qe,qa=new qe;class Ka extends Sn{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Oa){Oa=new hr;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Da(e,5);Oa.setIndex([0,1,2,0,2,3]),Oa.setAttribute("position",new Fa(t,3,0,!1)),Oa.setAttribute("uv",new Fa(t,2,3,!1))}this.geometry=Oa,this.material=void 0!==e?e:new Ua,this.center=new qe(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ka.setFromMatrixScale(this.matrixWorld),Va.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ga.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ka.multiplyScalar(-Ga.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const s=this.center;Ja(Ha.set(-.5,-.5,0),Ga,s,ka,r,i),Ja(ja.set(.5,-.5,0),Ga,s,ka,r,i),Ja(Wa.set(.5,.5,0),Ga,s,ka,r,i),Xa.set(0,0),Ya.set(1,0),qa.set(1,1);let a=e.ray.intersectTriangle(Ha,ja,Wa,!1,Na);if(null===a&&(Ja(ja.set(-.5,.5,0),Ga,s,ka,r,i),Ya.set(0,1),a=e.ray.intersectTriangle(Ha,Wa,ja,!1,Na),null===a))return;const o=e.ray.origin.distanceTo(Na);o<e.near||o>e.far||t.push({distance:o,point:Na.clone(),uv:Un.getInterpolation(Na,Ha,ja,Wa,Xa,Ya,qa,new qe),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Ja(e,t,n,r,i,s){za.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Qa.x=s*za.x-i*za.y,Qa.y=i*za.x+s*za.y):Qa.copy(za),e.copy(t),e.x+=Qa.x,e.y+=Qa.y,e.applyMatrix4(Va)}const Za=new Et,$a=new Et;class eo extends Sn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const e=t[n];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const r=this.levels;let i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Za.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Za);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Za.setFromMatrixPosition(e.matrixWorld),$a.setFromMatrixPosition(this.matrixWorld);const n=Za.distanceTo($a)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),!(n>=e))break;t[r-1].object.visible=!1,t[r].object.visible=!0}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,i=n.length;r<i;r++){const e=n[r];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}}const to=new Et,no=new At,ro=new At,io=new Et,so=new Zt,ao=new Et;class oo extends Tr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Zt,this.bindMatrixInverse=new Zt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new wt),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)ao.fromBufferAttribute(t,n),this.applyBoneTransform(n,ao),this.boundingBox.expandByPoint(ao)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Vt),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)ao.fromBufferAttribute(t,n),this.applyBoneTransform(n,ao),this.boundingSphere.expandByPoint(ao)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new At,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;no.fromBufferAttribute(r.attributes.skinIndex,e),ro.fromBufferAttribute(r.attributes.skinWeight,e),to.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let i=0;i<4;i++){const e=ro.getComponent(i);if(0!==e){const r=no.getComponent(i);so.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),t.addScaledVector(io.copy(to).applyMatrix4(so),e)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class lo extends Sn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class co extends gt{constructor(e=null,t=1,n=1,r,i,s,a,o,l=1003,c=1003,h,u){super(null,s,a,o,l,c,r,i,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ho=new Zt,uo=new Zt;class po{constructor(e=[],t=[]){this.uuid=ke(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Zt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Zt;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let i=0,s=e.length;i<s;i++){const r=e[i]?e[i].matrixWorld:uo;ho.multiplyMatrices(r,t[i]),ho.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}clone(){return new po(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=He(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new co(t,e,e,k,U);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new lo),this.bones.push(i),this.boneInverses.push((new Zt).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const s=n[r];e.boneInverses.push(s.toArray())}return e}}class fo extends $n{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const mo=new Zt,go=new Zt,Ao=[],vo=new wt,yo=new Zt,xo=new Tr,bo=new Vt;class Eo extends Tr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new fo(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,yo)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new wt),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,mo),vo.copy(e.boundingBox).applyMatrix4(mo),this.boundingBox.union(vo)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new Vt),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,mo),bo.copy(e.boundingSphere).applyMatrix4(mo),this.boundingSphere.union(bo)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(xo.geometry=this.geometry,xo.material=this.material,void 0!==xo.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),bo.copy(this.boundingSphere),bo.applyMatrix4(n),!1!==e.ray.intersectsSphere(bo)))for(let i=0;i<r;i++){this.getMatrixAt(i,mo),go.multiplyMatrices(n,mo),xo.matrixWorld=go,xo.raycast(e,Ao);for(let e=0,n=Ao.length;e<n;e++){const n=Ao[e];n.instanceId=i,n.object=this,t.push(n)}Ao.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new fo(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class _o extends Nn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Vn(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const So=new Et,wo=new Et,Mo=new Zt,Co=new Jt,To=new Vt;class Io extends Sn{constructor(e=new hr,t=new _o){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)So.fromBufferAttribute(t,e-1),wo.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=So.distanceTo(wo);e.setAttribute("lineDistance",new nr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),To.copy(n.boundingSphere),To.applyMatrix4(r),To.radius+=i,!1===e.ray.intersectsSphere(To))return;Mo.copy(r).invert(),Co.copy(e.ray).applyMatrix4(Mo);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new Et,c=new Et,h=new Et,u=new Et,d=this.isLineSegments?2:1,p=n.index,f=n.attributes.position;if(null!==p){for(let n=Math.max(0,s.start),r=Math.min(p.count,s.start+s.count)-1;n<r;n+=d){const r=p.getX(n),i=p.getX(n+1);l.fromBufferAttribute(f,r),c.fromBufferAttribute(f,i);if(Co.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);const s=e.ray.origin.distanceTo(u);s<e.near||s>e.far||t.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),r=Math.min(f.count,s.start+s.count)-1;n<r;n+=d){l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,n+1);if(Co.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);r<e.near||r>e.far||t.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const Bo=new Et,Ro=new Et;class Po extends Io{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Bo.fromBufferAttribute(t,e),Ro.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Bo.distanceTo(Ro);e.setAttribute("lineDistance",new nr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Do extends Io{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Lo extends Nn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Vn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Fo=new Zt,Uo=new Jt,Oo=new Vt,No=new Et;class ko extends Sn{constructor(e=new hr,t=new Lo){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Oo.copy(n.boundingSphere),Oo.applyMatrix4(r),Oo.radius+=i,!1===e.ray.intersectsSphere(Oo))return;Fo.copy(r).invert(),Uo.copy(e.ray).applyMatrix4(Fo);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);n<i;n++){const i=l.getX(n);No.fromBufferAttribute(c,i),Go(No,i,o,r,e,t,this)}}else{for(let n=Math.max(0,s.start),i=Math.min(c.count,s.start+s.count);n<i;n++)No.fromBufferAttribute(c,n),Go(No,n,o,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Go(e,t,n,r,i,s,a){const o=Uo.distanceSqToPoint(e);if(o<n){const n=new Et;Uo.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,object:a})}}class zo extends gt{constructor(e,t,n,r,i,s,a,o,l,c,h,u){super(null,s,a,o,l,c,r,i,h,u),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Qo{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let a,o=0,l=i-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-s,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const c=n[r];return(r+(s-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),a=this.getPoint(i),o=t||(s.isVector2?new qe:new Et);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new Et,r=[],i=[],s=[],a=new Et,o=new Zt;for(let d=0;d<=e;d++){const t=d/e;r[d]=this.getTangentAt(t,new Et)}i[0]=new Et,s[0]=new Et;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),h=Math.abs(r[0].y),u=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let d=1;d<=e;d++){if(i[d]=i[d-1].clone(),s[d]=s[d-1].clone(),a.crossVectors(r[d-1],r[d]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(Ge(r[d-1].dot(r[d]),-1,1));i[d].applyMatrix4(o.makeRotationAxis(a,e))}s[d].crossVectors(r[d],i[d])}if(!0===t){let t=Math.acos(Ge(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Vo extends Qo{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t){const n=t||new qe,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=l-this.aY;o=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Ho extends Vo{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.isArcCurve=!0,this.type="ArcCurve"}}function jo(){let e=0,t=0,n=0,r=0;function i(i,s,a,o){e=i,t=a,n=-3*i+3*s-2*a-o,r=2*i-2*s+a+o}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,a,o){let l=(t-e)/s-(n-e)/(s+a)+(n-t)/a,c=(n-t)/a-(r-t)/(a+o)+(r-n)/o;l*=a,c*=a,i(t,n,l,c)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}const Wo=new Et,Xo=new jo,Yo=new jo,qo=new jo;class Ko extends Qo{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new Et){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let a,o,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?a=r[(l-1)%i]:(Wo.subVectors(r[0],r[1]).add(r[0]),a=Wo);const h=r[l%i],u=r[(l+1)%i];if(this.closed||l+2<i?o=r[(l+2)%i]:(Wo.subVectors(r[i-1],r[i-2]).add(r[i-1]),o=Wo),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(h),e),n=Math.pow(h.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),Xo.initNonuniformCatmullRom(a.x,h.x,u.x,o.x,t,n,r),Yo.initNonuniformCatmullRom(a.y,h.y,u.y,o.y,t,n,r),qo.initNonuniformCatmullRom(a.z,h.z,u.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(Xo.initCatmullRom(a.x,h.x,u.x,o.x,this.tension),Yo.initCatmullRom(a.y,h.y,u.y,o.y,this.tension),qo.initCatmullRom(a.z,h.z,u.z,o.z,this.tension));return n.set(Xo.calc(c),Yo.calc(c),qo.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Et).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Jo(e,t,n,r,i){const s=.5*(r-t),a=.5*(i-n),o=e*e;return(2*n-2*r+s+a)*(e*o)+(-3*n+3*r-2*s-a)*o+s*e+n}function Zo(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function $o(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class el extends Qo{constructor(e=new qe,t=new qe,n=new qe,r=new qe){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new qe){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set($o(e,r.x,i.x,s.x,a.x),$o(e,r.y,i.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class tl extends Qo{constructor(e=new Et,t=new Et,n=new Et,r=new Et){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Et){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set($o(e,r.x,i.x,s.x,a.x),$o(e,r.y,i.y,s.y,a.y),$o(e,r.z,i.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class nl extends Qo{constructor(e=new qe,t=new qe){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new qe){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new qe){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class rl extends Qo{constructor(e=new Et,t=new Et){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Et){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Et){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class il extends Qo{constructor(e=new qe,t=new qe,n=new qe){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new qe){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Zo(e,r.x,i.x,s.x),Zo(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class sl extends Qo{constructor(e=new Et,t=new Et,n=new Et){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Et){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Zo(e,r.x,i.x,s.x),Zo(e,r.y,i.y,s.y),Zo(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class al extends Qo{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new qe){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),a=i-s,o=r[0===s?s:s-1],l=r[s],c=r[s>r.length-2?r.length-1:s+1],h=r[s>r.length-3?r.length-1:s+2];return n.set(Jo(a,o.x,l.x,c.x,h.x),Jo(a,o.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new qe).fromArray(n))}return this}}var ol=Object.freeze({__proto__:null,ArcCurve:Ho,CatmullRomCurve3:Ko,CubicBezierCurve:el,CubicBezierCurve3:tl,EllipseCurve:Vo,LineCurve:nl,LineCurve3:rl,QuadraticBezierCurve:il,QuadraticBezierCurve3:sl,SplineCurve:al});class ll extends Qo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new nl(t,e))}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){const r=o[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new ol[n.type]).fromJSON(n))}return this}}class cl extends ll{constructor(e){super(),this.type="Path",this.currentPoint=new qe,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new nl(this.currentPoint.clone(),new qe(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new il(this.currentPoint.clone(),new qe(e,t),new qe(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const a=new el(this.currentPoint.clone(),new qe(e,t),new qe(n,r),new qe(i,s));return this.curves.push(a),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new al(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,a,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,s,a,o),this}absellipse(e,t,n,r,i,s,a,o){const l=new Vo(e,t,n,r,i,s,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class hl extends hr{constructor(e=[new qe(0,-.5),new qe(.5,0),new qe(0,.5)],t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Ge(r,0,2*Math.PI);const i=[],s=[],a=[],o=[],l=[],c=1/t,h=new Et,u=new qe,d=new Et,p=new Et,f=new Et;let m=0,g=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:m=e[A+1].x-e[A].x,g=e[A+1].y-e[A].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[A+1].x-e[A].x,g=e[A+1].y-e[A].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let A=0;A<=t;A++){const i=n+A*c*r,d=Math.sin(i),p=Math.cos(i);for(let n=0;n<=e.length-1;n++){h.x=e[n].x*d,h.y=e[n].y,h.z=e[n].x*p,s.push(h.x,h.y,h.z),u.x=A/t,u.y=n/(e.length-1),a.push(u.x,u.y);const r=o[3*n+0]*d,i=o[3*n+1],c=o[3*n+0]*p;l.push(r,i,c)}}for(let A=0;A<t;A++)for(let t=0;t<e.length-1;t++){const n=t+A*e.length,r=n,s=n+e.length,a=n+e.length+1,o=n+1;i.push(r,s,o),i.push(a,o,s)}this.setIndex(i),this.setAttribute("position",new nr(s,3)),this.setAttribute("uv",new nr(a,2)),this.setAttribute("normal",new nr(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hl(e.points,e.segments,e.phiStart,e.phiLength)}}class ul extends hl{constructor(e=1,t=1,n=4,r=8){const i=new cl;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new ul(e.radius,e.length,e.capSegments,e.radialSegments)}}class dl extends hr{constructor(e=1,t=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],s=[],a=[],o=[],l=new Et,c=new qe;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let h=0,u=3;h<=t;h++,u+=3){const i=n+h/t*r;l.x=e*Math.cos(i),l.y=e*Math.sin(i),s.push(l.x,l.y,l.z),a.push(0,0,1),c.x=(s[u]/e+1)/2,c.y=(s[u+1]/e+1)/2,o.push(c.x,c.y)}for(let h=1;h<=t;h++)i.push(h,h+1,0);this.setIndex(i),this.setAttribute("position",new nr(s,3)),this.setAttribute("normal",new nr(a,3)),this.setAttribute("uv",new nr(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new dl(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class pl extends hr{constructor(e=1,t=1,n=1,r=32,i=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],h=[],u=[],d=[];let p=0;const f=[],m=n/2;let g=0;function A(n){const i=p,s=new qe,f=new Et;let A=0;const v=!0===n?e:t,y=!0===n?1:-1;for(let e=1;e<=r;e++)h.push(0,m*y,0),u.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let e=0;e<=r;e++){const t=e/r*o+a,n=Math.cos(t),i=Math.sin(t);f.x=v*i,f.y=m*y,f.z=v*n,h.push(f.x,f.y,f.z),u.push(0,y,0),s.x=.5*n+.5,s.y=.5*i*y+.5,d.push(s.x,s.y),p++}for(let e=0;e<r;e++){const t=i+e,r=x+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),A+=3}l.addGroup(g,A,!0===n?1:2),g+=A}!function(){const s=new Et,A=new Et;let v=0;const y=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*o+a,l=Math.sin(i),f=Math.cos(i);A.x=v*l,A.y=-g*n+m,A.z=v*f,h.push(A.x,A.y,A.z),s.set(l,y,f).normalize(),u.push(s.x,s.y,s.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],s=f[t][e+1];c.push(n,r,s),c.push(r,i,s),v+=6}l.addGroup(g,v,0),g+=v}(),!1===s&&(e>0&&A(!0),t>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new nr(h,3)),this.setAttribute("normal",new nr(u,3)),this.setAttribute("uv",new nr(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class fl extends pl{constructor(e=1,t=1,n=32,r=1,i=!1,s=0,a=2*Math.PI){super(0,e,t,n,r,i,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:s,thetaLength:a}}static fromJSON(e){return new fl(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ml extends hr{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],s=[];function a(e,t,n,r){const i=r+1,s=[];for(let a=0;a<=i;a++){s[a]=[];const r=e.clone().lerp(n,a/i),o=t.clone().lerp(n,a/i),l=i-a;for(let e=0;e<=l;e++)s[a][e]=0===e&&a===i?r:r.clone().lerp(o,e/l)}for(let a=0;a<i;a++)for(let e=0;e<2*(i-a)-1;e++){const t=Math.floor(e/2);e%2==0?(o(s[a][t+1]),o(s[a+1][t]),o(s[a][t])):(o(s[a][t+1]),o(s[a+1][t+1]),o(s[a+1][t]))}}function o(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(s[t]=e.x-1),0===n.x&&0===n.z&&(s[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new Et,r=new Et,i=new Et;for(let s=0;s<t.length;s+=3)l(t[s+0],n),l(t[s+1],r),l(t[s+2],i),a(n,r,i,e)}(r),function(e){const t=new Et;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new Et;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=h(e)/2/Math.PI+.5,a=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);s.push(r,1-a)}var t;(function(){const e=new Et,t=new Et,n=new Et,r=new Et,a=new qe,o=new qe,l=new qe;for(let u=0,d=0;u<i.length;u+=9,d+=6){e.set(i[u+0],i[u+1],i[u+2]),t.set(i[u+3],i[u+4],i[u+5]),n.set(i[u+6],i[u+7],i[u+8]),a.set(s[d+0],s[d+1]),o.set(s[d+2],s[d+3]),l.set(s[d+4],s[d+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=h(r);c(a,d+0,e,p),c(o,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],n=s[e+2],r=s[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new nr(i,3)),this.setAttribute("normal",new nr(i.slice(),3)),this.setAttribute("uv",new nr(s,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ml(e.vertices,e.indices,e.radius,e.details)}}class gl extends ml{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gl(e.radius,e.detail)}}const Al=new Et,vl=new Et,yl=new Et,xl=new Un;class bl extends hr{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos(Oe*t),s=e.getIndex(),a=e.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let e=0;e<o;e+=3){s?(l[0]=s.getX(e),l[1]=s.getX(e+1),l[2]=s.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:o}=xl;if(t.fromBufferAttribute(a,l[0]),n.fromBufferAttribute(a,l[1]),o.fromBufferAttribute(a,l[2]),xl.getNormal(yl),h[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,h[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,h[2]=`${Math.round(o.x*r)},${Math.round(o.y*r)},${Math.round(o.z*r)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=h[e],r=h[t],s=xl[c[e]],a=xl[c[t]],o=`${n}_${r}`,p=`${r}_${n}`;p in u&&u[p]?(yl.dot(u[p].normal)<=i&&(d.push(s.x,s.y,s.z),d.push(a.x,a.y,a.z)),u[p]=null):o in u||(u[o]={index0:l[e],index1:l[t],normal:yl.clone()})}}for(const e in u)if(u[e]){const{index0:t,index1:n}=u[e];Al.fromBufferAttribute(a,t),vl.fromBufferAttribute(a,n),d.push(Al.x,Al.y,Al.z),d.push(vl.x,vl.y,vl.z)}this.setAttribute("position",new nr(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class El extends cl{constructor(e){super(e),this.uuid=ke(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new cl).fromJSON(n))}return this}}const _l=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Sl(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,h,u,d,p;if(r&&(s=function(e,t,n,r){const i=[];let s,a,o,l,c;for(s=0,a=t.length;s<a;s++)o=t[s]*r,l=s<a-1?t[s+1]*r:e.length,c=Sl(e,o,l,r,!1),c===c.next&&(c.steiner=!0),i.push(Fl(c));for(i.sort(Rl),s=0;s<i.length;s++)n=Pl(i[s],n);return n}(e,t,s,n)),e.length>80*n){o=c=e[0],l=h=e[1];for(let t=n;t<i;t+=n)u=e[t],d=e[t+1],u<o&&(o=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Ml(s,a,n,o,l,p,0),a};function Sl(e,t,n,r,i){let s,a;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)a=jl(s,e[s],e[s+1],a);else for(s=n-r;s>=t;s-=r)a=jl(s,e[s],e[s+1],a);return a&&kl(a,a.next)&&(Wl(a),a=a.next),a}function wl(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!kl(r,r.next)&&0!==Nl(r.prev,r,r.next))r=r.next;else{if(Wl(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Ml(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=Ll(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,a,o,l,c=1;do{for(n=e,e=null,s=null,a=0;n;){for(a++,r=n,o=0,t=0;t<c&&(o++,r=r.nextZ,r);t++);for(l=c;o>0||l>0&&r;)0!==o&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?Tl(e,r,i,s):Cl(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Wl(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Ml(e=Il(wl(e),t,n),t,n,r,i,s,2):2===a&&Bl(e,t,n,r,i,s):Ml(wl(e),t,n,r,i,s,1);break}}function Cl(e){const t=e.prev,n=e,r=e.next;if(Nl(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,c=r.y,h=i<s?i<a?i:a:s<a?s:a,u=o<l?o<c?o:c:l<c?l:c,d=i>s?i>a?i:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let f=r.next;for(;f!==t;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Ul(i,o,s,l,a,c,f.x,f.y)&&Nl(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Tl(e,t,n,r){const i=e.prev,s=e,a=e.next;if(Nl(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,h=i.y,u=s.y,d=a.y,p=o<l?o<c?o:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=o>l?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Ll(p,f,t,n,r),v=Ll(m,g,t,n,r);let y=e.prevZ,x=e.nextZ;for(;y&&y.z>=A&&x&&x.z<=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&Ul(o,h,l,u,c,d,y.x,y.y)&&Nl(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==a&&Ul(o,h,l,u,c,d,x.x,x.y)&&Nl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&Ul(o,h,l,u,c,d,y.x,y.y)&&Nl(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==a&&Ul(o,h,l,u,c,d,x.x,x.y)&&Nl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Il(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!kl(i,s)&&Gl(i,r,r.next,s)&&Vl(i,s)&&Vl(s,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),Wl(r),Wl(r.next),r=e=s),r=r.next}while(r!==e);return wl(r)}function Bl(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Ol(a,e)){let o=Hl(a,e);return a=wl(a,a.next),o=wl(o,o.next),Ml(a,t,n,r,i,s,0),void Ml(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function Rl(e,t){return e.x-t.x}function Pl(e,t){const n=function(e,t){let n,r=t,i=-1/0;const s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){const e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===s))return n}r=r.next}while(r!==t);if(!n)return null;const o=n,l=n.x,c=n.y;let h,u=1/0;r=n;do{s>=r.x&&r.x>=l&&s!==r.x&&Ul(a<c?s:i,a,l,c,a<c?i:s,a,r.x,r.y)&&(h=Math.abs(a-r.y)/(s-r.x),Vl(r,e)&&(h<u||h===u&&(r.x>n.x||r.x===n.x&&Dl(n,r)))&&(n=r,u=h)),r=r.next}while(r!==o);return n}(e,t);if(!n)return t;const r=Hl(n,e);return wl(r,r.next),wl(n,n.next)}function Dl(e,t){return Nl(e.prev,e,t.prev)<0&&Nl(t.next,e,e.next)<0}function Ll(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Fl(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Ul(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function Ol(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Gl(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Vl(e,t)&&Vl(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Nl(e.prev,e,t.prev)||Nl(e,t.prev,t))||kl(e,t)&&Nl(e.prev,e,e.next)>0&&Nl(t.prev,t,t.next)>0)}function Nl(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function kl(e,t){return e.x===t.x&&e.y===t.y}function Gl(e,t,n,r){const i=Ql(Nl(e,t,n)),s=Ql(Nl(e,t,r)),a=Ql(Nl(n,r,e)),o=Ql(Nl(n,r,t));return i!==s&&a!==o||(!(0!==i||!zl(e,n,t))||(!(0!==s||!zl(e,r,t))||(!(0!==a||!zl(n,e,r))||!(0!==o||!zl(n,t,r)))))}function zl(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Ql(e){return e>0?1:e<0?-1:0}function Vl(e,t){return Nl(e.prev,e,e.next)<0?Nl(e,t,e.next)>=0&&Nl(e,e.prev,t)>=0:Nl(e,t,e.prev)<0||Nl(e,e.next,t)<0}function Hl(e,t){const n=new Xl(e.i,e.x,e.y),r=new Xl(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function jl(e,t,n,r){const i=new Xl(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Wl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Xl(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Yl{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Yl.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];ql(e),Kl(n,e);let s=e.length;t.forEach(ql);for(let o=0;o<t.length;o++)r.push(s),s+=t[o].length,Kl(n,t[o]);const a=_l(n,r);for(let o=0;o<a.length;o+=3)i.push(a.slice(o,o+3));return i}}function ql(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Kl(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class Jl extends hr{constructor(e=new El([new qe(.5,.5),new qe(-.5,.5),new qe(-.5,-.5),new qe(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let a=0,o=e.length;a<o;a++){s(e[a])}function s(e){const s=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:.2,u=void 0!==t.bevelSize?t.bevelSize:h-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Zl;let g,A,v,y,x,b=!1;f&&(g=f.getSpacedPoints(o),b=!0,c=!1,A=f.computeFrenetFrames(o,!1),v=new Et,y=new Et,x=new Et),c||(p=0,h=0,u=0,d=0);const E=e.extractPoints(a);let _=E.shape;const S=E.holes;if(!Yl.isClockWise(_)){_=_.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Yl.isClockWise(t)&&(S[e]=t.reverse())}}const w=Yl.triangulateShape(_,S),M=_;for(let t=0,n=S.length;t<n;t++){const e=S[t];_=_.concat(e)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const T=_.length,I=w.length;function B(e,t,n){let r,i,s;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,c=n.y-e.y,h=a*a+o*o,u=a*c-o*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=t.x-o/u,f=t.y+a/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(a*c-o*l);r=p+a*m-e.x,i=f+o*m-e.y;const g=r*r+i*i;if(g<=2)return new qe(r,i);s=Math.sqrt(g/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(c)&&(e=!0),e?(r=-o,i=a,s=Math.sqrt(h)):(r=a,i=o,s=Math.sqrt(h/2))}return new qe(r/s,i/s)}const R=[];for(let t=0,n=M.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),R[t]=B(M[t],M[r],M[i]);const P=[];let D,L=R.concat();for(let t=0,n=S.length;t<n;t++){const e=S[t];D=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),D[t]=B(e[t],e[r],e[i]);P.push(D),L=L.concat(D)}for(let t=0;t<p;t++){const e=t/p,n=h*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+d;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],R[t],r);O(e.x,e.y,-n)}for(let t=0,i=S.length;t<i;t++){const e=S[t];D=P[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);O(i.x,i.y,-n)}}}const F=u+d;for(let t=0;t<T;t++){const e=c?C(_[t],L[t],F):_[t];b?(y.copy(A.normals[0]).multiplyScalar(e.x),v.copy(A.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(y).add(v),O(x.x,x.y,x.z)):O(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<T;e++){const n=c?C(_[e],L[e],F):_[e];b?(y.copy(A.normals[t]).multiplyScalar(n.x),v.copy(A.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(y).add(v),O(x.x,x.y,x.z)):O(n.x,n.y,l/o*t)}for(let t=p-1;t>=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+d;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],R[t],r);O(e.x,e.y,l+n)}for(let t=0,i=S.length;t<i;t++){const e=S[t];D=P[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);b?O(i.x,i.y+g[o-1].y,g[o-1].x+n):O(i.x,i.y,l+n)}}}function U(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=o+2*p;e<n;e++){const n=T*e,s=T*(e+1);k(t+r+n,t+i+n,t+i+s,t+r+s)}}}function O(e,t,n){s.push(e),s.push(t),s.push(n)}function N(e,t,i){G(e),G(t),G(i);const s=r.length/3,a=m.generateTopUV(n,r,s-3,s-2,s-1);z(a[0]),z(a[1]),z(a[2])}function k(e,t,i,s){G(e),G(t),G(s),G(t),G(i),G(s);const a=r.length/3,o=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[3]),z(o[1]),z(o[2]),z(o[3])}function G(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function z(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=T*e;for(let n=0;n<I;n++){const e=w[n];N(e[2]+t,e[1]+t,e[0]+t)}e=o+2*p,t=T*e;for(let n=0;n<I;n++){const e=w[n];N(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<I;e++){const t=w[e];N(t[2],t[1],t[0])}for(let e=0;e<I;e++){const t=w[e];N(t[0]+T*o,t[1]+T*o,t[2]+T*o)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;U(M,t),t+=M.length;for(let n=0,r=S.length;n<r;n++){const e=S[n];U(e,t),t+=e.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new nr(r,3)),this.setAttribute("uv",new nr(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let r=0,i=e.length;r<i;r++){const t=e[r];n.shapes.push(t.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const r=t[e.shapes[i]];n.push(r)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new ol[r.type]).fromJSON(r)),new Jl(n,e.options)}}const Zl={generateTopUV:function(e,t,n,r,i){const s=t[3*n],a=t[3*n+1],o=t[3*r],l=t[3*r+1],c=t[3*i],h=t[3*i+1];return[new qe(s,a),new qe(o,l),new qe(c,h)]},generateSideWallUV:function(e,t,n,r,i,s){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],c=t[3*r],h=t[3*r+1],u=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*s],g=t[3*s+1],A=t[3*s+2];return Math.abs(o-h)<Math.abs(a-c)?[new qe(a,1-l),new qe(c,1-u),new qe(d,1-f),new qe(m,1-A)]:[new qe(o,1-l),new qe(h,1-u),new qe(p,1-f),new qe(g,1-A)]}};class $l extends ml{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new $l(e.radius,e.detail)}}class ec extends ml{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ec(e.radius,e.detail)}}class tc extends hr{constructor(e=.5,t=1,n=32,r=1,i=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:s},n=Math.max(3,n);const a=[],o=[],l=[],c=[];let h=e;const u=(t-e)/(r=Math.max(1,r)),d=new Et,p=new qe;for(let f=0;f<=r;f++){for(let e=0;e<=n;e++){const r=i+e/n*s;d.x=h*Math.cos(r),d.y=h*Math.sin(r),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}h+=u}for(let f=0;f<r;f++){const e=f*(n+1);for(let t=0;t<n;t++){const r=t+e,i=r,s=r+n+1,o=r+n+2,l=r+1;a.push(i,s,l),a.push(s,o,l)}}this.setIndex(a),this.setAttribute("position",new nr(o,3)),this.setAttribute("normal",new nr(l,3)),this.setAttribute("uv",new nr(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class nc extends hr{constructor(e=new El([new qe(0,.5),new qe(-.5,-.5),new qe(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],s=[];let a=0,o=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c<e.length;c++)l(e[c]),this.addGroup(a,o,c),a+=o,o=0;function l(e){const a=r.length/3,l=e.extractPoints(t);let c=l.shape;const h=l.holes;!1===Yl.isClockWise(c)&&(c=c.reverse());for(let t=0,n=h.length;t<n;t++){const e=h[t];!0===Yl.isClockWise(e)&&(h[t]=e.reverse())}const u=Yl.triangulateShape(c,h);for(let t=0,n=h.length;t<n;t++){const e=h[t];c=c.concat(e)}for(let t=0,n=c.length;t<n;t++){const e=c[t];r.push(e.x,e.y,0),i.push(0,0,1),s.push(e.x,e.y)}for(let t=0,r=u.length;t<r;t++){const e=u[t],r=e[0]+a,i=e[1]+a,s=e[2]+a;n.push(r,i,s),o+=3}}this.setIndex(n),this.setAttribute("position",new nr(r,3)),this.setAttribute("normal",new nr(i,3)),this.setAttribute("uv",new nr(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new nc(n,e.curveSegments)}}class rc extends hr{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const c=[],h=new Et,u=new Et,d=[],p=[],f=[],m=[];for(let g=0;g<=n;g++){const d=[],A=g/n;let v=0;0===g&&0===s?v=.5/t:g===n&&o===Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){const o=n/t;h.x=-e*Math.cos(r+o*i)*Math.sin(s+A*a),h.y=e*Math.cos(s+A*a),h.z=e*Math.sin(r+o*i)*Math.sin(s+A*a),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(o+v,1-A),d.push(l++)}c.push(d)}for(let g=0;g<n;g++)for(let e=0;e<t;e++){const t=c[g][e+1],r=c[g][e],i=c[g+1][e],a=c[g+1][e+1];(0!==g||s>0)&&d.push(t,r,a),(g!==n-1||o<Math.PI)&&d.push(r,i,a)}this.setIndex(d),this.setAttribute("position",new nr(p,3)),this.setAttribute("normal",new nr(f,3)),this.setAttribute("uv",new nr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ic extends ml{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ic(e.radius,e.detail)}}class sc extends hr{constructor(e=1,t=.4,n=12,r=48,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],o=[],l=[],c=new Et,h=new Et,u=new Et;for(let d=0;d<=n;d++)for(let s=0;s<=r;s++){const p=s/r*i,f=d/n*Math.PI*2;h.x=(e+t*Math.cos(f))*Math.cos(p),h.y=(e+t*Math.cos(f))*Math.sin(p),h.z=t*Math.sin(f),a.push(h.x,h.y,h.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),u.subVectors(h,c).normalize(),o.push(u.x,u.y,u.z),l.push(s/r),l.push(d/n)}for(let d=1;d<=n;d++)for(let e=1;e<=r;e++){const t=(r+1)*d+e-1,n=(r+1)*(d-1)+e-1,i=(r+1)*(d-1)+e,a=(r+1)*d+e;s.push(t,n,a),s.push(n,i,a)}this.setIndex(s),this.setAttribute("position",new nr(a,3)),this.setAttribute("normal",new nr(o,3)),this.setAttribute("uv",new nr(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class ac extends hr{constructor(e=1,t=.4,n=64,r=8,i=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:s},n=Math.floor(n),r=Math.floor(r);const a=[],o=[],l=[],c=[],h=new Et,u=new Et,d=new Et,p=new Et,f=new Et,m=new Et,g=new Et;for(let v=0;v<=n;++v){const a=v/n*i*Math.PI*2;A(a,i,s,e,d),A(a+.01,i,s,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,s=-t*Math.cos(i),a=t*Math.sin(i);h.x=d.x+(s*g.x+a*f.x),h.y=d.y+(s*g.y+a*f.y),h.z=d.z+(s*g.z+a*f.z),o.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(v/n),c.push(e/r)}}for(let v=1;v<=n;v++)for(let e=1;e<=r;e++){const t=(r+1)*(v-1)+(e-1),n=(r+1)*v+(e-1),i=(r+1)*v+e,s=(r+1)*(v-1)+e;a.push(t,n,s),a.push(n,i,s)}function A(e,t,n,r,i){const s=Math.cos(e),a=Math.sin(e),o=n/t*e,l=Math.cos(o);i.x=r*(2+l)*.5*s,i.y=r*(2+l)*a*.5,i.z=r*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new nr(o,3)),this.setAttribute("normal",new nr(l,3)),this.setAttribute("uv",new nr(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ac(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class oc extends hr{constructor(e=new sl(new Et(-1,-1,0),new Et(-1,1,0),new Et(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new Et,o=new Et,l=new qe;let c=new Et;const h=[],u=[],d=[],p=[];function f(i){c=e.getPointAt(i/t,c);const l=s.normals[i],d=s.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+i*d.x,o.y=s*l.y+i*d.y,o.z=s*l.z+i*d.z,o.normalize(),u.push(o.x,o.y,o.z),a.x=c.x+n*o.x,a.y=c.y+n*o.y,a.z=c.z+n*o.z,h.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;p.push(n,i,a),p.push(i,s,a)}}()}(),this.setIndex(p),this.setAttribute("position",new nr(h,3)),this.setAttribute("normal",new nr(u,3)),this.setAttribute("uv",new nr(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new oc((new ol[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class lc extends hr{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new Et,i=new Et;if(null!==e.index){const s=e.attributes.position,a=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let l=0;l<3;l++){const o=a.getX(e+l),c=a.getX(e+(l+1)%3);r.fromBufferAttribute(s,o),i.fromBufferAttribute(s,c),!0===cc(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let o=0;o<3;o++){const a=3*e+o,l=3*e+(o+1)%3;r.fromBufferAttribute(s,a),i.fromBufferAttribute(s,l),!0===cc(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new nr(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function cc(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var hc=Object.freeze({__proto__:null,BoxGeometry:Br,CapsuleGeometry:ul,CircleGeometry:dl,ConeGeometry:fl,CylinderGeometry:pl,DodecahedronGeometry:gl,EdgesGeometry:bl,ExtrudeGeometry:Jl,IcosahedronGeometry:$l,LatheGeometry:hl,OctahedronGeometry:ec,PlaneGeometry:Jr,PolyhedronGeometry:ml,RingGeometry:tc,ShapeGeometry:nc,SphereGeometry:rc,TetrahedronGeometry:ic,TorusGeometry:sc,TorusKnotGeometry:ac,TubeGeometry:oc,WireframeGeometry:lc});class uc extends Nn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Vn(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class dc extends Fr{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class pc extends Nn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Vn(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 Vn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(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 fc extends pc{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 qe(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ge(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 Vn(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 Vn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Vn(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}}class mc extends Nn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Vn(16777215),this.specular=new Vn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=c,this.reflectivity=1,this.refractionRatio=.98,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.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,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 gc extends Nn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Vn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Ac extends Nn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class vc extends Nn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Vn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=c,this.reflectivity=1,this.refractionRatio=.98,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.color.copy(e.color),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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,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 yc extends Nn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Vn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class xc extends _o{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function bc(e,t,n){return _c(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)}function Ec(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function _c(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Sc(e){const t=e.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n}function wc(e,t,n){const r=e.length,i=new e.constructor(r);for(let s=0,a=0;a!==r;++s){const r=n[s]*t;for(let n=0;n!==t;++n)i[a++]=e[r+n]}return i}function Mc(e,t,n,r){let i=1,s=e[0];for(;void 0!==s&&void 0===s[r];)s=e[i++];if(void 0===s)return;let a=s[r];if(void 0!==a)if(Array.isArray(a))do{a=s[r],void 0!==a&&(t.push(s.time),n.push.apply(n,a)),s=e[i++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[r],void 0!==a&&(t.push(s.time),a.toArray(n,n.length)),s=e[i++]}while(void 0!==s);else do{a=s[r],void 0!==a&&(t.push(s.time),n.push(a)),s=e[i++]}while(void 0!==s)}const Cc={arraySlice:bc,convertArray:Ec,isTypedArray:_c,getKeyframeOrder:Sc,sortedArray:wc,flattenJSON:Mc,subclip:function(e,t,n,r,i=30){const s=e.clone();s.name=t;const a=[];for(let l=0;l<s.tracks.length;++l){const e=s.tracks[l],t=e.getValueSize(),o=[],c=[];for(let s=0;s<e.times.length;++s){const a=e.times[s]*i;if(!(a<n||a>=r)){o.push(e.times[s]);for(let n=0;n<t;++n)c.push(e.values[s*t+n])}}0!==o.length&&(e.times=Ec(o,e.times.constructor),e.values=Ec(c,e.values.constructor),a.push(e))}s.tracks=a;let o=1/0;for(let l=0;l<s.tracks.length;++l)o>s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*o);return s.resetDuration(),s},makeClipAdditive:function(e,t=0,n=e,r=30){r<=0&&(r=30);const i=n.tracks.length,s=t/r;for(let a=0;a<i;++a){const t=n.tracks[a],r=t.ValueTypeName;if("bool"===r||"string"===r)continue;const i=e.tracks.find((function(e){return e.name===t.name&&e.ValueTypeName===r}));if(void 0===i)continue;let o=0;const l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let c=0;const h=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=t.times.length-1;let d;if(s<=t.times[0]){const e=o,n=l-o;d=bc(t.values,e,n)}else if(s>=t.times[u]){const e=u*l+o,n=e+l-o;d=bc(t.values,e,n)}else{const e=t.createInterpolant(),n=o,r=l-o;e.evaluate(s),d=bc(e.resultBuffer,n,r)}if("quaternion"===r){(new bt).fromArray(d).normalize().conjugate().toArray(d)}const p=i.times.length;for(let e=0;e<p;++e){const t=e*h+c;if("quaternion"===r)bt.multiplyQuaternionsFlat(i.values,t,d,0,i.values,t);else{const e=h-2*c;for(let n=0;n<e;++n)i.values[t+n]-=d[n]}}}return e.blendMode=_e,e}};class Tc{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let s;n:{r:if(!(e<r)){for(let s=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(i=r,r=t[++n],e<r)break t}s=t.length;break n}if(e>=i)break e;{const a=t[1];e<a&&(n=2,i=a);for(let s=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===s)break;if(r=i,i=t[--n-1],e>=i)break t}s=n,n=0}}for(;n<s;){const r=n+s>>>1;e<t[r]?s=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let s=0;s!==r;++s)t[s]=n[i+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Ic extends Tc{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ye,endingEnd:ye}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,s=e+1,a=r[i],o=r[s];if(void 0===a)switch(this.getSettings_().endingStart){case xe:i=e,a=2*t-n;break;case be:i=r.length-2,a=t+r[i]-r[i+1];break;default:i=e,a=n}if(void 0===o)switch(this.getSettings_().endingEnd){case xe:s=e,o=2*n-t;break;case be:s=1,o=n+r[1]-r[0];break;default:s=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-n),this._offsetPrev=i*c,this._offsetNext=s*c}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,A=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let x=0;x!==a;++x)i[x]=g*s[c+x]+A*s[l+x]+v*s[o+x]+y*s[h+x];return i}}class Bc extends Tc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=(n-t)/(r-t),h=1-c;for(let u=0;u!==a;++u)i[u]=s[l+u]*h+s[o+u]*c;return i}}class Rc extends Tc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Pc{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ec(t,this.TimeBufferType),this.values=Ec(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Ec(e.times,Array),values:Ec(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Rc(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Bc(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Ic(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ge:t=this.InterpolantFactoryMethodDiscrete;break;case Ae:t=this.InterpolantFactoryMethodLinear;break;case ve:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ge;case this.InterpolantFactoryMethodLinear:return Ae;case this.InterpolantFactoryMethodSmooth:return ve}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,s=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==s&&n[s]>t;)--s;if(++s,0!==i||s!==r){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=bc(n,i,s),this.values=bc(this.values,i*e,s*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 n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==i;a++){const t=n[a];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,t),e=!1;break}if(null!==s&&s>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,t,s),e=!1;break}s=t}if(void 0!==r&&_c(r))for(let a=0,o=r.length;a!==o;++a){const t=r[a];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,t),e=!1;break}}return e}optimize(){const e=bc(this.times),t=bc(this.values),n=this.getValueSize(),r=this.getInterpolation()===ve,i=e.length-1;let s=1;for(let a=1;a<i;++a){let i=!1;const o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(r)i=!0;else{const e=a*n,r=e-n,s=e+n;for(let a=0;a!==n;++a){const n=t[e+a];if(n!==t[r+a]||n!==t[s+a]){i=!0;break}}}if(i){if(a!==s){e[s]=e[a];const r=a*n,i=s*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++s}}if(i>0){e[s]=e[i];for(let e=i*n,r=s*n,a=0;a!==n;++a)t[r+a]=t[e+a];++s}return s!==e.length?(this.times=bc(e,0,s),this.values=bc(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=bc(this.times,0),t=bc(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Pc.prototype.TimeBufferType=Float32Array,Pc.prototype.ValueBufferType=Float32Array,Pc.prototype.DefaultInterpolation=Ae;class Dc extends Pc{}Dc.prototype.ValueTypeName="bool",Dc.prototype.ValueBufferType=Array,Dc.prototype.DefaultInterpolation=ge,Dc.prototype.InterpolantFactoryMethodLinear=void 0,Dc.prototype.InterpolantFactoryMethodSmooth=void 0;class Lc extends Pc{}Lc.prototype.ValueTypeName="color";class Fc extends Pc{}Fc.prototype.ValueTypeName="number";class Uc extends Tc{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-t)/(r-t);let l=e*a;for(let c=l+a;l!==c;l+=4)bt.slerpFlat(i,0,s,l-a,s,l,o);return i}}class Oc extends Pc{InterpolantFactoryMethodLinear(e){return new Uc(this.times,this.values,this.getValueSize(),e)}}Oc.prototype.ValueTypeName="quaternion",Oc.prototype.DefaultInterpolation=Ae,Oc.prototype.InterpolantFactoryMethodSmooth=void 0;class Nc extends Pc{}Nc.prototype.ValueTypeName="string",Nc.prototype.ValueBufferType=Array,Nc.prototype.DefaultInterpolation=ge,Nc.prototype.InterpolantFactoryMethodLinear=void 0,Nc.prototype.InterpolantFactoryMethodSmooth=void 0;class kc extends Pc{}kc.prototype.ValueTypeName="vector";class Gc{constructor(e,t=-1,n,r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=ke(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(zc(n[s]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,s=n.length;i!==s;++i)t.push(Pc.toJSON(n[i]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,s=[];for(let a=0;a<i;a++){let e=[],o=[];e.push((a+i-1)%i,a,(a+1)%i),o.push(0,1,0);const l=Sc(e);e=wc(e,1,l),o=wc(o,1,l),r||0!==e[0]||(e.push(i),o.push(o[0])),s.push(new Fc(".morphTargetInfluences["+t[a].name+"]",e,o).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let a=0,o=e.length;a<o;a++){const t=e[a],n=t.name.match(i);if(n&&n.length>1){const e=n[1];let i=r[e];i||(r[e]=i=[]),i.push(t)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const s=[],a=[];Mc(n,s,a,r),0!==s.length&&i.push(new e(t,s,a))}},r=[],i=e.name||"default",s=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let c=0;c<l.length;c++){const e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){const t={};let n;for(n=0;n<e.length;n++)if(e[n].morphTargets)for(let r=0;r<e[n].morphTargets.length;r++)t[e[n].morphTargets[r]]=-1;for(const i in t){const t=[],s=[];for(let r=0;r!==e[n].morphTargets.length;++r){const r=e[n];t.push(r.time),s.push(r.morphTarget===i?1:0)}r.push(new Fc(".morphTargetInfluence["+i+"]",t,s))}o=t.length*s}else{const i=".bones["+t[c].name+"]";n(kc,i+".position",e,"pos",r),n(Oc,i+".quaternion",e,"rot",r),n(kc,i+".scale",e,"scl",r)}}if(0===r.length)return null;return new this(i,o,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function zc(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Fc;case"vector":case"vector2":case"vector3":case"vector4":return kc;case"color":return Lc;case"quaternion":return Oc;case"bool":case"boolean":return Dc;case"string":return Nc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];Mc(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Qc={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Vc{constructor(e,t,n){const r=this;let i,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const Hc=new Vc;class jc{constructor(e){this.manager=void 0!==e?e:Hc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Wc={};class Xc extends Error{constructor(e,t){super(e),this.response=t}}class Yc extends jc{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Qc.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Wc[e])return void Wc[e].push({onLoad:t,onProgress:n,onError:r});Wc[e]=[],Wc[e].push({onLoad:t,onProgress:n,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).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 n=Wc[e],r=t.body.getReader(),i=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),s=i?parseInt(i):0,a=0!==s;let o=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{o+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw new Xc(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{Qc.add(e,t);const n=Wc[e];delete Wc[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=Wc[e];if(void 0===n)throw this.manager.itemError(e),t;delete Wc[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class qc extends jc{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Qc.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a=tt("img");function o(){c(),Qc.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class Kc extends Sn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Vn(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}}class Jc extends Kc{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Sn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Vn(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Zc=new Zt,$c=new Et,eh=new Et;class th{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new qe(512,512),this.map=null,this.mapPass=null,this.matrix=new Zt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Yr,this._frameExtents=new qe(1,1),this._viewportCount=1,this._viewports=[new At(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;$c.setFromMatrixPosition(e.matrixWorld),t.position.copy($c),eh.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(eh),t.updateMatrixWorld(),Zc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Zc),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Zc)}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 nh extends th{constructor(){super(new Or(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*Ne*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class rh extends Kc{constructor(e,t,n=0,r=Math.PI/3,i=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Sn.DEFAULT_UP),this.updateMatrix(),this.target=new Sn,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new nh}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 ih=new Zt,sh=new Et,ah=new Et;class oh extends th{constructor(){super(new Or(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new qe(4,2),this._viewportCount=6,this._viewports=[new At(2,1,1,1),new At(0,1,1,1),new At(3,1,1,1),new At(1,1,1,1),new At(3,0,1,1),new At(1,0,1,1)],this._cubeDirections=[new Et(1,0,0),new Et(-1,0,0),new Et(0,0,1),new Et(0,0,-1),new Et(0,1,0),new Et(0,-1,0)],this._cubeUps=[new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,0,1),new Et(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),sh.setFromMatrixPosition(e.matrixWorld),n.position.copy(sh),ah.copy(n.position),ah.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ah),n.updateMatrixWorld(),r.makeTranslation(-sh.x,-sh.y,-sh.z),ih.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ih)}}class lh extends Kc{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new oh}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 ch extends th{constructor(){super(new li(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class hh extends Kc{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Sn.DEFAULT_UP),this.updateMatrix(),this.target=new Sn,this.shadow=new ch}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class uh extends Kc{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class dh extends Kc{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class ph{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Et)}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 n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],n*i*1.092548),t.addScaledVector(s[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*n*i),t.addScaledVector(s[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],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 n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class fh extends Kc{constructor(e=new ph,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 mh extends jc{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,s=new Yc(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=mh.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new Vn).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const i in e.uniforms){const t=e.uniforms[i];switch(r.uniforms[i]={},t.type){case"t":r.uniforms[i].value=n(t.value);break;case"c":r.uniforms[i].value=(new Vn).setHex(t.value);break;case"v2":r.uniforms[i].value=(new qe).fromArray(t.value);break;case"v3":r.uniforms[i].value=(new Et).fromArray(t.value);break;case"v4":r.uniforms[i].value=(new At).fromArray(t.value);break;case"m3":r.uniforms[i].value=(new Ke).fromArray(t.value);break;case"m4":r.uniforms[i].value=(new Zt).fromArray(t.value);break;default:r.uniforms[i].value=t.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new qe).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new qe).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:uc,SpriteMaterial:Ua,RawShaderMaterial:dc,ShaderMaterial:Fr,PointsMaterial:Lo,MeshPhysicalMaterial:fc,MeshStandardMaterial:pc,MeshPhongMaterial:mc,MeshToonMaterial:gc,MeshNormalMaterial:Ac,MeshLambertMaterial:vc,MeshDepthMaterial:pa,MeshDistanceMaterial:fa,MeshBasicMaterial:jn,MeshMatcapMaterial:yc,LineDashedMaterial:xc,LineBasicMaterial:_o,Material:Nn}[e]}}class gh{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(n){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Ah extends hr{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class vh extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Yc(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],s=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers,i=r[t],s=new Uint32Array(i).buffer;return n[t]=s,s}(e,i.buffer),a=et(i.type,s),o=new Da(a,i.stride);return o.uuid=i.uuid,t[r]=o,o}const i=e.isInstancedBufferGeometry?new Ah:new hr,s=e.data.index;if(void 0!==s){const e=et(s.type,s.array);i.setIndex(new $n(e,1))}const a=e.data.attributes;for(const h in a){const t=a[h];let n;if(t.isInterleavedBufferAttribute){const i=r(e.data,t.data);n=new Fa(i,t.itemSize,t.offset,t.normalized)}else{const e=et(t.type,t.array);n=new(t.isInstancedBufferAttribute?fo:$n)(e,t.itemSize,t.normalized)}void 0!==t.name&&(n.name=t.name),void 0!==t.usage&&n.setUsage(t.usage),void 0!==t.updateRange&&(n.updateRange.offset=t.updateRange.offset,n.updateRange.count=t.updateRange.count),i.setAttribute(h,n)}const o=e.data.morphAttributes;if(o)for(const h in o){const t=o[h],n=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];let a;if(s.isInterleavedBufferAttribute){const t=r(e.data,s.data);a=new Fa(t,s.itemSize,s.offset,s.normalized)}else{const e=et(s.type,s.array);a=new $n(e,s.itemSize,s.normalized)}void 0!==s.name&&(a.name=s.name),n.push(a)}i.morphAttributes[h]=n}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let h=0,u=l.length;h!==u;++h){const e=l[h];i.addGroup(e.start,e.count,e.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new Et;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new Vt(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}const yh={UVMapping:v,CubeReflectionMapping:y,CubeRefractionMapping:x,EquirectangularReflectionMapping:b,EquirectangularRefractionMapping:E,CubeUVReflectionMapping:_},xh={RepeatWrapping:S,ClampToEdgeWrapping:w,MirroredRepeatWrapping:M},bh={NearestFilter:C,NearestMipmapNearestFilter:T,NearestMipmapLinearFilter:I,LinearFilter:B,LinearMipmapNearestFilter:R,LinearMipmapLinearFilter:P};let Eh;class _h{static getContext(){return void 0===Eh&&(Eh=new(window.AudioContext||window.webkitAudioContext)),Eh}static setContext(e){Eh=e}}const Sh=new Zt,wh=new Zt,Mh=new Zt;class Ch{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Th(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Th();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Th(){return("undefined"==typeof performance?Date:performance).now()}const Ih=new Et,Bh=new bt,Rh=new Et,Ph=new Et;class Dh extends Sn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Lh=new Et,Fh=new bt,Uh=new Et,Oh=new Et;class Nh{constructor(e,t,n){let r,i,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==r;++e)n[i+e]=n[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(n[o]!==n[o+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let i=n,s=r;i!==s;++i)t[i]=t[r+i%n];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 n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let s=0;s!==i;++s)e[t+s]=e[n+s]}_slerp(e,t,n,r){bt.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const s=this._workIndex*i;bt.multiplyQuaternionsFlat(e,s,e,t,e,n),bt.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,n,r,i){const s=1-r;for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]*s+e[n+a]*r}}_lerpAdditive(e,t,n,r,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[n+s]*r}}}const kh="\\[\\]\\.:\\/",Gh=new RegExp("["+kh+"]","g"),zh="[^"+kh+"]",Qh="[^"+kh.replace("\\.","")+"]",Vh=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",zh)+/(WCOD+)?/.source.replace("WCOD",Qh)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zh)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zh)+"$"),Hh=["material","materials","bones","map"];class jh{constructor(e,t,n){this.path=t,this.parsedPath=n||jh.parseTrackName(t),this.node=jh.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new jh.Composite(e,t,n):new jh(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Gh,"")}static parseTrackName(e){const t=Vh.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==Hh.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const s=n(i.children);if(s)return s}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=jh.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const s=e[r];if(void 0===s){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}jh.Composite=class{constructor(e,t,n){const r=n||jh.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},jh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},jh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},jh.prototype.GetterByBindingType=[jh.prototype._getValue_direct,jh.prototype._getValue_array,jh.prototype._getValue_arrayElement,jh.prototype._getValue_toArray],jh.prototype.SetterByBindingTypeAndVersioning=[[jh.prototype._setValue_direct,jh.prototype._setValue_direct_setNeedsUpdate,jh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[jh.prototype._setValue_array,jh.prototype._setValue_array_setNeedsUpdate,jh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[jh.prototype._setValue_arrayElement,jh.prototype._setValue_arrayElement_setNeedsUpdate,jh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[jh.prototype._setValue_fromArray,jh.prototype._setValue_fromArray_setNeedsUpdate,jh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Wh{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,s=i.length,a=new Array(s),o={endingStart:ye,endingEnd:ye};for(let l=0;l!==s;++l){const e=i[l].createInterpolant(null);a[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,s=n/r;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=i,o[1]=i+n,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);const s=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===_e)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(s),t[n].accumulateAdditive(a);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(s),t[n].accumulate(r,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const s=2202===n;if(0===e)return-1===i?r:s&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(s&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=xe,r.endingEnd=xe):(r.endingStart=e?this.zeroSlopeAtStart?xe:ye:be,r.endingEnd=t?this.zeroSlopeAtEnd?xe:ye:be)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let s=this._weightInterpolant;null===s&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=i,o[0]=t,a[1]=i+e,o[1]=n,this}}const Xh=new Float32Array(1);class Yh{constructor(e){this.value=e}clone(){return new Yh(void 0===this.value.clone?this.value:this.value.clone())}}let qh=0;function Kh(e,t){return e.distance-t.distance}function Jh(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)Jh(r[e],t,n,!0)}}const Zh=new qe;const $h=new Et,eu=new Et;const tu=new Et;const nu=new Et,ru=new Zt,iu=new Zt;function su(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,su(e.children[n]));return t}const au=new Et,ou=new Vn,lu=new Vn;const cu=new Et,hu=new Et,uu=new Et;const du=new Et,pu=new Ur;function fu(e,t,n,r,i,s,a){du.set(i,s,a).unproject(r);const o=t[e];if(void 0!==o){const e=n.getAttribute("position");for(let t=0,n=o.length;t<n;t++)e.setXYZ(o[t],du.x,du.y,du.z)}}const mu=new wt;const gu=new Et;let Au,vu;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n),t.ACESFilmicToneMapping=g,t.AddEquation=l,t.AddOperation=u,t.AdditiveAnimationBlendMode=_e,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=uh,t.AmbientLightProbe=class extends fh{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const n=(new Vn).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}},t.AnimationAction=Wh,t.AnimationClip=Gc,t.AnimationLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Yc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Gc.parse(e[n]);t.push(r)}return t}},t.AnimationMixer=class extends Le{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,s=e._propertyBindings,a=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let h=0;h!==i;++h){const e=r[h],i=e.name;let l=c[i];if(void 0!==l)++l.referenceCount,s[h]=l;else{if(l=s[h],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,i));continue}const r=t&&t._propertyBindings[h].binding.parsedPath;l=new Nh(jh.create(n,i,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,i),s[h]=l}a[h].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}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<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let s=i[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,s=this._actionsByClip,a=s[i],o=a.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;delete a.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete s[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const e=t[n];0==--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let s=r[t];void 0===s&&(s={},r[t]=s),s[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,s=this._bindingsByRootAndName,a=s[r],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete a[i],0===Object.keys(a).length&&delete s[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new Bc(new Float32Array(2),new Float32Array(2),1,Xh),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let s="string"==typeof e?Gc.findByName(r,e):e;const a=null!==s?s.uuid:e,o=this._actionsByClip[a];let l=null;if(void 0===n&&(n=null!==s?s.blendMode:Ee),void 0!==o){const e=o.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=o.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new Wh(this,s,t,n);return this._bindAction(c,l),this._addInactiveAction(c,a,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?Gc.findByName(n,e):e,s=i?i.uuid:e,a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let l=0;l!==n;++l){t[l]._update(r,e,i,s)}const a=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)a[l].apply(s);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,s=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,s._cacheIndex=i,t[i]=s,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const i in n){const e=n[i].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const i in r){const e=r[i];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}},t.AnimationObjectGroup=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=ke(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,s=i.length;let a,o=e.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=t[u];if(void 0===d){d=o++,t[u]=d,e.push(h);for(let e=0,t=s;e!==t;++e)i[e].push(new jh(h,n[e],r[e]))}else if(d<l){a=e[d];const o=--l,c=e[o];t[c.uuid]=d,e[d]=c,t[u]=o,e[o]=h;for(let e=0,t=s;e!==t;++e){const t=i[e],s=t[o];let a=t[d];t[d]=s,void 0===a&&(a=new jh(h,n[e],r[e])),t[o]=a}}else e[d]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s],o=a.uuid,l=t[o];if(void 0!==l&&l>=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[o]=s,e[s]=a;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[s],i=t[l];t[l]=r,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,s=e.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<i){const a=--i,o=e[a],c=--s,h=e[c];t[o.uuid]=l,e[l]=o,t[h.uuid]=a,e[a]=h,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[c];t[l]=r,t[a]=i,t.pop()}}else{const i=--s,a=e[i];i>0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);r=i.length,n[e]=r,s.push(e),a.push(t),i.push(h);for(let u=c,d=o.length;u!==d;++u){const n=o[u];h[u]=new jh(n,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];t[e[a]]=n,s[n]=o,s.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}},t.AnimationUtils=Cc,t.ArcCurve=Ho,t.ArrayCamera=ya,t.ArrowHelper=class extends Sn{constructor(e=new Et(0,0,1),t=new Et(0,0,0),n=1,r=16776960,i=.2*n,s=.2*i){super(),this.type="ArrowHelper",void 0===Au&&(Au=new hr,Au.setAttribute("position",new nr([0,0,0,0,1,0],3)),vu=new pl(0,.5,1,5,1),vu.translate(0,-.5,0)),this.position.copy(t),this.line=new Io(Au,new _o({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Tr(vu,new jn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{gu.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(gu,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},t.Audio=Dh,t.AudioAnalyser=class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}},t.AudioContext=_h,t.AudioListener=class extends Sn{constructor(){super(),this.type="AudioListener",this.context=_h.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ch}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ih,Bh,Rh),Ph.set(0,0,-1).applyQuaternion(Bh),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ih.x,e),t.positionY.linearRampToValueAtTime(Ih.y,e),t.positionZ.linearRampToValueAtTime(Ih.z,e),t.forwardX.linearRampToValueAtTime(Ph.x,e),t.forwardY.linearRampToValueAtTime(Ph.y,e),t.forwardZ.linearRampToValueAtTime(Ph.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(Ih.x,Ih.y,Ih.z),t.setOrientation(Ph.x,Ph.y,Ph.z,n.x,n.y,n.z)}},t.AudioLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Yc(this.manager);function a(t){r?r(t):console.error(t),i.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){try{const n=e.slice(0);_h.getContext().decodeAudioData(n,(function(e){t(e)}),a)}catch(n){a(n)}}),n,r)}},t.AxesHelper=class extends Po{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new hr;n.setAttribute("position",new nr(t,3)),n.setAttribute("color",new nr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new _o({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Vn,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BackSide=o,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.Bone=lo,t.BooleanKeyframeTrack=Dc,t.Box2=class{constructor(e=new qe(1/0,1/0),t=new qe(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Zh.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}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}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))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Zh).distanceTo(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}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)}},t.Box3=wt,t.Box3Helper=class extends Po{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new hr;r.setIndex(new $n(n,1)),r.setAttribute("position",new nr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new _o({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BoxBufferGeometry=class extends Br{constructor(e,t,n,r,i,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,n,r,i,s)}},t.BoxGeometry=Br,t.BoxHelper=class extends Po{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new hr;i.setIndex(new $n(n,1)),i.setAttribute("position",new $n(r,3)),super(i,new _o({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&mu.setFromObject(this.object),mu.isEmpty())return;const t=mu.min,n=mu.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BufferAttribute=$n,t.BufferGeometry=hr,t.BufferGeometryLoader=vh,t.ByteType=1010,t.Cache=Qc,t.Camera=Ur,t.CameraHelper=class extends Po{constructor(e){const t=new hr,n=new _o({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],s={};function a(e,t){o(e),o(t)}function o(e){r.push(0,0,0),i.push(0,0,0),void 0===s[e]&&(s[e]=[]),s[e].push(r.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),t.setAttribute("position",new nr(r,3)),t.setAttribute("color",new nr(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new Vn(16755200),c=new Vn(16711680),h=new Vn(43775),u=new Vn(16777215),d=new Vn(3355443);this.setColors(l,c,h,u,d)}setColors(e,t,n,r,i){const s=this.geometry.getAttribute("color");s.setXYZ(0,e.r,e.g,e.b),s.setXYZ(1,e.r,e.g,e.b),s.setXYZ(2,e.r,e.g,e.b),s.setXYZ(3,e.r,e.g,e.b),s.setXYZ(4,e.r,e.g,e.b),s.setXYZ(5,e.r,e.g,e.b),s.setXYZ(6,e.r,e.g,e.b),s.setXYZ(7,e.r,e.g,e.b),s.setXYZ(8,e.r,e.g,e.b),s.setXYZ(9,e.r,e.g,e.b),s.setXYZ(10,e.r,e.g,e.b),s.setXYZ(11,e.r,e.g,e.b),s.setXYZ(12,e.r,e.g,e.b),s.setXYZ(13,e.r,e.g,e.b),s.setXYZ(14,e.r,e.g,e.b),s.setXYZ(15,e.r,e.g,e.b),s.setXYZ(16,e.r,e.g,e.b),s.setXYZ(17,e.r,e.g,e.b),s.setXYZ(18,e.r,e.g,e.b),s.setXYZ(19,e.r,e.g,e.b),s.setXYZ(20,e.r,e.g,e.b),s.setXYZ(21,e.r,e.g,e.b),s.setXYZ(22,e.r,e.g,e.b),s.setXYZ(23,e.r,e.g,e.b),s.setXYZ(24,t.r,t.g,t.b),s.setXYZ(25,t.r,t.g,t.b),s.setXYZ(26,t.r,t.g,t.b),s.setXYZ(27,t.r,t.g,t.b),s.setXYZ(28,t.r,t.g,t.b),s.setXYZ(29,t.r,t.g,t.b),s.setXYZ(30,t.r,t.g,t.b),s.setXYZ(31,t.r,t.g,t.b),s.setXYZ(32,n.r,n.g,n.b),s.setXYZ(33,n.r,n.g,n.b),s.setXYZ(34,n.r,n.g,n.b),s.setXYZ(35,n.r,n.g,n.b),s.setXYZ(36,n.r,n.g,n.b),s.setXYZ(37,n.r,n.g,n.b),s.setXYZ(38,r.r,r.g,r.b),s.setXYZ(39,r.r,r.g,r.b),s.setXYZ(40,i.r,i.g,i.b),s.setXYZ(41,i.r,i.g,i.b),s.setXYZ(42,i.r,i.g,i.b),s.setXYZ(43,i.r,i.g,i.b),s.setXYZ(44,i.r,i.g,i.b),s.setXYZ(45,i.r,i.g,i.b),s.setXYZ(46,i.r,i.g,i.b),s.setXYZ(47,i.r,i.g,i.b),s.setXYZ(48,i.r,i.g,i.b),s.setXYZ(49,i.r,i.g,i.b),s.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;pu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),fu("c",t,e,pu,0,0,-1),fu("t",t,e,pu,0,0,1),fu("n1",t,e,pu,-1,-1,-1),fu("n2",t,e,pu,1,-1,-1),fu("n3",t,e,pu,-1,1,-1),fu("n4",t,e,pu,1,1,-1),fu("f1",t,e,pu,-1,-1,1),fu("f2",t,e,pu,1,-1,1),fu("f3",t,e,pu,-1,1,1),fu("f4",t,e,pu,1,1,1),fu("u1",t,e,pu,.7,1.1,-1),fu("u2",t,e,pu,-.7,1.1,-1),fu("u3",t,e,pu,0,2,-1),fu("cf1",t,e,pu,-1,0,1),fu("cf2",t,e,pu,1,0,1),fu("cf3",t,e,pu,0,-1,1),fu("cf4",t,e,pu,0,1,1),fu("cn1",t,e,pu,-1,0,-1),fu("cn2",t,e,pu,1,0,-1),fu("cn3",t,e,pu,0,-1,-1),fu("cn4",t,e,pu,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasTexture=class extends gt{constructor(e,t,n,r,i,s,a,o,l){super(e,t,n,r,i,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},t.CapsuleBufferGeometry=class extends ul{constructor(e,t,n,r){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,n,r)}},t.CapsuleGeometry=ul,t.CatmullRomCurve3=Ko,t.CineonToneMapping=m,t.CircleBufferGeometry=class extends dl{constructor(e,t,n,r){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,n,r)}},t.CircleGeometry=dl,t.ClampToEdgeWrapping=w,t.Clock=Ch,t.Color=Vn,t.ColorKeyframeTrack=Lc,t.ColorManagement=ht,t.CompressedArrayTexture=class extends zo{constructor(e,t,n,r,i,s){super(e,t,n,i,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=w}},t.CompressedTexture=zo,t.CompressedTextureLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=[],a=new zo,o=new Yc(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials);let l=0;function c(c){o.load(e[c],(function(e){const n=i.parse(e,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=B),a.image=s,a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(Array.isArray(e))for(let h=0,u=e.length;h<u;++h)c(h);else o.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)s[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),s[t].format=n.format,s[t].width=n.width,s[t].height=n.height}a.image=s}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=B),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a}},t.ConeBufferGeometry=class extends fl{constructor(e,t,n,r,i,s,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,n,r,i,s,a)}},t.ConeGeometry=fl,t.CubeCamera=kr,t.CubeReflectionMapping=y,t.CubeRefractionMapping=x,t.CubeTexture=Gr,t.CubeTextureLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=new Gr,s=new qc(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function o(n){s.load(e[n],(function(e){i.images[n]=e,a++,6===a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let l=0;l<e.length;++l)o(l);return i}},t.CubeUVReflectionMapping=_,t.CubicBezierCurve=el,t.CubicBezierCurve3=tl,t.CubicInterpolant=Ic,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=Qo,t.CurvePath=ll,t.CustomBlending=5,t.CustomToneMapping=A,t.CylinderBufferGeometry=class extends pl{constructor(e,t,n,r,i,s,a,o){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,n,r,i,s,a,o)}},t.CylinderGeometry=pl,t.Cylindrical=class{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}},t.Data3DTexture=xt,t.DataArrayTexture=yt,t.DataTexture=co,t.DataTextureLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new co,a=new Yc(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?s.image=n.image:void 0!==n.data&&(s.image.width=n.width,s.image.height=n.height,s.image.data=n.data),s.wrapS=void 0!==n.wrapS?n.wrapS:w,s.wrapT=void 0!==n.wrapT?n.wrapT:w,s.magFilter=void 0!==n.magFilter?n.magFilter:B,s.minFilter=void 0!==n.minFilter?n.minFilter:B,s.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace?s.colorSpace=n.colorSpace:void 0!==n.encoding&&(s.encoding=n.encoding),void 0!==n.flipY&&(s.flipY=n.flipY),void 0!==n.format&&(s.format=n.format),void 0!==n.type&&(s.type=n.type),void 0!==n.mipmaps&&(s.mipmaps=n.mipmaps,s.minFilter=P),1===n.mipmapCount&&(s.minFilter=B),void 0!==n.generateMipmaps&&(s.generateMipmaps=n.generateMipmaps),s.needsUpdate=!0,t&&t(s,n))}),n,r),s}},t.DataUtils=Kn,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=Hc,t.DepthFormat=G,t.DepthStencilFormat=z,t.DepthTexture=_a,t.DirectionalLight=hh,t.DirectionalLightHelper=class extends Sn{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===t&&(t=1);let r=new hr;r.setAttribute("position",new nr([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new _o({fog:!1,toneMapped:!1});this.lightPlane=new Io(r,i),this.add(this.lightPlane),r=new hr,r.setAttribute("position",new nr([0,0,0,0,0,1],3)),this.targetLine=new Io(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),cu.setFromMatrixPosition(this.light.matrixWorld),hu.setFromMatrixPosition(this.light.target.matrixWorld),uu.subVectors(hu,cu),this.lightPlane.lookAt(hu),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(hu),this.targetLine.scale.z=uu.length()}},t.DiscreteInterpolant=Rc,t.DisplayP3ColorSpace=Ie,t.DodecahedronBufferGeometry=class extends gl{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}},t.DodecahedronGeometry=gl,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicCopyUsage=35050,t.DynamicDrawUsage=35048,t.DynamicReadUsage=35049,t.EdgesGeometry=bl,t.EllipseCurve=Vo,t.EqualDepth=4,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=b,t.EquirectangularRefractionMapping=E,t.Euler=cn,t.EventDispatcher=Le,t.ExtrudeBufferGeometry=class extends Jl{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}},t.ExtrudeGeometry=Jl,t.FileLoader=Yc,t.Float16BufferAttribute=class extends $n{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=qn(this.array[e*this.itemSize]);return this.normalized&&(t=We(t,this.array)),t}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize]=Yn(t),this}getY(e){let t=qn(this.array[e*this.itemSize+1]);return this.normalized&&(t=We(t,this.array)),t}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+1]=Yn(t),this}getZ(e){let t=qn(this.array[e*this.itemSize+2]);return this.normalized&&(t=We(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+2]=Yn(t),this}getW(e){let t=qn(this.array[e*this.itemSize+3]);return this.normalized&&(t=We(t,this.array)),t}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+3]=Yn(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this.array[e+2]=Yn(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this.array[e+2]=Yn(r),this.array[e+3]=Yn(i),this}},t.Float32BufferAttribute=nr,t.Float64BufferAttribute=class extends $n{constructor(e,t,n){super(new Float64Array(e),t,n)}},t.FloatType=U,t.Fog=Ra,t.FogExp2=Ba,t.FramebufferTexture=class extends gt{constructor(e,t,n){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=n,this.magFilter=C,this.minFilter=C,this.generateMipmaps=!1,this.needsUpdate=!0}},t.FrontSide=a,t.Frustum=Yr,t.GLBufferAttribute=class{constructor(e,t,n,r,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},t.GLSL1="100",t.GLSL3=Pe,t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=class extends Po{constructor(e=10,t=10,n=4473924,r=8947848){n=new Vn(n),r=new Vn(r);const i=t/2,s=e/t,a=e/2,o=[],l=[];for(let h=0,u=0,d=-a;h<=t;h++,d+=s){o.push(-a,0,d,a,0,d),o.push(d,0,-a,d,0,a);const e=h===i?n:r;e.toArray(l,u),u+=3,e.toArray(l,u),u+=3,e.toArray(l,u),u+=3,e.toArray(l,u),u+=3}const c=new hr;c.setAttribute("position",new nr(o,3)),c.setAttribute("color",new nr(l,3));super(c,new _o({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},t.Group=xa,t.HalfFloatType=O,t.HemisphereLight=Jc,t.HemisphereLightHelper=class extends Sn{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new ec(t);r.rotateY(.5*Math.PI),this.material=new jn({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),s=new Float32Array(3*i.count);r.setAttribute("color",new $n(s,3)),this.add(new Tr(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");ou.copy(this.light.color),lu.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?ou:lu;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(au.setFromMatrixPosition(this.light.matrixWorld).negate())}},t.HemisphereLightProbe=class extends fh{constructor(e,t,n=1){super(void 0,n),this.isHemisphereLightProbe=!0;const r=(new Vn).set(e),i=(new Vn).set(t),s=new Et(r.r,r.g,r.b),a=new Et(i.r,i.g,i.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(o),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(l)}},t.IcosahedronBufferGeometry=class extends $l{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}},t.IcosahedronGeometry=$l,t.ImageBitmapLoader=class extends jc{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Qc.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Qc.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}},t.ImageLoader=qc,t.ImageUtils=dt,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=fo,t.InstancedBufferGeometry=Ah,t.InstancedInterleavedBuffer=class extends Da{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},t.InstancedMesh=Eo,t.Int16BufferAttribute=class extends $n{constructor(e,t,n){super(new Int16Array(e),t,n)}},t.Int32BufferAttribute=class extends $n{constructor(e,t,n){super(new Int32Array(e),t,n)}},t.Int8BufferAttribute=class extends $n{constructor(e,t,n){super(new Int8Array(e),t,n)}},t.IntType=1013,t.InterleavedBuffer=Da,t.InterleavedBufferAttribute=Fa,t.Interpolant=Tc,t.InterpolateDiscrete=ge,t.InterpolateLinear=Ae,t.InterpolateSmooth=ve,t.InvertStencilOp=5386,t.KeepStencilOp=Be,t.KeyframeTrack=Pc,t.LOD=eo,t.LatheBufferGeometry=class extends hl{constructor(e,t,n,r){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,n,r)}},t.LatheGeometry=hl,t.Layers=hn,t.LessDepth=2,t.LessEqualDepth=3,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=Kc,t.LightProbe=fh,t.Line=Io,t.Line3=class{constructor(e=new Et,t=new Et){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){$h.subVectors(e,this.start),eu.subVectors(this.end,this.start);const n=eu.dot(eu);let r=eu.dot($h)/n;return t&&(r=Ge(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},t.LineBasicMaterial=_o,t.LineCurve=nl,t.LineCurve3=rl,t.LineDashedMaterial=xc,t.LineLoop=Do,t.LineSegments=Po,t.LinearEncoding=Se,t.LinearFilter=B,t.LinearInterpolant=Bc,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=P,t.LinearMipmapNearestFilter=R,t.LinearSRGBColorSpace=Te,t.LinearToneMapping=p,t.Loader=jc,t.LoaderUtils=gh,t.LoadingManager=Vc,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=1025,t.LuminanceFormat=1024,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=Nn,t.MaterialLoader=mh,t.MathUtils=Ye,t.Matrix3=Ke,t.Matrix4=Zt,t.MaxEquation=104,t.Mesh=Tr,t.MeshBasicMaterial=jn,t.MeshDepthMaterial=pa,t.MeshDistanceMaterial=fa,t.MeshLambertMaterial=vc,t.MeshMatcapMaterial=yc,t.MeshNormalMaterial=Ac,t.MeshPhongMaterial=mc,t.MeshPhysicalMaterial=fc,t.MeshStandardMaterial=pc,t.MeshToonMaterial=gc,t.MinEquation=103,t.MirroredRepeatWrapping=M,t.MixOperation=h,t.MultiplyBlending=4,t.MultiplyOperation=c,t.NearestFilter=C,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=I,t.NearestMipmapNearestFilter=T,t.NeverDepth=0,t.NeverStencilFunc=512,t.NoBlending=0,t.NoColorSpace=Me,t.NoToneMapping=d,t.NormalAnimationBlendMode=Ee,t.NormalBlending=1,t.NotEqualDepth=7,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=Fc,t.Object3D=Sn,t.ObjectLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===this.path?gh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Yc(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){let s=null;try{s=JSON.parse(n)}catch(o){return void 0!==r&&r(o),void console.error("THREE:ObjectLoader: Can't parse "+e+".",o.message)}const a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(s,t)}),n,r)}async loadAsync(e,t){const n=""===this.path?gh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new Yc(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),s=JSON.parse(i),a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,i,o,a,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in s)if(s[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,s),o=this.parseObject(e.object,r,a,s,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new El).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let i=0,s=e.length;i<s;i++){const t=(new po).fromJSON(e[i],r);n[t.uuid]=t}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new vh;for(let i=0,s=e.length;i<s;i++){let s;const a=e[i];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(a);break;default:a.type in hc?s=hc[a.type].fromJSON(a,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${a.type}"`)}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.userData&&(s.userData=a.userData),n[a.uuid]=s}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new mh;i.setTextures(t);for(let t=0,s=e.length;t<s;t++){const s=e[t];void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=Gc.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function s(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:et(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Vc(t);i=new qc(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=s(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new co(n.data,n.width,n.height)))}r[n.uuid]=new pt(e)}else{const e=s(n.url);r[n.uuid]=new pt(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"==typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:et(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new qc(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.url;if(Array.isArray(s)){const e=[];for(let t=0,n=s.length;t<n;t++){const n=s[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new co(r.data,r.width,r.height)))}n[r.uuid]=new pt(e)}else{const e=await i(r.url);n[r.uuid]=new pt(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,s=e.length;i<s;i++){const s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const a=t[s.image],o=a.data;let l;Array.isArray(o)?(l=new Gr,6===o.length&&(l.needsUpdate=!0)):(l=o&&o.data?new co:new gt,o&&(l.needsUpdate=!0)),l.source=a,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=n(s.mapping,yh)),void 0!==s.channel&&(l.channel=s.channel),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=n(s.wrap[0],xh),l.wrapT=n(s.wrap[1],xh)),void 0!==s.format&&(l.format=s.format),void 0!==s.internalFormat&&(l.internalFormat=s.internalFormat),void 0!==s.type&&(l.type=s.type),void 0!==s.colorSpace&&(l.colorSpace=s.colorSpace),void 0!==s.encoding&&(l.encoding=s.encoding),void 0!==s.minFilter&&(l.minFilter=n(s.minFilter,bh)),void 0!==s.magFilter&&(l.magFilter=n(s.magFilter,bh)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.generateMipmaps&&(l.generateMipmaps=s.generateMipmaps),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(l.userData=s.userData),r[s.uuid]=l}return r}parseObject(e,t,n,r,i){let s,a,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function h(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":s=new Pa,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new Vn(e.background):s.background=h(e.background)),void 0!==e.environment&&(s.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Ra(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new Ba(e.fog.color,e.fog.density))),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":s=new Or(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new li(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new uh(e.color,e.intensity);break;case"DirectionalLight":s=new hh(e.color,e.intensity);break;case"PointLight":s=new lh(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new dh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new rh(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new Jc(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new fh).fromJSON(e);break;case"SkinnedMesh":a=l(e.geometry),o=c(e.material),s=new oo(a,o),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":a=l(e.geometry),o=c(e.material),s=new Tr(a,o);break;case"InstancedMesh":a=l(e.geometry),o=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;s=new Eo(a,o,t),s.instanceMatrix=new fo(new Float32Array(n.array),16),void 0!==r&&(s.instanceColor=new fo(new Float32Array(r.array),r.itemSize));break;case"LOD":s=new eo;break;case"Line":s=new Io(l(e.geometry),c(e.material));break;case"LineLoop":s=new Do(l(e.geometry),c(e.material));break;case"LineSegments":s=new Po(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new ko(l(e.geometry),c(e.material));break;case"Sprite":s=new Ka(c(e.material));break;case"Group":s=new xa;break;case"Bone":s=new lo;break;default:s=new Sn}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const a=e.children;for(let e=0;e<a.length;e++)s.add(this.parseObject(a[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];s.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=s.getObjectByProperty("uuid",n.object);void 0!==r&&s.addLevel(r,n.distance,n.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}},t.ObjectSpaceNormalMap=1,t.OctahedronBufferGeometry=class extends ec{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}},t.OctahedronGeometry=ec,t.OneFactor=201,t.OneMinusDstAlphaFactor=207,t.OneMinusDstColorFactor=209,t.OneMinusSrcAlphaFactor=205,t.OneMinusSrcColorFactor=203,t.OrthographicCamera=li,t.PCFShadowMap=r,t.PCFSoftShadowMap=i,t.PMREMGenerator=Ai,t.Path=cl,t.PerspectiveCamera=Or,t.Plane=jr,t.PlaneBufferGeometry=class extends Jr{constructor(e,t,n,r){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,n,r)}},t.PlaneGeometry=Jr,t.PlaneHelper=class extends Io{constructor(e,t=1,n=16776960){const r=n,i=new hr;i.setAttribute("position",new nr([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new _o({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new hr;s.setAttribute("position",new nr([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new Tr(s,new jn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},t.PointLight=lh,t.PointLightHelper=class extends Tr{constructor(e,t,n){super(new rc(t,4,2),new jn({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},t.Points=ko,t.PointsMaterial=Lo,t.PolarGridHelper=class extends Po{constructor(e=10,t=16,n=8,r=64,i=4473924,s=8947848){i=new Vn(i),s=new Vn(s);const a=[],o=[];if(t>1)for(let c=0;c<t;c++){const n=c/t*(2*Math.PI),r=Math.sin(n)*e,l=Math.cos(n)*e;a.push(0,0,0),a.push(r,0,l);const h=1&c?i:s;o.push(h.r,h.g,h.b),o.push(h.r,h.g,h.b)}for(let c=0;c<n;c++){const t=1&c?i:s,l=e-e/n*c;for(let e=0;e<r;e++){let n=e/r*(2*Math.PI),i=Math.sin(n)*l,s=Math.cos(n)*l;a.push(i,0,s),o.push(t.r,t.g,t.b),n=(e+1)/r*(2*Math.PI),i=Math.sin(n)*l,s=Math.cos(n)*l,a.push(i,0,s),o.push(t.r,t.g,t.b)}}const l=new hr;l.setAttribute("position",new nr(a,3)),l.setAttribute("color",new nr(o,3));super(l,new _o({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},t.PolyhedronBufferGeometry=class extends ml{constructor(e,t,n,r){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,n,r)}},t.PolyhedronGeometry=ml,t.PositionalAudio=class extends Dh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Lh,Fh,Uh),Oh.set(0,0,1).applyQuaternion(Fh);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Lh.x,e),t.positionY.linearRampToValueAtTime(Lh.y,e),t.positionZ.linearRampToValueAtTime(Lh.z,e),t.orientationX.linearRampToValueAtTime(Oh.x,e),t.orientationY.linearRampToValueAtTime(Oh.y,e),t.orientationZ.linearRampToValueAtTime(Oh.z,e)}else t.setPosition(Lh.x,Lh.y,Lh.z),t.setOrientation(Oh.x,Oh.y,Oh.z)}},t.PropertyBinding=jh,t.PropertyMixer=Nh,t.QuadraticBezierCurve=il,t.QuadraticBezierCurve3=sl,t.Quaternion=bt,t.QuaternionKeyframeTrack=Oc,t.QuaternionLinearInterpolant=Uc,t.RED_GREEN_RGTC2_Format=fe,t.RED_RGTC1_Format=36283,t.REVISION=n,t.RGBADepthPacking=3201,t.RGBAFormat=k,t.RGBAIntegerFormat=1033,t.RGBA_ASTC_10x10_Format=ce,t.RGBA_ASTC_10x5_Format=ae,t.RGBA_ASTC_10x6_Format=oe,t.RGBA_ASTC_10x8_Format=le,t.RGBA_ASTC_12x10_Format=he,t.RGBA_ASTC_12x12_Format=ue,t.RGBA_ASTC_4x4_Format=Z,t.RGBA_ASTC_5x4_Format=$,t.RGBA_ASTC_5x5_Format=ee,t.RGBA_ASTC_6x5_Format=te,t.RGBA_ASTC_6x6_Format=ne,t.RGBA_ASTC_8x5_Format=re,t.RGBA_ASTC_8x6_Format=ie,t.RGBA_ASTC_8x8_Format=se,t.RGBA_BPTC_Format=de,t.RGBA_ETC2_EAC_Format=J,t.RGBA_PVRTC_2BPPV1_Format=q,t.RGBA_PVRTC_4BPPV1_Format=Y,t.RGBA_S3TC_DXT1_Format=V,t.RGBA_S3TC_DXT3_Format=H,t.RGBA_S3TC_DXT5_Format=j,t.RGB_ETC1_Format=36196,t.RGB_ETC2_Format=K,t.RGB_PVRTC_2BPPV1_Format=X,t.RGB_PVRTC_4BPPV1_Format=W,t.RGB_S3TC_DXT1_Format=Q,t.RGFormat=1030,t.RGIntegerFormat=1031,t.RawShaderMaterial=dc,t.Ray=Jt,t.Raycaster=class{constructor(e,t,n=0,r=1/0){this.ray=new Jt(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new hn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return Jh(e,this,n,t),n.sort(Kh),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)Jh(e[r],this,n,t);return n.sort(Kh),n}},t.RectAreaLight=dh,t.RedFormat=1028,t.RedIntegerFormat=1029,t.ReinhardToneMapping=f,t.RepeatWrapping=S,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=102,t.RingBufferGeometry=class extends tc{constructor(e,t,n,r,i,s){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,n,r,i,s)}},t.RingGeometry=tc,t.SIGNED_RED_GREEN_RGTC2_Format=me,t.SIGNED_RED_RGTC1_Format=pe,t.SRGBColorSpace=Ce,t.Scene=Pa,t.ShaderChunk=Zr,t.ShaderLib=ei,t.ShaderMaterial=Fr,t.ShadowMaterial=uc,t.Shape=El,t.ShapeBufferGeometry=class extends nc{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}},t.ShapeGeometry=nc,t.ShapePath=class{constructor(){this.type="ShapePath",this.color=new Vn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new cl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],a=t[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[s],o=-o,a=t[i],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const n=Yl.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,s,a;const o=[];if(1===r.length)return s=r[0],a=new El,a.curves=s.curves,o.push(a),o;let l=!n(r[0].getPoints());l=e?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let m=0,g=r.length;m<g;m++)s=r[m],u=s.getPoints(),i=n(u),i=e?!i:i,i?(!l&&h[f]&&f++,h[f]={s:new El,p:u},h[f].s.curves=s.curves,l&&f++,p[f]=[]):p[f].push({h:s,p:u[0]});if(!h[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new El;i.curves=r.curves,t.push(i)}return t}(r);if(h.length>1){let e=!1,n=0;for(let t=0,r=h.length;t<r;t++)c[t]=[];for(let r=0,i=h.length;r<i;r++){const i=p[r];for(let s=0;s<i.length;s++){const a=i[s];let o=!0;for(let i=0;i<h.length;i++)t(a.p,h[i].p)&&(r!==i&&n++,o?(o=!1,c[i].push(a)):e=!0);o&&c[r].push(a)}}n>0&&!1===e&&(p=c)}for(let m=0,g=h.length;m<g;m++){a=h[m].s,o.push(a),d=p[m];for(let e=0,t=d.length;e<t;e++)a.holes.push(d[e].h)}return o}},t.ShapeUtils=Yl,t.ShortType=1011,t.Skeleton=po,t.SkeletonHelper=class extends Po{constructor(e){const t=su(e),n=new hr,r=[],i=[],s=new Vn(0,0,1),a=new Vn(0,1,0);for(let o=0;o<t.length;o++){const e=t[o];e.parent&&e.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(s.r,s.g,s.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new nr(r,3)),n.setAttribute("color",new nr(i,3));super(n,new _o({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");iu.copy(this.root.matrixWorld).invert();for(let i=0,s=0;i<t.length;i++){const e=t[i];e.parent&&e.parent.isBone&&(ru.multiplyMatrices(iu,e.matrixWorld),nu.setFromMatrixPosition(ru),r.setXYZ(s,nu.x,nu.y,nu.z),ru.multiplyMatrices(iu,e.parent.matrixWorld),nu.setFromMatrixPosition(ru),r.setXYZ(s+1,nu.x,nu.y,nu.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}},t.SkinnedMesh=oo,t.Source=pt,t.Sphere=Vt,t.SphereBufferGeometry=class extends rc{constructor(e,t,n,r,i,s,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,n,r,i,s,a)}},t.SphereGeometry=rc,t.Spherical=class{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ge(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},t.SphericalHarmonics3=ph,t.SplineCurve=al,t.SpotLight=rh,t.SpotLightHelper=class extends Sn{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new hr,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,o=32;s<o;s++,a++){const e=s/o*Math.PI*2,t=a/o*Math.PI*2;r.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}n.setAttribute("position",new nr(r,3));const i=new _o({fog:!1,toneMapped:!1});this.cone=new Po(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),tu.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(tu),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},t.Sprite=Ka,t.SpriteMaterial=Ua,t.SrcAlphaFactor=204,t.SrcAlphaSaturateFactor=210,t.SrcColorFactor=202,t.StaticCopyUsage=35046,t.StaticDrawUsage=Re,t.StaticReadUsage=35045,t.StereoCamera=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Or,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Or,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Mh.copy(e.projectionMatrix);const n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(Oe*t.fov*.5)/t.zoom;let s,a;wh.elements[12]=-n,Sh.elements[12]=n,s=-i*t.aspect+r,a=i*t.aspect+r,Mh.elements[0]=2*t.near/(a-s),Mh.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(Mh),s=-i*t.aspect-r,a=i*t.aspect-r,Mh.elements[0]=2*t.near/(a-s),Mh.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(Mh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(wh),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Sh)}},t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=Nc,t.SubtractEquation=101,t.SubtractiveBlending=3,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=0,t.TetrahedronBufferGeometry=class extends ic{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}},t.TetrahedronGeometry=ic,t.Texture=gt,t.TextureLoader=class extends jc{constructor(e){super(e)}load(e,t,n,r){const i=new gt,s=new qc(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}},t.TorusBufferGeometry=class extends sc{constructor(e,t,n,r,i){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,n,r,i)}},t.TorusGeometry=sc,t.TorusKnotBufferGeometry=class extends ac{constructor(e,t,n,r,i,s){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,n,r,i,s)}},t.TorusKnotGeometry=ac,t.Triangle=Un,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=class extends oc{constructor(e,t,n,r,i){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,n,r,i)}},t.TubeGeometry=oc,t.TwoPassDoubleSide=2,t.UVMapping=v,t.Uint16BufferAttribute=er,t.Uint32BufferAttribute=tr,t.Uint8BufferAttribute=class extends $n{constructor(e,t,n){super(new Uint8Array(e),t,n)}},t.Uint8ClampedBufferAttribute=class extends $n{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}},t.Uniform=Yh,t.UniformsGroup=class extends Le{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:qh++}),this.name="",this.usage=Re,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,r=t.length;n<r;n++)this.uniforms.push(t[n].clone());return this}clone(){return(new this.constructor).copy(this)}},t.UniformsLib=$r,t.UniformsUtils=Lr,t.UnsignedByteType=D,t.UnsignedInt248Type=N,t.UnsignedIntType=F,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShortType=L,t.VSMShadowMap=s,t.Vector2=qe,t.Vector3=Et,t.Vector4=At,t.VectorKeyframeTrack=kc,t.VideoTexture=class extends gt{constructor(e,t,n,r,i,s,a,o,l){super(e,t,n,r,i,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:B,this.magFilter=void 0!==i?i:B,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}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)}},t.WebGL1Renderer=Ia,t.WebGL3DRenderTarget=class extends vt{constructor(e=1,t=1,n=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new xt(null,e,t,n),this.texture.isRenderTargetTexture=!0}},t.WebGLArrayRenderTarget=class extends vt{constructor(e=1,t=1,n=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new yt(null,e,t,n),this.texture.isRenderTargetTexture=!0}},t.WebGLCubeRenderTarget=zr,t.WebGLMultipleRenderTargets=class extends vt{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let s=0;s<n;s++)this.texture[s]=i.clone(),this.texture[s].isRenderTargetTexture=!0}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}},t.WebGLRenderTarget=vt,t.WebGLRenderer=Ta,t.WebGLUtils=va,t.WireframeGeometry=lc,t.WrapAroundEnding=be,t.ZeroCurvatureEnding=ye,t.ZeroFactor=200,t.ZeroSlopeEnding=xe,t.ZeroStencilOp=0,t._SRGBAFormat=De,t.sRGBEncoding=we},85581:(e,t,n)=>{"use strict";function r(e){let t=0,n=0;for(const a of e)t+=a.w*a.h,n=Math.max(n,a.w);e.sort(((e,t)=>t.h-e.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}];let i=0,s=0;for(const a of e)for(let e=r.length-1;e>=0;e--){const t=r[e];if(!(a.w>t.w||a.h>t.h)){if(a.x=t.x,a.y=t.y,s=Math.max(s,a.y+a.h),i=Math.max(i,a.x+a.w),a.w===t.w&&a.h===t.h){const t=r.pop();e<r.length&&(r[e]=t)}else a.h===t.h?(t.x+=a.w,t.w-=a.w):a.w===t.w?(t.y+=a.h,t.h-=a.h):(r.push({x:t.x+a.w,y:t.y,w:t.w-a.w,h:a.h}),t.y+=a.h,t.h-=a.h);break}}return{w:i,h:s,fill:t/(i*s)||0}}n.r(t),n.d(t,{default:()=>r})},99477:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ACESFilmicToneMapping:()=>te,AddEquation:()=>S,AddOperation:()=>K,AdditiveAnimationBlendMode:()=>Bt,AdditiveBlending:()=>x,AlphaFormat:()=>De,AlwaysDepth:()=>z,AlwaysStencilFunc:()=>an,AmbientLight:()=>fd,AmbientLightProbe:()=>Rd,AnimationAction:()=>sp,AnimationClip:()=>Nu,AnimationLoader:()=>Xu,AnimationMixer:()=>op,AnimationObjectGroup:()=>ip,AnimationUtils:()=>wu,ArcCurve:()=>Qc,ArrayCamera:()=>fl,ArrowHelper:()=>Zp,Audio:()=>Vd,AudioAnalyser:()=>qd,AudioContext:()=>Td,AudioListener:()=>Qd,AudioLoader:()=>Id,AxesHelper:()=>$p,BackSide:()=>m,BasicDepthPacking:()=>Ut,BasicShadowMap:()=>h,Bone:()=>rc,BooleanKeyframeTrack:()=>Ru,Box2:()=>yp,Box3:()=>pr,Box3Helper:()=>Xp,BoxBufferGeometry:()=>tf,BoxGeometry:()=>Ss,BoxHelper:()=>Wp,BufferAttribute:()=>Gi,BufferGeometry:()=>is,BufferGeometryLoader:()=>bd,ByteType:()=>_e,Cache:()=>Gu,Camera:()=>Bs,CameraHelper:()=>Vp,CanvasTexture:()=>kc,CapsuleBufferGeometry:()=>nf,CapsuleGeometry:()=>ch,CatmullRomCurve3:()=>Yc,CineonToneMapping:()=>ee,CircleBufferGeometry:()=>rf,CircleGeometry:()=>hh,ClampToEdgeWrapping:()=>he,Clock:()=>Ud,Color:()=>Bi,ColorKeyframeTrack:()=>Pu,ColorManagement:()=>qn,CompressedArrayTexture:()=>Nc,CompressedTexture:()=>Oc,CompressedTextureLoader:()=>Yu,ConeBufferGeometry:()=>sf,ConeGeometry:()=>dh,CubeCamera:()=>Ds,CubeReflectionMapping:()=>ie,CubeRefractionMapping:()=>se,CubeTexture:()=>Ls,CubeTextureLoader:()=>Ku,CubeUVReflectionMapping:()=>le,CubicBezierCurve:()=>Zc,CubicBezierCurve3:()=>$c,CubicInterpolant:()=>Cu,CullFaceBack:()=>o,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>a,Curve:()=>Gc,CurvePath:()=>ah,CustomBlending:()=>_,CustomToneMapping:()=>ne,CylinderBufferGeometry:()=>af,CylinderGeometry:()=>uh,Cylindrical:()=>Ap,Data3DTexture:()=>ar,DataArrayTexture:()=>ir,DataTexture:()=>ic,DataTextureLoader:()=>Ju,DataUtils:()=>Oi,DecrementStencilOp:()=>Yt,DecrementWrapStencilOp:()=>Kt,DefaultLoadingManager:()=>Qu,DepthFormat:()=>Oe,DepthStencilFormat:()=>Ne,DepthTexture:()=>vl,DirectionalLight:()=>pd,DirectionalLightHelper:()=>Gp,DiscreteInterpolant:()=>Iu,DisplayP3ColorSpace:()=>Vt,DodecahedronBufferGeometry:()=>of,DodecahedronGeometry:()=>fh,DoubleSide:()=>g,DstAlphaFactor:()=>F,DstColorFactor:()=>O,DynamicCopyUsage:()=>fn,DynamicDrawUsage:()=>ln,DynamicReadUsage:()=>un,EdgesGeometry:()=>yh,EllipseCurve:()=>zc,EqualDepth:()=>H,EqualStencilFunc:()=>en,EquirectangularReflectionMapping:()=>ae,EquirectangularRefractionMapping:()=>oe,Euler:()=>Kr,EventDispatcher:()=>yn,ExtrudeBufferGeometry:()=>lf,ExtrudeGeometry:()=>qh,FileLoader:()=>Wu,Float16BufferAttribute:()=>Yi,Float32BufferAttribute:()=>qi,Float64BufferAttribute:()=>Ki,FloatType:()=>Te,Fog:()=>Ml,FogExp2:()=>wl,FramebufferTexture:()=>Uc,FrontSide:()=>f,Frustum:()=>Qs,GLBufferAttribute:()=>dp,GLSL1:()=>gn,GLSL3:()=>An,GreaterDepth:()=>W,GreaterEqualDepth:()=>j,GreaterEqualStencilFunc:()=>sn,GreaterStencilFunc:()=>nn,GridHelper:()=>Fp,Group:()=>ml,HalfFloatType:()=>Ie,HemisphereLight:()=>ed,HemisphereLightHelper:()=>Lp,HemisphereLightProbe:()=>Bd,IcosahedronBufferGeometry:()=>cf,IcosahedronGeometry:()=>Jh,ImageBitmapLoader:()=>Md,ImageLoader:()=>qu,ImageUtils:()=>Jn,IncrementStencilOp:()=>Xt,IncrementWrapStencilOp:()=>qt,InstancedBufferAttribute:()=>lc,InstancedBufferGeometry:()=>xd,InstancedInterleavedBuffer:()=>up,InstancedMesh:()=>gc,Int16BufferAttribute:()=>Hi,Int32BufferAttribute:()=>Wi,Int8BufferAttribute:()=>zi,IntType:()=>Me,InterleavedBuffer:()=>Tl,InterleavedBufferAttribute:()=>Bl,Interpolant:()=>Mu,InterpolateDiscrete:()=>_t,InterpolateLinear:()=>St,InterpolateSmooth:()=>wt,InvertStencilOp:()=>Jt,KeepStencilOp:()=>jt,KeyframeTrack:()=>Bu,LOD:()=>ql,LatheBufferGeometry:()=>hf,LatheGeometry:()=>lh,Layers:()=>Jr,LessDepth:()=>Q,LessEqualDepth:()=>V,LessEqualStencilFunc:()=>tn,LessStencilFunc:()=>$t,Light:()=>$u,LightProbe:()=>Ad,Line:()=>_c,Line3:()=>Ep,LineBasicMaterial:()=>Ac,LineCurve:()=>eh,LineCurve3:()=>th,LineDashedMaterial:()=>vu,LineLoop:()=>Cc,LineSegments:()=>Mc,LinearEncoding:()=>Lt,LinearFilter:()=>Ae,LinearInterpolant:()=>Tu,LinearMipMapLinearFilter:()=>be,LinearMipMapNearestFilter:()=>ye,LinearMipmapLinearFilter:()=>xe,LinearMipmapNearestFilter:()=>ve,LinearSRGBColorSpace:()=>Qt,LinearToneMapping:()=>Z,Loader:()=>Vu,LoaderUtils:()=>yd,LoadingManager:()=>zu,LoopOnce:()=>xt,LoopPingPong:()=>Et,LoopRepeat:()=>bt,LuminanceAlphaFormat:()=>Ue,LuminanceFormat:()=>Fe,MOUSE:()=>i,Material:()=>wi,MaterialLoader:()=>vd,MathUtils:()=>Dn,Matrix3:()=>Fn,Matrix4:()=>Gr,MaxEquation:()=>T,Mesh:()=>Es,MeshBasicMaterial:()=>Pi,MeshDepthMaterial:()=>ll,MeshDistanceMaterial:()=>cl,MeshLambertMaterial:()=>gu,MeshMatcapMaterial:()=>Au,MeshNormalMaterial:()=>mu,MeshPhongMaterial:()=>pu,MeshPhysicalMaterial:()=>du,MeshStandardMaterial:()=>uu,MeshToonMaterial:()=>fu,MinEquation:()=>C,MirroredRepeatWrapping:()=>ue,MixOperation:()=>q,MultiplyBlending:()=>E,MultiplyOperation:()=>Y,NearestFilter:()=>de,NearestMipMapLinearFilter:()=>ge,NearestMipMapNearestFilter:()=>fe,NearestMipmapLinearFilter:()=>me,NearestMipmapNearestFilter:()=>pe,NeverDepth:()=>G,NeverStencilFunc:()=>Zt,NoBlending:()=>v,NoColorSpace:()=>Gt,NoToneMapping:()=>J,NormalAnimationBlendMode:()=>It,NormalBlending:()=>y,NotEqualDepth:()=>X,NotEqualStencilFunc:()=>rn,NumberKeyframeTrack:()=>Du,Object3D:()=>ui,ObjectLoader:()=>Ed,ObjectSpaceNormalMap:()=>kt,OctahedronBufferGeometry:()=>uf,OctahedronGeometry:()=>Zh,OneFactor:()=>B,OneMinusDstAlphaFactor:()=>U,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>L,OneMinusSrcColorFactor:()=>P,OrthographicCamera:()=>na,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>ua,Path:()=>oh,PerspectiveCamera:()=>Rs,Plane:()=>ks,PlaneBufferGeometry:()=>df,PlaneGeometry:()=>js,PlaneHelper:()=>Yp,PointLight:()=>ud,PointLightHelper:()=>Bp,Points:()=>Dc,PointsMaterial:()=>Tc,PolarGridHelper:()=>Up,PolyhedronBufferGeometry:()=>pf,PolyhedronGeometry:()=>ph,PositionalAudio:()=>Yd,PropertyBinding:()=>rp,PropertyMixer:()=>Kd,QuadraticBezierCurve:()=>nh,QuadraticBezierCurve3:()=>rh,Quaternion:()=>cr,QuaternionKeyframeTrack:()=>Fu,QuaternionLinearInterpolant:()=>Lu,RED_GREEN_RGTC2_Format:()=>vt,RED_RGTC1_Format:()=>gt,REVISION:()=>r,RGBADepthPacking:()=>Ot,RGBAFormat:()=>Le,RGBAIntegerFormat:()=>Ve,RGBA_ASTC_10x10_Format:()=>dt,RGBA_ASTC_10x5_Format:()=>ct,RGBA_ASTC_10x6_Format:()=>ht,RGBA_ASTC_10x8_Format:()=>ut,RGBA_ASTC_12x10_Format:()=>pt,RGBA_ASTC_12x12_Format:()=>ft,RGBA_ASTC_4x4_Format:()=>tt,RGBA_ASTC_5x4_Format:()=>nt,RGBA_ASTC_5x5_Format:()=>rt,RGBA_ASTC_6x5_Format:()=>it,RGBA_ASTC_6x6_Format:()=>st,RGBA_ASTC_8x5_Format:()=>at,RGBA_ASTC_8x6_Format:()=>ot,RGBA_ASTC_8x8_Format:()=>lt,RGBA_BPTC_Format:()=>mt,RGBA_ETC2_EAC_Format:()=>et,RGBA_PVRTC_2BPPV1_Format:()=>Je,RGBA_PVRTC_4BPPV1_Format:()=>Ke,RGBA_S3TC_DXT1_Format:()=>je,RGBA_S3TC_DXT3_Format:()=>We,RGBA_S3TC_DXT5_Format:()=>Xe,RGB_ETC1_Format:()=>Ze,RGB_ETC2_Format:()=>$e,RGB_PVRTC_2BPPV1_Format:()=>qe,RGB_PVRTC_4BPPV1_Format:()=>Ye,RGB_S3TC_DXT1_Format:()=>He,RGFormat:()=>ze,RGIntegerFormat:()=>Qe,RawShaderMaterial:()=>hu,Ray:()=>kr,Raycaster:()=>pp,RectAreaLight:()=>md,RedFormat:()=>ke,RedIntegerFormat:()=>Ge,ReinhardToneMapping:()=>$,RepeatWrapping:()=>ce,ReplaceStencilOp:()=>Wt,ReverseSubtractEquation:()=>M,RingBufferGeometry:()=>ff,RingGeometry:()=>$h,SIGNED_RED_GREEN_RGTC2_Format:()=>yt,SIGNED_RED_RGTC1_Format:()=>At,SRGBColorSpace:()=>zt,Scene:()=>Cl,ShaderChunk:()=>Ws,ShaderLib:()=>Ys,ShaderMaterial:()=>Is,ShadowMaterial:()=>cu,Shape:()=>xh,ShapeBufferGeometry:()=>mf,ShapeGeometry:()=>eu,ShapePath:()=>ef,ShapeUtils:()=>Wh,ShortType:()=>Se,Skeleton:()=>oc,SkeletonHelper:()=>Tp,SkinnedMesh:()=>nc,Source:()=>Zn,Sphere:()=>Rr,SphereBufferGeometry:()=>gf,SphereGeometry:()=>tu,Spherical:()=>gp,SphericalHarmonics3:()=>gd,SplineCurve:()=>ih,SpotLight:()=>ad,SpotLightHelper:()=>Sp,Sprite:()=>jl,SpriteMaterial:()=>Rl,SrcAlphaFactor:()=>D,SrcAlphaSaturateFactor:()=>k,SrcColorFactor:()=>R,StaticCopyUsage:()=>pn,StaticDrawUsage:()=>on,StaticReadUsage:()=>hn,StereoCamera:()=>Fd,StreamCopyUsage:()=>mn,StreamDrawUsage:()=>cn,StreamReadUsage:()=>dn,StringKeyframeTrack:()=>Uu,SubtractEquation:()=>w,SubtractiveBlending:()=>b,TOUCH:()=>s,TangentSpaceNormalMap:()=>Nt,TetrahedronBufferGeometry:()=>Af,TetrahedronGeometry:()=>nu,Texture:()=>tr,TextureLoader:()=>Zu,TorusBufferGeometry:()=>vf,TorusGeometry:()=>ru,TorusKnotBufferGeometry:()=>yf,TorusKnotGeometry:()=>iu,Triangle:()=>_i,TriangleFanDrawMode:()=>Dt,TriangleStripDrawMode:()=>Pt,TrianglesDrawMode:()=>Rt,TubeBufferGeometry:()=>xf,TubeGeometry:()=>su,TwoPassDoubleSide:()=>A,UVMapping:()=>re,Uint16BufferAttribute:()=>ji,Uint32BufferAttribute:()=>Xi,Uint8BufferAttribute:()=>Qi,Uint8ClampedBufferAttribute:()=>Vi,Uniform:()=>lp,UniformsGroup:()=>hp,UniformsLib:()=>Xs,UniformsUtils:()=>Ts,UnsignedByteType:()=>Ee,UnsignedInt248Type:()=>Pe,UnsignedIntType:()=>Ce,UnsignedShort4444Type:()=>Be,UnsignedShort5551Type:()=>Re,UnsignedShortType:()=>we,VSMShadowMap:()=>p,Vector2:()=>Ln,Vector3:()=>hr,Vector4:()=>nr,VectorKeyframeTrack:()=>Ou,VideoTexture:()=>Fc,WebGL1Renderer:()=>Sl,WebGL3DRenderTarget:()=>or,WebGLArrayRenderTarget:()=>sr,WebGLCubeRenderTarget:()=>Fs,WebGLMultipleRenderTargets:()=>lr,WebGLRenderTarget:()=>rr,WebGLRenderer:()=>_l,WebGLUtils:()=>pl,WireframeGeometry:()=>au,WrapAroundEnding:()=>Tt,ZeroCurvatureEnding:()=>Mt,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Ct,ZeroStencilOp:()=>Ht,_SRGBAFormat:()=>vn,sRGBEncoding:()=>Ft});const r="152",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=0,o=1,l=2,c=3,h=0,u=1,d=2,p=3,f=0,m=1,g=2,A=2,v=0,y=1,x=2,b=3,E=4,_=5,S=100,w=101,M=102,C=103,T=104,I=200,B=201,R=202,P=203,D=204,L=205,F=206,U=207,O=208,N=209,k=210,G=0,z=1,Q=2,V=3,H=4,j=5,W=6,X=7,Y=0,q=1,K=2,J=0,Z=1,$=2,ee=3,te=4,ne=5,re=300,ie=301,se=302,ae=303,oe=304,le=306,ce=1e3,he=1001,ue=1002,de=1003,pe=1004,fe=1004,me=1005,ge=1005,Ae=1006,ve=1007,ye=1007,xe=1008,be=1008,Ee=1009,_e=1010,Se=1011,we=1012,Me=1013,Ce=1014,Te=1015,Ie=1016,Be=1017,Re=1018,Pe=1020,De=1021,Le=1023,Fe=1024,Ue=1025,Oe=1026,Ne=1027,ke=1028,Ge=1029,ze=1030,Qe=1031,Ve=1033,He=33776,je=33777,We=33778,Xe=33779,Ye=35840,qe=35841,Ke=35842,Je=35843,Ze=36196,$e=37492,et=37496,tt=37808,nt=37809,rt=37810,it=37811,st=37812,at=37813,ot=37814,lt=37815,ct=37816,ht=37817,ut=37818,dt=37819,pt=37820,ft=37821,mt=36492,gt=36283,At=36284,vt=36285,yt=36286,xt=2200,bt=2201,Et=2202,_t=2300,St=2301,wt=2302,Mt=2400,Ct=2401,Tt=2402,It=2500,Bt=2501,Rt=0,Pt=1,Dt=2,Lt=3e3,Ft=3001,Ut=3200,Ot=3201,Nt=0,kt=1,Gt="",zt="srgb",Qt="srgb-linear",Vt="display-p3",Ht=0,jt=7680,Wt=7681,Xt=7682,Yt=7683,qt=34055,Kt=34056,Jt=5386,Zt=512,$t=513,en=514,tn=515,nn=516,rn=517,sn=518,an=519,on=35044,ln=35048,cn=35040,hn=35045,un=35049,dn=35041,pn=35046,fn=35050,mn=35042,gn="100",An="300 es",vn=1035;class yn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.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 n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const xn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let bn=1234567;const En=Math.PI/180,_n=180/Math.PI;function Sn(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(xn[255&e]+xn[e>>8&255]+xn[e>>16&255]+xn[e>>24&255]+"-"+xn[255&t]+xn[t>>8&255]+"-"+xn[t>>16&15|64]+xn[t>>24&255]+"-"+xn[63&n|128]+xn[n>>8&255]+"-"+xn[n>>16&255]+xn[n>>24&255]+xn[255&r]+xn[r>>8&255]+xn[r>>16&255]+xn[r>>24&255]).toLowerCase()}function wn(e,t,n){return Math.max(t,Math.min(n,e))}function Mn(e,t){return(e%t+t)%t}function Cn(e,t,n){return(1-n)*e+n*t}function Tn(e){return 0==(e&e-1)&&0!==e}function In(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Bn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Rn(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 Pn(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 Dn={DEG2RAD:En,RAD2DEG:_n,generateUUID:Sn,clamp:wn,euclideanModulo:Mn,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Cn,damp:function(e,t,n,r){return Cn(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(Mn(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(bn=e);let t=bn+=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(e){return e*En},radToDeg:function(e){return e*_n},isPowerOfTwo:Tn,ceilPowerOfTwo:In,floorPowerOfTwo:Bn,setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((t+r)/2),h=a((t+r)/2),u=s((t-r)/2),d=a((t-r)/2),p=s((r-t)/2),f=a((r-t)/2);switch(i){case"XYX":e.set(o*h,l*u,l*d,o*c);break;case"YZY":e.set(l*d,o*h,l*u,o*c);break;case"ZXZ":e.set(l*u,l*d,o*h,o*c);break;case"XZX":e.set(o*h,l*f,l*p,o*c);break;case"YXY":e.set(l*p,o*h,l*f,o*c);break;case"ZYZ":e.set(l*f,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Pn,denormalize:Rn};class Ln{constructor(e=0,t=0){Ln.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,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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 n=this.dot(e)/t;return Math.acos(wn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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 n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Fn{constructor(){Fn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,n,r,i,s,a,o,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.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 n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],A=r[1],v=r[4],y=r[7],x=r[2],b=r[5],E=r[8];return i[0]=s*f+a*A+o*x,i[3]=s*m+a*v+o*b,i[6]=s*g+a*y+o*E,i[1]=l*f+c*A+h*x,i[4]=l*m+c*v+h*b,i[7]=l*g+c*y+h*E,i[2]=u*f+d*A+p*x,i[5]=u*m+d*v+p*b,i[8]=u*g+d*y+p*E,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],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-n*i*c+n*a*o+r*i*l-r*s*o}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=c*s-a*l,u=a*o-c*i,d=l*i-s*o,p=t*h+n*u+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(r*l-c*n)*f,e[2]=(a*n-r*s)*f,e[3]=u*f,e[4]=(c*t-r*o)*f,e[5]=(r*i-a*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(s*t-n*i)*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,n,r,i,s,a){const o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Un.makeScale(e,t)),this}rotate(e){return this.premultiply(Un.makeRotation(-e)),this}translate(e,t){return this.premultiply(Un.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),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Un=new Fn;function On(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const Nn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function kn(e,t){return new Nn[e](t)}function Gn(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}const zn={};function Qn(e){e in zn||(zn[e]=!0,console.warn(e))}function Vn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Hn(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const jn=(new Fn).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),Wn=(new Fn).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const Xn={[Qt]:e=>e,[zt]:e=>e.convertSRGBToLinear(),[Vt]:function(e){return e.convertSRGBToLinear().applyMatrix3(Wn)}},Yn={[Qt]:e=>e,[zt]:e=>e.convertLinearToSRGB(),[Vt]:function(e){return e.applyMatrix3(jn).convertLinearToSRGB()}},qn={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 Qt},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const r=Xn[t],i=Yn[n];if(void 0===r||void 0===i)throw new Error(`Unsupported color space conversion, "${t}" to "${n}".`);return i(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let Kn;class Jn{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===Kn&&(Kn=Gn("canvas")),Kn.width=e.width,Kn.height=e.height;const n=Kn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Kn}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=Gn("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*Vn(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*Vn(t[e]/255)):t[e]=Vn(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class Zn{constructor(e=null){this.isSource=!0,this.uuid=Sn(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push($n(r[t].image)):e.push($n(r[t]))}else e=$n(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function $n(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Jn.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let er=0;class tr extends yn{constructor(e=tr.DEFAULT_IMAGE,t=tr.DEFAULT_MAPPING,n=he,r=he,i=Ae,s=xe,a=Le,o=Ee,l=tr.DEFAULT_ANISOTROPY,c=Gt){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:er++}),this.uuid=Sn(),this.name="",this.source=new Zn(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Ln(0,0),this.repeat=new Ln(1,1),this.center=new Ln(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(Qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===Ft?zt:Gt),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==re)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ce:e.x=e.x-Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case ue: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 ce:e.y=e.y-Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case ue: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 Qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===zt?Ft:Lt}set encoding(e){Qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Ft?zt:Gt}}tr.DEFAULT_IMAGE=null,tr.DEFAULT_MAPPING=re,tr.DEFAULT_ANISOTROPY=1;class nr{constructor(e=0,t=0,n=0,r=1){nr.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}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,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,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,n,r,i;const s=.01,a=.1,o=e.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)<s&&Math.abs(h-f)<s&&Math.abs(p-m)<s){if(Math.abs(c+u)<a&&Math.abs(h+f)<a&&Math.abs(p+m)<a&&Math.abs(l+d+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,A=(g+1)/2,v=(c+u)/4,y=(h+f)/4,x=(p+m)/4;return e>o&&e>A?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):o>A?o<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=v/r,i=x/r):A<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(A),n=y/i,r=x/i),this.set(n,r,i,t),this}let A=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(A)<.001&&(A=1),this.x=(m-p)/A,this.y=(h-f)/A,this.z=(u-c)/A,this.w=Math.acos((l+d+g-1)/2),this}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.w=Math.min(this.w,e.w),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.w=Math.max(this.w,e.w),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.w=Math.max(e.w,Math.min(t.w,this.w)),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.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),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.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}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.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}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}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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class rr extends yn{constructor(e=1,t=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new nr(0,0,e,t),this.scissorTest=!1,this.viewport=new nr(0,0,e,t);const r={width:e,height:t,depth:1};void 0!==n.encoding&&(Qn("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Ft?zt:Gt),this.texture=new tr(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ae,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Zn(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ir extends tr{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=de,this.minFilter=de,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class sr extends rr{constructor(e=1,t=1,n=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new ir(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class ar extends tr{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=de,this.minFilter=de,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class or extends rr{constructor(e=1,t=1,n=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new ar(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class lr extends rr{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let s=0;s<n;s++)this.texture[s]=i.clone(),this.texture[s].isRenderTargetTexture=!0}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class cr{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,s,a){let o=n[r+0],l=n[r+1],c=n[r+2],h=n[r+3];const u=i[s+0],d=i[s+1],p=i[s+2],f=i[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===a)return e[t+0]=u,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(h!==f||o!==u||l!==d||c!==p){let e=1-a;const t=o*u+l*d+c*p+h*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,a=Math.sin(a*s)/i}const i=a*n;if(o=o*e+u*i,l=l*e+d*i,c=c*e+p*i,h=h*e+f*i,e===1-a){const e=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,r,i,s){const a=n[r],o=n[r+1],l=n[r+2],c=n[r+3],h=i[s],u=i[s+1],d=i[s+2],p=i[s+3];return e[t]=a*p+c*h+o*d-l*u,e[t+1]=o*p+c*u+l*h-a*d,e[t+2]=l*p+c*d+a*u-o*h,e[t+3]=c*p-a*h-o*u-l*d,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,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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 n=e._x,r=e._y,i=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(r/2),h=a(i/2),u=o(n/2),d=o(r/2),p=o(i/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],a=t[5],o=t[9],l=t[2],c=t[6],h=t[10],u=n+a+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-o)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>a&&n>h){const e=2*Math.sqrt(1+n-a-h);this._w=(c-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(a>h){const e=2*Math.sqrt(1+a-n-h);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+h-n-a);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(wn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),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 n=e._x,r=e._y,i=e._z,s=e._w,a=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+s*a+r*l-i*o,this._y=r*c+s*o+i*a-n*l,this._z=i*c+s*l+n*o-r*a,this._w=s*c-n*a-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let a=s*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=r*h+this._y*u,this._z=i*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}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 hr{constructor(e=0,t=0,n=0){hr.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,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(dr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(dr.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*r-a*n,c=o*n+a*t-i*r,h=o*r+i*n-s*t,u=-i*t-s*n-a*r;return this.x=l*o+u*-i+c*-a-h*-s,this.y=c*o+u*-s+h*-i-l*-a,this.z=h*o+u*-a+l*-s-c*-i,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,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-i*a,this.y=i*s-n*o,this.z=n*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ur.copy(this).projectOnVector(e),this.sub(ur)}reflect(e){return this.sub(ur.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 n=this.dot(e)/t;return Math.acos(wn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,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(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ur=new hr,dr=new cr;class pr{constructor(e=new hr(1/0,1/0,1/0),t=new hr(-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,n=e.length;t<n;t+=3)this.expandByPoint(mr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(mr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=mr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){if(e.updateWorldMatrix(!1,!1),void 0!==e.boundingBox)null===e.boundingBox&&e.computeBoundingBox(),gr.copy(e.boundingBox),gr.applyMatrix4(e.matrixWorld),this.union(gr);else{const n=e.geometry;if(void 0!==n)if(t&&void 0!==n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,r=t.count;n<r;n++)mr.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(mr)}else null===n.boundingBox&&n.computeBoundingBox(),gr.copy(n.boundingBox),gr.applyMatrix4(e.matrixWorld),this.union(gr)}const n=e.children;for(let r=0,i=n.length;r<i;r++)this.expandByObject(n[r],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.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.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,mr),mr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(_r),Sr.subVectors(this.max,_r),Ar.subVectors(e.a,_r),vr.subVectors(e.b,_r),yr.subVectors(e.c,_r),xr.subVectors(vr,Ar),br.subVectors(yr,vr),Er.subVectors(Ar,yr);let t=[0,-xr.z,xr.y,0,-br.z,br.y,0,-Er.z,Er.y,xr.z,0,-xr.x,br.z,0,-br.x,Er.z,0,-Er.x,-xr.y,xr.x,0,-br.y,br.x,0,-Er.y,Er.x,0];return!!Cr(t,Ar,vr,yr,Sr)&&(t=[1,0,0,0,1,0,0,0,1],!!Cr(t,Ar,vr,yr,Sr)&&(wr.crossVectors(xr,br),t=[wr.x,wr.y,wr.z],Cr(t,Ar,vr,yr,Sr)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,mr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(mr).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()||(fr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fr)),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 fr=[new hr,new hr,new hr,new hr,new hr,new hr,new hr,new hr],mr=new hr,gr=new pr,Ar=new hr,vr=new hr,yr=new hr,xr=new hr,br=new hr,Er=new hr,_r=new hr,Sr=new hr,wr=new hr,Mr=new hr;function Cr(e,t,n,r,i){for(let s=0,a=e.length-3;s<=a;s+=3){Mr.fromArray(e,s);const a=i.x*Math.abs(Mr.x)+i.y*Math.abs(Mr.y)+i.z*Math.abs(Mr.z),o=t.dot(Mr),l=n.dot(Mr),c=r.dot(Mr);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Tr=new pr,Ir=new hr,Br=new hr;class Rr{constructor(e=new hr,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Tr.setFromPoints(e).getCenter(n);let r=0;for(let i=0,s=e.length;i<s;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.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;Ir.subVectors(e,this.center);const t=Ir.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Ir,n/e),this.radius+=n}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):(Br.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ir.copy(e.center).add(Br)),this.expandByPoint(Ir.copy(e.center).sub(Br))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Pr=new hr,Dr=new hr,Lr=new hr,Fr=new hr,Ur=new hr,Or=new hr,Nr=new hr;class kr{constructor(e=new hr,t=new hr(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,Pr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Pr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Pr.copy(this.origin).addScaledVector(this.direction,t),Pr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Dr.copy(e).add(t).multiplyScalar(.5),Lr.copy(t).sub(e).normalize(),Fr.copy(this.origin).sub(Dr);const i=.5*e.distanceTo(t),s=-this.direction.dot(Lr),a=Fr.dot(this.direction),o=-Fr.dot(Lr),l=Fr.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=i*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*i+a)),u=h>0?-i:Math.min(Math.max(-i,-o),i),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-i,-o),i),d=u*(u+2*o)+l):(h=Math.max(0,-(s*i+a)),u=h>0?i:Math.min(Math.max(-i,-o),i),d=-h*h+u*(u+2*o)+l);else u=s>0?-i:i,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(Dr).addScaledVector(Lr,u),d}intersectSphere(e,t){Pr.subVectors(e.center,this.origin);const n=Pr.dot(this.direction),r=Pr.dot(Pr)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,t):this.at(a,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 n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,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 n,r,i,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,r=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,r=(e.min.x-u.x)*l),c>=0?(i=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(i=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),n>s||i>r?null:((i>n||isNaN(n))&&(n=i),(s<r||isNaN(r))&&(r=s),h>=0?(a=(e.min.z-u.z)*h,o=(e.max.z-u.z)*h):(a=(e.max.z-u.z)*h,o=(e.min.z-u.z)*h),n>o||a>r?null:((a>n||n!=n)&&(n=a),(o<r||r!=r)&&(r=o),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,Pr)}intersectTriangle(e,t,n,r,i){Ur.subVectors(t,e),Or.subVectors(n,e),Nr.crossVectors(Ur,Or);let s,a=this.direction.dot(Nr);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Fr.subVectors(this.origin,e);const o=s*this.direction.dot(Or.crossVectors(Fr,Or));if(o<0)return null;const l=s*this.direction.dot(Ur.cross(Fr));if(l<0)return null;if(o+l>a)return null;const c=-s*Fr.dot(Nr);return c<0?null:this.at(c/a,i)}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 Gr{constructor(){Gr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,n,r,i,s,a,o,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 Gr).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/zr.setFromMatrixColumn(e,0).length(),i=1/zr.setFromMatrixColumn(e,1).length(),s=1/zr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(r),l=Math.sin(r),c=Math.cos(i),h=Math.sin(i);if("XYZ"===e.order){const e=s*c,n=s*h,r=a*c,i=a*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*o}else if("YXZ"===e.order){const e=o*c,n=o*h,r=l*c,i=l*h;t[0]=e+i*a,t[4]=r*a-n,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*c,n=o*h,r=l*c,i=l*h;t[0]=e-i*a,t[4]=-s*h,t[8]=r+n*a,t[1]=n+r*a,t[5]=s*c,t[9]=i-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*c,n=s*h,r=a*c,i=a*h;t[0]=o*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*h,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=i-e*h,t[8]=r*h+n,t[1]=h,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*h+r,t[10]=e-i*h}else if("XZY"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+i,t[5]=s*c,t[9]=n*h-r,t[2]=r*h-n,t[6]=a*c,t[10]=i*h+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(Vr,e,Hr)}lookAt(e,t,n){const r=this.elements;return Xr.subVectors(e,t),0===Xr.lengthSq()&&(Xr.z=1),Xr.normalize(),jr.crossVectors(n,Xr),0===jr.lengthSq()&&(1===Math.abs(n.z)?Xr.x+=1e-4:Xr.z+=1e-4,Xr.normalize(),jr.crossVectors(n,Xr)),jr.normalize(),Wr.crossVectors(Xr,jr),r[0]=jr.x,r[4]=Wr.x,r[8]=Xr.x,r[1]=jr.y,r[5]=Wr.y,r[9]=Xr.y,r[2]=jr.z,r[6]=Wr.z,r[10]=Xr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],A=n[3],v=n[7],y=n[11],x=n[15],b=r[0],E=r[4],_=r[8],S=r[12],w=r[1],M=r[5],C=r[9],T=r[13],I=r[2],B=r[6],R=r[10],P=r[14],D=r[3],L=r[7],F=r[11],U=r[15];return i[0]=s*b+a*w+o*I+l*D,i[4]=s*E+a*M+o*B+l*L,i[8]=s*_+a*C+o*R+l*F,i[12]=s*S+a*T+o*P+l*U,i[1]=c*b+h*w+u*I+d*D,i[5]=c*E+h*M+u*B+d*L,i[9]=c*_+h*C+u*R+d*F,i[13]=c*S+h*T+u*P+d*U,i[2]=p*b+f*w+m*I+g*D,i[6]=p*E+f*M+m*B+g*L,i[10]=p*_+f*C+m*R+g*F,i[14]=p*S+f*T+m*P+g*U,i[3]=A*b+v*w+y*I+x*D,i[7]=A*E+v*M+y*B+x*L,i[11]=A*_+v*C+y*R+x*F,i[15]=A*S+v*T+y*P+x*U,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],n=e[4],r=e[8],i=e[12],s=e[1],a=e[5],o=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+i*o*h-r*l*h-i*a*u+n*l*u+r*a*d-n*o*d)+e[7]*(+t*o*d-t*l*u+i*s*u-r*s*d+r*l*c-i*o*c)+e[11]*(+t*l*h-t*a*d-i*s*h+n*s*d+i*a*c-n*l*c)+e[15]*(-r*a*c-t*o*h+t*a*u+r*s*h-n*s*u+n*o*c)}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,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],A=h*m*l-f*u*l+f*o*d-a*m*d-h*o*g+a*u*g,v=p*u*l-c*m*l-p*o*d+s*m*d+c*o*g-s*u*g,y=c*f*l-p*h*l+p*a*d-s*f*d-c*a*g+s*h*g,x=p*h*o-c*f*o-p*a*u+s*f*u+c*a*m-s*h*m,b=t*A+n*v+r*y+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/b;return e[0]=A*E,e[1]=(f*u*i-h*m*i-f*r*d+n*m*d+h*r*g-n*u*g)*E,e[2]=(a*m*i-f*o*i+f*r*l-n*m*l-a*r*g+n*o*g)*E,e[3]=(h*o*i-a*u*i-h*r*l+n*u*l+a*r*d-n*o*d)*E,e[4]=v*E,e[5]=(c*m*i-p*u*i+p*r*d-t*m*d-c*r*g+t*u*g)*E,e[6]=(p*o*i-s*m*i-p*r*l+t*m*l+s*r*g-t*o*g)*E,e[7]=(s*u*i-c*o*i+c*r*l-t*u*l-s*r*d+t*o*d)*E,e[8]=y*E,e[9]=(p*h*i-c*f*i-p*n*d+t*f*d+c*n*g-t*h*g)*E,e[10]=(s*f*i-p*a*i+p*n*l-t*f*l-s*n*g+t*a*g)*E,e[11]=(c*a*i-s*h*i-c*n*l+t*h*l+s*n*d-t*a*d)*E,e[12]=x*E,e[13]=(c*f*r-p*h*r+p*n*u-t*f*u-c*n*m+t*h*m)*E,e[14]=(p*a*r-s*f*r-p*n*o+t*f*o+s*n*m-t*a*m)*E,e[15]=(s*h*r-c*a*r+c*n*o-t*h*o-s*n*u+t*a*u)*E,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,a=e.y,o=e.z,l=i*s,c=i*a;return this.set(l*s+n,l*a-r*o,l*o+r*a,0,l*a+r*o,c*a+n,c*o-r*s,0,l*o-r*a,c*o+r*s,i*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,a=t._z,o=t._w,l=i+i,c=s+s,h=a+a,u=i*l,d=i*c,p=i*h,f=s*c,m=s*h,g=a*h,A=o*l,v=o*c,y=o*h,x=n.x,b=n.y,E=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+y)*x,r[2]=(p-v)*x,r[3]=0,r[4]=(d-y)*b,r[5]=(1-(u+g))*b,r[6]=(m+A)*b,r[7]=0,r[8]=(p+v)*E,r[9]=(m-A)*E,r[10]=(1-(u+f))*E,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=zr.set(r[0],r[1],r[2]).length();const s=zr.set(r[4],r[5],r[6]).length(),a=zr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Qr.copy(this);const o=1/i,l=1/s,c=1/a;return Qr.elements[0]*=o,Qr.elements[1]*=o,Qr.elements[2]*=o,Qr.elements[4]*=l,Qr.elements[5]*=l,Qr.elements[6]*=l,Qr.elements[8]*=c,Qr.elements[9]*=c,Qr.elements[10]*=c,t.setFromRotationMatrix(Qr),n.x=i,n.y=s,n.z=a,this}makePerspective(e,t,n,r,i,s){const a=this.elements,o=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),u=-(s+i)/(s-i),d=-2*s*i/(s-i);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,s){const a=this.elements,o=1/(t-e),l=1/(n-r),c=1/(s-i),h=(t+e)*o,u=(n+r)*l,d=(s+i)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const zr=new hr,Qr=new Gr,Vr=new hr(0,0,0),Hr=new hr(1,1,1),jr=new hr,Wr=new hr,Xr=new hr,Yr=new Gr,qr=new cr;class Kr{constructor(e=0,t=0,n=0,r=Kr.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}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,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],o=r[1],l=r[5],c=r[9],h=r[2],u=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(wn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-wn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,i),this._z=0);break;case"ZXY":this._x=Math.asin(wn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-wn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(wn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-wn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Yr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Yr,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return qr.setFromEuler(this),this.setFromQuaternion(qr,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}}Kr.DEFAULT_ORDER="XYZ";class Jr{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let Zr=0;const $r=new hr,ei=new cr,ti=new Gr,ni=new hr,ri=new hr,ii=new hr,si=new cr,ai=new hr(1,0,0),oi=new hr(0,1,0),li=new hr(0,0,1),ci={type:"added"},hi={type:"removed"};class ui extends yn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Zr++}),this.uuid=Sn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ui.DEFAULT_UP.clone();const e=new hr,t=new Kr,n=new cr,r=new hr(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Gr},normalMatrix:{value:new Fn}}),this.matrix=new Gr,this.matrixWorld=new Gr,this.matrixAutoUpdate=ui.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=ui.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new Jr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ei.setFromAxisAngle(e,t),this.quaternion.multiply(ei),this}rotateOnWorldAxis(e,t){return ei.setFromAxisAngle(e,t),this.quaternion.premultiply(ei),this}rotateX(e){return this.rotateOnAxis(ai,e)}rotateY(e){return this.rotateOnAxis(oi,e)}rotateZ(e){return this.rotateOnAxis(li,e)}translateOnAxis(e,t){return $r.copy(e).applyQuaternion(this.quaternion),this.position.add($r.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ai,e)}translateY(e){return this.translateOnAxis(oi,e)}translateZ(e){return this.translateOnAxis(li,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ti.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ni.copy(e):ni.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),ri.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ti.lookAt(ri,ni,this.up):ti.lookAt(ni,ri,this.up),this.quaternion.setFromRotationMatrix(ti),r&&(ti.extractRotation(r.matrixWorld),ei.setFromRotationMatrix(ti),this.quaternion.premultiply(ei.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ci)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(hi)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(hi)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),ti.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ti.multiply(e.parent.matrixWorld)),e.applyMatrix4(ti),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t){let n=[];this[e]===t&&n.push(this);for(let r=0,i=this.children.length;r<i;r++){const i=this.children[r].getObjectsByProperty(e,t);i.length>0&&(n=n.concat(i))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ri,e,ii),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ri,si,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 n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){const r=t[n];!0!==r.matrixWorldAutoUpdate&&!0!==e||r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){const n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),c=s(e.animations),h=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}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 n=0;n<e.children.length;n++){const t=e.children[n];this.add(t.clone())}return this}}ui.DEFAULT_UP=new hr(0,1,0),ui.DEFAULT_MATRIX_AUTO_UPDATE=!0,ui.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const di=new hr,pi=new hr,fi=new hr,mi=new hr,gi=new hr,Ai=new hr,vi=new hr,yi=new hr,xi=new hr,bi=new hr;let Ei=!1;class _i{constructor(e=new hr,t=new hr,n=new hr){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),di.subVectors(e,t),r.cross(di);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){di.subVectors(r,t),pi.subVectors(n,t),fi.subVectors(e,t);const s=di.dot(di),a=di.dot(pi),o=di.dot(fi),l=pi.dot(pi),c=pi.dot(fi),h=s*l-a*a;if(0===h)return i.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,mi),mi.x>=0&&mi.y>=0&&mi.x+mi.y<=1}static getUV(e,t,n,r,i,s,a,o){return!1===Ei&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Ei=!0),this.getInterpolation(e,t,n,r,i,s,a,o)}static getInterpolation(e,t,n,r,i,s,a,o){return this.getBarycoord(e,t,n,r,mi),o.setScalar(0),o.addScaledVector(i,mi.x),o.addScaledVector(s,mi.y),o.addScaledVector(a,mi.z),o}static isFrontFacing(e,t,n,r){return di.subVectors(n,t),pi.subVectors(e,t),di.cross(pi).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 di.subVectors(this.c,this.b),pi.subVectors(this.a,this.b),.5*di.cross(pi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _i.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _i.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return!1===Ei&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Ei=!0),_i.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}getInterpolation(e,t,n,r,i){return _i.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return _i.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _i.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,a;gi.subVectors(r,n),Ai.subVectors(i,n),yi.subVectors(e,n);const o=gi.dot(yi),l=Ai.dot(yi);if(o<=0&&l<=0)return t.copy(n);xi.subVectors(e,r);const c=gi.dot(xi),h=Ai.dot(xi);if(c>=0&&h<=c)return t.copy(r);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),t.copy(n).addScaledVector(gi,s);bi.subVectors(e,i);const d=gi.dot(bi),p=Ai.dot(bi);if(p>=0&&d<=p)return t.copy(i);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),t.copy(n).addScaledVector(Ai,a);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return vi.subVectors(i,r),a=(h-c)/(h-c+(d-p)),t.copy(r).addScaledVector(vi,a);const g=1/(m+f+u);return s=f*g,a=u*g,t.copy(n).addScaledVector(gi,s).addScaledVector(Ai,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Si=0;class wi extends yn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Si++}),this.uuid=Sn(),this.name="",this.type="Material",this.blending=y,this.side=f,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=D,this.blendDst=L,this.blendEquation=S,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=V,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=an,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jt,this.stencilZFail=jt,this.stencilZPass=jt,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 n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n: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 n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==y&&(n.blending=this.blending),this.side!==f&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}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 n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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 Mi={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},Ci={h:0,s:0,l:0},Ti={h:0,s:0,l:0};function Ii(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class Bi{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}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=zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,qn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=qn.workingColorSpace){return this.r=e,this.g=t,this.b=n,qn.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=qn.workingColorSpace){if(e=Mn(e,1),t=wn(t,0,1),n=wn(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ii(i,r,e+1/3),this.g=Ii(i,r,e),this.b=Ii(i,r,e-1/3)}return qn.toWorkingColorSpace(this,r),this}setStyle(e,t=zt){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=r[1],a=r[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===i)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=zt){const n=Mi[e.toLowerCase()];return void 0!==n?this.setHex(n,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=Vn(e.r),this.g=Vn(e.g),this.b=Vn(e.b),this}copyLinearToSRGB(e){return this.r=Hn(e.r),this.g=Hn(e.g),this.b=Hn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=zt){return qn.fromWorkingColorSpace(Ri.copy(this),e),65536*Math.round(wn(255*Ri.r,0,255))+256*Math.round(wn(255*Ri.g,0,255))+Math.round(wn(255*Ri.b,0,255))}getHexString(e=zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=qn.workingColorSpace){qn.fromWorkingColorSpace(Ri.copy(this),t);const n=Ri.r,r=Ri.g,i=Ri.b,s=Math.max(n,r,i),a=Math.min(n,r,i);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=c<=.5?e/(s+a):e/(2-s-a),s){case n:o=(r-i)/e+(r<i?6:0);break;case r:o=(i-n)/e+2;break;case i:o=(n-r)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=qn.workingColorSpace){return qn.fromWorkingColorSpace(Ri.copy(this),t),e.r=Ri.r,e.g=Ri.g,e.b=Ri.b,e}getStyle(e=zt){qn.fromWorkingColorSpace(Ri.copy(this),e);const t=Ri.r,n=Ri.g,r=Ri.b;return e!==zt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(Ci),Ci.h+=e,Ci.s+=t,Ci.l+=n,this.setHSL(Ci.h,Ci.s,Ci.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ci),e.getHSL(Ti);const n=Cn(Ci.h,Ti.h,t),r=Cn(Ci.s,Ti.s,t),i=Cn(Ci.l,Ti.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ri=new Bi;Bi.NAMES=Mi;class Pi extends wi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Bi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Di=Li();function Li(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const e=l-127;e<-27?(r[l]=0,r[256|l]=32768,i[l]=24,i[256|l]=24):e<-14?(r[l]=1024>>-e-14,r[256|l]=1024>>-e-14|32768,i[l]=-e-1,i[256|l]=-e-1):e<=15?(r[l]=e+15<<10,r[256|l]=e+15<<10|32768,i[l]=13,i[256|l]=13):e<128?(r[l]=31744,r[256|l]=64512,i[l]=24,i[256|l]=24):(r[l]=31744,r[256|l]=64512,i[l]=13,i[256|l]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0==(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,s[l]=e|t}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(o[l]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function Fi(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=wn(e,-65504,65504),Di.floatView[0]=e;const t=Di.uint32View[0],n=t>>23&511;return Di.baseTable[n]+((8388607&t)>>Di.shiftTable[n])}function Ui(e){const t=e>>10;return Di.uint32View[0]=Di.mantissaTable[Di.offsetTable[t]+(1023&e)]+Di.exponentTable[t],Di.floatView[0]}const Oi={toHalfFloat:Fi,fromHalfFloat:Ui},Ni=new hr,ki=new Ln;class Gi{constructor(e,t,n=!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=n,this.usage=on,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,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)ki.fromBufferAttribute(this,t),ki.applyMatrix3(e),this.setXY(t,ki.x,ki.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ni.fromBufferAttribute(this,t),Ni.applyMatrix3(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ni.fromBufferAttribute(this,t),Ni.applyMatrix4(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ni.fromBufferAttribute(this,t),Ni.applyNormalMatrix(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ni.fromBufferAttribute(this,t),Ni.transformDirection(e),this.setXYZ(t,Ni.x,Ni.y,Ni.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Rn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Rn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Rn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Rn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array),i=Pn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==on&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class zi extends Gi{constructor(e,t,n){super(new Int8Array(e),t,n)}}class Qi extends Gi{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class Vi extends Gi{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Hi extends Gi{constructor(e,t,n){super(new Int16Array(e),t,n)}}class ji extends Gi{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Wi extends Gi{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Xi extends Gi{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Yi extends Gi{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Ui(this.array[e*this.itemSize]);return this.normalized&&(t=Rn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize]=Fi(t),this}getY(e){let t=Ui(this.array[e*this.itemSize+1]);return this.normalized&&(t=Rn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+1]=Fi(t),this}getZ(e){let t=Ui(this.array[e*this.itemSize+2]);return this.normalized&&(t=Rn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+2]=Fi(t),this}getW(e){let t=Ui(this.array[e*this.itemSize+3]);return this.normalized&&(t=Rn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Pn(t,this.array)),this.array[e*this.itemSize+3]=Fi(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array)),this.array[e+0]=Fi(t),this.array[e+1]=Fi(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array)),this.array[e+0]=Fi(t),this.array[e+1]=Fi(n),this.array[e+2]=Fi(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array),i=Pn(i,this.array)),this.array[e+0]=Fi(t),this.array[e+1]=Fi(n),this.array[e+2]=Fi(r),this.array[e+3]=Fi(i),this}}class qi extends Gi{constructor(e,t,n){super(new Float32Array(e),t,n)}}class Ki extends Gi{constructor(e,t,n){super(new Float64Array(e),t,n)}}let Ji=0;const Zi=new Gr,$i=new ui,es=new hr,ts=new pr,ns=new pr,rs=new hr;class is extends yn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ji++}),this.uuid=Sn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(On(e)?Xi:ji)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Fn).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zi.makeRotationFromQuaternion(e),this.applyMatrix4(Zi),this}rotateX(e){return Zi.makeRotationX(e),this.applyMatrix4(Zi),this}rotateY(e){return Zi.makeRotationY(e),this.applyMatrix4(Zi),this}rotateZ(e){return Zi.makeRotationZ(e),this.applyMatrix4(Zi),this}translate(e,t,n){return Zi.makeTranslation(e,t,n),this.applyMatrix4(Zi),this}scale(e,t,n){return Zi.makeScale(e,t,n),this.applyMatrix4(Zi),this}lookAt(e){return $i.lookAt(e),$i.updateMatrix(),this.applyMatrix4($i.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(es).negate(),this.translate(es.x,es.y,es.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new qi(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new pr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new hr(-1/0,-1/0,-1/0),new hr(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const e=t[n];ts.setFromBufferAttribute(e),this.morphTargetsRelative?(rs.addVectors(this.boundingBox.min,ts.min),this.boundingBox.expandByPoint(rs),rs.addVectors(this.boundingBox.max,ts.max),this.boundingBox.expandByPoint(rs)):(this.boundingBox.expandByPoint(ts.min),this.boundingBox.expandByPoint(ts.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Rr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new hr,1/0);if(e){const n=this.boundingSphere.center;if(ts.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const n=t[e];ns.setFromBufferAttribute(n),this.morphTargetsRelative?(rs.addVectors(ts.min,ns.min),ts.expandByPoint(rs),rs.addVectors(ts.max,ns.max),ts.expandByPoint(rs)):(ts.expandByPoint(ns.min),ts.expandByPoint(ns.max))}ts.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)rs.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(rs));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],a=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)rs.fromBufferAttribute(s,t),a&&(es.fromBufferAttribute(e,t),rs.add(es)),r=Math.max(r,n.distanceToSquared(rs))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,s=t.uv.array,a=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Gi(new Float32Array(4*a),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let w=0;w<a;w++)l[w]=new hr,c[w]=new hr;const h=new hr,u=new hr,d=new hr,p=new Ln,f=new Ln,m=new Ln,g=new hr,A=new hr;function v(e,t,n){h.fromArray(r,3*e),u.fromArray(r,3*t),d.fromArray(r,3*n),p.fromArray(s,2*e),f.fromArray(s,2*t),m.fromArray(s,2*n),u.sub(h),d.sub(h),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(i),A.copy(d).multiplyScalar(f.x).addScaledVector(u,-m.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(A),c[t].add(A),c[n].add(A))}let y=this.groups;0===y.length&&(y=[{start:0,count:n.length}]);for(let w=0,M=y.length;w<M;++w){const e=y[w],t=e.start;for(let r=t,i=t+e.count;r<i;r+=3)v(n[r+0],n[r+1],n[r+2])}const x=new hr,b=new hr,E=new hr,_=new hr;function S(e){E.fromArray(i,3*e),_.copy(E);const t=l[e];x.copy(t),x.sub(E.multiplyScalar(E.dot(t))).normalize(),b.crossVectors(_,t);const n=b.dot(c[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=n}for(let w=0,M=y.length;w<M;++w){const e=y[w],t=e.start;for(let r=t,i=t+e.count;r<i;r+=3)S(n[r+0]),S(n[r+1]),S(n[r+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new Gi(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new hr,i=new hr,s=new hr,a=new hr,o=new hr,l=new hr,c=new hr,h=new hr;if(e)for(let u=0,d=e.count;u<d;u+=3){const d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),s.fromBufferAttribute(t,f),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),a.fromBufferAttribute(n,d),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),a.add(c),o.add(c),l.add(c),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,u=t.count;e<u;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)rs.fromBufferAttribute(e,t),rs.normalize(),e.setXYZ(t,rs.x,rs.y,rs.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let a=0,o=0;for(let l=0,c=t.length;l<c;l++){a=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(let e=0;e<r;e++)s[o++]=n[a++]}return new Gi(s,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new is,n=this.index.array,r=this.attributes;for(const a in r){const i=e(r[a],n);t.setAttribute(a,i)}const i=this.morphAttributes;for(const a in i){const r=[],s=i[a];for(let t=0,i=s.length;t<i;t++){const i=e(s[t],n);r.push(i)}t.morphAttributes[a]=r}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let a=0,o=s.length;a<o;a++){const e=s[a];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);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 n=this.attributes;for(const o in n){const t=n[o];e.data.attributes[o]=t.toJSON(e.data)}const r={};let i=!1;for(const o in this.morphAttributes){const t=this.morphAttributes[o],n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n.push(i.toJSON(e.data))}n.length>0&&(r[o]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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 n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r<i;r++)e.push(n[r].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let l=0,c=s.length;l<c;l++){const e=s[l];this.addGroup(e.start,e.count,e.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ss=new Gr,as=new kr,os=new Rr,ls=new hr,cs=new hr,hs=new hr,us=new hr,ds=new hr,ps=new hr,fs=new Ln,ms=new Ln,gs=new Ln,As=new hr,vs=new hr,ys=new hr,xs=new hr,bs=new hr;class Es extends ui{constructor(e=new is,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,s=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(i&&a){ps.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=a[n],o=i[n];0!==r&&(ds.fromBufferAttribute(o,e),s?ps.addScaledVector(ds,r):ps.addScaledVector(ds.sub(t),r))}t.add(ps)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),os.copy(n.boundingSphere),os.applyMatrix4(i),as.copy(e.ray).recast(e.near),!1===os.containsPoint(as.origin)){if(null===as.intersectSphere(os,ls))return;if(as.origin.distanceToSquared(ls)>(e.far-e.near)**2)return}ss.copy(i).invert(),as.copy(e.ray).applyMatrix4(ss),null!==n.boundingBox&&!1===as.intersectsBox(n.boundingBox)||this._computeIntersections(e,t)}}_computeIntersections(e,t){let n;const r=this.geometry,i=this.material,s=r.index,a=r.attributes.position,o=r.attributes.uv,l=r.attributes.uv1,c=r.attributes.normal,h=r.groups,u=r.drawRange;if(null!==s)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const r=h[d],a=i[r.materialIndex];for(let i=Math.max(r.start,u.start),h=Math.min(s.count,Math.min(r.start+r.count,u.start+u.count));i<h;i+=3){const h=s.getX(i),u=s.getX(i+1),d=s.getX(i+2);n=_s(this,a,e,as,o,l,c,h,u,d),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=r.materialIndex,t.push(n))}}else{for(let r=Math.max(0,u.start),a=Math.min(s.count,u.start+u.count);r<a;r+=3){const a=s.getX(r),h=s.getX(r+1),u=s.getX(r+2);n=_s(this,i,e,as,o,l,c,a,h,u),n&&(n.faceIndex=Math.floor(r/3),t.push(n))}}else if(void 0!==a)if(Array.isArray(i))for(let d=0,p=h.length;d<p;d++){const r=h[d],s=i[r.materialIndex];for(let i=Math.max(r.start,u.start),h=Math.min(a.count,Math.min(r.start+r.count,u.start+u.count));i<h;i+=3){n=_s(this,s,e,as,o,l,c,i,i+1,i+2),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=r.materialIndex,t.push(n))}}else{for(let r=Math.max(0,u.start),s=Math.min(a.count,u.start+u.count);r<s;r+=3){n=_s(this,i,e,as,o,l,c,r,r+1,r+2),n&&(n.faceIndex=Math.floor(r/3),t.push(n))}}}}function _s(e,t,n,r,i,s,a,o,l,c){e.getVertexPosition(o,cs),e.getVertexPosition(l,hs),e.getVertexPosition(c,us);const h=function(e,t,n,r,i,s,a,o){let l;if(l=t.side===m?r.intersectTriangle(a,s,i,!0,o):r.intersectTriangle(i,s,a,t.side===f,o),null===l)return null;bs.copy(o),bs.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(bs);return c<n.near||c>n.far?null:{distance:c,point:bs.clone(),object:e}}(e,t,n,r,cs,hs,us,xs);if(h){i&&(fs.fromBufferAttribute(i,o),ms.fromBufferAttribute(i,l),gs.fromBufferAttribute(i,c),h.uv=_i.getInterpolation(xs,cs,hs,us,fs,ms,gs,new Ln)),s&&(fs.fromBufferAttribute(s,o),ms.fromBufferAttribute(s,l),gs.fromBufferAttribute(s,c),h.uv1=_i.getInterpolation(xs,cs,hs,us,fs,ms,gs,new Ln),h.uv2=h.uv1),a&&(As.fromBufferAttribute(a,o),vs.fromBufferAttribute(a,l),ys.fromBufferAttribute(a,c),h.normal=_i.getInterpolation(xs,cs,hs,us,As,vs,ys,new hr),h.normal.dot(r.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c:c,normal:new hr,materialIndex:0};_i.getNormal(cs,hs,us,e.normal),h.face=e}return h}class Ss extends is{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const a=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(e,t,n,r,i,s,p,f,m,g,A){const v=s/m,y=p/g,x=s/2,b=p/2,E=f/2,_=m+1,S=g+1;let w=0,M=0;const C=new hr;for(let a=0;a<S;a++){const s=a*y-b;for(let o=0;o<_;o++){const u=o*v-x;C[e]=u*r,C[t]=s*i,C[n]=E,l.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,c.push(C.x,C.y,C.z),h.push(o/m),h.push(1-a/g),w+=1}}for(let a=0;a<g;a++)for(let e=0;e<m;e++){const t=u+e+_*a,n=u+e+_*(a+1),r=u+(e+1)+_*(a+1),i=u+(e+1)+_*a;o.push(t,n,i),o.push(n,r,i),M+=6}a.addGroup(d,M,A),d+=M,u+=w}p("z","y","x",-1,-1,n,t,e,s,i,0),p("z","y","x",1,-1,n,t,-e,s,i,1),p("x","z","y",1,1,e,n,t,r,s,2),p("x","z","y",1,-1,e,n,-t,r,s,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(o),this.setAttribute("position",new qi(l,3)),this.setAttribute("normal",new qi(c,3)),this.setAttribute("uv",new qi(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ss(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function ws(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Ms(e){const t={};for(let n=0;n<e.length;n++){const r=ws(e[n]);for(const e in r)t[e]=r[e]}return t}function Cs(e){return null===e.getRenderTarget()?e.outputColorSpace:Qt}const Ts={clone:ws,merge:Ms};class Is extends wi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ws(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Bs extends ui{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gr,this.projectionMatrix=new Gr,this.projectionMatrixInverse=new Gr}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 Rs extends Bs{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,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*_n*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*En*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*_n*Math.atan(Math.tan(.5*En*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,n,r,i,s){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=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*En*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;i+=s.offsetX*r/e,t-=s.offsetY*n/a,r*=s.width/e,n*=s.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,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 Ps=-90;class Ds extends ui{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n;const r=new Rs(Ps,1,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);const i=new Rs(Ps,1,e,t);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(-1,0,0),this.add(i);const s=new Rs(Ps,1,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);const a=new Rs(Ps,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const o=new Rs(Ps,1,e,t);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);const l=new Rs(Ps,1,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,s,a,o,l]=this.children,c=e.getRenderTarget(),h=e.toneMapping,u=e.xr.enabled;e.toneMapping=J,e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,o),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=h,e.xr.enabled=u,n.texture.needsPMREMUpdate=!0}}class Ls extends tr{constructor(e,t,n,r,i,s,a,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:ie,n,r,i,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Fs extends rr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];void 0!==t.encoding&&(Qn("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Ft?zt:Gt),this.texture=new Ls(r,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:Ae}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 n={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 <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\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 <common>\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"},r=new Ss(5,5,5),i=new Is({name:"CubemapFromEquirect",uniforms:ws(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:m,blending:v});i.uniforms.tEquirect.value=t;const s=new Es(r,i),a=t.minFilter;t.minFilter===xe&&(t.minFilter=Ae);return new Ds(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,r);e.setRenderTarget(i)}}const Us=new hr,Os=new hr,Ns=new Fn;class ks{constructor(e=new hr(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,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Us.subVectors(n,t).cross(Os.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,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 n=e.delta(Us),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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 n=t||Ns.getNormalMatrix(e),r=this.coplanarPoint(Us).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 Gs=new Rr,zs=new hr;class Qs{constructor(e=new ks,t=new ks,n=new ks,r=new ks,i=new ks,s=new ks){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],A=n[14],v=n[15];return t[0].setComponents(a-r,h-o,f-u,v-m).normalize(),t[1].setComponents(a+r,h+o,f+u,v+m).normalize(),t[2].setComponents(a+i,h+l,f+d,v+g).normalize(),t[3].setComponents(a-i,h-l,f-d,v-g).normalize(),t[4].setComponents(a-s,h-c,f-p,v-A).normalize(),t[5].setComponents(a+s,h+c,f+p,v+A).normalize(),this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Gs.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Gs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Gs)}intersectsSprite(e){return Gs.center.set(0,0,0),Gs.radius=.7071067811865476,Gs.applyMatrix4(e.matrixWorld),this.intersectsSphere(Gs)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(zs.x=r.normal.x>0?e.max.x:e.min.x,zs.y=r.normal.y>0?e.max.y:e.min.y,zs.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(zs)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Vs(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Hs(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=r.get(t);void 0===s?r.set(t,function(t,r){const i=t.array,s=t.usage,a=e.createBuffer();let o;if(e.bindBuffer(r,a),e.bufferData(r,i,s),t.onUploadCallback(),i instanceof Float32Array)o=e.FLOAT;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=e.HALF_FLOAT}else o=e.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=e.SHORT;else if(i instanceof Uint32Array)o=e.UNSIGNED_INT;else if(i instanceof Int32Array)o=e.INT;else if(i instanceof Int8Array)o=e.BYTE;else if(i instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=e.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):s.version<t.version&&(!function(t,r,i){const s=r.array,a=r.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,s):(n?e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count):e.bufferSubData(i,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count)),a.count=-1),r.onUploadCallback()}(s.buffer,t,i),s.version=t.version)}}}class js extends is{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,s=t/2,a=Math.floor(n),o=Math.floor(r),l=a+1,c=o+1,h=e/a,u=t/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const e=g*u-s;for(let t=0;t<l;t++){const n=t*h-i;p.push(n,-e,0),f.push(0,0,1),m.push(t/a),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let e=0;e<a;e++){const t=e+l*g,n=e+l*(g+1),r=e+1+l*(g+1),i=e+1+l*g;d.push(t,n,i),d.push(n,r,i)}this.setIndex(d),this.setAttribute("position",new qi(p,3)),this.setAttribute("normal",new qi(f,3)),this.setAttribute("uv",new qi(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new js(e.width,e.height,e.widthSegments,e.heightSegments)}}const Ws={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 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\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#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, 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 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_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\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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 <cube_uv_reflection_fragment>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\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 <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\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 <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\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 <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\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 <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Xs={common:{diffuse:{value:new Bi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Fn},alphaMap:{value:null},alphaMapTransform:{value:new Fn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Fn}},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 Fn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Fn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Fn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Fn},normalScale:{value:new Ln(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Fn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Fn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Fn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Fn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Bi(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 Bi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Fn}},sprite:{diffuse:{value:new Bi(16777215)},opacity:{value:1},center:{value:new Ln(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Fn},alphaMap:{value:null},alphaTest:{value:0}}},Ys={basic:{uniforms:Ms([Xs.common,Xs.specularmap,Xs.envmap,Xs.aomap,Xs.lightmap,Xs.fog]),vertexShader:Ws.meshbasic_vert,fragmentShader:Ws.meshbasic_frag},lambert:{uniforms:Ms([Xs.common,Xs.specularmap,Xs.envmap,Xs.aomap,Xs.lightmap,Xs.emissivemap,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,Xs.fog,Xs.lights,{emissive:{value:new Bi(0)}}]),vertexShader:Ws.meshlambert_vert,fragmentShader:Ws.meshlambert_frag},phong:{uniforms:Ms([Xs.common,Xs.specularmap,Xs.envmap,Xs.aomap,Xs.lightmap,Xs.emissivemap,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,Xs.fog,Xs.lights,{emissive:{value:new Bi(0)},specular:{value:new Bi(1118481)},shininess:{value:30}}]),vertexShader:Ws.meshphong_vert,fragmentShader:Ws.meshphong_frag},standard:{uniforms:Ms([Xs.common,Xs.envmap,Xs.aomap,Xs.lightmap,Xs.emissivemap,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,Xs.roughnessmap,Xs.metalnessmap,Xs.fog,Xs.lights,{emissive:{value:new Bi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ws.meshphysical_vert,fragmentShader:Ws.meshphysical_frag},toon:{uniforms:Ms([Xs.common,Xs.aomap,Xs.lightmap,Xs.emissivemap,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,Xs.gradientmap,Xs.fog,Xs.lights,{emissive:{value:new Bi(0)}}]),vertexShader:Ws.meshtoon_vert,fragmentShader:Ws.meshtoon_frag},matcap:{uniforms:Ms([Xs.common,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,Xs.fog,{matcap:{value:null}}]),vertexShader:Ws.meshmatcap_vert,fragmentShader:Ws.meshmatcap_frag},points:{uniforms:Ms([Xs.points,Xs.fog]),vertexShader:Ws.points_vert,fragmentShader:Ws.points_frag},dashed:{uniforms:Ms([Xs.common,Xs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ws.linedashed_vert,fragmentShader:Ws.linedashed_frag},depth:{uniforms:Ms([Xs.common,Xs.displacementmap]),vertexShader:Ws.depth_vert,fragmentShader:Ws.depth_frag},normal:{uniforms:Ms([Xs.common,Xs.bumpmap,Xs.normalmap,Xs.displacementmap,{opacity:{value:1}}]),vertexShader:Ws.meshnormal_vert,fragmentShader:Ws.meshnormal_frag},sprite:{uniforms:Ms([Xs.sprite,Xs.fog]),vertexShader:Ws.sprite_vert,fragmentShader:Ws.sprite_frag},background:{uniforms:{uvTransform:{value:new Fn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ws.background_vert,fragmentShader:Ws.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Ws.backgroundCube_vert,fragmentShader:Ws.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ws.cube_vert,fragmentShader:Ws.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ws.equirect_vert,fragmentShader:Ws.equirect_frag},distanceRGBA:{uniforms:Ms([Xs.common,Xs.displacementmap,{referencePosition:{value:new hr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ws.distanceRGBA_vert,fragmentShader:Ws.distanceRGBA_frag},shadow:{uniforms:Ms([Xs.lights,Xs.fog,{color:{value:new Bi(0)},opacity:{value:1}}]),vertexShader:Ws.shadow_vert,fragmentShader:Ws.shadow_frag}};Ys.physical={uniforms:Ms([Ys.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Fn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Fn},clearcoatNormalScale:{value:new Ln(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Fn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Fn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Fn},sheen:{value:0},sheenColor:{value:new Bi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Fn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Fn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Fn},transmissionSamplerSize:{value:new Ln},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Fn},attenuationDistance:{value:0},attenuationColor:{value:new Bi(0)},specularColor:{value:new Bi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Fn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Fn}}]),vertexShader:Ws.meshphysical_vert,fragmentShader:Ws.meshphysical_frag};const qs={r:0,b:0,g:0};function Ks(e,t,n,r,i,s,a){const o=new Bi(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function g(t,n){t.getRGB(qs,Cs(e)),r.buffers.color.setClear(qs.r,qs.g,qs.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),h=t,g(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(e){h=e,g(o,h)},render:function(s,A){let v=!1,y=!0===A.isScene?A.background:null;if(y&&y.isTexture){y=(A.backgroundBlurriness>0?n:t).get(y)}switch(null===y?g(o,h):y&&y.isColor&&(g(y,1),v=!0),e.xr.getEnvironmentBlendMode()){case"opaque":v=!0;break;case"additive":r.buffers.color.setClear(0,0,0,1,a),v=!0;break;case"alpha-blend":r.buffers.color.setClear(0,0,0,0,a),v=!0}(e.autoClear||v)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===le)?(void 0===c&&(c=new Es(new Ss(1,1,1),new Is({name:"BackgroundCubeMaterial",uniforms:ws(Ys.backgroundCube.uniforms),vertexShader:Ys.backgroundCube.vertexShader,fragmentShader:Ys.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,c.material.toneMapped=y.colorSpace!==zt,u===y&&d===y.version&&p===e.toneMapping||(c.material.needsUpdate=!0,u=y,d=y.version,p=e.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(void 0===l&&(l=new Es(new js(2,2),new Is({name:"BackgroundMaterial",uniforms:ws(Ys.background.uniforms),vertexShader:Ys.background.vertexShader,fragmentShader:Ys.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=y,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=y.colorSpace!==zt,!0===y.matrixAutoUpdate&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),u===y&&d===y.version&&p===e.toneMapping||(l.material.needsUpdate=!0,u=y,d=y.version,p=e.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function Js(e,t,n,r){const i=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(t){return r.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let s=0;s<i;s++)t[s]=0,n[s]=0,r[s]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function m(e){g(e,0)}function g(n,i){const s=c.newAttributes,a=c.enabledAttributes,o=c.attributeDivisors;if(s[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),o[n]!==i){(r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),o[n]=i}}function A(){const t=c.newAttributes,n=c.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function v(t,n,i,s,a,o){!0!==r.isWebGL2||i!==e.INT&&i!==e.UNSIGNED_INT?e.vertexAttribPointer(t,n,i,s,a,o):e.vertexAttribIPointer(t,n,i,a,o)}function y(){x(),h=!0,c!==l&&(c=l,u(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,d,y,x){let b=!1;if(a){const t=function(t,n,i){const a=!0===i.wireframe;let l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let h=c[a];void 0===h&&(h=p(r.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[a]=h);return h}(y,d,l);c!==t&&(c=t,u(c.object)),b=function(e,t,n,r){const i=c.attributes,s=t.attributes;let a=0;const o=n.getAttributes();for(const l in o){if(o[l].location>=0){const t=i[l];let n=s[l];if(void 0===n&&("instanceMatrix"===l&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(n=e.instanceColor)),void 0===t)return!0;if(t.attribute!==n)return!0;if(n&&t.data!==n.data)return!0;a++}}return c.attributesNum!==a||c.index!==r}(i,y,d,x),b&&function(e,t,n,r){const i={},s=t.attributes;let a=0;const o=n.getAttributes();for(const l in o){if(o[l].location>=0){let t=s[l];void 0===t&&("instanceMatrix"===l&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===l&&e.instanceColor&&(t=e.instanceColor));const n={};n.attribute=t,t&&t.data&&(n.data=t.data),i[l]=n,a++}}c.attributes=i,c.attributesNum=a,c.index=r}(i,y,d,x)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===e||(c.geometry=y.id,c.program=d.id,c.wireframe=e,b=!0)}null!==x&&n.update(x,e.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(i,s,a,o){if(!1===r.isWebGL2&&(i.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const t in c){const r=c[t];if(r.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&i.instanceMatrix&&(s=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(s=i.instanceColor)),void 0!==s){const t=s.normalized,a=s.itemSize,l=n.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,l=n.stride,d=s.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,h,t,l*u,(d+a/r.locationSize*e)*u)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,s.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)v(r.location+e,a/r.locationSize,h,t,a*u,a/r.locationSize*e*u)}}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r.location,n);break;case 3:e.vertexAttrib3fv(r.location,n);break;case 4:e.vertexAttrib4fv(r.location,n);break;default:e.vertexAttrib1fv(r.location,n)}}}}A()}(i,l,d,y),null!==x&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in o){const t=o[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;const t=o[e.id];for(const n in t){const e=t[n];for(const t in e)d(e[t].object),delete e[t];delete t[n]}delete o[e.id]},releaseStatesOfProgram:function(e){for(const t in o){const n=o[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:A}}function Zs(e,t,n,r){const i=r.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,r){e.drawArrays(s,t,r),n.update(r,s,1)},this.renderInstances=function(r,a,o){if(0===o)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,r,a,o),n.update(a,s,o)}}function $s(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),A=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,y=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?e.getParameter(e.MAX_SAMPLES):0}}function ea(e){const t=this;let n=null,r=0,i=!1,s=!1;const a=new ks,o=new Fn,l={value:null,needsUpdate:!1};function c(e,n,r,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=r+4*s,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let n=0,l=r;n!==s;++n,l+=4)a.copy(e[n]).applyMatrix4(i,o),a.normal.toArray(c,l),c[l+3]=a.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(a,o,h){const u=a.clippingPlanes,d=a.clipIntersection,p=a.clipShadows,f=e.get(a);if(!i||null===u||0===u.length||s&&!p)s?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=s?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=c(u,o,t,h);for(let r=0;r!==t;++r)i[r]=n[r];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function ta(e){let t=new WeakMap;function n(e,t){return t===ae?e.mapping=ie:t===oe&&(e.mapping=se),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const s=i.mapping;if(s===ae||s===oe){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const s=i.image;if(s&&s.height>0){const a=new Fs(s.height/2);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class na extends Bs{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,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,n,r,i,s){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=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,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),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,a=r+t,o=r-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;i+=e*this.view.offsetX,s=i+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,a,o,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 ra=[.125,.215,.35,.446,.526,.582],ia=20,sa=new na,aa=new Bi;let oa=null;const la=(1+Math.sqrt(5))/2,ca=1/la,ha=[new hr(1,1,1),new hr(-1,1,1),new hr(1,1,-1),new hr(-1,1,-1),new hr(0,la,ca),new hr(0,la,-ca),new hr(ca,0,la),new hr(-ca,0,la),new hr(la,ca,0),new hr(-la,ca,0)];class ua{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,n=.1,r=100){oa=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ma(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=fa(),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;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(oa),e.scissorTest=!1,pa(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ie||e.mapping===se?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),oa=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Ae,minFilter:Ae,generateMipmaps:!1,type:Ie,format:Le,colorSpace:Qt,depthBuffer:!1},r=da(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=da(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+ra.length;for(let a=0;a<s;a++){const s=Math.pow(2,i);n.push(s);let o=1/s;a>e-4?o=ra[a-e+4-1]:0===a&&(o=0),r.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),v=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];A.set(r,f*p*e),v.set(u,m*p*e);const i=[e,e,e,e,e,e];y.set(i,g*p*e)}const x=new is;x.setAttribute("position",new Gi(A,f)),x.setAttribute("uv",new Gi(v,m)),x.setAttribute("faceIndex",new Gi(y,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(ia),i=new hr(0,1,0),s=new Is({name:"SphericalGaussianBlur",defines:{n:ia,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ga(),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 <cube_uv_reflection_fragment>\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:v,depthTest:!1,depthWrite:!1});return s}(r,e,t)}return r}_compileMaterial(e){const t=new Es(this._lodPlanes[0],e);this._renderer.compile(t,sa)}_sceneToCubeUV(e,t,n,r){const i=new Rs(90,1,t,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(aa),o.toneMapping=J,o.autoClear=!1;const h=new Pi({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),u=new Es(new Ss,h);let d=!1;const p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,d=!0):(h.color.copy(aa),d=!0);for(let f=0;f<6;f++){const t=f%3;0===t?(i.up.set(0,s[f],0),i.lookAt(a[f],0,0)):1===t?(i.up.set(0,0,s[f]),i.lookAt(0,a[f],0)):(i.up.set(0,s[f],0),i.lookAt(0,0,a[f]));const n=this._cubeSize;pa(r,t*n,f>2?n:0,n,n),o.setRenderTarget(r),d&&o.render(u,i),o.render(e,i)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===ie||e.mapping===se;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ma()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=fa());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new Es(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const a=this._cubeSize;pa(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,sa)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const t=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),n=ha[(r-1)%ha.length];this._blur(e,r-1,r,t,n)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Es(this._lodPlanes[r],l),h=l.uniforms,u=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):ia;f>ia&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let y=0;y<ia;++y){const e=y/p,t=Math.exp(-e*e/2);m.push(t),0===y?g+=t:y<f&&(g+=2*t)}for(let y=0;y<m.length;y++)m[y]=m[y]/g;h.envMap.value=e.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===s,a&&(h.poleAxis.value=a);const{_lodMax:A}=this;h.dTheta.value=d,h.mipInt.value=A-n;const v=this._sizeLods[r];pa(t,3*v*(r>A-4?r-A+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(t),o.render(c,sa)}}function da(e,t,n){const r=new rr(e,t,n);return r.texture.mapping=le,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function pa(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function fa(){return new Is({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ga(),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 <common>\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:v,depthTest:!1,depthWrite:!1})}function ma(){return new Is({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ga(),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:v,depthTest:!1,depthWrite:!1})}function ga(){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 Aa(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,a=s===ae||s===oe,o=s===ie||s===se;if(a||o){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new ua(e)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const s=i.image;if(a&&s&&s.height>0||o&&s&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(s)){null===n&&(n=new ua(e));const s=a?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,s),i.addEventListener("dispose",r),s.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function va(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function ya(e,t,n,r){const i={},s=new WeakMap;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const n in o.attributes)t.remove(o.attributes[n]);o.removeEventListener("dispose",a),delete i[o.id];const l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const o=new(On(n)?Xi:ji)(n,1);o.version=a;const l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const s in r)t.update(r[s],e.ARRAY_BUFFER);const i=n.morphAttributes;for(const s in i){const n=i[s];for(let r=0,i=n.length;r<i;r++)t.update(n[r],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return s.get(e)}}}function xa(e,t,n,r){const i=r.isWebGL2;let s,a,o;this.setMode=function(e){s=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(s,r,a,t*o),n.update(r,s,1)},this.renderInstances=function(r,l,c){if(0===c)return;let h,u;if(i)h=e,u="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](s,l,a,r*o,c),n.update(l,s,c)}}function ba(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function Ea(e,t){return e[0]-t[0]}function _a(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Sa(e,t,n){const r={},i=new Float32Array(8),s=new WeakMap,a=new nr,o=[];for(let l=0;l<8;l++)o[l]=[l,0];return{update:function(l,c,h){const u=l.morphTargetInfluences;if(!0===t.isWebGL2){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=void 0!==d?d.length:0;let f=s.get(c);if(void 0===f||f.count!==p){void 0!==f&&f.texture.dispose();const A=void 0!==c.morphAttributes.position,v=void 0!==c.morphAttributes.normal,y=void 0!==c.morphAttributes.color,x=c.morphAttributes.position||[],b=c.morphAttributes.normal||[],E=c.morphAttributes.color||[];let _=0;!0===A&&(_=1),!0===v&&(_=2),!0===y&&(_=3);let S=c.attributes.position.count*_,w=1;S>t.maxTextureSize&&(w=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const M=new Float32Array(S*w*4*p),C=new ir(M,S,w,p);C.type=Te,C.needsUpdate=!0;const T=4*_;for(let B=0;B<p;B++){const R=x[B],P=b[B],D=E[B],L=S*w*4*B;for(let F=0;F<R.count;F++){const U=F*T;!0===A&&(a.fromBufferAttribute(R,F),M[L+U+0]=a.x,M[L+U+1]=a.y,M[L+U+2]=a.z,M[L+U+3]=0),!0===v&&(a.fromBufferAttribute(P,F),M[L+U+4]=a.x,M[L+U+5]=a.y,M[L+U+6]=a.z,M[L+U+7]=0),!0===y&&(a.fromBufferAttribute(D,F),M[L+U+8]=a.x,M[L+U+9]=a.y,M[L+U+10]=a.z,M[L+U+11]=4===D.itemSize?a.w:1)}}function I(){C.dispose(),s.delete(c),c.removeEventListener("dispose",I)}f={count:p,texture:C,size:new Ln(S,w)},s.set(c,f),c.addEventListener("dispose",I)}let m=0;for(let O=0;O<u.length;O++)m+=u[O];const g=c.morphTargetsRelative?1:1-m;h.getUniforms().setValue(e,"morphTargetBaseInfluence",g),h.getUniforms().setValue(e,"morphTargetInfluences",u),h.getUniforms().setValue(e,"morphTargetsTexture",f.texture,n),h.getUniforms().setValue(e,"morphTargetsTextureSize",f.size)}else{const N=void 0===u?0:u.length;let k=r[c.id];if(void 0===k||k.length!==N){k=[];for(let H=0;H<N;H++)k[H]=[H,0];r[c.id]=k}for(let j=0;j<N;j++){const W=k[j];W[0]=j,W[1]=u[j]}k.sort(_a);for(let X=0;X<8;X++)X<N&&k[X][1]?(o[X][0]=k[X][0],o[X][1]=k[X][1]):(o[X][0]=Number.MAX_SAFE_INTEGER,o[X][1]=0);o.sort(Ea);const G=c.morphAttributes.position,z=c.morphAttributes.normal;let Q=0;for(let Y=0;Y<8;Y++){const q=o[Y],K=q[0],J=q[1];K!==Number.MAX_SAFE_INTEGER&&J?(G&&c.getAttribute("morphTarget"+Y)!==G[K]&&c.setAttribute("morphTarget"+Y,G[K]),z&&c.getAttribute("morphNormal"+Y)!==z[K]&&c.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,Q+=J):(G&&!0===c.hasAttribute("morphTarget"+Y)&&c.deleteAttribute("morphTarget"+Y),z&&!0===c.hasAttribute("morphNormal"+Y)&&c.deleteAttribute("morphNormal"+Y),i[Y]=0)}const V=c.morphTargetsRelative?1:1-Q;h.getUniforms().setValue(e,"morphTargetBaseInfluence",V),h.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function wa(e,t,n,r){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(a){const o=r.render.frame,l=a.geometry,c=t.get(a,l);return i.get(c)!==o&&(t.update(c),i.set(c,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),n.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,e.ARRAY_BUFFER)),c},dispose:function(){i=new WeakMap}}}const Ma=new tr,Ca=new ir,Ta=new ar,Ia=new Ls,Ba=[],Ra=[],Pa=new Float32Array(16),Da=new Float32Array(9),La=new Float32Array(4);function Fa(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=Ba[i];if(void 0===s&&(s=new Float32Array(i),Ba[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function Ua(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Oa(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function Na(e,t){let n=Ra[t];void 0===n&&(n=new Int32Array(t),Ra[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function ka(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ga(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Ua(n,t))return;e.uniform2fv(this.addr,t),Oa(n,t)}}function za(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Ua(n,t))return;e.uniform3fv(this.addr,t),Oa(n,t)}}function Qa(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Ua(n,t))return;e.uniform4fv(this.addr,t),Oa(n,t)}}function Va(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Ua(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Oa(n,t)}else{if(Ua(n,r))return;La.set(r),e.uniformMatrix2fv(this.addr,!1,La),Oa(n,r)}}function Ha(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Ua(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Oa(n,t)}else{if(Ua(n,r))return;Da.set(r),e.uniformMatrix3fv(this.addr,!1,Da),Oa(n,r)}}function ja(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(Ua(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Oa(n,t)}else{if(Ua(n,r))return;Pa.set(r),e.uniformMatrix4fv(this.addr,!1,Pa),Oa(n,r)}}function Wa(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Xa(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Ua(n,t))return;e.uniform2iv(this.addr,t),Oa(n,t)}}function Ya(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Ua(n,t))return;e.uniform3iv(this.addr,t),Oa(n,t)}}function qa(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Ua(n,t))return;e.uniform4iv(this.addr,t),Oa(n,t)}}function Ka(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Ja(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Ua(n,t))return;e.uniform2uiv(this.addr,t),Oa(n,t)}}function Za(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(Ua(n,t))return;e.uniform3uiv(this.addr,t),Oa(n,t)}}function $a(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Ua(n,t))return;e.uniform4uiv(this.addr,t),Oa(n,t)}}function eo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(t||Ma,i)}function to(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Ta,i)}function no(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Ia,i)}function ro(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Ca,i)}function io(e,t){e.uniform1fv(this.addr,t)}function so(e,t){const n=Fa(t,this.size,2);e.uniform2fv(this.addr,n)}function ao(e,t){const n=Fa(t,this.size,3);e.uniform3fv(this.addr,n)}function oo(e,t){const n=Fa(t,this.size,4);e.uniform4fv(this.addr,n)}function lo(e,t){const n=Fa(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function co(e,t){const n=Fa(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ho(e,t){const n=Fa(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function uo(e,t){e.uniform1iv(this.addr,t)}function po(e,t){e.uniform2iv(this.addr,t)}function fo(e,t){e.uniform3iv(this.addr,t)}function mo(e,t){e.uniform4iv(this.addr,t)}function go(e,t){e.uniform1uiv(this.addr,t)}function Ao(e,t){e.uniform2uiv(this.addr,t)}function vo(e,t){e.uniform3uiv(this.addr,t)}function yo(e,t){e.uniform4uiv(this.addr,t)}function xo(e,t,n){const r=this.cache,i=t.length,s=Na(n,i);Ua(r,s)||(e.uniform1iv(this.addr,s),Oa(r,s));for(let a=0;a!==i;++a)n.setTexture2D(t[a]||Ma,s[a])}function bo(e,t,n){const r=this.cache,i=t.length,s=Na(n,i);Ua(r,s)||(e.uniform1iv(this.addr,s),Oa(r,s));for(let a=0;a!==i;++a)n.setTexture3D(t[a]||Ta,s[a])}function Eo(e,t,n){const r=this.cache,i=t.length,s=Na(n,i);Ua(r,s)||(e.uniform1iv(this.addr,s),Oa(r,s));for(let a=0;a!==i;++a)n.setTextureCube(t[a]||Ia,s[a])}function _o(e,t,n){const r=this.cache,i=t.length,s=Na(n,i);Ua(r,s)||(e.uniform1iv(this.addr,s),Oa(r,s));for(let a=0;a!==i;++a)n.setTexture2DArray(t[a]||Ca,s[a])}class So{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return ka;case 35664:return Ga;case 35665:return za;case 35666:return Qa;case 35674:return Va;case 35675:return Ha;case 35676:return ja;case 5124:case 35670:return Wa;case 35667:case 35671:return Xa;case 35668:case 35672:return Ya;case 35669:case 35673:return qa;case 5125:return Ka;case 36294:return Ja;case 36295:return Za;case 36296:return $a;case 35678:case 36198:case 36298:case 36306:case 35682:return eo;case 35679:case 36299:case 36307:return to;case 35680:case 36300:case 36308:case 36293:return no;case 36289:case 36303:case 36311:case 36292:return ro}}(t.type)}}class wo{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return io;case 35664:return so;case 35665:return ao;case 35666:return oo;case 35674:return lo;case 35675:return co;case 35676:return ho;case 5124:case 35670:return uo;case 35667:case 35671:return po;case 35668:case 35672:return fo;case 35669:case 35673:return mo;case 5125:return go;case 36294:return Ao;case 36295:return vo;case 36296:return yo;case 35678:case 36198:case 36298:case 36306:case 35682:return xo;case 35679:case 36299:case 36307:return bo;case 35680:case 36300:case 36308:case 36293:return Eo;case 36289:case 36303:case 36311:case 36292:return _o}}(t.type)}}class Mo{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}}}const Co=/(\w+)(\])?(\[|\.)?/g;function To(e,t){e.seq.push(t),e.map[t.id]=t}function Io(e,t,n){const r=e.name,i=r.length;for(Co.lastIndex=0;;){const s=Co.exec(r),a=Co.lastIndex;let o=s[1];const l="]"===s[2],c=s[3];if(l&&(o|=0),void 0===c||"["===c&&a+2===i){To(n,void 0===c?new So(o,e,t):new wo(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new Mo(o),To(n,e)),n=e}}}class Bo{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);Io(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],a=n[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function Ro(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let Po=0;function Do(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let a=i;a<s;a++){const e=a+1;r.push(`${e===t?">":" "} ${e}: ${n[a]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function Lo(e,t){const n=function(e){switch(e){case Qt:return["Linear","( value )"];case zt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Fo(e,t){let n;switch(t){case Z:n="Linear";break;case $:n="Reinhard";break;case ee:n="OptimizedCineon";break;case te:n="ACESFilmic";break;case ne:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Uo(e){return""!==e}function Oo(e,t){const n=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,n).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 No(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const ko=/^[ \t]*#include +<([\w\d./]+)>/gm;function Go(e){return e.replace(ko,zo)}function zo(e,t){const n=Ws[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Go(n)}const Qo=/#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 Vo(e){return e.replace(Qo,Ho)}function Ho(e,t,n,r){let i="";for(let s=parseInt(t);s<parseInt(n);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function jo(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Wo(e,t,n,r){const i=e.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===u?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===d?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===p&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case ie:case se:t="ENVMAP_TYPE_CUBE";break;case le:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),h=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===se&&(t="ENVMAP_MODE_REFRACTION");return t}(n),f=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Y:t="ENVMAP_BLENDING_MULTIPLY";break;case q:t="ENVMAP_BLENDING_MIX";break;case K:t="ENVMAP_BLENDING_ADD"}return t}(n),m=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),g=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.normalMapTangentSpace||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Uo).join("\n")}(n),A=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),v=i.createProgram();let y,x,b=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(y=[A].filter(Uo).join("\n"),y.length>0&&(y+="\n"),x=[g,A].filter(Uo).join("\n"),x.length>0&&(x+="\n")):(y=[jo(n),"#define SHADER_NAME "+n.shaderName,A,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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(Uo).join("\n"),x=[g,jo(n),"#define SHADER_NAME "+n.shaderName,A,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==J?"#define TONE_MAPPING":"",n.toneMapping!==J?Ws.tonemapping_pars_fragment:"",n.toneMapping!==J?Fo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ws.encodings_pars_fragment,Lo("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Uo).join("\n")),a=Go(a),a=Oo(a,n),a=No(a,n),o=Go(o),o=Oo(o,n),o=No(o,n),a=Vo(a),o=Vo(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(b="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",n.glslVersion===An?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===An?"":"#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"+x);const E=b+y+a,_=b+x+o,S=Ro(i,i.VERTEX_SHADER,E),w=Ro(i,i.FRAGMENT_SHADER,_);if(i.attachShader(v,S),i.attachShader(v,w),void 0!==n.index0AttributeName?i.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),e.debug.checkShaderErrors){const t=i.getProgramInfoLog(v).trim(),n=i.getShaderInfoLog(S).trim(),r=i.getShaderInfoLog(w).trim();let s=!0,a=!0;if(!1===i.getProgramParameter(v,i.LINK_STATUS))if(s=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,v,S,w);else{const e=Do(i,S,"vertex"),n=Do(i,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+n)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==n&&""!==r||(a=!1);a&&(this.diagnostics={runnable:s,programLog:t,vertexShader:{log:n,prefix:y},fragmentShader:{log:r,prefix:x}})}let M,C;return i.deleteShader(S),i.deleteShader(w),this.getUniforms=function(){return void 0===M&&(M=new Bo(i,v)),M},this.getAttributes=function(){return void 0===C&&(C=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let a=1;r.type===e.FLOAT_MAT2&&(a=2),r.type===e.FLOAT_MAT3&&(a=3),r.type===e.FLOAT_MAT4&&(a=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}(i,v)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.name=n.shaderName,this.id=Po++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=w,this}let Xo=0;class Yo{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new qo(e),t.set(e,n)),n}}class qo{constructor(e){this.id=Xo++,this.code=e,this.usedTimes=0}}function Ko(e,t,n,r,i,s,a){const o=new Jr,l=new Yo,c=[],h=i.isWebGL2,u=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function A(e){return 1===e?"uv1":2===e?"uv2":3===e?"uv3":"uv"}return{getParameters:function(s,o,c,v,x){const b=v.fog,E=x.geometry,_=s.isMeshStandardMaterial?v.environment:null,S=(s.isMeshStandardMaterial?n:t).get(s.envMap||_),w=S&&S.mapping===le?S.image.height:null,M=f[s.type];null!==s.precision&&(p=i.getMaxPrecision(s.precision),p!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",p,"instead."));const C=E.morphAttributes.position||E.morphAttributes.normal||E.morphAttributes.color,T=void 0!==C?C.length:0;let I,B,R,P,D=0;if(void 0!==E.morphAttributes.position&&(D=1),void 0!==E.morphAttributes.normal&&(D=2),void 0!==E.morphAttributes.color&&(D=3),M){const e=Ys[M];I=e.vertexShader,B=e.fragmentShader}else I=s.vertexShader,B=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),P=l.getFragmentShaderID(s);const L=e.getRenderTarget(),F=!0===x.isInstancedMesh,U=!!s.map,O=!!s.matcap,N=!!S,k=!!s.aoMap,G=!!s.lightMap,z=!!s.bumpMap,Q=!!s.normalMap,V=!!s.displacementMap,H=!!s.emissiveMap,j=!!s.metalnessMap,W=!!s.roughnessMap,X=s.clearcoat>0,Y=s.iridescence>0,q=s.sheen>0,K=s.transmission>0,Z=X&&!!s.clearcoatMap,$=X&&!!s.clearcoatNormalMap,ee=X&&!!s.clearcoatRoughnessMap,te=Y&&!!s.iridescenceMap,ne=Y&&!!s.iridescenceThicknessMap,re=q&&!!s.sheenColorMap,ie=q&&!!s.sheenRoughnessMap,se=!!s.specularMap,ae=!!s.specularColorMap,oe=!!s.specularIntensityMap,ce=K&&!!s.transmissionMap,he=K&&!!s.thicknessMap,ue=!!s.gradientMap,de=!!s.alphaMap,pe=s.alphaTest>0,fe=!!s.extensions,me=!!E.attributes.uv1,ge=!!E.attributes.uv2,Ae=!!E.attributes.uv3;return{isWebGL2:h,shaderID:M,shaderName:s.type,vertexShader:I,fragmentShader:B,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:P,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,instancing:F,instancingColor:F&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:Qt,map:U,matcap:O,envMap:N,envMapMode:N&&S.mapping,envMapCubeUVHeight:w,aoMap:k,lightMap:G,bumpMap:z,normalMap:Q,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:Q&&s.normalMapType===kt,normalMapTangentSpace:Q&&s.normalMapType===Nt,metalnessMap:j,roughnessMap:W,clearcoat:X,clearcoatMap:Z,clearcoatNormalMap:$,clearcoatRoughnessMap:ee,iridescence:Y,iridescenceMap:te,iridescenceThicknessMap:ne,sheen:q,sheenColorMap:re,sheenRoughnessMap:ie,specularMap:se,specularColorMap:ae,specularIntensityMap:oe,transmission:K,transmissionMap:ce,thicknessMap:he,gradientMap:ue,opaque:!1===s.transparent&&s.blending===y,alphaMap:de,alphaTest:pe,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:k&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:z&&A(s.bumpMap.channel),normalMapUv:Q&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:j&&A(s.metalnessMap.channel),roughnessMapUv:W&&A(s.roughnessMap.channel),clearcoatMapUv:Z&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:$&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:ne&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:re&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:ie&&A(s.sheenRoughnessMap.channel),specularMapUv:se&&A(s.specularMap.channel),specularColorMapUv:ae&&A(s.specularColorMap.channel),specularIntensityMapUv:oe&&A(s.specularIntensityMap.channel),transmissionMapUv:ce&&A(s.transmissionMap.channel),thicknessMapUv:he&&A(s.thicknessMap.channel),alphaMapUv:de&&A(s.alphaMap.channel),vertexTangents:Q&&!!E.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!E.attributes.color&&4===E.attributes.color.itemSize,vertexUv1s:me,vertexUv2s:ge,vertexUv3s:Ae,pointsUvs:!0===x.isPoints&&!!E.attributes.uv&&(U||de),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==E.morphAttributes.position,morphNormals:void 0!==E.morphAttributes.normal,morphColors:void 0!==E.morphAttributes.color,morphTargetsCount:T,morphTextureStride:D,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:J,useLegacyLights:e.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:fe&&!0===s.extensions.derivatives,extensionFragDepth:fe&&!0===s.extensions.fragDepth,extensionDrawBuffers:fe&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:fe&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(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.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)}(n,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0);t.supportsVertexTextures&&o.enable(1);t.instancing&&o.enable(2);t.instancingColor&&o.enable(3);t.matcap&&o.enable(4);t.envMap&&o.enable(5);t.normalMapObjectSpace&&o.enable(6);t.normalMapTangentSpace&&o.enable(7);t.clearcoat&&o.enable(8);t.iridescence&&o.enable(9);t.alphaTest&&o.enable(10);t.vertexColors&&o.enable(11);t.vertexAlphas&&o.enable(12);t.vertexUv1s&&o.enable(13);t.vertexUv2s&&o.enable(14);t.vertexUv3s&&o.enable(15);t.vertexTangents&&o.enable(16);e.push(o.mask),o.disableAll(),t.fog&&o.enable(0);t.useFog&&o.enable(1);t.flatShading&&o.enable(2);t.logarithmicDepthBuffer&&o.enable(3);t.skinning&&o.enable(4);t.morphTargets&&o.enable(5);t.morphNormals&&o.enable(6);t.morphColors&&o.enable(7);t.premultipliedAlpha&&o.enable(8);t.shadowMapEnabled&&o.enable(9);t.useLegacyLights&&o.enable(10);t.doubleSided&&o.enable(11);t.flipSided&&o.enable(12);t.useDepthPacking&&o.enable(13);t.dithering&&o.enable(14);t.transmission&&o.enable(15);t.sheen&&o.enable(16);t.opaque&&o.enable(17);t.pointsUvs&&o.enable(18);e.push(o.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=f[e.type];let n;if(t){const e=Ys[t];n=Ts.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,i=c.length;e<i;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new Wo(e,n,t,s),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function Jo(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Zo(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function $o(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function el(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,a,o,l,c){const h=s(e,t,a,o,l,c);a.transmission>0?r.push(h):!0===a.transparent?i.push(h):n.push(h)},unshift:function(e,t,a,o,l,c){const h=s(e,t,a,o,l,c);a.transmission>0?r.unshift(h):!0===a.transparent?i.unshift(h):n.unshift(h)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||Zo),r.length>1&&r.sort(t||$o),i.length>1&&i.sort(t||$o)}}}function tl(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new el,e.set(t,[i])):n>=r.length?(i=new el,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function nl(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new hr,color:new Bi};break;case"SpotLight":n={position:new hr,direction:new hr,color:new Bi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new hr,color:new Bi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new hr,skyColor:new Bi,groundColor:new Bi};break;case"RectAreaLight":n={color:new Bi,position:new hr,halfWidth:new hr,halfHeight:new hr}}return e[t.id]=n,n}}}let rl=0;function il(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function sl(e,t){const n=new nl,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ln};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ln,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={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 l=0;l<9;l++)i.probe.push(new hr);const s=new hr,a=new Gr,o=new Gr;return{setup:function(s,a){let o=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,A=0,v=0,y=0;s.sort(il);const x=!0===a?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],a=t.color,b=t.intensity,E=t.distance,_=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=a.r*b*x,l+=a.g*b*x,c+=a.b*b*x;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],b);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[h]=n,i.directionalShadowMap[h]=_,i.directionalShadowMatrix[h]=t.shadow.matrix,m++}i.directional[h]=e,h++}else if(t.isSpotLight){const e=n.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(a).multiplyScalar(b*x),e.distance=E,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[d]=e;const s=t.shadow;if(t.map&&(i.spotLightMap[v]=t.map,v++,s.updateMatrices(t),t.castShadow&&y++),i.spotLightMatrix[d]=s.matrix,t.castShadow){const e=r.get(t);e.shadowBias=s.bias,e.shadowNormalBias=s.normalBias,e.shadowRadius=s.radius,e.shadowMapSize=s.mapSize,i.spotShadow[d]=e,i.spotShadowMap[d]=_,A++}d++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(a).multiplyScalar(b),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=_,i.pointShadowMatrix[u]=t.shadow.matrix,g++}i.point[u]=e,u++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(b*x),e.groundColor.copy(t.groundColor).multiplyScalar(b*x),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Xs.LTC_FLOAT_1,i.rectAreaLTC2=Xs.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Xs.LTC_HALF_1,i.rectAreaLTC2=Xs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=l,i.ambient[2]=c;const b=i.hash;b.directionalLength===h&&b.pointLength===u&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===A&&b.numSpotMaps===v||(i.directional.length=h,i.spot.length=d,i.rectArea.length=p,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=A+v-y,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=y,b.directionalLength=h,b.pointLength=u,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=A,b.numSpotMaps=v,i.version=rl++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,h=0;const u=t.matrixWorldInverse;for(let d=0,p=e.length;d<p;d++){const t=e[d];if(t.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),n++}else if(t.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),l++}else if(t.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),o.identity(),a.copy(t.matrixWorld),a.premultiply(u),o.extractRotation(a),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(u),r++}else if(t.isHemisphereLight){const e=i.hemi[h];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(u),h++}}},state:i}}function al(e,t){const n=new sl(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function ol(e,t){let n=new WeakMap;return{get:function(r,i=0){const s=n.get(r);let a;return void 0===s?(a=new al(e,t),n.set(r,[a])):i>=s.length?(a=new al(e,t),s.push(a)):a=s[i],a},dispose:function(){n=new WeakMap}}}class ll extends wi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ut,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 cl extends wi{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 hl(e,t,n){let r=new Qs;const i=new Ln,s=new Ln,a=new nr,o=new ll({depthPacking:Ot}),l=new cl,c={},h=n.maxTextureSize,d={[f]:m,[m]:f,[g]:g},A=new Is({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ln},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 <packing>\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=A.clone();y.defines.HORIZONTAL_PASS=1;const x=new is;x.setAttribute("position",new Gi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Es(x,A),E=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u;let _=this.type;function S(n,r){const s=t.update(b);A.defines.VSM_SAMPLES!==n.blurSamples&&(A.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,A.needsUpdate=!0,y.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new rr(i.x,i.y)),A.uniforms.shadow_pass.value=n.map.texture,A.uniforms.resolution.value=n.mapSize,A.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,s,A,b,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,s,y,b,null)}function w(t,n,r,i){let s=null;const a=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=s.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=s.clone(),r[t]=i),s=i}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=i===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===r.isPointLight&&!0===s.isMeshDistanceMaterial){e.properties.get(s).light=r}return s}function M(n,i,s,a,o){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===p)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],h=i[c.materialIndex];if(h&&h.visible){const t=w(n,h,a,o);e.renderBufferDirect(s,null,r,t,n,c)}}}else if(i.visible){const t=w(n,i,a,o);e.renderBufferDirect(s,null,r,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)M(l[e],i,s,a,o)}this.render=function(t,n,o){if(!1===E.enabled)return;if(!1===E.autoUpdate&&!1===E.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(v),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const f=_!==p&&this.type===p,m=_===p&&this.type!==p;for(let g=0,A=t.length;g<A;g++){const l=t[g],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;i.copy(c.mapSize);const u=c.getFrameExtents();if(i.multiply(u),s.copy(c.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/u.x),i.x=s.x*u.x,c.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/u.y),i.y=s.y*u.y,c.mapSize.y=s.y)),null===c.map||!0===f||!0===m){const e=this.type!==p?{minFilter:de,magFilter:de}:{};null!==c.map&&c.map.dispose(),c.map=new rr(i.x,i.y,e),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}e.setRenderTarget(c.map),e.clear();const A=c.getViewportCount();for(let e=0;e<A;e++){const t=c.getViewport(e);a.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),d.viewport(a),c.updateMatrices(l,e),r=c.getFrustum(),M(n,o,c.camera,l,this.type)}!0!==c.isPointLightShadow&&this.type===p&&S(c,o),c.needsUpdate=!1}_=this.type,E.needsUpdate=!1,e.setRenderTarget(l,c,u)}}function ul(e,t,n){const r=n.isWebGL2;const i=new function(){let t=!1;const n=new nr;let r=null;const i=new nr(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),n.set(t,r,s,a),!1===i.equals(n)&&(e.clearColor(t,r,s,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},s=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?be(e.DEPTH_TEST):Ee(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case G:e.depthFunc(e.NEVER);break;case z:e.depthFunc(e.ALWAYS);break;case Q:e.depthFunc(e.LESS);break;case V:e.depthFunc(e.LEQUAL);break;case H:e.depthFunc(e.EQUAL);break;case j:e.depthFunc(e.GEQUAL);break;case W:e.depthFunc(e.GREATER);break;case X:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},c=new function(){let t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?be(e.STENCIL_TEST):Ee(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&s===a||(e.stencilFunc(t,n,a),r=t,i=n,s=a)},setOp:function(t,n,r){a===t&&o===n&&l===r||(e.stencilOp(t,n,r),a=t,o=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,c=null}}},h=new WeakMap,u=new WeakMap;let d={},p={},f=new WeakMap,A=[],Y=null,q=!1,K=null,J=null,Z=null,$=null,ee=null,te=null,ne=null,re=!1,ie=null,se=null,ae=null,oe=null,le=null;const ce=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let he=!1,ue=0;const de=e.getParameter(e.VERSION);-1!==de.indexOf("WebGL")?(ue=parseFloat(/^WebGL (\d)/.exec(de)[1]),he=ue>=1):-1!==de.indexOf("OpenGL ES")&&(ue=parseFloat(/^OpenGL ES (\d)/.exec(de)[1]),he=ue>=2);let pe=null,fe={};const me=e.getParameter(e.SCISSOR_BOX),ge=e.getParameter(e.VIEWPORT),Ae=(new nr).fromArray(me),ve=(new nr).fromArray(ge);function ye(t,n,i,s){const a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let l=0;l<i;l++)!r||t!==e.TEXTURE_3D&&t!==e.TEXTURE_2D_ARRAY?e.texImage2D(n+l,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage3D(n,0,e.RGBA,1,1,s,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const xe={};function be(t){!0!==d[t]&&(e.enable(t),d[t]=!0)}function Ee(t){!1!==d[t]&&(e.disable(t),d[t]=!1)}xe[e.TEXTURE_2D]=ye(e.TEXTURE_2D,e.TEXTURE_2D,1),xe[e.TEXTURE_CUBE_MAP]=ye(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(xe[e.TEXTURE_2D_ARRAY]=ye(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),xe[e.TEXTURE_3D]=ye(e.TEXTURE_3D,e.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),s.setClear(1),c.setClear(0),be(e.DEPTH_TEST),s.setFunc(V),Me(!1),Ce(o),be(e.CULL_FACE),we(v);const _e={[S]:e.FUNC_ADD,[w]:e.FUNC_SUBTRACT,[M]:e.FUNC_REVERSE_SUBTRACT};if(r)_e[C]=e.MIN,_e[T]=e.MAX;else{const e=t.get("EXT_blend_minmax");null!==e&&(_e[C]=e.MIN_EXT,_e[T]=e.MAX_EXT)}const Se={[I]:e.ZERO,[B]:e.ONE,[R]:e.SRC_COLOR,[D]:e.SRC_ALPHA,[k]:e.SRC_ALPHA_SATURATE,[O]:e.DST_COLOR,[F]:e.DST_ALPHA,[P]:e.ONE_MINUS_SRC_COLOR,[L]:e.ONE_MINUS_SRC_ALPHA,[N]:e.ONE_MINUS_DST_COLOR,[U]:e.ONE_MINUS_DST_ALPHA};function we(t,n,r,i,s,a,o,l){if(t!==v){if(!1===q&&(be(e.BLEND),q=!0),t===_)s=s||n,a=a||r,o=o||i,n===J&&s===ee||(e.blendEquationSeparate(_e[n],_e[s]),J=n,ee=s),r===Z&&i===$&&a===te&&o===ne||(e.blendFuncSeparate(Se[r],Se[i],Se[a],Se[o]),Z=r,$=i,te=a,ne=o),K=t,re=!1;else if(t!==K||l!==re){if(J===S&&ee===S||(e.blendEquation(e.FUNC_ADD),J=S,ee=S),l)switch(t){case y:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case x:e.blendFunc(e.ONE,e.ONE);break;case b:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case E:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case y:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case x:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case b:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case E:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}Z=null,$=null,te=null,ne=null,K=t,re=l}}else!0===q&&(Ee(e.BLEND),q=!1)}function Me(t){ie!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),ie=t)}function Ce(t){t!==a?(be(e.CULL_FACE),t!==se&&(t===o?e.cullFace(e.BACK):t===l?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):Ee(e.CULL_FACE),se=t}function Te(t,n,r){t?(be(e.POLYGON_OFFSET_FILL),oe===n&&le===r||(e.polygonOffset(n,r),oe=n,le=r)):Ee(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:s,stencil:c},enable:be,disable:Ee,bindFramebuffer:function(t,n){return p[t]!==n&&(e.bindFramebuffer(t,n),p[t]=n,r&&(t===e.DRAW_FRAMEBUFFER&&(p[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(p[e.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let s=A,a=!1;if(r)if(s=f.get(i),void 0===s&&(s=[],f.set(i,s)),r.isWebGLMultipleRenderTargets){const t=r.texture;if(s.length!==t.length||s[0]!==e.COLOR_ATTACHMENT0){for(let n=0,r=t.length;n<r;n++)s[n]=e.COLOR_ATTACHMENT0+n;s.length=t.length,a=!0}}else s[0]!==e.COLOR_ATTACHMENT0&&(s[0]=e.COLOR_ATTACHMENT0,a=!0);else s[0]!==e.BACK&&(s[0]=e.BACK,a=!0);a&&(n.isWebGL2?e.drawBuffers(s):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(t){return Y!==t&&(e.useProgram(t),Y=t,!0)},setBlending:we,setMaterial:function(t,n){t.side===g?Ee(e.CULL_FACE):be(e.CULL_FACE);let r=t.side===m;n&&(r=!r),Me(r),t.blending===y&&!1===t.transparent?we(v):we(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),i.setMask(t.colorWrite);const a=t.stencilWrite;c.setTest(a),a&&(c.setMask(t.stencilWriteMask),c.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),c.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Te(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?be(e.SAMPLE_ALPHA_TO_COVERAGE):Ee(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:Me,setCullFace:Ce,setLineWidth:function(t){t!==ae&&(he&&e.lineWidth(t),ae=t)},setPolygonOffset:Te,setScissorTest:function(t){t?be(e.SCISSOR_TEST):Ee(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+ce-1),pe!==t&&(e.activeTexture(t),pe=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===pe?e.TEXTURE0+ce-1:pe);let i=fe[r];void 0===i&&(i={type:void 0,texture:void 0},fe[r]=i),i.type===t&&i.texture===n||(pe!==r&&(e.activeTexture(r),pe=r),e.bindTexture(t,n||xe[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=fe[pe];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(t,n){let r=u.get(n);void 0===r&&(r=new WeakMap,u.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=u.get(n).get(t);h.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),h.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===Ae.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),Ae.copy(t))},viewport:function(t){!1===ve.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),ve.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),!0===r&&(e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),d={},pe=null,fe={},p={},f=new WeakMap,A=[],Y=null,q=!1,K=null,J=null,Z=null,$=null,ee=null,te=null,ne=null,re=!1,ie=null,se=null,ae=null,oe=null,le=null,Ae.set(0,0,e.canvas.width,e.canvas.height),ve.set(0,0,e.canvas.width,e.canvas.height),i.reset(),s.reset(),c.reset()}}}function dl(e,t,n,r,i,s,a){const o=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,h=i.maxTextureSize,u=i.maxSamples,d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let A=!1;try{A="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(Q){}function v(e,t){return A?new OffscreenCanvas(e,t):Gn("canvas")}function y(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?Bn:Math.floor,s=r(i*e.width),a=r(i*e.height);void 0===m&&(m=v(s,a));const o=n?v(s,a):m;o.width=s,o.height=a;return o.getContext("2d").drawImage(e,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return Tn(e.width)&&Tn(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==de&&e.minFilter!==Ae}function E(t){e.generateMipmap(t)}function _(n,r,i,s,a=!1){if(!1===o)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;return r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RGBA&&(i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=s===zt&&!1===a?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)),l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function S(e,t,n){return!0===b(e,n)||e.isFramebufferTexture&&e.minFilter!==de&&e.minFilter!==Ae?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 w(t){return t===de||t===pe||t===me?e.NEAREST:e.LINEAR}function M(e){const t=e.target;t.removeEventListener("dispose",M),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=g.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&T(e),0===Object.keys(i).length&&g.delete(n)}r.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function C(t){const n=t.target;n.removeEventListener("dispose",C),function(t){const n=t.texture,i=r.get(t),s=r.get(n);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++)e.deleteFramebuffer(i.__webglFramebuffer[r]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[r]);else{if(e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let o=0,l=n.length;o<l;o++){const t=r.get(n[o]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),a.memory.textures--),r.remove(n[o])}r.remove(n),r.remove(t)}(n)}function T(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete g.get(i)[n.__cacheKey],a.memory.textures--}let I=0;function B(t,i){const s=r.get(t);if(t.isVideoTexture&&function(e){const t=a.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__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 F(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const R={[ce]:e.REPEAT,[he]:e.CLAMP_TO_EDGE,[ue]:e.MIRRORED_REPEAT},P={[de]:e.NEAREST,[pe]:e.NEAREST_MIPMAP_NEAREST,[me]:e.NEAREST_MIPMAP_LINEAR,[Ae]:e.LINEAR,[ve]:e.LINEAR_MIPMAP_NEAREST,[xe]:e.LINEAR_MIPMAP_LINEAR};function D(n,s,a){if(a?(e.texParameteri(n,e.TEXTURE_WRAP_S,R[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,R[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,R[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,P[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,P[s.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),s.wrapS===he&&s.wrapT===he||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,w(s.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,w(s.minFilter)),s.minFilter!==de&&s.minFilter!==Ae&&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 a=t.get("EXT_texture_filter_anisotropic");if(s.magFilter===de)return;if(s.minFilter!==me&&s.minFilter!==xe)return;if(s.type===Te&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&s.type===Ie&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||r.get(s).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy)}}function L(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",M));const i=n.source;let s=g.get(i);void 0===s&&(s={},g.set(i,s));const o=function(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()}(n);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&T(n)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function F(t,i,a){let l=e.TEXTURE_2D;(i.isDataArrayTexture||i.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),i.isData3DTexture&&(l=e.TEXTURE_3D);const c=L(t,i),u=i.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+a);const d=r.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+a),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=function(e){return!o&&(e.wrapS!==he||e.wrapT!==he||e.minFilter!==de&&e.minFilter!==Ae)}(i)&&!1===x(i.image);let r=y(i.image,t,!1,h);r=z(i,r);const p=x(r)||o,f=s.convert(i.format,i.colorSpace);let m,g=s.convert(i.type),A=_(i.internalFormat,f,g,i.colorSpace);D(l,i,p);const v=i.mipmaps,w=o&&!0!==i.isVideoTexture,M=void 0===d.__version||!0===c,C=S(i,r,p);if(i.isDepthTexture)A=e.DEPTH_COMPONENT,o?A=i.type===Te?e.DEPTH_COMPONENT32F:i.type===Ce?e.DEPTH_COMPONENT24:i.type===Pe?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:i.type===Te&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Oe&&A===e.DEPTH_COMPONENT&&i.type!==we&&i.type!==Ce&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Ce,g=s.convert(i.type)),i.format===Ne&&A===e.DEPTH_COMPONENT&&(A=e.DEPTH_STENCIL,i.type!==Pe&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Pe,g=s.convert(i.type))),M&&(w?n.texStorage2D(e.TEXTURE_2D,1,A,r.width,r.height):n.texImage2D(e.TEXTURE_2D,0,A,r.width,r.height,0,f,g,null));else if(i.isDataTexture)if(v.length>0&&p){w&&M&&n.texStorage2D(e.TEXTURE_2D,C,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],w?n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,f,g,m.data);i.generateMipmaps=!1}else w?(M&&n.texStorage2D(e.TEXTURE_2D,C,A,r.width,r.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,f,g,r.data)):n.texImage2D(e.TEXTURE_2D,0,A,r.width,r.height,0,f,g,r.data);else if(i.isCompressedTexture)if(i.isCompressedArrayTexture){w&&M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,A,v[0].width,v[0].height,r.depth);for(let t=0,s=v.length;t<s;t++)m=v[t],i.format!==Le?null!==f?w?n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,r.depth,f,m.data,0,0):n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,A,m.width,m.height,r.depth,0,m.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,r.depth,f,g,m.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,A,m.width,m.height,r.depth,0,f,g,m.data)}else{w&&M&&n.texStorage2D(e.TEXTURE_2D,C,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],i.format!==Le?null!==f?w?n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,m.data):n.compressedTexImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,f,g,m.data):n.texImage2D(e.TEXTURE_2D,t,A,m.width,m.height,0,f,g,m.data)}else if(i.isDataArrayTexture)w?(M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,A,r.width,r.height,r.depth),n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,r.width,r.height,r.depth,f,g,r.data)):n.texImage3D(e.TEXTURE_2D_ARRAY,0,A,r.width,r.height,r.depth,0,f,g,r.data);else if(i.isData3DTexture)w?(M&&n.texStorage3D(e.TEXTURE_3D,C,A,r.width,r.height,r.depth),n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,r.width,r.height,r.depth,f,g,r.data)):n.texImage3D(e.TEXTURE_3D,0,A,r.width,r.height,r.depth,0,f,g,r.data);else if(i.isFramebufferTexture){if(M)if(w)n.texStorage2D(e.TEXTURE_2D,C,A,r.width,r.height);else{let t=r.width,i=r.height;for(let r=0;r<C;r++)n.texImage2D(e.TEXTURE_2D,r,A,t,i,0,f,g,null),t>>=1,i>>=1}}else if(v.length>0&&p){w&&M&&n.texStorage2D(e.TEXTURE_2D,C,A,v[0].width,v[0].height);for(let t=0,r=v.length;t<r;t++)m=v[t],w?n.texSubImage2D(e.TEXTURE_2D,t,0,0,f,g,m):n.texImage2D(e.TEXTURE_2D,t,A,f,g,m);i.generateMipmaps=!1}else w?(M&&n.texStorage2D(e.TEXTURE_2D,C,A,r.width,r.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,f,g,r)):n.texImage2D(e.TEXTURE_2D,0,A,f,g,r);b(i,p)&&E(l),d.__version=u.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function U(t,i,a,o,l){const c=s.convert(a.format,a.colorSpace),h=s.convert(a.type),u=_(a.internalFormat,c,h,a.colorSpace);r.get(i).__hasExternalTextures||(l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,0,u,i.width,i.height,i.depth,0,c,h,null):n.texImage2D(l,0,u,i.width,i.height,0,c,h,null)),n.bindFramebuffer(e.FRAMEBUFFER,t),G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,r.get(a).__webglTexture,0,k(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,l,r.get(a).__webglTexture,0),n.bindFramebuffer(e.FRAMEBUFFER,null)}function O(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let i=e.DEPTH_COMPONENT16;if(r||G(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===Te?i=e.DEPTH_COMPONENT32F:t.type===Ce&&(i=e.DEPTH_COMPONENT24));const r=k(n);G(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,r,i,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,r,i,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,i,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=k(n);r&&!1===G(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):G(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i<t.length;i++){const a=t[i],o=s.convert(a.format,a.colorSpace),l=s.convert(a.type),c=_(a.internalFormat,o,l,a.colorSpace),h=k(n);r&&!1===G(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,h,c,n.width,n.height):G(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,h,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function N(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),B(i.depthTexture,0);const s=r.get(i.depthTexture).__webglTexture,a=k(i);if(i.depthTexture.format===Oe)G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,a):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else{if(i.depthTexture.format!==Ne)throw new Error("Unknown depthTexture format");G(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,a):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),O(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),O(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function k(e){return Math.min(u,e.samples)}function G(e){const n=r.get(e);return o&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function z(e,n){const r=e.colorSpace,i=e.format,s=e.type;return!0===e.isCompressedTexture||e.format===vn||r!==Qt&&r!==Gt&&(r===zt?!1===o?!0===t.has("EXT_sRGB")&&i===Le?(e.format=vn,e.minFilter=Ae,e.generateMipmaps=!1):n=Jn.sRGBToLinear(n):i===Le&&s===Ee||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}this.allocateTextureUnit=function(){const e=I;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),I+=1,e},this.resetTextureUnits=function(){I=0},this.setTexture2D=B,this.setTexture2DArray=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?F(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?F(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,i,a){if(6!==i.image.length)return;const l=L(t,i),h=i.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+a);const u=r.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+a),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE);const t=i.isCompressedTexture||i.image[0].isCompressedTexture,r=i.image[0]&&i.image[0].isDataTexture,d=[];for(let e=0;e<6;e++)d[e]=t||r?r?i.image[e].image:i.image[e]:y(i.image[e],!1,!0,c),d[e]=z(i,d[e]);const p=d[0],f=x(p)||o,m=s.convert(i.format,i.colorSpace),g=s.convert(i.type),A=_(i.internalFormat,m,g,i.colorSpace),v=o&&!0!==i.isVideoTexture,w=void 0===u.__version||!0===l;let M,C=S(i,p,f);if(D(e.TEXTURE_CUBE_MAP,i,f),t){v&&w&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,A,p.width,p.height);for(let t=0;t<6;t++){M=d[t].mipmaps;for(let r=0;r<M.length;r++){const s=M[r];i.format!==Le?null!==m?v?n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,s.width,s.height,m,s.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,A,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,s.width,s.height,m,g,s.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,A,s.width,s.height,0,m,g,s.data)}}}else{M=i.mipmaps,v&&w&&(M.length>0&&C++,n.texStorage2D(e.TEXTURE_CUBE_MAP,C,A,d[0].width,d[0].height));for(let t=0;t<6;t++)if(r){v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,d[t].width,d[t].height,m,g,d[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,A,d[t].width,d[t].height,0,m,g,d[t].data);for(let r=0;r<M.length;r++){const i=M[r].image[t].image;v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,m,g,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,A,i.width,i.height,0,m,g,i.data)}}else{v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m,g,d[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,A,m,g,d[t]);for(let r=0;r<M.length;r++){const i=M[r];v?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,m,g,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,A,m,g,i.image[t])}}}b(i,f)&&E(e.TEXTURE_CUBE_MAP),u.__version=h.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(a,t,i):n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)},this.rebindTextures=function(t,n,i){const s=r.get(t);void 0!==n&&U(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),void 0!==i&&N(t)},this.setupRenderTarget=function(t){const l=t.texture,c=r.get(t),h=r.get(l);t.addEventListener("dispose",C),!0!==t.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=e.createTexture()),h.__version=l.version,a.memory.textures++);const u=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=x(t)||o;if(u){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&t.samples>0&&!1===G(t)){const r=d?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<r.length;n++){const i=r[n];c.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const a=s.convert(i.format,i.colorSpace),o=s.convert(i.type),l=_(i.internalFormat,a,o,i.colorSpace,!0===t.isXRRenderTarget),h=k(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,h,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,c.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),O(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,h.__webglTexture),D(e.TEXTURE_CUBE_MAP,l,p);for(let n=0;n<6;n++)U(c.__webglFramebuffer[n],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n);b(l,p)&&E(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){const i=t.texture;for(let s=0,a=i.length;s<a;s++){const a=i[s],o=r.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),D(e.TEXTURE_2D,a,p),U(c.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+s,e.TEXTURE_2D),b(a,p)&&E(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(o?r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,h.__webglTexture),D(r,l,p),U(c.__webglFramebuffer,t,l,e.COLOR_ATTACHMENT0,r),b(l,p)&&E(r),n.unbindTexture()}t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(t){const i=x(t)||o,s=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let a=0,o=s.length;a<o;a++){const o=s[a];if(b(o,i)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=r.get(o).__webglTexture;n.bindTexture(i,s),E(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(o&&t.samples>0&&!1===G(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,a=t.height;let o=e.COLOR_BUFFER_BIT;const l=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=r.get(t),u=!0===t.isWebGLMultipleRenderTargets;if(u)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let n=0;n<i.length;n++){l.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&l.push(c);const d=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===d&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),u&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,h.__webglColorRenderbuffer[n]),!0===d&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[c]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[c])),u){const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,e.NEAREST),p&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,h.__webglColorRenderbuffer[t]);const s=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=N,this.setupFrameBufferTexture=U,this.useMultisampledRTT=G}function pl(e,t,n){const r=n.isWebGL2;return{convert:function(n,i=Gt){let s;if(n===Ee)return e.UNSIGNED_BYTE;if(n===Be)return e.UNSIGNED_SHORT_4_4_4_4;if(n===Re)return e.UNSIGNED_SHORT_5_5_5_1;if(n===_e)return e.BYTE;if(n===Se)return e.SHORT;if(n===we)return e.UNSIGNED_SHORT;if(n===Me)return e.INT;if(n===Ce)return e.UNSIGNED_INT;if(n===Te)return e.FLOAT;if(n===Ie)return r?e.HALF_FLOAT:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(n===De)return e.ALPHA;if(n===Le)return e.RGBA;if(n===Fe)return e.LUMINANCE;if(n===Ue)return e.LUMINANCE_ALPHA;if(n===Oe)return e.DEPTH_COMPONENT;if(n===Ne)return e.DEPTH_STENCIL;if(n===vn)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(n===ke)return e.RED;if(n===Ge)return e.RED_INTEGER;if(n===ze)return e.RG;if(n===Qe)return e.RG_INTEGER;if(n===Ve)return e.RGBA_INTEGER;if(n===He||n===je||n===We||n===Xe)if(i===zt){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(n===He)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===je)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===We)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Xe)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(n===He)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===je)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===We)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Xe)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Ye||n===qe||n===Ke||n===Je){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(n===Ye)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qe)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ke)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Je)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Ze)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===$e||n===et){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(n===$e)return i===zt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===et)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(n===tt||n===nt||n===rt||n===it||n===st||n===at||n===ot||n===lt||n===ct||n===ht||n===ut||n===dt||n===pt||n===ft){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(n===tt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===nt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===rt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===it)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===st)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===at)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ot)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===lt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ct)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ht)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ut)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===dt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===pt)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===ft)return i===zt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===mt){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(n===mt)return i===zt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(n===gt||n===At||n===vt||n===yt){if(s=t.get("EXT_texture_compression_rgtc"),null===s)return null;if(n===mt)return s.COMPRESSED_RED_RGTC1_EXT;if(n===At)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===vt)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===yt)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Pe?r?e.UNSIGNED_INT_24_8:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}class fl extends Rs{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ml extends ui{constructor(){super(),this.isGroup=!0,this.type="Group"}}const gl={type:"move"};class Al{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ml,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ml,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new hr,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new hr),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ml,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new hr,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new hr),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const s of e.hand.values()){const e=t.getJointPose(s,n),r=this._getHandJoint(l,s);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],a=r.position.distanceTo(i.position),o=.02,c=.005;l.inputState.pinching&&a>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(gl)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new ml;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class vl extends tr{constructor(e,t,n,r,i,s,a,o,l,c){if((c=void 0!==c?c:Oe)!==Oe&&c!==Ne)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Oe&&(n=Ce),void 0===n&&c===Ne&&(n=Pe),super(null,r,i,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:de,this.minFilter=void 0!==o?o:de,this.flipY=!1,this.generateMipmaps=!1}}class yl extends yn{constructor(e,t){super();const n=this;let r=null,i=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=t.getContextAttributes();let m=null,g=null;const A=[],v=[],y=new Set,x=new Map,b=new Rs;b.layers.enable(1),b.viewport=new nr;const E=new Rs;E.layers.enable(2),E.viewport=new nr;const _=[b,E],S=new fl;S.layers.enable(1),S.layers.enable(2);let w=null,M=null;function C(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const n=A[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||s),n.dispatchEvent({type:e.type,data:e.inputSource}))}function T(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",T),r.removeEventListener("inputsourceschange",I);for(let e=0;e<A.length;e++){const t=v[e];null!==t&&(v[e]=null,A[e].disconnect(t))}w=null,M=null,e.setRenderTarget(m),d=null,u=null,h=null,r=null,g=null,L.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function I(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=v.indexOf(n);r>=0&&(v[r]=null,A[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=v.indexOf(n);if(-1===r){for(let e=0;e<A.length;e++){if(e>=v.length){v.push(n),r=e;break}if(null===v[e]){v[e]=n,r=e;break}}if(-1===r)break}const i=A[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=A[e];return void 0===t&&(t=new Al,A[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=A[e];return void 0===t&&(t=new Al,A[e]=t),t.getGripSpace()},this.getHand=function(e){let t=A[e];return void 0===t&&(t=new Al,A[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(c){if(r=c,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",T),r.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),g=new rr(d.framebufferWidth,d.framebufferHeight,{format:Le,type:Ee,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=f.stencil?Ne:Oe,s=f.stencil?Pe:Ce);const o={colorFormat:t.RGBA8,depthFormat:a,scaleFactor:i};h=new XRWebGLBinding(r,t),u=h.createProjectionLayer(o),r.updateRenderState({layers:[u]}),g=new rr(u.textureWidth,u.textureHeight,{format:Le,type:Ee,depthTexture:new vl(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0});e.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await r.requestReferenceSpace(a),L.setContext(r),L.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const B=new hr,R=new hr;function P(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===r)return;S.near=E.near=b.near=e.near,S.far=E.far=b.far=e.far,w===S.near&&M===S.far||(r.updateRenderState({depthNear:S.near,depthFar:S.far}),w=S.near,M=S.far);const t=e.parent,n=S.cameras;P(S,t);for(let r=0;r<n.length;r++)P(n[r],t);2===n.length?function(e,t,n){B.setFromMatrixPosition(t.matrixWorld),R.setFromMatrixPosition(n.matrixWorld);const r=B.distanceTo(R),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],h=(i[8]-1)/i[0],u=(s[8]+1)/s[0],d=a*h,p=a*u,f=r/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=a+f,A=o+f,v=d-m,y=p+(r-m),x=l*o/A*g,b=c*o/A*g;e.projectionMatrix.makePerspective(v,y,x,b,g,A),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(S,b,E):S.projectionMatrix.copy(b.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0);const r=e.children;for(let i=0,s=r.length;i<s;i++)r[i].updateMatrixWorld(!0);e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*_n*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,S,t)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==u||null!==d)return o},this.setFoveation=function(e){o=e,null!==u&&(u.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.getPlanes=function(){return y};let D=null;const L=new Vs;L.setAnimationLoop((function(t,r){if(c=r.getViewerPose(l||s),p=r,null!==c){const t=c.views;null!==d&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let n=!1;t.length!==S.cameras.length&&(S.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==d)s=d.getViewport(i);else{const t=h.getViewSubImage(u,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,u.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let a=_[r];void 0===a&&(a=new Rs,a.layers.enable(r),a.viewport=new nr,_[r]=a),a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(i.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&(S.matrix.copy(a.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),!0===n&&S.cameras.push(a)}}for(let e=0;e<A.length;e++){const t=v[e],n=A[e];null!==t&&void 0!==n&&n.update(t,r,l||s)}if(D&&D(t,r),r.detectedPlanes){n.dispatchEvent({type:"planesdetected",data:r.detectedPlanes});let e=null;for(const t of y)r.detectedPlanes.has(t)||(null===e&&(e=[]),e.push(t));if(null!==e)for(const t of e)y.delete(t),x.delete(t),n.dispatchEvent({type:"planeremoved",data:t});for(const t of r.detectedPlanes)if(y.has(t)){const e=x.get(t);t.lastChangedTime>e&&(x.set(t,t.lastChangedTime),n.dispatchEvent({type:"planechanged",data:t}))}else y.add(t),x.set(t,r.lastChangedTime),n.dispatchEvent({type:"planeadded",data:t})}p=null})),this.setAnimationLoop=function(e){D=e},this.dispose=function(){}}}function xl(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===m&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===m&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const s=t.get(i).envMap;if(s&&(r.envMap.value=s,r.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const t=!0===e.useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*t,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Cs(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,s,a,o){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,r){e.metalness.value=r.metalness,r.metalnessMap&&(e.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,e.metalnessMapTransform));e.roughness.value=r.roughness,r.roughnessMap&&(e.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,e.roughnessMapTransform));const i=t.get(r).envMap;i&&(e.envMapIntensity.value=r.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){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,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===m&&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,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(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,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,o)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,a):i.isSpriteMaterial?function(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,n(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 bl(e,t,n,r){let i={},s={},a=[];const o=n.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,n){const r=e.value;if(void 0===n[t]){if("number"==typeof r)n[t]=r;else{const e=Array.isArray(r)?r:[r],i=[];for(let t=0;t<e.length;t++)i.push(e[t].clone());n[t]=i}return!0}if("number"==typeof r){if(n[t]!==r)return n[t]=r,!0}else{const e=Array.isArray(n[t])?n[t]:[n[t]],i=Array.isArray(r)?r:[r];for(let t=0;t<e.length;t++){const n=e[t];if(!1===n.equals(i[t]))return n.copy(i[t]),!0}}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function h(t){const n=t.target;n.removeEventListener("dispose",h);const r=a.indexOf(n.__bindingPointIndex);a.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,u){let d=i[n.id];void 0===d&&(!function(e){const t=e.uniforms;let n=0;const r=16;let i=0;for(let s=0,a=t.length;s<a;s++){const e=t[s],a={boundary:0,storage:0},o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,n=o.length;t<n;t++){const e=c(o[t]);a.boundary+=e.boundary,a.storage+=e.storage}if(e.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,s>0){i=n%r;0!==i&&r-i-a.boundary<0&&(n+=r-i,e.__offset=n)}n+=a.storage}i=n%r,i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),d=function(t){const n=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=d,n.addEventListener("dispose",h));const p=u.program;r.updateUBOMapping(n,p);const f=t.render.frame;s[n.id]!==f&&(!function(t){const n=i[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let i=0,a=r.length;i<a;i++){const t=r[i];if(!0===l(t,i,s)){const n=t.__offset,r=Array.isArray(t.value)?t.value:[t.value];let i=0;for(let s=0;s<r.length;s++){const a=r[s],o=c(a);"number"==typeof a?(t.__data[0]=a,e.bufferSubData(e.UNIFORM_BUFFER,n+i,t.__data)):a.isMatrix3?(t.__data[0]=a.elements[0],t.__data[1]=a.elements[1],t.__data[2]=a.elements[2],t.__data[3]=a.elements[0],t.__data[4]=a.elements[3],t.__data[5]=a.elements[4],t.__data[6]=a.elements[5],t.__data[7]=a.elements[0],t.__data[8]=a.elements[6],t.__data[9]=a.elements[7],t.__data[10]=a.elements[8],t.__data[11]=a.elements[0]):(a.toArray(t.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=f)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);a=[],i={},s={}}}}function El(){const e=Gn("canvas");return e.style.display="block",e}class _l{constructor(e={}){const{canvas:t=El(),context:n=null,depth:i=!0,stencil:s=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=e;let d;this.isWebGLRenderer=!0,d=null!==n?n.getContextAttributes().alpha:a;let p=null,A=null;const v=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=zt,this.useLegacyLights=!0,this.toneMapping=J,this.toneMappingExposure=1;const x=this;let b=!1,E=0,_=0,S=null,w=-1,M=null;const C=new nr,T=new nr;let I=null,B=t.width,R=t.height,P=1,D=null,L=null;const F=new nr(0,0,B,R),U=new nr(0,0,B,R);let O=!1;const N=new Qs;let k=!1,G=!1,z=null;const Q=new Gr,V=new hr,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===S?P:1}let W,X,Y,q,K,Z,$,ee,te,ne,re,ie,se,ae,oe,le,ce,he,ue,de,pe,fe,me,ge,Ae=n;function ve(e,n){for(let r=0;r<e.length;r++){const i=e[r],s=t.getContext(i,n);if(null!==s)return s}return null}try{const e={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${r}`),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",we,!1),null===Ae){const t=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&t.shift(),Ae=ve(t,e),null===Ae)throw ve(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===Ae.getShaderPrecisionFormat&&(Ae.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ge){throw console.error("THREE.WebGLRenderer: "+Ge.message),Ge}function ye(){W=new va(Ae),X=new $s(Ae,W,e),W.init(X),fe=new pl(Ae,W,X),Y=new ul(Ae,W,X),q=new ba(Ae),K=new Jo,Z=new dl(Ae,W,Y,K,X,fe,q),$=new ta(x),ee=new Aa(x),te=new Hs(Ae,X),me=new Js(Ae,W,te,X),ne=new ya(Ae,te,q,me),re=new wa(Ae,ne,te,q),ue=new Sa(Ae,X,Z),le=new ea(K),ie=new Ko(x,$,ee,W,X,me,le),se=new xl(x,K),ae=new tl,oe=new ol(W,X),he=new Ks(x,$,ee,Y,re,d,l),ce=new hl(x,re,X),ge=new bl(Ae,q,X,Y),de=new Zs(Ae,W,q,X),pe=new xa(Ae,W,q,X),q.programs=ie.programs,x.capabilities=X,x.extensions=W,x.properties=K,x.renderLists=ae,x.shadowMap=ce,x.state=Y,x.info=q}ye();const be=new yl(x,Ae);function _e(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const e=q.autoReset,t=ce.enabled,n=ce.autoUpdate,r=ce.needsUpdate,i=ce.type;ye(),q.autoReset=e,ce.enabled=t,ce.autoUpdate=n,ce.needsUpdate=r,ce.type=i}function we(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Me(e){const t=e.target;t.removeEventListener("dispose",Me),function(e){(function(e){const t=K.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),K.remove(e)}(t)}this.xr=be,this.getContext=function(){return Ae},this.getContextAttributes=function(){return Ae.getContextAttributes()},this.forceContextLoss=function(){const e=W.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=W.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(e){void 0!==e&&(P=e,this.setSize(B,R,!1))},this.getSize=function(e){return e.set(B,R)},this.setSize=function(e,n,r=!0){be.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(B=e,R=n,t.width=Math.floor(e*P),t.height=Math.floor(n*P),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(B*P,R*P).floor()},this.setDrawingBufferSize=function(e,n,r){B=e,R=n,P=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(C)},this.getViewport=function(e){return e.copy(F)},this.setViewport=function(e,t,n,r){e.isVector4?F.set(e.x,e.y,e.z,e.w):F.set(e,t,n,r),Y.viewport(C.copy(F).multiplyScalar(P).floor())},this.getScissor=function(e){return e.copy(U)},this.setScissor=function(e,t,n,r){e.isVector4?U.set(e.x,e.y,e.z,e.w):U.set(e,t,n,r),Y.scissor(T.copy(U).multiplyScalar(P).floor())},this.getScissorTest=function(){return O},this.setScissorTest=function(e){Y.setScissorTest(O=e)},this.setOpaqueSort=function(e){D=e},this.setTransparentSort=function(e){L=e},this.getClearColor=function(e){return e.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor.apply(he,arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha.apply(he,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;e&&(r|=Ae.COLOR_BUFFER_BIT),t&&(r|=Ae.DEPTH_BUFFER_BIT),n&&(r|=Ae.STENCIL_BUFFER_BIT),Ae.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",_e,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",we,!1),ae.dispose(),oe.dispose(),K.dispose(),$.dispose(),ee.dispose(),re.dispose(),me.dispose(),ge.dispose(),ie.dispose(),be.dispose(),be.removeEventListener("sessionstart",Be),be.removeEventListener("sessionend",Re),z&&(z.dispose(),z=null),Pe.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=H);const a=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,n,r,i){!0!==t.isScene&&(t=H);Z.resetTextureUnits();const s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Qt,l=(r.isMeshStandardMaterial?ee:$).get(r.envMap||a),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!r.normalMap&&!!n.attributes.tangent,u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,f=r.toneMapped?x.toneMapping:J,m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==m?m.length:0,v=K.get(r),y=A.state.lights;if(!0===k&&(!0===G||e!==M)){const t=e===M&&r.id===w;le.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version||v.outputColorSpace!==o||i.isInstancedMesh&&!1===v.instancing?b=!0:i.isInstancedMesh||!0!==v.instancing?i.isSkinnedMesh&&!1===v.skinning?b=!0:i.isSkinnedMesh||!0!==v.skinning?v.envMap!==l||!0===r.fog&&v.fog!==s?b=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===le.numPlanes&&v.numIntersection===le.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==f||!0===X.isWebGL2&&v.morphTargetsCount!==g)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let E=v.currentProgram;!0===b&&(E=Ne(r,t,i));let _=!1,C=!1,T=!1;const I=E.getUniforms(),B=v.uniforms;Y.useProgram(E.program)&&(_=!0,C=!0,T=!0);r.id!==w&&(w=r.id,C=!0);if(_||M!==e){if(I.setValue(Ae,"projectionMatrix",e.projectionMatrix),X.logarithmicDepthBuffer&&I.setValue(Ae,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),M!==e&&(M=e,C=!0,T=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=I.map.cameraPosition;void 0!==t&&t.setValue(Ae,V.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&I.setValue(Ae,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&I.setValue(Ae,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){I.setOptional(Ae,i,"bindMatrix"),I.setOptional(Ae,i,"bindMatrixInverse");const e=i.skeleton;e&&(X.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),I.setValue(Ae,"boneTexture",e.boneTexture,Z),I.setValue(Ae,"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 D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===X.isWebGL2)&&ue.update(i,n,E);(C||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,I.setValue(Ae,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(B.envMap.value=l,B.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);C&&(I.setValue(Ae,"toneMappingExposure",x.toneMappingExposure),v.needsLights&&(F=T,(L=B).ambientLightColor.needsUpdate=F,L.lightProbe.needsUpdate=F,L.directionalLights.needsUpdate=F,L.directionalLightShadows.needsUpdate=F,L.pointLights.needsUpdate=F,L.pointLightShadows.needsUpdate=F,L.spotLights.needsUpdate=F,L.spotLightShadows.needsUpdate=F,L.rectAreaLights.needsUpdate=F,L.hemisphereLights.needsUpdate=F),s&&!0===r.fog&&se.refreshFogUniforms(B,s),se.refreshMaterialUniforms(B,r,P,R,z),Bo.upload(Ae,v.uniformsList,B,Z));var L,F;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Bo.upload(Ae,v.uniformsList,B,Z),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&I.setValue(Ae,"center",i.center);if(I.setValue(Ae,"modelViewMatrix",i.modelViewMatrix),I.setValue(Ae,"normalMatrix",i.normalMatrix),I.setValue(Ae,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++)if(X.isWebGL2){const n=e[t];ge.update(n,E),ge.bind(n,E)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return E}(e,t,n,r,i);Y.setMaterial(r,a);let l=n.index,c=1;!0===r.wireframe&&(l=ne.getWireframeAttribute(n),c=2);const h=n.drawRange,u=n.attributes.position;let d=h.start*c,p=(h.start+h.count)*c;null!==s&&(d=Math.max(d,s.start*c),p=Math.min(p,(s.start+s.count)*c)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):null!=u&&(d=Math.max(d,0),p=Math.min(p,u.count));const f=p-d;if(f<0||f===1/0)return;let m;me.setup(i,r,o,n,l);let g=de;if(null!==l&&(m=te.get(l),g=pe,g.setIndex(m)),i.isMesh)!0===r.wireframe?(Y.setLineWidth(r.wireframeLinewidth*j()),g.setMode(Ae.LINES)):g.setMode(Ae.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),Y.setLineWidth(e*j()),i.isLineSegments?g.setMode(Ae.LINES):i.isLineLoop?g.setMode(Ae.LINE_LOOP):g.setMode(Ae.LINE_STRIP)}else i.isPoints?g.setMode(Ae.POINTS):i.isSprite&&g.setMode(Ae.TRIANGLES);if(i.isInstancedMesh)g.renderInstances(d,f,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);g.renderInstances(d,f,t)}else g.render(d,f)},this.compile=function(e,t){function n(e,t,n){!0===e.transparent&&e.side===g&&!1===e.forceSinglePass?(e.side=m,e.needsUpdate=!0,Ne(e,t,n),e.side=f,e.needsUpdate=!0,Ne(e,t,n),e.side=g):Ne(e,t,n)}A=oe.get(e),A.init(),y.push(A),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(A.pushLight(e),e.castShadow&&A.pushShadow(e))})),A.setupLights(x.useLegacyLights),e.traverse((function(t){const r=t.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){n(r[i],e,t)}else n(r,e,t)})),y.pop(),A=null};let Ce=null;function Be(){Pe.stop()}function Re(){Pe.start()}const Pe=new Vs;function De(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)A.pushLight(e),e.castShadow&&A.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||N.intersectsSprite(e)){r&&V.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Q);const t=re.update(e),i=e.material;i.visible&&p.push(e,t,i,n,V.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||N.intersectsObject(e))){e.isSkinnedMesh&&e.skeleton.frame!==q.render.frame&&(e.skeleton.update(),e.skeleton.frame=q.render.frame);const t=re.update(e),i=e.material;if(r&&(null===t.boundingSphere&&t.computeBoundingSphere(),V.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(Q)),Array.isArray(i)){const r=t.groups;for(let s=0,a=r.length;s<a;s++){const a=r[s],o=i[a.materialIndex];o&&o.visible&&p.push(e,t,o,n,V.z,a)}}else i.visible&&p.push(e,t,i,n,V.z,null)}const i=e.children;for(let s=0,a=i.length;s<a;s++)De(i[s],t,n,r)}function Fe(e,t,n,r){const i=e.opaque,s=e.transmissive,a=e.transparent;A.setupLightsView(n),!0===k&&le.setGlobalState(x.clippingPlanes,n),s.length>0&&function(e,t,n,r){if(null===z){const e=X.isWebGL2;z=new rr(1024,1024,{generateMipmaps:!0,type:W.has("EXT_color_buffer_half_float")?Ie:Ee,minFilter:xe,samples:e&&!0===o?4:0})}const i=x.getRenderTarget();x.setRenderTarget(z),x.clear();const s=x.toneMapping;x.toneMapping=J,Ue(e,n,r),Z.updateMultisampleRenderTarget(z),Z.updateRenderTargetMipmap(z);let a=!1;for(let o=0,l=t.length;o<l;o++){const e=t[o],i=e.object,s=e.geometry,l=e.material,c=e.group;if(l.side===g&&i.layers.test(r.layers)){const e=l.side;l.side=m,l.needsUpdate=!0,Oe(i,n,r,s,l,c),l.side=e,l.needsUpdate=!0,a=!0}}!0===a&&(Z.updateMultisampleRenderTarget(z),Z.updateRenderTargetMipmap(z));x.setRenderTarget(i),x.toneMapping=s}(i,s,t,n),r&&Y.viewport(C.copy(r)),i.length>0&&Ue(i,t,n),s.length>0&&Ue(s,t,n),a.length>0&&Ue(a,t,n),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Ue(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.object,o=s.geometry,l=null===r?s.material:r,c=s.group;a.layers.test(n.layers)&&Oe(a,t,n,o,l,c)}}function Oe(e,t,n,r,i,s){e.onBeforeRender(x,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(x,t,n,r,e,s),!0===i.transparent&&i.side===g&&!1===i.forceSinglePass?(i.side=m,i.needsUpdate=!0,x.renderBufferDirect(n,t,r,i,e,s),i.side=f,i.needsUpdate=!0,x.renderBufferDirect(n,t,r,i,e,s),i.side=g):x.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(x,t,n,r,i,s)}function Ne(e,t,n){!0!==t.isScene&&(t=H);const r=K.get(e),i=A.state.lights,s=A.state.shadowsArray,a=i.state.version,o=ie.getParameters(e,i.state,s,t,n),l=ie.getProgramCacheKey(o);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ee:$).get(e.envMap||r.environment),void 0===c&&(e.addEventListener("dispose",Me),c=new Map,r.programs=c);let h=c.get(l);if(void 0!==h){if(r.currentProgram===h&&r.lightsStateVersion===a)return ke(e,o),h}else o.uniforms=ie.getUniforms(e),e.onBuild(n,o,x),e.onBeforeCompile(o,x),h=ie.acquireProgram(o,l),c.set(l,h),r.uniforms=o.uniforms;const u=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(u.clippingPlanes=le.uniform),ke(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=h.getUniforms(),p=Bo.seqWithValue(d.seq,u);return r.currentProgram=h,r.uniformsList=p,h}function ke(e,t){const n=K.get(e);n.outputColorSpace=t.outputColorSpace,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Pe.setAnimationLoop((function(e){Ce&&Ce(e)})),"undefined"!=typeof self&&Pe.setContext(self),this.setAnimationLoop=function(e){Ce=e,be.setAnimationLoop(e),null===e?Pe.stop():Pe.start()},be.addEventListener("sessionstart",Be),be.addEventListener("sessionend",Re),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===be.enabled&&!0===be.isPresenting&&(!0===be.cameraAutoUpdate&&be.updateCamera(t),t=be.getCamera()),!0===e.isScene&&e.onBeforeRender(x,e,t,S),A=oe.get(e,y.length),A.init(),y.push(A),Q.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),N.setFromProjectionMatrix(Q),G=this.localClippingEnabled,k=le.init(this.clippingPlanes,G),p=ae.get(e,v.length),p.init(),v.push(p),De(e,t,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(D,L),!0===k&&le.beginShadows();const n=A.state.shadowsArray;if(ce.render(n,e,t),!0===k&&le.endShadows(),!0===this.info.autoReset&&this.info.reset(),he.render(p,e),A.setupLights(x.useLegacyLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Fe(p,e,r,r.viewport)}}else Fe(p,e,t);null!==S&&(Z.updateMultisampleRenderTarget(S),Z.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(x,e,t),me.resetDefaultState(),w=-1,M=null,y.pop(),A=y.length>0?y[y.length-1]:null,v.pop(),p=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){K.get(e.texture).__webglTexture=t,K.get(e.depthTexture).__webglTexture=n;const r=K.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===W.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=K.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){S=e,E=t,_=n;let r=!0,i=null,s=!1,a=!1;if(e){const n=K.get(e);void 0!==n.__useDefaultFramebuffer?(Y.bindFramebuffer(Ae.FRAMEBUFFER,null),r=!1):void 0===n.__webglFramebuffer?Z.setupRenderTarget(e):n.__hasExternalTextures&&Z.rebindTextures(e,K.get(e.texture).__webglTexture,K.get(e.depthTexture).__webglTexture);const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=K.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=l[t],s=!0):i=X.isWebGL2&&e.samples>0&&!1===Z.useMultisampledRTT(e)?K.get(e).__webglMultisampledFramebuffer:l,C.copy(e.viewport),T.copy(e.scissor),I=e.scissorTest}else C.copy(F).multiplyScalar(P).floor(),T.copy(U).multiplyScalar(P).floor(),I=O;if(Y.bindFramebuffer(Ae.FRAMEBUFFER,i)&&X.drawBuffers&&r&&Y.drawBuffers(e,i),Y.viewport(C),Y.scissor(T),Y.setScissorTest(I),s){const r=K.get(e.texture);Ae.framebufferTexture2D(Ae.FRAMEBUFFER,Ae.COLOR_ATTACHMENT0,Ae.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){const r=K.get(e.texture),i=t||0;Ae.framebufferTextureLayer(Ae.FRAMEBUFFER,Ae.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=K.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){Y.bindFramebuffer(Ae.FRAMEBUFFER,o);try{const a=e.texture,o=a.format,l=a.type;if(o!==Le&&fe.convert(o)!==Ae.getParameter(Ae.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ie&&(W.has("EXT_color_buffer_half_float")||X.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(l===Ee||fe.convert(l)===Ae.getParameter(Ae.IMPLEMENTATION_COLOR_READ_TYPE)||l===Te&&(X.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&Ae.readPixels(t,n,r,i,fe.convert(o),fe.convert(l),s)}finally{const e=null!==S?K.get(S).__webglFramebuffer:null;Y.bindFramebuffer(Ae.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),s=Math.floor(t.image.height*r);Z.setTexture2D(t,0),Ae.copyTexSubImage2D(Ae.TEXTURE_2D,n,0,0,e.x,e.y,i,s),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,s=t.image.height,a=fe.convert(n.format),o=fe.convert(n.type);Z.setTexture2D(n,0),Ae.pixelStorei(Ae.UNPACK_FLIP_Y_WEBGL,n.flipY),Ae.pixelStorei(Ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ae.pixelStorei(Ae.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?Ae.texSubImage2D(Ae.TEXTURE_2D,r,e.x,e.y,i,s,a,o,t.image.data):t.isCompressedTexture?Ae.compressedTexSubImage2D(Ae.TEXTURE_2D,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):Ae.texSubImage2D(Ae.TEXTURE_2D,r,e.x,e.y,a,o,t.image),0===r&&n.generateMipmaps&&Ae.generateMipmap(Ae.TEXTURE_2D),Y.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=fe.convert(r.format),c=fe.convert(r.type);let h;if(r.isData3DTexture)Z.setTexture3D(r,0),h=Ae.TEXTURE_3D;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.setTexture2DArray(r,0),h=Ae.TEXTURE_2D_ARRAY}Ae.pixelStorei(Ae.UNPACK_FLIP_Y_WEBGL,r.flipY),Ae.pixelStorei(Ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ae.pixelStorei(Ae.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ae.getParameter(Ae.UNPACK_ROW_LENGTH),d=Ae.getParameter(Ae.UNPACK_IMAGE_HEIGHT),p=Ae.getParameter(Ae.UNPACK_SKIP_PIXELS),f=Ae.getParameter(Ae.UNPACK_SKIP_ROWS),m=Ae.getParameter(Ae.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;Ae.pixelStorei(Ae.UNPACK_ROW_LENGTH,g.width),Ae.pixelStorei(Ae.UNPACK_IMAGE_HEIGHT,g.height),Ae.pixelStorei(Ae.UNPACK_SKIP_PIXELS,e.min.x),Ae.pixelStorei(Ae.UNPACK_SKIP_ROWS,e.min.y),Ae.pixelStorei(Ae.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?Ae.texSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Ae.compressedTexSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,g.data)):Ae.texSubImage3D(h,i,t.x,t.y,t.z,s,a,o,l,c,g),Ae.pixelStorei(Ae.UNPACK_ROW_LENGTH,u),Ae.pixelStorei(Ae.UNPACK_IMAGE_HEIGHT,d),Ae.pixelStorei(Ae.UNPACK_SKIP_PIXELS,p),Ae.pixelStorei(Ae.UNPACK_SKIP_ROWS,f),Ae.pixelStorei(Ae.UNPACK_SKIP_IMAGES,m),0===i&&r.generateMipmaps&&Ae.generateMipmap(h),Y.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Z.setTextureCube(e,0):e.isData3DTexture?Z.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Z.setTexture2DArray(e,0):Z.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){E=0,_=0,S=null,Y.reset(),me.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}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===zt?Ft:Lt}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ft?zt:Qt}}class Sl extends _l{}Sl.prototype.isWebGL1Renderer=!0;class wl{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Bi(e),this.density=t}clone(){return new wl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ml{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Bi(e),this.near=t,this.far=n}clone(){return new Ml(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Cl extends ui{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 Tl{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=on,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Sn()}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,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Sn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Sn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Il=new hr;class Bl{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Il.fromBufferAttribute(this,t),Il.applyMatrix4(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Il.fromBufferAttribute(this,t),Il.applyNormalMatrix(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Il.fromBufferAttribute(this,t),Il.transformDirection(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}setX(e,t){return this.normalized&&(t=Pn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Pn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Pn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Pn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Rn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Rn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Rn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Rn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Pn(t,this.array),n=Pn(n,this.array),r=Pn(r,this.array),i=Pn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Gi(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Bl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Rl extends wi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Bi(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Pl;const Dl=new hr,Ll=new hr,Fl=new hr,Ul=new Ln,Ol=new Ln,Nl=new Gr,kl=new hr,Gl=new hr,zl=new hr,Ql=new Ln,Vl=new Ln,Hl=new Ln;class jl extends ui{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Pl){Pl=new is;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Tl(e,5);Pl.setIndex([0,1,2,0,2,3]),Pl.setAttribute("position",new Bl(t,3,0,!1)),Pl.setAttribute("uv",new Bl(t,2,3,!1))}this.geometry=Pl,this.material=void 0!==e?e:new Rl,this.center=new Ln(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ll.setFromMatrixScale(this.matrixWorld),Nl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Fl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Ll.multiplyScalar(-Fl.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const s=this.center;Wl(kl.set(-.5,-.5,0),Fl,s,Ll,r,i),Wl(Gl.set(.5,-.5,0),Fl,s,Ll,r,i),Wl(zl.set(.5,.5,0),Fl,s,Ll,r,i),Ql.set(0,0),Vl.set(1,0),Hl.set(1,1);let a=e.ray.intersectTriangle(kl,Gl,zl,!1,Dl);if(null===a&&(Wl(Gl.set(-.5,.5,0),Fl,s,Ll,r,i),Vl.set(0,1),a=e.ray.intersectTriangle(kl,zl,Gl,!1,Dl),null===a))return;const o=e.ray.origin.distanceTo(Dl);o<e.near||o>e.far||t.push({distance:o,point:Dl.clone(),uv:_i.getInterpolation(Dl,kl,Gl,zl,Ql,Vl,Hl,new Ln),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Wl(e,t,n,r,i,s){Ul.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Ol.x=s*Ul.x-i*Ul.y,Ol.y=i*Ul.x+s*Ul.y):Ol.copy(Ul),e.copy(t),e.x+=Ol.x,e.y+=Ol.y,e.applyMatrix4(Nl)}const Xl=new hr,Yl=new hr;class ql extends ui{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const e=t[n];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const r=this.levels;let i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Xl.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Xl);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Xl.setFromMatrixPosition(e.matrixWorld),Yl.setFromMatrixPosition(this.matrixWorld);const n=Xl.distanceTo(Yl)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),!(n>=e))break;t[r-1].object.visible=!1,t[r].object.visible=!0}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,i=n.length;r<i;r++){const e=n[r];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}}const Kl=new hr,Jl=new nr,Zl=new nr,$l=new hr,ec=new Gr,tc=new hr;class nc extends Es{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Gr,this.bindMatrixInverse=new Gr,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new pr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)tc.fromBufferAttribute(t,n),this.applyBoneTransform(n,tc),this.boundingBox.expandByPoint(tc)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Rr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)tc.fromBufferAttribute(t,n),this.applyBoneTransform(n,tc),this.boundingSphere.expandByPoint(tc)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new nr,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;Jl.fromBufferAttribute(r.attributes.skinIndex,e),Zl.fromBufferAttribute(r.attributes.skinWeight,e),Kl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let i=0;i<4;i++){const e=Zl.getComponent(i);if(0!==e){const r=Jl.getComponent(i);ec.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),t.addScaledVector($l.copy(Kl).applyMatrix4(ec),e)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class rc extends ui{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ic extends tr{constructor(e=null,t=1,n=1,r,i,s,a,o,l=de,c=de,h,u){super(null,s,a,o,l,c,r,i,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const sc=new Gr,ac=new Gr;class oc{constructor(e=[],t=[]){this.uuid=Sn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Gr)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Gr;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let i=0,s=e.length;i<s;i++){const r=e[i]?e[i].matrixWorld:ac;sc.multiplyMatrices(r,t[i]),sc.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}clone(){return new oc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=In(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ic(t,e,e,Le,Te);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new rc),this.bones.push(i),this.boneInverses.push((new Gr).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const s=n[r];e.boneInverses.push(s.toArray())}return e}}class lc extends Gi{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const cc=new Gr,hc=new Gr,uc=[],dc=new pr,pc=new Gr,fc=new Es,mc=new Rr;class gc extends Es{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new lc(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,pc)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new pr),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,cc),dc.copy(e.boundingBox).applyMatrix4(cc),this.boundingBox.union(dc)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new Rr),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,cc),mc.copy(e.boundingSphere).applyMatrix4(cc),this.boundingSphere.union(mc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(fc.geometry=this.geometry,fc.material=this.material,void 0!==fc.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),mc.copy(this.boundingSphere),mc.applyMatrix4(n),!1!==e.ray.intersectsSphere(mc)))for(let i=0;i<r;i++){this.getMatrixAt(i,cc),hc.multiplyMatrices(n,cc),fc.matrixWorld=hc,fc.raycast(e,uc);for(let e=0,n=uc.length;e<n;e++){const n=uc[e];n.instanceId=i,n.object=this,t.push(n)}uc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new lc(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class Ac extends wi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Bi(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const vc=new hr,yc=new hr,xc=new Gr,bc=new kr,Ec=new Rr;class _c extends ui{constructor(e=new is,t=new Ac){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)vc.fromBufferAttribute(t,e-1),yc.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=vc.distanceTo(yc);e.setAttribute("lineDistance",new qi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ec.copy(n.boundingSphere),Ec.applyMatrix4(r),Ec.radius+=i,!1===e.ray.intersectsSphere(Ec))return;xc.copy(r).invert(),bc.copy(e.ray).applyMatrix4(xc);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new hr,c=new hr,h=new hr,u=new hr,d=this.isLineSegments?2:1,p=n.index,f=n.attributes.position;if(null!==p){for(let n=Math.max(0,s.start),r=Math.min(p.count,s.start+s.count)-1;n<r;n+=d){const r=p.getX(n),i=p.getX(n+1);l.fromBufferAttribute(f,r),c.fromBufferAttribute(f,i);if(bc.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);const s=e.ray.origin.distanceTo(u);s<e.near||s>e.far||t.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),r=Math.min(f.count,s.start+s.count)-1;n<r;n+=d){l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,n+1);if(bc.distanceSqToSegment(l,c,u,h)>o)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);r<e.near||r>e.far||t.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const Sc=new hr,wc=new hr;class Mc extends _c{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Sc.fromBufferAttribute(t,e),wc.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Sc.distanceTo(wc);e.setAttribute("lineDistance",new qi(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Cc extends _c{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Tc extends wi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Bi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Ic=new Gr,Bc=new kr,Rc=new Rr,Pc=new hr;class Dc extends ui{constructor(e=new is,t=new Tc){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rc.copy(n.boundingSphere),Rc.applyMatrix4(r),Rc.radius+=i,!1===e.ray.intersectsSphere(Rc))return;Ic.copy(r).invert(),Bc.copy(e.ray).applyMatrix4(Ic);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);n<i;n++){const i=l.getX(n);Pc.fromBufferAttribute(c,i),Lc(Pc,i,o,r,e,t,this)}}else{for(let n=Math.max(0,s.start),i=Math.min(c.count,s.start+s.count);n<i;n++)Pc.fromBufferAttribute(c,n),Lc(Pc,n,o,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Lc(e,t,n,r,i,s,a){const o=Bc.distanceSqToPoint(e);if(o<n){const n=new hr;Bc.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,object:a})}}class Fc extends tr{constructor(e,t,n,r,i,s,a,o,l){super(e,t,n,r,i,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:Ae,this.magFilter=void 0!==i?i:Ae,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}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 Uc extends tr{constructor(e,t,n){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=n,this.magFilter=de,this.minFilter=de,this.generateMipmaps=!1,this.needsUpdate=!0}}class Oc extends tr{constructor(e,t,n,r,i,s,a,o,l,c,h,u){super(null,s,a,o,l,c,r,i,h,u),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Nc extends Oc{constructor(e,t,n,r,i,s){super(e,t,n,i,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=he}}class kc extends tr{constructor(e,t,n,r,i,s,a,o,l){super(e,t,n,r,i,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Gc{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let a,o=0,l=i-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-s,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const c=n[r];return(r+(s-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),a=this.getPoint(i),o=t||(s.isVector2?new Ln:new hr);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new hr,r=[],i=[],s=[],a=new hr,o=new Gr;for(let d=0;d<=e;d++){const t=d/e;r[d]=this.getTangentAt(t,new hr)}i[0]=new hr,s[0]=new hr;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),h=Math.abs(r[0].y),u=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let d=1;d<=e;d++){if(i[d]=i[d-1].clone(),s[d]=s[d-1].clone(),a.crossVectors(r[d-1],r[d]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(wn(r[d-1].dot(r[d]),-1,1));i[d].applyMatrix4(o.makeRotationAxis(a,e))}s[d].crossVectors(r[d],i[d])}if(!0===t){let t=Math.acos(wn(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class zc extends Gc{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t){const n=t||new Ln,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=l-this.aY;o=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Qc extends zc{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.isArcCurve=!0,this.type="ArcCurve"}}function Vc(){let e=0,t=0,n=0,r=0;function i(i,s,a,o){e=i,t=a,n=-3*i+3*s-2*a-o,r=2*i-2*s+a+o}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,a,o){let l=(t-e)/s-(n-e)/(s+a)+(n-t)/a,c=(n-t)/a-(r-t)/(a+o)+(r-n)/o;l*=a,c*=a,i(t,n,l,c)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}const Hc=new hr,jc=new Vc,Wc=new Vc,Xc=new Vc;class Yc extends Gc{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new hr){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let a,o,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?a=r[(l-1)%i]:(Hc.subVectors(r[0],r[1]).add(r[0]),a=Hc);const h=r[l%i],u=r[(l+1)%i];if(this.closed||l+2<i?o=r[(l+2)%i]:(Hc.subVectors(r[i-1],r[i-2]).add(r[i-1]),o=Hc),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(h),e),n=Math.pow(h.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),jc.initNonuniformCatmullRom(a.x,h.x,u.x,o.x,t,n,r),Wc.initNonuniformCatmullRom(a.y,h.y,u.y,o.y,t,n,r),Xc.initNonuniformCatmullRom(a.z,h.z,u.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(jc.initCatmullRom(a.x,h.x,u.x,o.x,this.tension),Wc.initCatmullRom(a.y,h.y,u.y,o.y,this.tension),Xc.initCatmullRom(a.z,h.z,u.z,o.z,this.tension));return n.set(jc.calc(c),Wc.calc(c),Xc.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new hr).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function qc(e,t,n,r,i){const s=.5*(r-t),a=.5*(i-n),o=e*e;return(2*n-2*r+s+a)*(e*o)+(-3*n+3*r-2*s-a)*o+s*e+n}function Kc(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Jc(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class Zc extends Gc{constructor(e=new Ln,t=new Ln,n=new Ln,r=new Ln){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Ln){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(Jc(e,r.x,i.x,s.x,a.x),Jc(e,r.y,i.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class $c extends Gc{constructor(e=new hr,t=new hr,n=new hr,r=new hr){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new hr){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(Jc(e,r.x,i.x,s.x,a.x),Jc(e,r.y,i.y,s.y,a.y),Jc(e,r.z,i.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class eh extends Gc{constructor(e=new Ln,t=new Ln){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ln){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ln){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class th extends Gc{constructor(e=new hr,t=new hr){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new hr){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new hr){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class nh extends Gc{constructor(e=new Ln,t=new Ln,n=new Ln){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Ln){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Kc(e,r.x,i.x,s.x),Kc(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class rh extends Gc{constructor(e=new hr,t=new hr,n=new hr){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new hr){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Kc(e,r.x,i.x,s.x),Kc(e,r.y,i.y,s.y),Kc(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ih extends Gc{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ln){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),a=i-s,o=r[0===s?s:s-1],l=r[s],c=r[s>r.length-2?r.length-1:s+1],h=r[s>r.length-3?r.length-1:s+2];return n.set(qc(a,o.x,l.x,c.x,h.x),qc(a,o.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Ln).fromArray(n))}return this}}var sh=Object.freeze({__proto__:null,ArcCurve:Qc,CatmullRomCurve3:Yc,CubicBezierCurve:Zc,CubicBezierCurve3:$c,EllipseCurve:zc,LineCurve:eh,LineCurve3:th,QuadraticBezierCurve:nh,QuadraticBezierCurve3:rh,SplineCurve:ih});class ah extends Gc{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new eh(t,e))}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){const r=o[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new sh[n.type]).fromJSON(n))}return this}}class oh extends ah{constructor(e){super(),this.type="Path",this.currentPoint=new Ln,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new eh(this.currentPoint.clone(),new Ln(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new nh(this.currentPoint.clone(),new Ln(e,t),new Ln(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const a=new Zc(this.currentPoint.clone(),new Ln(e,t),new Ln(n,r),new Ln(i,s));return this.curves.push(a),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new ih(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,a,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,s,a,o),this}absellipse(e,t,n,r,i,s,a,o){const l=new zc(e,t,n,r,i,s,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class lh extends is{constructor(e=[new Ln(0,-.5),new Ln(.5,0),new Ln(0,.5)],t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=wn(r,0,2*Math.PI);const i=[],s=[],a=[],o=[],l=[],c=1/t,h=new hr,u=new Ln,d=new hr,p=new hr,f=new hr;let m=0,g=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:m=e[A+1].x-e[A].x,g=e[A+1].y-e[A].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[A+1].x-e[A].x,g=e[A+1].y-e[A].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let A=0;A<=t;A++){const i=n+A*c*r,d=Math.sin(i),p=Math.cos(i);for(let n=0;n<=e.length-1;n++){h.x=e[n].x*d,h.y=e[n].y,h.z=e[n].x*p,s.push(h.x,h.y,h.z),u.x=A/t,u.y=n/(e.length-1),a.push(u.x,u.y);const r=o[3*n+0]*d,i=o[3*n+1],c=o[3*n+0]*p;l.push(r,i,c)}}for(let A=0;A<t;A++)for(let t=0;t<e.length-1;t++){const n=t+A*e.length,r=n,s=n+e.length,a=n+e.length+1,o=n+1;i.push(r,s,o),i.push(a,o,s)}this.setIndex(i),this.setAttribute("position",new qi(s,3)),this.setAttribute("uv",new qi(a,2)),this.setAttribute("normal",new qi(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lh(e.points,e.segments,e.phiStart,e.phiLength)}}class ch extends lh{constructor(e=1,t=1,n=4,r=8){const i=new oh;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new ch(e.radius,e.length,e.capSegments,e.radialSegments)}}class hh extends is{constructor(e=1,t=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],s=[],a=[],o=[],l=new hr,c=new Ln;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let h=0,u=3;h<=t;h++,u+=3){const i=n+h/t*r;l.x=e*Math.cos(i),l.y=e*Math.sin(i),s.push(l.x,l.y,l.z),a.push(0,0,1),c.x=(s[u]/e+1)/2,c.y=(s[u+1]/e+1)/2,o.push(c.x,c.y)}for(let h=1;h<=t;h++)i.push(h,h+1,0);this.setIndex(i),this.setAttribute("position",new qi(s,3)),this.setAttribute("normal",new qi(a,3)),this.setAttribute("uv",new qi(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hh(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class uh extends is{constructor(e=1,t=1,n=1,r=32,i=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],h=[],u=[],d=[];let p=0;const f=[],m=n/2;let g=0;function A(n){const i=p,s=new Ln,f=new hr;let A=0;const v=!0===n?e:t,y=!0===n?1:-1;for(let e=1;e<=r;e++)h.push(0,m*y,0),u.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let e=0;e<=r;e++){const t=e/r*o+a,n=Math.cos(t),i=Math.sin(t);f.x=v*i,f.y=m*y,f.z=v*n,h.push(f.x,f.y,f.z),u.push(0,y,0),s.x=.5*n+.5,s.y=.5*i*y+.5,d.push(s.x,s.y),p++}for(let e=0;e<r;e++){const t=i+e,r=x+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),A+=3}l.addGroup(g,A,!0===n?1:2),g+=A}!function(){const s=new hr,A=new hr;let v=0;const y=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*o+a,l=Math.sin(i),f=Math.cos(i);A.x=v*l,A.y=-g*n+m,A.z=v*f,h.push(A.x,A.y,A.z),s.set(l,y,f).normalize(),u.push(s.x,s.y,s.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],s=f[t][e+1];c.push(n,r,s),c.push(r,i,s),v+=6}l.addGroup(g,v,0),g+=v}(),!1===s&&(e>0&&A(!0),t>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new qi(h,3)),this.setAttribute("normal",new qi(u,3)),this.setAttribute("uv",new qi(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new uh(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class dh extends uh{constructor(e=1,t=1,n=32,r=1,i=!1,s=0,a=2*Math.PI){super(0,e,t,n,r,i,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:s,thetaLength:a}}static fromJSON(e){return new dh(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ph extends is{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],s=[];function a(e,t,n,r){const i=r+1,s=[];for(let a=0;a<=i;a++){s[a]=[];const r=e.clone().lerp(n,a/i),o=t.clone().lerp(n,a/i),l=i-a;for(let e=0;e<=l;e++)s[a][e]=0===e&&a===i?r:r.clone().lerp(o,e/l)}for(let a=0;a<i;a++)for(let e=0;e<2*(i-a)-1;e++){const t=Math.floor(e/2);e%2==0?(o(s[a][t+1]),o(s[a+1][t]),o(s[a][t])):(o(s[a][t+1]),o(s[a+1][t+1]),o(s[a+1][t]))}}function o(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(s[t]=e.x-1),0===n.x&&0===n.z&&(s[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new hr,r=new hr,i=new hr;for(let s=0;s<t.length;s+=3)l(t[s+0],n),l(t[s+1],r),l(t[s+2],i),a(n,r,i,e)}(r),function(e){const t=new hr;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new hr;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=h(e)/2/Math.PI+.5,a=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);s.push(r,1-a)}var t;(function(){const e=new hr,t=new hr,n=new hr,r=new hr,a=new Ln,o=new Ln,l=new Ln;for(let u=0,d=0;u<i.length;u+=9,d+=6){e.set(i[u+0],i[u+1],i[u+2]),t.set(i[u+3],i[u+4],i[u+5]),n.set(i[u+6],i[u+7],i[u+8]),a.set(s[d+0],s[d+1]),o.set(s[d+2],s[d+3]),l.set(s[d+4],s[d+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=h(r);c(a,d+0,e,p),c(o,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],n=s[e+2],r=s[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new qi(i,3)),this.setAttribute("normal",new qi(i.slice(),3)),this.setAttribute("uv",new qi(s,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ph(e.vertices,e.indices,e.radius,e.details)}}class fh extends ph{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new fh(e.radius,e.detail)}}const mh=new hr,gh=new hr,Ah=new hr,vh=new _i;class yh extends is{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos(En*t),s=e.getIndex(),a=e.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let e=0;e<o;e+=3){s?(l[0]=s.getX(e),l[1]=s.getX(e+1),l[2]=s.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:o}=vh;if(t.fromBufferAttribute(a,l[0]),n.fromBufferAttribute(a,l[1]),o.fromBufferAttribute(a,l[2]),vh.getNormal(Ah),h[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,h[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,h[2]=`${Math.round(o.x*r)},${Math.round(o.y*r)},${Math.round(o.z*r)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=h[e],r=h[t],s=vh[c[e]],a=vh[c[t]],o=`${n}_${r}`,p=`${r}_${n}`;p in u&&u[p]?(Ah.dot(u[p].normal)<=i&&(d.push(s.x,s.y,s.z),d.push(a.x,a.y,a.z)),u[p]=null):o in u||(u[o]={index0:l[e],index1:l[t],normal:Ah.clone()})}}for(const e in u)if(u[e]){const{index0:t,index1:n}=u[e];mh.fromBufferAttribute(a,t),gh.fromBufferAttribute(a,n),d.push(mh.x,mh.y,mh.z),d.push(gh.x,gh.y,gh.z)}this.setAttribute("position",new qi(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class xh extends oh{constructor(e){super(e),this.uuid=Sn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new oh).fromJSON(n))}return this}}const bh=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Eh(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,h,u,d,p;if(r&&(s=function(e,t,n,r){const i=[];let s,a,o,l,c;for(s=0,a=t.length;s<a;s++)o=t[s]*r,l=s<a-1?t[s+1]*r:e.length,c=Eh(e,o,l,r,!1),c===c.next&&(c.steiner=!0),i.push(Dh(c));for(i.sort(Ih),s=0;s<i.length;s++)n=Bh(i[s],n);return n}(e,t,s,n)),e.length>80*n){o=c=e[0],l=h=e[1];for(let t=n;t<i;t+=n)u=e[t],d=e[t+1],u<o&&(o=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Sh(s,a,n,o,l,p,0),a};function Eh(e,t,n,r,i){let s,a;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)a=Vh(s,e[s],e[s+1],a);else for(s=n-r;s>=t;s-=r)a=Vh(s,e[s],e[s+1],a);return a&&Oh(a,a.next)&&(Hh(a),a=a.next),a}function _h(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Oh(r,r.next)&&0!==Uh(r.prev,r,r.next))r=r.next;else{if(Hh(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Sh(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=Ph(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,a,o,l,c=1;do{for(n=e,e=null,s=null,a=0;n;){for(a++,r=n,o=0,t=0;t<c&&(o++,r=r.nextZ,r);t++);for(l=c;o>0||l>0&&r;)0!==o&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?Mh(e,r,i,s):wh(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Hh(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Sh(e=Ch(_h(e),t,n),t,n,r,i,s,2):2===a&&Th(e,t,n,r,i,s):Sh(_h(e),t,n,r,i,s,1);break}}function wh(e){const t=e.prev,n=e,r=e.next;if(Uh(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,c=r.y,h=i<s?i<a?i:a:s<a?s:a,u=o<l?o<c?o:c:l<c?l:c,d=i>s?i>a?i:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let f=r.next;for(;f!==t;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Lh(i,o,s,l,a,c,f.x,f.y)&&Uh(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Mh(e,t,n,r){const i=e.prev,s=e,a=e.next;if(Uh(i,s,a)>=0)return!1;const o=i.x,l=s.x,c=a.x,h=i.y,u=s.y,d=a.y,p=o<l?o<c?o:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=o>l?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Ph(p,f,t,n,r),v=Ph(m,g,t,n,r);let y=e.prevZ,x=e.nextZ;for(;y&&y.z>=A&&x&&x.z<=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&Lh(o,h,l,u,c,d,y.x,y.y)&&Uh(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==a&&Lh(o,h,l,u,c,d,x.x,x.y)&&Uh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==a&&Lh(o,h,l,u,c,d,y.x,y.y)&&Uh(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==a&&Lh(o,h,l,u,c,d,x.x,x.y)&&Uh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Ch(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!Oh(i,s)&&Nh(i,r,r.next,s)&&zh(i,s)&&zh(s,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),Hh(r),Hh(r.next),r=e=s),r=r.next}while(r!==e);return _h(r)}function Th(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Fh(a,e)){let o=Qh(a,e);return a=_h(a,a.next),o=_h(o,o.next),Sh(a,t,n,r,i,s,0),void Sh(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function Ih(e,t){return e.x-t.x}function Bh(e,t){const n=function(e,t){let n,r=t,i=-1/0;const s=e.x,a=e.y;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){const e=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===s))return n}r=r.next}while(r!==t);if(!n)return null;const o=n,l=n.x,c=n.y;let h,u=1/0;r=n;do{s>=r.x&&r.x>=l&&s!==r.x&&Lh(a<c?s:i,a,l,c,a<c?i:s,a,r.x,r.y)&&(h=Math.abs(a-r.y)/(s-r.x),zh(r,e)&&(h<u||h===u&&(r.x>n.x||r.x===n.x&&Rh(n,r)))&&(n=r,u=h)),r=r.next}while(r!==o);return n}(e,t);if(!n)return t;const r=Qh(n,e);return _h(r,r.next),_h(n,n.next)}function Rh(e,t){return Uh(e.prev,e,t.prev)<0&&Uh(t.next,e,e.next)<0}function Ph(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Dh(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Lh(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function Fh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Nh(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(zh(e,t)&&zh(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Uh(e.prev,e,t.prev)||Uh(e,t.prev,t))||Oh(e,t)&&Uh(e.prev,e,e.next)>0&&Uh(t.prev,t,t.next)>0)}function Uh(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Oh(e,t){return e.x===t.x&&e.y===t.y}function Nh(e,t,n,r){const i=Gh(Uh(e,t,n)),s=Gh(Uh(e,t,r)),a=Gh(Uh(n,r,e)),o=Gh(Uh(n,r,t));return i!==s&&a!==o||(!(0!==i||!kh(e,n,t))||(!(0!==s||!kh(e,r,t))||(!(0!==a||!kh(n,e,r))||!(0!==o||!kh(n,t,r)))))}function kh(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Gh(e){return e>0?1:e<0?-1:0}function zh(e,t){return Uh(e.prev,e,e.next)<0?Uh(e,t,e.next)>=0&&Uh(e,e.prev,t)>=0:Uh(e,t,e.prev)<0||Uh(e,e.next,t)<0}function Qh(e,t){const n=new jh(e.i,e.x,e.y),r=new jh(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function Vh(e,t,n,r){const i=new jh(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Hh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function jh(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Wh{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Wh.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Xh(e),Yh(n,e);let s=e.length;t.forEach(Xh);for(let o=0;o<t.length;o++)r.push(s),s+=t[o].length,Yh(n,t[o]);const a=bh(n,r);for(let o=0;o<a.length;o+=3)i.push(a.slice(o,o+3));return i}}function Xh(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Yh(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class qh extends is{constructor(e=new xh([new Ln(.5,.5),new Ln(-.5,.5),new Ln(-.5,-.5),new Ln(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let a=0,o=e.length;a<o;a++){s(e[a])}function s(e){const s=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:.2,u=void 0!==t.bevelSize?t.bevelSize:h-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Kh;let g,A,v,y,x,b=!1;f&&(g=f.getSpacedPoints(o),b=!0,c=!1,A=f.computeFrenetFrames(o,!1),v=new hr,y=new hr,x=new hr),c||(p=0,h=0,u=0,d=0);const E=e.extractPoints(a);let _=E.shape;const S=E.holes;if(!Wh.isClockWise(_)){_=_.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Wh.isClockWise(t)&&(S[e]=t.reverse())}}const w=Wh.triangulateShape(_,S),M=_;for(let t=0,n=S.length;t<n;t++){const e=S[t];_=_.concat(e)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const T=_.length,I=w.length;function B(e,t,n){let r,i,s;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,c=n.y-e.y,h=a*a+o*o,u=a*c-o*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=t.x-o/u,f=t.y+a/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(a*c-o*l);r=p+a*m-e.x,i=f+o*m-e.y;const g=r*r+i*i;if(g<=2)return new Ln(r,i);s=Math.sqrt(g/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(c)&&(e=!0),e?(r=-o,i=a,s=Math.sqrt(h)):(r=a,i=o,s=Math.sqrt(h/2))}return new Ln(r/s,i/s)}const R=[];for(let t=0,n=M.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),R[t]=B(M[t],M[r],M[i]);const P=[];let D,L=R.concat();for(let t=0,n=S.length;t<n;t++){const e=S[t];D=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),D[t]=B(e[t],e[r],e[i]);P.push(D),L=L.concat(D)}for(let t=0;t<p;t++){const e=t/p,n=h*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+d;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],R[t],r);O(e.x,e.y,-n)}for(let t=0,i=S.length;t<i;t++){const e=S[t];D=P[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);O(i.x,i.y,-n)}}}const F=u+d;for(let t=0;t<T;t++){const e=c?C(_[t],L[t],F):_[t];b?(y.copy(A.normals[0]).multiplyScalar(e.x),v.copy(A.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(y).add(v),O(x.x,x.y,x.z)):O(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<T;e++){const n=c?C(_[e],L[e],F):_[e];b?(y.copy(A.normals[t]).multiplyScalar(n.x),v.copy(A.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(y).add(v),O(x.x,x.y,x.z)):O(n.x,n.y,l/o*t)}for(let t=p-1;t>=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+d;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],R[t],r);O(e.x,e.y,l+n)}for(let t=0,i=S.length;t<i;t++){const e=S[t];D=P[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);b?O(i.x,i.y+g[o-1].y,g[o-1].x+n):O(i.x,i.y,l+n)}}}function U(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=o+2*p;e<n;e++){const n=T*e,s=T*(e+1);k(t+r+n,t+i+n,t+i+s,t+r+s)}}}function O(e,t,n){s.push(e),s.push(t),s.push(n)}function N(e,t,i){G(e),G(t),G(i);const s=r.length/3,a=m.generateTopUV(n,r,s-3,s-2,s-1);z(a[0]),z(a[1]),z(a[2])}function k(e,t,i,s){G(e),G(t),G(s),G(t),G(i),G(s);const a=r.length/3,o=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[3]),z(o[1]),z(o[2]),z(o[3])}function G(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function z(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=T*e;for(let n=0;n<I;n++){const e=w[n];N(e[2]+t,e[1]+t,e[0]+t)}e=o+2*p,t=T*e;for(let n=0;n<I;n++){const e=w[n];N(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<I;e++){const t=w[e];N(t[2],t[1],t[0])}for(let e=0;e<I;e++){const t=w[e];N(t[0]+T*o,t[1]+T*o,t[2]+T*o)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;U(M,t),t+=M.length;for(let n=0,r=S.length;n<r;n++){const e=S[n];U(e,t),t+=e.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new qi(r,3)),this.setAttribute("uv",new qi(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let r=0,i=e.length;r<i;r++){const t=e[r];n.shapes.push(t.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const r=t[e.shapes[i]];n.push(r)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new sh[r.type]).fromJSON(r)),new qh(n,e.options)}}const Kh={generateTopUV:function(e,t,n,r,i){const s=t[3*n],a=t[3*n+1],o=t[3*r],l=t[3*r+1],c=t[3*i],h=t[3*i+1];return[new Ln(s,a),new Ln(o,l),new Ln(c,h)]},generateSideWallUV:function(e,t,n,r,i,s){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],c=t[3*r],h=t[3*r+1],u=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*s],g=t[3*s+1],A=t[3*s+2];return Math.abs(o-h)<Math.abs(a-c)?[new Ln(a,1-l),new Ln(c,1-u),new Ln(d,1-f),new Ln(m,1-A)]:[new Ln(o,1-l),new Ln(h,1-u),new Ln(p,1-f),new Ln(g,1-A)]}};class Jh extends ph{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Jh(e.radius,e.detail)}}class Zh extends ph{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Zh(e.radius,e.detail)}}class $h extends is{constructor(e=.5,t=1,n=32,r=1,i=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:s},n=Math.max(3,n);const a=[],o=[],l=[],c=[];let h=e;const u=(t-e)/(r=Math.max(1,r)),d=new hr,p=new Ln;for(let f=0;f<=r;f++){for(let e=0;e<=n;e++){const r=i+e/n*s;d.x=h*Math.cos(r),d.y=h*Math.sin(r),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}h+=u}for(let f=0;f<r;f++){const e=f*(n+1);for(let t=0;t<n;t++){const r=t+e,i=r,s=r+n+1,o=r+n+2,l=r+1;a.push(i,s,l),a.push(s,o,l)}}this.setIndex(a),this.setAttribute("position",new qi(o,3)),this.setAttribute("normal",new qi(l,3)),this.setAttribute("uv",new qi(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $h(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class eu extends is{constructor(e=new xh([new Ln(0,.5),new Ln(-.5,-.5),new Ln(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],s=[];let a=0,o=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c<e.length;c++)l(e[c]),this.addGroup(a,o,c),a+=o,o=0;function l(e){const a=r.length/3,l=e.extractPoints(t);let c=l.shape;const h=l.holes;!1===Wh.isClockWise(c)&&(c=c.reverse());for(let t=0,n=h.length;t<n;t++){const e=h[t];!0===Wh.isClockWise(e)&&(h[t]=e.reverse())}const u=Wh.triangulateShape(c,h);for(let t=0,n=h.length;t<n;t++){const e=h[t];c=c.concat(e)}for(let t=0,n=c.length;t<n;t++){const e=c[t];r.push(e.x,e.y,0),i.push(0,0,1),s.push(e.x,e.y)}for(let t=0,r=u.length;t<r;t++){const e=u[t],r=e[0]+a,i=e[1]+a,s=e[2]+a;n.push(r,i,s),o+=3}}this.setIndex(n),this.setAttribute("position",new qi(r,3)),this.setAttribute("normal",new qi(i,3)),this.setAttribute("uv",new qi(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new eu(n,e.curveSegments)}}class tu extends is{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const c=[],h=new hr,u=new hr,d=[],p=[],f=[],m=[];for(let g=0;g<=n;g++){const d=[],A=g/n;let v=0;0===g&&0===s?v=.5/t:g===n&&o===Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){const o=n/t;h.x=-e*Math.cos(r+o*i)*Math.sin(s+A*a),h.y=e*Math.cos(s+A*a),h.z=e*Math.sin(r+o*i)*Math.sin(s+A*a),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(o+v,1-A),d.push(l++)}c.push(d)}for(let g=0;g<n;g++)for(let e=0;e<t;e++){const t=c[g][e+1],r=c[g][e],i=c[g+1][e],a=c[g+1][e+1];(0!==g||s>0)&&d.push(t,r,a),(g!==n-1||o<Math.PI)&&d.push(r,i,a)}this.setIndex(d),this.setAttribute("position",new qi(p,3)),this.setAttribute("normal",new qi(f,3)),this.setAttribute("uv",new qi(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tu(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class nu extends ph{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new nu(e.radius,e.detail)}}class ru extends is{constructor(e=1,t=.4,n=12,r=48,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],o=[],l=[],c=new hr,h=new hr,u=new hr;for(let d=0;d<=n;d++)for(let s=0;s<=r;s++){const p=s/r*i,f=d/n*Math.PI*2;h.x=(e+t*Math.cos(f))*Math.cos(p),h.y=(e+t*Math.cos(f))*Math.sin(p),h.z=t*Math.sin(f),a.push(h.x,h.y,h.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),u.subVectors(h,c).normalize(),o.push(u.x,u.y,u.z),l.push(s/r),l.push(d/n)}for(let d=1;d<=n;d++)for(let e=1;e<=r;e++){const t=(r+1)*d+e-1,n=(r+1)*(d-1)+e-1,i=(r+1)*(d-1)+e,a=(r+1)*d+e;s.push(t,n,a),s.push(n,i,a)}this.setIndex(s),this.setAttribute("position",new qi(a,3)),this.setAttribute("normal",new qi(o,3)),this.setAttribute("uv",new qi(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ru(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class iu extends is{constructor(e=1,t=.4,n=64,r=8,i=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:s},n=Math.floor(n),r=Math.floor(r);const a=[],o=[],l=[],c=[],h=new hr,u=new hr,d=new hr,p=new hr,f=new hr,m=new hr,g=new hr;for(let v=0;v<=n;++v){const a=v/n*i*Math.PI*2;A(a,i,s,e,d),A(a+.01,i,s,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,s=-t*Math.cos(i),a=t*Math.sin(i);h.x=d.x+(s*g.x+a*f.x),h.y=d.y+(s*g.y+a*f.y),h.z=d.z+(s*g.z+a*f.z),o.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(v/n),c.push(e/r)}}for(let v=1;v<=n;v++)for(let e=1;e<=r;e++){const t=(r+1)*(v-1)+(e-1),n=(r+1)*v+(e-1),i=(r+1)*v+e,s=(r+1)*(v-1)+e;a.push(t,n,s),a.push(n,i,s)}function A(e,t,n,r,i){const s=Math.cos(e),a=Math.sin(e),o=n/t*e,l=Math.cos(o);i.x=r*(2+l)*.5*s,i.y=r*(2+l)*a*.5,i.z=r*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new qi(o,3)),this.setAttribute("normal",new qi(l,3)),this.setAttribute("uv",new qi(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new iu(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class su extends is{constructor(e=new rh(new hr(-1,-1,0),new hr(-1,1,0),new hr(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new hr,o=new hr,l=new Ln;let c=new hr;const h=[],u=[],d=[],p=[];function f(i){c=e.getPointAt(i/t,c);const l=s.normals[i],d=s.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+i*d.x,o.y=s*l.y+i*d.y,o.z=s*l.z+i*d.z,o.normalize(),u.push(o.x,o.y,o.z),a.x=c.x+n*o.x,a.y=c.y+n*o.y,a.z=c.z+n*o.z,h.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;p.push(n,i,a),p.push(i,s,a)}}()}(),this.setIndex(p),this.setAttribute("position",new qi(h,3)),this.setAttribute("normal",new qi(u,3)),this.setAttribute("uv",new qi(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new su((new sh[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class au extends is{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new hr,i=new hr;if(null!==e.index){const s=e.attributes.position,a=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let l=0;l<3;l++){const o=a.getX(e+l),c=a.getX(e+(l+1)%3);r.fromBufferAttribute(s,o),i.fromBufferAttribute(s,c),!0===ou(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let o=0;o<3;o++){const a=3*e+o,l=3*e+(o+1)%3;r.fromBufferAttribute(s,a),i.fromBufferAttribute(s,l),!0===ou(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new qi(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function ou(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var lu=Object.freeze({__proto__:null,BoxGeometry:Ss,CapsuleGeometry:ch,CircleGeometry:hh,ConeGeometry:dh,CylinderGeometry:uh,DodecahedronGeometry:fh,EdgesGeometry:yh,ExtrudeGeometry:qh,IcosahedronGeometry:Jh,LatheGeometry:lh,OctahedronGeometry:Zh,PlaneGeometry:js,PolyhedronGeometry:ph,RingGeometry:$h,ShapeGeometry:eu,SphereGeometry:tu,TetrahedronGeometry:nu,TorusGeometry:ru,TorusKnotGeometry:iu,TubeGeometry:su,WireframeGeometry:au});class cu extends wi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Bi(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class hu extends Is{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class uu extends wi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Bi(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 Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(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 du extends uu{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 Ln(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return wn(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 Bi(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 Bi(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Bi(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}}class pu extends wi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Bi(16777215),this.specular=new Bi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,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.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,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 fu extends wi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Bi(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class mu extends wi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class gu extends wi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Bi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Bi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,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.color.copy(e.color),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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,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 Au extends wi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Bi(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nt,this.normalScale=new Ln(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class vu extends Ac{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function yu(e,t,n){return bu(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)}function xu(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function bu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Eu(e){const t=e.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n}function _u(e,t,n){const r=e.length,i=new e.constructor(r);for(let s=0,a=0;a!==r;++s){const r=n[s]*t;for(let n=0;n!==t;++n)i[a++]=e[r+n]}return i}function Su(e,t,n,r){let i=1,s=e[0];for(;void 0!==s&&void 0===s[r];)s=e[i++];if(void 0===s)return;let a=s[r];if(void 0!==a)if(Array.isArray(a))do{a=s[r],void 0!==a&&(t.push(s.time),n.push.apply(n,a)),s=e[i++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[r],void 0!==a&&(t.push(s.time),a.toArray(n,n.length)),s=e[i++]}while(void 0!==s);else do{a=s[r],void 0!==a&&(t.push(s.time),n.push(a)),s=e[i++]}while(void 0!==s)}const wu={arraySlice:yu,convertArray:xu,isTypedArray:bu,getKeyframeOrder:Eu,sortedArray:_u,flattenJSON:Su,subclip:function(e,t,n,r,i=30){const s=e.clone();s.name=t;const a=[];for(let l=0;l<s.tracks.length;++l){const e=s.tracks[l],t=e.getValueSize(),o=[],c=[];for(let s=0;s<e.times.length;++s){const a=e.times[s]*i;if(!(a<n||a>=r)){o.push(e.times[s]);for(let n=0;n<t;++n)c.push(e.values[s*t+n])}}0!==o.length&&(e.times=xu(o,e.times.constructor),e.values=xu(c,e.values.constructor),a.push(e))}s.tracks=a;let o=1/0;for(let l=0;l<s.tracks.length;++l)o>s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*o);return s.resetDuration(),s},makeClipAdditive:function(e,t=0,n=e,r=30){r<=0&&(r=30);const i=n.tracks.length,s=t/r;for(let a=0;a<i;++a){const t=n.tracks[a],r=t.ValueTypeName;if("bool"===r||"string"===r)continue;const i=e.tracks.find((function(e){return e.name===t.name&&e.ValueTypeName===r}));if(void 0===i)continue;let o=0;const l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let c=0;const h=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=t.times.length-1;let d;if(s<=t.times[0]){const e=o,n=l-o;d=yu(t.values,e,n)}else if(s>=t.times[u]){const e=u*l+o,n=e+l-o;d=yu(t.values,e,n)}else{const e=t.createInterpolant(),n=o,r=l-o;e.evaluate(s),d=yu(e.resultBuffer,n,r)}if("quaternion"===r){(new cr).fromArray(d).normalize().conjugate().toArray(d)}const p=i.times.length;for(let e=0;e<p;++e){const t=e*h+c;if("quaternion"===r)cr.multiplyQuaternionsFlat(i.values,t,d,0,i.values,t);else{const e=h-2*c;for(let n=0;n<e;++n)i.values[t+n]-=d[n]}}}return e.blendMode=Bt,e}};class Mu{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let s;n:{r:if(!(e<r)){for(let s=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(i=r,r=t[++n],e<r)break t}s=t.length;break n}if(e>=i)break e;{const a=t[1];e<a&&(n=2,i=a);for(let s=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===s)break;if(r=i,i=t[--n-1],e>=i)break t}s=n,n=0}}for(;n<s;){const r=n+s>>>1;e<t[r]?s=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let s=0;s!==r;++s)t[s]=n[i+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Cu extends Mu{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Mt,endingEnd:Mt}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,s=e+1,a=r[i],o=r[s];if(void 0===a)switch(this.getSettings_().endingStart){case Ct:i=e,a=2*t-n;break;case Tt:i=r.length-2,a=t+r[i]-r[i+1];break;default:i=e,a=n}if(void 0===o)switch(this.getSettings_().endingEnd){case Ct:s=e,o=2*n-t;break;case Tt:s=1,o=n+r[1]-r[0];break;default:s=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-n),this._offsetPrev=i*c,this._offsetNext=s*c}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,A=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let x=0;x!==a;++x)i[x]=g*s[c+x]+A*s[l+x]+v*s[o+x]+y*s[h+x];return i}}class Tu extends Mu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=(n-t)/(r-t),h=1-c;for(let u=0;u!==a;++u)i[u]=s[l+u]*h+s[o+u]*c;return i}}class Iu extends Mu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bu{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=xu(t,this.TimeBufferType),this.values=xu(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:xu(e.times,Array),values:xu(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Iu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Tu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Cu(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case _t:t=this.InterpolantFactoryMethodDiscrete;break;case St:t=this.InterpolantFactoryMethodLinear;break;case wt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _t;case this.InterpolantFactoryMethodLinear:return St;case this.InterpolantFactoryMethodSmooth:return wt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,s=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==s&&n[s]>t;)--s;if(++s,0!==i||s!==r){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=yu(n,i,s),this.values=yu(this.values,i*e,s*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 n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==i;a++){const t=n[a];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,t),e=!1;break}if(null!==s&&s>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,t,s),e=!1;break}s=t}if(void 0!==r&&bu(r))for(let a=0,o=r.length;a!==o;++a){const t=r[a];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,t),e=!1;break}}return e}optimize(){const e=yu(this.times),t=yu(this.values),n=this.getValueSize(),r=this.getInterpolation()===wt,i=e.length-1;let s=1;for(let a=1;a<i;++a){let i=!1;const o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(r)i=!0;else{const e=a*n,r=e-n,s=e+n;for(let a=0;a!==n;++a){const n=t[e+a];if(n!==t[r+a]||n!==t[s+a]){i=!0;break}}}if(i){if(a!==s){e[s]=e[a];const r=a*n,i=s*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++s}}if(i>0){e[s]=e[i];for(let e=i*n,r=s*n,a=0;a!==n;++a)t[r+a]=t[e+a];++s}return s!==e.length?(this.times=yu(e,0,s),this.values=yu(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=yu(this.times,0),t=yu(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Bu.prototype.TimeBufferType=Float32Array,Bu.prototype.ValueBufferType=Float32Array,Bu.prototype.DefaultInterpolation=St;class Ru extends Bu{}Ru.prototype.ValueTypeName="bool",Ru.prototype.ValueBufferType=Array,Ru.prototype.DefaultInterpolation=_t,Ru.prototype.InterpolantFactoryMethodLinear=void 0,Ru.prototype.InterpolantFactoryMethodSmooth=void 0;class Pu extends Bu{}Pu.prototype.ValueTypeName="color";class Du extends Bu{}Du.prototype.ValueTypeName="number";class Lu extends Mu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-t)/(r-t);let l=e*a;for(let c=l+a;l!==c;l+=4)cr.slerpFlat(i,0,s,l-a,s,l,o);return i}}class Fu extends Bu{InterpolantFactoryMethodLinear(e){return new Lu(this.times,this.values,this.getValueSize(),e)}}Fu.prototype.ValueTypeName="quaternion",Fu.prototype.DefaultInterpolation=St,Fu.prototype.InterpolantFactoryMethodSmooth=void 0;class Uu extends Bu{}Uu.prototype.ValueTypeName="string",Uu.prototype.ValueBufferType=Array,Uu.prototype.DefaultInterpolation=_t,Uu.prototype.InterpolantFactoryMethodLinear=void 0,Uu.prototype.InterpolantFactoryMethodSmooth=void 0;class Ou extends Bu{}Ou.prototype.ValueTypeName="vector";class Nu{constructor(e,t=-1,n,r=It){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Sn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let s=0,a=n.length;s!==a;++s)t.push(ku(n[s]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,s=n.length;i!==s;++i)t.push(Bu.toJSON(n[i]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,s=[];for(let a=0;a<i;a++){let e=[],o=[];e.push((a+i-1)%i,a,(a+1)%i),o.push(0,1,0);const l=Eu(e);e=_u(e,1,l),o=_u(o,1,l),r||0!==e[0]||(e.push(i),o.push(o[0])),s.push(new Du(".morphTargetInfluences["+t[a].name+"]",e,o).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let a=0,o=e.length;a<o;a++){const t=e[a],n=t.name.match(i);if(n&&n.length>1){const e=n[1];let i=r[e];i||(r[e]=i=[]),i.push(t)}}const s=[];for(const a in r)s.push(this.CreateFromMorphTargetSequence(a,r[a],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const s=[],a=[];Su(n,s,a,r),0!==s.length&&i.push(new e(t,s,a))}},r=[],i=e.name||"default",s=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let c=0;c<l.length;c++){const e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){const t={};let n;for(n=0;n<e.length;n++)if(e[n].morphTargets)for(let r=0;r<e[n].morphTargets.length;r++)t[e[n].morphTargets[r]]=-1;for(const i in t){const t=[],s=[];for(let r=0;r!==e[n].morphTargets.length;++r){const r=e[n];t.push(r.time),s.push(r.morphTarget===i?1:0)}r.push(new Du(".morphTargetInfluence["+i+"]",t,s))}o=t.length*s}else{const i=".bones["+t[c].name+"]";n(Ou,i+".position",e,"pos",r),n(Fu,i+".quaternion",e,"rot",r),n(Ou,i+".scale",e,"scl",r)}}if(0===r.length)return null;return new this(i,o,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function ku(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Du;case"vector":case"vector2":case"vector3":case"vector4":return Ou;case"color":return Pu;case"quaternion":return Fu;case"bool":case"boolean":return Ru;case"string":return Uu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];Su(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Gu={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class zu{constructor(e,t,n){const r=this;let i,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const Qu=new zu;class Vu{constructor(e){this.manager=void 0!==e?e:Qu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Hu={};class ju extends Error{constructor(e,t){super(e),this.response=t}}class Wu extends Vu{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Gu.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==Hu[e])return void Hu[e].push({onLoad:t,onProgress:n,onError:r});Hu[e]=[],Hu[e].push({onLoad:t,onProgress:n,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).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 n=Hu[e],r=t.body.getReader(),i=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),s=i?parseInt(i):0,a=0!==s;let o=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{o+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw new ju(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{Gu.add(e,t);const n=Hu[e];delete Hu[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=Hu[e];if(void 0===n)throw this.manager.itemError(e),t;delete Hu[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Xu extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Wu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Nu.parse(e[n]);t.push(r)}return t}}class Yu extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=[],a=new Oc,o=new Wu(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials);let l=0;function c(c){o.load(e[c],(function(e){const n=i.parse(e,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=Ae),a.image=s,a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(Array.isArray(e))for(let h=0,u=e.length;h<u;++h)c(h);else o.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)s[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),s[t].format=n.format,s[t].width=n.width,s[t].height=n.height}a.image=s}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=Ae),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a}}class qu extends Vu{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Gu.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a=Gn("img");function o(){c(),Gu.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class Ku extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=new Ls,s=new qu(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function o(n){s.load(e[n],(function(e){i.images[n]=e,a++,6===a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let l=0;l<e.length;++l)o(l);return i}}class Ju extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new ic,a=new Wu(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?s.image=n.image:void 0!==n.data&&(s.image.width=n.width,s.image.height=n.height,s.image.data=n.data),s.wrapS=void 0!==n.wrapS?n.wrapS:he,s.wrapT=void 0!==n.wrapT?n.wrapT:he,s.magFilter=void 0!==n.magFilter?n.magFilter:Ae,s.minFilter=void 0!==n.minFilter?n.minFilter:Ae,s.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace?s.colorSpace=n.colorSpace:void 0!==n.encoding&&(s.encoding=n.encoding),void 0!==n.flipY&&(s.flipY=n.flipY),void 0!==n.format&&(s.format=n.format),void 0!==n.type&&(s.type=n.type),void 0!==n.mipmaps&&(s.mipmaps=n.mipmaps,s.minFilter=xe),1===n.mipmapCount&&(s.minFilter=Ae),void 0!==n.generateMipmaps&&(s.generateMipmaps=n.generateMipmaps),s.needsUpdate=!0,t&&t(s,n))}),n,r),s}}class Zu extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=new tr,s=new qu(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class $u extends ui{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Bi(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}}class ed extends $u{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(ui.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Bi(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const td=new Gr,nd=new hr,rd=new hr;class id{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ln(512,512),this.map=null,this.mapPass=null,this.matrix=new Gr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qs,this._frameExtents=new Ln(1,1),this._viewportCount=1,this._viewports=[new nr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;nd.setFromMatrixPosition(e.matrixWorld),t.position.copy(nd),rd.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(rd),t.updateMatrixWorld(),td.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(td),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(td)}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 sd extends id{constructor(){super(new Rs(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*_n*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class ad extends $u{constructor(e,t,n=0,r=Math.PI/3,i=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ui.DEFAULT_UP),this.updateMatrix(),this.target=new ui,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new sd}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 od=new Gr,ld=new hr,cd=new hr;class hd extends id{constructor(){super(new Rs(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ln(4,2),this._viewportCount=6,this._viewports=[new nr(2,1,1,1),new nr(0,1,1,1),new nr(3,1,1,1),new nr(1,1,1,1),new nr(3,0,1,1),new nr(1,0,1,1)],this._cubeDirections=[new hr(1,0,0),new hr(-1,0,0),new hr(0,0,1),new hr(0,0,-1),new hr(0,1,0),new hr(0,-1,0)],this._cubeUps=[new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,1,0),new hr(0,0,1),new hr(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),ld.setFromMatrixPosition(e.matrixWorld),n.position.copy(ld),cd.copy(n.position),cd.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(cd),n.updateMatrixWorld(),r.makeTranslation(-ld.x,-ld.y,-ld.z),od.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(od)}}class ud extends $u{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new hd}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 dd extends id{constructor(){super(new na(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class pd extends $u{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ui.DEFAULT_UP),this.updateMatrix(),this.target=new ui,this.shadow=new dd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class fd extends $u{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class md extends $u{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class gd{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new hr)}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 n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],n*i*1.092548),t.addScaledVector(s[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*n*i),t.addScaledVector(s[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],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 n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class Ad extends $u{constructor(e=new gd,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 vd extends Vu{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,s=new Wu(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=vd.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new Bi).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const i in e.uniforms){const t=e.uniforms[i];switch(r.uniforms[i]={},t.type){case"t":r.uniforms[i].value=n(t.value);break;case"c":r.uniforms[i].value=(new Bi).setHex(t.value);break;case"v2":r.uniforms[i].value=(new Ln).fromArray(t.value);break;case"v3":r.uniforms[i].value=(new hr).fromArray(t.value);break;case"v4":r.uniforms[i].value=(new nr).fromArray(t.value);break;case"m3":r.uniforms[i].value=(new Fn).fromArray(t.value);break;case"m4":r.uniforms[i].value=(new Gr).fromArray(t.value);break;default:r.uniforms[i].value=t.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new Ln).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Ln).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:cu,SpriteMaterial:Rl,RawShaderMaterial:hu,ShaderMaterial:Is,PointsMaterial:Tc,MeshPhysicalMaterial:du,MeshStandardMaterial:uu,MeshPhongMaterial:pu,MeshToonMaterial:fu,MeshNormalMaterial:mu,MeshLambertMaterial:gu,MeshDepthMaterial:ll,MeshDistanceMaterial:cl,MeshBasicMaterial:Pi,MeshMatcapMaterial:Au,LineDashedMaterial:vu,LineBasicMaterial:Ac,Material:wi}[e]}}class yd{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(n){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class xd extends is{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class bd extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Wu(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],s=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers,i=r[t],s=new Uint32Array(i).buffer;return n[t]=s,s}(e,i.buffer),a=kn(i.type,s),o=new Tl(a,i.stride);return o.uuid=i.uuid,t[r]=o,o}const i=e.isInstancedBufferGeometry?new xd:new is,s=e.data.index;if(void 0!==s){const e=kn(s.type,s.array);i.setIndex(new Gi(e,1))}const a=e.data.attributes;for(const h in a){const t=a[h];let n;if(t.isInterleavedBufferAttribute){const i=r(e.data,t.data);n=new Bl(i,t.itemSize,t.offset,t.normalized)}else{const e=kn(t.type,t.array);n=new(t.isInstancedBufferAttribute?lc:Gi)(e,t.itemSize,t.normalized)}void 0!==t.name&&(n.name=t.name),void 0!==t.usage&&n.setUsage(t.usage),void 0!==t.updateRange&&(n.updateRange.offset=t.updateRange.offset,n.updateRange.count=t.updateRange.count),i.setAttribute(h,n)}const o=e.data.morphAttributes;if(o)for(const h in o){const t=o[h],n=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];let a;if(s.isInterleavedBufferAttribute){const t=r(e.data,s.data);a=new Bl(t,s.itemSize,s.offset,s.normalized)}else{const e=kn(s.type,s.array);a=new Gi(e,s.itemSize,s.normalized)}void 0!==s.name&&(a.name=s.name),n.push(a)}i.morphAttributes[h]=n}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let h=0,u=l.length;h!==u;++h){const e=l[h];i.addGroup(e.start,e.count,e.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new hr;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new Rr(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class Ed extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===this.path?yd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new Wu(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){let s=null;try{s=JSON.parse(n)}catch(o){return void 0!==r&&r(o),void console.error("THREE:ObjectLoader: Can't parse "+e+".",o.message)}const a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(s,t)}),n,r)}async loadAsync(e,t){const n=""===this.path?yd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new Wu(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),s=JSON.parse(i),a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,i,o,a,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in s)if(s[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,s),o=this.parseObject(e.object,r,a,s,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new xh).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let i=0,s=e.length;i<s;i++){const t=(new oc).fromJSON(e[i],r);n[t.uuid]=t}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new bd;for(let i=0,s=e.length;i<s;i++){let s;const a=e[i];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(a);break;default:a.type in lu?s=lu[a.type].fromJSON(a,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${a.type}"`)}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.userData&&(s.userData=a.userData),n[a.uuid]=s}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new vd;i.setTextures(t);for(let t=0,s=e.length;t<s;t++){const s=e[t];void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=Nu.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function s(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:kn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new zu(t);i=new qu(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=s(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new ic(n.data,n.width,n.height)))}r[n.uuid]=new Zn(e)}else{const e=s(n.url);r[n.uuid]=new Zn(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"==typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:kn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new qu(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.url;if(Array.isArray(s)){const e=[];for(let t=0,n=s.length;t<n;t++){const n=s[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new ic(r.data,r.width,r.height)))}n[r.uuid]=new Zn(e)}else{const e=await i(r.url);n[r.uuid]=new Zn(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,s=e.length;i<s;i++){const s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const a=t[s.image],o=a.data;let l;Array.isArray(o)?(l=new Ls,6===o.length&&(l.needsUpdate=!0)):(l=o&&o.data?new ic:new tr,o&&(l.needsUpdate=!0)),l.source=a,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=n(s.mapping,_d)),void 0!==s.channel&&(l.channel=s.channel),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=n(s.wrap[0],Sd),l.wrapT=n(s.wrap[1],Sd)),void 0!==s.format&&(l.format=s.format),void 0!==s.internalFormat&&(l.internalFormat=s.internalFormat),void 0!==s.type&&(l.type=s.type),void 0!==s.colorSpace&&(l.colorSpace=s.colorSpace),void 0!==s.encoding&&(l.encoding=s.encoding),void 0!==s.minFilter&&(l.minFilter=n(s.minFilter,wd)),void 0!==s.magFilter&&(l.magFilter=n(s.magFilter,wd)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.generateMipmaps&&(l.generateMipmaps=s.generateMipmaps),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(l.userData=s.userData),r[s.uuid]=l}return r}parseObject(e,t,n,r,i){let s,a,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function h(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":s=new Cl,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new Bi(e.background):s.background=h(e.background)),void 0!==e.environment&&(s.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Ml(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new wl(e.fog.color,e.fog.density))),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":s=new Rs(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new na(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new fd(e.color,e.intensity);break;case"DirectionalLight":s=new pd(e.color,e.intensity);break;case"PointLight":s=new ud(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new md(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new ad(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new ed(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new Ad).fromJSON(e);break;case"SkinnedMesh":a=l(e.geometry),o=c(e.material),s=new nc(a,o),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":a=l(e.geometry),o=c(e.material),s=new Es(a,o);break;case"InstancedMesh":a=l(e.geometry),o=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;s=new gc(a,o,t),s.instanceMatrix=new lc(new Float32Array(n.array),16),void 0!==r&&(s.instanceColor=new lc(new Float32Array(r.array),r.itemSize));break;case"LOD":s=new ql;break;case"Line":s=new _c(l(e.geometry),c(e.material));break;case"LineLoop":s=new Cc(l(e.geometry),c(e.material));break;case"LineSegments":s=new Mc(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Dc(l(e.geometry),c(e.material));break;case"Sprite":s=new jl(c(e.material));break;case"Group":s=new ml;break;case"Bone":s=new rc;break;default:s=new ui}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const a=e.children;for(let e=0;e<a.length;e++)s.add(this.parseObject(a[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];s.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=s.getObjectByProperty("uuid",n.object);void 0!==r&&s.addLevel(r,n.distance,n.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}}const _d={UVMapping:re,CubeReflectionMapping:ie,CubeRefractionMapping:se,EquirectangularReflectionMapping:ae,EquirectangularRefractionMapping:oe,CubeUVReflectionMapping:le},Sd={RepeatWrapping:ce,ClampToEdgeWrapping:he,MirroredRepeatWrapping:ue},wd={NearestFilter:de,NearestMipmapNearestFilter:pe,NearestMipmapLinearFilter:me,LinearFilter:Ae,LinearMipmapNearestFilter:ve,LinearMipmapLinearFilter:xe};class Md extends Vu{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Gu.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Gu.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}let Cd;class Td{static getContext(){return void 0===Cd&&(Cd=new(window.AudioContext||window.webkitAudioContext)),Cd}static setContext(e){Cd=e}}class Id extends Vu{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new Wu(this.manager);function a(t){r?r(t):console.error(t),i.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){try{const n=e.slice(0);Td.getContext().decodeAudioData(n,(function(e){t(e)}),a)}catch(n){a(n)}}),n,r)}}class Bd extends Ad{constructor(e,t,n=1){super(void 0,n),this.isHemisphereLightProbe=!0;const r=(new Bi).set(e),i=(new Bi).set(t),s=new hr(r.r,r.g,r.b),a=new hr(i.r,i.g,i.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(o),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(l)}}class Rd extends Ad{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const n=(new Bi).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const Pd=new Gr,Dd=new Gr,Ld=new Gr;class Fd{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Rs,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Rs,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ld.copy(e.projectionMatrix);const n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(En*t.fov*.5)/t.zoom;let s,a;Dd.elements[12]=-n,Pd.elements[12]=n,s=-i*t.aspect+r,a=i*t.aspect+r,Ld.elements[0]=2*t.near/(a-s),Ld.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(Ld),s=-i*t.aspect-r,a=i*t.aspect-r,Ld.elements[0]=2*t.near/(a-s),Ld.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(Ld)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Dd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Pd)}}class Ud{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Od(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Od();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Od(){return("undefined"==typeof performance?Date:performance).now()}const Nd=new hr,kd=new cr,Gd=new hr,zd=new hr;class Qd extends ui{constructor(){super(),this.type="AudioListener",this.context=Td.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ud}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Nd,kd,Gd),zd.set(0,0,-1).applyQuaternion(kd),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Nd.x,e),t.positionY.linearRampToValueAtTime(Nd.y,e),t.positionZ.linearRampToValueAtTime(Nd.z,e),t.forwardX.linearRampToValueAtTime(zd.x,e),t.forwardY.linearRampToValueAtTime(zd.y,e),t.forwardZ.linearRampToValueAtTime(zd.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(Nd.x,Nd.y,Nd.z),t.setOrientation(zd.x,zd.y,zd.z,n.x,n.y,n.z)}}class Vd extends ui{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Hd=new hr,jd=new cr,Wd=new hr,Xd=new hr;class Yd extends Vd{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Hd,jd,Wd),Xd.set(0,0,1).applyQuaternion(jd);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Hd.x,e),t.positionY.linearRampToValueAtTime(Hd.y,e),t.positionZ.linearRampToValueAtTime(Hd.z,e),t.orientationX.linearRampToValueAtTime(Xd.x,e),t.orientationY.linearRampToValueAtTime(Xd.y,e),t.orientationZ.linearRampToValueAtTime(Xd.z,e)}else t.setPosition(Hd.x,Hd.y,Hd.z),t.setOrientation(Xd.x,Xd.y,Xd.z)}}class qd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class Kd{constructor(e,t,n){let r,i,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==r;++e)n[i+e]=n[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let o=t,l=t+t;o!==l;++o)if(n[o]!==n[o+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let i=n,s=r;i!==s;++i)t[i]=t[r+i%n];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 n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let s=0;s!==i;++s)e[t+s]=e[n+s]}_slerp(e,t,n,r){cr.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const s=this._workIndex*i;cr.multiplyQuaternionsFlat(e,s,e,t,e,n),cr.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,n,r,i){const s=1-r;for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]*s+e[n+a]*r}}_lerpAdditive(e,t,n,r,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[n+s]*r}}}const Jd="\\[\\]\\.:\\/",Zd=new RegExp("["+Jd+"]","g"),$d="[^"+Jd+"]",ep="[^"+Jd.replace("\\.","")+"]",tp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",$d)+/(WCOD+)?/.source.replace("WCOD",ep)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",$d)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",$d)+"$"),np=["material","materials","bones","map"];class rp{constructor(e,t,n){this.path=t,this.parsedPath=n||rp.parseTrackName(t),this.node=rp.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new rp.Composite(e,t,n):new rp(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Zd,"")}static parseTrackName(e){const t=tp.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==np.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const s=n(i.children);if(s)return s}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=rp.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const s=e[r];if(void 0===s){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}rp.Composite=class{constructor(e,t,n){const r=n||rp.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},rp.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},rp.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},rp.prototype.GetterByBindingType=[rp.prototype._getValue_direct,rp.prototype._getValue_array,rp.prototype._getValue_arrayElement,rp.prototype._getValue_toArray],rp.prototype.SetterByBindingTypeAndVersioning=[[rp.prototype._setValue_direct,rp.prototype._setValue_direct_setNeedsUpdate,rp.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[rp.prototype._setValue_array,rp.prototype._setValue_array_setNeedsUpdate,rp.prototype._setValue_array_setMatrixWorldNeedsUpdate],[rp.prototype._setValue_arrayElement,rp.prototype._setValue_arrayElement_setNeedsUpdate,rp.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[rp.prototype._setValue_fromArray,rp.prototype._setValue_fromArray_setNeedsUpdate,rp.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ip{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Sn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,s=i.length;let a,o=e.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=t[u];if(void 0===d){d=o++,t[u]=d,e.push(h);for(let e=0,t=s;e!==t;++e)i[e].push(new rp(h,n[e],r[e]))}else if(d<l){a=e[d];const o=--l,c=e[o];t[c.uuid]=d,e[d]=c,t[u]=o,e[o]=h;for(let e=0,t=s;e!==t;++e){const t=i[e],s=t[o];let a=t[d];t[d]=s,void 0===a&&(a=new rp(h,n[e],r[e])),t[o]=a}}else e[d]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s],o=a.uuid,l=t[o];if(void 0!==l&&l>=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[o]=s,e[s]=a;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[s],i=t[l];t[l]=r,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,s=e.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<i){const a=--i,o=e[a],c=--s,h=e[c];t[o.uuid]=l,e[l]=o,t[h.uuid]=a,e[a]=h,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[c];t[l]=r,t[a]=i,t.pop()}}else{const i=--s,a=e[i];i>0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);r=i.length,n[e]=r,s.push(e),a.push(t),i.push(h);for(let u=c,d=o.length;u!==d;++u){const n=o[u];h[u]=new rp(n,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];t[e[a]]=n,s[n]=o,s.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}class sp{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,s=i.length,a=new Array(s),o={endingStart:Mt,endingEnd:Mt};for(let l=0;l!==s;++l){const e=i[l].createInterpolant(null);a[l]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,s=n/r;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=i,o[1]=i+n,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);const s=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Bt)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(s),t[n].accumulateAdditive(a);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(s),t[n].accumulate(r,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const s=n===Et;if(0===e)return-1===i?r:s&&1==(1&i)?t-r:r;if(n===xt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(s&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Ct,r.endingEnd=Ct):(r.endingStart=e?this.zeroSlopeAtStart?Ct:Mt:Tt,r.endingEnd=t?this.zeroSlopeAtEnd?Ct:Mt:Tt)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let s=this._weightInterpolant;null===s&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=i,o[0]=t,a[1]=i+e,o[1]=n,this}}const ap=new Float32Array(1);class op extends yn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,s=e._propertyBindings,a=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let h=0;h!==i;++h){const e=r[h],i=e.name;let l=c[i];if(void 0!==l)++l.referenceCount,s[h]=l;else{if(l=s[h],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,o,i));continue}const r=t&&t._propertyBindings[h].binding.parsedPath;l=new Kd(rp.create(n,i,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,o,i),s[h]=l}a[h].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}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<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let s=i[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,s=this._actionsByClip,a=s[i],o=a.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;delete a.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete s[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const e=t[n];0==--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let s=r[t];void 0===s&&(s={},r[t]=s),s[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,s=this._bindingsByRootAndName,a=s[r],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete a[i],0===Object.keys(a).length&&delete s[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new Tu(new Float32Array(2),new Float32Array(2),1,ap),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let s="string"==typeof e?Nu.findByName(r,e):e;const a=null!==s?s.uuid:e,o=this._actionsByClip[a];let l=null;if(void 0===n&&(n=null!==s?s.blendMode:It),void 0!==o){const e=o.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=o.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new sp(this,s,t,n);return this._bindAction(c,l),this._addInactiveAction(c,a,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?Nu.findByName(n,e):e,s=i?i.uuid:e,a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let l=0;l!==n;++l){t[l]._update(r,e,i,s)}const a=this._bindings,o=this._nActiveBindings;for(let l=0;l!==o;++l)a[l].apply(s);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,s=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,s._cacheIndex=i,t[i]=s,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const i in n){const e=n[i].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const i in r){const e=r[i];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class lp{constructor(e){this.value=e}clone(){return new lp(void 0===this.value.clone?this.value:this.value.clone())}}let cp=0;class hp extends yn{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:cp++}),this.name="",this.usage=on,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,r=t.length;n<r;n++)this.uniforms.push(t[n].clone());return this}clone(){return(new this.constructor).copy(this)}}class up extends Tl{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class dp{constructor(e,t,n,r,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class pp{constructor(e,t,n=0,r=1/0){this.ray=new kr(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Jr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return mp(e,this,n,t),n.sort(fp),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)mp(e[r],this,n,t);return n.sort(fp),n}}function fp(e,t){return e.distance-t.distance}function mp(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)mp(r[e],t,n,!0)}}class gp{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(wn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Ap{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const vp=new Ln;class yp{constructor(e=new Ln(1/0,1/0),t=new Ln(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=vp.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}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}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))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vp).distanceTo(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}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 xp=new hr,bp=new hr;class Ep{constructor(e=new hr,t=new hr){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xp.subVectors(e,this.start),bp.subVectors(this.end,this.start);const n=bp.dot(bp);let r=bp.dot(xp)/n;return t&&(r=wn(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const _p=new hr;class Sp extends ui{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new is,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,o=32;s<o;s++,a++){const e=s/o*Math.PI*2,t=a/o*Math.PI*2;r.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}n.setAttribute("position",new qi(r,3));const i=new Ac({fog:!1,toneMapped:!1});this.cone=new Mc(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_p.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_p),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const wp=new hr,Mp=new Gr,Cp=new Gr;class Tp extends Mc{constructor(e){const t=Ip(e),n=new is,r=[],i=[],s=new Bi(0,0,1),a=new Bi(0,1,0);for(let o=0;o<t.length;o++){const e=t[o];e.parent&&e.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(s.r,s.g,s.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new qi(r,3)),n.setAttribute("color",new qi(i,3));super(n,new Ac({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");Cp.copy(this.root.matrixWorld).invert();for(let i=0,s=0;i<t.length;i++){const e=t[i];e.parent&&e.parent.isBone&&(Mp.multiplyMatrices(Cp,e.matrixWorld),wp.setFromMatrixPosition(Mp),r.setXYZ(s,wp.x,wp.y,wp.z),Mp.multiplyMatrices(Cp,e.parent.matrixWorld),wp.setFromMatrixPosition(Mp),r.setXYZ(s+1,wp.x,wp.y,wp.z),s+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function Ip(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,Ip(e.children[n]));return t}class Bp extends Es{constructor(e,t,n){super(new tu(t,4,2),new Pi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Rp=new hr,Pp=new Bi,Dp=new Bi;class Lp extends ui{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new Zh(t);r.rotateY(.5*Math.PI),this.material=new Pi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),s=new Float32Array(3*i.count);r.setAttribute("color",new Gi(s,3)),this.add(new Es(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Pp.copy(this.light.color),Dp.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?Pp:Dp;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Rp.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Fp extends Mc{constructor(e=10,t=10,n=4473924,r=8947848){n=new Bi(n),r=new Bi(r);const i=t/2,s=e/t,a=e/2,o=[],l=[];for(let h=0,u=0,d=-a;h<=t;h++,d+=s){o.push(-a,0,d,a,0,d),o.push(d,0,-a,d,0,a);const e=h===i?n:r;e.toArray(l,u),u+=3,e.toArray(l,u),u+=3,e.toArray(l,u),u+=3,e.toArray(l,u),u+=3}const c=new is;c.setAttribute("position",new qi(o,3)),c.setAttribute("color",new qi(l,3));super(c,new Ac({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Up extends Mc{constructor(e=10,t=16,n=8,r=64,i=4473924,s=8947848){i=new Bi(i),s=new Bi(s);const a=[],o=[];if(t>1)for(let c=0;c<t;c++){const n=c/t*(2*Math.PI),r=Math.sin(n)*e,l=Math.cos(n)*e;a.push(0,0,0),a.push(r,0,l);const h=1&c?i:s;o.push(h.r,h.g,h.b),o.push(h.r,h.g,h.b)}for(let c=0;c<n;c++){const t=1&c?i:s,l=e-e/n*c;for(let e=0;e<r;e++){let n=e/r*(2*Math.PI),i=Math.sin(n)*l,s=Math.cos(n)*l;a.push(i,0,s),o.push(t.r,t.g,t.b),n=(e+1)/r*(2*Math.PI),i=Math.sin(n)*l,s=Math.cos(n)*l,a.push(i,0,s),o.push(t.r,t.g,t.b)}}const l=new is;l.setAttribute("position",new qi(a,3)),l.setAttribute("color",new qi(o,3));super(l,new Ac({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Op=new hr,Np=new hr,kp=new hr;class Gp extends ui{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===t&&(t=1);let r=new is;r.setAttribute("position",new qi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new Ac({fog:!1,toneMapped:!1});this.lightPlane=new _c(r,i),this.add(this.lightPlane),r=new is,r.setAttribute("position",new qi([0,0,0,0,0,1],3)),this.targetLine=new _c(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Op.setFromMatrixPosition(this.light.matrixWorld),Np.setFromMatrixPosition(this.light.target.matrixWorld),kp.subVectors(Np,Op),this.lightPlane.lookAt(Np),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Np),this.targetLine.scale.z=kp.length()}}const zp=new hr,Qp=new Bs;class Vp extends Mc{constructor(e){const t=new is,n=new Ac({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],s={};function a(e,t){o(e),o(t)}function o(e){r.push(0,0,0),i.push(0,0,0),void 0===s[e]&&(s[e]=[]),s[e].push(r.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),t.setAttribute("position",new qi(r,3)),t.setAttribute("color",new qi(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new Bi(16755200),c=new Bi(16711680),h=new Bi(43775),u=new Bi(16777215),d=new Bi(3355443);this.setColors(l,c,h,u,d)}setColors(e,t,n,r,i){const s=this.geometry.getAttribute("color");s.setXYZ(0,e.r,e.g,e.b),s.setXYZ(1,e.r,e.g,e.b),s.setXYZ(2,e.r,e.g,e.b),s.setXYZ(3,e.r,e.g,e.b),s.setXYZ(4,e.r,e.g,e.b),s.setXYZ(5,e.r,e.g,e.b),s.setXYZ(6,e.r,e.g,e.b),s.setXYZ(7,e.r,e.g,e.b),s.setXYZ(8,e.r,e.g,e.b),s.setXYZ(9,e.r,e.g,e.b),s.setXYZ(10,e.r,e.g,e.b),s.setXYZ(11,e.r,e.g,e.b),s.setXYZ(12,e.r,e.g,e.b),s.setXYZ(13,e.r,e.g,e.b),s.setXYZ(14,e.r,e.g,e.b),s.setXYZ(15,e.r,e.g,e.b),s.setXYZ(16,e.r,e.g,e.b),s.setXYZ(17,e.r,e.g,e.b),s.setXYZ(18,e.r,e.g,e.b),s.setXYZ(19,e.r,e.g,e.b),s.setXYZ(20,e.r,e.g,e.b),s.setXYZ(21,e.r,e.g,e.b),s.setXYZ(22,e.r,e.g,e.b),s.setXYZ(23,e.r,e.g,e.b),s.setXYZ(24,t.r,t.g,t.b),s.setXYZ(25,t.r,t.g,t.b),s.setXYZ(26,t.r,t.g,t.b),s.setXYZ(27,t.r,t.g,t.b),s.setXYZ(28,t.r,t.g,t.b),s.setXYZ(29,t.r,t.g,t.b),s.setXYZ(30,t.r,t.g,t.b),s.setXYZ(31,t.r,t.g,t.b),s.setXYZ(32,n.r,n.g,n.b),s.setXYZ(33,n.r,n.g,n.b),s.setXYZ(34,n.r,n.g,n.b),s.setXYZ(35,n.r,n.g,n.b),s.setXYZ(36,n.r,n.g,n.b),s.setXYZ(37,n.r,n.g,n.b),s.setXYZ(38,r.r,r.g,r.b),s.setXYZ(39,r.r,r.g,r.b),s.setXYZ(40,i.r,i.g,i.b),s.setXYZ(41,i.r,i.g,i.b),s.setXYZ(42,i.r,i.g,i.b),s.setXYZ(43,i.r,i.g,i.b),s.setXYZ(44,i.r,i.g,i.b),s.setXYZ(45,i.r,i.g,i.b),s.setXYZ(46,i.r,i.g,i.b),s.setXYZ(47,i.r,i.g,i.b),s.setXYZ(48,i.r,i.g,i.b),s.setXYZ(49,i.r,i.g,i.b),s.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;Qp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Hp("c",t,e,Qp,0,0,-1),Hp("t",t,e,Qp,0,0,1),Hp("n1",t,e,Qp,-1,-1,-1),Hp("n2",t,e,Qp,1,-1,-1),Hp("n3",t,e,Qp,-1,1,-1),Hp("n4",t,e,Qp,1,1,-1),Hp("f1",t,e,Qp,-1,-1,1),Hp("f2",t,e,Qp,1,-1,1),Hp("f3",t,e,Qp,-1,1,1),Hp("f4",t,e,Qp,1,1,1),Hp("u1",t,e,Qp,.7,1.1,-1),Hp("u2",t,e,Qp,-.7,1.1,-1),Hp("u3",t,e,Qp,0,2,-1),Hp("cf1",t,e,Qp,-1,0,1),Hp("cf2",t,e,Qp,1,0,1),Hp("cf3",t,e,Qp,0,-1,1),Hp("cf4",t,e,Qp,0,1,1),Hp("cn1",t,e,Qp,-1,0,-1),Hp("cn2",t,e,Qp,1,0,-1),Hp("cn3",t,e,Qp,0,-1,-1),Hp("cn4",t,e,Qp,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Hp(e,t,n,r,i,s,a){zp.set(i,s,a).unproject(r);const o=t[e];if(void 0!==o){const e=n.getAttribute("position");for(let t=0,n=o.length;t<n;t++)e.setXYZ(o[t],zp.x,zp.y,zp.z)}}const jp=new pr;class Wp extends Mc{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new is;i.setIndex(new Gi(n,1)),i.setAttribute("position",new Gi(r,3)),super(i,new Ac({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&jp.setFromObject(this.object),jp.isEmpty())return;const t=jp.min,n=jp.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Xp extends Mc{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new is;r.setIndex(new Gi(n,1)),r.setAttribute("position",new qi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new Ac({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yp extends _c{constructor(e,t=1,n=16776960){const r=n,i=new is;i.setAttribute("position",new qi([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new Ac({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new is;s.setAttribute("position",new qi([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new Es(s,new Pi({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const qp=new hr;let Kp,Jp;class Zp extends ui{constructor(e=new hr(0,0,1),t=new hr(0,0,0),n=1,r=16776960,i=.2*n,s=.2*i){super(),this.type="ArrowHelper",void 0===Kp&&(Kp=new is,Kp.setAttribute("position",new qi([0,0,0,0,1,0],3)),Jp=new uh(0,.5,1,5,1),Jp.translate(0,-.5,0)),this.position.copy(t),this.line=new _c(Kp,new Ac({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Es(Jp,new Pi({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{qp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(qp,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class $p extends Mc{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new is;n.setAttribute("position",new qi(t,3)),n.setAttribute("color",new qi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new Ac({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Bi,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ef{constructor(){this.type="ShapePath",this.color=new Bi,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new oh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],a=t[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[s],o=-o,a=t[i],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const n=Wh.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,s,a;const o=[];if(1===r.length)return s=r[0],a=new xh,a.curves=s.curves,o.push(a),o;let l=!n(r[0].getPoints());l=e?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let m=0,g=r.length;m<g;m++)s=r[m],u=s.getPoints(),i=n(u),i=e?!i:i,i?(!l&&h[f]&&f++,h[f]={s:new xh,p:u},h[f].s.curves=s.curves,l&&f++,p[f]=[]):p[f].push({h:s,p:u[0]});if(!h[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new xh;i.curves=r.curves,t.push(i)}return t}(r);if(h.length>1){let e=!1,n=0;for(let t=0,r=h.length;t<r;t++)c[t]=[];for(let r=0,i=h.length;r<i;r++){const i=p[r];for(let s=0;s<i.length;s++){const a=i[s];let o=!0;for(let i=0;i<h.length;i++)t(a.p,h[i].p)&&(r!==i&&n++,o?(o=!1,c[i].push(a)):e=!0);o&&c[r].push(a)}}n>0&&!1===e&&(p=c)}for(let m=0,g=h.length;m<g;m++){a=h[m].s,o.push(a),d=p[m];for(let e=0,t=d.length;e<t;e++)a.holes.push(d[e].h)}return o}}class tf extends Ss{constructor(e,t,n,r,i,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,n,r,i,s)}}class nf extends ch{constructor(e,t,n,r){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,n,r)}}class rf extends hh{constructor(e,t,n,r){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,n,r)}}class sf extends dh{constructor(e,t,n,r,i,s,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,n,r,i,s,a)}}class af extends uh{constructor(e,t,n,r,i,s,a,o){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,n,r,i,s,a,o)}}class of extends fh{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class lf extends qh{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class cf extends Jh{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class hf extends lh{constructor(e,t,n,r){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,n,r)}}class uf extends Zh{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class df extends js{constructor(e,t,n,r){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,n,r)}}class pf extends ph{constructor(e,t,n,r){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,n,r)}}class ff extends $h{constructor(e,t,n,r,i,s){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,n,r,i,s)}}class mf extends eu{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class gf extends tu{constructor(e,t,n,r,i,s,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,n,r,i,s,a)}}class Af extends nu{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class vf extends ru{constructor(e,t,n,r,i){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,n,r,i)}}class yf extends iu{constructor(e,t,n,r,i,s){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,n,r,i,s)}}class xf extends su{constructor(e,t,n,r,i){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,n,r,i)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r)}}]);