a3js 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/a3js.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Br=Object.create;var xn=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Rr=Object.getPrototypeOf,vr=Object.prototype.hasOwnProperty;var Qr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wr(e))!vr.call(i,r)&&r!==t&&xn(i,r,{get:()=>e[r],enumerable:!(n=Tr(e,r))||n.enumerable});return i};var kr=(i,e,t)=>(t=i!=null?Br(Rr(i)):{},Qr(e||!i||!i.__esModule?xn(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("three"),Xn=require("fflate");function Sr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const oe=Sr(E);class Ae{x=0;y=0;z=0;constructor(e,t,n){typeof e=="number"?(this.x=e,this.y=t,this.z=n):typeof e>"u"?this.x=this.y=this.z=0:(this.x=e.x,this.y=e.y,this.z=e.z)}clone(){return new Ae(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z}normalize(){const e=this.x*this.x+this.y*this.y+this.z*this.z,t=Math.sqrt(e);return t!==0?(this.x/=t,this.y/=t,this.z/=t):console.warn("Vec3.normalize."),this}negate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}set(e,t,n){return typeof e=="number"?(this.x=e,this.y=t,this.z=n):(this.x=e.x,this.y=e.y,this.z=e.z),this}add(e,t,n){return typeof e=="number"?(this.x+=e,this.y+=t,this.z+=n):(this.x+=e.x,this.y+=e.y,this.z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this.x-=e,this.y-=t,this.z-=n):(this.x-=e.x,this.y-=e.y,this.z-=e.z),this}scale(e){return this.x*=e,this.y*=e,this.z*=e,this}cross(e,t){return 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}apply(e,t,n,r){let o,s,c,A;typeof e=="number"?(o=e,s=t,c=n,A=r):(o=e.x,s=e.y,c=e.z,A=e.w);const a=2*(s*this.z-c*this.y),d=2*(c*this.x-o*this.z),u=2*(o*this.y-s*this.x);return this.x+=A*a+s*u-c*d,this.y+=A*d+c*a-o*u,this.z+=A*u+o*d-s*a,this}lerp(e,t,n){this.x=(1-n)*e.x+n*t.x,this.y=(1-n)*e.y+n*t.y,this.z=(1-n)*e.z+n*t.z}}class Pe{x=0;y=0;z=0;w=1;constructor(e,t,n,r){typeof e=="number"?(this.x=e,this.y=t,this.z=n,this.w=r):typeof e>"u"?(this.x=this.y=this.z=0,this.w=1):(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w)}clone(){return new Pe(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w}normalize(){const e=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w,t=Math.sqrt(e);return t!==0?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):console.warn("Quat.normalize."),this}conjugate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}set(e,t,n,r){return typeof e=="number"?(this.x=e,this.y=t,this.z=n,this.w=r):(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w),this}mul(e,t,n,r){const o=this.x,s=this.y,c=this.z,A=this.w;let a,d,u,m;return typeof e=="number"?(a=e,d=t,u=n,m=r):(a=e.x,d=e.y,u=e.z,m=e.w),this.x=A*a+o*m+s*u-c*d,this.y=A*d-o*u+s*m+c*a,this.z=A*u+o*d-s*a+c*m,this.w=A*m-o*a-s*d-c*u,this}lerp(e,t,n){this.x=(1-n)*e.x+n*t.x,this.y=(1-n)*e.y+n*t.y,this.z=(1-n)*e.z+n*t.z,this.w=(1-n)*e.w+n*t.w}slerp(e,t,n){if(n<0||n>1){console.warn("Quat.slerp(): t must be in [0,1]");return}let r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Ye.set(t),r<0&&(r*=-1,Ye.set(-Ye.x,-Ye.y,-Ye.z,-Ye.w)),r>.9995){this.x=(1-n)*e.x+n*Ye.x,this.y=(1-n)*e.y+n*Ye.y,this.z=(1-n)*e.z+n*Ye.z,this.w=(1-n)*e.w+n*Ye.w;const o=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);o<1e-4?(console.warn("Quat.slerp(); ???!"),this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):(this.x*=1/o,this.y*=1/o,this.z*=1/o,this.w*=1/o)}else{const o=Math.acos(r),s=Math.sin((1-n)*o)/Math.sin(o),c=Math.sin(n*o)/Math.sin(o);this.x=s*e.x+c*Ye.x,this.y=s*e.y+c*Ye.y,this.z=s*e.z+c*Ye.z,this.w=s*e.w+c*Ye.w}}}const Ye=new Pe;function at(i,e,t,n){t.normalize();const r=i.clone().sub(e).normalize(),o=new Ae().cross(r,t).normalize(),s=new Ae().cross(o,r),c=o.x,A=s.x,a=-r.x,d=o.y,u=s.y,m=-r.y,p=o.z,I=s.z,g=-r.z;let l,h,f,C;const b=c+u+g;if(b>0){const R=Math.sqrt(b+1)*2;l=(I-m)/R,h=(a-p)/R,f=(d-A)/R,C=.25*R}else if(c>u&&c>g){const R=Math.sqrt(1+c-u-g)*2;l=.25*R,h=(A+d)/R,f=(a+p)/R,C=(I-m)/R}else if(u>g){const R=Math.sqrt(1+u-c-g)*2;l=(A+d)/R,h=.25*R,f=(m+I)/R,C=(a-p)/R}else{const R=Math.sqrt(1+g-c-u)*2;l=(a+p)/R,h=(m+I)/R,f=.25*R,C=(d-A)/R}const y=n??new Pe;return y.set(l,h,f,C),y}function ut(i,e="ZXY",t){const n=t!==void 0?t.set(0,0,0,1):new Pe(0,0,0,1);for(let r=0;r<3;r++)switch(e.charAt(r)){case"X":n.mul(Math.sin(i.x),0,0,Math.cos(i.x));break;case"Y":n.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":n.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return n}function xr(i){const e=[[],[],[]],t=i.x+i.x,n=i.y+i.y,r=i.z+i.z,o=i.x*t,s=i.x*n,c=i.x*r,A=i.y*n,a=i.y*r,d=i.z*r,u=i.w*t,m=i.w*n,p=i.w*r;return e[0][0]=1-(A+d),e[0][1]=s-p,e[0][2]=c+m,e[1][0]=s+p,e[1][1]=1-(o+d),e[1][2]=a-u,e[2][0]=c-m,e[2][1]=a+u,e[2][2]=1-(o+A),e}const pt=i=>Math.max(-1,Math.min(1,i));function Ln(i,e="ZXY",t){const n=xr(i),r=t??new Ae;let o=0,s=0,c=0;switch(e){case"XYZ":s=Math.asin(pt(n[0][2])),Math.abs(n[0][2])<.9999999?(o=Math.atan2(-n[1][2],n[2][2]),c=Math.atan2(-n[0][1],n[0][0])):(o=Math.atan2(n[2][1],n[1][1]),c=0);break;case"YXZ":o=Math.asin(-pt(n[1][2])),Math.abs(n[1][2])<.9999999?(s=Math.atan2(n[0][2],n[2][2]),c=Math.atan2(n[1][0],n[1][1])):(s=Math.atan2(-n[2][0],n[0][0]),c=0);break;case"ZXY":o=Math.asin(pt(n[2][1])),Math.abs(n[2][1])<.9999999?(s=Math.atan2(-n[2][0],n[2][2]),c=Math.atan2(-n[0][1],n[1][1])):(s=0,c=Math.atan2(n[1][0],n[0][0]));break;case"ZYX":s=Math.asin(-pt(n[2][0])),Math.abs(n[2][0])<.9999999?(o=Math.atan2(n[2][1],n[2][2]),c=Math.atan2(n[1][0],n[0][0])):(o=0,c=Math.atan2(-n[0][1],n[1][1]));break;case"YZX":c=Math.asin(pt(n[1][0])),Math.abs(n[1][0])<.9999999?(o=Math.atan2(-n[1][2],n[1][1]),s=Math.atan2(-n[2][0],n[0][0])):(o=0,s=Math.atan2(n[0][2],n[2][2]));break;case"XZY":c=Math.asin(-pt(n[0][1])),Math.abs(n[0][1])<.9999999?(o=Math.atan2(n[2][1],n[1][1]),s=Math.atan2(n[0][2],n[0][0])):(o=Math.atan2(-n[1][2],n[2][2]),s=0);break}return r.set(o,s,c),r}class qe{loc;quat;scale;constructor(){this.loc=new Ae,this.quat=new Pe,this.scale=new Ae(1,1,1)}set(e){return e instanceof qe?(this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale)):(e.getPosition(this.loc),e.getQuat(this.quat),e.getScale(this.scale)),this}write(e){e instanceof Me?(e.object3D.position.set(this.loc.x,this.loc.y,this.loc.z),e.object3D.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object3D.scale.set(this.scale.x,this.scale.y,this.scale.z)):(e.position.set(this.loc.x,this.loc.y,this.loc.z),e.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.scale.set(this.scale.x,this.scale.y,this.scale.z))}blend(e,t){return this.loc.lerp(this.loc,e.loc,t),this.quat.slerp(this.quat,e.quat,t),this.scale.lerp(this.scale,e.scale,t),this}clone(){const e=new qe;return e.set(this),e}}class Rt{transform;constructor(){this.transform=new qe}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.transform.loc.set(e)}setPositionNow(e){this.transform.loc.set(e)}setQuat(e){this.transform.quat.set(e)}setQuatNow(e){this.transform.quat.set(e)}setScale(e){this.transform.scale.set(e)}setScaleNow(e){this.transform.scale.set(e)}setLinearVelocity(e){}getLinearVelocity(e){return e||new Ae}setAngularVelocity(e){}getAngularVelocity(e){return e||new Ae}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Zn{transform;constructor(){this.transform=new qe}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||new Ae}setAngularVelocity(e){}getAngularVelocity(e){return e||new Ae}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class En{startTransform;transform;endTransform;currentTime;duration;constructor(){this.startTransform=new qe,this.transform=new qe,this.endTransform=new qe,this.currentTime=0,this.duration=1}init(e,t){this.startTransform.set(e),this.transform.set(e),this.endTransform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.startTransform.set(this.transform),this.endTransform.loc.set(e),this.currentTime=0}setPositionNow(e){this.setPosition(e),this.currentTime=1}setQuat(e){this.startTransform.set(this.transform),this.endTransform.quat.set(e),this.currentTime=0}setQuatNow(e){this.setQuat(e),this.currentTime=1}setScale(e){this.startTransform.set(this.transform),this.endTransform.scale.set(e),this.currentTime=0}setScaleNow(e){this.setScale(e),this.currentTime=1}setLinearVelocity(e){}getLinearVelocity(e){e||(e=new Ae);const t=this.endTransform.loc.x-this.startTransform.loc.x,n=this.endTransform.loc.y-this.startTransform.loc.y,r=this.endTransform.loc.z-this.startTransform.loc.z;e.set(t,n,r);const o=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngularVelocity(e){}getAngularVelocity(e){e||(e=new Ae),Ln(this.startTransform.quat,"ZXY",_t),Ln(this.endTransform.quat,"ZXY",Dt),e.set(Dt.x-_t.x,Dt.y-_t.y,Dt.z-_t.z);const t=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*t*t+6*t)/this.duration),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}smoothstep(e){return e*e*(3-2*e)}update(e){this.currentTime+=e,this.currentTime>this.duration&&(this.currentTime=this.duration);const t=this.currentTime/this.duration,n=this.smoothstep(t);this.transform.set(this.startTransform),this.transform.blend(this.endTransform,n)}}const rt=new Ae,Ct=new Ae,dt=new Pe,Lt=new qe,_t=new Ae,Dt=new Ae;class $n extends Rt{up;target;constructor(e){super(),this.up=new Ae(0,1,0),this.target=e}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Me.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){rt.set(this.transform.loc),this.target.getPosition(Ct),at(rt,Ct,this.up,dt),this.transform.quat.set(dt)}}class ei extends En{up;target;constructor(e){super(),this.up=new Ae(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Me.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),rt.set(this.transform.loc),this.target.getPosition(Ct),at(rt,Ct,this.up,dt),this.transform.quat.set(dt)}}const ti={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class ni extends Zn{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...ti,...t},this.target=e,this.lookFrom=new Ae(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Me.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e),rt.set(this.transform.loc),this.target.getPosition(Ct),at(rt,Ct,this.up,dt),dt.mul(0,1,0,0),Lt.quat.set(dt),rt.set(this.lookFrom),rt.apply(this.target.getQuat()),rt.add(this.target.getPosition()),Lt.loc.set(rt),this.transform.loc.lerp(this.transform.loc,Lt.loc,1-this.options.smoothness),this.transform.quat.slerp(this.transform.quat,Lt.quat,1-this.options.smoothness)}}const ii={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function ri(i){return typeof i=="string"}function In(i){return i.isMesh===!0}function Lr(i){return i.type==="RoundedBoxGeometry"}function _r(i){return i.type==="BoxGeometry"}function Dr(i){return i.type==="SphereGeometry"}function Nr(i){return i.type==="IcosahedronGeometry"}function Fr(i){return i.type==="CylinderGeometry"}function Or(i){return i.type==="CapsuleGeometry"}function Mr(i){return i.isBone===!0}function Pr(i){return i.isPerspectiveCamera===!0}let je;const nt=new Map;class vt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!vt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),vt.RAPIER=e,je=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new je.World(e.gravity);return new bn(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class bn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new je.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let n=0;n<t;n++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{const o=nt.get(t),s=nt.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e}}class _n{transform;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...ii,...e},this.transform=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=je.RigidBodyDesc.dynamic();break;case"kinematic":e=je.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=je.RigidBodyDesc.fixed();break}return e.setTranslation(this.transform.loc.x,this.transform.loc.y,this.transform.loc.z),e.setRotation({x:this.transform.quat.x,y:this.transform.quat.y,z:this.transform.quat.z,w:this.transform.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object3D.traverse(r=>{if(In(r)){const o=jr(r.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(je.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(o.colliderDesc),o.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(o.volume);else{let c,A;switch(e.meshCollider){case"tri_mesh":c=Gr(r),A=Dn(r.geometry);break;case"convex_hull":c=Ur(r),A=Dn(r.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(je.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((r,o)=>r+o,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.transform.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat)}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{const n=e.world.createCollider(t,this.body);this.colliders.push(n),this.objectA3&&nt.set(n.handle,this.objectA3)}),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),nt.delete(t.handle)})}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinearVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngularVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}update(e){if(this.body){const t=this.body.translation();this.transform.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.transform.quat.set(n.x,n.y,n.z,n.w)}}}function Gr(i){let e=null;if(In(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let o=n.index?n.index.array:null;if(o)o instanceof Uint32Array||(o=new Uint32Array(o));else{const s=n.attributes.position.count;o=new Uint32Array(s);for(let c=0;c<s;c++)o[c]=c}r instanceof Float32Array&&(e=je.ColliderDesc.trimesh(r,o))}return e}function Ur(i){let e=null;if(In(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=je.ColliderDesc.convexHull(r))}return e}function Dn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const o=new oe.Vector3,s=new oe.Vector3,c=new oe.Vector3;if(t){const A=t.array;for(let a=0;a<A.length;a+=3){const d=A[a]*3,u=A[a+1]*3,m=A[a+2]*3;o.set(n[d],n[d+1],n[d+2]),s.set(n[u],n[u+1],n[u+2]),c.set(n[m],n[m+1],n[m+2]),r+=o.dot(s.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)o.set(n[A],n[A+1],n[A+2]),s.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=o.dot(s.clone().cross(c));return Math.abs(r)/6}function jr(i){if(Lr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:je.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(_r(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:je.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Dr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:je.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Nr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:je.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Fr(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:je.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(Or(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:je.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const cn=new vt;async function Hr(){await cn.init()}const D={v0:new Ae,v1:new Ae,v2:new Ae,v3:new Ae,v4:new Ae,q0:new Pe,q1:new Pe,q2:new Pe,q3:new Pe,q4:new Pe,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function qr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function oi(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Xn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function Ot(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Xn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function ln(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=Vr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const zr={"image/png":/\.png$/i,"image/jpeg":/\.(jpg|jpeg)$/i,"image/gif":/\.gif$/i,"model/vrml":/\.wrl$/i,"application/xml":/\.xml$/i,"application/octet-stream":/\.bvh/i,"audio/x-wav":/\.wav/i,"audio/mpeg":/\.mp3/i,"audio/ogg":/\.ogg/i,"text/plain":/\.(txt|text)$/i,"model/gltf+json":/\.gltf$/i,"model/gltf-binary":/\.glb$/i};function Vr(i){for(const[e,t]of Object.entries(zr))if(t.test(i))return e;return"application/octet-stream"}function Ut(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=Ut(i[n],e[n]):t[n]=e[n];return t}const si={offset:.01,auto:!0,height:1.5,radius:.3};class ai{transform;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;constructor(e={}){this.completeOptions={...si,...e},this.transform=new qe,this.capsuleCenter=new Ae,this.nextLocation=new Ae,this.tmpV1=new Ae,this.tmpV2=new Ae,this.tmpQ1=new Pe}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new oe.Vector3,r=new oe.Quaternion,o=new oe.Object3D;o.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(n),o.position.set(n.x,n.y,n.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.getScale(this.tmpV2),this.tmpV2.write(n),o.scale.set(n.x,n.y,n.z);const s=new oe.Box3().setFromObject(o);o.remove(t.object3D),s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.colliderDesc=je.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.colliderDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w})}addOneselfToPhysics(e){this.controller=e.world.createCharacterController(this.completeOptions.offset),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&nt.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),nt.delete(this.collider.handle))}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.transform.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new Ae),e.set(0,0,0),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new Ae),e.set(0,0,0),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){return this.controller?this.controller.computedGrounded():!1}update(e){if(!this.controller||!this.collider)return;this.transform.quat.set(this.collider.rotation()),this.tmpV1.set(this.collider.translation()),this.tmpV2.set(this.nextLocation),this.tmpV2.sub(this.tmpV1),this.controller.computeColliderMovement(this.collider,this.tmpV2);const t=this.controller.computedMovement();this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.transform.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const Ai={auto:!0,height:1.5,radius:.3};class ci{transform;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;physicsWorld;constructor(e={}){this.completeOptions={...Ai,...e},this.transform=new qe,this.capsuleCenter=new Ae,this.nextLocation=new Ae,this.tmpV1=new Ae,this.tmpV2=new Ae,this.tmpQ1=new Pe}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new oe.Vector3,r=new oe.Quaternion,o=new oe.Object3D;o.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(n),o.position.set(n.x,n.y,n.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.getScale(this.tmpV2),this.tmpV2.write(n),o.scale.set(n.x,n.y,n.z);const s=new oe.Box3().setFromObject(o);s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.bodyDesc=je.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat),this.colliderDesc=je.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&nt.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),nt.delete(this.collider.handle)),this.physicsWorld=void 0}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinearVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngularVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}isGrounded(){if(this.body&&this.physicsWorld){const e=this.body.translation(),t=new je.Ray(e,{x:0,y:-1,z:0}),n=1.1*(this.completeOptions.height+this.completeOptions.radius);return this.physicsWorld.world.castRay(t,n,!0,void 0,void 0,this.collider)!==null}else return this.transform.loc.y<=0}update(e){if(!this.body)return;const t=new Ae(this.body.translation());t.sub(this.capsuleCenter),this.transform.loc.set(t),this.transform.quat.set(this.body.rotation())}}const Kr=new oe.SphereGeometry,Wr=new oe.MeshStandardMaterial({color:16711680});let Yr=new oe.Mesh(Kr,Wr);class Me{static defaultRotationOrder="ZXY";static defaultUpVector=new Ae(0,1,0);rotationOrder;upVector;object3D;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object3D=new oe.Object3D;const t=this.initObject(e);t&&this.object3D.add(t),this.object3D.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return Yr.clone()}initTransformer(e){return new Rt}setTransformer(e){D.t0.set(this.transformer.transform),e.init(D.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t,n){if(e==="Default")this.setTransformer(new Rt);else if(e==="Smooth")this.setTransformer(new En);else if(e==="Follow"){if(!t)throw new Error("ObjectA3.setTransformMode(): Follow mode needs target.");this.setTransformer(new ni(t,n))}else if(e==="Billboard"){if(!t)throw new Error("ObjectA3.setTransformMode(): Billboard mode needs target.");this.setTransformer(new $n(t))}else if(e==="SmoothBillboard"){if(!t)throw new Error("ObjectA3.setTransformMode(): SmoothBillboard mode needs target.");this.setTransformer(new ei(t))}else e==="SimplePhysics"?this.setTransformer(new _n(n)):e==="KinematicCharacter"?this.setTransformer(new ai(n)):e==="DynamicCharacter"&&this.setTransformer(new ci(n))}initSimplePhysics(e){const t={...ii,...e};this.setTransformer(new _n(t))}update(e){this.transformer.update(e),this.transformer.transform.write(this),this.children.forEach(t=>{t.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object3D.add(e.object3D)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object3D.remove(e.object3D)}setSpeechBubble(e){this.balloon?this.balloon.message=e:this.balloon=new Jr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}getPosition(e){return e?(e.set(this.transformer.transform.loc),e):this.transformer.transform.loc.clone()}setPosition(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setPosition(D.v0)}setPositionNow(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setPositionNow(D.v0)}getQuat(e){return e?(e.set(this.transformer.transform.quat),e):this.transformer.transform.quat.clone()}setQuat(e,t,n,r){typeof e=="number"?D.q0.set(e,t,n,r):D.q0.set(e),this.transformer.setQuat(D.q0)}setQuatNow(e,t,n,r){typeof e=="number"?D.q0.set(e,t,n,r):D.q0.set(e),this.transformer.setQuatNow(D.q0)}getScale(e){return e?(e.set(this.transformer.transform.scale),e):this.transformer.transform.scale.clone()}setScale(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setScale(D.v0)}setScaleNow(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setScaleNow(D.v0)}setRotation(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),D.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder;ut(D.v0,r,D.q1),this.setQuat(D.q1)}setRotationNow(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),D.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder;ut(D.v0,r,D.q0),this.setQuatNow(D.q0)}lookAt(e,t,n){typeof e=="number"?D.v1.set(e,t,n):e instanceof Me?D.v1.set(e.transformer.transform.loc):D.v1.set(e);const r=this.upVector?this.upVector:Me.defaultUpVector;at(this.transformer.transform.loc,D.v1,r,D.q1),this.setQuat(D.q1)}lookAtNow(e,t,n){typeof e=="number"?D.v1.set(e,t,n):e instanceof Me?D.v1.set(e.transformer.transform.loc):D.v1.set(e);const r=this.upVector?this.upVector:Me.defaultUpVector;at(this.transformer.transform.loc,D.v1,r,D.q1),this.setQuatNow(D.q1)}getUnitVecX(e){return e?(e.set(1,0,0),e.apply(this.object3D.quaternion)):new Ae(1,0,0).apply(this.object3D.quaternion)}getUnitVecY(e){return e?(e.set(0,1,0),e.apply(this.object3D.quaternion)):new Ae(0,1,0).apply(this.object3D.quaternion)}getUnitVecZ(e){return e?(e.set(0,0,1),e.apply(this.object3D.quaternion)):new Ae(0,0,1).apply(this.object3D.quaternion)}translate(e,t,n){D.v1.set(this.transformer.transform.loc),typeof e=="number"?D.v1.add(e,t,n):D.v1.add(e),this.setPosition(D.v1)}translateNow(e,t,n){D.v1.set(this.transformer.transform.loc),typeof e=="number"?D.v1.add(e,t,n):D.v1.add(e),this.setPositionNow(D.v1)}mulQuat(e,t,n,r){D.q1.set(this.transformer.transform.quat),typeof e=="number"?D.q1.mul(e,t,n,r):D.q1.mul(e),this.setQuat(D.q1)}mulQuatNow(e,t,n,r){D.q1.set(this.transformer.transform.quat),typeof e=="number"?D.q1.mul(e,t,n,r):D.q1.mul(e),this.setQuatNow(D.q1)}mulRotation(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),D.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder;ut(D.v0,r,D.q1),this.getQuat(D.q0),D.q0.mul(D.q1),this.setQuat(D.q0)}mulRotationNow(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),D.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder;ut(D.v0,r,D.q1),this.getQuat(D.q0),D.q0.mul(D.q1),this.setQuatNow(D.q0)}scaleBy(e,t,n){this.getScale(D.v0),typeof e=="number"?D.v0.set(D.v0.x*e,D.v0.y*t,D.v0.z*n):D.v0.set(D.v0.x*e.x,D.v0.y*e.y,D.v0.z*e.z),this.setScale(D.v0)}mulScaleNow(e,t,n){this.getScale(D.v0),typeof e=="number"?D.v0.set(D.v0.x*e,D.v0.y*t,D.v0.z*n):D.v0.set(D.v0.x*e.x,D.v0.y*e.y,D.v0.z*e.z),this.setScaleNow(D.v0)}moveForward(e){this.getUnitVecZ(D.v0),D.v0.scale(e),this.translate(D.v0)}moveForwardNow(e){this.getUnitVecZ(D.v0),D.v0.scale(e),this.translateNow(D.v0)}moveBackward(e){this.getUnitVecZ(D.v0),D.v0.scale(-e),this.translate(D.v0)}moveBackwardNow(e){this.getUnitVecZ(D.v0),D.v0.scale(-e),this.translateNow(D.v0)}moveRight(e){this.getUnitVecX(D.v0),D.v0.scale(-e),this.translate(D.v0)}moveRightNow(e){this.getUnitVecX(D.v0),D.v0.scale(-e),this.translateNow(D.v0)}moveLeft(e){this.getUnitVecX(D.v0),D.v0.scale(e),this.translate(D.v0)}moveLeftNow(e){this.getUnitVecX(D.v0),D.v0.scale(e),this.translateNow(D.v0)}moveUp(e){this.getUnitVecY(D.v0),D.v0.scale(e),this.translate(D.v0)}moveUpNow(e){this.getUnitVecY(D.v0),D.v0.scale(e),this.translateNow(D.v0)}moveDown(e){this.getUnitVecY(D.v0),D.v0.scale(-e),this.translate(D.v0)}moveDownNow(e){this.getUnitVecY(D.v0),D.v0.scale(-e),this.translateNow(D.v0)}turnUp(e){this.mulRotation(-e,0,0)}turnUpNow(e){this.mulRotationNow(-e,0,0)}turnDown(e){this.mulRotation(e,0,0)}turnDownNow(e){this.mulRotationNow(e,0,0)}turnRight(e){this.mulRotation(0,-e,0)}turnRightNow(e){this.mulRotationNow(0,-e,0)}turnLeft(e){this.mulRotation(0,e,0)}turnLeftNow(e){this.mulRotationNow(0,e,0)}rollRight(e){this.mulRotation(0,0,e)}rollRightNow(e){this.mulRotationNow(0,0,e)}rollLeft(e){this.mulRotation(0,0,-e)}rollLeftNow(e){this.mulRotationNow(0,0,-e)}setLinearVelocity(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setLinearVelocity(D.v0)}getLinearVelocity(e){return this.transformer.getLinearVelocity(e)}setAngularVelocity(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.setAngularVelocity(D.v0)}getAngularVelocity(e){return this.transformer.getAngularVelocity(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.addForce(D.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")D.v0.set(e,t,n),D.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else D.v0.set(e),D.v1.set(t);this.transformer.addForceAtPoint(D.v0,D.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.addTorque(D.v0)}applyImpulse(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.applyImpulse(D.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")D.v0.set(e,t,n),D.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else D.v0.set(e),D.v1.set(t);this.transformer.applyImpulseAtPoint(D.v0,D.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?D.v0.set(e,t,n):D.v0.set(e),this.transformer.applyTorqueImpulse(D.v0)}addOneselfToPhysics(e){this.transformer.addOneselfToPhysics(e)}removeOneselfFromPhysics(e){this.transformer.removeOneselfFromPhysics(e)}isGrounded(){return this.transformer.isGrounded()}}class Jr{message;dir;offsetTop;offsetRight;offsetLeft;offsetBottom;constructor(e){this.message=e,this.dir="RIGHT",this.offsetTop={x:0,y:2},this.offsetRight={x:1,y:1},this.offsetLeft={x:-1,y:1},this.offsetBottom={x:0,y:0}}}class Cn{shape;motion;constructor(e,t){this.shape=e,this.motion=t}enable(e,t){this.motion.playCount=0,this.motion.time=0,e.add(this.shape.root)}disable(e,t){e.remove(this.shape.root)}}class It extends Me{ready;actions;currentAction;stateAction;emoteAction;morphs;overwriteMorphs;constructor(e){super(e),this.actions={},this.morphs={},this.overwriteMorphs=!1,this.ready=this.asyncInit(e)}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object3D.clear(),this.morphs=n,this.stateAction?.enable(this.object3D,this.scene)}setActions(e){this.actions=e}getAction(e){return this.actions[e]}addAction(e,t){this.actions[e]=t}removeAction(e){const t=this.actions[e];return delete this.actions[e],t}getActionNames(){return Object.keys(this.actions)}setState(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.overwriteMorphs=e}setMorph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0?(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.emoteAction.disable(this.object3D,this.scene),this.emoteAction=void 0,this.stateAction&&(this.stateAction.enable(this.object3D,this.scene),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(r.loc&&o.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&o.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&o.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.overwriteMorphs&&r.morphs){for(const s of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(s.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=s.vals[a];break}}}this.object3D.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class Nn{name;playCount;time;finishListener;constructor(){this.name="dummy",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){return{}}}var Re=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),li=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),Ne=Re((i,e)=>{var t=i&&i.__spreadArray||function(M,Y){for(var V=0,re=Y.length,fe=M.length;V<re;V++,fe++)M[fe]=Y[V];return M};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(M){return M&&M.length===0}i.isEmpty=n;function r(M){return M==null?[]:Object.keys(M)}i.keys=r;function o(M){for(var Y=[],V=Object.keys(M),re=0;re<V.length;re++)Y.push(M[V[re]]);return Y}i.values=o;function s(M,Y){for(var V=[],re=r(M),fe=0;fe<re.length;fe++){var ke=re[fe];V.push(Y.call(null,M[ke],ke))}return V}i.mapValues=s;function c(M,Y){for(var V=[],re=0;re<M.length;re++)V.push(Y.call(null,M[re],re));return V}i.map=c;function A(M){for(var Y=[],V=0;V<M.length;V++){var re=M[V];Array.isArray(re)?Y=Y.concat(A(re)):Y.push(re)}return Y}i.flatten=A;function a(M){return n(M)?void 0:M[0]}i.first=a;function d(M){var Y=M&&M.length;return Y?M[Y-1]:void 0}i.last=d;function u(M,Y){if(Array.isArray(M))for(var V=0;V<M.length;V++)Y.call(null,M[V],V);else if($(M))for(var re=r(M),V=0;V<re.length;V++){var fe=re[V],ke=M[fe];Y.call(null,ke,fe)}else throw Error("non exhaustive match")}i.forEach=u;function m(M){return typeof M=="string"}i.isString=m;function p(M){return M===void 0}i.isUndefined=p;function I(M){return M instanceof Function}i.isFunction=I;function g(M,Y){return Y===void 0&&(Y=1),M.slice(Y,M.length)}i.drop=g;function l(M,Y){return Y===void 0&&(Y=1),M.slice(0,M.length-Y)}i.dropRight=l;function h(M,Y){var V=[];if(Array.isArray(M))for(var re=0;re<M.length;re++){var fe=M[re];Y.call(null,fe)&&V.push(fe)}return V}i.filter=h;function f(M,Y){return h(M,function(V){return!Y(V)})}i.reject=f;function C(M,Y){for(var V=Object.keys(M),re={},fe=0;fe<V.length;fe++){var ke=V[fe],Be=M[ke];Y(Be)&&(re[ke]=Be)}return re}i.pick=C;function b(M,Y){return $(M)?M.hasOwnProperty(Y):!1}i.has=b;function y(M,Y){return z(M,function(V){return V===Y})!==void 0}i.contains=y;function R(M){for(var Y=[],V=0;V<M.length;V++)Y.push(M[V]);return Y}i.cloneArr=R;function x(M){var Y={};for(var V in M)Object.prototype.hasOwnProperty.call(M,V)&&(Y[V]=M[V]);return Y}i.cloneObj=x;function z(M,Y){for(var V=0;V<M.length;V++){var re=M[V];if(Y.call(null,re))return re}}i.find=z;function k(M,Y){for(var V=[],re=0;re<M.length;re++){var fe=M[re];Y.call(null,fe)&&V.push(fe)}return V}i.findAll=k;function P(M,Y,V){for(var re=Array.isArray(M),fe=re?M:o(M),ke=re?[]:r(M),Be=V,ce=0;ce<fe.length;ce++)Be=Y.call(null,Be,fe[ce],re?ce:ke[ce]);return Be}i.reduce=P;function N(M){return f(M,function(Y){return Y==null})}i.compact=N;function S(M,Y){Y===void 0&&(Y=function(re){return re});var V=[];return P(M,function(re,fe){var ke=Y(fe);return y(V,ke)?re:(V.push(ke),re.concat(fe))},[])}i.uniq=S;function F(M){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];var re=[null],fe=re.concat(Y);return Function.bind.apply(M,fe)}i.partial=F;function _(M){return Array.isArray(M)}i.isArray=_;function W(M){return M instanceof RegExp}i.isRegExp=W;function $(M){return M instanceof Object}i.isObject=$;function H(M,Y){for(var V=0;V<M.length;V++)if(!Y(M[V],V))return!1;return!0}i.every=H;function ee(M,Y){return f(M,function(V){return y(Y,V)})}i.difference=ee;function ne(M,Y){for(var V=0;V<M.length;V++)if(Y(M[V]))return!0;return!1}i.some=ne;function ue(M,Y){for(var V=0;V<M.length;V++)if(M[V]===Y)return V;return-1}i.indexOf=ue;function ie(M,Y){var V=R(M);return V.sort(function(re,fe){return Y(re)-Y(fe)}),V}i.sortBy=ie;function X(M,Y){if(M.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var V={},re=0;re<M.length;re++)V[M[re]]=Y[re];return V}i.zipObject=X;function se(M){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var re=0;re<Y.length;re++)for(var fe=Y[re],ke=r(fe),Be=0;Be<ke.length;Be++){var ce=ke[Be];M[ce]=fe[ce]}return M}i.assign=se;function de(M){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var re=0;re<Y.length;re++)for(var fe=Y[re],ke=r(fe),Be=0;Be<ke.length;Be++){var ce=ke[Be];b(M,ce)||(M[ce]=fe[ce])}return M}i.assignNoOverwrite=de;function G(){for(var M=[],Y=0;Y<arguments.length;Y++)M[Y]=arguments[Y];return de.apply(void 0,t([{}],M))}i.defaults=G;function q(M,Y){var V={};return u(M,function(re){var fe=Y(re),ke=V[fe];ke?ke.push(re):V[fe]=[re]}),V}i.groupBy=q;function j(M,Y){for(var V=x(M),re=r(Y),fe=0;fe<re.length;fe++){var ke=re[fe],Be=Y[ke];V[ke]=Be}return V}i.merge=j;function Z(){}i.NOOP=Z;function J(M){return M}i.IDENTITY=J;function le(M){for(var Y=[],V=0;V<M.length;V++){var re=M[V];Y.push(re!==void 0?re:void 0)}return Y}i.packArray=le;function ye(M){console&&console.error&&console.error("Error: "+M)}i.PRINT_ERROR=ye;function Te(M){console&&console.warn&&console.warn("Warning: "+M)}i.PRINT_WARNING=Te;function De(){return typeof Map=="function"}i.isES2015MapSupported=De;function ze(M){return M[M.length-1]}i.peek=ze;function Xe(M){var Y=new Date().getTime(),V=M(),re=new Date().getTime(),fe=re-Y;return{time:fe,value:V}}i.timer=Xe;function Fe(M){function Y(){}Y.prototype=M;var V=new Y;function re(){return typeof V.bar}return re(),re(),M}i.toFastProperties=Fe}),yn=Re((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var h=this.disjunction();this.consumeChar("/");for(var f={type:"Flags",loc:{begin:this.idx,end:l.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(f,"global");break;case"i":A(f,"ignoreCase");break;case"m":A(f,"multiLine");break;case"u":A(f,"unicode");break;case"y":A(f,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:f,value:h,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],h=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(h)}},t.prototype.alternative=function(){for(var l=[],h=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(h)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var l=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(l)};case"$":return{type:"EndAnchor",loc:this.loc(l)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(l)};case"B":return{type:"NonWordBoundary",loc:this.loc(l)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var h;switch(this.popChar()){case"=":h="Lookahead";break;case"!":h="NegativeLookahead";break}a(h);var f=this.disjunction();return this.consumeChar(")"),{type:h,value:f,loc:this.loc(l)}}d()},t.prototype.quantifier=function(l){var h,f=this.idx;switch(this.popChar()){case"*":h={atLeast:0,atMost:1/0};break;case"+":h={atLeast:1,atMost:1/0};break;case"?":h={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":h={atLeast:C,atMost:C};break;case",":var b;this.isDigit()?(b=this.integerIncludingZero(),h={atLeast:C,atMost:b}):h={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&h===void 0)return;a(h);break}if(!(l===!0&&h===void 0))return a(h),this.peekChar(0)==="?"?(this.consumeChar("?"),h.greedy=!1):h.greedy=!0,h.type="Quantifier",h.loc=this.loc(f),h},t.prototype.atom=function(){var l,h=this.idx;switch(this.peekChar()){case".":l=this.dotAll();break;case"\\":l=this.atomEscape();break;case"[":l=this.characterClass();break;case"(":l=this.group();break}return l===void 0&&this.isPatternCharacter()&&(l=this.patternCharacter()),a(l),l.loc=this.loc(h),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[s(`
1
+ "use strict";var Ir=Object.create;var vn=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var Cr=Object.getOwnPropertyNames;var yr=Object.getPrototypeOf,Br=Object.prototype.hasOwnProperty;var Tr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Cr(e))!Br.call(i,r)&&r!==t&&vn(i,r,{get:()=>e[r],enumerable:!(n=br(e,r))||n.enumerable});return i};var wr=(i,e,t)=>(t=i!=null?Ir(yr(i)):{},Tr(e||!i||!i.__esModule?vn(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("three"),Kn=require("fflate");function Rr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const oe=Rr(E);class Ae{x=0;y=0;z=0;constructor(e,t,n){typeof e=="number"?(this.x=e,this.y=t,this.z=n):typeof e>"u"?this.x=this.y=this.z=0:(this.x=e.x,this.y=e.y,this.z=e.z)}clone(){return new Ae(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z}normalize(){const e=this.x*this.x+this.y*this.y+this.z*this.z,t=Math.sqrt(e);return t!==0?(this.x/=t,this.y/=t,this.z/=t):console.warn("Vec3.normalize."),this}negate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}set(e,t,n){return typeof e=="number"?(this.x=e,this.y=t,this.z=n):(this.x=e.x,this.y=e.y,this.z=e.z),this}add(e,t,n){return typeof e=="number"?(this.x+=e,this.y+=t,this.z+=n):(this.x+=e.x,this.y+=e.y,this.z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this.x-=e,this.y-=t,this.z-=n):(this.x-=e.x,this.y-=e.y,this.z-=e.z),this}scale(e){return this.x*=e,this.y*=e,this.z*=e,this}cross(e,t){return 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}apply(e,t,n,r){let o,s,c,A;typeof e=="number"?(o=e,s=t,c=n,A=r):(o=e.x,s=e.y,c=e.z,A=e.w);const a=2*(s*this.z-c*this.y),d=2*(c*this.x-o*this.z),u=2*(o*this.y-s*this.x);return this.x+=A*a+s*u-c*d,this.y+=A*d+c*a-o*u,this.z+=A*u+o*d-s*a,this}lerp(e,t,n){this.x=(1-n)*e.x+n*t.x,this.y=(1-n)*e.y+n*t.y,this.z=(1-n)*e.z+n*t.z}}class Me{x=0;y=0;z=0;w=1;constructor(e,t,n,r){typeof e=="number"?(this.x=e,this.y=t,this.z=n,this.w=r):typeof e>"u"?(this.x=this.y=this.z=0,this.w=1):(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w)}clone(){return new Me(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w}normalize(){const e=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w,t=Math.sqrt(e);return t!==0?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):console.warn("Quat.normalize."),this}conjugate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}set(e,t,n,r){return typeof e=="number"?(this.x=e,this.y=t,this.z=n,this.w=r):(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w),this}mul(e,t,n,r){const o=this.x,s=this.y,c=this.z,A=this.w;let a,d,u,m;return typeof e=="number"?(a=e,d=t,u=n,m=r):(a=e.x,d=e.y,u=e.z,m=e.w),this.x=A*a+o*m+s*u-c*d,this.y=A*d-o*u+s*m+c*a,this.z=A*u+o*d-s*a+c*m,this.w=A*m-o*a-s*d-c*u,this}lerp(e,t,n){this.x=(1-n)*e.x+n*t.x,this.y=(1-n)*e.y+n*t.y,this.z=(1-n)*e.z+n*t.z,this.w=(1-n)*e.w+n*t.w}slerp(e,t,n){if(n<0||n>1){console.warn("Quat.slerp(): t must be in [0,1]");return}let r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Xe.set(t),r<0&&(r*=-1,Xe.set(-Xe.x,-Xe.y,-Xe.z,-Xe.w)),r>.9995){this.x=(1-n)*e.x+n*Xe.x,this.y=(1-n)*e.y+n*Xe.y,this.z=(1-n)*e.z+n*Xe.z,this.w=(1-n)*e.w+n*Xe.w;const o=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);o<1e-4?(console.warn("Quat.slerp(); ???!"),this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):(this.x*=1/o,this.y*=1/o,this.z*=1/o,this.w*=1/o)}else{const o=Math.acos(r),s=Math.sin((1-n)*o)/Math.sin(o),c=Math.sin(n*o)/Math.sin(o);this.x=s*e.x+c*Xe.x,this.y=s*e.y+c*Xe.y,this.z=s*e.z+c*Xe.z,this.w=s*e.w+c*Xe.w}}}const Xe=new Me;function At(i,e,t,n){t.normalize();const r=i.clone().sub(e).normalize(),o=new Ae().cross(r,t).normalize(),s=new Ae().cross(o,r),c=o.x,A=s.x,a=-r.x,d=o.y,u=s.y,m=-r.y,p=o.z,I=s.z,g=-r.z;let l,h,f,C;const b=c+u+g;if(b>0){const R=Math.sqrt(b+1)*2;l=(I-m)/R,h=(a-p)/R,f=(d-A)/R,C=.25*R}else if(c>u&&c>g){const R=Math.sqrt(1+c-u-g)*2;l=.25*R,h=(A+d)/R,f=(a+p)/R,C=(I-m)/R}else if(u>g){const R=Math.sqrt(1+u-c-g)*2;l=(A+d)/R,h=.25*R,f=(m+I)/R,C=(a-p)/R}else{const R=Math.sqrt(1+g-c-u)*2;l=(a+p)/R,h=(m+I)/R,f=.25*R,C=(d-A)/R}const y=n??new Me;return y.set(l,h,f,C),y}function ht(i,e="ZXY",t){const n=t!==void 0?t.set(0,0,0,1):new Me(0,0,0,1);for(let r=0;r<3;r++)switch(e.charAt(r)){case"X":n.mul(Math.sin(i.x),0,0,Math.cos(i.x));break;case"Y":n.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":n.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return n}function vr(i){const e=[[],[],[]],t=i.x+i.x,n=i.y+i.y,r=i.z+i.z,o=i.x*t,s=i.x*n,c=i.x*r,A=i.y*n,a=i.y*r,d=i.z*r,u=i.w*t,m=i.w*n,p=i.w*r;return e[0][0]=1-(A+d),e[0][1]=s-p,e[0][2]=c+m,e[1][0]=s+p,e[1][1]=1-(o+d),e[1][2]=a-u,e[2][0]=c-m,e[2][1]=a+u,e[2][2]=1-(o+A),e}const gt=i=>Math.max(-1,Math.min(1,i));function Qn(i,e="ZXY",t){const n=vr(i),r=t??new Ae;let o=0,s=0,c=0;switch(e){case"XYZ":s=Math.asin(gt(n[0][2])),Math.abs(n[0][2])<.9999999?(o=Math.atan2(-n[1][2],n[2][2]),c=Math.atan2(-n[0][1],n[0][0])):(o=Math.atan2(n[2][1],n[1][1]),c=0);break;case"YXZ":o=Math.asin(-gt(n[1][2])),Math.abs(n[1][2])<.9999999?(s=Math.atan2(n[0][2],n[2][2]),c=Math.atan2(n[1][0],n[1][1])):(s=Math.atan2(-n[2][0],n[0][0]),c=0);break;case"ZXY":o=Math.asin(gt(n[2][1])),Math.abs(n[2][1])<.9999999?(s=Math.atan2(-n[2][0],n[2][2]),c=Math.atan2(-n[0][1],n[1][1])):(s=0,c=Math.atan2(n[1][0],n[0][0]));break;case"ZYX":s=Math.asin(-gt(n[2][0])),Math.abs(n[2][0])<.9999999?(o=Math.atan2(n[2][1],n[2][2]),c=Math.atan2(n[1][0],n[0][0])):(o=0,c=Math.atan2(-n[0][1],n[1][1]));break;case"YZX":c=Math.asin(gt(n[1][0])),Math.abs(n[1][0])<.9999999?(o=Math.atan2(-n[1][2],n[1][1]),s=Math.atan2(-n[2][0],n[0][0])):(o=0,s=Math.atan2(n[0][2],n[2][2]));break;case"XZY":c=Math.asin(-gt(n[0][1])),Math.abs(n[0][1])<.9999999?(o=Math.atan2(n[2][1],n[1][1]),s=Math.atan2(n[0][2],n[0][0])):(o=Math.atan2(-n[1][2],n[2][2]),s=0);break}return r.set(o,s,c),r}class ze{loc;quat;scale;constructor(){this.loc=new Ae,this.quat=new Me,this.scale=new Ae(1,1,1)}set(e){return e instanceof ze?(this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale)):(e.getPosition(this.loc),e.getQuat(this.quat),e.getScale(this.scale)),this}write(e){e instanceof Oe?(e.object3D.position.set(this.loc.x,this.loc.y,this.loc.z),e.object3D.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object3D.scale.set(this.scale.x,this.scale.y,this.scale.z)):(e.position.set(this.loc.x,this.loc.y,this.loc.z),e.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.scale.set(this.scale.x,this.scale.y,this.scale.z))}blend(e,t){return this.loc.lerp(this.loc,e.loc,t),this.quat.slerp(this.quat,e.quat,t),this.scale.lerp(this.scale,e.scale,t),this}clone(){const e=new ze;return e.set(this),e}}class Rt{transform;constructor(){this.transform=new ze}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.transform.loc.set(e)}setPositionNow(e){this.transform.loc.set(e)}setQuat(e){this.transform.quat.set(e)}setQuatNow(e){this.transform.quat.set(e)}setScale(e){this.transform.scale.set(e)}setScaleNow(e){this.transform.scale.set(e)}setLinearVelocity(e){}getLinearVelocity(e){return e||new Ae}setAngularVelocity(e){}getAngularVelocity(e){return e||new Ae}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Wn{transform;constructor(){this.transform=new ze}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||new Ae}setAngularVelocity(e){}getAngularVelocity(e){return e||new Ae}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class fn{startTransform;transform;endTransform;currentTime;duration;constructor(){this.startTransform=new ze,this.transform=new ze,this.endTransform=new ze,this.currentTime=0,this.duration=1}init(e,t){this.startTransform.set(e),this.transform.set(e),this.endTransform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.startTransform.set(this.transform),this.endTransform.loc.set(e),this.currentTime=0}setPositionNow(e){this.setPosition(e),this.currentTime=1}setQuat(e){this.startTransform.set(this.transform),this.endTransform.quat.set(e),this.currentTime=0}setQuatNow(e){this.setQuat(e),this.currentTime=1}setScale(e){this.startTransform.set(this.transform),this.endTransform.scale.set(e),this.currentTime=0}setScaleNow(e){this.setScale(e),this.currentTime=1}setLinearVelocity(e){}getLinearVelocity(e){e||(e=new Ae);const t=this.endTransform.loc.x-this.startTransform.loc.x,n=this.endTransform.loc.y-this.startTransform.loc.y,r=this.endTransform.loc.z-this.startTransform.loc.z;e.set(t,n,r);const o=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngularVelocity(e){}getAngularVelocity(e){e||(e=new Ae),Qn(this.startTransform.quat,"ZXY",_t),Qn(this.endTransform.quat,"ZXY",Dt),e.set(Dt.x-_t.x,Dt.y-_t.y,Dt.z-_t.z);const t=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*t*t+6*t)/this.duration),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}smoothstep(e){return e*e*(3-2*e)}update(e){this.currentTime+=e,this.currentTime>this.duration&&(this.currentTime=this.duration);const t=this.currentTime/this.duration,n=this.smoothstep(t);this.transform.set(this.startTransform),this.transform.blend(this.endTransform,n)}}const ot=new Ae,yt=new Ae,ft=new Me,Lt=new ze,_t=new Ae,Dt=new Ae,Qr={up:new Ae(0,1,0)};class Yn extends Rt{up;target;constructor(e){super();const t={...Qr,...e};this.target=t.target,this.up=t.up}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){ot.set(this.transform.loc),this.target.getPosition(yt),At(ot,yt,this.up,ft),this.transform.quat.set(ft)}}const kr={up:new Ae(0,1,0)};class Jn extends fn{up;target;constructor(e){super();const t={...kr,...e};this.target=t.target,this.up=t.up}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),ot.set(this.transform.loc),this.target.getPosition(yt),At(ot,yt,this.up,ft),this.transform.quat.set(ft)}}const Xn={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class Zn extends Wn{target;lookFrom;up;smoothness;constructor(e){super();const t={...Xn,...e};this.target=t.target,this.lookFrom=new Ae(t.lookFrom),this.target.upVector?this.up=this.target.upVector:this.up=Oe.defaultUpVector,this.smoothness=t.smoothness}init(e,t){super.init(e,t)}update(e){super.update(e),ot.set(this.transform.loc),this.target.getPosition(yt),At(ot,yt,this.up,ft),ft.mul(0,1,0,0),Lt.quat.set(ft),ot.set(this.lookFrom),ot.apply(this.target.getQuat()),ot.add(this.target.getPosition()),Lt.loc.set(ot),this.transform.loc.lerp(this.transform.loc,Lt.loc,1-this.smoothness),this.transform.quat.slerp(this.transform.quat,Lt.quat,1-this.smoothness)}}const $n={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function ei(i){return typeof i=="string"}function pn(i){return i.isMesh===!0}function Sr(i){return i.type==="RoundedBoxGeometry"}function xr(i){return i.type==="BoxGeometry"}function Lr(i){return i.type==="SphereGeometry"}function _r(i){return i.type==="IcosahedronGeometry"}function Dr(i){return i.type==="CylinderGeometry"}function Nr(i){return i.type==="CapsuleGeometry"}function Fr(i){return i.isBone===!0}function Or(i){return i.isPerspectiveCamera===!0}let je;const it=new Map;class vt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!vt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),vt.RAPIER=e,je=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new je.World(e.gravity);return new gn(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class gn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new je.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let n=0;n<t;n++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{const o=it.get(t),s=it.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e}}class kn{transform;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...$n,...e},this.transform=new ze,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=je.RigidBodyDesc.dynamic();break;case"kinematic":e=je.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=je.RigidBodyDesc.fixed();break}return e.setTranslation(this.transform.loc.x,this.transform.loc.y,this.transform.loc.z),e.setRotation({x:this.transform.quat.x,y:this.transform.quat.y,z:this.transform.quat.z,w:this.transform.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object3D.traverse(r=>{if(pn(r)){const o=Gr(r.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(je.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(o.colliderDesc),o.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(o.volume);else{let c,A;switch(e.meshCollider){case"tri_mesh":c=Mr(r),A=Sn(r.geometry);break;case"convex_hull":c=Pr(r),A=Sn(r.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(je.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((r,o)=>r+o,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.transform.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat)}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{const n=e.world.createCollider(t,this.body);this.colliders.push(n),this.objectA3&&it.set(n.handle,this.objectA3)}),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),it.delete(t.handle)})}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinearVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngularVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}update(e){if(this.body){const t=this.body.translation();this.transform.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.transform.quat.set(n.x,n.y,n.z,n.w)}}}function Mr(i){let e=null;if(pn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let o=n.index?n.index.array:null;if(o)o instanceof Uint32Array||(o=new Uint32Array(o));else{const s=n.attributes.position.count;o=new Uint32Array(s);for(let c=0;c<s;c++)o[c]=c}r instanceof Float32Array&&(e=je.ColliderDesc.trimesh(r,o))}return e}function Pr(i){let e=null;if(pn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=je.ColliderDesc.convexHull(r))}return e}function Sn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const o=new oe.Vector3,s=new oe.Vector3,c=new oe.Vector3;if(t){const A=t.array;for(let a=0;a<A.length;a+=3){const d=A[a]*3,u=A[a+1]*3,m=A[a+2]*3;o.set(n[d],n[d+1],n[d+2]),s.set(n[u],n[u+1],n[u+2]),c.set(n[m],n[m+1],n[m+2]),r+=o.dot(s.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)o.set(n[A],n[A+1],n[A+2]),s.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=o.dot(s.clone().cross(c));return Math.abs(r)/6}function Gr(i){if(Sr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:je.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(xr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:je.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Lr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:je.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(_r(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:je.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Dr(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:je.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(Nr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:je.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const on=new vt;async function Ur(){await on.init()}const _={v0:new Ae,v1:new Ae,v2:new Ae,v3:new Ae,v4:new Ae,q0:new Me,q1:new Me,q2:new Me,q3:new Me,q4:new Me,t0:new ze,t1:new ze,t2:new ze,t3:new ze,t4:new ze};function jr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function ti(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Kn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function Nt(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Kn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function sn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=qr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const Hr={"image/png":/\.png$/i,"image/jpeg":/\.(jpg|jpeg)$/i,"image/gif":/\.gif$/i,"model/vrml":/\.wrl$/i,"application/xml":/\.xml$/i,"application/octet-stream":/\.bvh/i,"audio/x-wav":/\.wav/i,"audio/mpeg":/\.mp3/i,"audio/ogg":/\.ogg/i,"text/plain":/\.(txt|text)$/i,"model/gltf+json":/\.gltf$/i,"model/gltf-binary":/\.glb$/i};function qr(i){for(const[e,t]of Object.entries(Hr))if(t.test(i))return e;return"application/octet-stream"}function Ot(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=Ot(i[n],e[n]):t[n]=e[n];return t}const ni={offset:.01,auto:!0,height:1.5,radius:.3};class ii{transform;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;constructor(e={}){this.completeOptions={...ni,...e},this.transform=new ze,this.capsuleCenter=new Ae,this.nextLocation=new Ae,this.tmpV1=new Ae,this.tmpV2=new Ae,this.tmpQ1=new Me}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new oe.Vector3,r=new oe.Quaternion,o=new oe.Object3D;o.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(n),o.position.set(n.x,n.y,n.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.getScale(this.tmpV2),this.tmpV2.write(n),o.scale.set(n.x,n.y,n.z);const s=new oe.Box3().setFromObject(o);o.remove(t.object3D),s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.colliderDesc=je.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.colliderDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w})}addOneselfToPhysics(e){this.controller=e.world.createCharacterController(this.completeOptions.offset),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle))}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.transform.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new Ae),e.set(0,0,0),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new Ae),e.set(0,0,0),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){return this.controller?this.controller.computedGrounded():!1}update(e){if(!this.controller||!this.collider)return;this.transform.quat.set(this.collider.rotation()),this.tmpV1.set(this.collider.translation()),this.tmpV2.set(this.nextLocation),this.tmpV2.sub(this.tmpV1),this.controller.computeColliderMovement(this.collider,this.tmpV2);const t=this.controller.computedMovement();this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.transform.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const ri={auto:!0,height:1.5,radius:.3};class oi{transform;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;physicsWorld;constructor(e={}){this.completeOptions={...ri,...e},this.transform=new ze,this.capsuleCenter=new Ae,this.nextLocation=new Ae,this.tmpV1=new Ae,this.tmpV2=new Ae,this.tmpQ1=new Me}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new oe.Vector3,r=new oe.Quaternion,o=new oe.Object3D;o.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(n),o.position.set(n.x,n.y,n.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.getScale(this.tmpV2),this.tmpV2.write(n),o.scale.set(n.x,n.y,n.z);const s=new oe.Box3().setFromObject(o);s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.bodyDesc=je.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat),this.colliderDesc=je.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle)),this.physicsWorld=void 0}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinearVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngularVelocity(e){return e||(e=new Ae),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}isGrounded(){if(this.body&&this.physicsWorld){const e=this.body.translation(),t=new je.Ray(e,{x:0,y:-1,z:0}),n=1.1*(this.completeOptions.height+this.completeOptions.radius);return this.physicsWorld.world.castRay(t,n,!0,void 0,void 0,this.collider)!==null}else return this.transform.loc.y<=0}update(e){if(!this.body)return;const t=new Ae(this.body.translation());t.sub(this.capsuleCenter),this.transform.loc.set(t),this.transform.quat.set(this.body.rotation())}}const zr=new oe.SphereGeometry,Vr=new oe.MeshStandardMaterial({color:16711680});let Kr=new oe.Mesh(zr,Vr);class Oe{static defaultRotationOrder="ZXY";static defaultUpVector=new Ae(0,1,0);rotationOrder;upVector;object3D;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object3D=new oe.Object3D;const t=this.initObject(e);t&&this.object3D.add(t),this.object3D.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return Kr.clone()}initTransformer(e){return new Rt}setTransformer(e){_.t0.set(this.transformer.transform),e.init(_.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){e==="Default"?this.setTransformer(new Rt):e==="Smooth"?this.setTransformer(new fn):e==="Follow"?this.setTransformer(new Zn(t)):e==="Billboard"?this.setTransformer(new Yn(t)):e==="SmoothBillboard"?this.setTransformer(new Jn(t)):e==="SimplePhysics"?this.setTransformer(new kn(t)):e==="KinematicCharacter"?this.setTransformer(new ii(t)):e==="DynamicCharacter"&&this.setTransformer(new oi(t))}initSimplePhysics(e){const t={...$n,...e};this.setTransformer(new kn(t))}update(e){this.transformer.update(e),this.transformer.transform.write(this),this.children.forEach(t=>{t.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object3D.add(e.object3D)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object3D.remove(e.object3D)}setSpeechBubble(e){this.balloon?this.balloon.message=e:this.balloon=new Wr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}getPosition(e){return e?(e.set(this.transformer.transform.loc),e):this.transformer.transform.loc.clone()}setPosition(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setPosition(_.v0)}setPositionNow(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setPositionNow(_.v0)}getQuat(e){return e?(e.set(this.transformer.transform.quat),e):this.transformer.transform.quat.clone()}setQuat(e,t,n,r){typeof e=="number"?_.q0.set(e,t,n,r):_.q0.set(e),this.transformer.setQuat(_.q0)}setQuatNow(e,t,n,r){typeof e=="number"?_.q0.set(e,t,n,r):_.q0.set(e),this.transformer.setQuatNow(_.q0)}getScale(e){return e?(e.set(this.transformer.transform.scale),e):this.transformer.transform.scale.clone()}setScale(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setScale(_.v0)}setScaleNow(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setScaleNow(_.v0)}setRotation(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),_.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(_.v0,r,_.q1),this.setQuat(_.q1)}setRotationNow(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),_.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(_.v0,r,_.q0),this.setQuatNow(_.q0)}lookAt(e,t,n){typeof e=="number"?_.v1.set(e,t,n):e instanceof Oe?_.v1.set(e.transformer.transform.loc):_.v1.set(e);const r=this.upVector?this.upVector:Oe.defaultUpVector;At(this.transformer.transform.loc,_.v1,r,_.q1),this.setQuat(_.q1)}lookAtNow(e,t,n){typeof e=="number"?_.v1.set(e,t,n):e instanceof Oe?_.v1.set(e.transformer.transform.loc):_.v1.set(e);const r=this.upVector?this.upVector:Oe.defaultUpVector;At(this.transformer.transform.loc,_.v1,r,_.q1),this.setQuatNow(_.q1)}getUnitVecX(e){return e?(e.set(1,0,0),e.apply(this.object3D.quaternion)):new Ae(1,0,0).apply(this.object3D.quaternion)}getUnitVecY(e){return e?(e.set(0,1,0),e.apply(this.object3D.quaternion)):new Ae(0,1,0).apply(this.object3D.quaternion)}getUnitVecZ(e){return e?(e.set(0,0,1),e.apply(this.object3D.quaternion)):new Ae(0,0,1).apply(this.object3D.quaternion)}translate(e,t,n){_.v1.set(this.transformer.transform.loc),typeof e=="number"?_.v1.add(e,t,n):_.v1.add(e),this.setPosition(_.v1)}translateNow(e,t,n){_.v1.set(this.transformer.transform.loc),typeof e=="number"?_.v1.add(e,t,n):_.v1.add(e),this.setPositionNow(_.v1)}mulQuat(e,t,n,r){_.q1.set(this.transformer.transform.quat),typeof e=="number"?_.q1.mul(e,t,n,r):_.q1.mul(e),this.setQuat(_.q1)}mulQuatNow(e,t,n,r){_.q1.set(this.transformer.transform.quat),typeof e=="number"?_.q1.mul(e,t,n,r):_.q1.mul(e),this.setQuatNow(_.q1)}mulRotation(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),_.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(_.v0,r,_.q1),this.getQuat(_.q0),_.q0.mul(_.q1),this.setQuat(_.q0)}mulRotationNow(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),_.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(_.v0,r,_.q1),this.getQuat(_.q0),_.q0.mul(_.q1),this.setQuatNow(_.q0)}scaleBy(e,t,n){this.getScale(_.v0),typeof e=="number"?_.v0.set(_.v0.x*e,_.v0.y*t,_.v0.z*n):_.v0.set(_.v0.x*e.x,_.v0.y*e.y,_.v0.z*e.z),this.setScale(_.v0)}mulScaleNow(e,t,n){this.getScale(_.v0),typeof e=="number"?_.v0.set(_.v0.x*e,_.v0.y*t,_.v0.z*n):_.v0.set(_.v0.x*e.x,_.v0.y*e.y,_.v0.z*e.z),this.setScaleNow(_.v0)}moveForward(e){this.getUnitVecZ(_.v0),_.v0.scale(e),this.translate(_.v0)}moveForwardNow(e){this.getUnitVecZ(_.v0),_.v0.scale(e),this.translateNow(_.v0)}moveBackward(e){this.getUnitVecZ(_.v0),_.v0.scale(-e),this.translate(_.v0)}moveBackwardNow(e){this.getUnitVecZ(_.v0),_.v0.scale(-e),this.translateNow(_.v0)}moveRight(e){this.getUnitVecX(_.v0),_.v0.scale(-e),this.translate(_.v0)}moveRightNow(e){this.getUnitVecX(_.v0),_.v0.scale(-e),this.translateNow(_.v0)}moveLeft(e){this.getUnitVecX(_.v0),_.v0.scale(e),this.translate(_.v0)}moveLeftNow(e){this.getUnitVecX(_.v0),_.v0.scale(e),this.translateNow(_.v0)}moveUp(e){this.getUnitVecY(_.v0),_.v0.scale(e),this.translate(_.v0)}moveUpNow(e){this.getUnitVecY(_.v0),_.v0.scale(e),this.translateNow(_.v0)}moveDown(e){this.getUnitVecY(_.v0),_.v0.scale(-e),this.translate(_.v0)}moveDownNow(e){this.getUnitVecY(_.v0),_.v0.scale(-e),this.translateNow(_.v0)}turnUp(e){this.mulRotation(-e,0,0)}turnUpNow(e){this.mulRotationNow(-e,0,0)}turnDown(e){this.mulRotation(e,0,0)}turnDownNow(e){this.mulRotationNow(e,0,0)}turnRight(e){this.mulRotation(0,-e,0)}turnRightNow(e){this.mulRotationNow(0,-e,0)}turnLeft(e){this.mulRotation(0,e,0)}turnLeftNow(e){this.mulRotationNow(0,e,0)}rollRight(e){this.mulRotation(0,0,e)}rollRightNow(e){this.mulRotationNow(0,0,e)}rollLeft(e){this.mulRotation(0,0,-e)}rollLeftNow(e){this.mulRotationNow(0,0,-e)}setLinearVelocity(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setLinearVelocity(_.v0)}getLinearVelocity(e){return this.transformer.getLinearVelocity(e)}setAngularVelocity(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.setAngularVelocity(_.v0)}getAngularVelocity(e){return this.transformer.getAngularVelocity(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.addForce(_.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")_.v0.set(e,t,n),_.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else _.v0.set(e),_.v1.set(t);this.transformer.addForceAtPoint(_.v0,_.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.addTorque(_.v0)}applyImpulse(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.applyImpulse(_.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")_.v0.set(e,t,n),_.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else _.v0.set(e),_.v1.set(t);this.transformer.applyImpulseAtPoint(_.v0,_.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?_.v0.set(e,t,n):_.v0.set(e),this.transformer.applyTorqueImpulse(_.v0)}addOneselfToPhysics(e){this.transformer.addOneselfToPhysics(e)}removeOneselfFromPhysics(e){this.transformer.removeOneselfFromPhysics(e)}isGrounded(){return this.transformer.isGrounded()}}class Wr{message;dir;offsetTop;offsetRight;offsetLeft;offsetBottom;constructor(e){this.message=e,this.dir="RIGHT",this.offsetTop={x:0,y:2},this.offsetRight={x:1,y:1},this.offsetLeft={x:-1,y:1},this.offsetBottom={x:0,y:0}}}class mn{shape;motion;constructor(e,t){this.shape=e,this.motion=t}enable(e,t){this.motion.playCount=0,this.motion.time=0,e.add(this.shape.root)}disable(e,t){e.remove(this.shape.root)}}class bt extends Oe{ready;actions;currentAction;stateAction;emoteAction;morphs;overwriteMorphs;constructor(e){super(e),this.actions={},this.morphs={},this.overwriteMorphs=!1,this.ready=this.asyncInit(e)}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object3D.clear(),this.morphs=n,this.stateAction?.enable(this.object3D,this.scene)}setActions(e){this.actions=e}getAction(e){return this.actions[e]}addAction(e,t){this.actions[e]=t}removeAction(e){const t=this.actions[e];return delete this.actions[e],t}getActionNames(){return Object.keys(this.actions)}setState(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.overwriteMorphs=e}setMorph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0?(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.emoteAction.disable(this.object3D,this.scene),this.emoteAction=void 0,this.stateAction&&(this.stateAction.enable(this.object3D,this.scene),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(r.loc&&o.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&o.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&o.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.overwriteMorphs&&r.morphs){for(const s of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(s.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=s.vals[a];break}}}this.object3D.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class xn{name;playCount;time;finishListener;constructor(){this.name="dummy",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){return{}}}var Re=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),si=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),Ne=Re((i,e)=>{var t=i&&i.__spreadArray||function(O,X){for(var z=0,re=X.length,fe=O.length;z<re;z++,fe++)O[fe]=X[z];return O};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(O){return O&&O.length===0}i.isEmpty=n;function r(O){return O==null?[]:Object.keys(O)}i.keys=r;function o(O){for(var X=[],z=Object.keys(O),re=0;re<z.length;re++)X.push(O[z[re]]);return X}i.values=o;function s(O,X){for(var z=[],re=r(O),fe=0;fe<re.length;fe++){var Qe=re[fe];z.push(X.call(null,O[Qe],Qe))}return z}i.mapValues=s;function c(O,X){for(var z=[],re=0;re<O.length;re++)z.push(X.call(null,O[re],re));return z}i.map=c;function A(O){for(var X=[],z=0;z<O.length;z++){var re=O[z];Array.isArray(re)?X=X.concat(A(re)):X.push(re)}return X}i.flatten=A;function a(O){return n(O)?void 0:O[0]}i.first=a;function d(O){var X=O&&O.length;return X?O[X-1]:void 0}i.last=d;function u(O,X){if(Array.isArray(O))for(var z=0;z<O.length;z++)X.call(null,O[z],z);else if($(O))for(var re=r(O),z=0;z<re.length;z++){var fe=re[z],Qe=O[fe];X.call(null,Qe,fe)}else throw Error("non exhaustive match")}i.forEach=u;function m(O){return typeof O=="string"}i.isString=m;function p(O){return O===void 0}i.isUndefined=p;function I(O){return O instanceof Function}i.isFunction=I;function g(O,X){return X===void 0&&(X=1),O.slice(X,O.length)}i.drop=g;function l(O,X){return X===void 0&&(X=1),O.slice(0,O.length-X)}i.dropRight=l;function h(O,X){var z=[];if(Array.isArray(O))for(var re=0;re<O.length;re++){var fe=O[re];X.call(null,fe)&&z.push(fe)}return z}i.filter=h;function f(O,X){return h(O,function(z){return!X(z)})}i.reject=f;function C(O,X){for(var z=Object.keys(O),re={},fe=0;fe<z.length;fe++){var Qe=z[fe],ye=O[Qe];X(ye)&&(re[Qe]=ye)}return re}i.pick=C;function b(O,X){return $(O)?O.hasOwnProperty(X):!1}i.has=b;function y(O,X){return q(O,function(z){return z===X})!==void 0}i.contains=y;function R(O){for(var X=[],z=0;z<O.length;z++)X.push(O[z]);return X}i.cloneArr=R;function x(O){var X={};for(var z in O)Object.prototype.hasOwnProperty.call(O,z)&&(X[z]=O[z]);return X}i.cloneObj=x;function q(O,X){for(var z=0;z<O.length;z++){var re=O[z];if(X.call(null,re))return re}}i.find=q;function v(O,X){for(var z=[],re=0;re<O.length;re++){var fe=O[re];X.call(null,fe)&&z.push(fe)}return z}i.findAll=v;function G(O,X,z){for(var re=Array.isArray(O),fe=re?O:o(O),Qe=re?[]:r(O),ye=z,le=0;le<fe.length;le++)ye=X.call(null,ye,fe[le],re?le:Qe[le]);return ye}i.reduce=G;function D(O){return f(O,function(X){return X==null})}i.compact=D;function Q(O,X){X===void 0&&(X=function(re){return re});var z=[];return G(O,function(re,fe){var Qe=X(fe);return y(z,Qe)?re:(z.push(Qe),re.concat(fe))},[])}i.uniq=Q;function F(O){for(var X=[],z=1;z<arguments.length;z++)X[z-1]=arguments[z];var re=[null],fe=re.concat(X);return Function.bind.apply(O,fe)}i.partial=F;function L(O){return Array.isArray(O)}i.isArray=L;function J(O){return O instanceof RegExp}i.isRegExp=J;function $(O){return O instanceof Object}i.isObject=$;function j(O,X){for(var z=0;z<O.length;z++)if(!X(O[z],z))return!1;return!0}i.every=j;function ee(O,X){return f(O,function(z){return y(X,z)})}i.difference=ee;function ne(O,X){for(var z=0;z<O.length;z++)if(X(O[z]))return!0;return!1}i.some=ne;function ue(O,X){for(var z=0;z<O.length;z++)if(O[z]===X)return z;return-1}i.indexOf=ue;function ie(O,X){var z=R(O);return z.sort(function(re,fe){return X(re)-X(fe)}),z}i.sortBy=ie;function Z(O,X){if(O.length!==X.length)throw Error("can't zipObject with different number of keys and values!");for(var z={},re=0;re<O.length;re++)z[O[re]]=X[re];return z}i.zipObject=Z;function se(O){for(var X=[],z=1;z<arguments.length;z++)X[z-1]=arguments[z];for(var re=0;re<X.length;re++)for(var fe=X[re],Qe=r(fe),ye=0;ye<Qe.length;ye++){var le=Qe[ye];O[le]=fe[le]}return O}i.assign=se;function de(O){for(var X=[],z=1;z<arguments.length;z++)X[z-1]=arguments[z];for(var re=0;re<X.length;re++)for(var fe=X[re],Qe=r(fe),ye=0;ye<Qe.length;ye++){var le=Qe[ye];b(O,le)||(O[le]=fe[le])}return O}i.assignNoOverwrite=de;function P(){for(var O=[],X=0;X<arguments.length;X++)O[X]=arguments[X];return de.apply(void 0,t([{}],O))}i.defaults=P;function H(O,X){var z={};return u(O,function(re){var fe=X(re),Qe=z[fe];Qe?Qe.push(re):z[fe]=[re]}),z}i.groupBy=H;function Y(O,X){for(var z=x(O),re=r(X),fe=0;fe<re.length;fe++){var Qe=re[fe],ye=X[Qe];z[Qe]=ye}return z}i.merge=Y;function V(){}i.NOOP=V;function K(O){return O}i.IDENTITY=K;function ce(O){for(var X=[],z=0;z<O.length;z++){var re=O[z];X.push(re!==void 0?re:void 0)}return X}i.packArray=ce;function Be(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=Be;function Te(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=Te;function De(){return typeof Map=="function"}i.isES2015MapSupported=De;function Ve(O){return O[O.length-1]}i.peek=Ve;function Je(O){var X=new Date().getTime(),z=O(),re=new Date().getTime(),fe=re-X;return{time:fe,value:z}}i.timer=Je;function qe(O){function X(){}X.prototype=O;var z=new X;function re(){return typeof z.bar}return re(),re(),O}i.toFastProperties=qe}),En=Re((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var h=this.disjunction();this.consumeChar("/");for(var f={type:"Flags",loc:{begin:this.idx,end:l.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(f,"global");break;case"i":A(f,"ignoreCase");break;case"m":A(f,"multiLine");break;case"u":A(f,"unicode");break;case"y":A(f,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:f,value:h,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],h=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(h)}},t.prototype.alternative=function(){for(var l=[],h=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(h)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var l=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(l)};case"$":return{type:"EndAnchor",loc:this.loc(l)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(l)};case"B":return{type:"NonWordBoundary",loc:this.loc(l)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var h;switch(this.popChar()){case"=":h="Lookahead";break;case"!":h="NegativeLookahead";break}a(h);var f=this.disjunction();return this.consumeChar(")"),{type:h,value:f,loc:this.loc(l)}}d()},t.prototype.quantifier=function(l){var h,f=this.idx;switch(this.popChar()){case"*":h={atLeast:0,atMost:1/0};break;case"+":h={atLeast:1,atMost:1/0};break;case"?":h={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":h={atLeast:C,atMost:C};break;case",":var b;this.isDigit()?(b=this.integerIncludingZero(),h={atLeast:C,atMost:b}):h={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&h===void 0)return;a(h);break}if(!(l===!0&&h===void 0))return a(h),this.peekChar(0)==="?"?(this.consumeChar("?"),h.greedy=!1):h.greedy=!0,h.type="Quantifier",h.loc=this.loc(f),h},t.prototype.atom=function(){var l,h=this.idx;switch(this.peekChar()){case".":l=this.dotAll();break;case"\\":l=this.atomEscape();break;case"[":l=this.characterClass();break;case"(":l=this.group();break}return l===void 0&&this.isPatternCharacter()&&(l=this.patternCharacter()),a(l),l.loc=this.loc(h),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[s(`
2
2
  `),s("\r"),s("\u2028"),s("\u2029")]}},t.prototype.atomEscape=function(){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()}},t.prototype.decimalEscapeAtom=function(){var l=this.positiveInteger();return{type:"GroupBackReference",value:l}},t.prototype.characterClassEscape=function(){var l,h=!1;switch(this.popChar()){case"d":l=m;break;case"D":l=m,h=!0;break;case"s":l=I;break;case"S":l=I,h=!0;break;case"w":l=p;break;case"W":l=p,h=!0;break}return a(l),{type:"Set",value:l,complement:h}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=s("\f");break;case"n":l=s(`
3
3
  `);break;case"r":l=s("\r");break;case"t":l=s(" ");break;case"v":l=s("\v");break}return a(l),{type:"Character",value:l}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var l=this.popChar();if(/[a-zA-Z]/.test(l)===!1)throw Error("Invalid ");var h=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:h}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:s("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var l=this.popChar();return{type:"Character",value:s(l)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
4
4
  `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:s(l)}}},t.prototype.characterClass=function(){var l=[],h=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),h=!0);this.isClassAtom();){var f=this.classAtom(),C=f.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var b=this.classAtom(),y=b.type==="Character";if(y){if(b.value<f.value)throw Error("Range out of order in character class");l.push({from:f.value,to:b.value})}else c(f.value,l),l.push(s("-")),c(b.value,l)}else c(f.value,l)}return this.consumeChar("]"),{type:"Set",complement:h,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
@@ -6,7 +6,7 @@
6
6
  `: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:s(l)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case`
7
7
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.prototype.isAssertion=function(){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}},t.prototype.isQuantifier=function(){var l=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(l)}},t.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
8
8
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var h="",f=0;f<l;f++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");h+=C}var b=parseInt(h,16);return{type:"Character",value:b}},t.prototype.peekChar=function(l){return l===void 0&&(l=0),this.input[this.idx+l]},t.prototype.popChar=function(){var l=this.peekChar(0);return this.consumeChar(),l},t.prototype.consumeChar=function(l){if(l!==void 0&&this.input[this.idx]!==l)throw Error("Expected: '"+l+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(l){return{begin:l,end:this.idx}};var n=/[0-9a-fA-F]/,r=/[0-9]/,o=/[1-9]/;function s(l){return l.charCodeAt(0)}function c(l,h){l.length!==void 0?l.forEach(function(f){h.push(f)}):h.push(l)}function A(l,h){if(l[h]===!0)throw"duplicate flag "+h;l[h]=!0}function a(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function d(){throw Error("Internal Error - Should never get here!")}var u,m=[];for(u=s("0");u<=s("9");u++)m.push(u);var p=[s("_")].concat(m);for(u=s("a");u<=s("z");u++)p.push(u);for(u=s("A");u<=s("Z");u++)p.push(u);var I=[s(" "),s("\f"),s(`
9
- `),s("\r"),s(" "),s("\v"),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s("\u2028"),s("\u2029"),s(" "),s(" "),s(" "),s("\uFEFF")];function g(){}return g.prototype.visitChildren=function(l){for(var h in l){var f=l[h];l.hasOwnProperty(h)&&(f.type!==void 0?this.visit(f):Array.isArray(f)&&f.forEach(function(C){this.visit(C)},this))}},g.prototype.visit=function(l){switch(l.type){case"Pattern":this.visitPattern(l);break;case"Flags":this.visitFlags(l);break;case"Disjunction":this.visitDisjunction(l);break;case"Alternative":this.visitAlternative(l);break;case"StartAnchor":this.visitStartAnchor(l);break;case"EndAnchor":this.visitEndAnchor(l);break;case"WordBoundary":this.visitWordBoundary(l);break;case"NonWordBoundary":this.visitNonWordBoundary(l);break;case"Lookahead":this.visitLookahead(l);break;case"NegativeLookahead":this.visitNegativeLookahead(l);break;case"Character":this.visitCharacter(l);break;case"Set":this.visitSet(l);break;case"Group":this.visitGroup(l);break;case"GroupBackReference":this.visitGroupBackReference(l);break;case"Quantifier":this.visitQuantifier(l);break}this.visitChildren(l)},g.prototype.visitPattern=function(l){},g.prototype.visitFlags=function(l){},g.prototype.visitDisjunction=function(l){},g.prototype.visitAlternative=function(l){},g.prototype.visitStartAnchor=function(l){},g.prototype.visitEndAnchor=function(l){},g.prototype.visitWordBoundary=function(l){},g.prototype.visitNonWordBoundary=function(l){},g.prototype.visitLookahead=function(l){},g.prototype.visitNegativeLookahead=function(l){},g.prototype.visitCharacter=function(l){},g.prototype.visitSet=function(l){},g.prototype.visitGroup=function(l){},g.prototype.visitGroupBackReference=function(l){},g.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:g,VERSION:"0.5.0"}})}),Bn=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=yn(),t={},n=new e.RegExpParser;function r(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function o(){t={}}i.clearRegExpParserCache=o}),Xr=Re(i=>{var e=i&&i.__extends||(function(){var g=function(l,h){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,C){f.__proto__=C}||function(f,C){for(var b in C)Object.prototype.hasOwnProperty.call(C,b)&&(f[b]=C[b])},g(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");g(l,h);function f(){this.constructor=l}l.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=yn(),n=Ne(),r=Bn(),o=ui(),s="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
9
+ `),s("\r"),s(" "),s("\v"),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s("\u2028"),s("\u2029"),s(" "),s(" "),s(" "),s("\uFEFF")];function g(){}return g.prototype.visitChildren=function(l){for(var h in l){var f=l[h];l.hasOwnProperty(h)&&(f.type!==void 0?this.visit(f):Array.isArray(f)&&f.forEach(function(C){this.visit(C)},this))}},g.prototype.visit=function(l){switch(l.type){case"Pattern":this.visitPattern(l);break;case"Flags":this.visitFlags(l);break;case"Disjunction":this.visitDisjunction(l);break;case"Alternative":this.visitAlternative(l);break;case"StartAnchor":this.visitStartAnchor(l);break;case"EndAnchor":this.visitEndAnchor(l);break;case"WordBoundary":this.visitWordBoundary(l);break;case"NonWordBoundary":this.visitNonWordBoundary(l);break;case"Lookahead":this.visitLookahead(l);break;case"NegativeLookahead":this.visitNegativeLookahead(l);break;case"Character":this.visitCharacter(l);break;case"Set":this.visitSet(l);break;case"Group":this.visitGroup(l);break;case"GroupBackReference":this.visitGroupBackReference(l);break;case"Quantifier":this.visitQuantifier(l);break}this.visitChildren(l)},g.prototype.visitPattern=function(l){},g.prototype.visitFlags=function(l){},g.prototype.visitDisjunction=function(l){},g.prototype.visitAlternative=function(l){},g.prototype.visitStartAnchor=function(l){},g.prototype.visitEndAnchor=function(l){},g.prototype.visitWordBoundary=function(l){},g.prototype.visitNonWordBoundary=function(l){},g.prototype.visitLookahead=function(l){},g.prototype.visitNegativeLookahead=function(l){},g.prototype.visitCharacter=function(l){},g.prototype.visitSet=function(l){},g.prototype.visitGroup=function(l){},g.prototype.visitGroupBackReference=function(l){},g.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:g,VERSION:"0.5.0"}})}),In=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=En(),t={},n=new e.RegExpParser;function r(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function o(){t={}}i.clearRegExpParserCache=o}),Yr=Re(i=>{var e=i&&i.__extends||(function(){var g=function(l,h){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,C){f.__proto__=C}||function(f,C){for(var b in C)Object.prototype.hasOwnProperty.call(C,b)&&(f[b]=C[b])},g(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");g(l,h);function f(){this.constructor=l}l.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=En(),n=Ne(),r=In(),o=ai(),s="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
10
10
  `;function c(g,l){l===void 0&&(l=!1);try{var h=r.getRegExpAst(g),f=A(h.value,{},h.flags.ignoreCase);return f}catch(b){if(b.message===s)l&&n.PRINT_WARNING(""+i.failedOptimizationPrefixMsg+(" Unable to optimize: < "+g.toString()+` >
11
11
  `)+` Complement Sets cannot be automatically optimized.
12
12
  This will disable the lexer's first char optimizations.
@@ -15,32 +15,32 @@
15
15
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),n.PRINT_ERROR(i.failedOptimizationPrefixMsg+`
16
16
  `+(" Failed parsing: < "+g.toString()+` >
17
17
  `)+(" Using the regexp-to-ast library version: "+t.VERSION+`
18
- `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(g,l,h){switch(g.type){case"Disjunction":for(var f=0;f<g.value.length;f++)A(g.value[f],l,h);break;case"Alternative":for(var C=g.value,f=0;f<C.length;f++){var b=C[f];switch(b.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=b;switch(y.type){case"Character":a(y.value,l,h);break;case"Set":if(y.complement===!0)throw Error(s);n.forEach(y.value,function(z){if(typeof z=="number")a(z,l,h);else{var k=z;if(h===!0)for(var P=k.from;P<=k.to;P++)a(P,l,h);else{for(var P=k.from;P<=k.to&&P<o.minOptimizationVal;P++)a(P,l,h);if(k.to>=o.minOptimizationVal)for(var N=k.from>=o.minOptimizationVal?k.from:o.minOptimizationVal,S=k.to,F=o.charCodeToOptimizedIndex(N),_=o.charCodeToOptimizedIndex(S),W=F;W<=_;W++)l[W]=W}}});break;case"Group":A(y.value,l,h);break;default:throw Error("Non Exhaustive Match")}var R=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&m(y)===!1||y.type!=="Group"&&R===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(g,l,h){var f=o.charCodeToOptimizedIndex(g);l[f]=f,h===!0&&d(g,l)}function d(g,l){var h=String.fromCharCode(g),f=h.toUpperCase();if(f!==h){var C=o.charCodeToOptimizedIndex(f.charCodeAt(0));l[C]=C}else{var b=h.toLowerCase();if(b!==h){var C=o.charCodeToOptimizedIndex(b.charCodeAt(0));l[C]=C}}}function u(g,l){return n.find(g.value,function(h){if(typeof h=="number")return n.contains(l,h);var f=h;return n.find(l,function(C){return f.from<=C&&C<=f.to})!==void 0})}function m(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?n.isArray(g.value)?n.every(g.value,m):m(g.value):!1}var p=(function(g){e(l,g);function l(h){var f=g.call(this)||this;return f.targetCharCodes=h,f.found=!1,f}return l.prototype.visitChildren=function(h){if(this.found!==!0){switch(h.type){case"Lookahead":this.visitLookahead(h);return;case"NegativeLookahead":this.visitNegativeLookahead(h);return}g.prototype.visitChildren.call(this,h)}},l.prototype.visitCharacter=function(h){n.contains(this.targetCharCodes,h.value)&&(this.found=!0)},l.prototype.visitSet=function(h){h.complement?u(h,this.targetCharCodes)===void 0&&(this.found=!0):u(h,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function I(g,l){if(l instanceof RegExp){var h=r.getRegExpAst(l),f=new p(g);return f.visit(h),f.found}else return n.find(l,function(C){return n.contains(g,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=I}),ui=Re(i=>{var e=i&&i.__extends||(function(){var G=function(q,j){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,J){Z.__proto__=J}||function(Z,J){for(var le in J)Object.prototype.hasOwnProperty.call(J,le)&&(Z[le]=J[le])},G(q,j)};return function(q,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");G(q,j);function Z(){this.constructor=q}q.prototype=j===null?Object.create(j):(Z.prototype=j.prototype,new Z)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.charCodeToOptimizedIndex=i.minOptimizationVal=i.buildLineBreakIssueMessage=i.LineTerminatorOptimizedTester=i.isShortPattern=i.isCustomPattern=i.cloneEmptyGroups=i.performWarningRuntimeChecks=i.performRuntimeChecks=i.addStickyFlag=i.addStartOfInput=i.findUnreachablePatterns=i.findModesThatDoNotExist=i.findInvalidGroupType=i.findDuplicatePatterns=i.findUnsupportedFlags=i.findStartOfInputAnchor=i.findEmptyMatchRegExps=i.findEndOfInputAnchor=i.findInvalidPatterns=i.findMissingPatterns=i.validatePatterns=i.analyzeTokenTypes=i.enableSticky=i.disableSticky=i.SUPPORT_STICKY=i.MODES=i.DEFAULT_MODE=void 0;var t=yn(),n=jt(),r=Ne(),o=Xr(),s=Bn(),c="PATTERN";i.DEFAULT_MODE="defaultMode",i.MODES="modes",i.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){i.SUPPORT_STICKY=!1}i.disableSticky=A;function a(){i.SUPPORT_STICKY=!0}i.enableSticky=a;function d(G,q){q=r.defaults(q,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
- `],tracer:function(Be,ce){return ce()}});var j=q.tracer;j("initCharCodeToOptimizedIndexMap",function(){de()});var Z;j("Reject Lexer.NA",function(){Z=r.reject(G,function(Be){return Be[c]===n.Lexer.NA})});var J=!1,le;j("Transform Patterns",function(){J=!1,le=r.map(Z,function(Be){var ce=Be[c];if(r.isRegExp(ce)){var v=ce.source;return v.length===1&&v!=="^"&&v!=="$"&&v!=="."&&!ce.ignoreCase?v:v.length===2&&v[0]==="\\"&&!r.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],v[1])?v[1]:q.useSticky?S(ce):N(ce)}else{if(r.isFunction(ce))return J=!0,{exec:ce};if(r.has(ce,"exec"))return J=!0,ce;if(typeof ce=="string"){if(ce.length===1)return ce;var T=ce.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),w=new RegExp(T);return q.useSticky?S(w):N(w)}else throw Error("non exhaustive match")}})});var ye,Te,De,ze,Xe;j("misc mapping",function(){ye=r.map(Z,function(Be){return Be.tokenTypeIdx}),Te=r.map(Z,function(Be){var ce=Be.GROUP;if(ce!==n.Lexer.SKIPPED){if(r.isString(ce))return ce;if(r.isUndefined(ce))return!1;throw Error("non exhaustive match")}}),De=r.map(Z,function(Be){var ce=Be.LONGER_ALT;if(ce){var v=r.indexOf(Z,ce);return v}}),ze=r.map(Z,function(Be){return Be.PUSH_MODE}),Xe=r.map(Z,function(Be){return r.has(Be,"POP_MODE")})});var Fe;j("Line Terminator Handling",function(){var Be=ue(q.lineTerminatorCharacters);Fe=r.map(Z,function(ce){return!1}),q.positionTracking!=="onlyOffset"&&(Fe=r.map(Z,function(ce){if(r.has(ce,"LINE_BREAKS"))return ce.LINE_BREAKS;if(ee(ce,Be)===!1)return o.canMatchCharCode(Be,ce.PATTERN)}))});var M,Y,V,re;j("Misc Mapping #2",function(){M=r.map(Z,$),Y=r.map(le,H),V=r.reduce(Z,function(Be,ce){var v=ce.GROUP;return r.isString(v)&&v!==n.Lexer.SKIPPED&&(Be[v]=[]),Be},{}),re=r.map(le,function(Be,ce){return{pattern:le[ce],longerAlt:De[ce],canLineTerminator:Fe[ce],isCustom:M[ce],short:Y[ce],group:Te[ce],push:ze[ce],pop:Xe[ce],tokenTypeIdx:ye[ce],tokenType:Z[ce]}})});var fe=!0,ke=[];return q.safeMode||j("First Char Optimization",function(){ke=r.reduce(Z,function(Be,ce,v){if(typeof ce.PATTERN=="string"){var T=ce.PATTERN.charCodeAt(0),w=se(T);ie(Be,w,re[v])}else if(r.isArray(ce.START_CHARS_HINT)){var Q;r.forEach(ce.START_CHARS_HINT,function(L){var O=typeof L=="string"?L.charCodeAt(0):L,U=se(O);Q!==U&&(Q=U,ie(Be,U,re[v]))})}else if(r.isRegExp(ce.PATTERN))if(ce.PATTERN.unicode)fe=!1,q.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+ce.PATTERN.toString()+` > pattern.
18
+ `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(g,l,h){switch(g.type){case"Disjunction":for(var f=0;f<g.value.length;f++)A(g.value[f],l,h);break;case"Alternative":for(var C=g.value,f=0;f<C.length;f++){var b=C[f];switch(b.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=b;switch(y.type){case"Character":a(y.value,l,h);break;case"Set":if(y.complement===!0)throw Error(s);n.forEach(y.value,function(q){if(typeof q=="number")a(q,l,h);else{var v=q;if(h===!0)for(var G=v.from;G<=v.to;G++)a(G,l,h);else{for(var G=v.from;G<=v.to&&G<o.minOptimizationVal;G++)a(G,l,h);if(v.to>=o.minOptimizationVal)for(var D=v.from>=o.minOptimizationVal?v.from:o.minOptimizationVal,Q=v.to,F=o.charCodeToOptimizedIndex(D),L=o.charCodeToOptimizedIndex(Q),J=F;J<=L;J++)l[J]=J}}});break;case"Group":A(y.value,l,h);break;default:throw Error("Non Exhaustive Match")}var R=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&m(y)===!1||y.type!=="Group"&&R===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(g,l,h){var f=o.charCodeToOptimizedIndex(g);l[f]=f,h===!0&&d(g,l)}function d(g,l){var h=String.fromCharCode(g),f=h.toUpperCase();if(f!==h){var C=o.charCodeToOptimizedIndex(f.charCodeAt(0));l[C]=C}else{var b=h.toLowerCase();if(b!==h){var C=o.charCodeToOptimizedIndex(b.charCodeAt(0));l[C]=C}}}function u(g,l){return n.find(g.value,function(h){if(typeof h=="number")return n.contains(l,h);var f=h;return n.find(l,function(C){return f.from<=C&&C<=f.to})!==void 0})}function m(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?n.isArray(g.value)?n.every(g.value,m):m(g.value):!1}var p=(function(g){e(l,g);function l(h){var f=g.call(this)||this;return f.targetCharCodes=h,f.found=!1,f}return l.prototype.visitChildren=function(h){if(this.found!==!0){switch(h.type){case"Lookahead":this.visitLookahead(h);return;case"NegativeLookahead":this.visitNegativeLookahead(h);return}g.prototype.visitChildren.call(this,h)}},l.prototype.visitCharacter=function(h){n.contains(this.targetCharCodes,h.value)&&(this.found=!0)},l.prototype.visitSet=function(h){h.complement?u(h,this.targetCharCodes)===void 0&&(this.found=!0):u(h,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function I(g,l){if(l instanceof RegExp){var h=r.getRegExpAst(l),f=new p(g);return f.visit(h),f.found}else return n.find(l,function(C){return n.contains(g,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=I}),ai=Re(i=>{var e=i&&i.__extends||(function(){var P=function(H,Y){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,K){V.__proto__=K}||function(V,K){for(var ce in K)Object.prototype.hasOwnProperty.call(K,ce)&&(V[ce]=K[ce])},P(H,Y)};return function(H,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");P(H,Y);function V(){this.constructor=H}H.prototype=Y===null?Object.create(Y):(V.prototype=Y.prototype,new V)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.charCodeToOptimizedIndex=i.minOptimizationVal=i.buildLineBreakIssueMessage=i.LineTerminatorOptimizedTester=i.isShortPattern=i.isCustomPattern=i.cloneEmptyGroups=i.performWarningRuntimeChecks=i.performRuntimeChecks=i.addStickyFlag=i.addStartOfInput=i.findUnreachablePatterns=i.findModesThatDoNotExist=i.findInvalidGroupType=i.findDuplicatePatterns=i.findUnsupportedFlags=i.findStartOfInputAnchor=i.findEmptyMatchRegExps=i.findEndOfInputAnchor=i.findInvalidPatterns=i.findMissingPatterns=i.validatePatterns=i.analyzeTokenTypes=i.enableSticky=i.disableSticky=i.SUPPORT_STICKY=i.MODES=i.DEFAULT_MODE=void 0;var t=En(),n=Mt(),r=Ne(),o=Yr(),s=In(),c="PATTERN";i.DEFAULT_MODE="defaultMode",i.MODES="modes",i.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){i.SUPPORT_STICKY=!1}i.disableSticky=A;function a(){i.SUPPORT_STICKY=!0}i.enableSticky=a;function d(P,H){H=r.defaults(H,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
+ `],tracer:function(ye,le){return le()}});var Y=H.tracer;Y("initCharCodeToOptimizedIndexMap",function(){de()});var V;Y("Reject Lexer.NA",function(){V=r.reject(P,function(ye){return ye[c]===n.Lexer.NA})});var K=!1,ce;Y("Transform Patterns",function(){K=!1,ce=r.map(V,function(ye){var le=ye[c];if(r.isRegExp(le)){var Ge=le.source;return Ge.length===1&&Ge!=="^"&&Ge!=="$"&&Ge!=="."&&!le.ignoreCase?Ge:Ge.length===2&&Ge[0]==="\\"&&!r.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],Ge[1])?Ge[1]:H.useSticky?Q(le):D(le)}else{if(r.isFunction(le))return K=!0,{exec:le};if(r.has(le,"exec"))return K=!0,le;if(typeof le=="string"){if(le.length===1)return le;var k=le.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),w=new RegExp(k);return H.useSticky?Q(w):D(w)}else throw Error("non exhaustive match")}})});var Be,Te,De,Ve,Je;Y("misc mapping",function(){Be=r.map(V,function(ye){return ye.tokenTypeIdx}),Te=r.map(V,function(ye){var le=ye.GROUP;if(le!==n.Lexer.SKIPPED){if(r.isString(le))return le;if(r.isUndefined(le))return!1;throw Error("non exhaustive match")}}),De=r.map(V,function(ye){var le=ye.LONGER_ALT;if(le){var Ge=r.indexOf(V,le);return Ge}}),Ve=r.map(V,function(ye){return ye.PUSH_MODE}),Je=r.map(V,function(ye){return r.has(ye,"POP_MODE")})});var qe;Y("Line Terminator Handling",function(){var ye=ue(H.lineTerminatorCharacters);qe=r.map(V,function(le){return!1}),H.positionTracking!=="onlyOffset"&&(qe=r.map(V,function(le){if(r.has(le,"LINE_BREAKS"))return le.LINE_BREAKS;if(ee(le,ye)===!1)return o.canMatchCharCode(ye,le.PATTERN)}))});var O,X,z,re;Y("Misc Mapping #2",function(){O=r.map(V,$),X=r.map(ce,j),z=r.reduce(V,function(ye,le){var Ge=le.GROUP;return r.isString(Ge)&&Ge!==n.Lexer.SKIPPED&&(ye[Ge]=[]),ye},{}),re=r.map(ce,function(ye,le){return{pattern:ce[le],longerAlt:De[le],canLineTerminator:qe[le],isCustom:O[le],short:X[le],group:Te[le],push:Ve[le],pop:Je[le],tokenTypeIdx:Be[le],tokenType:V[le]}})});var fe=!0,Qe=[];return H.safeMode||Y("First Char Optimization",function(){Qe=r.reduce(V,function(ye,le,Ge){if(typeof le.PATTERN=="string"){var k=le.PATTERN.charCodeAt(0),w=se(k);ie(ye,w,re[Ge])}else if(r.isArray(le.START_CHARS_HINT)){var B;r.forEach(le.START_CHARS_HINT,function(T){var N=typeof T=="string"?T.charCodeAt(0):T,M=se(N);B!==M&&(B=M,ie(ye,M,re[Ge]))})}else if(r.isRegExp(le.PATTERN))if(le.PATTERN.unicode)fe=!1,H.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+le.PATTERN.toString()+` > pattern.
20
20
  `)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
21
21
  This will disable the lexer's first char optimizations.
22
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var B=o.getOptimizedStartCodesIndices(ce.PATTERN,q.ensureOptimizations);r.isEmpty(B)&&(fe=!1),r.forEach(B,function(L){ie(Be,L,re[v])})}else q.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+ce.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
22
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var S=o.getOptimizedStartCodesIndices(le.PATTERN,H.ensureOptimizations);r.isEmpty(S)&&(fe=!1),r.forEach(S,function(T){ie(ye,T,re[Ge])})}else H.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+le.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
23
23
  `)+` This will disable the lexer's first char optimizations.
24
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),fe=!1;return Be},[])}),j("ArrayPacking",function(){ke=r.packArray(ke)}),{emptyGroups:V,patternIdxToConfig:re,charCodeToPatternIdxToConfig:ke,hasCustom:J,canBeOptimized:fe}}i.analyzeTokenTypes=d;function u(G,q){var j=[],Z=p(G);j=j.concat(Z.errors);var J=I(Z.valid),le=J.valid;return j=j.concat(J.errors),j=j.concat(m(le)),j=j.concat(R(le)),j=j.concat(x(le,q)),j=j.concat(z(le)),j}i.validatePatterns=u;function m(G){var q=[],j=r.filter(G,function(Z){return r.isRegExp(Z[c])});return q=q.concat(l(j)),q=q.concat(C(j)),q=q.concat(b(j)),q=q.concat(y(j)),q=q.concat(h(j)),q}function p(G){var q=r.filter(G,function(J){return!r.has(J,c)}),j=r.map(q,function(J){return{message:"Token Type: ->"+J.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[J]}}),Z=r.difference(G,q);return{errors:j,valid:Z}}i.findMissingPatterns=p;function I(G){var q=r.filter(G,function(J){var le=J[c];return!r.isRegExp(le)&&!r.isFunction(le)&&!r.has(le,"exec")&&!r.isString(le)}),j=r.map(q,function(J){return{message:"Token Type: ->"+J.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:n.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[J]}}),Z=r.difference(G,q);return{errors:j,valid:Z}}i.findInvalidPatterns=I;var g=/[^\\][\$]/;function l(G){var q=(function(J){e(le,J);function le(){var ye=J!==null&&J.apply(this,arguments)||this;return ye.found=!1,ye}return le.prototype.visitEndAnchor=function(ye){this.found=!0},le})(t.BaseRegExpVisitor),j=r.filter(G,function(J){var le=J[c];try{var ye=s.getRegExpAst(le),Te=new q;return Te.visit(ye),Te.found}catch{return g.test(le.source)}}),Z=r.map(j,function(J){return{message:`Unexpected RegExp Anchor Error:
25
- Token Type: ->`+J.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[J]}});return Z}i.findEndOfInputAnchor=l;function h(G){var q=r.filter(G,function(Z){var J=Z[c];return J.test("")}),j=r.map(q,function(Z){return{message:"Token Type: ->"+Z.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[Z]}});return j}i.findEmptyMatchRegExps=h;var f=/[^\\[][\^]|^\^/;function C(G){var q=(function(J){e(le,J);function le(){var ye=J!==null&&J.apply(this,arguments)||this;return ye.found=!1,ye}return le.prototype.visitStartAnchor=function(ye){this.found=!0},le})(t.BaseRegExpVisitor),j=r.filter(G,function(J){var le=J[c];try{var ye=s.getRegExpAst(le),Te=new q;return Te.visit(ye),Te.found}catch{return f.test(le.source)}}),Z=r.map(j,function(J){return{message:`Unexpected RegExp Anchor Error:
27
- Token Type: ->`+J.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[J]}});return Z}i.findStartOfInputAnchor=C;function b(G){var q=r.filter(G,function(Z){var J=Z[c];return J instanceof RegExp&&(J.multiline||J.global)}),j=r.map(q,function(Z){return{message:"Token Type: ->"+Z.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[Z]}});return j}i.findUnsupportedFlags=b;function y(G){var q=[],j=r.map(G,function(le){return r.reduce(G,function(ye,Te){return le.PATTERN.source===Te.PATTERN.source&&!r.contains(q,Te)&&Te.PATTERN!==n.Lexer.NA&&(q.push(Te),ye.push(Te)),ye},[])});j=r.compact(j);var Z=r.filter(j,function(le){return le.length>1}),J=r.map(Z,function(le){var ye=r.map(le,function(De){return De.name}),Te=r.first(le).PATTERN;return{message:"The same RegExp pattern ->"+Te+"<-"+("has been used in all of the following Token Types: "+ye.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return J}i.findDuplicatePatterns=y;function R(G){var q=r.filter(G,function(Z){if(!r.has(Z,"GROUP"))return!1;var J=Z.GROUP;return J!==n.Lexer.SKIPPED&&J!==n.Lexer.NA&&!r.isString(J)}),j=r.map(q,function(Z){return{message:"Token Type: ->"+Z.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[Z]}});return j}i.findInvalidGroupType=R;function x(G,q){var j=r.filter(G,function(J){return J.PUSH_MODE!==void 0&&!r.contains(q,J.PUSH_MODE)}),Z=r.map(j,function(J){var le="Token Type: ->"+J.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+J.PUSH_MODE+"<-which does not exist";return{message:le,type:n.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[J]}});return Z}i.findModesThatDoNotExist=x;function z(G){var q=[],j=r.reduce(G,function(Z,J,le){var ye=J.PATTERN;return ye===n.Lexer.NA||(r.isString(ye)?Z.push({str:ye,idx:le,tokenType:J}):r.isRegExp(ye)&&P(ye)&&Z.push({str:ye.source,idx:le,tokenType:J})),Z},[]);return r.forEach(G,function(Z,J){r.forEach(j,function(le){var ye=le.str,Te=le.idx,De=le.tokenType;if(J<Te&&k(ye,Z.PATTERN)){var ze="Token: ->"+De.name+`<- can never be matched.
29
- `+("Because it appears AFTER the Token Type ->"+Z.name+"<-")+`in the lexer's definition.
30
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;q.push({message:ze,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[Z,De]})}})}),q}i.findUnreachablePatterns=z;function k(G,q){if(r.isRegExp(q)){var j=q.exec(G);return j!==null&&j.index===0}else{if(r.isFunction(q))return q(G,0,[],{});if(r.has(q,"exec"))return q.exec(G,0,[],{});if(typeof q=="string")return q===G;throw Error("non exhaustive match")}}function P(G){var q=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(q,function(j){return G.source.indexOf(j)!==-1})===void 0}function N(G){var q=G.ignoreCase?"i":"";return new RegExp("^(?:"+G.source+")",q)}i.addStartOfInput=N;function S(G){var q=G.ignoreCase?"iy":"y";return new RegExp(""+G.source,q)}i.addStickyFlag=S;function F(G,q,j){var Z=[];return r.has(G,i.DEFAULT_MODE)||Z.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.DEFAULT_MODE+`> property in its definition
31
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(G,i.MODES)||Z.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.MODES+`> property in its definition
32
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(G,i.MODES)&&r.has(G,i.DEFAULT_MODE)&&!r.has(G.modes,G.defaultMode)&&Z.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+G.defaultMode+`>which does not exist
33
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(G,i.MODES)&&r.forEach(G.modes,function(J,le){r.forEach(J,function(ye,Te){r.isUndefined(ye)&&Z.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+le+"> at index: <"+Te+`>
34
- `),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),Z}i.performRuntimeChecks=F;function _(G,q,j){var Z=[],J=!1,le=r.compact(r.flatten(r.mapValues(G.modes,function(De){return De}))),ye=r.reject(le,function(De){return De[c]===n.Lexer.NA}),Te=ue(j);return q&&r.forEach(ye,function(De){var ze=ee(De,Te);if(ze!==!1){var Xe=ne(De,ze),Fe={message:Xe,type:ze.issue,tokenType:De};Z.push(Fe)}else r.has(De,"LINE_BREAKS")?De.LINE_BREAKS===!0&&(J=!0):o.canMatchCharCode(Te,De.PATTERN)&&(J=!0)}),q&&!J&&Z.push({message:`Warning: No LINE_BREAKS Found.
24
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),fe=!1;return ye},[])}),Y("ArrayPacking",function(){Qe=r.packArray(Qe)}),{emptyGroups:z,patternIdxToConfig:re,charCodeToPatternIdxToConfig:Qe,hasCustom:K,canBeOptimized:fe}}i.analyzeTokenTypes=d;function u(P,H){var Y=[],V=p(P);Y=Y.concat(V.errors);var K=I(V.valid),ce=K.valid;return Y=Y.concat(K.errors),Y=Y.concat(m(ce)),Y=Y.concat(R(ce)),Y=Y.concat(x(ce,H)),Y=Y.concat(q(ce)),Y}i.validatePatterns=u;function m(P){var H=[],Y=r.filter(P,function(V){return r.isRegExp(V[c])});return H=H.concat(l(Y)),H=H.concat(C(Y)),H=H.concat(b(Y)),H=H.concat(y(Y)),H=H.concat(h(Y)),H}function p(P){var H=r.filter(P,function(K){return!r.has(K,c)}),Y=r.map(H,function(K){return{message:"Token Type: ->"+K.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[K]}}),V=r.difference(P,H);return{errors:Y,valid:V}}i.findMissingPatterns=p;function I(P){var H=r.filter(P,function(K){var ce=K[c];return!r.isRegExp(ce)&&!r.isFunction(ce)&&!r.has(ce,"exec")&&!r.isString(ce)}),Y=r.map(H,function(K){return{message:"Token Type: ->"+K.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:n.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[K]}}),V=r.difference(P,H);return{errors:Y,valid:V}}i.findInvalidPatterns=I;var g=/[^\\][\$]/;function l(P){var H=(function(K){e(ce,K);function ce(){var Be=K!==null&&K.apply(this,arguments)||this;return Be.found=!1,Be}return ce.prototype.visitEndAnchor=function(Be){this.found=!0},ce})(t.BaseRegExpVisitor),Y=r.filter(P,function(K){var ce=K[c];try{var Be=s.getRegExpAst(ce),Te=new H;return Te.visit(Be),Te.found}catch{return g.test(ce.source)}}),V=r.map(Y,function(K){return{message:`Unexpected RegExp Anchor Error:
25
+ Token Type: ->`+K.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[K]}});return V}i.findEndOfInputAnchor=l;function h(P){var H=r.filter(P,function(V){var K=V[c];return K.test("")}),Y=r.map(H,function(V){return{message:"Token Type: ->"+V.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[V]}});return Y}i.findEmptyMatchRegExps=h;var f=/[^\\[][\^]|^\^/;function C(P){var H=(function(K){e(ce,K);function ce(){var Be=K!==null&&K.apply(this,arguments)||this;return Be.found=!1,Be}return ce.prototype.visitStartAnchor=function(Be){this.found=!0},ce})(t.BaseRegExpVisitor),Y=r.filter(P,function(K){var ce=K[c];try{var Be=s.getRegExpAst(ce),Te=new H;return Te.visit(Be),Te.found}catch{return f.test(ce.source)}}),V=r.map(Y,function(K){return{message:`Unexpected RegExp Anchor Error:
27
+ Token Type: ->`+K.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[K]}});return V}i.findStartOfInputAnchor=C;function b(P){var H=r.filter(P,function(V){var K=V[c];return K instanceof RegExp&&(K.multiline||K.global)}),Y=r.map(H,function(V){return{message:"Token Type: ->"+V.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[V]}});return Y}i.findUnsupportedFlags=b;function y(P){var H=[],Y=r.map(P,function(ce){return r.reduce(P,function(Be,Te){return ce.PATTERN.source===Te.PATTERN.source&&!r.contains(H,Te)&&Te.PATTERN!==n.Lexer.NA&&(H.push(Te),Be.push(Te)),Be},[])});Y=r.compact(Y);var V=r.filter(Y,function(ce){return ce.length>1}),K=r.map(V,function(ce){var Be=r.map(ce,function(De){return De.name}),Te=r.first(ce).PATTERN;return{message:"The same RegExp pattern ->"+Te+"<-"+("has been used in all of the following Token Types: "+Be.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:ce}});return K}i.findDuplicatePatterns=y;function R(P){var H=r.filter(P,function(V){if(!r.has(V,"GROUP"))return!1;var K=V.GROUP;return K!==n.Lexer.SKIPPED&&K!==n.Lexer.NA&&!r.isString(K)}),Y=r.map(H,function(V){return{message:"Token Type: ->"+V.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[V]}});return Y}i.findInvalidGroupType=R;function x(P,H){var Y=r.filter(P,function(K){return K.PUSH_MODE!==void 0&&!r.contains(H,K.PUSH_MODE)}),V=r.map(Y,function(K){var ce="Token Type: ->"+K.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+K.PUSH_MODE+"<-which does not exist";return{message:ce,type:n.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[K]}});return V}i.findModesThatDoNotExist=x;function q(P){var H=[],Y=r.reduce(P,function(V,K,ce){var Be=K.PATTERN;return Be===n.Lexer.NA||(r.isString(Be)?V.push({str:Be,idx:ce,tokenType:K}):r.isRegExp(Be)&&G(Be)&&V.push({str:Be.source,idx:ce,tokenType:K})),V},[]);return r.forEach(P,function(V,K){r.forEach(Y,function(ce){var Be=ce.str,Te=ce.idx,De=ce.tokenType;if(K<Te&&v(Be,V.PATTERN)){var Ve="Token: ->"+De.name+`<- can never be matched.
29
+ `+("Because it appears AFTER the Token Type ->"+V.name+"<-")+`in the lexer's definition.
30
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;H.push({message:Ve,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[V,De]})}})}),H}i.findUnreachablePatterns=q;function v(P,H){if(r.isRegExp(H)){var Y=H.exec(P);return Y!==null&&Y.index===0}else{if(r.isFunction(H))return H(P,0,[],{});if(r.has(H,"exec"))return H.exec(P,0,[],{});if(typeof H=="string")return H===P;throw Error("non exhaustive match")}}function G(P){var H=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(H,function(Y){return P.source.indexOf(Y)!==-1})===void 0}function D(P){var H=P.ignoreCase?"i":"";return new RegExp("^(?:"+P.source+")",H)}i.addStartOfInput=D;function Q(P){var H=P.ignoreCase?"iy":"y";return new RegExp(""+P.source,H)}i.addStickyFlag=Q;function F(P,H,Y){var V=[];return r.has(P,i.DEFAULT_MODE)||V.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.DEFAULT_MODE+`> property in its definition
31
+ `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(P,i.MODES)||V.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.MODES+`> property in its definition
32
+ `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(P,i.MODES)&&r.has(P,i.DEFAULT_MODE)&&!r.has(P.modes,P.defaultMode)&&V.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+P.defaultMode+`>which does not exist
33
+ `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(P,i.MODES)&&r.forEach(P.modes,function(K,ce){r.forEach(K,function(Be,Te){r.isUndefined(Be)&&V.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+ce+"> at index: <"+Te+`>
34
+ `),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),V}i.performRuntimeChecks=F;function L(P,H,Y){var V=[],K=!1,ce=r.compact(r.flatten(r.mapValues(P.modes,function(De){return De}))),Be=r.reject(ce,function(De){return De[c]===n.Lexer.NA}),Te=ue(Y);return H&&r.forEach(Be,function(De){var Ve=ee(De,Te);if(Ve!==!1){var Je=ne(De,Ve),qe={message:Je,type:Ve.issue,tokenType:De};V.push(qe)}else r.has(De,"LINE_BREAKS")?De.LINE_BREAKS===!0&&(K=!0):o.canMatchCharCode(Te,De.PATTERN)&&(K=!0)}),H&&!K&&V.push({message:`Warning: No LINE_BREAKS Found.
35
35
  This Lexer has been defined to track line and column information,
36
36
  But none of the Token Types can be identified as matching a line terminator.
37
37
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
38
- for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),Z}i.performWarningRuntimeChecks=_;function W(G){var q={},j=r.keys(G);return r.forEach(j,function(Z){var J=G[Z];if(r.isArray(J))q[Z]=[];else throw Error("non exhaustive match")}),q}i.cloneEmptyGroups=W;function $(G){var q=G.PATTERN;if(r.isRegExp(q))return!1;if(r.isFunction(q)||r.has(q,"exec"))return!0;if(r.isString(q))return!1;throw Error("non exhaustive match")}i.isCustomPattern=$;function H(G){return r.isString(G)&&G.length===1?G.charCodeAt(0):!1}i.isShortPattern=H,i.LineTerminatorOptimizedTester={test:function(G){for(var q=G.length,j=this.lastIndex;j<q;j++){var Z=G.charCodeAt(j);if(Z===10)return this.lastIndex=j+1,!0;if(Z===13)return G.charCodeAt(j+1)===10?this.lastIndex=j+2:this.lastIndex=j+1,!0}return!1},lastIndex:0};function ee(G,q){if(r.has(G,"LINE_BREAKS"))return!1;if(r.isRegExp(G.PATTERN)){try{o.canMatchCharCode(q,G.PATTERN)}catch(j){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:j.message}}return!1}else{if(r.isString(G.PATTERN))return!1;if($(G))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function ne(G,q){if(q.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
39
- `+(" The problem is in the <"+G.name+`> Token Type
40
- `)+(" Root cause: "+q.errMsg+`.
41
- `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(q.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
- `+(" The problem is in the <"+G.name+`> Token Type
43
- `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=ne;function ue(G){var q=r.map(G,function(j){return r.isString(j)&&j.length>0?j.charCodeAt(0):j});return q}function ie(G,q,j){G[q]===void 0?G[q]=[j]:G[q].push(j)}i.minOptimizationVal=256;var X=[];function se(G){return G<i.minOptimizationVal?G:X[G]}i.charCodeToOptimizedIndex=se;function de(){if(r.isEmpty(X)){X=new Array(65536);for(var G=0;G<65536;G++)X[G]=G>255?255+~~(G/255):G}}}),kt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isTokenType=i.hasExtendingTokensTypesMapProperty=i.hasExtendingTokensTypesProperty=i.hasCategoriesProperty=i.hasShortKeyProperty=i.singleAssignCategoriesToksMap=i.assignCategoriesMapProp=i.assignCategoriesTokensProp=i.assignTokenDefaultProps=i.expandCategories=i.augmentTokenTypes=i.tokenIdxToClass=i.tokenShortNameIdx=i.tokenStructuredMatcherNoCategories=i.tokenStructuredMatcher=void 0;var e=Ne();function t(g,l){var h=g.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!0}i.tokenStructuredMatcher=t;function n(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}i.tokenStructuredMatcherNoCategories=n,i.tokenShortNameIdx=1,i.tokenIdxToClass={};function r(g){var l=o(g);s(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}i.augmentTokenTypes=r;function o(g){for(var l=e.cloneArr(g),h=g,f=!0;f;){h=e.compact(e.flatten(e.map(h,function(b){return b.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?f=!1:h=C}return l}i.expandCategories=o;function s(g){e.forEach(g,function(l){d(l)||(i.tokenIdxToClass[i.tokenShortNameIdx]=l,l.tokenTypeIdx=i.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),m(l)||(l.categoryMatches=[]),p(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=s;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,f){l.categoryMatches.push(i.tokenIdxToClass[f].tokenTypeIdx)})})}i.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}i.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var f=g.concat(l);e.contains(f,h)||a(f,h)})}i.singleAssignCategoriesToksMap=a;function d(g){return e.has(g,"tokenTypeIdx")}i.hasShortKeyProperty=d;function u(g){return e.has(g,"CATEGORIES")}i.hasCategoriesProperty=u;function m(g){return e.has(g,"categoryMatches")}i.hasExtendingTokensTypesProperty=m;function p(g){return e.has(g,"categoryMatchesMap")}i.hasExtendingTokensTypesMapProperty=p;function I(g){return e.has(g,"tokenTypeIdx")}i.isTokenType=I}),hi=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultLexerErrorProvider=void 0,i.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),jt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=ui(),t=Ne(),n=kt(),r=hi(),o=Bn();(function(A){A[A.MISSING_PATTERN=0]="MISSING_PATTERN",A[A.INVALID_PATTERN=1]="INVALID_PATTERN",A[A.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",A[A.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",A[A.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",A[A.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",A[A.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",A[A.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",A[A.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",A[A.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",A[A.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",A[A.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",A[A.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",A[A.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",A[A.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",A[A.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",A[A.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(i.LexerDefinitionErrorType||(i.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
38
+ for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),V}i.performWarningRuntimeChecks=L;function J(P){var H={},Y=r.keys(P);return r.forEach(Y,function(V){var K=P[V];if(r.isArray(K))H[V]=[];else throw Error("non exhaustive match")}),H}i.cloneEmptyGroups=J;function $(P){var H=P.PATTERN;if(r.isRegExp(H))return!1;if(r.isFunction(H)||r.has(H,"exec"))return!0;if(r.isString(H))return!1;throw Error("non exhaustive match")}i.isCustomPattern=$;function j(P){return r.isString(P)&&P.length===1?P.charCodeAt(0):!1}i.isShortPattern=j,i.LineTerminatorOptimizedTester={test:function(P){for(var H=P.length,Y=this.lastIndex;Y<H;Y++){var V=P.charCodeAt(Y);if(V===10)return this.lastIndex=Y+1,!0;if(V===13)return P.charCodeAt(Y+1)===10?this.lastIndex=Y+2:this.lastIndex=Y+1,!0}return!1},lastIndex:0};function ee(P,H){if(r.has(P,"LINE_BREAKS"))return!1;if(r.isRegExp(P.PATTERN)){try{o.canMatchCharCode(H,P.PATTERN)}catch(Y){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:Y.message}}return!1}else{if(r.isString(P.PATTERN))return!1;if($(P))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function ne(P,H){if(H.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
39
+ `+(" The problem is in the <"+P.name+`> Token Type
40
+ `)+(" Root cause: "+H.errMsg+`.
41
+ `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(H.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
+ `+(" The problem is in the <"+P.name+`> Token Type
43
+ `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=ne;function ue(P){var H=r.map(P,function(Y){return r.isString(Y)&&Y.length>0?Y.charCodeAt(0):Y});return H}function ie(P,H,Y){P[H]===void 0?P[H]=[Y]:P[H].push(Y)}i.minOptimizationVal=256;var Z=[];function se(P){return P<i.minOptimizationVal?P:Z[P]}i.charCodeToOptimizedIndex=se;function de(){if(r.isEmpty(Z)){Z=new Array(65536);for(var P=0;P<65536;P++)Z[P]=P>255?255+~~(P/255):P}}}),kt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isTokenType=i.hasExtendingTokensTypesMapProperty=i.hasExtendingTokensTypesProperty=i.hasCategoriesProperty=i.hasShortKeyProperty=i.singleAssignCategoriesToksMap=i.assignCategoriesMapProp=i.assignCategoriesTokensProp=i.assignTokenDefaultProps=i.expandCategories=i.augmentTokenTypes=i.tokenIdxToClass=i.tokenShortNameIdx=i.tokenStructuredMatcherNoCategories=i.tokenStructuredMatcher=void 0;var e=Ne();function t(g,l){var h=g.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!0}i.tokenStructuredMatcher=t;function n(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}i.tokenStructuredMatcherNoCategories=n,i.tokenShortNameIdx=1,i.tokenIdxToClass={};function r(g){var l=o(g);s(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}i.augmentTokenTypes=r;function o(g){for(var l=e.cloneArr(g),h=g,f=!0;f;){h=e.compact(e.flatten(e.map(h,function(b){return b.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?f=!1:h=C}return l}i.expandCategories=o;function s(g){e.forEach(g,function(l){d(l)||(i.tokenIdxToClass[i.tokenShortNameIdx]=l,l.tokenTypeIdx=i.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),m(l)||(l.categoryMatches=[]),p(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=s;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,f){l.categoryMatches.push(i.tokenIdxToClass[f].tokenTypeIdx)})})}i.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}i.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var f=g.concat(l);e.contains(f,h)||a(f,h)})}i.singleAssignCategoriesToksMap=a;function d(g){return e.has(g,"tokenTypeIdx")}i.hasShortKeyProperty=d;function u(g){return e.has(g,"CATEGORIES")}i.hasCategoriesProperty=u;function m(g){return e.has(g,"categoryMatches")}i.hasExtendingTokensTypesProperty=m;function p(g){return e.has(g,"categoryMatchesMap")}i.hasExtendingTokensTypesMapProperty=p;function I(g){return e.has(g,"tokenTypeIdx")}i.isTokenType=I}),Ai=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultLexerErrorProvider=void 0,i.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),Mt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=ai(),t=Ne(),n=kt(),r=Ai(),o=In();(function(A){A[A.MISSING_PATTERN=0]="MISSING_PATTERN",A[A.INVALID_PATTERN=1]="INVALID_PATTERN",A[A.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",A[A.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",A[A.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",A[A.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",A[A.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",A[A.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",A[A.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",A[A.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",A[A.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",A[A.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",A[A.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",A[A.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",A[A.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",A[A.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",A[A.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(i.LexerDefinitionErrorType||(i.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
44
44
  `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:r.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(s);var c=(function(){function A(a,d){var u=this;if(d===void 0&&(d=s),this.lexerDefinition=a,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof d=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
45
45
  a boolean 2nd argument is no longer supported`);this.config=t.merge(s,d);var m=this.config.traceInitPerf;m===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof m=="number"&&(this.traceInitMaxIdent=m,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var p,I=!0;u.TRACE_INIT("Lexer Config handling",function(){if(u.config.lineTerminatorsPattern===s.lineTerminatorsPattern)u.config.lineTerminatorsPattern=e.LineTerminatorOptimizedTester;else if(u.config.lineTerminatorCharacters===s.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
46
46
  For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(d.safeMode&&d.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');u.trackStartLines=/full|onlyStart/i.test(u.config.positionTracking),u.trackEndLines=/full/i.test(u.config.positionTracking),t.isArray(a)?(p={modes:{}},p.modes[e.DEFAULT_MODE]=t.cloneArr(a),p[e.DEFAULT_MODE]=e.DEFAULT_MODE):(I=!1,p=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(p,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(p,u.trackStartLines,u.config.lineTerminatorCharacters))})),p.modes=p.modes?p.modes:{},t.forEach(p.modes,function(f,C){p.modes[C]=t.reject(f,function(b){return t.isUndefined(b)})});var g=t.keys(p.modes);if(t.forEach(p.modes,function(f,C){u.TRACE_INIT("Mode: <"+C+"> processing",function(){if(u.modes.push(C),u.config.skipValidations===!1&&u.TRACE_INIT("validatePatterns",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.validatePatterns(f,g))}),t.isEmpty(u.lexerDefinitionErrors)){n.augmentTokenTypes(f);var b;u.TRACE_INIT("analyzeTokenTypes",function(){b=e.analyzeTokenTypes(f,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:d.positionTracking,ensureOptimizations:d.ensureOptimizations,safeMode:d.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=b.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=b.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,b.emptyGroups),u.hasCustom=b.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=b.canBeOptimized}})}),u.defaultMode=p.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(f){return f.message}),h=l.join(`-----------------------
@@ -49,8 +49,8 @@ a boolean 2nd argument is no longer supported`);this.config=t.merge(s,d);var m=t
49
49
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
50
50
  Or inspect the console log for details on how to resolve these issues.`)}),u.TRACE_INIT("clearRegExpParserCache",function(){o.clearRegExpParserCache()}),u.TRACE_INIT("toFastProperties",function(){t.toFastProperties(u)})})}return A.prototype.tokenize=function(a,d){if(d===void 0&&(d=this.defaultMode),!t.isEmpty(this.lexerDefinitionErrors)){var u=t.map(this.lexerDefinitionErrors,function(I){return I.message}),m=u.join(`-----------------------
51
51
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
52
- `+m)}var p=this.tokenizeInternal(a,d);return p},A.prototype.tokenizeInternal=function(a,d){var u=this,m,p,I,g,l,h,f,C,b,y,R,x,z,k,P=a,N=P.length,S=0,F=0,_=this.hasCustom?0:Math.floor(a.length/10),W=new Array(_),$=[],H=this.trackStartLines?1:void 0,ee=this.trackStartLines?1:void 0,ne=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,ie=this.config.lineTerminatorsPattern,X=0,se=[],de=[],G=[],q=[];Object.freeze(q);var j=void 0;function Z(){return se}function J(Q){var B=e.charCodeToOptimizedIndex(Q),L=de[B];return L===void 0?q:L}var le=function(Q){if(G.length===1&&Q.tokenType.PUSH_MODE===void 0){var B=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Q);$.push({offset:Q.startOffset,line:Q.startLine!==void 0?Q.startLine:void 0,column:Q.startColumn!==void 0?Q.startColumn:void 0,length:Q.image.length,message:B})}else{G.pop();var L=t.last(G);se=u.patternIdxToConfig[L],de=u.charCodeToPatternIdxToConfig[L],X=se.length;var O=u.canModeBeOptimized[L]&&u.config.safeMode===!1;de&&O?j=J:j=Z}};function ye(Q){G.push(Q),de=this.charCodeToPatternIdxToConfig[Q],se=this.patternIdxToConfig[Q],X=se.length,X=se.length;var B=this.canModeBeOptimized[Q]&&this.config.safeMode===!1;de&&B?j=J:j=Z}ye.call(this,d);for(var Te;S<N;){l=null;var De=P.charCodeAt(S),ze=j(De),Xe=ze.length;for(m=0;m<Xe;m++){Te=ze[m];var Fe=Te.pattern;h=null;var M=Te.short;if(M!==!1?De===M&&(l=Fe):Te.isCustom===!0?(k=Fe.exec(P,S,W,ne),k!==null?(l=k[0],k.payload!==void 0&&(h=k.payload)):l=null):(this.updateLastIndex(Fe,S),l=this.match(Fe,a,S)),l!==null){if(g=Te.longerAlt,g!==void 0){var Y=se[g],V=Y.pattern;f=null,Y.isCustom===!0?(k=V.exec(P,S,W,ne),k!==null?(I=k[0],k.payload!==void 0&&(f=k.payload)):I=null):(this.updateLastIndex(V,S),I=this.match(V,a,S)),I&&I.length>l.length&&(l=I,h=f,Te=Y)}break}}if(l!==null){if(C=l.length,b=Te.group,b!==void 0&&(y=Te.tokenTypeIdx,R=this.createTokenInstance(l,S,y,Te.tokenType,H,ee,C),this.handlePayload(R,h),b===!1?F=this.addToken(W,F,R):ne[b].push(R)),a=this.chopInput(a,C),S=S+C,ee=this.computeNewColumn(ee,C),ue===!0&&Te.canLineTerminator===!0){var re=0,fe=void 0,ke=void 0;ie.lastIndex=0;do fe=ie.test(l),fe===!0&&(ke=ie.lastIndex-1,re++);while(fe===!0);re!==0&&(H=H+re,ee=C-ke,this.updateTokenEndLineColumnLocation(R,b,ke,re,H,ee,C))}this.handleModes(Te,le,ye,R)}else{for(var Be=S,ce=H,v=ee,T=!1;!T&&S<N;)for(P.charCodeAt(S),a=this.chopInput(a,1),S++,p=0;p<X;p++){var w=se[p],Fe=w.pattern,M=w.short;if(M!==!1?P.charCodeAt(S)===M&&(T=!0):w.isCustom===!0?T=Fe.exec(P,S,W,ne)!==null:(this.updateLastIndex(Fe,S),T=Fe.exec(a)!==null),T===!0)break}x=S-Be,z=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(P,Be,x,ce,v),$.push({offset:Be,line:ce,column:v,length:x,message:z})}}return this.hasCustom||(W.length=F),{tokens:W,groups:ne,errors:$}},A.prototype.handleModes=function(a,d,u,m){if(a.pop===!0){var p=a.push;d(m),p!==void 0&&u.call(this,p)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,d){return a.substring(d)},A.prototype.updateLastIndex=function(a,d){a.lastIndex=d},A.prototype.updateTokenEndLineColumnLocation=function(a,d,u,m,p,I,g){var l,h;d!==void 0&&(l=u===g-1,h=l?-1:0,m===1&&l===!0||(a.endLine=p+h,a.endColumn=I-1+-h))},A.prototype.computeNewColumn=function(a,d){return a+d},A.prototype.createTokenInstance=function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];return null},A.prototype.createOffsetOnlyToken=function(a,d,u,m){return{image:a,startOffset:d,tokenTypeIdx:u,tokenType:m}},A.prototype.createStartOnlyToken=function(a,d,u,m,p,I){return{image:a,startOffset:d,startLine:p,startColumn:I,tokenTypeIdx:u,tokenType:m}},A.prototype.createFullToken=function(a,d,u,m,p,I,g){return{image:a,startOffset:d,endOffset:d+g-1,startLine:p,endLine:p,startColumn:I,endColumn:I+g-1,tokenTypeIdx:u,tokenType:m}},A.prototype.addToken=function(a,d,u){return 666},A.prototype.addTokenUsingPush=function(a,d,u){return a.push(u),d},A.prototype.addTokenUsingMemberAccess=function(a,d,u){return a[d]=u,d++,d},A.prototype.handlePayload=function(a,d){},A.prototype.handlePayloadNoCustom=function(a,d){},A.prototype.handlePayloadWithCustom=function(a,d){d!==null&&(a.payload=d)},A.prototype.match=function(a,d,u){return null},A.prototype.matchWithTest=function(a,d,u){var m=a.test(d);return m===!0?d.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,d){var u=a.exec(d);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,d){if(this.traceInitPerf===!0){this.traceInitIndent++;var u=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(u+"--> <"+a+">");var m=t.timer(d),p=m.time,I=m.value,g=p>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+p+"ms"),this.traceInitIndent--,I}else return d()},A.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.",A.NA=/NOT_APPLICABLE/,A})();i.Lexer=c}),ft=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tokenMatcher=i.createTokenInstance=i.EOF=i.createToken=i.hasTokenLabel=i.tokenName=i.tokenLabel=void 0;var e=Ne(),t=jt(),n=kt();function r(b){return s(b)?b.LABEL:b.name}i.tokenLabel=r;function o(b){return b.name}i.tokenName=o;function s(b){return e.isString(b.LABEL)&&b.LABEL!==""}i.hasTokenLabel=s;var c="parent",A="categories",a="label",d="group",u="push_mode",m="pop_mode",p="longer_alt",I="line_breaks",g="start_chars_hint";function l(b){return h(b)}i.createToken=l;function h(b){var y=b.pattern,R={};if(R.name=b.name,e.isUndefined(y)||(R.PATTERN=y),e.has(b,c))throw`The parent property is no longer supported.
53
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(b,A)&&(R.CATEGORIES=b[A]),n.augmentTokenTypes([R]),e.has(b,a)&&(R.LABEL=b[a]),e.has(b,d)&&(R.GROUP=b[d]),e.has(b,m)&&(R.POP_MODE=b[m]),e.has(b,u)&&(R.PUSH_MODE=b[u]),e.has(b,p)&&(R.LONGER_ALT=b[p]),e.has(b,I)&&(R.LINE_BREAKS=b[I]),e.has(b,g)&&(R.START_CHARS_HINT=b[g]),R}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function f(b,y,R,x,z,k,P,N){return{image:y,startOffset:R,endOffset:x,startLine:z,endLine:k,startColumn:P,endColumn:N,tokenTypeIdx:b.tokenTypeIdx,tokenType:b}}i.createTokenInstance=f;function C(b,y){return n.tokenStructuredMatcher(b,y)}i.tokenMatcher=C}),Je=Re(i=>{var e=i&&i.__extends||(function(){var h=function(f,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,y){b.__proto__=y}||function(b,y){for(var R in y)Object.prototype.hasOwnProperty.call(y,R)&&(b[R]=y[R])},h(f,C)};return function(f,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");h(f,C);function b(){this.constructor=f}f.prototype=C===null?Object.create(C):(b.prototype=C.prototype,new b)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=Ne(),n=ft(),r=(function(){function h(f){this._definition=f}return Object.defineProperty(h.prototype,"definition",{get:function(){return this._definition},set:function(f){this._definition=f},enumerable:!1,configurable:!0}),h.prototype.accept=function(f){f.visit(this),t.forEach(this.definition,function(C){C.accept(f)})},h})();i.AbstractProduction=r;var o=(function(h){e(f,h);function f(C){var b=h.call(this,[])||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return Object.defineProperty(f.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),f.prototype.accept=function(C){C.visit(this)},f})(r);i.NonTerminal=o;var s=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.orgText="",t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Rule=s;var c=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.ignoreAmbiguities=!1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Alternative=c;var A=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Option=A;var a=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionMandatory=a;var d=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionMandatoryWithSeparator=d;var u=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Repetition=u;var m=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionWithSeparator=m;var p=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,b.ignoreAmbiguities=!1,b.hasPredicates=!1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return Object.defineProperty(f.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),f})(r);i.Alternation=p;var I=(function(){function h(f){this.idx=1,t.assign(this,t.pick(f,function(C){return C!==void 0}))}return h.prototype.accept=function(f){f.visit(this)},h})();i.Terminal=I;function g(h){return t.map(h,l)}i.serializeGrammar=g;function l(h){function f(y){return t.map(y,l)}if(h instanceof o)return{type:"NonTerminal",name:h.nonTerminalName,idx:h.idx};if(h instanceof c)return{type:"Alternative",definition:f(h.definition)};if(h instanceof A)return{type:"Option",idx:h.idx,definition:f(h.definition)};if(h instanceof a)return{type:"RepetitionMandatory",idx:h.idx,definition:f(h.definition)};if(h instanceof d)return{type:"RepetitionMandatoryWithSeparator",idx:h.idx,separator:l(new I({terminalType:h.separator})),definition:f(h.definition)};if(h instanceof m)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new I({terminalType:h.separator})),definition:f(h.definition)};if(h instanceof u)return{type:"Repetition",idx:h.idx,definition:f(h.definition)};if(h instanceof p)return{type:"Alternation",idx:h.idx,definition:f(h.definition)};if(h instanceof I){var C={type:"Terminal",name:h.terminalType.name,label:n.tokenLabel(h.terminalType),idx:h.idx},b=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(b)?b.source:b),C}else{if(h instanceof s)return{type:"Rule",name:h.name,orgText:h.orgText,definition:f(h.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),Tn=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=Ne(),t=Je(),n=(function(){function o(){}return o.prototype.walk=function(s,c){var A=this;c===void 0&&(c=[]),e.forEach(s.definition,function(a,d){var u=e.drop(s.definition,d+1);if(a instanceof t.NonTerminal)A.walkProdRef(a,u,c);else if(a instanceof t.Terminal)A.walkTerminal(a,u,c);else if(a instanceof t.Alternative)A.walkFlat(a,u,c);else if(a instanceof t.Option)A.walkOption(a,u,c);else if(a instanceof t.RepetitionMandatory)A.walkAtLeastOne(a,u,c);else if(a instanceof t.RepetitionMandatoryWithSeparator)A.walkAtLeastOneSep(a,u,c);else if(a instanceof t.RepetitionWithSeparator)A.walkManySep(a,u,c);else if(a instanceof t.Repetition)A.walkMany(a,u,c);else if(a instanceof t.Alternation)A.walkOr(a,u,c);else throw Error("non exhaustive match")})},o.prototype.walkTerminal=function(s,c,A){},o.prototype.walkProdRef=function(s,c,A){},o.prototype.walkFlat=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkOption=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkAtLeastOne=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkAtLeastOneSep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkMany=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkManySep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkOr=function(s,c,A){var a=this,d=c.concat(A);e.forEach(s.definition,function(u){var m=new t.Alternative({definition:[u]});a.walk(m,d)})},o})();i.RestWalker=n;function r(o,s,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:o.separator})].concat(o.definition)})],a=A.concat(s,c);return a}}),St=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=Je(),t=(function(){function n(){}return n.prototype.visit=function(r){var o=r;switch(o.constructor){case e.NonTerminal:return this.visitNonTerminal(o);case e.Alternative:return this.visitAlternative(o);case e.Option:return this.visitOption(o);case e.RepetitionMandatory:return this.visitRepetitionMandatory(o);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(o);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(o);case e.Repetition:return this.visitRepetition(o);case e.Alternation:return this.visitAlternation(o);case e.Terminal:return this.visitTerminal(o);case e.Rule:return this.visitRule(o);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),Ht=Re(i=>{var e=i&&i.__extends||(function(){var m=function(p,I){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(g[h]=l[h])},m(p,I)};return function(p,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");m(p,I);function g(){this.constructor=p}p.prototype=I===null?Object.create(I):(g.prototype=I.prototype,new g)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=Ne(),n=Je(),r=St();function o(m){return m instanceof n.Alternative||m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionMandatory||m instanceof n.RepetitionMandatoryWithSeparator||m instanceof n.RepetitionWithSeparator||m instanceof n.Terminal||m instanceof n.Rule}i.isSequenceProd=o;function s(m,p){p===void 0&&(p=[]);var I=m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionWithSeparator;return I?!0:m instanceof n.Alternation?t.some(m.definition,function(g){return s(g,p)}):m instanceof n.NonTerminal&&t.contains(p,m)?!1:m instanceof n.AbstractProduction?(m instanceof n.NonTerminal&&p.push(m),t.every(m.definition,function(g){return s(g,p)})):!1}i.isOptionalProd=s;function c(m){return m instanceof n.Alternation}i.isBranchingProd=c;function A(m){if(m instanceof n.NonTerminal)return"SUBRULE";if(m instanceof n.Option)return"OPTION";if(m instanceof n.Alternation)return"OR";if(m instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(m instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(m instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(m instanceof n.Repetition)return"MANY";if(m instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}i.getProductionDslName=A;var a=(function(m){e(p,m);function p(){var I=m!==null&&m.apply(this,arguments)||this;return I.separator="-",I.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},I}return p.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},p.prototype.visitTerminal=function(I){var g=I.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(I)},p.prototype.visitNonTerminal=function(I){var g=I.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(I)},p.prototype.visitOption=function(I){this.dslMethods.option.push(I)},p.prototype.visitRepetitionWithSeparator=function(I){this.dslMethods.repetitionWithSeparator.push(I)},p.prototype.visitRepetitionMandatory=function(I){this.dslMethods.repetitionMandatory.push(I)},p.prototype.visitRepetitionMandatoryWithSeparator=function(I){this.dslMethods.repetitionMandatoryWithSeparator.push(I)},p.prototype.visitRepetition=function(I){this.dslMethods.repetition.push(I)},p.prototype.visitAlternation=function(I){this.dslMethods.alternation.push(I)},p})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var d=new a;function u(m){d.reset(),m.accept(d);var p=d.dslMethods;return d.reset(),p}i.collectMethods=u}),di=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=Ne(),t=Je(),n=Ht();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return o(A);if(n.isBranchingProd(A))return s(A);throw Error("non exhaustive match")}i.first=r;function o(A){for(var a=[],d=A.definition,u=0,m=d.length>u,p,I=!0;m&&I;)p=d[u],I=n.isOptionalProd(p),a=a.concat(r(p)),u=u+1,m=d.length>u;return e.uniq(a)}i.firstForSequence=o;function s(A){var a=e.map(A.definition,function(d){return r(d)});return e.uniq(e.flatten(a))}i.firstForBranching=s;function c(A){return[A.terminalType]}i.firstForTerminal=c}),fi=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),Zr=Re(i=>{var e=i&&i.__extends||(function(){var u=function(m,p){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,g){I.__proto__=g}||function(I,g){for(var l in g)Object.prototype.hasOwnProperty.call(g,l)&&(I[l]=g[l])},u(m,p)};return function(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");u(m,p);function I(){this.constructor=m}m.prototype=p===null?Object.create(p):(I.prototype=p.prototype,new I)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=Tn(),n=di(),r=Ne(),o=fi(),s=Je(),c=(function(u){e(m,u);function m(p){var I=u.call(this)||this;return I.topProd=p,I.follows={},I}return m.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},m.prototype.walkTerminal=function(p,I,g){},m.prototype.walkProdRef=function(p,I,g){var l=a(p.referencedRule,p.idx)+this.topProd.name,h=I.concat(g),f=new s.Alternative({definition:h}),C=n.first(f);this.follows[l]=C},m})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var m={};return r.forEach(u,function(p){var I=new c(p).startWalking();r.assign(m,I)}),m}i.computeAllProdsFollows=A;function a(u,m){return u.name+m+o.IN}i.buildBetweenProdsFollowPrefix=a;function d(u){var m=u.terminalType.name;return m+u.idx+o.IN}i.buildInProdFollowPrefix=d}),qt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=ft(),t=Ne(),n=Ne(),r=Je(),o=Ht();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(s){var c=s.expected,A=s.actual;s.previous,s.ruleName;var a=e.hasTokenLabel(c),d=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+d+" but found --> '"+A.image+"' <--";return u},buildNotAllInputParsedMessage:function(s){var c=s.firstRedundant;return s.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(s){var c=s.expectedPathsPerAlt,A=s.actual;s.previous;var a=s.customUserDescription;s.ruleName;var d="Expecting: ",u=n.first(A).image,m=`
52
+ `+m)}var p=this.tokenizeInternal(a,d);return p},A.prototype.tokenizeInternal=function(a,d){var u=this,m,p,I,g,l,h,f,C,b,y,R,x,q,v,G=a,D=G.length,Q=0,F=0,L=this.hasCustom?0:Math.floor(a.length/10),J=new Array(L),$=[],j=this.trackStartLines?1:void 0,ee=this.trackStartLines?1:void 0,ne=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,ie=this.config.lineTerminatorsPattern,Z=0,se=[],de=[],P=[],H=[];Object.freeze(H);var Y=void 0;function V(){return se}function K(B){var S=e.charCodeToOptimizedIndex(B),T=de[S];return T===void 0?H:T}var ce=function(B){if(P.length===1&&B.tokenType.PUSH_MODE===void 0){var S=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(B);$.push({offset:B.startOffset,line:B.startLine!==void 0?B.startLine:void 0,column:B.startColumn!==void 0?B.startColumn:void 0,length:B.image.length,message:S})}else{P.pop();var T=t.last(P);se=u.patternIdxToConfig[T],de=u.charCodeToPatternIdxToConfig[T],Z=se.length;var N=u.canModeBeOptimized[T]&&u.config.safeMode===!1;de&&N?Y=K:Y=V}};function Be(B){P.push(B),de=this.charCodeToPatternIdxToConfig[B],se=this.patternIdxToConfig[B],Z=se.length,Z=se.length;var S=this.canModeBeOptimized[B]&&this.config.safeMode===!1;de&&S?Y=K:Y=V}Be.call(this,d);for(var Te;Q<D;){l=null;var De=G.charCodeAt(Q),Ve=Y(De),Je=Ve.length;for(m=0;m<Je;m++){Te=Ve[m];var qe=Te.pattern;h=null;var O=Te.short;if(O!==!1?De===O&&(l=qe):Te.isCustom===!0?(v=qe.exec(G,Q,J,ne),v!==null?(l=v[0],v.payload!==void 0&&(h=v.payload)):l=null):(this.updateLastIndex(qe,Q),l=this.match(qe,a,Q)),l!==null){if(g=Te.longerAlt,g!==void 0){var X=se[g],z=X.pattern;f=null,X.isCustom===!0?(v=z.exec(G,Q,J,ne),v!==null?(I=v[0],v.payload!==void 0&&(f=v.payload)):I=null):(this.updateLastIndex(z,Q),I=this.match(z,a,Q)),I&&I.length>l.length&&(l=I,h=f,Te=X)}break}}if(l!==null){if(C=l.length,b=Te.group,b!==void 0&&(y=Te.tokenTypeIdx,R=this.createTokenInstance(l,Q,y,Te.tokenType,j,ee,C),this.handlePayload(R,h),b===!1?F=this.addToken(J,F,R):ne[b].push(R)),a=this.chopInput(a,C),Q=Q+C,ee=this.computeNewColumn(ee,C),ue===!0&&Te.canLineTerminator===!0){var re=0,fe=void 0,Qe=void 0;ie.lastIndex=0;do fe=ie.test(l),fe===!0&&(Qe=ie.lastIndex-1,re++);while(fe===!0);re!==0&&(j=j+re,ee=C-Qe,this.updateTokenEndLineColumnLocation(R,b,Qe,re,j,ee,C))}this.handleModes(Te,ce,Be,R)}else{for(var ye=Q,le=j,Ge=ee,k=!1;!k&&Q<D;)for(G.charCodeAt(Q),a=this.chopInput(a,1),Q++,p=0;p<Z;p++){var w=se[p],qe=w.pattern,O=w.short;if(O!==!1?G.charCodeAt(Q)===O&&(k=!0):w.isCustom===!0?k=qe.exec(G,Q,J,ne)!==null:(this.updateLastIndex(qe,Q),k=qe.exec(a)!==null),k===!0)break}x=Q-ye,q=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(G,ye,x,le,Ge),$.push({offset:ye,line:le,column:Ge,length:x,message:q})}}return this.hasCustom||(J.length=F),{tokens:J,groups:ne,errors:$}},A.prototype.handleModes=function(a,d,u,m){if(a.pop===!0){var p=a.push;d(m),p!==void 0&&u.call(this,p)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,d){return a.substring(d)},A.prototype.updateLastIndex=function(a,d){a.lastIndex=d},A.prototype.updateTokenEndLineColumnLocation=function(a,d,u,m,p,I,g){var l,h;d!==void 0&&(l=u===g-1,h=l?-1:0,m===1&&l===!0||(a.endLine=p+h,a.endColumn=I-1+-h))},A.prototype.computeNewColumn=function(a,d){return a+d},A.prototype.createTokenInstance=function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];return null},A.prototype.createOffsetOnlyToken=function(a,d,u,m){return{image:a,startOffset:d,tokenTypeIdx:u,tokenType:m}},A.prototype.createStartOnlyToken=function(a,d,u,m,p,I){return{image:a,startOffset:d,startLine:p,startColumn:I,tokenTypeIdx:u,tokenType:m}},A.prototype.createFullToken=function(a,d,u,m,p,I,g){return{image:a,startOffset:d,endOffset:d+g-1,startLine:p,endLine:p,startColumn:I,endColumn:I+g-1,tokenTypeIdx:u,tokenType:m}},A.prototype.addToken=function(a,d,u){return 666},A.prototype.addTokenUsingPush=function(a,d,u){return a.push(u),d},A.prototype.addTokenUsingMemberAccess=function(a,d,u){return a[d]=u,d++,d},A.prototype.handlePayload=function(a,d){},A.prototype.handlePayloadNoCustom=function(a,d){},A.prototype.handlePayloadWithCustom=function(a,d){d!==null&&(a.payload=d)},A.prototype.match=function(a,d,u){return null},A.prototype.matchWithTest=function(a,d,u){var m=a.test(d);return m===!0?d.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,d){var u=a.exec(d);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,d){if(this.traceInitPerf===!0){this.traceInitIndent++;var u=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(u+"--> <"+a+">");var m=t.timer(d),p=m.time,I=m.value,g=p>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+p+"ms"),this.traceInitIndent--,I}else return d()},A.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.",A.NA=/NOT_APPLICABLE/,A})();i.Lexer=c}),pt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tokenMatcher=i.createTokenInstance=i.EOF=i.createToken=i.hasTokenLabel=i.tokenName=i.tokenLabel=void 0;var e=Ne(),t=Mt(),n=kt();function r(b){return s(b)?b.LABEL:b.name}i.tokenLabel=r;function o(b){return b.name}i.tokenName=o;function s(b){return e.isString(b.LABEL)&&b.LABEL!==""}i.hasTokenLabel=s;var c="parent",A="categories",a="label",d="group",u="push_mode",m="pop_mode",p="longer_alt",I="line_breaks",g="start_chars_hint";function l(b){return h(b)}i.createToken=l;function h(b){var y=b.pattern,R={};if(R.name=b.name,e.isUndefined(y)||(R.PATTERN=y),e.has(b,c))throw`The parent property is no longer supported.
53
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(b,A)&&(R.CATEGORIES=b[A]),n.augmentTokenTypes([R]),e.has(b,a)&&(R.LABEL=b[a]),e.has(b,d)&&(R.GROUP=b[d]),e.has(b,m)&&(R.POP_MODE=b[m]),e.has(b,u)&&(R.PUSH_MODE=b[u]),e.has(b,p)&&(R.LONGER_ALT=b[p]),e.has(b,I)&&(R.LINE_BREAKS=b[I]),e.has(b,g)&&(R.START_CHARS_HINT=b[g]),R}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function f(b,y,R,x,q,v,G,D){return{image:y,startOffset:R,endOffset:x,startLine:q,endLine:v,startColumn:G,endColumn:D,tokenTypeIdx:b.tokenTypeIdx,tokenType:b}}i.createTokenInstance=f;function C(b,y){return n.tokenStructuredMatcher(b,y)}i.tokenMatcher=C}),Ze=Re(i=>{var e=i&&i.__extends||(function(){var h=function(f,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,y){b.__proto__=y}||function(b,y){for(var R in y)Object.prototype.hasOwnProperty.call(y,R)&&(b[R]=y[R])},h(f,C)};return function(f,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");h(f,C);function b(){this.constructor=f}f.prototype=C===null?Object.create(C):(b.prototype=C.prototype,new b)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=Ne(),n=pt(),r=(function(){function h(f){this._definition=f}return Object.defineProperty(h.prototype,"definition",{get:function(){return this._definition},set:function(f){this._definition=f},enumerable:!1,configurable:!0}),h.prototype.accept=function(f){f.visit(this),t.forEach(this.definition,function(C){C.accept(f)})},h})();i.AbstractProduction=r;var o=(function(h){e(f,h);function f(C){var b=h.call(this,[])||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return Object.defineProperty(f.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),f.prototype.accept=function(C){C.visit(this)},f})(r);i.NonTerminal=o;var s=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.orgText="",t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Rule=s;var c=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.ignoreAmbiguities=!1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Alternative=c;var A=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Option=A;var a=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionMandatory=a;var d=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionMandatoryWithSeparator=d;var u=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.Repetition=u;var m=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return f})(r);i.RepetitionWithSeparator=m;var p=(function(h){e(f,h);function f(C){var b=h.call(this,C.definition)||this;return b.idx=1,b.ignoreAmbiguities=!1,b.hasPredicates=!1,t.assign(b,t.pick(C,function(y){return y!==void 0})),b}return Object.defineProperty(f.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),f})(r);i.Alternation=p;var I=(function(){function h(f){this.idx=1,t.assign(this,t.pick(f,function(C){return C!==void 0}))}return h.prototype.accept=function(f){f.visit(this)},h})();i.Terminal=I;function g(h){return t.map(h,l)}i.serializeGrammar=g;function l(h){function f(y){return t.map(y,l)}if(h instanceof o)return{type:"NonTerminal",name:h.nonTerminalName,idx:h.idx};if(h instanceof c)return{type:"Alternative",definition:f(h.definition)};if(h instanceof A)return{type:"Option",idx:h.idx,definition:f(h.definition)};if(h instanceof a)return{type:"RepetitionMandatory",idx:h.idx,definition:f(h.definition)};if(h instanceof d)return{type:"RepetitionMandatoryWithSeparator",idx:h.idx,separator:l(new I({terminalType:h.separator})),definition:f(h.definition)};if(h instanceof m)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new I({terminalType:h.separator})),definition:f(h.definition)};if(h instanceof u)return{type:"Repetition",idx:h.idx,definition:f(h.definition)};if(h instanceof p)return{type:"Alternation",idx:h.idx,definition:f(h.definition)};if(h instanceof I){var C={type:"Terminal",name:h.terminalType.name,label:n.tokenLabel(h.terminalType),idx:h.idx},b=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(b)?b.source:b),C}else{if(h instanceof s)return{type:"Rule",name:h.name,orgText:h.orgText,definition:f(h.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),bn=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=Ne(),t=Ze(),n=(function(){function o(){}return o.prototype.walk=function(s,c){var A=this;c===void 0&&(c=[]),e.forEach(s.definition,function(a,d){var u=e.drop(s.definition,d+1);if(a instanceof t.NonTerminal)A.walkProdRef(a,u,c);else if(a instanceof t.Terminal)A.walkTerminal(a,u,c);else if(a instanceof t.Alternative)A.walkFlat(a,u,c);else if(a instanceof t.Option)A.walkOption(a,u,c);else if(a instanceof t.RepetitionMandatory)A.walkAtLeastOne(a,u,c);else if(a instanceof t.RepetitionMandatoryWithSeparator)A.walkAtLeastOneSep(a,u,c);else if(a instanceof t.RepetitionWithSeparator)A.walkManySep(a,u,c);else if(a instanceof t.Repetition)A.walkMany(a,u,c);else if(a instanceof t.Alternation)A.walkOr(a,u,c);else throw Error("non exhaustive match")})},o.prototype.walkTerminal=function(s,c,A){},o.prototype.walkProdRef=function(s,c,A){},o.prototype.walkFlat=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkOption=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkAtLeastOne=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkAtLeastOneSep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkMany=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkManySep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkOr=function(s,c,A){var a=this,d=c.concat(A);e.forEach(s.definition,function(u){var m=new t.Alternative({definition:[u]});a.walk(m,d)})},o})();i.RestWalker=n;function r(o,s,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:o.separator})].concat(o.definition)})],a=A.concat(s,c);return a}}),St=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=Ze(),t=(function(){function n(){}return n.prototype.visit=function(r){var o=r;switch(o.constructor){case e.NonTerminal:return this.visitNonTerminal(o);case e.Alternative:return this.visitAlternative(o);case e.Option:return this.visitOption(o);case e.RepetitionMandatory:return this.visitRepetitionMandatory(o);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(o);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(o);case e.Repetition:return this.visitRepetition(o);case e.Alternation:return this.visitAlternation(o);case e.Terminal:return this.visitTerminal(o);case e.Rule:return this.visitRule(o);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),Pt=Re(i=>{var e=i&&i.__extends||(function(){var m=function(p,I){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(g[h]=l[h])},m(p,I)};return function(p,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");m(p,I);function g(){this.constructor=p}p.prototype=I===null?Object.create(I):(g.prototype=I.prototype,new g)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=Ne(),n=Ze(),r=St();function o(m){return m instanceof n.Alternative||m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionMandatory||m instanceof n.RepetitionMandatoryWithSeparator||m instanceof n.RepetitionWithSeparator||m instanceof n.Terminal||m instanceof n.Rule}i.isSequenceProd=o;function s(m,p){p===void 0&&(p=[]);var I=m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionWithSeparator;return I?!0:m instanceof n.Alternation?t.some(m.definition,function(g){return s(g,p)}):m instanceof n.NonTerminal&&t.contains(p,m)?!1:m instanceof n.AbstractProduction?(m instanceof n.NonTerminal&&p.push(m),t.every(m.definition,function(g){return s(g,p)})):!1}i.isOptionalProd=s;function c(m){return m instanceof n.Alternation}i.isBranchingProd=c;function A(m){if(m instanceof n.NonTerminal)return"SUBRULE";if(m instanceof n.Option)return"OPTION";if(m instanceof n.Alternation)return"OR";if(m instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(m instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(m instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(m instanceof n.Repetition)return"MANY";if(m instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}i.getProductionDslName=A;var a=(function(m){e(p,m);function p(){var I=m!==null&&m.apply(this,arguments)||this;return I.separator="-",I.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},I}return p.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},p.prototype.visitTerminal=function(I){var g=I.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(I)},p.prototype.visitNonTerminal=function(I){var g=I.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(I)},p.prototype.visitOption=function(I){this.dslMethods.option.push(I)},p.prototype.visitRepetitionWithSeparator=function(I){this.dslMethods.repetitionWithSeparator.push(I)},p.prototype.visitRepetitionMandatory=function(I){this.dslMethods.repetitionMandatory.push(I)},p.prototype.visitRepetitionMandatoryWithSeparator=function(I){this.dslMethods.repetitionMandatoryWithSeparator.push(I)},p.prototype.visitRepetition=function(I){this.dslMethods.repetition.push(I)},p.prototype.visitAlternation=function(I){this.dslMethods.alternation.push(I)},p})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var d=new a;function u(m){d.reset(),m.accept(d);var p=d.dslMethods;return d.reset(),p}i.collectMethods=u}),ci=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=Ne(),t=Ze(),n=Pt();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return o(A);if(n.isBranchingProd(A))return s(A);throw Error("non exhaustive match")}i.first=r;function o(A){for(var a=[],d=A.definition,u=0,m=d.length>u,p,I=!0;m&&I;)p=d[u],I=n.isOptionalProd(p),a=a.concat(r(p)),u=u+1,m=d.length>u;return e.uniq(a)}i.firstForSequence=o;function s(A){var a=e.map(A.definition,function(d){return r(d)});return e.uniq(e.flatten(a))}i.firstForBranching=s;function c(A){return[A.terminalType]}i.firstForTerminal=c}),li=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),Jr=Re(i=>{var e=i&&i.__extends||(function(){var u=function(m,p){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,g){I.__proto__=g}||function(I,g){for(var l in g)Object.prototype.hasOwnProperty.call(g,l)&&(I[l]=g[l])},u(m,p)};return function(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");u(m,p);function I(){this.constructor=m}m.prototype=p===null?Object.create(p):(I.prototype=p.prototype,new I)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=bn(),n=ci(),r=Ne(),o=li(),s=Ze(),c=(function(u){e(m,u);function m(p){var I=u.call(this)||this;return I.topProd=p,I.follows={},I}return m.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},m.prototype.walkTerminal=function(p,I,g){},m.prototype.walkProdRef=function(p,I,g){var l=a(p.referencedRule,p.idx)+this.topProd.name,h=I.concat(g),f=new s.Alternative({definition:h}),C=n.first(f);this.follows[l]=C},m})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var m={};return r.forEach(u,function(p){var I=new c(p).startWalking();r.assign(m,I)}),m}i.computeAllProdsFollows=A;function a(u,m){return u.name+m+o.IN}i.buildBetweenProdsFollowPrefix=a;function d(u){var m=u.terminalType.name;return m+u.idx+o.IN}i.buildInProdFollowPrefix=d}),Gt=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=pt(),t=Ne(),n=Ne(),r=Ze(),o=Pt();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(s){var c=s.expected,A=s.actual;s.previous,s.ruleName;var a=e.hasTokenLabel(c),d=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+d+" but found --> '"+A.image+"' <--";return u},buildNotAllInputParsedMessage:function(s){var c=s.firstRedundant;return s.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(s){var c=s.expectedPathsPerAlt,A=s.actual;s.previous;var a=s.customUserDescription;s.ruleName;var d="Expecting: ",u=n.first(A).image,m=`
54
54
  but found: '`+u+"'";if(a)return d+a+m;var p=n.reduce(c,function(h,f){return h.concat(f)},[]),I=n.map(p,function(h){return"["+n.map(h,function(f){return e.tokenLabel(f)}).join(", ")+"]"}),g=n.map(I,function(h,f){return" "+(f+1)+". "+h}),l=`one of these possible Token sequences:
55
55
  `+g.join(`
56
56
  `);return d+l+m},buildEarlyExitMessage:function(s){var c=s.expectedIterationPaths,A=s.actual,a=s.customUserDescription;s.ruleName;var d="Expecting: ",u=n.first(A).image,m=`
@@ -80,33 +80,33 @@ This could lead to an infinite loop.`;return A},buildTokenNameError:function(s){
80
80
  `)+(`without consuming any Tokens. The grammar path that causes this is:
81
81
  `+a+`
82
82
  `)+` To fix this refactor your grammar to remove the left recursion.
83
- see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return d},buildInvalidRuleNameError:function(s){return"deprecated"},buildDuplicateRuleNameError:function(s){var c;s.topLevelRule instanceof r.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),$r=Re(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,u){d.__proto__=u}||function(d,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(d[m]=u[m])},c(A,a)};return function(A,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");c(A,a);function d(){this.constructor=A}A.prototype=a===null?Object.create(a):(d.prototype=a.prototype,new d)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=et(),n=Ne(),r=St();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=o;var s=(function(c){e(A,c);function A(a,d){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=d,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(d){a.currTopLevel=d,d.accept(a)})},A.prototype.visitNonTerminal=function(a){var d=this.nameToTopRule[a.nonTerminalName];if(d)a.referencedRule=d;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=s}),zt=Re(i=>{var e=i&&i.__extends||(function(){var l=function(h,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,b){C.__proto__=b}||function(C,b){for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(C[y]=b[y])},l(h,f)};return function(h,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");l(h,f);function C(){this.constructor=h}h.prototype=f===null?Object.create(f):(C.prototype=f.prototype,new C)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=Tn(),n=Ne(),r=di(),o=Je(),s=(function(l){e(h,l);function h(f,C){var b=l.call(this)||this;return b.topProd=f,b.path=C,b.possibleTokTypes=[],b.nextProductionName="",b.nextProductionOccurrence=0,b.found=!1,b.isAtEndOfPath=!1,b}return h.prototype.startWalking=function(){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=n.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=n.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},h.prototype.walk=function(f,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,f,C)},h.prototype.walkProdRef=function(f,C,b){if(f.referencedRule.name===this.nextProductionName&&f.idx===this.nextProductionOccurrence){var y=C.concat(b);this.updateExpectedNext(),this.walk(f.referencedRule,y)}},h.prototype.updateExpectedNext=function(){n.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},h})(t.RestWalker);i.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(h,l);function h(f,C){var b=l.call(this,f,C)||this;return b.path=C,b.nextTerminalName="",b.nextTerminalOccurrence=0,b.nextTerminalName=b.path.lastTok.name,b.nextTerminalOccurrence=b.path.lastTokOccurrence,b}return h.prototype.walkTerminal=function(f,C,b){if(this.isAtEndOfPath&&f.terminalType.name===this.nextTerminalName&&f.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(b),R=new o.Alternative({definition:y});this.possibleTokTypes=r.first(R),this.found=!0}},h})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(f,C){var b=l.call(this)||this;return b.topRule=f,b.occurrence=C,b.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},b}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkMany.call(this,f,C,b)},h})(A);i.NextTerminalAfterManyWalker=a;var d=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkManySep.call(this,f,C,b)},h})(A);i.NextTerminalAfterManySepWalker=d;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOne.call(this,f,C,b)},h})(A);i.NextTerminalAfterAtLeastOneWalker=u;var m=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOneSep=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOneSep.call(this,f,C,b)},h})(A);i.NextTerminalAfterAtLeastOneSepWalker=m;function p(l,h,f){f===void 0&&(f=[]),f=n.cloneArr(f);var C=[],b=0;function y(k){return k.concat(n.drop(l,b+1))}function R(k){var P=p(y(k),h,f);return C.concat(P)}for(;f.length<h&&b<l.length;){var x=l[b];if(x instanceof o.Alternative||x instanceof o.NonTerminal)return R(x.definition);if(x instanceof o.Option)C=R(x.definition);else if(x instanceof o.RepetitionMandatory){var z=x.definition.concat([new o.Repetition({definition:x.definition})]);return R(z)}else if(x instanceof o.RepetitionMandatoryWithSeparator){var z=[new o.Alternative({definition:x.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})];return R(z)}else if(x instanceof o.RepetitionWithSeparator){var z=x.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})]);C=R(z)}else if(x instanceof o.Repetition){var z=x.definition.concat([new o.Repetition({definition:x.definition})]);C=R(z)}else{if(x instanceof o.Alternation)return n.forEach(x.definition,function(k){n.isEmpty(k.definition)===!1&&(C=R(k.definition))}),C;if(x instanceof o.Terminal)f.push(x.terminalType);else throw Error("non exhaustive match")}b++}return C.push({partialPath:f,suffixDef:n.drop(l,b)}),C}i.possiblePathsFrom=p;function I(l,h,f,C){var b="EXIT_NONE_TERMINAL",y=[b],R="EXIT_ALTERNATIVE",x=!1,z=h.length,k=z-C-1,P=[],N=[];for(N.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(N);){var S=N.pop();if(S===R){x&&n.last(N).idx<=k&&N.pop();continue}var F=S.def,_=S.idx,W=S.ruleStack,$=S.occurrenceStack;if(!n.isEmpty(F)){var H=F[0];if(H===b){var ee={idx:_,def:n.drop(F),ruleStack:n.dropRight(W),occurrenceStack:n.dropRight($)};N.push(ee)}else if(H instanceof o.Terminal)if(_<z-1){var ne=_+1,ue=h[ne];if(f(ue,H.terminalType)){var ee={idx:ne,def:n.drop(F),ruleStack:W,occurrenceStack:$};N.push(ee)}}else if(_===z-1)P.push({nextTokenType:H.terminalType,nextTokenOccurrence:H.idx,ruleStack:W,occurrenceStack:$}),x=!0;else throw Error("non exhaustive match");else if(H instanceof o.NonTerminal){var ie=n.cloneArr(W);ie.push(H.nonTerminalName);var X=n.cloneArr($);X.push(H.idx);var ee={idx:_,def:H.definition.concat(y,n.drop(F)),ruleStack:ie,occurrenceStack:X};N.push(ee)}else if(H instanceof o.Option){var se={idx:_,def:n.drop(F),ruleStack:W,occurrenceStack:$};N.push(se),N.push(R);var de={idx:_,def:H.definition.concat(n.drop(F)),ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.RepetitionMandatory){var G=new o.Repetition({definition:H.definition,idx:H.idx}),q=H.definition.concat([G],n.drop(F)),ee={idx:_,def:q,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionMandatoryWithSeparator){var j=new o.Terminal({terminalType:H.separator}),G=new o.Repetition({definition:[j].concat(H.definition),idx:H.idx}),q=H.definition.concat([G],n.drop(F)),ee={idx:_,def:q,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionWithSeparator){var se={idx:_,def:n.drop(F),ruleStack:W,occurrenceStack:$};N.push(se),N.push(R);var j=new o.Terminal({terminalType:H.separator}),Z=new o.Repetition({definition:[j].concat(H.definition),idx:H.idx}),q=H.definition.concat([Z],n.drop(F)),de={idx:_,def:q,ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.Repetition){var se={idx:_,def:n.drop(F),ruleStack:W,occurrenceStack:$};N.push(se),N.push(R);var Z=new o.Repetition({definition:H.definition,idx:H.idx}),q=H.definition.concat([Z],n.drop(F)),de={idx:_,def:q,ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.Alternation)for(var J=H.definition.length-1;J>=0;J--){var le=H.definition[J],ye={idx:_,def:le.definition.concat(n.drop(F)),ruleStack:W,occurrenceStack:$};N.push(ye),N.push(R)}else if(H instanceof o.Alternative)N.push({idx:_,def:H.definition.concat(n.drop(F)),ruleStack:W,occurrenceStack:$});else if(H instanceof o.Rule)N.push(g(H,_,W,$));else throw Error("non exhaustive match")}}return P}i.nextPossibleTokensAfter=I;function g(l,h,f,C){var b=n.cloneArr(f);b.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:h,def:l.definition,ruleStack:b,occurrenceStack:y}}}),Vt=Re(i=>{var e=i&&i.__extends||(function(){var k=function(P,N){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,F){S.__proto__=F}||function(S,F){for(var _ in F)Object.prototype.hasOwnProperty.call(F,_)&&(S[_]=F[_])},k(P,N)};return function(P,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");k(P,N);function S(){this.constructor=P}P.prototype=N===null?Object.create(N):(S.prototype=N.prototype,new S)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=Ne(),n=zt(),r=Tn(),o=kt(),s=Je(),c=St(),A;(function(k){k[k.OPTION=0]="OPTION",k[k.REPETITION=1]="REPETITION",k[k.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",k[k.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",k[k.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",k[k.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(k){if(k instanceof s.Option)return A.OPTION;if(k instanceof s.Repetition)return A.REPETITION;if(k instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(k instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(k instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(k instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function d(k,P,N,S,F,_){var W=b(k,P,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(W,S,$,F)}i.buildLookaheadFuncForOr=d;function u(k,P,N,S,F,_){var W=y(k,P,F,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(W[0],$,S)}i.buildLookaheadFuncForOptionalProd=u;function m(k,P,N,S){var F=k.length,_=t.every(k,function(H){return t.every(H,function(ee){return ee.length===1})});if(P)return function(H){for(var ee=t.map(H,function(Z){return Z.GATE}),ne=0;ne<F;ne++){var ue=k[ne],ie=ue.length,X=ee[ne];if(!(X!==void 0&&X.call(this)===!1))e:for(var se=0;se<ie;se++){for(var de=ue[se],G=de.length,q=0;q<G;q++){var j=this.LA(q+1);if(N(j,de[q])===!1)continue e}return ne}}};if(_&&!S){var W=t.map(k,function(H){return t.flatten(H)}),$=t.reduce(W,function(H,ee,ne){return t.forEach(ee,function(ue){t.has(H,ue.tokenTypeIdx)||(H[ue.tokenTypeIdx]=ne),t.forEach(ue.categoryMatches,function(ie){t.has(H,ie)||(H[ie]=ne)})}),H},[]);return function(){var H=this.LA(1);return $[H.tokenTypeIdx]}}else return function(){for(var H=0;H<F;H++){var ee=k[H],ne=ee.length;e:for(var ue=0;ue<ne;ue++){for(var ie=ee[ue],X=ie.length,se=0;se<X;se++){var de=this.LA(se+1);if(N(de,ie[se])===!1)continue e}return H}}}}i.buildAlternativesLookAheadFunc=m;function p(k,P,N){var S=t.every(k,function(ee){return ee.length===1}),F=k.length;if(S&&!N){var _=t.flatten(k);if(_.length===1&&t.isEmpty(_[0].categoryMatches)){var W=_[0],$=W.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===$}}else{var H=t.reduce(_,function(ee,ne,ue){return ee[ne.tokenTypeIdx]=!0,t.forEach(ne.categoryMatches,function(ie){ee[ie]=!0}),ee},[]);return function(){var ee=this.LA(1);return H[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<F;ee++){for(var ne=k[ee],ue=ne.length,ie=0;ie<ue;ie++){var X=this.LA(ie+1);if(P(X,ne[ie])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=p;var I=(function(k){e(P,k);function P(N,S,F){var _=k.call(this)||this;return _.topProd=N,_.targetOccurrence=S,_.targetProdType=F,_}return P.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},P.prototype.checkIsTarget=function(N,S,F,_){return N.idx===this.targetOccurrence&&this.targetProdType===S?(this.restDef=F.concat(_),!0):!1},P.prototype.walkOption=function(N,S,F){this.checkIsTarget(N,A.OPTION,S,F)||k.prototype.walkOption.call(this,N,S,F)},P.prototype.walkAtLeastOne=function(N,S,F){this.checkIsTarget(N,A.REPETITION_MANDATORY,S,F)||k.prototype.walkOption.call(this,N,S,F)},P.prototype.walkAtLeastOneSep=function(N,S,F){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR,S,F)||k.prototype.walkOption.call(this,N,S,F)},P.prototype.walkMany=function(N,S,F){this.checkIsTarget(N,A.REPETITION,S,F)||k.prototype.walkOption.call(this,N,S,F)},P.prototype.walkManySep=function(N,S,F){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR,S,F)||k.prototype.walkOption.call(this,N,S,F)},P})(r.RestWalker),g=(function(k){e(P,k);function P(N,S,F){var _=k.call(this)||this;return _.targetOccurrence=N,_.targetProdType=S,_.targetRef=F,_.result=[],_}return P.prototype.checkIsTarget=function(N,S){N.idx===this.targetOccurrence&&this.targetProdType===S&&(this.targetRef===void 0||N===this.targetRef)&&(this.result=N.definition)},P.prototype.visitOption=function(N){this.checkIsTarget(N,A.OPTION)},P.prototype.visitRepetition=function(N){this.checkIsTarget(N,A.REPETITION)},P.prototype.visitRepetitionMandatory=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY)},P.prototype.visitRepetitionMandatoryWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR)},P.prototype.visitRepetitionWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR)},P.prototype.visitAlternation=function(N){this.checkIsTarget(N,A.ALTERNATION)},P})(c.GAstVisitor);function l(k){for(var P=new Array(k),N=0;N<k;N++)P[N]=[];return P}function h(k){for(var P=[""],N=0;N<k.length;N++){for(var S=k[N],F=[],_=0;_<P.length;_++){var W=P[_];F.push(W+"_"+S.tokenTypeIdx);for(var $=0;$<S.categoryMatches.length;$++){var H="_"+S.categoryMatches[$];F.push(W+H)}}P=F}return P}function f(k,P,N){for(var S=0;S<k.length;S++)if(S!==N)for(var F=k[S],_=0;_<P.length;_++){var W=P[_];if(F[W]===!0)return!1}return!0}function C(k,P){for(var N=t.map(k,function(ne){return n.possiblePathsFrom([ne],1)}),S=l(N.length),F=t.map(N,function(ne){var ue={};return t.forEach(ne,function(ie){var X=h(ie.partialPath);t.forEach(X,function(se){ue[se]=!0})}),ue}),_=N,W=1;W<=P;W++){var $=_;_=l($.length);for(var H=function(ne){for(var ue=$[ne],ie=0;ie<ue.length;ie++){var X=ue[ie].partialPath,se=ue[ie].suffixDef,de=h(X),G=f(F,de,ne);if(G||t.isEmpty(se)||X.length===P){var q=S[ne];if(R(q,X)===!1){q.push(X);for(var j=0;j<de.length;j++){var Z=de[j];F[ne][Z]=!0}}}else{var J=n.possiblePathsFrom(se,W+1,X);_[ne]=_[ne].concat(J),t.forEach(J,function(le){var ye=h(le.partialPath);t.forEach(ye,function(Te){F[ne][Te]=!0})})}}},ee=0;ee<$.length;ee++)H(ee)}return S}i.lookAheadSequenceFromAlternatives=C;function b(k,P,N,S){var F=new g(k,A.ALTERNATION,S);return P.accept(F),C(F.result,N)}i.getLookaheadPathsForOr=b;function y(k,P,N,S){var F=new g(k,N);P.accept(F);var _=F.result,W=new I(P,k,N),$=W.startWalking(),H=new s.Alternative({definition:_}),ee=new s.Alternative({definition:$});return C([H,ee],S)}i.getLookaheadPathsForOptionalProd=y;function R(k,P){e:for(var N=0;N<k.length;N++){var S=k[N];if(S.length===P.length){for(var F=0;F<S.length;F++){var _=P[F],W=S[F],$=_===W||W.categoryMatchesMap[_.tokenTypeIdx]!==void 0;if($===!1)continue e}return!0}}return!1}i.containsPath=R;function x(k,P){return k.length<P.length&&t.every(k,function(N,S){var F=P[S];return N===F||F.categoryMatchesMap[N.tokenTypeIdx]})}i.isStrictPrefixOfPath=x;function z(k){return t.every(k,function(P){return t.every(P,function(N){return t.every(N,function(S){return t.isEmpty(S.categoryMatches)})})})}i.areTokenCategoriesNotUsed=z}),pi=Re(i=>{var e=i&&i.__extends||(function(){var S=function(F,_){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,$){W.__proto__=$}||function(W,$){for(var H in $)Object.prototype.hasOwnProperty.call($,H)&&(W[H]=$[H])},S(F,_)};return function(F,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");S(F,_);function W(){this.constructor=F}F.prototype=_===null?Object.create(_):(W.prototype=_.prototype,new W)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=Ne(),n=Ne(),r=et(),o=Ht(),s=Vt(),c=zt(),A=Je(),a=St();function d(S,F,_,W,$){var H=t.map(S,function(G){return u(G,W)}),ee=t.map(S,function(G){return h(G,G,W)}),ne=[],ue=[],ie=[];n.every(ee,n.isEmpty)&&(ne=n.map(S,function(G){return b(G,W)}),ue=n.map(S,function(G){return y(G,F,W)}),ie=z(S,F,W));var X=N(S,_,W),se=n.map(S,function(G){return x(G,W)}),de=n.map(S,function(G){return g(G,S,$,W)});return t.flatten(H.concat(ie,ee,ne,ue,X,se,de))}i.validateGrammar=d;function u(S,F){var _=new I;S.accept(_);var W=_.allProductions,$=t.groupBy(W,m),H=t.pick($,function(ne){return ne.length>1}),ee=t.map(t.values(H),function(ne){var ue=t.first(ne),ie=F.buildDuplicateFoundError(S,ne),X=o.getProductionDslName(ue),se={message:ie,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:S.name,dslName:X,occurrence:ue.idx},de=p(ue);return de&&(se.parameter=de),se});return ee}function m(S){return o.getProductionDslName(S)+"_#_"+S.idx+"_#_"+p(S)}i.identifyProductionForDuplicates=m;function p(S){return S instanceof A.Terminal?S.terminalType.name:S instanceof A.NonTerminal?S.nonTerminalName:""}var I=(function(S){e(F,S);function F(){var _=S!==null&&S.apply(this,arguments)||this;return _.allProductions=[],_}return F.prototype.visitNonTerminal=function(_){this.allProductions.push(_)},F.prototype.visitOption=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetition=function(_){this.allProductions.push(_)},F.prototype.visitAlternation=function(_){this.allProductions.push(_)},F.prototype.visitTerminal=function(_){this.allProductions.push(_)},F})(a.GAstVisitor);i.OccurrenceValidationCollector=I;function g(S,F,_,W){var $=[],H=n.reduce(F,function(ne,ue){return ue.name===S.name?ne+1:ne},0);if(H>1){var ee=W.buildDuplicateRuleNameError({topLevelRule:S,grammarName:_});$.push({message:ee,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:S.name})}return $}i.validateRuleDoesNotAlreadyExist=g;function l(S,F,_){var W=[],$;return t.contains(F,S)||($="Invalid rule override, rule: ->"+S+"<- cannot be overridden in the grammar: ->"+_+"<-as it is not defined in any of the super grammars ",W.push({message:$,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:S})),W}i.validateRuleIsOverridden=l;function h(S,F,_,W){W===void 0&&(W=[]);var $=[],H=f(F.definition);if(t.isEmpty(H))return[];var ee=S.name,ne=t.contains(H,S);ne&&$.push({message:_.buildLeftRecursionError({topLevelRule:S,leftRecursionPath:W}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(H,W.concat([S])),ie=t.map(ue,function(X){var se=t.cloneArr(W);return se.push(X),h(S,X,_,se)});return $.concat(t.flatten(ie))}i.validateNoLeftRecursion=h;function f(S){var F=[];if(t.isEmpty(S))return F;var _=t.first(S);if(_ instanceof A.NonTerminal)F.push(_.referencedRule);else if(_ instanceof A.Alternative||_ instanceof A.Option||_ instanceof A.RepetitionMandatory||_ instanceof A.RepetitionMandatoryWithSeparator||_ instanceof A.RepetitionWithSeparator||_ instanceof A.Repetition)F=F.concat(f(_.definition));else if(_ instanceof A.Alternation)F=t.flatten(t.map(_.definition,function(ee){return f(ee.definition)}));else if(!(_ instanceof A.Terminal))throw Error("non exhaustive match");var W=o.isOptionalProd(_),$=S.length>1;if(W&&$){var H=t.drop(S);return F.concat(f(H))}else return F}i.getFirstNoneTerminal=f;var C=(function(S){e(F,S);function F(){var _=S!==null&&S.apply(this,arguments)||this;return _.alternations=[],_}return F.prototype.visitAlternation=function(_){this.alternations.push(_)},F})(a.GAstVisitor);function b(S,F){var _=new C;S.accept(_);var W=_.alternations,$=t.reduce(W,function(H,ee){var ne=t.dropRight(ee.definition),ue=t.map(ne,function(ie,X){var se=c.nextPossibleTokensAfter([ie],[],null,1);return t.isEmpty(se)?{message:F.buildEmptyAlternationError({topLevelRule:S,alternation:ee,emptyChoiceIdx:X}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:S.name,occurrence:ee.idx,alternative:X+1}:null});return H.concat(t.compact(ue))},[]);return $}i.validateEmptyOrAlternative=b;function y(S,F,_){var W=new C;S.accept(W);var $=W.alternations;$=n.reject($,function(ee){return ee.ignoreAmbiguities===!0});var H=t.reduce($,function(ee,ne){var ue=ne.idx,ie=ne.maxLookahead||F,X=s.getLookaheadPathsForOr(ue,S,ie,ne),se=k(X,ne,S,_),de=P(X,ne,S,_);return ee.concat(se,de)},[]);return H}i.validateAmbiguousAlternationAlternatives=y;var R=(function(S){e(F,S);function F(){var _=S!==null&&S.apply(this,arguments)||this;return _.allProductions=[],_}return F.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetition=function(_){this.allProductions.push(_)},F})(a.GAstVisitor);i.RepetionCollector=R;function x(S,F){var _=new C;S.accept(_);var W=_.alternations,$=t.reduce(W,function(H,ee){return ee.definition.length>255&&H.push({message:F.buildTooManyAlternativesError({topLevelRule:S,alternation:ee}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:S.name,occurrence:ee.idx}),H},[]);return $}i.validateTooManyAlts=x;function z(S,F,_){var W=[];return n.forEach(S,function($){var H=new R;$.accept(H);var ee=H.allProductions;n.forEach(ee,function(ne){var ue=s.getProdType(ne),ie=ne.maxLookahead||F,X=ne.idx,se=s.getLookaheadPathsForOptionalProd(X,$,ue,ie),de=se[0];if(n.isEmpty(n.flatten(de))){var G=_.buildEmptyRepetitionError({topLevelRule:$,repetition:ne});W.push({message:G,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:$.name})}})}),W}i.validateSomeNonEmptyLookaheadPath=z;function k(S,F,_,W){var $=[],H=n.reduce(S,function(ne,ue,ie){return F.definition[ie].ignoreAmbiguities===!0||n.forEach(ue,function(X){var se=[ie];n.forEach(S,function(de,G){ie!==G&&s.containsPath(de,X)&&F.definition[G].ignoreAmbiguities!==!0&&se.push(G)}),se.length>1&&!s.containsPath($,X)&&($.push(X),ne.push({alts:se,path:X}))}),ne},[]),ee=t.map(H,function(ne){var ue=n.map(ne.alts,function(X){return X+1}),ie=W.buildAlternationAmbiguityError({topLevelRule:_,alternation:F,ambiguityIndices:ue,prefixPath:ne.path});return{message:ie,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:_.name,occurrence:F.idx,alternatives:[ne.alts]}});return ee}function P(S,F,_,W){var $=[],H=n.reduce(S,function(ee,ne,ue){var ie=n.map(ne,function(X){return{idx:ue,path:X}});return ee.concat(ie)},[]);return n.forEach(H,function(ee){var ne=F.definition[ee.idx];if(ne.ignoreAmbiguities!==!0){var ue=ee.idx,ie=ee.path,X=n.findAll(H,function(de){return F.definition[de.idx].ignoreAmbiguities!==!0&&de.idx<ue&&s.isStrictPrefixOfPath(de.path,ie)}),se=n.map(X,function(de){var G=[de.idx+1,ue+1],q=F.idx===0?"":F.idx,j=W.buildAlternationPrefixAmbiguityError({topLevelRule:_,alternation:F,ambiguityIndices:G,prefixPath:de.path});return{message:j,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:_.name,occurrence:q,alternatives:G}});$=$.concat(se)}}),$}i.checkPrefixAlternativesAmbiguities=P;function N(S,F,_){var W=[],$=n.map(F,function(H){return H.name});return n.forEach(S,function(H){var ee=H.name;if(n.contains($,ee)){var ne=_.buildNamespaceConflictError(H);W.push({message:ne,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),W}}),eo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=Ne(),t=$r(),n=pi(),r=qt();function o(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=s}),xt=Re(i=>{var e=i&&i.__extends||(function(){var I=function(g,l){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(h[C]=f[C])},I(g,l)};return function(g,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");I(g,l);function h(){this.constructor=g}g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=Ne(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(I){return t.contains(c,I.name)}i.isRecognitionException=A;var a=(function(I){e(g,I);function g(l,h){var f=this.constructor,C=I.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,f.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),d=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=n,C}return g})(a);i.MismatchedTokenException=d;var u=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=r,C}return g})(a);i.NoViableAltException=u;var m=(function(I){e(g,I);function g(l,h){var f=I.call(this,l,h)||this;return f.name=s,f}return g})(a);i.NotAllInputParsedException=m;var p=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=o,C}return g})(a);i.EarlyExitException=p}),gi=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=ft(),t=Ne(),n=xt(),r=fi(),o=et();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=s,s.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(d){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(d,"recoveryEnabled")?d.recoveryEnabled:o.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(d){var u=e.createTokenInstance(d,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(d){return!0},a.prototype.tryInRepetitionRecovery=function(d,u,m,p){for(var I=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],f=!1,C=this.LA(1),b=this.LA(1),y=function(){var R=I.LA(0),x=I.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:C,previous:R,ruleName:I.getCurrRuleFullName()}),z=new n.MismatchedTokenException(x,C,I.LA(0));z.resyncedTokens=t.dropRight(h),I.SAVE_ERROR(z)};!f;)if(this.tokenMatcher(b,p)){y();return}else if(m.call(this)){y(),d.apply(this,u);return}else this.tokenMatcher(b,g)?f=!0:(b=this.SKIP_TOKEN(),this.addToResyncTokens(b,h));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(d,u,m){return!(m===!1||d===void 0||u===void 0||this.tokenMatcher(this.LA(1),d)||this.isBackTracking()||this.canPerformInRuleRecovery(d,this.getFollowsForInRuleRecovery(d,u)))},a.prototype.getFollowsForInRuleRecovery=function(d,u){var m=this.getCurrentGrammarPath(d,u),p=this.getNextPossibleTokenTypes(m);return p},a.prototype.tryInRuleRecovery=function(d,u){if(this.canRecoverWithSingleTokenInsertion(d,u)){var m=this.getTokenToInsert(d);return m}if(this.canRecoverWithSingleTokenDeletion(d)){var p=this.SKIP_TOKEN();return this.consumeToken(),p}throw new s("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(d,u){return this.canRecoverWithSingleTokenInsertion(d,u)||this.canRecoverWithSingleTokenDeletion(d)},a.prototype.canRecoverWithSingleTokenInsertion=function(d,u){var m=this;if(!this.canTokenTypeBeInsertedInRecovery(d)||t.isEmpty(u))return!1;var p=this.LA(1),I=t.find(u,function(g){return m.tokenMatcher(p,g)})!==void 0;return I},a.prototype.canRecoverWithSingleTokenDeletion=function(d){var u=this.tokenMatcher(this.LA(2),d);return u},a.prototype.isInCurrentRuleReSyncSet=function(d){var u=this.getCurrFollowKey(),m=this.getFollowSetFromFollowKey(u);return t.contains(m,d)},a.prototype.findReSyncTokenType=function(){for(var d=this.flattenFollowSet(),u=this.LA(1),m=2;;){var p=u.tokenType;if(t.contains(d,p))return p;u=this.LA(m),m++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var d=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),m=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(d),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(m)}},a.prototype.buildFullFollowKeyStack=function(){var d=this,u=this.RULE_STACK,m=this.RULE_OCCURRENCE_STACK;return t.map(u,function(p,I){return I===0?i.EOF_FOLLOW_KEY:{ruleName:d.shortRuleNameToFullName(p),idxInCallingRule:m[I],inRule:d.shortRuleNameToFullName(u[I-1])}})},a.prototype.flattenFollowSet=function(){var d=this,u=t.map(this.buildFullFollowKeyStack(),function(m){return d.getFollowSetFromFollowKey(m)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(d){if(d===i.EOF_FOLLOW_KEY)return[e.EOF];var u=d.ruleName+d.idxInCallingRule+r.IN+d.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(d,u){return this.tokenMatcher(d,e.EOF)||u.push(d),u},a.prototype.reSyncTo=function(d){for(var u=[],m=this.LA(1);this.tokenMatcher(m,d)===!1;)m=this.SKIP_TOKEN(),this.addToResyncTokens(m,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(d,u,m,p,I,g,l){},a.prototype.getCurrentGrammarPath=function(d,u){var m=this.getHumanReadableRuleStack(),p=t.cloneArr(this.RULE_OCCURRENCE_STACK),I={ruleStack:m,occurrenceStack:p,lastTok:d,lastTokOccurrence:u};return I},a.prototype.getHumanReadableRuleStack=function(){var d=this;return t.map(this.RULE_STACK,function(u){return d.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,d,u,m,p,I,g){var l=this.getKeyForAutomaticLookahead(m,p),h=this.firstAfterRepMap[l];if(h===void 0){var f=this.getCurrRuleFullName(),C=this.getGAstProductions()[f],b=new I(C,p);h=b.startWalking(),this.firstAfterRepMap[l]=h}var y=h.token,R=h.occurrence,x=h.isEndOfRule;this.RULE_STACK.length===1&&x&&y===void 0&&(y=e.EOF,R=1),this.shouldInRepetitionRecoveryBeTried(y,R,g)&&this.tryInRepetitionRecovery(a,d,u,y)}i.attemptInRepetitionRecovery=A}),wn=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),to=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=Vt(),t=Ne(),n=et(),r=wn(),o=Ht(),s=(function(){function c(){}return c.prototype.initLooksAhead=function(A){this.dynamicTokensEnabled=t.has(A,"dynamicTokensEnabled")?A.dynamicTokensEnabled:n.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(A,"maxLookahead")?A.maxLookahead:n.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=t.isES2015MapSupported()?new Map:[],t.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},c.prototype.preComputeLookaheadFunctions=function(A){var a=this;t.forEach(A,function(d){a.TRACE_INIT(d.name+" Rule Lookahead",function(){var u=o.collectMethods(d),m=u.alternation,p=u.repetition,I=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(m,function(f){var C=f.idx===0?"":f.idx;a.TRACE_INIT(""+o.getProductionDslName(f)+C,function(){var b=e.buildLookaheadFuncForOr(f.idx,d,f.maxLookahead||a.maxLookahead,f.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[d.name],r.OR_IDX,f.idx);a.setLaFuncCache(y,b)})}),t.forEach(p,function(f){a.computeLookaheadFunc(d,f.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(I,function(f){a.computeLookaheadFunc(d,f.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(g,function(f){a.computeLookaheadFunc(d,f.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(l,function(f){a.computeLookaheadFunc(d,f.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(h,function(f){a.computeLookaheadFunc(d,f.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))})})})},c.prototype.computeLookaheadFunc=function(A,a,d,u,m,p){var I=this;this.TRACE_INIT(""+p+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,m||I.maxLookahead,I.dynamicTokensEnabled,u,I.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(I.fullRuleNameToShort[A.name],d,a);I.setLaFuncCache(l,g)})},c.prototype.lookAheadBuilderForOptional=function(A,a,d){return e.buildSingleAlternativeLookaheadFunction(A,a,d)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,d,u){return e.buildAlternativesLookAheadFunc(A,a,d,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var d=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(d,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=s}),no=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.endOffset=s.endOffset):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset)}i.setNodeLocationOnlyOffset=e;function t(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.startColumn=s.startColumn,o.startLine=s.startLine,o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine)}i.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}i.addTerminalToCst=n;function r(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}i.addNoneTerminalToCst=r}),mi=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=Ne();function t(s){return r(s.constructor)}i.classNameFromInstance=t;var n="name";function r(s){var c=s.name;return c||"anonymous"}i.functionName=r;function o(s,c){var A=Object.getOwnPropertyDescriptor(s,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(s,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=o}),io=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=Ne(),t=mi();function n(u,m){for(var p=e.keys(u),I=p.length,g=0;g<I;g++)for(var l=p[g],h=u[l],f=h.length,C=0;C<f;C++){var b=h[C];b.tokenTypeIdx===void 0&&this[b.name](b.children,m)}}i.defaultVisit=n;function r(u,m){var p=function(){};t.defineNameProp(p,u+"BaseSemantics");var I={visit:function(g,l){if(e.isArray(g)&&(g=g[0]),!e.isUndefined(g))return this[g.name](g.children,l)},validateVisitor:function(){var g=c(this,m);if(!e.isEmpty(g)){var l=e.map(g,function(h){return h.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
83
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return d},buildInvalidRuleNameError:function(s){return"deprecated"},buildDuplicateRuleNameError:function(s){var c;s.topLevelRule instanceof r.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),Xr=Re(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,u){d.__proto__=u}||function(d,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(d[m]=u[m])},c(A,a)};return function(A,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");c(A,a);function d(){this.constructor=A}A.prototype=a===null?Object.create(a):(d.prototype=a.prototype,new d)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=tt(),n=Ne(),r=St();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=o;var s=(function(c){e(A,c);function A(a,d){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=d,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(d){a.currTopLevel=d,d.accept(a)})},A.prototype.visitNonTerminal=function(a){var d=this.nameToTopRule[a.nonTerminalName];if(d)a.referencedRule=d;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=s}),Ut=Re(i=>{var e=i&&i.__extends||(function(){var l=function(h,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,b){C.__proto__=b}||function(C,b){for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(C[y]=b[y])},l(h,f)};return function(h,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");l(h,f);function C(){this.constructor=h}h.prototype=f===null?Object.create(f):(C.prototype=f.prototype,new C)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=bn(),n=Ne(),r=ci(),o=Ze(),s=(function(l){e(h,l);function h(f,C){var b=l.call(this)||this;return b.topProd=f,b.path=C,b.possibleTokTypes=[],b.nextProductionName="",b.nextProductionOccurrence=0,b.found=!1,b.isAtEndOfPath=!1,b}return h.prototype.startWalking=function(){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=n.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=n.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},h.prototype.walk=function(f,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,f,C)},h.prototype.walkProdRef=function(f,C,b){if(f.referencedRule.name===this.nextProductionName&&f.idx===this.nextProductionOccurrence){var y=C.concat(b);this.updateExpectedNext(),this.walk(f.referencedRule,y)}},h.prototype.updateExpectedNext=function(){n.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},h})(t.RestWalker);i.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(h,l);function h(f,C){var b=l.call(this,f,C)||this;return b.path=C,b.nextTerminalName="",b.nextTerminalOccurrence=0,b.nextTerminalName=b.path.lastTok.name,b.nextTerminalOccurrence=b.path.lastTokOccurrence,b}return h.prototype.walkTerminal=function(f,C,b){if(this.isAtEndOfPath&&f.terminalType.name===this.nextTerminalName&&f.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(b),R=new o.Alternative({definition:y});this.possibleTokTypes=r.first(R),this.found=!0}},h})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(f,C){var b=l.call(this)||this;return b.topRule=f,b.occurrence=C,b.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},b}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkMany.call(this,f,C,b)},h})(A);i.NextTerminalAfterManyWalker=a;var d=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkManySep.call(this,f,C,b)},h})(A);i.NextTerminalAfterManySepWalker=d;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOne.call(this,f,C,b)},h})(A);i.NextTerminalAfterAtLeastOneWalker=u;var m=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOneSep=function(f,C,b){if(f.idx===this.occurrence){var y=n.first(C.concat(b));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOneSep.call(this,f,C,b)},h})(A);i.NextTerminalAfterAtLeastOneSepWalker=m;function p(l,h,f){f===void 0&&(f=[]),f=n.cloneArr(f);var C=[],b=0;function y(v){return v.concat(n.drop(l,b+1))}function R(v){var G=p(y(v),h,f);return C.concat(G)}for(;f.length<h&&b<l.length;){var x=l[b];if(x instanceof o.Alternative||x instanceof o.NonTerminal)return R(x.definition);if(x instanceof o.Option)C=R(x.definition);else if(x instanceof o.RepetitionMandatory){var q=x.definition.concat([new o.Repetition({definition:x.definition})]);return R(q)}else if(x instanceof o.RepetitionMandatoryWithSeparator){var q=[new o.Alternative({definition:x.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})];return R(q)}else if(x instanceof o.RepetitionWithSeparator){var q=x.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})]);C=R(q)}else if(x instanceof o.Repetition){var q=x.definition.concat([new o.Repetition({definition:x.definition})]);C=R(q)}else{if(x instanceof o.Alternation)return n.forEach(x.definition,function(v){n.isEmpty(v.definition)===!1&&(C=R(v.definition))}),C;if(x instanceof o.Terminal)f.push(x.terminalType);else throw Error("non exhaustive match")}b++}return C.push({partialPath:f,suffixDef:n.drop(l,b)}),C}i.possiblePathsFrom=p;function I(l,h,f,C){var b="EXIT_NONE_TERMINAL",y=[b],R="EXIT_ALTERNATIVE",x=!1,q=h.length,v=q-C-1,G=[],D=[];for(D.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(D);){var Q=D.pop();if(Q===R){x&&n.last(D).idx<=v&&D.pop();continue}var F=Q.def,L=Q.idx,J=Q.ruleStack,$=Q.occurrenceStack;if(!n.isEmpty(F)){var j=F[0];if(j===b){var ee={idx:L,def:n.drop(F),ruleStack:n.dropRight(J),occurrenceStack:n.dropRight($)};D.push(ee)}else if(j instanceof o.Terminal)if(L<q-1){var ne=L+1,ue=h[ne];if(f(ue,j.terminalType)){var ee={idx:ne,def:n.drop(F),ruleStack:J,occurrenceStack:$};D.push(ee)}}else if(L===q-1)G.push({nextTokenType:j.terminalType,nextTokenOccurrence:j.idx,ruleStack:J,occurrenceStack:$}),x=!0;else throw Error("non exhaustive match");else if(j instanceof o.NonTerminal){var ie=n.cloneArr(J);ie.push(j.nonTerminalName);var Z=n.cloneArr($);Z.push(j.idx);var ee={idx:L,def:j.definition.concat(y,n.drop(F)),ruleStack:ie,occurrenceStack:Z};D.push(ee)}else if(j instanceof o.Option){var se={idx:L,def:n.drop(F),ruleStack:J,occurrenceStack:$};D.push(se),D.push(R);var de={idx:L,def:j.definition.concat(n.drop(F)),ruleStack:J,occurrenceStack:$};D.push(de)}else if(j instanceof o.RepetitionMandatory){var P=new o.Repetition({definition:j.definition,idx:j.idx}),H=j.definition.concat([P],n.drop(F)),ee={idx:L,def:H,ruleStack:J,occurrenceStack:$};D.push(ee)}else if(j instanceof o.RepetitionMandatoryWithSeparator){var Y=new o.Terminal({terminalType:j.separator}),P=new o.Repetition({definition:[Y].concat(j.definition),idx:j.idx}),H=j.definition.concat([P],n.drop(F)),ee={idx:L,def:H,ruleStack:J,occurrenceStack:$};D.push(ee)}else if(j instanceof o.RepetitionWithSeparator){var se={idx:L,def:n.drop(F),ruleStack:J,occurrenceStack:$};D.push(se),D.push(R);var Y=new o.Terminal({terminalType:j.separator}),V=new o.Repetition({definition:[Y].concat(j.definition),idx:j.idx}),H=j.definition.concat([V],n.drop(F)),de={idx:L,def:H,ruleStack:J,occurrenceStack:$};D.push(de)}else if(j instanceof o.Repetition){var se={idx:L,def:n.drop(F),ruleStack:J,occurrenceStack:$};D.push(se),D.push(R);var V=new o.Repetition({definition:j.definition,idx:j.idx}),H=j.definition.concat([V],n.drop(F)),de={idx:L,def:H,ruleStack:J,occurrenceStack:$};D.push(de)}else if(j instanceof o.Alternation)for(var K=j.definition.length-1;K>=0;K--){var ce=j.definition[K],Be={idx:L,def:ce.definition.concat(n.drop(F)),ruleStack:J,occurrenceStack:$};D.push(Be),D.push(R)}else if(j instanceof o.Alternative)D.push({idx:L,def:j.definition.concat(n.drop(F)),ruleStack:J,occurrenceStack:$});else if(j instanceof o.Rule)D.push(g(j,L,J,$));else throw Error("non exhaustive match")}}return G}i.nextPossibleTokensAfter=I;function g(l,h,f,C){var b=n.cloneArr(f);b.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:h,def:l.definition,ruleStack:b,occurrenceStack:y}}}),jt=Re(i=>{var e=i&&i.__extends||(function(){var v=function(G,D){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,F){Q.__proto__=F}||function(Q,F){for(var L in F)Object.prototype.hasOwnProperty.call(F,L)&&(Q[L]=F[L])},v(G,D)};return function(G,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");v(G,D);function Q(){this.constructor=G}G.prototype=D===null?Object.create(D):(Q.prototype=D.prototype,new Q)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=Ne(),n=Ut(),r=bn(),o=kt(),s=Ze(),c=St(),A;(function(v){v[v.OPTION=0]="OPTION",v[v.REPETITION=1]="REPETITION",v[v.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",v[v.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",v[v.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",v[v.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(v){if(v instanceof s.Option)return A.OPTION;if(v instanceof s.Repetition)return A.REPETITION;if(v instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(v instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(v instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(v instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function d(v,G,D,Q,F,L){var J=b(v,G,D),$=q(J)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(J,Q,$,F)}i.buildLookaheadFuncForOr=d;function u(v,G,D,Q,F,L){var J=y(v,G,F,D),$=q(J)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(J[0],$,Q)}i.buildLookaheadFuncForOptionalProd=u;function m(v,G,D,Q){var F=v.length,L=t.every(v,function(j){return t.every(j,function(ee){return ee.length===1})});if(G)return function(j){for(var ee=t.map(j,function(V){return V.GATE}),ne=0;ne<F;ne++){var ue=v[ne],ie=ue.length,Z=ee[ne];if(!(Z!==void 0&&Z.call(this)===!1))e:for(var se=0;se<ie;se++){for(var de=ue[se],P=de.length,H=0;H<P;H++){var Y=this.LA(H+1);if(D(Y,de[H])===!1)continue e}return ne}}};if(L&&!Q){var J=t.map(v,function(j){return t.flatten(j)}),$=t.reduce(J,function(j,ee,ne){return t.forEach(ee,function(ue){t.has(j,ue.tokenTypeIdx)||(j[ue.tokenTypeIdx]=ne),t.forEach(ue.categoryMatches,function(ie){t.has(j,ie)||(j[ie]=ne)})}),j},[]);return function(){var j=this.LA(1);return $[j.tokenTypeIdx]}}else return function(){for(var j=0;j<F;j++){var ee=v[j],ne=ee.length;e:for(var ue=0;ue<ne;ue++){for(var ie=ee[ue],Z=ie.length,se=0;se<Z;se++){var de=this.LA(se+1);if(D(de,ie[se])===!1)continue e}return j}}}}i.buildAlternativesLookAheadFunc=m;function p(v,G,D){var Q=t.every(v,function(ee){return ee.length===1}),F=v.length;if(Q&&!D){var L=t.flatten(v);if(L.length===1&&t.isEmpty(L[0].categoryMatches)){var J=L[0],$=J.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===$}}else{var j=t.reduce(L,function(ee,ne,ue){return ee[ne.tokenTypeIdx]=!0,t.forEach(ne.categoryMatches,function(ie){ee[ie]=!0}),ee},[]);return function(){var ee=this.LA(1);return j[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<F;ee++){for(var ne=v[ee],ue=ne.length,ie=0;ie<ue;ie++){var Z=this.LA(ie+1);if(G(Z,ne[ie])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=p;var I=(function(v){e(G,v);function G(D,Q,F){var L=v.call(this)||this;return L.topProd=D,L.targetOccurrence=Q,L.targetProdType=F,L}return G.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},G.prototype.checkIsTarget=function(D,Q,F,L){return D.idx===this.targetOccurrence&&this.targetProdType===Q?(this.restDef=F.concat(L),!0):!1},G.prototype.walkOption=function(D,Q,F){this.checkIsTarget(D,A.OPTION,Q,F)||v.prototype.walkOption.call(this,D,Q,F)},G.prototype.walkAtLeastOne=function(D,Q,F){this.checkIsTarget(D,A.REPETITION_MANDATORY,Q,F)||v.prototype.walkOption.call(this,D,Q,F)},G.prototype.walkAtLeastOneSep=function(D,Q,F){this.checkIsTarget(D,A.REPETITION_MANDATORY_WITH_SEPARATOR,Q,F)||v.prototype.walkOption.call(this,D,Q,F)},G.prototype.walkMany=function(D,Q,F){this.checkIsTarget(D,A.REPETITION,Q,F)||v.prototype.walkOption.call(this,D,Q,F)},G.prototype.walkManySep=function(D,Q,F){this.checkIsTarget(D,A.REPETITION_WITH_SEPARATOR,Q,F)||v.prototype.walkOption.call(this,D,Q,F)},G})(r.RestWalker),g=(function(v){e(G,v);function G(D,Q,F){var L=v.call(this)||this;return L.targetOccurrence=D,L.targetProdType=Q,L.targetRef=F,L.result=[],L}return G.prototype.checkIsTarget=function(D,Q){D.idx===this.targetOccurrence&&this.targetProdType===Q&&(this.targetRef===void 0||D===this.targetRef)&&(this.result=D.definition)},G.prototype.visitOption=function(D){this.checkIsTarget(D,A.OPTION)},G.prototype.visitRepetition=function(D){this.checkIsTarget(D,A.REPETITION)},G.prototype.visitRepetitionMandatory=function(D){this.checkIsTarget(D,A.REPETITION_MANDATORY)},G.prototype.visitRepetitionMandatoryWithSeparator=function(D){this.checkIsTarget(D,A.REPETITION_MANDATORY_WITH_SEPARATOR)},G.prototype.visitRepetitionWithSeparator=function(D){this.checkIsTarget(D,A.REPETITION_WITH_SEPARATOR)},G.prototype.visitAlternation=function(D){this.checkIsTarget(D,A.ALTERNATION)},G})(c.GAstVisitor);function l(v){for(var G=new Array(v),D=0;D<v;D++)G[D]=[];return G}function h(v){for(var G=[""],D=0;D<v.length;D++){for(var Q=v[D],F=[],L=0;L<G.length;L++){var J=G[L];F.push(J+"_"+Q.tokenTypeIdx);for(var $=0;$<Q.categoryMatches.length;$++){var j="_"+Q.categoryMatches[$];F.push(J+j)}}G=F}return G}function f(v,G,D){for(var Q=0;Q<v.length;Q++)if(Q!==D)for(var F=v[Q],L=0;L<G.length;L++){var J=G[L];if(F[J]===!0)return!1}return!0}function C(v,G){for(var D=t.map(v,function(ne){return n.possiblePathsFrom([ne],1)}),Q=l(D.length),F=t.map(D,function(ne){var ue={};return t.forEach(ne,function(ie){var Z=h(ie.partialPath);t.forEach(Z,function(se){ue[se]=!0})}),ue}),L=D,J=1;J<=G;J++){var $=L;L=l($.length);for(var j=function(ne){for(var ue=$[ne],ie=0;ie<ue.length;ie++){var Z=ue[ie].partialPath,se=ue[ie].suffixDef,de=h(Z),P=f(F,de,ne);if(P||t.isEmpty(se)||Z.length===G){var H=Q[ne];if(R(H,Z)===!1){H.push(Z);for(var Y=0;Y<de.length;Y++){var V=de[Y];F[ne][V]=!0}}}else{var K=n.possiblePathsFrom(se,J+1,Z);L[ne]=L[ne].concat(K),t.forEach(K,function(ce){var Be=h(ce.partialPath);t.forEach(Be,function(Te){F[ne][Te]=!0})})}}},ee=0;ee<$.length;ee++)j(ee)}return Q}i.lookAheadSequenceFromAlternatives=C;function b(v,G,D,Q){var F=new g(v,A.ALTERNATION,Q);return G.accept(F),C(F.result,D)}i.getLookaheadPathsForOr=b;function y(v,G,D,Q){var F=new g(v,D);G.accept(F);var L=F.result,J=new I(G,v,D),$=J.startWalking(),j=new s.Alternative({definition:L}),ee=new s.Alternative({definition:$});return C([j,ee],Q)}i.getLookaheadPathsForOptionalProd=y;function R(v,G){e:for(var D=0;D<v.length;D++){var Q=v[D];if(Q.length===G.length){for(var F=0;F<Q.length;F++){var L=G[F],J=Q[F],$=L===J||J.categoryMatchesMap[L.tokenTypeIdx]!==void 0;if($===!1)continue e}return!0}}return!1}i.containsPath=R;function x(v,G){return v.length<G.length&&t.every(v,function(D,Q){var F=G[Q];return D===F||F.categoryMatchesMap[D.tokenTypeIdx]})}i.isStrictPrefixOfPath=x;function q(v){return t.every(v,function(G){return t.every(G,function(D){return t.every(D,function(Q){return t.isEmpty(Q.categoryMatches)})})})}i.areTokenCategoriesNotUsed=q}),ui=Re(i=>{var e=i&&i.__extends||(function(){var Q=function(F,L){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,$){J.__proto__=$}||function(J,$){for(var j in $)Object.prototype.hasOwnProperty.call($,j)&&(J[j]=$[j])},Q(F,L)};return function(F,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");Q(F,L);function J(){this.constructor=F}F.prototype=L===null?Object.create(L):(J.prototype=L.prototype,new J)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=Ne(),n=Ne(),r=tt(),o=Pt(),s=jt(),c=Ut(),A=Ze(),a=St();function d(Q,F,L,J,$){var j=t.map(Q,function(P){return u(P,J)}),ee=t.map(Q,function(P){return h(P,P,J)}),ne=[],ue=[],ie=[];n.every(ee,n.isEmpty)&&(ne=n.map(Q,function(P){return b(P,J)}),ue=n.map(Q,function(P){return y(P,F,J)}),ie=q(Q,F,J));var Z=D(Q,L,J),se=n.map(Q,function(P){return x(P,J)}),de=n.map(Q,function(P){return g(P,Q,$,J)});return t.flatten(j.concat(ie,ee,ne,ue,Z,se,de))}i.validateGrammar=d;function u(Q,F){var L=new I;Q.accept(L);var J=L.allProductions,$=t.groupBy(J,m),j=t.pick($,function(ne){return ne.length>1}),ee=t.map(t.values(j),function(ne){var ue=t.first(ne),ie=F.buildDuplicateFoundError(Q,ne),Z=o.getProductionDslName(ue),se={message:ie,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:Q.name,dslName:Z,occurrence:ue.idx},de=p(ue);return de&&(se.parameter=de),se});return ee}function m(Q){return o.getProductionDslName(Q)+"_#_"+Q.idx+"_#_"+p(Q)}i.identifyProductionForDuplicates=m;function p(Q){return Q instanceof A.Terminal?Q.terminalType.name:Q instanceof A.NonTerminal?Q.nonTerminalName:""}var I=(function(Q){e(F,Q);function F(){var L=Q!==null&&Q.apply(this,arguments)||this;return L.allProductions=[],L}return F.prototype.visitNonTerminal=function(L){this.allProductions.push(L)},F.prototype.visitOption=function(L){this.allProductions.push(L)},F.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},F.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},F.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},F.prototype.visitRepetition=function(L){this.allProductions.push(L)},F.prototype.visitAlternation=function(L){this.allProductions.push(L)},F.prototype.visitTerminal=function(L){this.allProductions.push(L)},F})(a.GAstVisitor);i.OccurrenceValidationCollector=I;function g(Q,F,L,J){var $=[],j=n.reduce(F,function(ne,ue){return ue.name===Q.name?ne+1:ne},0);if(j>1){var ee=J.buildDuplicateRuleNameError({topLevelRule:Q,grammarName:L});$.push({message:ee,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:Q.name})}return $}i.validateRuleDoesNotAlreadyExist=g;function l(Q,F,L){var J=[],$;return t.contains(F,Q)||($="Invalid rule override, rule: ->"+Q+"<- cannot be overridden in the grammar: ->"+L+"<-as it is not defined in any of the super grammars ",J.push({message:$,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:Q})),J}i.validateRuleIsOverridden=l;function h(Q,F,L,J){J===void 0&&(J=[]);var $=[],j=f(F.definition);if(t.isEmpty(j))return[];var ee=Q.name,ne=t.contains(j,Q);ne&&$.push({message:L.buildLeftRecursionError({topLevelRule:Q,leftRecursionPath:J}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(j,J.concat([Q])),ie=t.map(ue,function(Z){var se=t.cloneArr(J);return se.push(Z),h(Q,Z,L,se)});return $.concat(t.flatten(ie))}i.validateNoLeftRecursion=h;function f(Q){var F=[];if(t.isEmpty(Q))return F;var L=t.first(Q);if(L instanceof A.NonTerminal)F.push(L.referencedRule);else if(L instanceof A.Alternative||L instanceof A.Option||L instanceof A.RepetitionMandatory||L instanceof A.RepetitionMandatoryWithSeparator||L instanceof A.RepetitionWithSeparator||L instanceof A.Repetition)F=F.concat(f(L.definition));else if(L instanceof A.Alternation)F=t.flatten(t.map(L.definition,function(ee){return f(ee.definition)}));else if(!(L instanceof A.Terminal))throw Error("non exhaustive match");var J=o.isOptionalProd(L),$=Q.length>1;if(J&&$){var j=t.drop(Q);return F.concat(f(j))}else return F}i.getFirstNoneTerminal=f;var C=(function(Q){e(F,Q);function F(){var L=Q!==null&&Q.apply(this,arguments)||this;return L.alternations=[],L}return F.prototype.visitAlternation=function(L){this.alternations.push(L)},F})(a.GAstVisitor);function b(Q,F){var L=new C;Q.accept(L);var J=L.alternations,$=t.reduce(J,function(j,ee){var ne=t.dropRight(ee.definition),ue=t.map(ne,function(ie,Z){var se=c.nextPossibleTokensAfter([ie],[],null,1);return t.isEmpty(se)?{message:F.buildEmptyAlternationError({topLevelRule:Q,alternation:ee,emptyChoiceIdx:Z}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:Q.name,occurrence:ee.idx,alternative:Z+1}:null});return j.concat(t.compact(ue))},[]);return $}i.validateEmptyOrAlternative=b;function y(Q,F,L){var J=new C;Q.accept(J);var $=J.alternations;$=n.reject($,function(ee){return ee.ignoreAmbiguities===!0});var j=t.reduce($,function(ee,ne){var ue=ne.idx,ie=ne.maxLookahead||F,Z=s.getLookaheadPathsForOr(ue,Q,ie,ne),se=v(Z,ne,Q,L),de=G(Z,ne,Q,L);return ee.concat(se,de)},[]);return j}i.validateAmbiguousAlternationAlternatives=y;var R=(function(Q){e(F,Q);function F(){var L=Q!==null&&Q.apply(this,arguments)||this;return L.allProductions=[],L}return F.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},F.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},F.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},F.prototype.visitRepetition=function(L){this.allProductions.push(L)},F})(a.GAstVisitor);i.RepetionCollector=R;function x(Q,F){var L=new C;Q.accept(L);var J=L.alternations,$=t.reduce(J,function(j,ee){return ee.definition.length>255&&j.push({message:F.buildTooManyAlternativesError({topLevelRule:Q,alternation:ee}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:Q.name,occurrence:ee.idx}),j},[]);return $}i.validateTooManyAlts=x;function q(Q,F,L){var J=[];return n.forEach(Q,function($){var j=new R;$.accept(j);var ee=j.allProductions;n.forEach(ee,function(ne){var ue=s.getProdType(ne),ie=ne.maxLookahead||F,Z=ne.idx,se=s.getLookaheadPathsForOptionalProd(Z,$,ue,ie),de=se[0];if(n.isEmpty(n.flatten(de))){var P=L.buildEmptyRepetitionError({topLevelRule:$,repetition:ne});J.push({message:P,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:$.name})}})}),J}i.validateSomeNonEmptyLookaheadPath=q;function v(Q,F,L,J){var $=[],j=n.reduce(Q,function(ne,ue,ie){return F.definition[ie].ignoreAmbiguities===!0||n.forEach(ue,function(Z){var se=[ie];n.forEach(Q,function(de,P){ie!==P&&s.containsPath(de,Z)&&F.definition[P].ignoreAmbiguities!==!0&&se.push(P)}),se.length>1&&!s.containsPath($,Z)&&($.push(Z),ne.push({alts:se,path:Z}))}),ne},[]),ee=t.map(j,function(ne){var ue=n.map(ne.alts,function(Z){return Z+1}),ie=J.buildAlternationAmbiguityError({topLevelRule:L,alternation:F,ambiguityIndices:ue,prefixPath:ne.path});return{message:ie,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:L.name,occurrence:F.idx,alternatives:[ne.alts]}});return ee}function G(Q,F,L,J){var $=[],j=n.reduce(Q,function(ee,ne,ue){var ie=n.map(ne,function(Z){return{idx:ue,path:Z}});return ee.concat(ie)},[]);return n.forEach(j,function(ee){var ne=F.definition[ee.idx];if(ne.ignoreAmbiguities!==!0){var ue=ee.idx,ie=ee.path,Z=n.findAll(j,function(de){return F.definition[de.idx].ignoreAmbiguities!==!0&&de.idx<ue&&s.isStrictPrefixOfPath(de.path,ie)}),se=n.map(Z,function(de){var P=[de.idx+1,ue+1],H=F.idx===0?"":F.idx,Y=J.buildAlternationPrefixAmbiguityError({topLevelRule:L,alternation:F,ambiguityIndices:P,prefixPath:de.path});return{message:Y,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:L.name,occurrence:H,alternatives:P}});$=$.concat(se)}}),$}i.checkPrefixAlternativesAmbiguities=G;function D(Q,F,L){var J=[],$=n.map(F,function(j){return j.name});return n.forEach(Q,function(j){var ee=j.name;if(n.contains($,ee)){var ne=L.buildNamespaceConflictError(j);J.push({message:ne,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),J}}),Zr=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=Ne(),t=Xr(),n=ui(),r=Gt();function o(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=s}),xt=Re(i=>{var e=i&&i.__extends||(function(){var I=function(g,l){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(h[C]=f[C])},I(g,l)};return function(g,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");I(g,l);function h(){this.constructor=g}g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=Ne(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(I){return t.contains(c,I.name)}i.isRecognitionException=A;var a=(function(I){e(g,I);function g(l,h){var f=this.constructor,C=I.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,f.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),d=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=n,C}return g})(a);i.MismatchedTokenException=d;var u=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=r,C}return g})(a);i.NoViableAltException=u;var m=(function(I){e(g,I);function g(l,h){var f=I.call(this,l,h)||this;return f.name=s,f}return g})(a);i.NotAllInputParsedException=m;var p=(function(I){e(g,I);function g(l,h,f){var C=I.call(this,l,h)||this;return C.previousToken=f,C.name=o,C}return g})(a);i.EarlyExitException=p}),hi=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=pt(),t=Ne(),n=xt(),r=li(),o=tt();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=s,s.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(d){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(d,"recoveryEnabled")?d.recoveryEnabled:o.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(d){var u=e.createTokenInstance(d,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(d){return!0},a.prototype.tryInRepetitionRecovery=function(d,u,m,p){for(var I=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],f=!1,C=this.LA(1),b=this.LA(1),y=function(){var R=I.LA(0),x=I.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:C,previous:R,ruleName:I.getCurrRuleFullName()}),q=new n.MismatchedTokenException(x,C,I.LA(0));q.resyncedTokens=t.dropRight(h),I.SAVE_ERROR(q)};!f;)if(this.tokenMatcher(b,p)){y();return}else if(m.call(this)){y(),d.apply(this,u);return}else this.tokenMatcher(b,g)?f=!0:(b=this.SKIP_TOKEN(),this.addToResyncTokens(b,h));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(d,u,m){return!(m===!1||d===void 0||u===void 0||this.tokenMatcher(this.LA(1),d)||this.isBackTracking()||this.canPerformInRuleRecovery(d,this.getFollowsForInRuleRecovery(d,u)))},a.prototype.getFollowsForInRuleRecovery=function(d,u){var m=this.getCurrentGrammarPath(d,u),p=this.getNextPossibleTokenTypes(m);return p},a.prototype.tryInRuleRecovery=function(d,u){if(this.canRecoverWithSingleTokenInsertion(d,u)){var m=this.getTokenToInsert(d);return m}if(this.canRecoverWithSingleTokenDeletion(d)){var p=this.SKIP_TOKEN();return this.consumeToken(),p}throw new s("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(d,u){return this.canRecoverWithSingleTokenInsertion(d,u)||this.canRecoverWithSingleTokenDeletion(d)},a.prototype.canRecoverWithSingleTokenInsertion=function(d,u){var m=this;if(!this.canTokenTypeBeInsertedInRecovery(d)||t.isEmpty(u))return!1;var p=this.LA(1),I=t.find(u,function(g){return m.tokenMatcher(p,g)})!==void 0;return I},a.prototype.canRecoverWithSingleTokenDeletion=function(d){var u=this.tokenMatcher(this.LA(2),d);return u},a.prototype.isInCurrentRuleReSyncSet=function(d){var u=this.getCurrFollowKey(),m=this.getFollowSetFromFollowKey(u);return t.contains(m,d)},a.prototype.findReSyncTokenType=function(){for(var d=this.flattenFollowSet(),u=this.LA(1),m=2;;){var p=u.tokenType;if(t.contains(d,p))return p;u=this.LA(m),m++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var d=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),m=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(d),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(m)}},a.prototype.buildFullFollowKeyStack=function(){var d=this,u=this.RULE_STACK,m=this.RULE_OCCURRENCE_STACK;return t.map(u,function(p,I){return I===0?i.EOF_FOLLOW_KEY:{ruleName:d.shortRuleNameToFullName(p),idxInCallingRule:m[I],inRule:d.shortRuleNameToFullName(u[I-1])}})},a.prototype.flattenFollowSet=function(){var d=this,u=t.map(this.buildFullFollowKeyStack(),function(m){return d.getFollowSetFromFollowKey(m)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(d){if(d===i.EOF_FOLLOW_KEY)return[e.EOF];var u=d.ruleName+d.idxInCallingRule+r.IN+d.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(d,u){return this.tokenMatcher(d,e.EOF)||u.push(d),u},a.prototype.reSyncTo=function(d){for(var u=[],m=this.LA(1);this.tokenMatcher(m,d)===!1;)m=this.SKIP_TOKEN(),this.addToResyncTokens(m,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(d,u,m,p,I,g,l){},a.prototype.getCurrentGrammarPath=function(d,u){var m=this.getHumanReadableRuleStack(),p=t.cloneArr(this.RULE_OCCURRENCE_STACK),I={ruleStack:m,occurrenceStack:p,lastTok:d,lastTokOccurrence:u};return I},a.prototype.getHumanReadableRuleStack=function(){var d=this;return t.map(this.RULE_STACK,function(u){return d.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,d,u,m,p,I,g){var l=this.getKeyForAutomaticLookahead(m,p),h=this.firstAfterRepMap[l];if(h===void 0){var f=this.getCurrRuleFullName(),C=this.getGAstProductions()[f],b=new I(C,p);h=b.startWalking(),this.firstAfterRepMap[l]=h}var y=h.token,R=h.occurrence,x=h.isEndOfRule;this.RULE_STACK.length===1&&x&&y===void 0&&(y=e.EOF,R=1),this.shouldInRepetitionRecoveryBeTried(y,R,g)&&this.tryInRepetitionRecovery(a,d,u,y)}i.attemptInRepetitionRecovery=A}),Cn=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),$r=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=jt(),t=Ne(),n=tt(),r=Cn(),o=Pt(),s=(function(){function c(){}return c.prototype.initLooksAhead=function(A){this.dynamicTokensEnabled=t.has(A,"dynamicTokensEnabled")?A.dynamicTokensEnabled:n.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(A,"maxLookahead")?A.maxLookahead:n.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=t.isES2015MapSupported()?new Map:[],t.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},c.prototype.preComputeLookaheadFunctions=function(A){var a=this;t.forEach(A,function(d){a.TRACE_INIT(d.name+" Rule Lookahead",function(){var u=o.collectMethods(d),m=u.alternation,p=u.repetition,I=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(m,function(f){var C=f.idx===0?"":f.idx;a.TRACE_INIT(""+o.getProductionDslName(f)+C,function(){var b=e.buildLookaheadFuncForOr(f.idx,d,f.maxLookahead||a.maxLookahead,f.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[d.name],r.OR_IDX,f.idx);a.setLaFuncCache(y,b)})}),t.forEach(p,function(f){a.computeLookaheadFunc(d,f.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(I,function(f){a.computeLookaheadFunc(d,f.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(g,function(f){a.computeLookaheadFunc(d,f.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(l,function(f){a.computeLookaheadFunc(d,f.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(h,function(f){a.computeLookaheadFunc(d,f.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))})})})},c.prototype.computeLookaheadFunc=function(A,a,d,u,m,p){var I=this;this.TRACE_INIT(""+p+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,m||I.maxLookahead,I.dynamicTokensEnabled,u,I.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(I.fullRuleNameToShort[A.name],d,a);I.setLaFuncCache(l,g)})},c.prototype.lookAheadBuilderForOptional=function(A,a,d){return e.buildSingleAlternativeLookaheadFunction(A,a,d)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,d,u){return e.buildAlternativesLookAheadFunc(A,a,d,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var d=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(d,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=s}),eo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.endOffset=s.endOffset):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset)}i.setNodeLocationOnlyOffset=e;function t(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.startColumn=s.startColumn,o.startLine=s.startLine,o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine)}i.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}i.addTerminalToCst=n;function r(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}i.addNoneTerminalToCst=r}),di=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=Ne();function t(s){return r(s.constructor)}i.classNameFromInstance=t;var n="name";function r(s){var c=s.name;return c||"anonymous"}i.functionName=r;function o(s,c){var A=Object.getOwnPropertyDescriptor(s,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(s,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=o}),to=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=Ne(),t=di();function n(u,m){for(var p=e.keys(u),I=p.length,g=0;g<I;g++)for(var l=p[g],h=u[l],f=h.length,C=0;C<f;C++){var b=h[C];b.tokenTypeIdx===void 0&&this[b.name](b.children,m)}}i.defaultVisit=n;function r(u,m){var p=function(){};t.defineNameProp(p,u+"BaseSemantics");var I={visit:function(g,l){if(e.isArray(g)&&(g=g[0]),!e.isUndefined(g))return this[g.name](g.children,l)},validateVisitor:function(){var g=c(this,m);if(!e.isEmpty(g)){var l=e.map(g,function(h){return h.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
84
84
  `+(""+l.join(`
85
85
 
86
86
  `).replace(/\n/g,`
87
87
  `)))}}};return p.prototype=I,p.prototype.constructor=p,p._RULE_NAMES=m,p}i.createBaseSemanticVisitorConstructor=r;function o(u,m,p){var I=function(){};t.defineNameProp(I,u+"BaseSemanticsWithDefaults");var g=Object.create(p.prototype);return e.forEach(m,function(l){g[l]=n}),I.prototype=g,I.prototype.constructor=I,I}i.createBaseVisitorConstructorWithDefaults=o;var s;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(s=i.CstVisitorDefinitionError||(i.CstVisitorDefinitionError={}));function c(u,m){var p=A(u,m),I=d(u,m);return p.concat(I)}i.validateVisitor=c;function A(u,m){var p=e.map(m,function(I){if(!e.isFunction(u[I]))return{msg:"Missing visitor method: <"+I+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:s.MISSING_METHOD,methodName:I}});return e.compact(p)}i.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function d(u,m){var p=[];for(var I in u)e.isFunction(u[I])&&!e.contains(a,I)&&!e.contains(m,I)&&p.push({msg:"Redundant visitor method: <"+I+"> on "+t.functionName(u.constructor)+` CST Visitor
88
88
  There is no Grammar Rule corresponding to this method's name.
89
- `,type:s.REDUNDANT_METHOD,methodName:I});return p}i.validateRedundantMethods=d}),ro=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=no(),t=Ne(),n=io(),r=et(),o=(function(){function s(){}return s.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},s.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},s.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},s.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.setInitialNodeLocationFullRegular=function(c){var A=this.LA(1);c.location={startOffset:A.startOffset,startLine:A.startLine,startColumn:A.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},s.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},s.prototype.cstPostRuleFull=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?(a.endOffset=A.endOffset,a.endLine=A.endLine,a.endColumn=A.endColumn):(a.startOffset=NaN,a.startLine=NaN,a.startColumn=NaN)},s.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},s.prototype.cstPostTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(a,A,c),this.setNodeLocationFromToken(a.location,A)},s.prototype.cstPostNonTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(a,A,c),this.setNodeLocationFromNode(a.location,c.location)},s.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=n.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},s.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=n.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},s.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},s.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},s.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},s})();i.TreeBuilder=o}),oo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=et(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var o=this.currIdx+r;return o<0||this.tokVectorLength<=o?e.END_OF_FILE:this.tokVector[o]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),so=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=Ne(),t=xt(),n=et(),r=qt(),o=pi(),s=Je(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,d,u){return this.consumeInternal(d,a,u)},A.prototype.subrule=function(a,d,u){return this.subruleInternal(d,a,u)},A.prototype.option=function(a,d){return this.optionInternal(d,a)},A.prototype.or=function(a,d){return this.orInternal(d,a)},A.prototype.many=function(a,d){return this.manyInternal(a,d)},A.prototype.atLeastOne=function(a,d){return this.atLeastOneInternal(a,d)},A.prototype.CONSUME=function(a,d){return this.consumeInternal(a,0,d)},A.prototype.CONSUME1=function(a,d){return this.consumeInternal(a,1,d)},A.prototype.CONSUME2=function(a,d){return this.consumeInternal(a,2,d)},A.prototype.CONSUME3=function(a,d){return this.consumeInternal(a,3,d)},A.prototype.CONSUME4=function(a,d){return this.consumeInternal(a,4,d)},A.prototype.CONSUME5=function(a,d){return this.consumeInternal(a,5,d)},A.prototype.CONSUME6=function(a,d){return this.consumeInternal(a,6,d)},A.prototype.CONSUME7=function(a,d){return this.consumeInternal(a,7,d)},A.prototype.CONSUME8=function(a,d){return this.consumeInternal(a,8,d)},A.prototype.CONSUME9=function(a,d){return this.consumeInternal(a,9,d)},A.prototype.SUBRULE=function(a,d){return this.subruleInternal(a,0,d)},A.prototype.SUBRULE1=function(a,d){return this.subruleInternal(a,1,d)},A.prototype.SUBRULE2=function(a,d){return this.subruleInternal(a,2,d)},A.prototype.SUBRULE3=function(a,d){return this.subruleInternal(a,3,d)},A.prototype.SUBRULE4=function(a,d){return this.subruleInternal(a,4,d)},A.prototype.SUBRULE5=function(a,d){return this.subruleInternal(a,5,d)},A.prototype.SUBRULE6=function(a,d){return this.subruleInternal(a,6,d)},A.prototype.SUBRULE7=function(a,d){return this.subruleInternal(a,7,d)},A.prototype.SUBRULE8=function(a,d){return this.subruleInternal(a,8,d)},A.prototype.SUBRULE9=function(a,d){return this.subruleInternal(a,9,d)},A.prototype.OPTION=function(a){return this.optionInternal(a,0)},A.prototype.OPTION1=function(a){return this.optionInternal(a,1)},A.prototype.OPTION2=function(a){return this.optionInternal(a,2)},A.prototype.OPTION3=function(a){return this.optionInternal(a,3)},A.prototype.OPTION4=function(a){return this.optionInternal(a,4)},A.prototype.OPTION5=function(a){return this.optionInternal(a,5)},A.prototype.OPTION6=function(a){return this.optionInternal(a,6)},A.prototype.OPTION7=function(a){return this.optionInternal(a,7)},A.prototype.OPTION8=function(a){return this.optionInternal(a,8)},A.prototype.OPTION9=function(a){return this.optionInternal(a,9)},A.prototype.OR=function(a){return this.orInternal(a,0)},A.prototype.OR1=function(a){return this.orInternal(a,1)},A.prototype.OR2=function(a){return this.orInternal(a,2)},A.prototype.OR3=function(a){return this.orInternal(a,3)},A.prototype.OR4=function(a){return this.orInternal(a,4)},A.prototype.OR5=function(a){return this.orInternal(a,5)},A.prototype.OR6=function(a){return this.orInternal(a,6)},A.prototype.OR7=function(a){return this.orInternal(a,7)},A.prototype.OR8=function(a){return this.orInternal(a,8)},A.prototype.OR9=function(a){return this.orInternal(a,9)},A.prototype.MANY=function(a){this.manyInternal(0,a)},A.prototype.MANY1=function(a){this.manyInternal(1,a)},A.prototype.MANY2=function(a){this.manyInternal(2,a)},A.prototype.MANY3=function(a){this.manyInternal(3,a)},A.prototype.MANY4=function(a){this.manyInternal(4,a)},A.prototype.MANY5=function(a){this.manyInternal(5,a)},A.prototype.MANY6=function(a){this.manyInternal(6,a)},A.prototype.MANY7=function(a){this.manyInternal(7,a)},A.prototype.MANY8=function(a){this.manyInternal(8,a)},A.prototype.MANY9=function(a){this.manyInternal(9,a)},A.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},A.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},A.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},A.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},A.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},A.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},A.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},A.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},A.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},A.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},A.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},A.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},A.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},A.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},A.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},A.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},A.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},A.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},A.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},A.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},A.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},A.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},A.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},A.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},A.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},A.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},A.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},A.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},A.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},A.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},A.prototype.RULE=function(a,d,u){if(u===void 0&&(u=n.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var m=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),p={message:m,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(p)}this.definedRulesNames.push(a);var I=this.defineRule(a,d,u);return this[a]=I,I},A.prototype.OVERRIDE_RULE=function(a,d,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var m=[];m=m.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(m);var p=this.defineRule(a,d,u);return this[a]=p,p},A.prototype.BACKTRACK=function(a,d){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,d),!0}catch(m){if(t.isRecognitionException(m))return!1;throw m}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}},A.prototype.getGAstProductions=function(){return this.gastProductionsCache},A.prototype.getSerializedGastProductions=function(){return s.serializeGrammar(e.values(this.gastProductionsCache))},A})();i.RecognizerApi=c}),ao=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=Ne(),t=wn(),n=xt(),r=Vt(),o=zt(),s=et(),c=gi(),A=ft(),a=kt(),d=mi(),u=(function(){function m(){}return m.prototype.initRecognizerEngine=function(p,I){if(this.className=d.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=a.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(I,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
89
+ `,type:s.REDUNDANT_METHOD,methodName:I});return p}i.validateRedundantMethods=d}),no=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=eo(),t=Ne(),n=to(),r=tt(),o=(function(){function s(){}return s.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},s.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},s.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},s.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.setInitialNodeLocationFullRegular=function(c){var A=this.LA(1);c.location={startOffset:A.startOffset,startLine:A.startLine,startColumn:A.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},s.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},s.prototype.cstPostRuleFull=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?(a.endOffset=A.endOffset,a.endLine=A.endLine,a.endColumn=A.endColumn):(a.startOffset=NaN,a.startLine=NaN,a.startColumn=NaN)},s.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},s.prototype.cstPostTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(a,A,c),this.setNodeLocationFromToken(a.location,A)},s.prototype.cstPostNonTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(a,A,c),this.setNodeLocationFromNode(a.location,c.location)},s.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=n.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},s.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=n.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},s.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},s.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},s.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},s})();i.TreeBuilder=o}),io=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=tt(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var o=this.currIdx+r;return o<0||this.tokVectorLength<=o?e.END_OF_FILE:this.tokVector[o]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),ro=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=Ne(),t=xt(),n=tt(),r=Gt(),o=ui(),s=Ze(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,d,u){return this.consumeInternal(d,a,u)},A.prototype.subrule=function(a,d,u){return this.subruleInternal(d,a,u)},A.prototype.option=function(a,d){return this.optionInternal(d,a)},A.prototype.or=function(a,d){return this.orInternal(d,a)},A.prototype.many=function(a,d){return this.manyInternal(a,d)},A.prototype.atLeastOne=function(a,d){return this.atLeastOneInternal(a,d)},A.prototype.CONSUME=function(a,d){return this.consumeInternal(a,0,d)},A.prototype.CONSUME1=function(a,d){return this.consumeInternal(a,1,d)},A.prototype.CONSUME2=function(a,d){return this.consumeInternal(a,2,d)},A.prototype.CONSUME3=function(a,d){return this.consumeInternal(a,3,d)},A.prototype.CONSUME4=function(a,d){return this.consumeInternal(a,4,d)},A.prototype.CONSUME5=function(a,d){return this.consumeInternal(a,5,d)},A.prototype.CONSUME6=function(a,d){return this.consumeInternal(a,6,d)},A.prototype.CONSUME7=function(a,d){return this.consumeInternal(a,7,d)},A.prototype.CONSUME8=function(a,d){return this.consumeInternal(a,8,d)},A.prototype.CONSUME9=function(a,d){return this.consumeInternal(a,9,d)},A.prototype.SUBRULE=function(a,d){return this.subruleInternal(a,0,d)},A.prototype.SUBRULE1=function(a,d){return this.subruleInternal(a,1,d)},A.prototype.SUBRULE2=function(a,d){return this.subruleInternal(a,2,d)},A.prototype.SUBRULE3=function(a,d){return this.subruleInternal(a,3,d)},A.prototype.SUBRULE4=function(a,d){return this.subruleInternal(a,4,d)},A.prototype.SUBRULE5=function(a,d){return this.subruleInternal(a,5,d)},A.prototype.SUBRULE6=function(a,d){return this.subruleInternal(a,6,d)},A.prototype.SUBRULE7=function(a,d){return this.subruleInternal(a,7,d)},A.prototype.SUBRULE8=function(a,d){return this.subruleInternal(a,8,d)},A.prototype.SUBRULE9=function(a,d){return this.subruleInternal(a,9,d)},A.prototype.OPTION=function(a){return this.optionInternal(a,0)},A.prototype.OPTION1=function(a){return this.optionInternal(a,1)},A.prototype.OPTION2=function(a){return this.optionInternal(a,2)},A.prototype.OPTION3=function(a){return this.optionInternal(a,3)},A.prototype.OPTION4=function(a){return this.optionInternal(a,4)},A.prototype.OPTION5=function(a){return this.optionInternal(a,5)},A.prototype.OPTION6=function(a){return this.optionInternal(a,6)},A.prototype.OPTION7=function(a){return this.optionInternal(a,7)},A.prototype.OPTION8=function(a){return this.optionInternal(a,8)},A.prototype.OPTION9=function(a){return this.optionInternal(a,9)},A.prototype.OR=function(a){return this.orInternal(a,0)},A.prototype.OR1=function(a){return this.orInternal(a,1)},A.prototype.OR2=function(a){return this.orInternal(a,2)},A.prototype.OR3=function(a){return this.orInternal(a,3)},A.prototype.OR4=function(a){return this.orInternal(a,4)},A.prototype.OR5=function(a){return this.orInternal(a,5)},A.prototype.OR6=function(a){return this.orInternal(a,6)},A.prototype.OR7=function(a){return this.orInternal(a,7)},A.prototype.OR8=function(a){return this.orInternal(a,8)},A.prototype.OR9=function(a){return this.orInternal(a,9)},A.prototype.MANY=function(a){this.manyInternal(0,a)},A.prototype.MANY1=function(a){this.manyInternal(1,a)},A.prototype.MANY2=function(a){this.manyInternal(2,a)},A.prototype.MANY3=function(a){this.manyInternal(3,a)},A.prototype.MANY4=function(a){this.manyInternal(4,a)},A.prototype.MANY5=function(a){this.manyInternal(5,a)},A.prototype.MANY6=function(a){this.manyInternal(6,a)},A.prototype.MANY7=function(a){this.manyInternal(7,a)},A.prototype.MANY8=function(a){this.manyInternal(8,a)},A.prototype.MANY9=function(a){this.manyInternal(9,a)},A.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},A.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},A.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},A.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},A.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},A.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},A.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},A.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},A.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},A.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},A.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},A.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},A.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},A.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},A.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},A.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},A.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},A.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},A.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},A.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},A.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},A.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},A.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},A.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},A.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},A.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},A.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},A.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},A.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},A.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},A.prototype.RULE=function(a,d,u){if(u===void 0&&(u=n.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var m=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),p={message:m,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(p)}this.definedRulesNames.push(a);var I=this.defineRule(a,d,u);return this[a]=I,I},A.prototype.OVERRIDE_RULE=function(a,d,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var m=[];m=m.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(m);var p=this.defineRule(a,d,u);return this[a]=p,p},A.prototype.BACKTRACK=function(a,d){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,d),!0}catch(m){if(t.isRecognitionException(m))return!1;throw m}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}},A.prototype.getGAstProductions=function(){return this.gastProductionsCache},A.prototype.getSerializedGastProductions=function(){return s.serializeGrammar(e.values(this.gastProductionsCache))},A})();i.RecognizerApi=c}),oo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=Ne(),t=Cn(),n=xt(),r=jt(),o=Ut(),s=tt(),c=hi(),A=pt(),a=kt(),d=di(),u=(function(){function m(){}return m.prototype.initRecognizerEngine=function(p,I){if(this.className=d.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=a.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(I,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
90
90
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
91
91
  For Further details.`);if(e.isArray(p)){if(e.isEmpty(p))throw Error(`A Token Vocabulary cannot be empty.
92
92
  Note that the first argument for the parser constructor
93
93
  is no longer a Token vector (since v4.0).`);if(typeof p[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
94
94
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
95
95
  For Further details.`)}if(e.isArray(p))this.tokensMap=e.reduce(p,function(f,C){return f[C.name]=C,f},{});else if(e.has(p,"modes")&&e.every(e.flatten(e.values(p.modes)),a.isTokenType)){var g=e.flatten(e.values(p.modes)),l=e.uniq(g);this.tokensMap=e.reduce(l,function(f,C){return f[C.name]=C,f},{})}else if(e.isObject(p))this.tokensMap=e.cloneObj(p);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=A.EOF;var h=e.every(e.values(p),function(f){return e.isEmpty(f.categoryMatches)});this.tokenMatcher=h?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},m.prototype.defineRule=function(p,I,g){if(this.selfAnalysisDone)throw Error("Grammar rule <"+p+`> may not be defined after the 'performSelfAnalysis' method has been called'
96
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(g,"resyncEnabled")?g.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,h=e.has(g,"recoveryValueFunc")?g.recoveryValueFunc:s.DEFAULT_RULE_CONFIG.recoveryValueFunc,f=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[f]=p,this.fullRuleNameToShort[p]=f;function C(R){try{if(this.outputCst===!0){I.apply(this,R);var x=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(x),x}else return I.apply(this,R)}catch(z){return this.invokeRuleCatch(z,l,h)}finally{this.ruleFinallyStateUpdate()}}var b=function(R,x){return R===void 0&&(R=0),this.ruleInvocationStateUpdate(f,p,R),C.call(this,x)},y="ruleName";return b[y]=p,b.originalGrammarAction=I,b},m.prototype.invokeRuleCatch=function(p,I,g){var l=this.RULE_STACK.length===1,h=I&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(p)){var f=p;if(h){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(f.resyncedTokens=this.reSyncTo(C),this.outputCst){var b=this.CST_STACK[this.CST_STACK.length-1];return b.recoveredNode=!0,b}else return g();else{if(this.outputCst){var b=this.CST_STACK[this.CST_STACK.length-1];b.recoveredNode=!0,f.partialCstResult=b}throw f}}else{if(l)return this.moveToTerminatedState(),g();throw f}}else throw p},m.prototype.optionInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,I);return this.optionInternalLogic(p,I,g)},m.prototype.optionInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(p.DEF!==void 0){if(f=p.DEF,C=p.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=p;if(h.call(this)===!0)return f.call(this)},m.prototype.atLeastOneInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,p);return this.atLeastOneInternalLogic(p,I,g)},m.prototype.atLeastOneInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(I.DEF!==void 0){if(f=I.DEF,C=I.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=I;if(h.call(this)===!0)for(var y=this.doSingleRepetition(f);h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY,I.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[p,I],h,t.AT_LEAST_ONE_IDX,p,o.NextTerminalAfterAtLeastOneWalker)},m.prototype.atLeastOneSepFirstInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,p);this.atLeastOneSepFirstInternalLogic(p,I,g)},m.prototype.atLeastOneSepFirstInternalLogic=function(p,I,g){var l=this,h=I.DEF,f=I.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var b=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,b,h,o.NextTerminalAfterAtLeastOneSepWalker],b,t.AT_LEAST_ONE_SEP_IDX,p,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,I.ERR_MSG)},m.prototype.manyInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,p);return this.manyInternalLogic(p,I,g)},m.prototype.manyInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(I.DEF!==void 0){if(f=I.DEF,C=I.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=I;for(var y=!0;h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);this.attemptInRepetitionRecovery(this.manyInternal,[p,I],h,t.MANY_IDX,p,o.NextTerminalAfterManyWalker,y)},m.prototype.manySepFirstInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,p);this.manySepFirstInternalLogic(p,I,g)},m.prototype.manySepFirstInternalLogic=function(p,I,g){var l=this,h=I.DEF,f=I.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var b=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,b,h,o.NextTerminalAfterManySepWalker],b,t.MANY_SEP_IDX,p,o.NextTerminalAfterManySepWalker)}},m.prototype.repetitionSepSecondInternal=function(p,I,g,l,h){for(;g();)this.CONSUME(I),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,I,g,l,h],g,t.AT_LEAST_ONE_SEP_IDX,p,h)},m.prototype.doSingleRepetition=function(p){var I=this.getLexerPosition();p.call(this);var g=this.getLexerPosition();return g>I},m.prototype.orInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,I),l=e.isArray(p)?p:p.DEF,h=this.getLaFuncFromCache(g),f=h.call(this,l);if(f!==void 0){var C=l[f];return C.ALT.call(this)}this.raiseNoAltException(I,p.ERR_MSG)},m.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var p=this.LA(1),I=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:p,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(I,p))}},m.prototype.subruleInternal=function(p,I,g){var l;try{var h=g!==void 0?g.ARGS:void 0;return l=p.call(this,I,h),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:p.ruleName),l}catch(f){this.subruleInternalError(f,g,p.ruleName)}},m.prototype.subruleInternalError=function(p,I,g){throw n.isRecognitionException(p)&&p.partialCstResult!==void 0&&(this.cstPostNonTerminal(p.partialCstResult,I!==void 0&&I.LABEL!==void 0?I.LABEL:g),delete p.partialCstResult),p},m.prototype.consumeInternal=function(p,I,g){var l;try{var h=this.LA(1);this.tokenMatcher(h,p)===!0?(this.consumeToken(),l=h):this.consumeInternalError(p,h,g)}catch(f){l=this.consumeInternalRecovery(p,I,f)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:p.name,l),l},m.prototype.consumeInternalError=function(p,I,g){var l,h=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:I,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,I,h))},m.prototype.consumeInternalRecovery=function(p,I,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(p,I);try{return this.tryInRuleRecovery(p,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?g:h}}else throw g},m.prototype.saveRecogState=function(){var p=this.errors,I=e.cloneArr(this.RULE_STACK);return{errors:p,lexerState:this.exportLexerState(),RULE_STACK:I,CST_STACK:this.CST_STACK}},m.prototype.reloadRecogState=function(p){this.errors=p.errors,this.importLexerState(p.lexerState),this.RULE_STACK=p.RULE_STACK},m.prototype.ruleInvocationStateUpdate=function(p,I,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(p),this.cstInvocationStateUpdate(I,p)},m.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},m.prototype.getCurrRuleFullName=function(){var p=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[p]},m.prototype.shortRuleNameToFullName=function(p){return this.shortRuleNameToFull[p]},m.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},m.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},m})();i.RecognizerEngine=u}),Ao=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=xt(),t=Ne(),n=Vt(),r=et(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},s.prototype.SAVE_ERROR=function(c){if(e.isRecognitionException(c))return c.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(c),c;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(s.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),s.prototype.raiseEarlyExitException=function(c,A,a){for(var d=this.getCurrRuleFullName(),u=this.getGAstProductions()[d],m=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),p=m[0],I=[],g=1;g<=this.maxLookahead;g++)I.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:p,actual:I,previous:this.LA(0),customUserDescription:a,ruleName:d});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},s.prototype.raiseNoAltException=function(c,A){for(var a=this.getCurrRuleFullName(),d=this.getGAstProductions()[a],u=n.getLookaheadPathsForOr(c,d,this.maxLookahead),m=[],p=1;p<=this.maxLookahead;p++)m.push(this.LA(p));var I=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:m,previous:I,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),I))},s})();i.ErrorHandler=o}),co=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=zt(),t=Ne(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(o,s){var c=this.gastProductionsCache[o];if(t.isUndefined(c))throw Error("Rule ->"+o+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],s,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(o){var s=t.first(o.ruleStack),c=this.getGAstProductions(),A=c[s],a=new e.NextAfterTokenWalker(A,o).startWalking();return a},r})();i.ContentAssist=n}),lo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=Ne(),t=Je(),n=jt(),r=kt(),o=ft(),s=et(),c=wn(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,d=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=o.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var m=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
96
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(g,"resyncEnabled")?g.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,h=e.has(g,"recoveryValueFunc")?g.recoveryValueFunc:s.DEFAULT_RULE_CONFIG.recoveryValueFunc,f=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[f]=p,this.fullRuleNameToShort[p]=f;function C(R){try{if(this.outputCst===!0){I.apply(this,R);var x=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(x),x}else return I.apply(this,R)}catch(q){return this.invokeRuleCatch(q,l,h)}finally{this.ruleFinallyStateUpdate()}}var b=function(R,x){return R===void 0&&(R=0),this.ruleInvocationStateUpdate(f,p,R),C.call(this,x)},y="ruleName";return b[y]=p,b.originalGrammarAction=I,b},m.prototype.invokeRuleCatch=function(p,I,g){var l=this.RULE_STACK.length===1,h=I&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(p)){var f=p;if(h){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(f.resyncedTokens=this.reSyncTo(C),this.outputCst){var b=this.CST_STACK[this.CST_STACK.length-1];return b.recoveredNode=!0,b}else return g();else{if(this.outputCst){var b=this.CST_STACK[this.CST_STACK.length-1];b.recoveredNode=!0,f.partialCstResult=b}throw f}}else{if(l)return this.moveToTerminatedState(),g();throw f}}else throw p},m.prototype.optionInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,I);return this.optionInternalLogic(p,I,g)},m.prototype.optionInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(p.DEF!==void 0){if(f=p.DEF,C=p.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=p;if(h.call(this)===!0)return f.call(this)},m.prototype.atLeastOneInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,p);return this.atLeastOneInternalLogic(p,I,g)},m.prototype.atLeastOneInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(I.DEF!==void 0){if(f=I.DEF,C=I.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=I;if(h.call(this)===!0)for(var y=this.doSingleRepetition(f);h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY,I.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[p,I],h,t.AT_LEAST_ONE_IDX,p,o.NextTerminalAfterAtLeastOneWalker)},m.prototype.atLeastOneSepFirstInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,p);this.atLeastOneSepFirstInternalLogic(p,I,g)},m.prototype.atLeastOneSepFirstInternalLogic=function(p,I,g){var l=this,h=I.DEF,f=I.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var b=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,b,h,o.NextTerminalAfterAtLeastOneSepWalker],b,t.AT_LEAST_ONE_SEP_IDX,p,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,I.ERR_MSG)},m.prototype.manyInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,p);return this.manyInternalLogic(p,I,g)},m.prototype.manyInternalLogic=function(p,I,g){var l=this,h=this.getLaFuncFromCache(g),f,C;if(I.DEF!==void 0){if(f=I.DEF,C=I.GATE,C!==void 0){var b=h;h=function(){return C.call(l)&&b.call(l)}}}else f=I;for(var y=!0;h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);this.attemptInRepetitionRecovery(this.manyInternal,[p,I],h,t.MANY_IDX,p,o.NextTerminalAfterManyWalker,y)},m.prototype.manySepFirstInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,p);this.manySepFirstInternalLogic(p,I,g)},m.prototype.manySepFirstInternalLogic=function(p,I,g){var l=this,h=I.DEF,f=I.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var b=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,b,h,o.NextTerminalAfterManySepWalker],b,t.MANY_SEP_IDX,p,o.NextTerminalAfterManySepWalker)}},m.prototype.repetitionSepSecondInternal=function(p,I,g,l,h){for(;g();)this.CONSUME(I),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,I,g,l,h],g,t.AT_LEAST_ONE_SEP_IDX,p,h)},m.prototype.doSingleRepetition=function(p){var I=this.getLexerPosition();p.call(this);var g=this.getLexerPosition();return g>I},m.prototype.orInternal=function(p,I){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,I),l=e.isArray(p)?p:p.DEF,h=this.getLaFuncFromCache(g),f=h.call(this,l);if(f!==void 0){var C=l[f];return C.ALT.call(this)}this.raiseNoAltException(I,p.ERR_MSG)},m.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var p=this.LA(1),I=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:p,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(I,p))}},m.prototype.subruleInternal=function(p,I,g){var l;try{var h=g!==void 0?g.ARGS:void 0;return l=p.call(this,I,h),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:p.ruleName),l}catch(f){this.subruleInternalError(f,g,p.ruleName)}},m.prototype.subruleInternalError=function(p,I,g){throw n.isRecognitionException(p)&&p.partialCstResult!==void 0&&(this.cstPostNonTerminal(p.partialCstResult,I!==void 0&&I.LABEL!==void 0?I.LABEL:g),delete p.partialCstResult),p},m.prototype.consumeInternal=function(p,I,g){var l;try{var h=this.LA(1);this.tokenMatcher(h,p)===!0?(this.consumeToken(),l=h):this.consumeInternalError(p,h,g)}catch(f){l=this.consumeInternalRecovery(p,I,f)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:p.name,l),l},m.prototype.consumeInternalError=function(p,I,g){var l,h=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:I,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,I,h))},m.prototype.consumeInternalRecovery=function(p,I,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(p,I);try{return this.tryInRuleRecovery(p,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?g:h}}else throw g},m.prototype.saveRecogState=function(){var p=this.errors,I=e.cloneArr(this.RULE_STACK);return{errors:p,lexerState:this.exportLexerState(),RULE_STACK:I,CST_STACK:this.CST_STACK}},m.prototype.reloadRecogState=function(p){this.errors=p.errors,this.importLexerState(p.lexerState),this.RULE_STACK=p.RULE_STACK},m.prototype.ruleInvocationStateUpdate=function(p,I,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(p),this.cstInvocationStateUpdate(I,p)},m.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},m.prototype.getCurrRuleFullName=function(){var p=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[p]},m.prototype.shortRuleNameToFullName=function(p){return this.shortRuleNameToFull[p]},m.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},m.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},m})();i.RecognizerEngine=u}),so=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=xt(),t=Ne(),n=jt(),r=tt(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},s.prototype.SAVE_ERROR=function(c){if(e.isRecognitionException(c))return c.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(c),c;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(s.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),s.prototype.raiseEarlyExitException=function(c,A,a){for(var d=this.getCurrRuleFullName(),u=this.getGAstProductions()[d],m=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),p=m[0],I=[],g=1;g<=this.maxLookahead;g++)I.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:p,actual:I,previous:this.LA(0),customUserDescription:a,ruleName:d});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},s.prototype.raiseNoAltException=function(c,A){for(var a=this.getCurrRuleFullName(),d=this.getGAstProductions()[a],u=n.getLookaheadPathsForOr(c,d,this.maxLookahead),m=[],p=1;p<=this.maxLookahead;p++)m.push(this.LA(p));var I=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:m,previous:I,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),I))},s})();i.ErrorHandler=o}),ao=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=Ut(),t=Ne(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(o,s){var c=this.gastProductionsCache[o];if(t.isUndefined(c))throw Error("Rule ->"+o+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],s,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(o){var s=t.first(o.ruleStack),c=this.getGAstProductions(),A=c[s],a=new e.NextAfterTokenWalker(A,o).startWalking();return a},r})();i.ContentAssist=n}),Ao=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=Ne(),t=Ze(),n=Mt(),r=kt(),o=pt(),s=tt(),c=Cn(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,d=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=o.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var m=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
97
97
  See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(m);var p={name:`This CSTNode indicates the Parser is in Recording Phase
98
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},I=(function(){function C(){}return C.prototype.initGastRecorder=function(b){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var b=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(x){var z=x>0?x:"";b["CONSUME"+z]=function(k,P){return this.consumeInternalRecord(k,x,P)},b["SUBRULE"+z]=function(k,P){return this.subruleInternalRecord(k,x,P)},b["OPTION"+z]=function(k){return this.optionInternalRecord(k,x)},b["OR"+z]=function(k){return this.orInternalRecord(k,x)},b["MANY"+z]=function(k){this.manyInternalRecord(x,k)},b["MANY_SEP"+z]=function(k){this.manySepFirstInternalRecord(x,k)},b["AT_LEAST_ONE"+z]=function(k){this.atLeastOneInternalRecord(x,k)},b["AT_LEAST_ONE_SEP"+z]=function(k){this.atLeastOneSepFirstInternalRecord(x,k)}},R=0;R<10;R++)y(R);b.consume=function(x,z,k){return this.consumeInternalRecord(z,x,k)},b.subrule=function(x,z,k){return this.subruleInternalRecord(z,x,k)},b.option=function(x,z){return this.optionInternalRecord(z,x)},b.or=function(x,z){return this.orInternalRecord(z,x)},b.many=function(x,z){this.manyInternalRecord(x,z)},b.atLeastOne=function(x,z){this.atLeastOneInternalRecord(x,z)},b.ACTION=b.ACTION_RECORD,b.BACKTRACK=b.BACKTRACK_RECORD,b.LA=b.LA_RECORD})},C.prototype.disableRecording=function(){var b=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var R=y>0?y:"";delete b["CONSUME"+R],delete b["SUBRULE"+R],delete b["OPTION"+R],delete b["OR"+R],delete b["MANY"+R],delete b["MANY_SEP"+R],delete b["AT_LEAST_ONE"+R],delete b["AT_LEAST_ONE_SEP"+R]}delete b.consume,delete b.subrule,delete b.option,delete b.or,delete b.many,delete b.atLeastOne,delete b.ACTION,delete b.BACKTRACK,delete b.LA})},C.prototype.ACTION_RECORD=function(b){},C.prototype.BACKTRACK_RECORD=function(b,y){return function(){return!0}},C.prototype.LA_RECORD=function(b){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(b,y){try{var R=new t.Rule({definition:[],name:b});return R.name=b,this.recordingProdStack.push(R),y.call(this),this.recordingProdStack.pop(),R}catch(x){if(x.KNOWN_RECORDER_ERROR!==!0)try{x.message=x.message+`
98
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},I=(function(){function C(){}return C.prototype.initGastRecorder=function(b){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var b=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(x){var q=x>0?x:"";b["CONSUME"+q]=function(v,G){return this.consumeInternalRecord(v,x,G)},b["SUBRULE"+q]=function(v,G){return this.subruleInternalRecord(v,x,G)},b["OPTION"+q]=function(v){return this.optionInternalRecord(v,x)},b["OR"+q]=function(v){return this.orInternalRecord(v,x)},b["MANY"+q]=function(v){this.manyInternalRecord(x,v)},b["MANY_SEP"+q]=function(v){this.manySepFirstInternalRecord(x,v)},b["AT_LEAST_ONE"+q]=function(v){this.atLeastOneInternalRecord(x,v)},b["AT_LEAST_ONE_SEP"+q]=function(v){this.atLeastOneSepFirstInternalRecord(x,v)}},R=0;R<10;R++)y(R);b.consume=function(x,q,v){return this.consumeInternalRecord(q,x,v)},b.subrule=function(x,q,v){return this.subruleInternalRecord(q,x,v)},b.option=function(x,q){return this.optionInternalRecord(q,x)},b.or=function(x,q){return this.orInternalRecord(q,x)},b.many=function(x,q){this.manyInternalRecord(x,q)},b.atLeastOne=function(x,q){this.atLeastOneInternalRecord(x,q)},b.ACTION=b.ACTION_RECORD,b.BACKTRACK=b.BACKTRACK_RECORD,b.LA=b.LA_RECORD})},C.prototype.disableRecording=function(){var b=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var R=y>0?y:"";delete b["CONSUME"+R],delete b["SUBRULE"+R],delete b["OPTION"+R],delete b["OR"+R],delete b["MANY"+R],delete b["MANY_SEP"+R],delete b["AT_LEAST_ONE"+R],delete b["AT_LEAST_ONE_SEP"+R]}delete b.consume,delete b.subrule,delete b.option,delete b.or,delete b.many,delete b.atLeastOne,delete b.ACTION,delete b.BACKTRACK,delete b.LA})},C.prototype.ACTION_RECORD=function(b){},C.prototype.BACKTRACK_RECORD=function(b,y){return function(){return!0}},C.prototype.LA_RECORD=function(b){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(b,y){try{var R=new t.Rule({definition:[],name:b});return R.name=b,this.recordingProdStack.push(R),y.call(this),this.recordingProdStack.pop(),R}catch(x){if(x.KNOWN_RECORDER_ERROR!==!0)try{x.message=x.message+`
99
99
  This error was thrown during the "grammar recording phase" For more info see:
100
100
  https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw x}throw x}},C.prototype.optionInternalRecord=function(b,y){return g.call(this,t.Option,b,y)},C.prototype.atLeastOneInternalRecord=function(b,y){g.call(this,t.RepetitionMandatory,y,b)},C.prototype.atLeastOneSepFirstInternalRecord=function(b,y){g.call(this,t.RepetitionMandatoryWithSeparator,y,b,a)},C.prototype.manyInternalRecord=function(b,y){g.call(this,t.Repetition,y,b)},C.prototype.manySepFirstInternalRecord=function(b,y){g.call(this,t.RepetitionWithSeparator,y,b,a)},C.prototype.orInternalRecord=function(b,y){return l.call(this,b,y)},C.prototype.subruleInternalRecord=function(b,y,R){if(f(y),!b||e.has(b,"ruleName")===!1){var x=new Error("<SUBRULE"+h(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(b)+">")+(`
101
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var z=e.peek(this.recordingProdStack),k=b.ruleName,P=new t.NonTerminal({idx:y,nonTerminalName:k,referencedRule:void 0});return z.definition.push(P),this.outputCst?p:A},C.prototype.consumeInternalRecord=function(b,y,R){if(f(y),!r.hasShortKeyProperty(b)){var x=new Error("<CONSUME"+h(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(b)+">")+(`
102
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var z=e.peek(this.recordingProdStack),k=new t.Terminal({idx:y,terminalType:b});return z.definition.push(k),m},C})();i.GastRecorder=I;function g(C,b,y,R){R===void 0&&(R=!1),f(y);var x=e.peek(this.recordingProdStack),z=e.isFunction(b)?b:b.DEF,k=new C({definition:[],idx:y});return R&&(k.separator=b.SEP),e.has(b,"MAX_LOOKAHEAD")&&(k.maxLookahead=b.MAX_LOOKAHEAD),this.recordingProdStack.push(k),z.call(this),x.definition.push(k),this.recordingProdStack.pop(),A}function l(C,b){var y=this;f(b);var R=e.peek(this.recordingProdStack),x=e.isArray(C)===!1,z=x===!1?C:C.DEF,k=new t.Alternation({definition:[],idx:b,ignoreAmbiguities:x&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(k.maxLookahead=C.MAX_LOOKAHEAD);var P=e.some(z,function(N){return e.isFunction(N.GATE)});return k.hasPredicates=P,R.definition.push(k),e.forEach(z,function(N){var S=new t.Alternative({definition:[]});k.definition.push(S),e.has(N,"IGNORE_AMBIGUITIES")?S.ignoreAmbiguities=N.IGNORE_AMBIGUITIES:e.has(N,"GATE")&&(S.ignoreAmbiguities=!0),y.recordingProdStack.push(S),N.ALT.call(y),y.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function f(C){if(C<0||C>d){var b=new Error("Invalid DSL Method idx value: <"+C+`>
103
- `+("Idx value must be a none negative value smaller than "+(d+1)));throw b.KNOWN_RECORDER_ERROR=!0,b}}}),uo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Ne(),t=et(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(o){if(e.has(o,"traceInitPerf")){var s=o.traceInitPerf,c=typeof s=="number";this.traceInitMaxIdent=c?s:1/0,this.traceInitPerf=c?s>0:s}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(o,s){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+o+">");var A=e.timer(s),a=A.time,d=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+o+"> time: "+a+"ms"),this.traceInitIndent--,d}else return s()},r})();i.PerformanceTracer=n}),ho=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var o=r.prototype;Object.getOwnPropertyNames(o).forEach(function(s){if(s!=="constructor"){var c=Object.getOwnPropertyDescriptor(o,s);c&&(c.get||c.set)?Object.defineProperty(t.prototype,s,c):t.prototype[s]=r.prototype[s]}})})}i.applyMixins=e}),et=Re(i=>{var e=i&&i.__extends||(function(){var R=function(x,z){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,P){k.__proto__=P}||function(k,P){for(var N in P)Object.prototype.hasOwnProperty.call(P,N)&&(k[N]=P[N])},R(x,z)};return function(x,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");R(x,z);function k(){this.constructor=x}x.prototype=z===null?Object.create(z):(k.prototype=z.prototype,new k)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EmbeddedActionsParser=i.CstParser=i.Parser=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.DEFAULT_RULE_CONFIG=i.DEFAULT_PARSER_CONFIG=i.END_OF_FILE=void 0;var t=Ne(),n=Zr(),r=ft(),o=qt(),s=eo(),c=gi(),A=to(),a=ro(),d=oo(),u=so(),m=ao(),p=Ao(),I=co(),g=lo(),l=uo(),h=ho();i.END_OF_FILE=r.createTokenInstance(r.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(i.END_OF_FILE),i.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(R){R[R.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",R[R.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",R[R.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",R[R.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",R[R.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",R[R.LEFT_RECURSION=5]="LEFT_RECURSION",R[R.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",R[R.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",R[R.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",R[R.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",R[R.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",R[R.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",R[R.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(i.ParserDefinitionErrorType||(i.ParserDefinitionErrorType={}));function f(R){return R===void 0&&(R=void 0),function(){return R}}i.EMPTY_ALT=f;var C=(function(){function R(x,z){this.definitionErrors=[],this.selfAnalysisDone=!1;var k=this;if(k.initErrorHandler(z),k.initLexerAdapter(),k.initLooksAhead(z),k.initRecognizerEngine(x,z),k.initRecoverable(z),k.initTreeBuilder(z),k.initContentAssist(),k.initGastRecorder(z),k.initPerformanceTracer(z),t.has(z,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
101
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var q=e.peek(this.recordingProdStack),v=b.ruleName,G=new t.NonTerminal({idx:y,nonTerminalName:v,referencedRule:void 0});return q.definition.push(G),this.outputCst?p:A},C.prototype.consumeInternalRecord=function(b,y,R){if(f(y),!r.hasShortKeyProperty(b)){var x=new Error("<CONSUME"+h(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(b)+">")+(`
102
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var q=e.peek(this.recordingProdStack),v=new t.Terminal({idx:y,terminalType:b});return q.definition.push(v),m},C})();i.GastRecorder=I;function g(C,b,y,R){R===void 0&&(R=!1),f(y);var x=e.peek(this.recordingProdStack),q=e.isFunction(b)?b:b.DEF,v=new C({definition:[],idx:y});return R&&(v.separator=b.SEP),e.has(b,"MAX_LOOKAHEAD")&&(v.maxLookahead=b.MAX_LOOKAHEAD),this.recordingProdStack.push(v),q.call(this),x.definition.push(v),this.recordingProdStack.pop(),A}function l(C,b){var y=this;f(b);var R=e.peek(this.recordingProdStack),x=e.isArray(C)===!1,q=x===!1?C:C.DEF,v=new t.Alternation({definition:[],idx:b,ignoreAmbiguities:x&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(v.maxLookahead=C.MAX_LOOKAHEAD);var G=e.some(q,function(D){return e.isFunction(D.GATE)});return v.hasPredicates=G,R.definition.push(v),e.forEach(q,function(D){var Q=new t.Alternative({definition:[]});v.definition.push(Q),e.has(D,"IGNORE_AMBIGUITIES")?Q.ignoreAmbiguities=D.IGNORE_AMBIGUITIES:e.has(D,"GATE")&&(Q.ignoreAmbiguities=!0),y.recordingProdStack.push(Q),D.ALT.call(y),y.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function f(C){if(C<0||C>d){var b=new Error("Invalid DSL Method idx value: <"+C+`>
103
+ `+("Idx value must be a none negative value smaller than "+(d+1)));throw b.KNOWN_RECORDER_ERROR=!0,b}}}),co=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Ne(),t=tt(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(o){if(e.has(o,"traceInitPerf")){var s=o.traceInitPerf,c=typeof s=="number";this.traceInitMaxIdent=c?s:1/0,this.traceInitPerf=c?s>0:s}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(o,s){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+o+">");var A=e.timer(s),a=A.time,d=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+o+"> time: "+a+"ms"),this.traceInitIndent--,d}else return s()},r})();i.PerformanceTracer=n}),lo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var o=r.prototype;Object.getOwnPropertyNames(o).forEach(function(s){if(s!=="constructor"){var c=Object.getOwnPropertyDescriptor(o,s);c&&(c.get||c.set)?Object.defineProperty(t.prototype,s,c):t.prototype[s]=r.prototype[s]}})})}i.applyMixins=e}),tt=Re(i=>{var e=i&&i.__extends||(function(){var R=function(x,q){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,G){v.__proto__=G}||function(v,G){for(var D in G)Object.prototype.hasOwnProperty.call(G,D)&&(v[D]=G[D])},R(x,q)};return function(x,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");R(x,q);function v(){this.constructor=x}x.prototype=q===null?Object.create(q):(v.prototype=q.prototype,new v)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EmbeddedActionsParser=i.CstParser=i.Parser=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.DEFAULT_RULE_CONFIG=i.DEFAULT_PARSER_CONFIG=i.END_OF_FILE=void 0;var t=Ne(),n=Jr(),r=pt(),o=Gt(),s=Zr(),c=hi(),A=$r(),a=no(),d=io(),u=ro(),m=oo(),p=so(),I=ao(),g=Ao(),l=co(),h=lo();i.END_OF_FILE=r.createTokenInstance(r.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(i.END_OF_FILE),i.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(R){R[R.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",R[R.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",R[R.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",R[R.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",R[R.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",R[R.LEFT_RECURSION=5]="LEFT_RECURSION",R[R.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",R[R.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",R[R.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",R[R.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",R[R.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",R[R.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",R[R.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(i.ParserDefinitionErrorType||(i.ParserDefinitionErrorType={}));function f(R){return R===void 0&&(R=void 0),function(){return R}}i.EMPTY_ALT=f;var C=(function(){function R(x,q){this.definitionErrors=[],this.selfAnalysisDone=!1;var v=this;if(v.initErrorHandler(q),v.initLexerAdapter(),v.initLooksAhead(q),v.initRecognizerEngine(x,q),v.initRecoverable(q),v.initTreeBuilder(q),v.initContentAssist(),v.initGastRecorder(q),v.initPerformanceTracer(q),t.has(q,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
104
104
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
105
105
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
106
- For further details.`);this.skipValidations=t.has(z,"skipValidations")?z.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return R.performSelfAnalysis=function(x){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},R.prototype.performSelfAnalysis=function(){var x=this;this.TRACE_INIT("performSelfAnalysis",function(){var z;x.selfAnalysisDone=!0;var k=x.className;x.TRACE_INIT("toFastProps",function(){t.toFastProperties(x)}),x.TRACE_INIT("Grammar Recording",function(){try{x.enableRecording(),t.forEach(x.definedRulesNames,function(N){var S=x[N],F=S.originalGrammarAction,_=void 0;x.TRACE_INIT(N+" Rule",function(){_=x.topLevelRuleRecord(N,F)}),x.gastProductionsCache[N]=_})}finally{x.disableRecording()}});var P=[];if(x.TRACE_INIT("Grammar Resolving",function(){P=s.resolveGrammar({rules:t.values(x.gastProductionsCache)}),x.definitionErrors=x.definitionErrors.concat(P)}),x.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(P)&&x.skipValidations===!1){var N=s.validateGrammar({rules:t.values(x.gastProductionsCache),maxLookahead:x.maxLookahead,tokenTypes:t.values(x.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:k});x.definitionErrors=x.definitionErrors.concat(N)}}),t.isEmpty(x.definitionErrors)&&(x.recoveryEnabled&&x.TRACE_INIT("computeAllProdsFollows",function(){var N=n.computeAllProdsFollows(t.values(x.gastProductionsCache));x.resyncFollows=N}),x.TRACE_INIT("ComputeLookaheadFunctions",function(){x.preComputeLookaheadFunctions(t.values(x.gastProductionsCache))})),!R.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(x.definitionErrors))throw z=t.map(x.definitionErrors,function(N){return N.message}),new Error(`Parser Definition Errors detected:
107
- `+z.join(`
106
+ For further details.`);this.skipValidations=t.has(q,"skipValidations")?q.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return R.performSelfAnalysis=function(x){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},R.prototype.performSelfAnalysis=function(){var x=this;this.TRACE_INIT("performSelfAnalysis",function(){var q;x.selfAnalysisDone=!0;var v=x.className;x.TRACE_INIT("toFastProps",function(){t.toFastProperties(x)}),x.TRACE_INIT("Grammar Recording",function(){try{x.enableRecording(),t.forEach(x.definedRulesNames,function(D){var Q=x[D],F=Q.originalGrammarAction,L=void 0;x.TRACE_INIT(D+" Rule",function(){L=x.topLevelRuleRecord(D,F)}),x.gastProductionsCache[D]=L})}finally{x.disableRecording()}});var G=[];if(x.TRACE_INIT("Grammar Resolving",function(){G=s.resolveGrammar({rules:t.values(x.gastProductionsCache)}),x.definitionErrors=x.definitionErrors.concat(G)}),x.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(G)&&x.skipValidations===!1){var D=s.validateGrammar({rules:t.values(x.gastProductionsCache),maxLookahead:x.maxLookahead,tokenTypes:t.values(x.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:v});x.definitionErrors=x.definitionErrors.concat(D)}}),t.isEmpty(x.definitionErrors)&&(x.recoveryEnabled&&x.TRACE_INIT("computeAllProdsFollows",function(){var D=n.computeAllProdsFollows(t.values(x.gastProductionsCache));x.resyncFollows=D}),x.TRACE_INIT("ComputeLookaheadFunctions",function(){x.preComputeLookaheadFunctions(t.values(x.gastProductionsCache))})),!R.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(x.definitionErrors))throw q=t.map(x.definitionErrors,function(D){return D.message}),new Error(`Parser Definition Errors detected:
107
+ `+q.join(`
108
108
  -------------------------------
109
- `))})},R.DEFER_DEFINITION_ERRORS_HANDLING=!1,R})();i.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,d.LexerAdapter,m.RecognizerEngine,u.RecognizerApi,p.ErrorHandler,I.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var b=(function(R){e(x,R);function x(z,k){k===void 0&&(k=i.DEFAULT_PARSER_CONFIG);var P=this,N=t.cloneObj(k);return N.outputCst=!0,P=R.call(this,z,N)||this,P}return x})(C);i.CstParser=b;var y=(function(R){e(x,R);function x(z,k){k===void 0&&(k=i.DEFAULT_PARSER_CONFIG);var P=this,N=t.cloneObj(k);return N.outputCst=!1,P=R.call(this,z,N)||this,P}return x})(C);i.EmbeddedActionsParser=y}),fo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=li();function t(n,r){var o=r===void 0?{}:r,s=o.resourceBase,c=s===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":s,A=o.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,d=`
109
+ `))})},R.DEFER_DEFINITION_ERRORS_HANDLING=!1,R})();i.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,d.LexerAdapter,m.RecognizerEngine,u.RecognizerApi,p.ErrorHandler,I.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var b=(function(R){e(x,R);function x(q,v){v===void 0&&(v=i.DEFAULT_PARSER_CONFIG);var G=this,D=t.cloneObj(v);return D.outputCst=!0,G=R.call(this,q,D)||this,G}return x})(C);i.CstParser=b;var y=(function(R){e(x,R);function x(q,v){v===void 0&&(v=i.DEFAULT_PARSER_CONFIG);var G=this,D=t.cloneObj(v);return D.outputCst=!1,G=R.call(this,q,D)||this,G}return x})(C);i.EmbeddedActionsParser=y}),uo=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=si();function t(n,r){var o=r===void 0?{}:r,s=o.resourceBase,c=s===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":s,A=o.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,d=`
110
110
  <!-- This is a generated file -->
111
111
  <!DOCTYPE html>
112
112
  <meta charset="utf-8">
@@ -134,12 +134,12 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
134
134
  var diagramsDiv = document.getElementById("diagrams");
135
135
  main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
136
136
  <\/script>
137
- `;return d+u+m+p+I+g}i.createSyntaxDiagramsCode=t}),po=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Parser=i.createSyntaxDiagramsCode=i.clearCache=i.GAstVisitor=i.serializeProduction=i.serializeGrammar=i.Terminal=i.Rule=i.RepetitionWithSeparator=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Repetition=i.Option=i.NonTerminal=i.Alternative=i.Alternation=i.defaultLexerErrorProvider=i.NoViableAltException=i.NotAllInputParsedException=i.MismatchedTokenException=i.isRecognitionException=i.EarlyExitException=i.defaultParserErrorProvider=i.tokenName=i.tokenMatcher=i.tokenLabel=i.EOF=i.createTokenInstance=i.createToken=i.LexerDefinitionErrorType=i.Lexer=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.EmbeddedActionsParser=i.CstParser=i.VERSION=void 0;var e=li();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=et();Object.defineProperty(i,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(i,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(i,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(i,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=jt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=ft();Object.defineProperty(i,"createToken",{enumerable:!0,get:function(){return r.createToken}}),Object.defineProperty(i,"createTokenInstance",{enumerable:!0,get:function(){return r.createTokenInstance}}),Object.defineProperty(i,"EOF",{enumerable:!0,get:function(){return r.EOF}}),Object.defineProperty(i,"tokenLabel",{enumerable:!0,get:function(){return r.tokenLabel}}),Object.defineProperty(i,"tokenMatcher",{enumerable:!0,get:function(){return r.tokenMatcher}}),Object.defineProperty(i,"tokenName",{enumerable:!0,get:function(){return r.tokenName}});var o=qt();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=xt();Object.defineProperty(i,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(i,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(i,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(i,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(i,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=hi();Object.defineProperty(i,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Je();Object.defineProperty(i,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(i,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(i,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(i,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(i,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(i,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(i,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(i,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(i,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(i,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Je();Object.defineProperty(i,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(i,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var d=St();Object.defineProperty(i,"GAstVisitor",{enumerable:!0,get:function(){return d.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
137
+ `;return d+u+m+p+I+g}i.createSyntaxDiagramsCode=t}),ho=Re(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Parser=i.createSyntaxDiagramsCode=i.clearCache=i.GAstVisitor=i.serializeProduction=i.serializeGrammar=i.Terminal=i.Rule=i.RepetitionWithSeparator=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Repetition=i.Option=i.NonTerminal=i.Alternative=i.Alternation=i.defaultLexerErrorProvider=i.NoViableAltException=i.NotAllInputParsedException=i.MismatchedTokenException=i.isRecognitionException=i.EarlyExitException=i.defaultParserErrorProvider=i.tokenName=i.tokenMatcher=i.tokenLabel=i.EOF=i.createTokenInstance=i.createToken=i.LexerDefinitionErrorType=i.Lexer=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.EmbeddedActionsParser=i.CstParser=i.VERSION=void 0;var e=si();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=tt();Object.defineProperty(i,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(i,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(i,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(i,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=Mt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=pt();Object.defineProperty(i,"createToken",{enumerable:!0,get:function(){return r.createToken}}),Object.defineProperty(i,"createTokenInstance",{enumerable:!0,get:function(){return r.createTokenInstance}}),Object.defineProperty(i,"EOF",{enumerable:!0,get:function(){return r.EOF}}),Object.defineProperty(i,"tokenLabel",{enumerable:!0,get:function(){return r.tokenLabel}}),Object.defineProperty(i,"tokenMatcher",{enumerable:!0,get:function(){return r.tokenMatcher}}),Object.defineProperty(i,"tokenName",{enumerable:!0,get:function(){return r.tokenName}});var o=Gt();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=xt();Object.defineProperty(i,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(i,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(i,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(i,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(i,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=Ai();Object.defineProperty(i,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Ze();Object.defineProperty(i,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(i,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(i,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(i,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(i,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(i,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(i,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(i,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(i,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(i,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Ze();Object.defineProperty(i,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(i,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var d=St();Object.defineProperty(i,"GAstVisitor",{enumerable:!0,get:function(){return d.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
138
138
  It performs no action other than printing this message.
139
- Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var m=fo();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return m.createSyntaxDiagramsCode}});var p=(function(){function I(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
140
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I})();i.Parser=p});const wt=po();let Nt,Ft;class go extends E.Loader{constructor(e){super(e)}load(e,t,n,r){Nt=void 0,Ft=void 0;const o=this,s=o.path===""?E.LoaderUtils.extractUrlBase(e):o.path,c=new E.FileLoader(o.manager);c.setPath(o.path),c.setRequestHeader(o.requestHeader),c.setWithCredentials(o.withCredentials),c.load(e,function(A){try{t(o.parse(A,s))}catch(a){r?r(a):console.error(a),o.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(v){const T=o(),w=new mo(T.tokens),Q=new Io(T.tokenVocabulary),B=s(Q.getBaseCstVisitorConstructor()),L=w.lex(v);Q.input=L.tokens;const O=Q.vrml();if(Q.errors.length>0)throw console.error(Q.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return B.visit(O)}function o(){const v=wt.createToken,T=v({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]*/}),w=v({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\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:T}),Q=["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"],B=v({name:"Version",pattern:/#VRML.*/,longer_alt:w}),L=v({name:"NodeName",pattern:new RegExp(Q.join("|")),longer_alt:w}),O=v({name:"DEF",pattern:/DEF/,longer_alt:w}),U=v({name:"USE",pattern:/USE/,longer_alt:w}),K=v({name:"ROUTE",pattern:/ROUTE/,longer_alt:w}),te=v({name:"TO",pattern:/TO/,longer_alt:w}),ae=v({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),me=v({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),xe=v({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Se=v({name:"TrueLiteral",pattern:/TRUE/}),be=v({name:"FalseLiteral",pattern:/FALSE/}),we=v({name:"NullLiteral",pattern:/NULL/}),pe=v({name:"LSquare",pattern:/\[/}),ve=v({name:"RSquare",pattern:/]/}),Ge=v({name:"LCurly",pattern:/{/}),Oe=v({name:"RCurly",pattern:/}/}),Le=v({name:"Comment",pattern:/#.*/,group:wt.Lexer.SKIPPED}),Ve=[v({name:"WhiteSpace",pattern:/[ ,\s]/,group:wt.Lexer.SKIPPED}),L,O,U,K,te,Se,be,we,B,w,T,ae,me,xe,pe,ve,Ge,Oe,Le],Ke={};for(let _e=0,ge=Ve.length;_e<ge;_e++){const Ee=Ve[_e];Ke[Ee.name]=Ee}return{tokens:Ve,tokenVocabulary:Ke}}function s(v){class T extends v{constructor(){super(),this.validateVisitor()}vrml(B){const L={version:this.visit(B.version),nodes:[],routes:[]};for(let O=0,U=B.node.length;O<U;O++){const K=B.node[O];L.nodes.push(this.visit(K))}if(B.route)for(let O=0,U=B.route.length;O<U;O++){const K=B.route[O];L.routes.push(this.visit(K))}return L}version(B){return B.Version[0].image}node(B){const L={name:B.NodeName[0].image,fields:[]};if(B.field)for(let O=0,U=B.field.length;O<U;O++){const K=B.field[O];L.fields.push(this.visit(K))}return B.def&&(L.DEF=this.visit(B.def[0])),L}field(B){const L={name:B.Identifier[0].image,type:null,values:null};let O;return B.singleFieldValue&&(O=this.visit(B.singleFieldValue[0])),B.multiFieldValue&&(O=this.visit(B.multiFieldValue[0])),L.type=O.type,L.values=O.values,L}def(B){return(B.Identifier||B.NodeName)[0].image}use(B){return{USE:(B.Identifier||B.NodeName)[0].image}}singleFieldValue(B){return w(this,B)}multiFieldValue(B){return w(this,B)}route(B){return{FROM:B.RouteIdentifier[0].image,TO:B.RouteIdentifier[1].image}}}function w(Q,B){const L={type:null,values:[]};if(B.node){L.type="node";for(let O=0,U=B.node.length;O<U;O++){const K=B.node[O];L.values.push(Q.visit(K))}}if(B.use){L.type="use";for(let O=0,U=B.use.length;O<U;O++){const K=B.use[O];L.values.push(Q.visit(K))}}if(B.StringLiteral){L.type="string";for(let O=0,U=B.StringLiteral.length;O<U;O++){const K=B.StringLiteral[O];L.values.push(K.image.replace(/'|"/g,""))}}if(B.NumberLiteral){L.type="number";for(let O=0,U=B.NumberLiteral.length;O<U;O++){const K=B.NumberLiteral[O];L.values.push(parseFloat(K.image))}}if(B.HexLiteral){L.type="hex";for(let O=0,U=B.HexLiteral.length;O<U;O++){const K=B.HexLiteral[O];L.values.push(K.image)}}if(B.TrueLiteral){L.type="boolean";for(let O=0,U=B.TrueLiteral.length;O<U;O++)B.TrueLiteral[O].image==="TRUE"&&L.values.push(!0)}if(B.FalseLiteral){L.type="boolean";for(let O=0,U=B.FalseLiteral.length;O<U;O++)B.FalseLiteral[O].image==="FALSE"&&L.values.push(!1)}return B.NullLiteral&&(L.type="null",B.NullLiteral.forEach(function(){L.values.push(null)})),L}return new T}function c(v){const T=v.nodes,w=new E.Scene;for(let Q=0,B=T.length;Q<B;Q++){const L=T[Q];A(L)}for(let Q=0,B=T.length;Q<B;Q++){const L=T[Q],O=a(L);O instanceof E.Object3D&&w.add(O),L.name==="WorldInfo"&&(w.userData.worldInfo=O)}return w}function A(v){v.DEF&&(n[v.DEF]=v);const T=v.fields;for(let w=0,Q=T.length;w<Q;w++){const B=T[w];if(B.type==="node"){const L=B.values;for(let O=0,U=L.length;O<U;O++)A(L[O])}}}function a(v){return v.USE?ue(v.USE):(v.build!==void 0||(v.build=d(v)),v.build)}function d(v){const T=v.name;let w;switch(T){case"Anchor":case"Group":case"Transform":case"Collision":w=u(v);break;case"Background":w=m(v);break;case"Shape":w=p(v);break;case"Appearance":w=I(v);break;case"Material":w=g(v);break;case"ImageTexture":w=C(v);break;case"PixelTexture":w=f(v);break;case"TextureTransform":w=b(v);break;case"IndexedFaceSet":w=N(v);break;case"IndexedLineSet":w=S(v);break;case"PointSet":w=F(v);break;case"Box":w=_(v);break;case"Cone":w=W(v);break;case"Cylinder":w=$(v);break;case"Sphere":w=H(v);break;case"ElevationGrid":w=ee(v);break;case"Extrusion":w=ne(v);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":w=y(v);break;case"WorldInfo":w=R(v);break;case"DirectionalLight":w=x(v);break;case"PointLight":w=z(v);break;case"SpotLight":w=k(v);break;case"Fog":w=P(v);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"Script":case"Sound":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"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",T);break}return w!==void 0&&v.DEF!==void 0&&w.hasOwnProperty("name")===!0&&(w.name=v.DEF),w}function u(v){const T=new E.Group,w=v.fields;for(let Q=0,B=w.length;Q<B;Q++){const L=w[Q],O=L.name,U=L.values;switch(O){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":ie(U,T);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const K=new E.Vector3(U[0],U[1],U[2]).normalize(),te=U[3];T.quaternion.setFromAxisAngle(K,te);break;case"scale":T.scale.set(U[0],U[1],U[2]);break;case"scaleOrientation":break;case"translation":T.position.set(U[0],U[1],U[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return T}function m(v){const T=new E.Group;let w,Q,B,L,O,U,K,te,ae,me;const xe=v.fields;for(let Se=0,be=xe.length;Se<be;Se++){const we=xe[Se],pe=we.name,ve=we.values;switch(pe){case"groundAngle":w=ve;break;case"groundColor":Q=ve;break;case"backUrl":O=ve;break;case"bottomUrl":U=ve;break;case"frontUrl":K=ve;break;case"leftUrl":te=ve;break;case"rightUrl":ae=ve;break;case"topUrl":me=ve;break;case"skyAngle":B=ve;break;case"skyColor":L=ve;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}if(O&&U&&K&&te&&ae&&me)Nt=new E.CubeTextureLoader().load([ae[0],te[0],me[0],U[0],K[0],O[0]]);else{if(L){const Se=[];for(let be=0;be<L.length;be+=3)Se.push([L[be],L[be+1],L[be+2]]);L=Se}if(Q){const Se=[];for(let be=0;be<Q.length;be+=3)Se.push([Q[be],Q[be+1],Q[be+2]]);Q=Se}Nt=new Co({skyColor:L,skyAngle:B,groundColor:Q,groundAngle:w}).buildTexture()}return T}function p(v){const T=v.fields;let w=new E.MeshBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:0}),Q;for(let L=0,O=T.length;L<O;L++){const U=T[L],K=U.name,te=U.values;switch(K){case"appearance":te[0]!==null&&(w=a(te[0]));break;case"geometry":te[0]!==null&&(Q=a(te[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}let B;if(Q&&Q.attributes.position){const L=Q._type;if(L==="points"){const O=new E.PointsMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});Q.attributes.color!==void 0?O.vertexColors=!0:w.isMeshPhongMaterial&&O.color.copy(w.emissive),B=new E.Points(Q,O)}else if(L==="line"){const O=new E.LineBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});Q.attributes.color!==void 0?O.vertexColors=!0:w.isMeshPhongMaterial&&O.color.copy(w.emissive),B=new E.LineSegments(Q,O)}else Q._solid!==void 0&&(w.side=Q._solid?E.FrontSide:E.DoubleSide),Q.attributes.color!==void 0&&(w.vertexColors=!0),B=new E.Mesh(Q,w)}else B=new E.Object3D,B.visible=!1;return B}function I(v){let T=new E.MeshPhongMaterial,w;const Q=v.fields;for(let B=0,L=Q.length;B<L;B++){const O=Q[B],U=O.name,K=O.values;switch(U){case"material":if(K[0]!==null){const ae=a(K[0]);ae.diffuseColor&&T.color.copy(ae.diffuseColor),ae.emissiveColor&&T.emissive.copy(ae.emissiveColor),ae.shininess&&(T.shininess=ae.shininess),ae.specularColor&&T.specular.copy(ae.specularColor),ae.transparency&&(T.opacity=1-ae.transparency),ae.transparency>0&&(T.transparent=!0)}else T=new E.MeshBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const te=K[0];te!==null&&(te.name==="ImageTexture"||te.name==="PixelTexture"||te.USE)&&(T.map=a(te));break;case"textureTransform":K[0]!==null&&(w=a(K[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",U);break}}if(T.map){if(T.map.__type){switch(T.map.__type){case tt.INTENSITY_ALPHA:T.opacity=1;break;case tt.RGB:T.color.set(16777215);break;case tt.RGBA:T.color.set(16777215),T.opacity=1;break}delete T.map.__type}w&&(T.map.center.copy(w.center),T.map.rotation=w.rotation,T.map.repeat.copy(w.scale),T.map.offset.copy(w.translation))}return T.map&&T.map.fookHolder&&T.map.fookHolder.fooks.push(async B=>{const L=await yo(B.source.data);T.transparent=L,T.needsUpdate=L}),T}function g(v){const T={},w=v.fields;for(let Q=0,B=w.length;Q<B;Q++){const L=w[Q],O=L.name,U=L.values;switch(O){case"ambientIntensity":break;case"diffuseColor":T.diffuseColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"emissiveColor":T.emissiveColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"shininess":T.shininess=U[0];break;case"specularColor":T.specularColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"transparency":T.transparency=U[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return T}function l(v,T,w){let Q;switch(T){case tt.INTENSITY:Q=parseInt(v),w.r=Q,w.g=Q,w.b=Q,w.a=1;break;case tt.INTENSITY_ALPHA:Q=parseInt("0x"+v.substring(2,4)),w.r=Q,w.g=Q,w.b=Q,w.a=parseInt("0x"+v.substring(4,6));break;case tt.RGB:w.r=parseInt("0x"+v.substring(2,4)),w.g=parseInt("0x"+v.substring(4,6)),w.b=parseInt("0x"+v.substring(6,8)),w.a=1;break;case tt.RGBA:w.r=parseInt("0x"+v.substring(2,4)),w.g=parseInt("0x"+v.substring(4,6)),w.b=parseInt("0x"+v.substring(6,8)),w.a=parseInt("0x"+v.substring(8,10));break}}function h(v){let T;switch(v){case 1:T=tt.INTENSITY;break;case 2:T=tt.INTENSITY_ALPHA;break;case 3:T=tt.RGB;break;case 4:T=tt.RGBA;break}return T}function f(v){let T,w=E.RepeatWrapping,Q=E.RepeatWrapping;const B=v.fields;for(let L=0,O=B.length;L<O;L++){const U=B[L],K=U.name,te=U.values;switch(K){case"image":const ae=te[0],me=te[1],xe=te[2],Se=h(xe),be=new Uint8Array(4*ae*me),we={r:0,g:0,b:0,a:0};for(let pe=3,ve=0,Ge=te.length;pe<Ge;pe++,ve++){l(te[pe],Se,we);const Oe=ve*4;be[Oe+0]=we.r,be[Oe+1]=we.g,be[Oe+2]=we.b,be[Oe+3]=we.a}T=new E.DataTexture(be,ae,me),T.colorSpace=E.SRGBColorSpace,T.needsUpdate=!0,T.__type=Se;break;case"repeatS":te[0]===!1&&(w=E.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(Q=E.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return T&&(T.wrapS=w,T.wrapT=Q),T}function C(v){let T,w=E.RepeatWrapping,Q=E.RepeatWrapping;const B=v.fields;for(let L=0,O=B.length;L<O;L++){const U=B[L],K=U.name,te=U.values;switch(K){case"url":const ae=te[0],me={fooks:[]},xe=Se=>{me.fooks&&me.fooks.map(be=>be(Se))};ae&&(T=ke.load(ae,xe)),T&&(T.fookHolder=me);break;case"repeatS":te[0]===!1&&(w=E.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(Q=E.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return T&&(T.wrapS=w,T.wrapT=Q,T.colorSpace=E.SRGBColorSpace),T}function b(v){const T={center:new E.Vector2,rotation:0,scale:new E.Vector2(1,1),translation:new E.Vector2},w=v.fields;for(let Q=0,B=w.length;Q<B;Q++){const L=w[Q],O=L.name,U=L.values;switch(O){case"center":T.center.set(U[0],U[1]);break;case"rotation":T.rotation=U[0];break;case"scale":T.scale.set(U[0],U[1]);break;case"translation":T.translation.set(U[0],U[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return T}function y(v){return v.fields[0]?v.fields[0].values:{}}function R(v){const T={},w=v.fields;for(let Q=0,B=w.length;Q<B;Q++){const L=w[Q],O=L.name,U=L.values;switch(O){case"title":T.title=U[0];break;case"info":T.info=U;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return T}function x(v){let T=0;const w=new E.Color(1,1,1),Q=new E.Vector3(0,0,-1);let B=1,L=!0;const O=v.fields;for(let ae=0,me=O.length;ae<me;ae++){const xe=O[ae],Se=xe.name,be=xe.values;switch(Se){case"ambientIntensity":T=be[0];break;case"color":w.set(be[0],be[1],be[2]);break;case"direction":Q.set(be[0],be[1],be[2]);break;case"intensity":B=be[0];break;case"on":L=be[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Se);break}}B=L?B:0;const U=new E.Object3D,K=new E.DirectionalLight(w,B);Q.normalize(),Q.multiplyScalar(-10),K.position.copy(Q),U.add(K);const te=new E.AmbientLight(w,B*T);return U.add(te),U}function z(v){let T=0;const w=new E.Vector3(1,0,0),Q=new E.Color(1,1,1);let B=1;const L=new E.Vector3(0,0,0);let O=!0,U=100;const K=v.fields;for(let xe=0,Se=K.length;xe<Se;xe++){const be=K[xe],we=be.name,pe=be.values;switch(we){case"ambientIntensity":T=pe[0];break;case"attenuation":w.set(pe[0],pe[1],pe[2]);break;case"color":Q.set(pe[0],pe[1],pe[2]);break;case"intensity":B=pe[0];break;case"location":L.set(pe[0],pe[1],pe[2]);break;case"on":O=pe[0];break;case"radius":U=pe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",we);break}}B=O?B:0;const te=new E.Object3D,ae=new E.PointLight(Q,B,U);ae.position.copy(L),ae.decay=2,te.add(ae);const me=new E.AmbientLight(Q,B*T);return te.add(me),te}function k(v){let T=0;const w=new E.Vector3(1,0,0);let Q=1.570796;const B=new E.Color(1,1,1);let L=.785398;const O=new E.Vector3(0,0,-1);let U=1;const K=new E.Vector3(0,0,-1);let te=!0,ae=100;const me=v.fields;for(let pe=0,ve=me.length;pe<ve;pe++){const Ge=me[pe],Oe=Ge.name,Le=Ge.values;switch(Oe){case"ambientIntensity":T=Le[0];break;case"attenuation":w.set(Le[0],Le[1],Le[2]);break;case"beamWidth":Q=Le[0];break;case"color":B.set(Le[0],Le[1],Le[2]);break;case"cutOffAngle":L=Le[0];break;case"direction":O.set(Le[0],Le[1],Le[2]);break;case"intensity":U=Le[0];break;case"location":K.set(Le[0],Le[1],Le[2]);break;case"on":te=Le[0];break;case"radius":ae=Le[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Oe);break}}U=te?U:0;const xe=new E.Object3D;Q=Q>L?L:Q;const Se=1-Q/L,be=new E.SpotLight(B,U,ae,L,Se);O.normalize(),be.position.copy(O),be.decay=0,xe.add(be);const we=new E.AmbientLight(B,U*T);return xe.add(we),xe.position.copy(K),xe}function P(v){const T=new E.Color(1,1,1);let w="LINEAR",Q=0;const B=v.fields;for(let L=0,O=B.length;L<O;L++){const U=B[L],K=U.name,te=U.values;switch(K){case"color":T.set(te[0],te[1],te[2]);break;case"fogType":w=te[0];break;case"visibilityRange":Q=te[0];break;case"set_bind":break;case"isBound":break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",K);break}}if(w==="LINEAR")Ft=new E.Fog(T,0,Q);else if(w==="EXPONENTIAL"){let L=.02;Q!==0&&(L=2.146/Q),Ft=new E.FogExp2(T,L)}else console.warn("ThreeMFLoader.VRMLLoader2: Unknown fogType:",w);return new E.Object3D}function N(v){let T,w,Q,B,L=!0,O=!0,U=0,K,te,ae,me,xe=!0,Se=!0;const be=v.fields;for(let He=0,Ve=be.length;He<Ve;He++){const Ke=be[He],_e=Ke.name,ge=Ke.values;switch(_e){case"color":const Ee=ge[0];Ee!==null&&(T=a(Ee));break;case"coord":const he=ge[0];he!==null&&(w=a(he));break;case"normal":const Ie=ge[0];Ie!==null&&(Q=a(Ie));break;case"texCoord":const Ce=ge[0];Ce!==null&&(B=a(Ce));break;case"ccw":L=ge[0];break;case"colorIndex":K=ge;break;case"colorPerVertex":xe=ge[0];break;case"convex":break;case"coordIndex":te=ge;break;case"creaseAngle":U=ge[0];break;case"normalIndex":ae=ge;break;case"normalPerVertex":Se=ge[0];break;case"solid":O=ge[0];break;case"texCoordIndex":me=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",_e);break}}if(te===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new E.BufferGeometry;const we=X(te,L);let pe,ve,Ge;if(T){if(xe===!0)if(K&&K.length>0){const He=X(K,L);pe=De(we,He,T,3)}else pe=Fe(we,new E.Float32BufferAttribute(T,3));else if(K&&K.length>0){const He=de(T,K),Ve=se(He,te);pe=ze(we,Ve)}else{const He=se(T,te);pe=ze(we,He)}fe(pe)}if(Q)if(Se===!0)if(ae&&ae.length>0){const He=X(ae,L);ve=De(we,He,Q,3)}else ve=Fe(we,new E.Float32BufferAttribute(Q,3));else if(ae&&ae.length>0){const He=de(Q,ae),Ve=se(He,te);ve=ze(we,Ve)}else{const He=se(Q,te);ve=ze(we,He)}else ve=V(we,w,U);if(B)if(me&&me.length>0){const He=X(me,L);Ge=De(we,He,B,2)}else Ge=Fe(we,new E.Float32BufferAttribute(B,2));const Oe=new E.BufferGeometry,Le=Fe(we,new E.Float32BufferAttribute(w,3));return Oe.setAttribute("position",Le),Oe.setAttribute("normal",ve),pe&&Oe.setAttribute("color",pe),Ge&&Oe.setAttribute("uv",Ge),Oe._solid=O,Oe._type="mesh",Oe}function S(v){let T,w,Q,B,L=!0;const O=v.fields;for(let me=0,xe=O.length;me<xe;me++){const Se=O[me],be=Se.name,we=Se.values;switch(be){case"color":const pe=we[0];pe!==null&&(T=a(pe));break;case"coord":const ve=we[0];ve!==null&&(w=a(ve));break;case"colorIndex":Q=we;break;case"colorPerVertex":L=we[0];break;case"coordIndex":B=we;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",be);break}}let U;const K=G(B);if(T){if(L===!0)if(Q.length>0){const me=G(Q);U=De(K,me,T,3)}else U=Fe(K,new E.Float32BufferAttribute(T,3));else if(Q.length>0){const me=de(T,Q),xe=q(me,B);U=Xe(K,xe)}else{const me=q(T,B);U=Xe(K,me)}fe(U)}const te=new E.BufferGeometry,ae=Fe(K,new E.Float32BufferAttribute(w,3));return te.setAttribute("position",ae),U&&te.setAttribute("color",U),te._type="line",te}function F(v){let T,w;const Q=v.fields;for(let L=0,O=Q.length;L<O;L++){const U=Q[L],K=U.name,te=U.values;switch(K){case"color":const ae=te[0];ae!==null&&(T=a(ae));break;case"coord":const me=te[0];me!==null&&(w=a(me));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}const B=new E.BufferGeometry;if(B.setAttribute("position",new E.Float32BufferAttribute(w,3)),T){const L=new E.Float32BufferAttribute(T,3);fe(L),B.setAttribute("color",L)}return B._type="points",B}function _(v){const T=new E.Vector3(2,2,2),w=v.fields;for(let B=0,L=w.length;B<L;B++){const O=w[B],U=O.name,K=O.values;U==="size"?(T.x=K[0],T.y=K[1],T.z=K[2]):console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new E.BoxGeometry(T.x,T.y,T.z)}function W(v){let T=1,w=2,Q=!1;const B=v.fields;for(let O=0,U=B.length;O<U;O++){const K=B[O],te=K.name,ae=K.values;switch(te){case"bottom":Q=!ae[0];break;case"bottomRadius":T=ae[0];break;case"height":w=ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",te);break}}return new E.ConeGeometry(T,w,16,1,Q)}function $(v){let T=1,w=2;const Q=v.fields;for(let L=0,O=Q.length;L<O;L++){const U=Q[L],K=U.name,te=U.values;switch(K){case"bottom":break;case"radius":T=te[0];break;case"height":w=te[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return new E.CylinderGeometry(T,T,w,16,1)}function H(v){let T=1;const w=v.fields;for(let B=0,L=w.length;B<L;B++){const O=w[B],U=O.name,K=O.values;U==="radius"?T=K[0]:console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new E.SphereGeometry(T,16,16)}function ee(v){let T,w,Q,B,L=!0,O=!0,U=!0,K=!0,te=0,ae=2,me=2,xe=1,Se=1;const be=v.fields;for(let ge=0,Ee=be.length;ge<Ee;ge++){const he=be[ge],Ie=he.name,Ce=he.values;switch(Ie){case"color":const Ue=Ce[0];Ue!==null&&(T=a(Ue));break;case"normal":const At=Ce[0];At!==null&&(w=a(At));break;case"texCoord":const ct=Ce[0];ct!==null&&(Q=a(ct));break;case"height":B=Ce;break;case"ccw":K=Ce[0];break;case"colorPerVertex":L=Ce[0];break;case"creaseAngle":te=Ce[0];break;case"normalPerVertex":O=Ce[0];break;case"solid":U=Ce[0];break;case"xDimension":ae=Ce[0];break;case"xSpacing":xe=Ce[0];break;case"zDimension":me=Ce[0];break;case"zSpacing":Se=Ce[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const we=[],pe=[],ve=[],Ge=[];for(let ge=0;ge<me;ge++)for(let Ee=0;Ee<ae;Ee++){const he=ge*ae+Ee,Ie=xe*ge,Ce=B[he],Ue=Se*Ee;if(we.push(Ie,Ce,Ue),T&&L===!0){const At=T[he*3+0],ct=T[he*3+1],Wt=T[he*3+2];ve.push(At,ct,Wt)}if(w&&O===!0){const At=w[he*3+0],ct=w[he*3+1],Wt=w[he*3+2];pe.push(At,ct,Wt)}if(Q){const At=Q[he*2+0],ct=Q[he*2+1];Ge.push(At,ct)}else Ge.push(ge/(ae-1),Ee/(me-1))}const Oe=[];for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*ae,Ie=ge+(Ee+1)*ae,Ce=ge+1+(Ee+1)*ae,Ue=ge+1+Ee*ae;K===!0?(Oe.push(he,Ce,Ie),Oe.push(Ce,he,Ue)):(Oe.push(he,Ie,Ce),Oe.push(Ce,Ue,he))}const Le=Fe(Oe,new E.Float32BufferAttribute(we,3)),He=Fe(Oe,new E.Float32BufferAttribute(Ge,2));let Ve,Ke;if(T){if(L===!1){for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(ae-1),Ie=T[he*3+0],Ce=T[he*3+1],Ue=T[he*3+2];ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue)}Ve=new E.Float32BufferAttribute(ve,3)}else Ve=Fe(Oe,new E.Float32BufferAttribute(ve,3));fe(Ve)}if(w)if(O===!1){for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(ae-1),Ie=w[he*3+0],Ce=w[he*3+1],Ue=w[he*3+2];pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue)}Ke=new E.Float32BufferAttribute(pe,3)}else Ke=Fe(Oe,new E.Float32BufferAttribute(pe,3));else Ke=V(Oe,we,te);const _e=new E.BufferGeometry;return _e.setAttribute("position",Le),_e.setAttribute("normal",Ke),_e.setAttribute("uv",He),Ve&&_e.setAttribute("color",Ve),_e._solid=U,_e._type="mesh",_e}function ne(v){let T=[1,1,1,-1,-1,-1,-1,1,1,1],w=[0,0,0,0,1,0],Q,B,L=!0,O=!0,U=0,K=!0,te=!0;const ae=v.fields;for(let _e=0,ge=ae.length;_e<ge;_e++){const Ee=ae[_e],he=Ee.name,Ie=Ee.values;switch(he){case"beginCap":L=Ie[0];break;case"ccw":O=Ie[0];break;case"convex":break;case"creaseAngle":U=Ie[0];break;case"crossSection":T=Ie;break;case"endCap":K=Ie[0];break;case"orientation":B=Ie;break;case"scale":Q=Ie;break;case"solid":te=Ie[0];break;case"spine":w=Ie;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",he);break}}const me=T[0]===T[T.length-2]&&T[1]===T[T.length-1],xe=[],Se=new E.Vector3,be=new E.Vector3,we=new E.Vector3,pe=new E.Vector3,ve=new E.Quaternion;for(let _e=0,ge=0,Ee=0,he=w.length;_e<he;_e+=3,ge+=2,Ee+=4){Se.fromArray(w,_e),be.x=Q?Q[ge+0]:1,be.y=1,be.z=Q?Q[ge+1]:1,we.x=B?B[Ee+0]:0,we.y=B?B[Ee+1]:0,we.z=B?B[Ee+2]:1;const Ie=B?B[Ee+3]:0;for(let Ce=0,Ue=T.length;Ce<Ue;Ce+=2)pe.x=T[Ce+0],pe.y=0,pe.z=T[Ce+1],pe.multiply(be),ve.setFromAxisAngle(we,Ie),pe.applyQuaternion(ve),pe.add(Se),xe.push(pe.x,pe.y,pe.z)}const Ge=[],Oe=w.length/3,Le=T.length/2;for(let _e=0;_e<Oe-1;_e++)for(let ge=0;ge<Le-1;ge++){const Ee=ge+_e*Le;let he=ge+1+_e*Le;const Ie=ge+(_e+1)*Le;let Ce=ge+1+(_e+1)*Le;ge===Le-2&&me===!0&&(he=_e*Le,Ce=(_e+1)*Le),O===!0?(Ge.push(Ee,he,Ie),Ge.push(Ie,he,Ce)):(Ge.push(Ee,Ie,he),Ge.push(Ie,Ce,he))}if(L===!0||K===!0){const _e=[];for(let he=0,Ie=T.length;he<Ie;he+=2)_e.push(new E.Vector2(T[he],T[he+1]));const ge=E.ShapeUtils.triangulateShape(_e,[]),Ee=[];for(let he=0,Ie=ge.length;he<Ie;he++){const Ce=ge[he];Ee.push(Ce[0],Ce[1],Ce[2])}if(L===!0)for(let he=0,Ie=Ee.length;he<Ie;he+=3)O===!0?Ge.push(Ee[he+0],Ee[he+1],Ee[he+2]):Ge.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(K===!0){const he=Le*(Oe-1);for(let Ie=0,Ce=Ee.length;Ie<Ce;Ie+=3)O===!0?Ge.push(he+Ee[Ie+0],he+Ee[Ie+2],he+Ee[Ie+1]):Ge.push(he+Ee[Ie+0],he+Ee[Ie+1],he+Ee[Ie+2])}}const He=Fe(Ge,new E.Float32BufferAttribute(xe,3)),Ve=V(Ge,xe,U),Ke=new E.BufferGeometry;return Ke.setAttribute("position",He),Ke.setAttribute("normal",Ve),Ke._solid=te,Ke._type="mesh",Ke}function ue(v){const T=n[v],w=a(T);return w.isObject3D||w.isMaterial?w.clone():w}function ie(v,T){for(let w=0,Q=v.length;w<Q;w++){const B=a(v[w]);B instanceof E.Object3D&&T.add(B)}}function X(v,T){const w=[];let Q=0;for(let B=0,L=v.length;B<L;B++){const O=v[Q],U=v[B+(T?1:2)],K=v[B+(T?2:1)];w.push(O,U,K),(v[B+3]===-1||B+3>=L)&&(B+=3,Q=B+1)}return w}function se(v,T){const w=[];let Q=0;for(let B=0,L=T.length;B<L;B++){const O=Q*3,U=v[O],K=v[O+1],te=v[O+2];w.push(U,K,te),(T[B+3]===-1||B+3>=L)&&(B+=3,Q++)}return w}function de(v,T){const w=[];for(let Q=0,B=T.length;Q<B;Q++){const O=T[Q]*3,U=v[O],K=v[O+1],te=v[O+2];w.push(U,K,te)}return w}function G(v){const T=[];for(let w=0,Q=v.length;w<Q;w++){const B=v[w],L=v[w+1];T.push(B,L),(v[w+2]===-1||w+2>=Q)&&(w+=2)}return T}function q(v,T){const w=[];let Q=0;for(let B=0,L=T.length;B<L;B++){const O=Q*3,U=v[O],K=v[O+1],te=v[O+2];w.push(U,K,te),(T[B+2]===-1||B+2>=L)&&(B+=2,Q++)}return w}const j=new E.Vector3,Z=new E.Vector3,J=new E.Vector3,le=new E.Vector2,ye=new E.Vector2,Te=new E.Vector2;function De(v,T,w,Q){const B=[];for(let L=0,O=v.length;L<O;L+=3){const U=T[L],K=T[L+1],te=T[L+2];Q===2?(le.fromArray(w,U*Q),ye.fromArray(w,K*Q),Te.fromArray(w,te*Q),B.push(le.x,le.y),B.push(ye.x,ye.y),B.push(Te.x,Te.y)):(j.fromArray(w,U*Q),Z.fromArray(w,K*Q),J.fromArray(w,te*Q),B.push(j.x,j.y,j.z),B.push(Z.x,Z.y,Z.z),B.push(J.x,J.y,J.z))}return new E.Float32BufferAttribute(B,Q)}function ze(v,T){const w=[];for(let Q=0,B=0,L=v.length;Q<L;Q+=3,B++)j.fromArray(T,B*3),w.push(j.x,j.y,j.z),w.push(j.x,j.y,j.z),w.push(j.x,j.y,j.z);return new E.Float32BufferAttribute(w,3)}function Xe(v,T){const w=[];for(let Q=0,B=0,L=v.length;Q<L;Q+=2,B++)j.fromArray(T,B*3),w.push(j.x,j.y,j.z),w.push(j.x,j.y,j.z);return new E.Float32BufferAttribute(w,3)}function Fe(v,T){const w=T.array,Q=T.itemSize,B=new w.constructor(v.length*Q);let L=0,O=0;for(let U=0,K=v.length;U<K;U++){L=v[U]*Q;for(let te=0;te<Q;te++)B[O++]=w[L++]}return new E.Float32BufferAttribute(B,Q)}const M=new E.Vector3,Y=new E.Vector3;function V(v,T,w){const Q=[],B={};for(let O=0,U=v.length;O<U;O+=3){const K=v[O],te=v[O+1],ae=v[O+2],me=new bo(K,te,ae);j.fromArray(T,K*3),Z.fromArray(T,te*3),J.fromArray(T,ae*3),Y.subVectors(J,Z),M.subVectors(j,Z),Y.cross(M),Y.normalize(),me.normal.copy(Y),B[K]===void 0&&(B[K]=[]),B[te]===void 0&&(B[te]=[]),B[ae]===void 0&&(B[ae]=[]),B[K].push(me.normal),B[te].push(me.normal),B[ae].push(me.normal),Q.push(me)}const L=[];for(let O=0,U=Q.length;O<U;O++){const K=Q[O],te=re(B[K.a],K.normal,w),ae=re(B[K.b],K.normal,w),me=re(B[K.c],K.normal,w);j.fromArray(T,K.a*3),Z.fromArray(T,K.b*3),J.fromArray(T,K.c*3),L.push(te.x,te.y,te.z),L.push(ae.x,ae.y,ae.z),L.push(me.x,me.y,me.z)}return new E.Float32BufferAttribute(L,3)}function re(v,T,w){const Q=new E.Vector3;if(w===0)Q.copy(T);else for(let B=0,L=v.length;B<L;B++)v[B].angleTo(T)<w&&Q.add(v[B]);return Q.normalize()}function fe(v){const T=new E.Color;for(let w=0;w<v.count;w++)T.fromBufferAttribute(v,w),E.ColorManagement.colorSpaceToWorking(T,E.SRGBColorSpace),v.setXYZ(w,T.r,T.g,T.b)}const ke=new E.TextureLoader(this.manager);if(ke.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const Be=r(e);return c(Be)}}class mo{constructor(e){this.lexer=new wt.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}}const Eo=wt.CstParser;class Io extends Eo{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,d=e.StringLiteral,u=e.HexLiteral,m=e.NumberLiteral,p=e.TrueLiteral,I=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,h=e.USE,f=e.ROUTE,C=e.TO,b=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(b),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(o)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(b)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(b)}}])}),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(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(m)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(I)}},{ALT:function(){t.CONSUME(g)}}])})}),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(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(m)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(f),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class bo{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new E.Vector3}}const tt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Co{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:r=[],size:o=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=r,this._size=o,this._texture=null}applyToScene(e){e.background=this._buildCubeTexture()}buildTexture(){return this._texture||(this._texture=this._buildCubeTexture()),this._texture}dispose(){this._texture&&(this._texture.dispose(),this._texture=null)}_colorAtPitch(e){const t=Math.PI/2;if(e<=t){if(this._skyAngle.length===0)return this._skyColor[0];if(e<=this._skyAngle[0])return this._lerpColor(this._skyColor[0],this._skyColor[1],e/this._skyAngle[0]);const n=this._skyAngle.length-1;if(e>=this._skyAngle[n])return this._skyColor[n+1]??this._skyColor[this._skyColor.length-1];for(let r=0;r<n;r++)if(e<=this._skyAngle[r+1]){const o=(e-this._skyAngle[r])/(this._skyAngle[r+1]-this._skyAngle[r]);return this._lerpColor(this._skyColor[r+1]??this._skyColor[this._skyColor.length-1],this._skyColor[r+2]??this._skyColor[this._skyColor.length-1],o)}return this._skyColor[this._skyColor.length-1]}else{if(this._groundColor.length===0)return this._skyColor[this._skyColor.length-1];const n=e-t;if(this._groundAngle.length===0)return this._groundColor[0];if(n<=this._groundAngle[0])return this._lerpColor(this._groundColor[0],this._groundColor[1],n/this._groundAngle[0]);const r=this._groundAngle.length-1;if(n>=this._groundAngle[r])return this._groundColor[r+1]??this._groundColor[this._groundColor.length-1];for(let o=0;o<r;o++)if(n<=this._groundAngle[o+1]){const s=(n-this._groundAngle[o])/(this._groundAngle[o+1]-this._groundAngle[o]);return this._lerpColor(this._groundColor[o+1]??this._groundColor[this._groundColor.length-1],this._groundColor[o+2]??this._groundColor[this._groundColor.length-1],s)}return this._groundColor[this._groundColor.length-1]}}_lerpColor(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}_buildSideCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const A=1-2*((s+.5)/e);for(let a=0;a<e;a++){const u=2*((a+.5)/e)-1,m=1,p=Math.sqrt(u*u+A*A+m*m),I=Math.acos(Math.max(-1,Math.min(1,A/p))),[g,l,h]=this._colorAtPitch(I),f=(s*e+a)*4;o[f]=Math.round(g*255),o[f+1]=Math.round(l*255),o[f+2]=Math.round(h*255),o[f+3]=255}}return n.putImageData(r,0,0),t}_buildTopCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,d=1,u=Math.sqrt(a*a+d*d+c*c),m=Math.acos(Math.max(-1,Math.min(1,d/u))),[p,I,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(I*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildBottomCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,d=-1,u=Math.sqrt(a*a+d*d+c*c),m=Math.acos(Math.max(-1,Math.min(1,d/u))),[p,I,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(I*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildCubeTexture(){const e=this._buildSideCanvas(),t=this._buildTopCanvas(),n=this._buildBottomCanvas(),r=[e,e,t,n,e,e],o=new E.CubeTexture(r);return o.needsUpdate=!0,o.minFilter=E.LinearMipmapLinearFilter,o.magFilter=E.LinearFilter,o}}async function yo(i){await new Promise((o,s)=>{if(i.complete)return o();i.onload=o,i.onerror=s});const e=document.createElement("canvas"),t=e.getContext("2d");e.width=i.naturalWidth,e.height=i.naturalHeight,t.drawImage(i,0,0);const r=t.getImageData(0,0,e.width,e.height).data;for(let o=3;o<r.length;o+=4)if(r[o]<255)return!0;return!1}class Bo extends E.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new E.FileLoader(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(c){try{t(o.parse(c))}catch(A){r?r(A):console.error(A),o.manager.itemError(e)}},n,r)}parse(e){function t(p){c(p)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const I=[],g=r(p,c(p),I);c(p)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(p).split(/[\s]+/);const h=parseInt(l[1]);isNaN(h)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(p).split(/[\s]+/);const f=parseFloat(l[2]);isNaN(f)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<h;C++)l=c(p).split(/[\s]+/),n(l,C*f,g);return I}function n(p,I,g){if(g.type==="ENDSITE")return;const l={time:I,position:new E.Vector3,rotation:new E.Quaternion,scale:new E.Vector3(1,1,1)};g.frames.push(l);const h=new E.Quaternion,f=new E.Vector3(1,0,0),C=new E.Vector3(0,1,0),b=new E.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(p.shift().trim());break;case"Yposition":l.position.y=parseFloat(p.shift().trim());break;case"Zposition":l.position.z=parseFloat(p.shift().trim());break;case"Xrotation":h.setFromAxisAngle(f,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Yrotation":h.setFromAxisAngle(C,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Zrotation":h.setFromAxisAngle(b,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Xscale":l.scale.x=parseFloat(p.shift().trim());break;case"Yscale":l.scale.y=parseFloat(p.shift().trim());break;case"Zscale":l.scale.z=parseFloat(p.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)n(p,I,g.children[y])}function r(p,I,g){const l={name:"",type:"",frames:[]};g.push(l);let h=I.split(/[\s]+/);h[0].toUpperCase()==="END"&&h[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=h[1],l.type=h[0].toUpperCase()),c(p)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),h=c(p).split(/[\s]+/),h[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+h[0]),h.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const f=new E.Vector3(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));if((isNaN(f.x)||isNaN(f.y)||isNaN(f.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=f,l.type!=="ENDSITE"){h=c(p).split(/[\s]+/),h[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(h[1]);l.channels=h.splice(2,C),l.children=[]}for(;;){const C=c(p);if(C==="}")return l;l.children.push(r(p,C,g))}}function o(p,I){const g=new E.Bone;if(I.push(g),g.position.add(p.offset),g.name=p.name,p.type!=="ENDSITE")for(let l=0;l<p.children.length;l++)g.add(o(p.children[l],I));return g}function s(p){const I=[];for(let g=0;g<p.length;g++){const l=p[g];if(l.type==="ENDSITE")continue;const h=[],f=[],C=[],b=[];for(let y=0;y<l.frames.length;y++){const R=l.frames[y];h.push(R.time),f.push(R.position.x+l.offset.x),f.push(R.position.y+l.offset.y),f.push(R.position.z+l.offset.z),C.push(R.rotation.x),C.push(R.rotation.y),C.push(R.rotation.z),C.push(R.rotation.w),b.push(R.scale.x),b.push(R.scale.y),b.push(R.scale.z)}A.animateBonePositions&&I.push(new E.VectorKeyframeTrack(l.name+".position",h,f)),A.animateBoneRotations&&I.push(new E.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&I.push(new E.VectorKeyframeTrack(l.name+".scale",h,b))}return new E.AnimationClip("animation",-1,I)}function c(p){let I;for(;(I=p.shift().trim()).length===0;);return I}const A=this,a=e.split(/[\r\n]+/g),d=t(a),u=[];o(d[0],u);const m=s(d);return{skeleton:new E.Skeleton(u),clip:m}}}let Mt,Pt,yt;async function To(i,e){yt||(yt=new go),yt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(ln(i,n)))),Mt=void 0,Pt=void 0;const t=await yt.loadAsync(e);return Mt=Nt,Pt=Ft,yt.manager.setURLModifier(n=>n),t}let Yt;async function wo(i,e){Yt||(Yt=new Bo);const t=Ot(i,e);return await Yt.parse(t)}function Ro(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof oe.Bone&&n.push(o)});const r=new oe.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class Rn{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let o;n.getInterpolation()===oe.InterpolateDiscrete?o=new oe.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new oe.QuaternionLinearInterpolant(n.times,n.values,r):o=new oe.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=o}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const o=n.substring(0,n.lastIndexOf(".")),s=n.substring(n.lastIndexOf(".")+1,n.length);let c=t[o];c||(c={},t[o]=c);const A=r.evaluate(this.time);if(s==="position")c.loc=new Ae(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Pe(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new Ae(A[0],A[1],A[2]);else if(s==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:o,vals:a})}else console.warn(`ClipMotion: update. unknown property(${s})`)}return t}}const vo={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Qo(){try{st.listener.context.state!=="running"&&await st.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class st extends Me{static listener=new oe.AudioListener;static audioLoader=new oe.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=Ut(vo,t),this.ready=this.asyncInit(e)}initObject(){return new oe.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new oe.PositionalAudio(st.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);const n=this.options.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}else{const t=new oe.Audio(st.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object3D.add(this.sound),new Promise(t=>{st.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class Fn{isDummy=!0;skeleton=new oe.Skeleton([new oe.Bone]);clip=new oe.AnimationClip("dummy")}const Jt={},gt={};class un extends Cn{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,r,o=!1,s=!0,c,A){super(e,t),this.loop=n,this.sound=r,this.soundLoop=o,this.soundContinue=s,this.backgroundTexture=c,this.fog=A}enable(e,t){super.enable(e,t),this.sound&&(this.sound.play(),this.loop&&!this.soundContinue&&this.motion.setFinishListener(()=>{this.sound?.play()}),this.loop&&!this.soundLoop&&this.motion.setFinishListener(()=>{this.sound?.play()})),t&&(this.backgroundTexture&&(t.scene.background=this.backgroundTexture,t.scene.environment=this.backgroundTexture),this.fog&&(t.scene.fog=this.fog))}disable(e,t){super.disable(e,t),this.sound&&(this.loop&&this.sound.stop(),this.soundContinue||this.sound.stop(),this.motion.setFinishListener=()=>{})}}class Ei extends It{haltActionNo=0;walkActionNo=0;runActionNo=0;minWalkSpeed=.1;minRunSpeed=1;isBillboard=!1;comment=null;tags=[];profiles=[];thumbnails=[];rdf=null;htmlfile="";constructor(e){super(e)}async asyncInit(e){const t=await oi(e),n=new DOMParser,r=Ot(t,"CATALOG.XML"),o=n.parseFromString(r,"application/xml");if(o.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const s="http://acerola3d.sourceforge.jp/a3/catalog",c=o.getElementsByTagNameNS(s,"a3");c[0]&&(this.haltActionNo=Number(c[0].getAttribute("haltActionN0")),this.walkActionNo=Number(c[0].getAttribute("walkActionN0")),this.runActionNo=Number(c[0].getAttribute("runActionN0")),this.minWalkSpeed=Number(c[0].getAttribute("minWalkSpeed")),this.minRunSpeed=Number(c[0].getAttribute("minRunSpeed")),this.isBillboard=!!c[0].getAttribute("billboard"));const A=o.getElementsByTagNameNS(s,"c");A[0]&&(this.comment=A[0].textContent);const a=o.getElementsByTagNameNS(s,"tag");Array.from(a).forEach(h=>{const f=h.getAttribute("name");f&&this.tags.push(f)});const d=o.getElementsByTagNameNS(s,"profile");Array.from(d).forEach(h=>{const f=h.getAttribute("uri");f&&this.profiles.push(f)});const u=o.getElementsByTagNameNS(s,"thumbnail");Array.from(u).forEach(h=>{const f=h.getAttribute("src");if(f){const C=ln(t,f);this.thumbnails.push(C)}});const m=o.getElementsByTagNameNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","RDF");m[0]&&(this.rdf=m[0]);const p=o.getElementsByTagNameNS(s,"htmlfile");if(p[0]){const h=p[0].getAttribute("src");h&&(this.htmlfile=Ot(t,h))}const I=o.getElementsByTagNameNS(s,"a"),g={};let l;for(const h of Array.from(I)){const f=h.getAttribute("an");if(f){l||(l=f);let C;const b=h.getAttribute("bvh");if(b&&b!=="none"){const X=t.zipUrl+"!"+b;Jt[X]||(Jt[X]=await wo(t,b)),C=Ro(Jt[X]),C&&C.clip.tracks.forEach(se=>{se.setInterpolation(oe.InterpolateDiscrete)})}else C=new Fn;const y={};C.skeleton.bones.forEach(X=>{y[X.name]=X});const R=h.getAttribute("scale"),x=R?Number(R):1,z=h.getAttribute("offset"),k=new Ae;if(z){const X=z.split(" ");k.set(Number(X[0]),Number(X[1]),Number(X[2]))}const P=h.getAttribute("rot"),N=new Ae;if(P){const X=P.split(" ");N.set(Number(X[0]),Number(X[1]),Number(X[2]))}const S=h.getAttribute("loop")==="true";let F,_;const W={},$=h.getElementsByTagNameNS(s,"p");for(const X of Array.from($)){const se=X.getAttribute("name"),de=X.getAttribute("wrl");if(se&&de){const G=t.zipUrl+"!"+de;gt[G]||(gt[G]=await To(t,de),Mt&&(F=Mt),Pt&&(_=Pt));const q=X.getAttribute("scale");if(q){const J=Number(q);gt[G].scale.set(J,J,J)}const j=X.getAttribute("rot");if(j){const J=j.split(" ");gt[G].rotation.set(Number(J[0])/180*Math.PI,Number(J[1])/180*Math.PI,Number(J[2])/180*Math.PI,"ZXY")}const Z=X.getAttribute("offset");if(Z){const J=Z.split(" ");gt[G].position.set(Number(J[0]),Number(J[1]),Number(J[2]))}W[se]=gt[G].clone(!0)}}const H=new oe.Object3D;H.add(C.skeleton.bones[0]),C instanceof Fn||Ii(H,W),Object.values(W).forEach(X=>{H.add(X)}),H.scale.set(x,x,x),N.scale(Math.PI/180),H.setRotationFromEuler(new oe.Euler(N.x,N.y,N.z,"ZXY")),H.position.add(k),H.traverse(X=>{X.userData.a3js={objectA3:this}});let ee,ne=!1,ue=!0;const ie=h.getElementsByTagNameNS(s,"s");if(ie[0]){const X=ie[0].getAttribute("file"),se=ie[0].getAttribute("type")||"PointSound",de=ie[0].getAttribute("loop")||"false";ne=de==="true";const G=ie[0].getAttribute("gain")||"1.0",q=ie[0].getAttribute("offset")||"0.0 0.0 0.0",j=ie[0].getAttribute("direction")||"0.0 0.0 1.0";ue=(ie[0].getAttribute("continue")||"true")==="true";const J=q.split(" ").map(M=>Number(M)),le=new Ae(J[0],J[1],J[2]),ye=j.split(" ").map(M=>Number(M)),Te=new Ae(ye[0],ye[1],ye[2]),De=se==="PointSound"||se==="ConeSound"?"positional":"audio",Fe=se==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(X){const M=ln(t,X),Y=URL.createObjectURL(M),V={type:De,autoplay:!1,loop:de==="true",volume:Number(G),positional:{directional:Fe}};ee=await new st(Y,V).ready,ee.setPosition(le),ee.lookAt(Te),URL.revokeObjectURL(Y),H.add(ee.object3D)}}g[f]=new un({root:H,bones:y,skeleton:C.skeleton},new Rn(C.clip,f),S,ee,ne,ue,F,_)}}return l&&this.syncInit(l,g),this}}function Ii(i,e){if(Mr(i)){const t=e[i.name];t&&(i.add(t),delete e[i.name])}i.children&&i.children.forEach(t=>{Ii(t,e)})}class bi{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new oe.Scene,this.objects=[],cn.isInitialized&&(this.physicsWorld=cn.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object3D),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.addOneselfToPhysics(this.physicsWorld),e instanceof It))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof Ei&&e.currentAction instanceof un&&(e.currentAction.backgroundTexture&&(this.scene.background=e.currentAction.backgroundTexture,this.scene.environment=e.currentAction.backgroundTexture),e.currentAction.fog&&(this.scene.fog=e.currentAction.fog))}remove(e){this.scene.remove(e.object3D);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}if(e.scene=void 0,this.physicsWorld&&(e.removeOneselfFromPhysics(this.physicsWorld),e instanceof It))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof It&&e.currentAction instanceof un&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}removeAll(){[...this.objects].forEach(t=>{this.remove(t)})}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();if(t.forEach(n=>{n.objectA.handleCollision(n.objectB,n.started,n.partOfA,n.partOfB),n.objectB.handleCollision(n.objectA,n.started,n.partOfB,n.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof bn){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new oe.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new oe.BufferAttribute(r,4))}}for(const t of this.objects)t.update(e)}setPhysicsDebugMode(e){e?(this.rapierLines=new oe.LineSegments(new oe.BufferGeometry,new oe.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class Ci extends Me{view;setView(e){this.view=e}lookAt(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof Me?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Me.defaultUpVector,s=at(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuat(s)}lookAtNow(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof Me?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Me.defaultUpVector,s=at(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuatNow(s)}}class Kt{view;setView(e){this.view=e}update(e){}activate(){}deactivate(){}keyDown(e){}keyUp(e){}keyPress(e){}mouseDown(e){}mouseUp(e){}mouseMove(e){}mouseClick(e){}mouseEnter(e){}mouseLeave(e){}mouseWheel(e){}touchStart(e){}touchEnd(e){}touchMove(e){}touchCancel(e){}}class yi extends Kt{lastMousePosition;dx=0;dy=0;isLeftDown=!1;isRightDown=!1;ctrlKey=!1;deltaY=0;target;constructor(e,t,n){super(),this.lastMousePosition={x:0,y:0},typeof e=="number"?this.target=new Ae(e,t,n):this.target=new Ae(e)}update(e){if(!this.view)return;const t=this.view.camera.getPosition(),n=this.view.camera.getQuat();if(this.isLeftDown&&!this.ctrlKey){const o=Math.sin(-this.dx*.01),s=Math.cos(-this.dx*.01),c=Math.sin(-this.dy*.01),A=Math.cos(-this.dy*.01),a=new Ae(1,0,0).apply(n),d=new Ae(0,1,0).apply(n),u=new Pe(a.x*c,a.y*c,a.z*c,A),m=new Pe(d.x*o,d.y*o,d.z*o,s),p=new Ae(t);p.sub(this.target),p.apply(u),p.apply(m),p.add(this.target),t.set(p);const I=at(t,this.target,new Ae(0,1,0));I.mul(new Pe(0,1,0,0)),n.set(I)}else if(this.isLeftDown){D.v0.set(this.target),D.v0.sub(t);const o=.005*D.v0.length(),s=new Ae(1,0,0).apply(n).scale(-this.dx*o),c=new Ae(0,1,0).apply(n).scale(this.dy*o);t.add(s),t.add(c),this.target.add(s),this.target.add(c)}if(this.deltaY!==0){const r=new Ae(this.target).sub(t);this.deltaY>0?r.scale(.05):this.deltaY<0&&r.scale(-.05),t.add(r)}this.view.camera.setPosition(t),this.view.camera.setQuat(n),this.dx=0,this.dy=0,this.deltaY=0}mouseDown(e){e.button===0?(this.isLeftDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY):e.button===2&&(this.isRightDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY)}mouseMove(e){this.dx+=e.clientX-this.lastMousePosition.x,this.dy+=e.clientY-this.lastMousePosition.y,this.ctrlKey=e.ctrlKey,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}mouseUp(e){e.button===0?this.isLeftDown=!1:e.button===2&&(this.isRightDown=!1)}mouseWheel(e){this.deltaY=e.deltaY}}const ko={speed:.1,angSpeed:.01};class So extends Kt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...ko,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new Ae,this._avatarNextQuat=new Pe,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar,n=new qe;n.set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(o),this._velY+=-9.8*e*.1,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=.5)),this._avatarNextLoc.add(0,this._velY,0),this._keyLeft&&(D.v0.set(0,this.options.angSpeed,0),this._avatarNextQuat.mul(ut(D.v0,"ZXY",D.q0))),this._keyRight&&(D.v0.set(0,-this.options.angSpeed,0),this._avatarNextQuat.mul(ut(D.v0,"ZXY",D.q0))),t.setPosition(this._avatarNextLoc),t.setQuat(this._avatarNextQuat)}}const xo={speed:5,angSpeed:.3,jumpSpeed:15};class Lo extends Kt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...xo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new Ae,this._avatarNextAngVel=new Ae,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar;new qe().set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(r),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(r),this._keyD&&this._avatarNextVel.sub(o),this._velY+=-9.8*e,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=this.options.jumpSpeed)),this._avatarNextVel.add(0,this._velY,0),this._keyLeft&&this._avatarNextAngVel.add(0,this.options.angSpeed,0),this._keyRight&&this._avatarNextAngVel.add(0,-this.options.angSpeed,0),t.setLinearVelocity(this._avatarNextVel),t.setAngularVelocity(this._avatarNextAngVel)}}class vn{scene;camera;controller;constructor(e){e.setView(this),this.camera=e,this.camera.setAudioListener(st.listener),this.camera.setPosition(0,0,3),this.scene=new bi,this.scene.scene.add(this.camera.object3D),this.controller=new yi(0,0,0),this.controller.setView(this),this.controller.activate()}replaceScene(e){this.scene.scene.remove(this.camera.object3D),e.scene.add(this.camera.object3D);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller.deactivate(),this.controller=e,this.controller.setView(this),this.controller.activate()}worldToScreen(e){throw new Error("BaseViewはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("BaseViewはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("BaseViewはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("BaseViewはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("BaseViewはwaitForRender()は実装していません")}}class Qt extends Ci{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new oe.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new oe.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new oe.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Pr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new oe.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Bi extends E.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 E.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const mt=new E.Vector3,On=new E.Matrix4,Mn=new E.Matrix4,Pn=new E.Vector3,Gn=new E.Vector3;class Ti{constructor(e={}){const t=this;let n,r,o,s;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(I,g){I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),On.copy(g.matrixWorldInverse),Mn.multiplyMatrices(g.projectionMatrix,On),d(I,I,g),this.sortObjects&&p(I)},this.setSize=function(I,g){n=I,r=g,o=n/2,s=r/2,A.style.width=I+"px",A.style.height=g+"px"};function a(I){I.isCSS2DObject&&(I.element.style.display="none");for(let g=0,l=I.children.length;g<l;g++)a(I.children[g])}function d(I,g,l){if(I.visible===!1){a(I);return}if(I.isCSS2DObject){mt.setFromMatrixPosition(I.matrixWorld),mt.applyMatrix4(Mn);const h=mt.z>=-1&&mt.z<=1&&I.layers.test(l.layers)===!0,f=I.element;f.style.display=h===!0?"":"none",h===!0&&(I.onBeforeRender(t,g,l),f.style.transform="translate("+-100*I.center.x+"%,"+-100*I.center.y+"%)translate("+(mt.x*o+o)+"px,"+(-mt.y*s+s)+"px)",f.parentNode!==A&&A.appendChild(f),I.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,I)};c.objects.set(I,C)}for(let h=0,f=I.children.length;h<f;h++)d(I.children[h],g,l)}function u(I,g){return Pn.setFromMatrixPosition(I.matrixWorld),Gn.setFromMatrixPosition(g.matrixWorld),Pn.distanceToSquared(Gn)}function m(I){const g=[];return I.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function p(I){const g=m(I).sort(function(h,f){if(h.renderOrder!==f.renderOrder)return f.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,b=c.objects.get(f).distanceToCameraSquared;return C-b}),l=g.length;for(let h=0,f=g.length;h<f;h++)g[h].element.style.zIndex=l-h}}}function Un(i,e){if(e===E.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===E.TriangleFanDrawMode||e===E.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const s=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);i.setIndex(s),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===E.TriangleFanDrawMode)for(let s=1;s<=n;s++)r.push(t.getX(0)),r.push(t.getX(s)),r.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(r.push(t.getX(s)),r.push(t.getX(s+1)),r.push(t.getX(s+2))):(r.push(t.getX(s+2)),r.push(t.getX(s+1)),r.push(t.getX(s)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class wi extends E.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Oo(t)}),this.register(function(t){return new Mo(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new Wo(t)}),this.register(function(t){return new Yo(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new Fo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new Vo(t)}),this.register(function(t){return new zo(t)}),this.register(function(t){return new Do(t)}),this.register(function(t){return new Jo(t)}),this.register(function(t){return new Xo(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=E.LoaderUtils.extractUrlBase(e);s=E.LoaderUtils.resolveURL(a,this.path)}else s=E.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new E.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(a){try{o.parse(a,s,function(d){t(d),o.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let o;const s={},c={},A=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===Ri){try{s[Qe.KHR_BINARY_GLTF]=new Zo(e)}catch(u){r&&r(u);return}o=JSON.parse(s[Qe.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new us(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const u=this.pluginCallbacks[d](a);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[u.name]=u,s[u.name]=!0}if(o.extensionsUsed)for(let d=0;d<o.extensionsUsed.length;++d){const u=o.extensionsUsed[d],m=o.extensionsRequired||[];switch(u){case Qe.KHR_MATERIALS_UNLIT:s[u]=new No;break;case Qe.KHR_DRACO_MESH_COMPRESSION:s[u]=new $o(o,this.dracoLoader);break;case Qe.KHR_TEXTURE_TRANSFORM:s[u]=new es;break;case Qe.KHR_MESH_QUANTIZATION:s[u]=new ts;break;default:m.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function _o(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Qe={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_DISPERSION:"KHR_materials_dispersion",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_MATERIALS_BUMP:"EXT_materials_bump",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 Do{constructor(e){this.parser=e,this.name=Qe.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 o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const d=new E.Color(16777215);A.color!==void 0&&d.setRGB(A.color[0],A.color[1],A.color[2],E.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new E.DirectionalLight(d),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new E.PointLight(d),a.distance=u;break;case"spot":a=new E.SpotLight(d),a.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,a.angle=A.spot.outerConeAngle,a.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return a.position.set(0,0,0),it(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class No{constructor(){this.name=Qe.KHR_MATERIALS_UNLIT}getMaterialType(){return E.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new E.Color(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const s=o.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],E.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,E.SRGBColorSpace))}return Promise.all(r)}}class Fo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Oo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const c=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new E.Vector2(c,c)}return Promise.all(o)}}class Mo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class Po{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(o)}}class Go{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new E.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,E.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Uo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(o)}}class jo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const c=s.attenuationColor||[1,1,1];return t.attenuationColor=new E.Color().setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace),Promise.all(o)}}class Ho{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class qo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const c=s.specularColorFactor||[1,1,1];return t.specularColor=new E.Color().setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,E.SRGBColorSpace)),Promise.all(o)}}class zo{constructor(e){this.parser=e,this.name=Qe.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(o)}}class Vo{constructor(e){this.parser=e,this.name=Qe.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(o)}}class Ko{constructor(e){this.parser=e,this.name=Qe.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 o=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,o.source,s)}}class Wo{constructor(e){this.parser=e,this.name=Qe.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class Yo{constructor(e){this.parser=e,this.name=Qe.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class Jo{constructor(e){this.name=Qe.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 r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.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 o.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,d=r.count,u=r.byteStride,m=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(d,u,m,r.mode,r.filter).then(function(p){return p.buffer}):s.ready.then(function(){const p=new ArrayBuffer(d*u);return s.decodeGltfBuffer(new Uint8Array(p),d,u,m,r.mode,r.filter),p})})}else return null}}class Xo{constructor(e){this.name=Qe.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]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==Ze.TRIANGLES&&a.mode!==Ze.TRIANGLE_STRIP&&a.mode!==Ze.TRIANGLE_FAN&&a.mode!==void 0)return null;const s=n.extensions[this.name].attributes,c=[],A={};for(const a in s)c.push(this.parser.getDependency("accessor",s[a]).then(d=>(A[a]=d,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const d=a.pop(),u=d.isGroup?d.children:[d],m=a[0].count,p=[];for(const I of u){const g=new E.Matrix4,l=new E.Vector3,h=new E.Quaternion,f=new E.Vector3(1,1,1),C=new E.InstancedMesh(I.geometry,I.material,m);for(let b=0;b<m;b++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,b),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,b),A.SCALE&&f.fromBufferAttribute(A.SCALE,b),C.setMatrixAt(b,g.compose(l,h,f));for(const b in A)if(b==="_COLOR_0"){const y=A[b];C.instanceColor=new E.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else b!=="TRANSLATION"&&b!=="ROTATION"&&b!=="SCALE"&&I.geometry.setAttribute(b,A[b]);E.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),p.push(C)}return d.isGroup?(d.clear(),d.add(...p),d):p[0]}))}}const Ri="glTF",Bt=12,jn={JSON:1313821514,BIN:5130562};class Zo{constructor(e){this.name=Qe.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Bt),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Ri)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-Bt,o=new DataView(e,Bt);let s=0;for(;s<r;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===jn.JSON){const a=new Uint8Array(e,Bt+s,c);this.content=n.decode(a)}else if(A===jn.BIN){const a=Bt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class $o{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Qe.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const d in s){const u=hn[d]||d.toLowerCase();c[u]=s[d]}for(const d in e.attributes){const u=hn[d]||d.toLowerCase();if(s[d]!==void 0){const m=n.accessors[e.attributes[d]],p=bt[m.componentType];a[u]=p.name,A[u]=m.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(u,m){r.decodeDracoFile(d,function(p){for(const I in p.attributes){const g=p.attributes[I],l=A[I];l!==void 0&&(g.normalized=l)}u(p)},c,a,E.LinearSRGBColorSpace,m)})})}}class es{constructor(){this.name=Qe.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class ts{constructor(){this.name=Qe.KHR_MESH_QUANTIZATION}}class vi extends E.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,d=r-t,u=(n-t)/d,m=u*u,p=m*u,I=e*a,g=I-a,l=-2*p+3*m,h=p-m,f=1-l,C=h-m+u;for(let b=0;b!==c;b++){const y=s[g+b+c],R=s[g+b+A]*d,x=s[I+b+c],z=s[I+b]*d;o[b]=f*y+C*R+l*x+h*z}return o}}const ns=new E.Quaternion;class is extends vi{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return ns.fromArray(o).normalize().toArray(o),o}}const Ze={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Hn={9728:E.NearestFilter,9729:E.LinearFilter,9984:E.NearestMipmapNearestFilter,9985:E.LinearMipmapNearestFilter,9986:E.NearestMipmapLinearFilter,9987:E.LinearMipmapLinearFilter},qn={33071:E.ClampToEdgeWrapping,33648:E.MirroredRepeatWrapping,10497:E.RepeatWrapping},Xt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},lt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},rs={CUBICSPLINE:void 0,LINEAR:E.InterpolateLinear,STEP:E.InterpolateDiscrete},Zt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function os(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new E.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:E.FrontSide})),i.DefaultMaterial}function ht(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function it(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ss(i,e,t){let n=!1,r=!1,o=!1;for(let a=0,d=e.length;a<d;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const s=[],c=[],A=[];for(let a=0,d=e.length;a<d;a++){const u=e[a];if(n){const m=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(m)}if(r){const m=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(m)}if(o){const m=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(m)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const d=a[0],u=a[1],m=a[2];return n&&(i.morphAttributes.position=d),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=m),i.morphTargetsRelative=!0,i})}function as(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function As(i){let e;const t=i.extensions&&i.extensions[Qe.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+$t(t.attributes):e=i.indices+":"+$t(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+$t(i.targets[n]);return e}function $t(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function dn(i){switch(i){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.")}}function cs(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const ls=new E.Matrix4;class us{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,r=-1,o=!1,s=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,o=c.indexOf("Firefox")>-1,s=o?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||o&&s<98?this.textureLoader=new E.TextureLoader(this.options.manager):this.textureLoader=new E.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new E.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const c={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:n,userData:{}};return ht(o,c,r),it(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const s=t[r].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(n[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(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(),o=(s,c)=>{const A=this.associations.get(s);A!=null&&this.associations.set(c,A);for(const[a,d]of s.children.entries())o(d,c.children[a])};return o(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 o=e(t[r]);o&&n.push(o)}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(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,s){return n.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Qe.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,s){n.load(E.LoaderUtils.resolveURL(t.uri,r.path),o,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(n){const r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=Xt[r.type],c=bt[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new E.BufferAttribute(a,s,A))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Xt[r.type],a=bt[r.componentType],d=a.BYTES_PER_ELEMENT,u=d*A,m=r.byteOffset||0,p=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,I=r.normalized===!0;let g,l;if(p&&p!==u){const h=Math.floor(m/p),f="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+h+":"+r.count;let C=t.cache.get(f);C||(g=new a(c,h*p,r.count*p/d),C=new E.InterleavedBuffer(g,p/d),t.cache.add(f,C)),l=new E.InterleavedBufferAttribute(C,A,m%p/d,I)}else c===null?g=new a(r.count*A):g=new a(c,m,r.count*A),l=new E.BufferAttribute(g,A,I);if(r.sparse!==void 0){const h=Xt.SCALAR,f=bt[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,b=r.sparse.values.byteOffset||0,y=new f(s[1],C,r.sparse.count*h),R=new a(s[2],b,r.sparse.count*A);c!==null&&(l=new E.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let x=0,z=y.length;x<z;x++){const k=y[x];if(l.setX(k,R[x*A]),A>=2&&l.setY(k,R[x*A+1]),A>=3&&l.setZ(k,R[x*A+2]),A>=4&&l.setW(k,R[x*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=I}return l})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let c=this.textureLoader;if(s.uri){const A=n.manager.getHandler(s.uri);A!==null&&(c=A)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,s=o.textures[e],c=o.images[t],A=(c.uri||c.bufferView)+":"+s.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=s.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const m=(o.samplers||{})[s.sampler]||{};return d.magFilter=Hn[m.magFilter]||E.LinearFilter,d.minFilter=Hn[m.minFilter]||E.LinearMipmapLinearFilter,d.wrapS=qn[m.wrapS]||E.RepeatWrapping,d.wrapT=qn[m.wrapT]||E.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==E.NearestFilter&&d.minFilter!==E.LinearFilter,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=r.images[e],c=self.URL||self.webkitURL;let A=s.uri||"",a=!1;if(s.bufferView!==void 0)A=n.getDependency("bufferView",s.bufferView).then(function(u){a=!0;const m=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(m),A});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(A).then(function(u){return new Promise(function(m,p){let I=m;t.isImageBitmapLoader===!0&&(I=function(g){const l=new E.Texture(g);l.needsUpdate=!0,m(l)}),t.load(E.LoaderUtils.resolveURL(u,o.path),I,void 0,p)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),it(u,s),u.userData.mimeType=s.mimeType||cs(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=d,d}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[Qe.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Qe.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[Qe.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return r!==void 0&&(s.colorSpace=r),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new E.PointsMaterial,E.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,A.sizeAttenuation=!1,this.cache.add(c,A)),n=A}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new E.LineBasicMaterial,E.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(r||o||s){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),s&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),o&&(A.vertexColors=!0),s&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return E.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[Qe.KHR_MATERIALS_UNLIT]){const u=r[Qe.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new E.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const m=u.baseColorFactor;c.color.setRGB(m[0],m[1],m[2],E.LinearSRGBColorSpace),c.opacity=m[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,E.SRGBColorSpace)),c.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,c.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(a.push(t.assignTexture(c,"metalnessMap",u.metallicRoughnessTexture)),a.push(t.assignTexture(c,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=E.DoubleSide);const d=o.alphaMode||Zt.OPAQUE;if(d===Zt.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===Zt.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==E.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new E.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==E.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==E.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new E.Color().setRGB(u[0],u[1],u[2],E.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==E.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,E.SRGBColorSpace)),Promise.all(a).then(function(){const u=new s(c);return o.name&&(u.name=o.name),it(u,o),t.associations.set(u,{materials:e}),o.extensions&&ht(r,u,o),u})}createUniqueName(e){const t=E.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 o(c){return n[Qe.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return zn(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],d=As(a),u=r[d];if(u)s.push(u.promise);else{let m;a.extensions&&a.extensions[Qe.KHR_DRACO_MESH_COMPRESSION]?m=o(a):m=zn(new E.BufferGeometry,a,t),r[d]={primitive:a,promise:m},s.push(m)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],s=o.primitives,c=[];for(let A=0,a=s.length;A<a;A++){const d=s[A].material===void 0?os(this.cache):this.getDependency("material",s[A].material);c.push(d)}return c.push(t.loadGeometries(s)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),d=A[A.length-1],u=[];for(let p=0,I=d.length;p<I;p++){const g=d[p],l=s[p];let h;const f=a[p];if(l.mode===Ze.TRIANGLES||l.mode===Ze.TRIANGLE_STRIP||l.mode===Ze.TRIANGLE_FAN||l.mode===void 0)h=o.isSkinnedMesh===!0?new E.SkinnedMesh(g,f):new E.Mesh(g,f),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===Ze.TRIANGLE_STRIP?h.geometry=Un(h.geometry,E.TriangleStripDrawMode):l.mode===Ze.TRIANGLE_FAN&&(h.geometry=Un(h.geometry,E.TriangleFanDrawMode));else if(l.mode===Ze.LINES)h=new E.LineSegments(g,f);else if(l.mode===Ze.LINE_STRIP)h=new E.Line(g,f);else if(l.mode===Ze.LINE_LOOP)h=new E.LineLoop(g,f);else if(l.mode===Ze.POINTS)h=new E.Points(g,f);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&as(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),it(h,o),l.extensions&&ht(r,h,l),t.assignFinalMaterial(h),u.push(h)}for(let p=0,I=u.length;p<I;p++)t.associations.set(u[p],{meshes:e,primitives:p});if(u.length===1)return o.extensions&&ht(r,u[0],o),u[0];const m=new E.Group;o.extensions&&ht(r,m,o),t.associations.set(m,{meshes:e});for(let p=0,I=u.length;p<I;p++)m.add(u[p]);return m})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new E.PerspectiveCamera(E.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new E.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),it(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),s=r,c=[],A=[];for(let a=0,d=s.length;a<d;a++){const u=s[a];if(u){c.push(u);const m=new E.Matrix4;o!==null&&m.fromArray(o.array,a*16),A.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new E.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,s=[],c=[],A=[],a=[],d=[];for(let u=0,m=r.channels.length;u<m;u++){const p=r.channels[u],I=r.samplers[p.sampler],g=p.target,l=g.node,h=r.parameters!==void 0?r.parameters[I.input]:I.input,f=r.parameters!==void 0?r.parameters[I.output]:I.output;g.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",f)),a.push(I),d.push(g))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(d)]).then(function(u){const m=u[0],p=u[1],I=u[2],g=u[3],l=u[4],h=[];for(let C=0,b=m.length;C<b;C++){const y=m[C],R=p[C],x=I[C],z=g[C],k=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const P=n._createAnimationTracks(y,R,x,z,k);if(P)for(let N=0;N<P.length;N++)h.push(P[N])}const f=new E.AnimationClip(o,void 0,h);return it(f,r),f})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),s})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=r.children||[];for(let a=0,d=c.length;a<d;a++)s.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const d=a[0],u=a[1],m=a[2];m!==null&&d.traverse(function(p){p.isSkinnedMesh&&p.bind(m,ls)});for(let p=0,I=u.length;p<I;p++)d.add(u[p]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?r.createUniqueName(o.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(a){return r._getNodeRef(r.cameraCache,o.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let d;if(o.isBone===!0?d=new E.Bone:a.length>1?d=new E.Group:a.length===1?d=a[0]:d=new E.Object3D,d!==a[0])for(let u=0,m=a.length;u<m;u++)d.add(a[u]);if(o.name&&(d.userData.name=o.name,d.name=s),it(d,o),o.extensions&&ht(n,d,o),o.matrix!==void 0){const u=new E.Matrix4;u.fromArray(o.matrix),d.applyMatrix4(u)}else o.translation!==void 0&&d.position.fromArray(o.translation),o.rotation!==void 0&&d.quaternion.fromArray(o.rotation),o.scale!==void 0&&d.scale.fromArray(o.scale);if(!r.associations.has(d))r.associations.set(d,{});else if(o.mesh!==void 0&&r.meshCache.refs[o.mesh]>1){const u=r.associations.get(d);r.associations.set(d,{...u})}return r.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new E.Group;n.name&&(o.name=r.createUniqueName(n.name)),it(o,n),n.extensions&&ht(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(r.getDependency("node",s[A]));return Promise.all(c).then(function(A){for(let d=0,u=A.length;d<u;d++)o.add(A[d]);const a=d=>{const u=new Map;for(const[m,p]of r.associations)(m instanceof E.Material||m instanceof E.Texture)&&u.set(m,p);return d.traverse(m=>{const p=r.associations.get(m);p!=null&&u.set(m,p)}),u};return r.associations=a(o),o})}_createAnimationTracks(e,t,n,r,o){const s=[],c=e.name?e.name:e.uuid,A=[];lt[o.path]===lt.weights?e.traverse(function(m){m.morphTargetInfluences&&A.push(m.name?m.name:m.uuid)}):A.push(c);let a;switch(lt[o.path]){case lt.weights:a=E.NumberKeyframeTrack;break;case lt.rotation:a=E.QuaternionKeyframeTrack;break;case lt.translation:case lt.scale:a=E.VectorKeyframeTrack;break;default:n.itemSize===1?a=E.NumberKeyframeTrack:a=E.VectorKeyframeTrack;break}const d=r.interpolation!==void 0?rs[r.interpolation]:E.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let m=0,p=A.length;m<p;m++){const I=new a(A[m]+"."+lt[o.path],t.array,u,d);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),s.push(I)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=dn(t.constructor),r=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof E.QuaternionKeyframeTrack?is:vi;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function hs(i,e,t){const n=e.attributes,r=new E.Box3;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(r.set(new E.Vector3(A[0],A[1],A[2]),new E.Vector3(a[0],a[1],a[2])),c.normalized){const d=dn(bt[c.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new E.Vector3,A=new E.Vector3;for(let a=0,d=o.length;a<d;a++){const u=o[a];if(u.POSITION!==void 0){const m=t.json.accessors[u.POSITION],p=m.min,I=m.max;if(p!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(I[2]))),m.normalized){const g=dn(bt[m.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new E.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function zn(i,e,t){const n=e.attributes,r=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){i.setAttribute(c,A)})}for(const s in n){const c=hn[s]||s.toLowerCase();c in i.attributes||r.push(o(n[s],c))}if(e.indices!==void 0&&!i.index){const s=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(s)}return E.ColorManagement.workingColorSpace!==E.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${E.ColorManagement.workingColorSpace}" not supported.`),it(i,e),hs(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?ss(i,e.targets,t):i})}const en=new WeakMap;class ds extends E.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 o=new E.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,E.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=E.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:o};return this.decodeGeometry(e,c).then(t).catch(s)}decodeGeometry(e,t){const n=JSON.stringify(t);if(en.has(e)){const A=en.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(r=A,new Promise((a,d)=>{r._callbacks[o]={resolve:a,reject:d},r.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&o&&this._releaseTask(r,o)}),en.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new E.BufferGeometry;e.index&&t.setIndex(new E.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:r,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new E.BufferAttribute(o,s);else{const d=new E.InterleavedBuffer(o,c);a=new E.InterleavedBufferAttribute(d,s,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==E.SRGBColorSpace)return;const n=new E.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),E.ColorManagement.colorSpaceToWorking(n,E.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new E.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,o)=>{n.load(e,r,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",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(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=fs.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
141
- `);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(o){const s=o.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,o){return r._taskLoad>o._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.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function fs(){let i,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(d){i.onModuleLoaded=function(u){d({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(d=>{const u=d.draco,m=new u.Decoder;try{const p=t(u,m,new Int8Array(A),a),I=p.attributes.map(g=>g.array.buffer);p.index&&I.push(p.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:p},I)}catch(p){console.error(p),self.postMessage({type:"error",id:c.id,error:p.message})}finally{u.destroy(m)}});break}};function t(s,c,A,a){const d=a.attributeIDs,u=a.attributeTypes;let m,p;const I=c.GetEncodedGeometryType(A);if(I===s.TRIANGULAR_MESH)m=new s.Mesh,p=c.DecodeArrayToMesh(A,A.byteLength,m);else if(I===s.POINT_CLOUD)m=new s.PointCloud,p=c.DecodeArrayToPointCloud(A,A.byteLength,m);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||m.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const g={index:null,attributes:[]};for(const l in d){const h=self[u[l]];let f,C;if(a.useUniqueIDs)C=d[l],f=c.GetAttributeByUniqueId(m,C);else{if(C=c.GetAttributeId(m,s[d[l]]),C===-1)continue;f=c.GetAttribute(m,C)}const b=r(s,c,m,l,h,f);l==="color"&&(b.vertexColorSpace=a.vertexColorSpace),g.attributes.push(b)}return I===s.TRIANGULAR_MESH&&(g.index=n(s,c,m)),s.destroy(m),g}function n(s,c,A){const d=A.num_faces()*3,u=d*4,m=s._malloc(u);c.GetTrianglesUInt32Array(A,u,m);const p=new Uint32Array(s.HEAPF32.buffer,m,d).slice();return s._free(m),{array:p,itemSize:1}}function r(s,c,A,a,d,u){const m=A.num_points(),p=u.num_components(),I=o(s,d),g=p*d.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,h=l/d.BYTES_PER_ELEMENT,f=m*g,C=m*l,b=s._malloc(f);c.GetAttributeDataArrayForAllPoints(A,u,I,f,b);const y=new d(s.HEAPF32.buffer,b,f/d.BYTES_PER_ELEMENT);let R;if(g===l)R=y.slice();else{R=new d(C/d.BYTES_PER_ELEMENT);let x=0;for(let z=0,k=y.length;z<k;z++){for(let P=0;P<p;P++)R[x+P]=y[z*p+P];x+=h}}return s._free(b),{name:a,count:m,itemSize:p,array:R,stride:h}}function o(s,c){switch(c){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}class ps{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_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:r,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,s)}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();r!==-1?(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}}const gs=0,Vn=2,ms=1,Kn=2,Es=0,Is=1,bs=10,Cs=0,Qi=9,ki=15,Si=16,xi=22,Li=37,_i=43,Di=76,Ni=83,Fi=97,Oi=100,Mi=103,Pi=109,Gi=122,Ui=123,ji=131,Hi=132,qi=133,zi=134,Vi=137,Ki=138,Wi=139,Yi=140,Ji=141,Xi=142,Zi=145,$i=146,er=148,tr=152,fn=153,ys=154,pn=155,Bs=156,nr=157,ir=158,rr=165,or=166,sr=1000054e3,ar=1000054001,Ar=1000054004,cr=1000054005,Qn=1000066e3,lr=1000066004;class Tt{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)+4294967296*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=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 We=[171,75,84,88,32,50,48,187,13,10,26,10];function Wn(i){return new TextDecoder().decode(i)}function Ts(i){const e=new Uint8Array(i.buffer,i.byteOffset,We.length);if(e[0]!==We[0]||e[1]!==We[1]||e[2]!==We[2]||e[3]!==We[3]||e[4]!==We[4]||e[5]!==We[5]||e[6]!==We[6]||e[7]!==We[7]||e[8]!==We[8]||e[9]!==We[9]||e[10]!==We[10]||e[11]!==We[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType: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:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new Tt(i,We.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const o=r._nextUint32(),s=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),d=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,m=new Tt(i,We.length+n,u,!0);for(let ie=0,X=Math.max(t.levelCount,1);ie<X;ie++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+m._nextUint64(),m._nextUint64()),uncompressedByteLength:m._nextUint64()});const p=new Tt(i,o,s,!0);p._skip(4);const I=p._nextUint16(),g=p._nextUint16(),l=p._nextUint16(),h=p._nextUint16(),f={vendorId:I,descriptorType:g,versionNumber:l,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:[]},C=(h/4-6)/4;for(let ie=0;ie<C;ie++){const X={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&X.channelType?(X.sampleLower=p._nextInt32(),X.sampleUpper=p._nextInt32()):(X.sampleLower=p._nextUint32(),X.sampleUpper=p._nextUint32()),f.samples[ie]=X}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(f);const b=new Tt(i,c,A,!0);for(;b._offset<A;){const ie=b._nextUint32(),X=b._scan(ie),se=Wn(X);if(t.keyValue[se]=b._nextUint8Array(ie-X.byteLength-1),se.match(/^ktx/i)){const de=Wn(t.keyValue[se]);t.keyValue[se]=de.substring(0,de.lastIndexOf("\0"))}b._skip(ie%4?4-ie%4:0)}if(d<=0)return t;const y=new Tt(i,a,d,!0),R=y._nextUint16(),x=y._nextUint16(),z=y._nextUint32(),k=y._nextUint32(),P=y._nextUint32(),N=y._nextUint32(),S=[];for(let ie=0,X=Math.max(t.levelCount,1);ie<X;ie++)S.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const F=a+y._offset,_=F+z,W=_+k,$=W+P,H=new Uint8Array(i.buffer,i.byteOffset+F,z),ee=new Uint8Array(i.buffer,i.byteOffset+_,k),ne=new Uint8Array(i.buffer,i.byteOffset+W,P),ue=new Uint8Array(i.buffer,i.byteOffset+$,N);return t.globalData={endpointCount:R,selectorCount:x,imageDescs:S,endpointsData:H,selectorsData:ee,tablesData:ne,extendedData:ue},t}let tn,ot,gn;const nn={env:{emscripten_notify_memory_growth:function(i){gn=new Uint8Array(ot.exports.memory.buffer)}}};class ws{init(){return tn||(tn=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Yn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,nn)).then(this._init):WebAssembly.instantiate(Buffer.from(Yn,"base64"),nn).then(this._init),tn)}_init(e){ot=e.instance,nn.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ot)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=ot.exports.malloc(n);gn.set(e,r),t=t||Number(ot.exports.ZSTD_findDecompressedSize(r,n));const o=ot.exports.malloc(t),s=ot.exports.ZSTD_decompress(o,t,r,n),c=gn.slice(o,o+s);return ot.exports.free(r),ot.exports.free(o),c}}const Yn="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQC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AIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQc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LBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABI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AaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgC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8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBS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ABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Rs="display-p3",vs="display-p3-linear";({...E.ColorManagement.spaces[E.SRGBColorSpace]});const rn=new WeakMap;let on=0,sn;class $e extends E.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ps,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&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}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),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")},typeof navigator<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new E.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new E.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(([o,s])=>{const c=$e.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify($e.EngineFormat),"let _EngineType = "+JSON.stringify($e.EngineType),"let _TranscoderFormat = "+JSON.stringify($e.TranscoderFormat),"let _BasisFormat = "+JSON.stringify($e.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
142
- `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=s,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),a})}),on>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),on++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new E.FileLoader(this.manager);o.setPath(this.path),o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setRequestHeader(this.requestHeader),o.setResponseType("arraybuffer"),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(rn.has(e))return rn.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:d}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new E.CompressedCubeTexture(o,A,a);else{const m=o[0].mipmaps;u=t.layerCount>1?new E.CompressedArrayTexture(m,s,c,t.layerCount,A,a):new E.CompressedTexture(m,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?E.LinearFilter:E.LinearMipmapLinearFilter,u.magFilter=E.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=ur(t),u.premultiplyAlpha=!!(d&ms),u}async _createTexture(e,t={}){const n=Ts(new Uint8Array(e)),r=n.vkFormat===Qn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===Cs||r&&!this.workerConfig.astcHDRSupported))return ks(n);const s=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:s},[e])).then(A=>this._createTextureFrom(A.data,n));return rn.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),on--}}$e.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};$e.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,BC6H:22,RGB_HALF:24,RGBA_HALF:25};$e.EngineFormat={RGBAFormat:E.RGBAFormat,RGBA_ASTC_4x4_Format:E.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:E.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:E.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:E.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:E.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:E.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:E.RGB_ETC1_Format,RGB_ETC2_Format:E.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:E.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:E.RGBA_S3TC_DXT1_Format};$e.EngineType={UnsignedByteType:E.UnsignedByteType,HalfFloatType:E.HalfFloatType,FloatType:E.FloatType};$e.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(I){const g=I.data;switch(g.type){case"init":i=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:f,height:C,hasAlpha:b,format:y,type:R,dfdFlags:x}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:f,height:C,hasAlpha:b,format:y,type:R,dfdFlags:x}},h)}catch(l){console.error(l),self.postMessage({type:"error",id:g.id,error:l.message})}});break}});function c(I){e=new Promise(g=>{t={wasmBinary:I,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const g=new t.KTX2File(new Uint8Array(I));function l(){g.close(),g.delete()}if(!g.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let h;if(g.isUASTC())h=s.UASTC;else if(g.isETC1S())h=s.ETC1S;else if(g.isHDR())h=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const f=g.getWidth(),C=g.getHeight(),b=g.getLayers()||1,y=g.getLevels(),R=g.getFaces(),x=g.getHasAlpha(),z=g.getDFDFlags(),{transcoderFormat:k,engineFormat:P,engineType:N}=u(h,f,C,x);if(!f||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const S=[],F=[];for(let _=0;_<R;_++){const W=[];for(let $=0;$<y;$++){const H=[];let ee,ne;for(let ie=0;ie<b;ie++){const X=g.getImageLevelInfo($,ie,_);_===0&&$===0&&ie===0&&(X.origWidth%4!==0||X.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?(ee=X.origWidth,ne=X.origHeight):(ee=X.width,ne=X.height);let se=new Uint8Array(g.getImageTranscodedSizeInBytes($,ie,0,k));const de=g.transcodeImage(se,$,ie,_,k,0,-1,-1);if(N===r.HalfFloatType&&(se=new Uint16Array(se.buffer,se.byteOffset,se.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");H.push(se)}const ue=p(H);W.push({data:ue,width:ee,height:ne}),F.push(ue.buffer)}S.push({mipmaps:W,width:f,height:C,format:P,type:N})}return l(),{faces:S,buffers:F,width:f,height:C,hasAlpha:x,dfdFlags:z,format:P,type:N}}const a=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[o.ASTC_4x4,o.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC7_M5,o.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC1,o.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1,o.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.PVRTC1_4_RGB,o.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],d={[s.ETC1S]:a.filter(I=>I.basisFormat.includes(s.ETC1S)).sort((I,g)=>I.priorityETC1S-g.priorityETC1S),[s.UASTC]:a.filter(I=>I.basisFormat.includes(s.UASTC)).sort((I,g)=>I.priorityUASTC-g.priorityUASTC),[s.UASTC_HDR]:a.filter(I=>I.basisFormat.includes(s.UASTC_HDR)).sort((I,g)=>I.priorityHDR-g.priorityHDR)};function u(I,g,l,h){const f=d[I];for(let C=0;C<f.length;C++){const b=f[C];if(b.if&&!i[b.if]||!b.basisFormat.includes(I)||h&&b.transcoderFormat.length<2||b.needsPowerOfTwo&&!(m(g)&&m(l)))continue;const y=b.transcoderFormat[h?1:0],R=b.engineFormat[h?1:0],x=b.engineType[0];return{transcoderFormat:y,engineFormat:R,engineType:x}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function m(I){return I<=2?!0:(I&I-1)===0&&I!==0}function p(I){if(I.length===1)return I[0];let g=0;for(let f=0;f<I.length;f++){const C=I[f];g+=C.byteLength}const l=new Uint8Array(g);let h=0;for(let f=0;f<I.length;f++){const C=I[f];l.set(C,h),h+=C.byteLength}return l}};const Qs=new Set([E.RGBAFormat,E.RGBFormat,E.RGFormat,E.RedFormat]),an={[Pi]:E.RGBAFormat,[Mi]:E.RGFormat,[Oi]:E.RedFormat,[Fi]:E.RGBAFormat,[Ni]:E.RGFormat,[Di]:E.RedFormat,[_i]:E.RGBAFormat,[Li]:E.RGBAFormat,[xi]:E.RGFormat,[Si]:E.RGFormat,[ki]:E.RedFormat,[Qi]:E.RedFormat,[Ui]:E.RGBFormat,[Gi]:E.RGBFormat,[tr]:E.RGBA_ETC2_EAC_Format,[er]:E.RGB_ETC2_Format,[fn]:E.R11_EAC_Format,[ys]:E.SIGNED_R11_EAC_Format,[pn]:E.RG11_EAC_Format,[Bs]:E.SIGNED_RG11_EAC_Format,[Qn]:E.RGBA_ASTC_4x4_Format,[ir]:E.RGBA_ASTC_4x4_Format,[nr]:E.RGBA_ASTC_4x4_Format,[lr]:E.RGBA_ASTC_6x6_Format,[or]:E.RGBA_ASTC_6x6_Format,[rr]:E.RGBA_ASTC_6x6_Format,[zi]:E.RGBA_S3TC_DXT1_Format,[qi]:E.RGBA_S3TC_DXT1_Format,[Hi]:E.RGB_S3TC_DXT1_Format,[ji]:E.RGB_S3TC_DXT1_Format,[Ki]:E.RGBA_S3TC_DXT3_Format,[Vi]:E.RGBA_S3TC_DXT3_Format,[Yi]:E.SIGNED_RED_RGTC1_Format,[Wi]:E.RED_RGTC1_Format,[Xi]:E.SIGNED_RED_GREEN_RGTC2_Format,[Ji]:E.RED_GREEN_RGTC2_Format,[$i]:E.RGBA_BPTC_Format,[Zi]:E.RGBA_BPTC_Format,[cr]:E.RGBA_PVRTC_4BPPV1_Format,[ar]:E.RGBA_PVRTC_4BPPV1_Format,[Ar]:E.RGBA_PVRTC_2BPPV1_Format,[sr]:E.RGBA_PVRTC_2BPPV1_Format},Et={[Pi]:E.FloatType,[Mi]:E.FloatType,[Oi]:E.FloatType,[Fi]:E.HalfFloatType,[Ni]:E.HalfFloatType,[Di]:E.HalfFloatType,[_i]:E.UnsignedByteType,[Li]:E.UnsignedByteType,[xi]:E.UnsignedByteType,[Si]:E.UnsignedByteType,[ki]:E.UnsignedByteType,[Qi]:E.UnsignedByteType,[Ui]:E.UnsignedInt5999Type,[Gi]:E.UnsignedInt101111Type,[tr]:E.UnsignedByteType,[er]:E.UnsignedByteType,[fn]:E.UnsignedByteType,[fn]:E.UnsignedByteType,[pn]:E.UnsignedByteType,[pn]:E.UnsignedByteType,[Qn]:E.HalfFloatType,[ir]:E.UnsignedByteType,[nr]:E.UnsignedByteType,[lr]:E.HalfFloatType,[or]:E.UnsignedByteType,[rr]:E.UnsignedByteType,[zi]:E.UnsignedByteType,[qi]:E.UnsignedByteType,[Hi]:E.UnsignedByteType,[ji]:E.UnsignedByteType,[Ki]:E.UnsignedByteType,[Vi]:E.UnsignedByteType,[Yi]:E.UnsignedByteType,[Wi]:E.UnsignedByteType,[Xi]:E.UnsignedByteType,[Ji]:E.UnsignedByteType,[$i]:E.UnsignedByteType,[Zi]:E.UnsignedByteType,[cr]:E.UnsignedByteType,[ar]:E.UnsignedByteType,[Ar]:E.UnsignedByteType,[sr]:E.UnsignedByteType};async function ks(i){const{vkFormat:e}=i;if(an[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);Et[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===Vn&&(sn||(sn=new Promise(async s=>{const c=new ws;await c.init(),s(c)})),t=await sn);const n=[];for(let s=0;s<i.levels.length;s++){const c=Math.max(1,i.pixelWidth>>s),A=Math.max(1,i.pixelHeight>>s),a=i.pixelDepth?Math.max(1,i.pixelDepth>>s):0,d=i.levels[s];let u;if(i.supercompressionScheme===gs)u=d.levelData;else if(i.supercompressionScheme===Vn)u=t.decode(d.levelData,d.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let m;Et[e]===E.FloatType?m=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):Et[e]===E.HalfFloatType?m=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):Et[e]===E.UnsignedInt5999Type||Et[e]===E.UnsignedInt101111Type?m=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):m=u,n.push({data:m,width:c,height:A,depth:a})}const r=i.levelCount===0||n.length>1;let o;if(Qs.has(an[e]))o=i.pixelDepth===0?new E.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new E.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?E.NearestMipmapNearestFilter:E.NearestFilter,o.magFilter=E.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new E.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?E.LinearMipmapLinearFilter:E.LinearFilter,o.magFilter=E.LinearFilter}return o.mipmaps=n,o.type=Et[e],o.format=an[e],o.colorSpace=ur(i),o.needsUpdate=!0,Promise.resolve(o)}function ur(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===Is?e.transferFunction===Kn?E.SRGBColorSpace:E.LinearSRGBColorSpace:e.colorPrimaries===bs?e.transferFunction===Kn?Rs:vs:(e.colorPrimaries===Es||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),E.NoColorSpace)}var hr=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=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]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),o,s=WebAssembly.instantiate(r,{}).then(function(h){o=h.instance,o.exports.__wasm_call_ctors()});function c(h){for(var f=new Uint8Array(h.length),C=0;C<h.length;++C){var b=h.charCodeAt(C);f[C]=b>96?b-97:b>64?b-39:b+4}for(var y=0,C=0;C<h.length;++C)f[y++]=f[C]<60?n[f[C]]:(f[C]-60)*64+f[++C];return f.buffer.slice(0,y)}function A(h,f,C,b,y,R,x){var z=h.exports.sbrk,k=b+3&-4,P=z(k*y),N=z(R.length),S=new Uint8Array(h.exports.memory.buffer);S.set(R,N);var F=f(P,b,y,N,R.length);if(F==0&&x&&x(P,k,y),C.set(S.subarray(P,P+b*y)),z(P-z(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],m=0;function p(h){var f={object:new Worker(h),pending:0,requests:{}};return f.object.onmessage=function(C){var b=C.data;f.pending-=b.count,f.requests[b.id][b.action](b.value),delete f.requests[b.id]},f}function I(h){for(var f="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([f],{type:"text/javascript"}),b=URL.createObjectURL(C),y=u.length;y<h;++y)u[y]=p(b);for(var y=h;y<u.length;++y)u[y].object.postMessage({});u.length=h,URL.revokeObjectURL(b)}function g(h,f,C,b,y){for(var R=u[0],x=1;x<u.length;++x)u[x].pending<R.pending&&(R=u[x]);return new Promise(function(z,k){var P=new Uint8Array(C),N=++m;R.pending+=h,R.requests[N]={resolve:z,reject:k},R.object.postMessage({id:N,count:h,size:f,source:P,mode:b,filter:y},[P.buffer])})}function l(h){var f=h.data;if(!f.id)return self.close();self.ready.then(function(C){try{var b=new Uint8Array(f.count*f.size);A(C,C.exports[f.mode],b,f.count,f.size,f.source,C.exports[f.filter]),self.postMessage({id:f.id,count:f.count,action:"resolve",value:b},[b.buffer])}catch(y){self.postMessage({id:f.id,count:f.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(h){I(h)},decodeVertexBuffer:function(h,f,C,b,y){A(o,o.exports.meshopt_decodeVertexBuffer,h,f,C,b,o.exports[a[y]])},decodeIndexBuffer:function(h,f,C,b){A(o,o.exports.meshopt_decodeIndexBuffer,h,f,C,b)},decodeIndexSequence:function(h,f,C,b){A(o,o.exports.meshopt_decodeIndexSequence,h,f,C,b)},decodeGltfBuffer:function(h,f,C,b,y,R){A(o,o.exports[d[y]],h,f,C,b,o.exports[a[R]])},decodeGltfBufferAsync:function(h,f,C,b,y){return u.length>0?g(h,f,C,d[b],a[y]):s.then(function(){var R=new Uint8Array(h*f);return A(o,o.exports[d[b]],R,h,f,C,o.exports[a[y]]),R})}}})();function Ss(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const xs={draco:"https://unpkg.com/three@0.182/examples/jsm/libs/draco/",ktx2:"https://unpkg.com/three@0.182.0/examples/jsm/libs/basis/",meshopt:!0};function kn(i={}){const e={...xs,...i};let t=new wi;const n=new ds;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new $e;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(hr),Sn=t}let Sn=new wi;Sn.setMeshoptDecoder(hr);class An extends Cn{constructor(e,t){super(e,t)}}class Ls extends It{gltf;constructor(e){super(e)}async asyncInit(e){if(ri(e)){let t=null;this.gltf=await Sn.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},Ss(s)){const{morphTargetDictionary:c,morphTargetInfluences:A}=s;Object.keys(c).forEach(a=>{const d=s.name+"."+a,u=c[a];o[d]={array:A,idx:u}})}s instanceof oe.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof oe.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]=new An(r,new Rn(s))}),t?this.syncInit(t,n,o):(t="dummy",n.dummy=new An(r,new Nn),this.syncInit(t,n,o))}else{const t=new oe.BoxGeometry,n=new oe.MeshStandardMaterial({color:16711680}),r=new oe.Mesh(t,n),o="dummy",s={};s.dummy=new An({root:r},new Nn),this.syncInit(o,s)}return this}}const dr={camera:void 0,antialias:!1,transparent:!1};class fr extends HTMLElement{options;ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;_canvas;_css2DCanvas;constructor(e){if(super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
139
+ Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var m=uo();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return m.createSyntaxDiagramsCode}});var p=(function(){function I(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
140
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I})();i.Parser=p});const wt=ho();class fo extends E.Loader{backgroundTexture;fog;constructor(e){super(e)}load(e,t,n,r){this.backgroundTexture=void 0,this.fog=void 0;const o=this,s=o.path===""?E.LoaderUtils.extractUrlBase(e):o.path,c=new E.FileLoader(o.manager);c.setPath(o.path),c.setRequestHeader(o.requestHeader),c.setWithCredentials(o.withCredentials),c.load(e,function(A){try{t(o.parse(A,s))}catch(a){r?r(a):console.error(a),o.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(k){const w=o(),B=new po(w.tokens),S=new mo(w.tokenVocabulary),T=s(S.getBaseCstVisitorConstructor()),N=B.lex(k);S.input=N.tokens;const M=S.vrml();if(S.errors.length>0)throw console.error(S.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return T.visit(M)}function o(){const k=wt.createToken,w=k({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]*/}),B=k({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\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:w}),S=["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"],T=k({name:"Version",pattern:/#VRML.*/,longer_alt:B}),N=k({name:"NodeName",pattern:new RegExp(S.join("|")),longer_alt:B}),M=k({name:"DEF",pattern:/DEF/,longer_alt:B}),U=k({name:"USE",pattern:/USE/,longer_alt:B}),W=k({name:"ROUTE",pattern:/ROUTE/,longer_alt:B}),te=k({name:"TO",pattern:/TO/,longer_alt:B}),ae=k({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),me=k({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),xe=k({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),ke=k({name:"TrueLiteral",pattern:/TRUE/}),be=k({name:"FalseLiteral",pattern:/FALSE/}),we=k({name:"NullLiteral",pattern:/NULL/}),pe=k({name:"LSquare",pattern:/\[/}),ve=k({name:"RSquare",pattern:/]/}),Pe=k({name:"LCurly",pattern:/{/}),Fe=k({name:"RCurly",pattern:/}/}),Le=k({name:"Comment",pattern:/#.*/,group:wt.Lexer.SKIPPED}),Ke=[k({name:"WhiteSpace",pattern:/[ ,\s]/,group:wt.Lexer.SKIPPED}),N,M,U,W,te,ke,be,we,T,B,w,ae,me,xe,pe,ve,Pe,Fe,Le],We={};for(let _e=0,ge=Ke.length;_e<ge;_e++){const Ee=Ke[_e];We[Ee.name]=Ee}return{tokens:Ke,tokenVocabulary:We}}function s(k){class w extends k{constructor(){super(),this.validateVisitor()}vrml(T){const N={version:this.visit(T.version),nodes:[],routes:[]};for(let M=0,U=T.node.length;M<U;M++){const W=T.node[M];N.nodes.push(this.visit(W))}if(T.route)for(let M=0,U=T.route.length;M<U;M++){const W=T.route[M];N.routes.push(this.visit(W))}return N}version(T){return T.Version[0].image}node(T){const N={name:T.NodeName[0].image,fields:[]};if(T.field)for(let M=0,U=T.field.length;M<U;M++){const W=T.field[M];N.fields.push(this.visit(W))}return T.def&&(N.DEF=this.visit(T.def[0])),N}field(T){const N={name:T.Identifier[0].image,type:null,values:null};let M;return T.singleFieldValue&&(M=this.visit(T.singleFieldValue[0])),T.multiFieldValue&&(M=this.visit(T.multiFieldValue[0])),N.type=M.type,N.values=M.values,N}def(T){return(T.Identifier||T.NodeName)[0].image}use(T){return{USE:(T.Identifier||T.NodeName)[0].image}}singleFieldValue(T){return B(this,T)}multiFieldValue(T){return B(this,T)}route(T){return{FROM:T.RouteIdentifier[0].image,TO:T.RouteIdentifier[1].image}}}function B(S,T){const N={type:null,values:[]};if(T.node){N.type="node";for(let M=0,U=T.node.length;M<U;M++){const W=T.node[M];N.values.push(S.visit(W))}}if(T.use){N.type="use";for(let M=0,U=T.use.length;M<U;M++){const W=T.use[M];N.values.push(S.visit(W))}}if(T.StringLiteral){N.type="string";for(let M=0,U=T.StringLiteral.length;M<U;M++){const W=T.StringLiteral[M];N.values.push(W.image.replace(/'|"/g,""))}}if(T.NumberLiteral){N.type="number";for(let M=0,U=T.NumberLiteral.length;M<U;M++){const W=T.NumberLiteral[M];N.values.push(parseFloat(W.image))}}if(T.HexLiteral){N.type="hex";for(let M=0,U=T.HexLiteral.length;M<U;M++){const W=T.HexLiteral[M];N.values.push(W.image)}}if(T.TrueLiteral){N.type="boolean";for(let M=0,U=T.TrueLiteral.length;M<U;M++)T.TrueLiteral[M].image==="TRUE"&&N.values.push(!0)}if(T.FalseLiteral){N.type="boolean";for(let M=0,U=T.FalseLiteral.length;M<U;M++)T.FalseLiteral[M].image==="FALSE"&&N.values.push(!1)}return T.NullLiteral&&(N.type="null",T.NullLiteral.forEach(function(){N.values.push(null)})),N}return new w}function c(k){const w=k.nodes,B=new E.Scene;for(let S=0,T=w.length;S<T;S++){const N=w[S];A(N)}for(let S=0,T=w.length;S<T;S++){const N=w[S],M=a(N);M instanceof E.Object3D&&B.add(M),N.name==="WorldInfo"&&(B.userData.worldInfo=M)}return B}function A(k){k.DEF&&(n[k.DEF]=k);const w=k.fields;for(let B=0,S=w.length;B<S;B++){const T=w[B];if(T.type==="node"){const N=T.values;for(let M=0,U=N.length;M<U;M++)A(N[M])}}}function a(k){return k.USE?ie(k.USE):(k.build!==void 0||(k.build=d(k)),k.build)}function d(k){const w=k.name;let B;switch(w){case"Anchor":case"Group":case"Transform":case"Collision":B=u(k);break;case"Background":B=p(k);break;case"Shape":B=I(k);break;case"Appearance":B=g(k);break;case"Material":B=l(k);break;case"ImageTexture":B=b(k);break;case"PixelTexture":B=C(k);break;case"TextureTransform":B=y(k);break;case"IndexedFaceSet":B=Q(k);break;case"IndexedLineSet":B=F(k);break;case"PointSet":B=L(k);break;case"Box":B=J(k);break;case"Cone":B=$(k);break;case"Cylinder":B=j(k);break;case"Sphere":B=ee(k);break;case"ElevationGrid":B=ne(k);break;case"Extrusion":B=ue(k);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":B=R(k);break;case"WorldInfo":B=x(k);break;case"DirectionalLight":B=q(k);break;case"PointLight":B=v(k);break;case"SpotLight":B=G(k);break;case"Fog":B=D(k);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"Script":case"Sound":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"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",w);break}return B!==void 0&&k.DEF!==void 0&&B.hasOwnProperty("name")===!0&&(B.name=k.DEF),B}function u(k){const w=new E.Group,B=k.fields;for(let S=0,T=B.length;S<T;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":Z(U,w);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const W=new E.Vector3(U[0],U[1],U[2]).normalize(),te=U[3];w.quaternion.setFromAxisAngle(W,te);break;case"scale":w.scale.set(U[0],U[1],U[2]);break;case"scaleOrientation":break;case"translation":w.position.set(U[0],U[1],U[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return w}const m=this;function p(k){const w=new E.Group;let B,S,T,N,M,U,W,te,ae,me;const xe=k.fields;for(let ke=0,be=xe.length;ke<be;ke++){const we=xe[ke],pe=we.name,ve=we.values;switch(pe){case"groundAngle":B=ve;break;case"groundColor":S=ve;break;case"backUrl":M=ve;break;case"bottomUrl":U=ve;break;case"frontUrl":W=ve;break;case"leftUrl":te=ve;break;case"rightUrl":ae=ve;break;case"topUrl":me=ve;break;case"skyAngle":T=ve;break;case"skyColor":N=ve;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}if(M&&U&&W&&te&&ae&&me){const ke=new E.CubeTextureLoader(m.manager);m.backgroundTexture=ke.load([ae[0],te[0],me[0],U[0],W[0],M[0]])}else{if(N){const ke=[];for(let be=0;be<N.length;be+=3)ke.push([N[be],N[be+1],N[be+2]]);N=ke}if(S){const ke=[];for(let be=0;be<S.length;be+=3)ke.push([S[be],S[be+1],S[be+2]]);S=ke}this.backgroundTexture=new Io({skyColor:N,skyAngle:T,groundColor:S,groundAngle:B}).buildTexture()}return w}function I(k){const w=k.fields;let B=new E.MeshBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:0}),S;for(let N=0,M=w.length;N<M;N++){const U=w[N],W=U.name,te=U.values;switch(W){case"appearance":te[0]!==null&&(B=a(te[0]));break;case"geometry":te[0]!==null&&(S=a(te[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}let T;if(S&&S.attributes.position){const N=S._type;if(N==="points"){const M=new E.PointsMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?M.vertexColors=!0:B.isMeshPhongMaterial&&M.color.copy(B.emissive),T=new E.Points(S,M)}else if(N==="line"){const M=new E.LineBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?M.vertexColors=!0:B.isMeshPhongMaterial&&M.color.copy(B.emissive),T=new E.LineSegments(S,M)}else S._solid!==void 0&&(B.side=S._solid?E.FrontSide:E.DoubleSide),S.attributes.color!==void 0&&(B.vertexColors=!0),T=new E.Mesh(S,B)}else T=new E.Object3D,T.visible=!1;return T}function g(k){let w=new E.MeshPhongMaterial,B;const S=k.fields;for(let T=0,N=S.length;T<N;T++){const M=S[T],U=M.name,W=M.values;switch(U){case"material":if(W[0]!==null){const ae=a(W[0]);ae.diffuseColor&&w.color.copy(ae.diffuseColor),ae.emissiveColor&&w.emissive.copy(ae.emissiveColor),ae.shininess&&(w.shininess=ae.shininess),ae.specularColor&&w.specular.copy(ae.specularColor),ae.transparency&&(w.opacity=1-ae.transparency),ae.transparency>0&&(w.transparent=!0)}else w=new E.MeshBasicMaterial({name:E.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const te=W[0];te!==null&&(te.name==="ImageTexture"||te.name==="PixelTexture"||te.USE)&&(w.map=a(te));break;case"textureTransform":W[0]!==null&&(B=a(W[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",U);break}}if(w.map){if(w.map.__type){switch(w.map.__type){case nt.INTENSITY_ALPHA:w.opacity=1;break;case nt.RGB:w.color.set(16777215);break;case nt.RGBA:w.color.set(16777215),w.opacity=1;break}delete w.map.__type}B&&(w.map.center.copy(B.center),w.map.rotation=B.rotation,w.map.repeat.copy(B.scale),w.map.offset.copy(B.translation))}return w.map&&w.map.fookHolder&&w.map.fookHolder.fooks.push(async T=>{const N=await bo(T.source.data);w.transparent=N,w.needsUpdate=N}),w}function l(k){const w={},B=k.fields;for(let S=0,T=B.length;S<T;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"ambientIntensity":break;case"diffuseColor":w.diffuseColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"emissiveColor":w.emissiveColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"shininess":w.shininess=U[0];break;case"specularColor":w.specularColor=new E.Color().setRGB(U[0],U[1],U[2],E.SRGBColorSpace);break;case"transparency":w.transparency=U[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return w}function h(k,w,B){let S;switch(w){case nt.INTENSITY:S=parseInt(k),B.r=S,B.g=S,B.b=S,B.a=1;break;case nt.INTENSITY_ALPHA:S=parseInt("0x"+k.substring(2,4)),B.r=S,B.g=S,B.b=S,B.a=parseInt("0x"+k.substring(4,6));break;case nt.RGB:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=1;break;case nt.RGBA:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=parseInt("0x"+k.substring(8,10));break}}function f(k){let w;switch(k){case 1:w=nt.INTENSITY;break;case 2:w=nt.INTENSITY_ALPHA;break;case 3:w=nt.RGB;break;case 4:w=nt.RGBA;break}return w}function C(k){let w,B=E.RepeatWrapping,S=E.RepeatWrapping;const T=k.fields;for(let N=0,M=T.length;N<M;N++){const U=T[N],W=U.name,te=U.values;switch(W){case"image":const ae=te[0],me=te[1],xe=te[2],ke=f(xe),be=new Uint8Array(4*ae*me),we={r:0,g:0,b:0,a:0};for(let pe=3,ve=0,Pe=te.length;pe<Pe;pe++,ve++){h(te[pe],ke,we);const Fe=ve*4;be[Fe+0]=we.r,be[Fe+1]=we.g,be[Fe+2]=we.b,be[Fe+3]=we.a}w=new E.DataTexture(be,ae,me),w.colorSpace=E.SRGBColorSpace,w.needsUpdate=!0,w.__type=ke;break;case"repeatS":te[0]===!1&&(B=E.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(S=E.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return w&&(w.wrapS=B,w.wrapT=S),w}function b(k){let w,B=E.RepeatWrapping,S=E.RepeatWrapping;const T=k.fields;for(let N=0,M=T.length;N<M;N++){const U=T[N],W=U.name,te=U.values;switch(W){case"url":const ae=te[0],me={fooks:[]},xe=ke=>{me.fooks&&me.fooks.map(be=>be(ke))};ae&&(w=ye.load(ae,xe)),w&&(w.fookHolder=me);break;case"repeatS":te[0]===!1&&(B=E.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(S=E.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return w&&(w.wrapS=B,w.wrapT=S,w.colorSpace=E.SRGBColorSpace),w}function y(k){const w={center:new E.Vector2,rotation:0,scale:new E.Vector2(1,1),translation:new E.Vector2},B=k.fields;for(let S=0,T=B.length;S<T;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"center":w.center.set(U[0],U[1]);break;case"rotation":w.rotation=U[0];break;case"scale":w.scale.set(U[0],U[1]);break;case"translation":w.translation.set(U[0],U[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return w}function R(k){return k.fields[0]?k.fields[0].values:{}}function x(k){const w={},B=k.fields;for(let S=0,T=B.length;S<T;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"title":w.title=U[0];break;case"info":w.info=U;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return w}function q(k){let w=0;const B=new E.Color(1,1,1),S=new E.Vector3(0,0,-1);let T=1,N=!0;const M=k.fields;for(let ae=0,me=M.length;ae<me;ae++){const xe=M[ae],ke=xe.name,be=xe.values;switch(ke){case"ambientIntensity":w=be[0];break;case"color":B.set(be[0],be[1],be[2]);break;case"direction":S.set(be[0],be[1],be[2]);break;case"intensity":T=be[0];break;case"on":N=be[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",ke);break}}T=N?T:0;const U=new E.Object3D,W=new E.DirectionalLight(B,T);S.normalize(),S.multiplyScalar(-10),W.position.copy(S),U.add(W);const te=new E.AmbientLight(B,T*w);return U.add(te),U}function v(k){let w=0;const B=new E.Vector3(1,0,0),S=new E.Color(1,1,1);let T=1;const N=new E.Vector3(0,0,0);let M=!0,U=100;const W=k.fields;for(let xe=0,ke=W.length;xe<ke;xe++){const be=W[xe],we=be.name,pe=be.values;switch(we){case"ambientIntensity":w=pe[0];break;case"attenuation":B.set(pe[0],pe[1],pe[2]);break;case"color":S.set(pe[0],pe[1],pe[2]);break;case"intensity":T=pe[0];break;case"location":N.set(pe[0],pe[1],pe[2]);break;case"on":M=pe[0];break;case"radius":U=pe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",we);break}}T=M?T:0;const te=new E.Object3D,ae=new E.PointLight(S,T,U);ae.position.copy(N),ae.decay=2,te.add(ae);const me=new E.AmbientLight(S,T*w);return te.add(me),te}function G(k){let w=0;const B=new E.Vector3(1,0,0);let S=1.570796;const T=new E.Color(1,1,1);let N=.785398;const M=new E.Vector3(0,0,-1);let U=1;const W=new E.Vector3(0,0,-1);let te=!0,ae=100;const me=k.fields;for(let pe=0,ve=me.length;pe<ve;pe++){const Pe=me[pe],Fe=Pe.name,Le=Pe.values;switch(Fe){case"ambientIntensity":w=Le[0];break;case"attenuation":B.set(Le[0],Le[1],Le[2]);break;case"beamWidth":S=Le[0];break;case"color":T.set(Le[0],Le[1],Le[2]);break;case"cutOffAngle":N=Le[0];break;case"direction":M.set(Le[0],Le[1],Le[2]);break;case"intensity":U=Le[0];break;case"location":W.set(Le[0],Le[1],Le[2]);break;case"on":te=Le[0];break;case"radius":ae=Le[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Fe);break}}U=te?U:0;const xe=new E.Object3D;S=S>N?N:S;const ke=1-S/N,be=new E.SpotLight(T,U,ae,N,ke);M.normalize(),be.position.copy(M),be.decay=0,xe.add(be);const we=new E.AmbientLight(T,U*w);return xe.add(we),xe.position.copy(W),xe}function D(k){const w=new E.Color(1,1,1);let B="LINEAR",S=0;const T=k.fields;for(let N=0,M=T.length;N<M;N++){const U=T[N],W=U.name,te=U.values;switch(W){case"color":w.set(te[0],te[1],te[2]);break;case"fogType":B=te[0];break;case"visibilityRange":S=te[0];break;case"set_bind":break;case"isBound":break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",W);break}}if(B==="LINEAR")m.fog=new E.Fog(w,0,S);else if(B==="EXPONENTIAL"){let N=.02;S!==0&&(N=2.146/S),m.fog=new E.FogExp2(w,N)}else console.warn("ThreeMFLoader.VRMLLoader2: Unknown fogType:",B);return new E.Object3D}function Q(k){let w,B,S,T,N=!0,M=!0,U=0,W,te,ae,me,xe=!0,ke=!0;const be=k.fields;for(let He=0,Ke=be.length;He<Ke;He++){const We=be[He],_e=We.name,ge=We.values;switch(_e){case"color":const Ee=ge[0];Ee!==null&&(w=a(Ee));break;case"coord":const he=ge[0];he!==null&&(B=a(he));break;case"normal":const Ie=ge[0];Ie!==null&&(S=a(Ie));break;case"texCoord":const Ce=ge[0];Ce!==null&&(T=a(Ce));break;case"ccw":N=ge[0];break;case"colorIndex":W=ge;break;case"colorPerVertex":xe=ge[0];break;case"convex":break;case"coordIndex":te=ge;break;case"creaseAngle":U=ge[0];break;case"normalIndex":ae=ge;break;case"normalPerVertex":ke=ge[0];break;case"solid":M=ge[0];break;case"texCoordIndex":me=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",_e);break}}if(te===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new E.BufferGeometry;const we=se(te,N);let pe,ve,Pe;if(w){if(xe===!0)if(W&&W.length>0){const He=se(W,N);pe=Ve(we,He,w,3)}else pe=O(we,new E.Float32BufferAttribute(w,3));else if(W&&W.length>0){const He=P(w,W),Ke=de(He,te);pe=Je(we,Ke)}else{const He=de(w,te);pe=Je(we,He)}Qe(pe)}if(S)if(ke===!0)if(ae&&ae.length>0){const He=se(ae,N);ve=Ve(we,He,S,3)}else ve=O(we,new E.Float32BufferAttribute(S,3));else if(ae&&ae.length>0){const He=P(S,ae),Ke=de(He,te);ve=Je(we,Ke)}else{const He=de(S,te);ve=Je(we,He)}else ve=re(we,B,U);if(T)if(me&&me.length>0){const He=se(me,N);Pe=Ve(we,He,T,2)}else Pe=O(we,new E.Float32BufferAttribute(T,2));const Fe=new E.BufferGeometry,Le=O(we,new E.Float32BufferAttribute(B,3));return Fe.setAttribute("position",Le),Fe.setAttribute("normal",ve),pe&&Fe.setAttribute("color",pe),Pe&&Fe.setAttribute("uv",Pe),Fe._solid=M,Fe._type="mesh",Fe}function F(k){let w,B,S,T,N=!0;const M=k.fields;for(let me=0,xe=M.length;me<xe;me++){const ke=M[me],be=ke.name,we=ke.values;switch(be){case"color":const pe=we[0];pe!==null&&(w=a(pe));break;case"coord":const ve=we[0];ve!==null&&(B=a(ve));break;case"colorIndex":S=we;break;case"colorPerVertex":N=we[0];break;case"coordIndex":T=we;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",be);break}}let U;const W=H(T);if(w){if(N===!0)if(S.length>0){const me=H(S);U=Ve(W,me,w,3)}else U=O(W,new E.Float32BufferAttribute(w,3));else if(S.length>0){const me=P(w,S),xe=Y(me,T);U=qe(W,xe)}else{const me=Y(w,T);U=qe(W,me)}Qe(U)}const te=new E.BufferGeometry,ae=O(W,new E.Float32BufferAttribute(B,3));return te.setAttribute("position",ae),U&&te.setAttribute("color",U),te._type="line",te}function L(k){let w,B;const S=k.fields;for(let N=0,M=S.length;N<M;N++){const U=S[N],W=U.name,te=U.values;switch(W){case"color":const ae=te[0];ae!==null&&(w=a(ae));break;case"coord":const me=te[0];me!==null&&(B=a(me));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}const T=new E.BufferGeometry;if(T.setAttribute("position",new E.Float32BufferAttribute(B,3)),w){const N=new E.Float32BufferAttribute(w,3);Qe(N),T.setAttribute("color",N)}return T._type="points",T}function J(k){const w=new E.Vector3(2,2,2),B=k.fields;for(let T=0,N=B.length;T<N;T++){const M=B[T],U=M.name,W=M.values;U==="size"?(w.x=W[0],w.y=W[1],w.z=W[2]):console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new E.BoxGeometry(w.x,w.y,w.z)}function $(k){let w=1,B=2,S=!1;const T=k.fields;for(let M=0,U=T.length;M<U;M++){const W=T[M],te=W.name,ae=W.values;switch(te){case"bottom":S=!ae[0];break;case"bottomRadius":w=ae[0];break;case"height":B=ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",te);break}}return new E.ConeGeometry(w,B,16,1,S)}function j(k){let w=1,B=2;const S=k.fields;for(let N=0,M=S.length;N<M;N++){const U=S[N],W=U.name,te=U.values;switch(W){case"bottom":break;case"radius":w=te[0];break;case"height":B=te[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return new E.CylinderGeometry(w,w,B,16,1)}function ee(k){let w=1;const B=k.fields;for(let T=0,N=B.length;T<N;T++){const M=B[T],U=M.name,W=M.values;U==="radius"?w=W[0]:console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new E.SphereGeometry(w,16,16)}function ne(k){let w,B,S,T,N=!0,M=!0,U=!0,W=!0,te=0,ae=2,me=2,xe=1,ke=1;const be=k.fields;for(let ge=0,Ee=be.length;ge<Ee;ge++){const he=be[ge],Ie=he.name,Ce=he.values;switch(Ie){case"color":const Ue=Ce[0];Ue!==null&&(w=a(Ue));break;case"normal":const ct=Ce[0];ct!==null&&(B=a(ct));break;case"texCoord":const lt=Ce[0];lt!==null&&(S=a(lt));break;case"height":T=Ce;break;case"ccw":W=Ce[0];break;case"colorPerVertex":N=Ce[0];break;case"creaseAngle":te=Ce[0];break;case"normalPerVertex":M=Ce[0];break;case"solid":U=Ce[0];break;case"xDimension":ae=Ce[0];break;case"xSpacing":xe=Ce[0];break;case"zDimension":me=Ce[0];break;case"zSpacing":ke=Ce[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const we=[],pe=[],ve=[],Pe=[];for(let ge=0;ge<me;ge++)for(let Ee=0;Ee<ae;Ee++){const he=ge*ae+Ee,Ie=xe*ge,Ce=T[he],Ue=ke*Ee;if(we.push(Ie,Ce,Ue),w&&N===!0){const ct=w[he*3+0],lt=w[he*3+1],qt=w[he*3+2];ve.push(ct,lt,qt)}if(B&&M===!0){const ct=B[he*3+0],lt=B[he*3+1],qt=B[he*3+2];pe.push(ct,lt,qt)}if(S){const ct=S[he*2+0],lt=S[he*2+1];Pe.push(ct,lt)}else Pe.push(ge/(ae-1),Ee/(me-1))}const Fe=[];for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*ae,Ie=ge+(Ee+1)*ae,Ce=ge+1+(Ee+1)*ae,Ue=ge+1+Ee*ae;W===!0?(Fe.push(he,Ce,Ie),Fe.push(Ce,he,Ue)):(Fe.push(he,Ie,Ce),Fe.push(Ce,Ue,he))}const Le=O(Fe,new E.Float32BufferAttribute(we,3)),He=O(Fe,new E.Float32BufferAttribute(Pe,2));let Ke,We;if(w){if(N===!1){for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(ae-1),Ie=w[he*3+0],Ce=w[he*3+1],Ue=w[he*3+2];ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue),ve.push(Ie,Ce,Ue)}Ke=new E.Float32BufferAttribute(ve,3)}else Ke=O(Fe,new E.Float32BufferAttribute(ve,3));Qe(Ke)}if(B)if(M===!1){for(let ge=0;ge<ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(ae-1),Ie=B[he*3+0],Ce=B[he*3+1],Ue=B[he*3+2];pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue),pe.push(Ie,Ce,Ue)}We=new E.Float32BufferAttribute(pe,3)}else We=O(Fe,new E.Float32BufferAttribute(pe,3));else We=re(Fe,we,te);const _e=new E.BufferGeometry;return _e.setAttribute("position",Le),_e.setAttribute("normal",We),_e.setAttribute("uv",He),Ke&&_e.setAttribute("color",Ke),_e._solid=U,_e._type="mesh",_e}function ue(k){let w=[1,1,1,-1,-1,-1,-1,1,1,1],B=[0,0,0,0,1,0],S,T,N=!0,M=!0,U=0,W=!0,te=!0;const ae=k.fields;for(let _e=0,ge=ae.length;_e<ge;_e++){const Ee=ae[_e],he=Ee.name,Ie=Ee.values;switch(he){case"beginCap":N=Ie[0];break;case"ccw":M=Ie[0];break;case"convex":break;case"creaseAngle":U=Ie[0];break;case"crossSection":w=Ie;break;case"endCap":W=Ie[0];break;case"orientation":T=Ie;break;case"scale":S=Ie;break;case"solid":te=Ie[0];break;case"spine":B=Ie;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",he);break}}const me=w[0]===w[w.length-2]&&w[1]===w[w.length-1],xe=[],ke=new E.Vector3,be=new E.Vector3,we=new E.Vector3,pe=new E.Vector3,ve=new E.Quaternion;for(let _e=0,ge=0,Ee=0,he=B.length;_e<he;_e+=3,ge+=2,Ee+=4){ke.fromArray(B,_e),be.x=S?S[ge+0]:1,be.y=1,be.z=S?S[ge+1]:1,we.x=T?T[Ee+0]:0,we.y=T?T[Ee+1]:0,we.z=T?T[Ee+2]:1;const Ie=T?T[Ee+3]:0;for(let Ce=0,Ue=w.length;Ce<Ue;Ce+=2)pe.x=w[Ce+0],pe.y=0,pe.z=w[Ce+1],pe.multiply(be),ve.setFromAxisAngle(we,Ie),pe.applyQuaternion(ve),pe.add(ke),xe.push(pe.x,pe.y,pe.z)}const Pe=[],Fe=B.length/3,Le=w.length/2;for(let _e=0;_e<Fe-1;_e++)for(let ge=0;ge<Le-1;ge++){const Ee=ge+_e*Le;let he=ge+1+_e*Le;const Ie=ge+(_e+1)*Le;let Ce=ge+1+(_e+1)*Le;ge===Le-2&&me===!0&&(he=_e*Le,Ce=(_e+1)*Le),M===!0?(Pe.push(Ee,he,Ie),Pe.push(Ie,he,Ce)):(Pe.push(Ee,Ie,he),Pe.push(Ie,Ce,he))}if(N===!0||W===!0){const _e=[];for(let he=0,Ie=w.length;he<Ie;he+=2)_e.push(new E.Vector2(w[he],w[he+1]));const ge=E.ShapeUtils.triangulateShape(_e,[]),Ee=[];for(let he=0,Ie=ge.length;he<Ie;he++){const Ce=ge[he];Ee.push(Ce[0],Ce[1],Ce[2])}if(N===!0)for(let he=0,Ie=Ee.length;he<Ie;he+=3)M===!0?Pe.push(Ee[he+0],Ee[he+1],Ee[he+2]):Pe.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(W===!0){const he=Le*(Fe-1);for(let Ie=0,Ce=Ee.length;Ie<Ce;Ie+=3)M===!0?Pe.push(he+Ee[Ie+0],he+Ee[Ie+2],he+Ee[Ie+1]):Pe.push(he+Ee[Ie+0],he+Ee[Ie+1],he+Ee[Ie+2])}}const He=O(Pe,new E.Float32BufferAttribute(xe,3)),Ke=re(Pe,xe,U),We=new E.BufferGeometry;return We.setAttribute("position",He),We.setAttribute("normal",Ke),We._solid=te,We._type="mesh",We}function ie(k){const w=n[k],B=a(w);return B.isObject3D||B.isMaterial?B.clone():B}function Z(k,w){for(let B=0,S=k.length;B<S;B++){const T=a(k[B]);T instanceof E.Object3D&&w.add(T)}}function se(k,w){const B=[];let S=0;for(let T=0,N=k.length;T<N;T++){const M=k[S],U=k[T+(w?1:2)],W=k[T+(w?2:1)];B.push(M,U,W),(k[T+3]===-1||T+3>=N)&&(T+=3,S=T+1)}return B}function de(k,w){const B=[];let S=0;for(let T=0,N=w.length;T<N;T++){const M=S*3,U=k[M],W=k[M+1],te=k[M+2];B.push(U,W,te),(w[T+3]===-1||T+3>=N)&&(T+=3,S++)}return B}function P(k,w){const B=[];for(let S=0,T=w.length;S<T;S++){const M=w[S]*3,U=k[M],W=k[M+1],te=k[M+2];B.push(U,W,te)}return B}function H(k){const w=[];for(let B=0,S=k.length;B<S;B++){const T=k[B],N=k[B+1];w.push(T,N),(k[B+2]===-1||B+2>=S)&&(B+=2)}return w}function Y(k,w){const B=[];let S=0;for(let T=0,N=w.length;T<N;T++){const M=S*3,U=k[M],W=k[M+1],te=k[M+2];B.push(U,W,te),(w[T+2]===-1||T+2>=N)&&(T+=2,S++)}return B}const V=new E.Vector3,K=new E.Vector3,ce=new E.Vector3,Be=new E.Vector2,Te=new E.Vector2,De=new E.Vector2;function Ve(k,w,B,S){const T=[];for(let N=0,M=k.length;N<M;N+=3){const U=w[N],W=w[N+1],te=w[N+2];S===2?(Be.fromArray(B,U*S),Te.fromArray(B,W*S),De.fromArray(B,te*S),T.push(Be.x,Be.y),T.push(Te.x,Te.y),T.push(De.x,De.y)):(V.fromArray(B,U*S),K.fromArray(B,W*S),ce.fromArray(B,te*S),T.push(V.x,V.y,V.z),T.push(K.x,K.y,K.z),T.push(ce.x,ce.y,ce.z))}return new E.Float32BufferAttribute(T,S)}function Je(k,w){const B=[];for(let S=0,T=0,N=k.length;S<N;S+=3,T++)V.fromArray(w,T*3),B.push(V.x,V.y,V.z),B.push(V.x,V.y,V.z),B.push(V.x,V.y,V.z);return new E.Float32BufferAttribute(B,3)}function qe(k,w){const B=[];for(let S=0,T=0,N=k.length;S<N;S+=2,T++)V.fromArray(w,T*3),B.push(V.x,V.y,V.z),B.push(V.x,V.y,V.z);return new E.Float32BufferAttribute(B,3)}function O(k,w){const B=w.array,S=w.itemSize,T=new B.constructor(k.length*S);let N=0,M=0;for(let U=0,W=k.length;U<W;U++){N=k[U]*S;for(let te=0;te<S;te++)T[M++]=B[N++]}return new E.Float32BufferAttribute(T,S)}const X=new E.Vector3,z=new E.Vector3;function re(k,w,B){const S=[],T={};for(let M=0,U=k.length;M<U;M+=3){const W=k[M],te=k[M+1],ae=k[M+2],me=new Eo(W,te,ae);V.fromArray(w,W*3),K.fromArray(w,te*3),ce.fromArray(w,ae*3),z.subVectors(ce,K),X.subVectors(V,K),z.cross(X),z.normalize(),me.normal.copy(z),T[W]===void 0&&(T[W]=[]),T[te]===void 0&&(T[te]=[]),T[ae]===void 0&&(T[ae]=[]),T[W].push(me.normal),T[te].push(me.normal),T[ae].push(me.normal),S.push(me)}const N=[];for(let M=0,U=S.length;M<U;M++){const W=S[M],te=fe(T[W.a],W.normal,B),ae=fe(T[W.b],W.normal,B),me=fe(T[W.c],W.normal,B);V.fromArray(w,W.a*3),K.fromArray(w,W.b*3),ce.fromArray(w,W.c*3),N.push(te.x,te.y,te.z),N.push(ae.x,ae.y,ae.z),N.push(me.x,me.y,me.z)}return new E.Float32BufferAttribute(N,3)}function fe(k,w,B){const S=new E.Vector3;if(B===0)S.copy(w);else for(let T=0,N=k.length;T<N;T++)k[T].angleTo(w)<B&&S.add(k[T]);return S.normalize()}function Qe(k){const w=new E.Color;for(let B=0;B<k.count;B++)w.fromBufferAttribute(k,B),E.ColorManagement.colorSpaceToWorking(w,E.SRGBColorSpace),k.setXYZ(B,w.r,w.g,w.b)}const ye=new E.TextureLoader(this.manager);if(ye.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const le=r(e);return c(le)}}class po{constructor(e){this.lexer=new wt.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}}const go=wt.CstParser;class mo extends go{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,d=e.StringLiteral,u=e.HexLiteral,m=e.NumberLiteral,p=e.TrueLiteral,I=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,h=e.USE,f=e.ROUTE,C=e.TO,b=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(b),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(o)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(b)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(b)}}])}),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(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(m)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(I)}},{ALT:function(){t.CONSUME(g)}}])})}),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(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(m)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(f),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class Eo{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new E.Vector3}}const nt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Io{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:r=[],size:o=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=r,this._size=o,this._texture=null}applyToScene(e){e.background=this._buildCubeTexture()}buildTexture(){return this._texture||(this._texture=this._buildCubeTexture()),this._texture}dispose(){this._texture&&(this._texture.dispose(),this._texture=null)}_colorAtPitch(e){const t=Math.PI/2;if(e<=t){if(this._skyAngle.length===0)return this._skyColor[0];if(e<=this._skyAngle[0])return this._lerpColor(this._skyColor[0],this._skyColor[1],e/this._skyAngle[0]);const n=this._skyAngle.length-1;if(e>=this._skyAngle[n])return this._skyColor[n+1]??this._skyColor[this._skyColor.length-1];for(let r=0;r<n;r++)if(e<=this._skyAngle[r+1]){const o=(e-this._skyAngle[r])/(this._skyAngle[r+1]-this._skyAngle[r]);return this._lerpColor(this._skyColor[r+1]??this._skyColor[this._skyColor.length-1],this._skyColor[r+2]??this._skyColor[this._skyColor.length-1],o)}return this._skyColor[this._skyColor.length-1]}else{if(this._groundColor.length===0)return this._skyColor[this._skyColor.length-1];const n=e-t;if(this._groundAngle.length===0)return this._groundColor[0];if(n<=this._groundAngle[0])return this._lerpColor(this._groundColor[0],this._groundColor[1],n/this._groundAngle[0]);const r=this._groundAngle.length-1;if(n>=this._groundAngle[r])return this._groundColor[r+1]??this._groundColor[this._groundColor.length-1];for(let o=0;o<r;o++)if(n<=this._groundAngle[o+1]){const s=(n-this._groundAngle[o])/(this._groundAngle[o+1]-this._groundAngle[o]);return this._lerpColor(this._groundColor[o+1]??this._groundColor[this._groundColor.length-1],this._groundColor[o+2]??this._groundColor[this._groundColor.length-1],s)}return this._groundColor[this._groundColor.length-1]}}_lerpColor(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}_buildSideCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const A=1-2*((s+.5)/e);for(let a=0;a<e;a++){const u=2*((a+.5)/e)-1,m=1,p=Math.sqrt(u*u+A*A+m*m),I=Math.acos(Math.max(-1,Math.min(1,A/p))),[g,l,h]=this._colorAtPitch(I),f=(s*e+a)*4;o[f]=Math.round(g*255),o[f+1]=Math.round(l*255),o[f+2]=Math.round(h*255),o[f+3]=255}}return n.putImageData(r,0,0),t}_buildTopCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,d=1,u=Math.sqrt(a*a+d*d+c*c),m=Math.acos(Math.max(-1,Math.min(1,d/u))),[p,I,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(I*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildBottomCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,d=-1,u=Math.sqrt(a*a+d*d+c*c),m=Math.acos(Math.max(-1,Math.min(1,d/u))),[p,I,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(I*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildCubeTexture(){const e=this._buildSideCanvas(),t=this._buildTopCanvas(),n=this._buildBottomCanvas(),r=[e,e,t,n,e,e],o=new E.CubeTexture(r);return o.needsUpdate=!0,o.minFilter=E.LinearMipmapLinearFilter,o.magFilter=E.LinearFilter,o}}async function bo(i){await new Promise((o,s)=>{if(i.complete)return o();i.onload=o,i.onerror=s});const e=document.createElement("canvas"),t=e.getContext("2d");e.width=i.naturalWidth,e.height=i.naturalHeight,t.drawImage(i,0,0);const r=t.getImageData(0,0,e.width,e.height).data;for(let o=3;o<r.length;o+=4)if(r[o]<255)return!0;return!1}class Co extends E.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new E.FileLoader(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(c){try{t(o.parse(c))}catch(A){r?r(A):console.error(A),o.manager.itemError(e)}},n,r)}parse(e){function t(p){c(p)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const I=[],g=r(p,c(p),I);c(p)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(p).split(/[\s]+/);const h=parseInt(l[1]);isNaN(h)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(p).split(/[\s]+/);const f=parseFloat(l[2]);isNaN(f)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<h;C++)l=c(p).split(/[\s]+/),n(l,C*f,g);return I}function n(p,I,g){if(g.type==="ENDSITE")return;const l={time:I,position:new E.Vector3,rotation:new E.Quaternion,scale:new E.Vector3(1,1,1)};g.frames.push(l);const h=new E.Quaternion,f=new E.Vector3(1,0,0),C=new E.Vector3(0,1,0),b=new E.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(p.shift().trim());break;case"Yposition":l.position.y=parseFloat(p.shift().trim());break;case"Zposition":l.position.z=parseFloat(p.shift().trim());break;case"Xrotation":h.setFromAxisAngle(f,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Yrotation":h.setFromAxisAngle(C,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Zrotation":h.setFromAxisAngle(b,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Xscale":l.scale.x=parseFloat(p.shift().trim());break;case"Yscale":l.scale.y=parseFloat(p.shift().trim());break;case"Zscale":l.scale.z=parseFloat(p.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)n(p,I,g.children[y])}function r(p,I,g){const l={name:"",type:"",frames:[]};g.push(l);let h=I.split(/[\s]+/);h[0].toUpperCase()==="END"&&h[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=h[1],l.type=h[0].toUpperCase()),c(p)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),h=c(p).split(/[\s]+/),h[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+h[0]),h.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const f=new E.Vector3(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));if((isNaN(f.x)||isNaN(f.y)||isNaN(f.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=f,l.type!=="ENDSITE"){h=c(p).split(/[\s]+/),h[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(h[1]);l.channels=h.splice(2,C),l.children=[]}for(;;){const C=c(p);if(C==="}")return l;l.children.push(r(p,C,g))}}function o(p,I){const g=new E.Bone;if(I.push(g),g.position.add(p.offset),g.name=p.name,p.type!=="ENDSITE")for(let l=0;l<p.children.length;l++)g.add(o(p.children[l],I));return g}function s(p){const I=[];for(let g=0;g<p.length;g++){const l=p[g];if(l.type==="ENDSITE")continue;const h=[],f=[],C=[],b=[];for(let y=0;y<l.frames.length;y++){const R=l.frames[y];h.push(R.time),f.push(R.position.x+l.offset.x),f.push(R.position.y+l.offset.y),f.push(R.position.z+l.offset.z),C.push(R.rotation.x),C.push(R.rotation.y),C.push(R.rotation.z),C.push(R.rotation.w),b.push(R.scale.x),b.push(R.scale.y),b.push(R.scale.z)}A.animateBonePositions&&I.push(new E.VectorKeyframeTrack(l.name+".position",h,f)),A.animateBoneRotations&&I.push(new E.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&I.push(new E.VectorKeyframeTrack(l.name+".scale",h,b))}return new E.AnimationClip("animation",-1,I)}function c(p){let I;for(;(I=p.shift().trim()).length===0;);return I}const A=this,a=e.split(/[\r\n]+/g),d=t(a),u=[];o(d[0],u);const m=s(d);return{skeleton:new E.Skeleton(u),clip:m}}}async function yo(i,e){const t=new oe.LoadingManager;t.setURLModifier(c=>(c.startsWith("./")&&(c=c.substring(2)),URL.createObjectURL(sn(i,c))));const n=new fo(t),r=await n.loadAsync(e),o=n.backgroundTexture,s=n.fog;return{object3D:r,bgTexture:o,fog:s}}let zt;async function Bo(i,e){zt||(zt=new Co);const t=Nt(i,e);return await zt.parse(t)}function To(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof oe.Bone&&n.push(o)});const r=new oe.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class yn{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let o;n.getInterpolation()===oe.InterpolateDiscrete?o=new oe.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new oe.QuaternionLinearInterpolant(n.times,n.values,r):o=new oe.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=o}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const o=n.substring(0,n.lastIndexOf(".")),s=n.substring(n.lastIndexOf(".")+1,n.length);let c=t[o];c||(c={},t[o]=c);const A=r.evaluate(this.time);if(s==="position")c.loc=new Ae(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Me(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new Ae(A[0],A[1],A[2]);else if(s==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:o,vals:a})}else console.warn(`ClipMotion: update. unknown property(${s})`)}return t}}const wo={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Ro(){try{at.listener.context.state!=="running"&&await at.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class at extends Oe{static listener=new oe.AudioListener;static audioLoader=new oe.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=Ot(wo,t),this.ready=this.asyncInit(e)}initObject(){return new oe.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new oe.PositionalAudio(at.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);const n=this.options.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}else{const t=new oe.Audio(at.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object3D.add(this.sound),new Promise(t=>{at.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class Ln{isDummy=!0;skeleton=new oe.Skeleton([new oe.Bone]);clip=new oe.AnimationClip("dummy")}const Vt={},mt={};class an extends mn{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,r,o=!1,s=!0,c,A){super(e,t),this.loop=n,this.sound=r,this.soundLoop=o,this.soundContinue=s,this.backgroundTexture=c,this.fog=A}enable(e,t){super.enable(e,t),this.sound&&(this.sound.play(),this.loop&&!this.soundContinue&&this.motion.setFinishListener(()=>{this.sound?.play()}),this.loop&&!this.soundLoop&&this.motion.setFinishListener(()=>{this.sound?.play()})),t&&(this.backgroundTexture&&(t.scene.background=this.backgroundTexture,t.scene.environment=this.backgroundTexture),this.fog&&(t.scene.fog=this.fog))}disable(e,t){super.disable(e,t),this.sound&&(this.loop&&this.sound.stop(),this.soundContinue||this.sound.stop(),this.motion.setFinishListener=()=>{})}}class fi extends bt{haltActionNo=0;walkActionNo=0;runActionNo=0;minWalkSpeed=.1;minRunSpeed=1;isBillboard=!1;comment=null;tags=[];profiles=[];thumbnails=[];rdf=null;htmlfile="";constructor(e){super(e)}async asyncInit(e){const t=await ti(e),n=new DOMParser,r=Nt(t,"CATALOG.XML"),o=n.parseFromString(r,"application/xml");if(o.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const s="http://acerola3d.sourceforge.jp/a3/catalog",c=o.getElementsByTagNameNS(s,"a3");c[0]&&(this.haltActionNo=Number(c[0].getAttribute("haltActionN0")),this.walkActionNo=Number(c[0].getAttribute("walkActionN0")),this.runActionNo=Number(c[0].getAttribute("runActionN0")),this.minWalkSpeed=Number(c[0].getAttribute("minWalkSpeed")),this.minRunSpeed=Number(c[0].getAttribute("minRunSpeed")),this.isBillboard=!!c[0].getAttribute("billboard"));const A=o.getElementsByTagNameNS(s,"c");A[0]&&(this.comment=A[0].textContent);const a=o.getElementsByTagNameNS(s,"tag");Array.from(a).forEach(h=>{const f=h.getAttribute("name");f&&this.tags.push(f)});const d=o.getElementsByTagNameNS(s,"profile");Array.from(d).forEach(h=>{const f=h.getAttribute("uri");f&&this.profiles.push(f)});const u=o.getElementsByTagNameNS(s,"thumbnail");Array.from(u).forEach(h=>{const f=h.getAttribute("src");if(f){const C=sn(t,f);this.thumbnails.push(C)}});const m=o.getElementsByTagNameNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","RDF");m[0]&&(this.rdf=m[0]);const p=o.getElementsByTagNameNS(s,"htmlfile");if(p[0]){const h=p[0].getAttribute("src");h&&(this.htmlfile=Nt(t,h))}const I=o.getElementsByTagNameNS(s,"a"),g={};let l;for(const h of Array.from(I)){const f=h.getAttribute("an");if(f){l||(l=f);let C;const b=h.getAttribute("bvh");if(b&&b!=="none"){const Z=t.zipUrl+"!"+b;Vt[Z]||(Vt[Z]=await Bo(t,b)),C=To(Vt[Z]),C&&C.clip.tracks.forEach(se=>{se.setInterpolation(oe.InterpolateDiscrete)})}else C=new Ln;const y={};C.skeleton.bones.forEach(Z=>{y[Z.name]=Z});const R=h.getAttribute("scale"),x=R?Number(R):1,q=h.getAttribute("offset"),v=new Ae;if(q){const Z=q.split(" ");v.set(Number(Z[0]),Number(Z[1]),Number(Z[2]))}const G=h.getAttribute("rot"),D=new Ae;if(G){const Z=G.split(" ");D.set(Number(Z[0]),Number(Z[1]),Number(Z[2]))}const Q=h.getAttribute("loop")==="true";let F,L;const J={},$=h.getElementsByTagNameNS(s,"p");for(const Z of Array.from($)){const se=Z.getAttribute("name"),de=Z.getAttribute("wrl");if(se&&de){const P=t.zipUrl+"!"+de;if(!mt[P]){const K=await yo(t,de);mt[P]=K.object3D,K.bgTexture&&(F=K.bgTexture),K.fog&&(L=K.fog)}const H=Z.getAttribute("scale");if(H){const K=Number(H);mt[P].scale.set(K,K,K)}const Y=Z.getAttribute("rot");if(Y){const K=Y.split(" ");mt[P].rotation.set(Number(K[0])/180*Math.PI,Number(K[1])/180*Math.PI,Number(K[2])/180*Math.PI,"ZXY")}const V=Z.getAttribute("offset");if(V){const K=V.split(" ");mt[P].position.set(Number(K[0]),Number(K[1]),Number(K[2]))}J[se]=mt[P].clone(!0)}}const j=new oe.Object3D;j.add(C.skeleton.bones[0]),C instanceof Ln||pi(j,J),Object.values(J).forEach(Z=>{j.add(Z)}),j.scale.set(x,x,x),D.scale(Math.PI/180),j.setRotationFromEuler(new oe.Euler(D.x,D.y,D.z,"ZXY")),j.position.add(v),j.traverse(Z=>{Z.userData.a3js={objectA3:this}});let ee,ne=!1,ue=!0;const ie=h.getElementsByTagNameNS(s,"s");if(ie[0]){const Z=ie[0].getAttribute("file"),se=ie[0].getAttribute("type")||"PointSound",de=ie[0].getAttribute("loop")||"false";ne=de==="true";const P=ie[0].getAttribute("gain")||"1.0",H=ie[0].getAttribute("offset")||"0.0 0.0 0.0",Y=ie[0].getAttribute("direction")||"0.0 0.0 1.0";ue=(ie[0].getAttribute("continue")||"true")==="true";const K=H.split(" ").map(O=>Number(O)),ce=new Ae(K[0],K[1],K[2]),Be=Y.split(" ").map(O=>Number(O)),Te=new Ae(Be[0],Be[1],Be[2]),De=se==="PointSound"||se==="ConeSound"?"positional":"audio",qe=se==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(Z){const O=sn(t,Z),X=URL.createObjectURL(O),z={type:De,autoplay:!1,loop:de==="true",volume:Number(P),positional:{directional:qe}};ee=await new at(X,z).ready,ee.setPosition(ce),ee.lookAt(Te),URL.revokeObjectURL(X),j.add(ee.object3D)}}g[f]=new an({root:j,bones:y,skeleton:C.skeleton},new yn(C.clip,f),Q,ee,ne,ue,F,L)}}return l&&this.syncInit(l,g),this}}function pi(i,e){if(Fr(i)){const t=e[i.name];t&&(i.add(t),delete e[i.name])}i.children&&i.children.forEach(t=>{pi(t,e)})}class gi{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new oe.Scene,this.objects=[],on.isInitialized&&(this.physicsWorld=on.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object3D),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.addOneselfToPhysics(this.physicsWorld),e instanceof bt))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof fi&&e.currentAction instanceof an&&(e.currentAction.backgroundTexture&&(this.scene.background=e.currentAction.backgroundTexture,this.scene.environment=e.currentAction.backgroundTexture),e.currentAction.fog&&(this.scene.fog=e.currentAction.fog))}remove(e){this.scene.remove(e.object3D);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}if(e.scene=void 0,this.physicsWorld&&(e.removeOneselfFromPhysics(this.physicsWorld),e instanceof bt))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof bt&&e.currentAction instanceof an&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}removeAll(){[...this.objects].forEach(t=>{this.remove(t)})}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();if(t.forEach(n=>{n.objectA.handleCollision(n.objectB,n.started,n.partOfA,n.partOfB),n.objectB.handleCollision(n.objectA,n.started,n.partOfB,n.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof gn){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new oe.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new oe.BufferAttribute(r,4))}}for(const t of this.objects)t.update(e)}setPhysicsDebugMode(e){e?(this.rapierLines=new oe.LineSegments(new oe.BufferGeometry,new oe.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class mi extends Oe{view;setView(e){this.view=e}lookAt(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof Oe?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuat(s)}lookAtNow(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof Oe?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuatNow(s)}}class Ht{view;setView(e){this.view=e}update(e){}activate(){}deactivate(){}keyDown(e){}keyUp(e){}keyPress(e){}mouseDown(e){}mouseUp(e){}mouseMove(e){}mouseClick(e){}mouseEnter(e){}mouseLeave(e){}mouseWheel(e){}touchStart(e){}touchEnd(e){}touchMove(e){}touchCancel(e){}}class Ei extends Ht{lastMousePosition;dx=0;dy=0;isLeftDown=!1;isRightDown=!1;ctrlKey=!1;deltaY=0;target;constructor(e,t,n){super(),this.lastMousePosition={x:0,y:0},typeof e=="number"?this.target=new Ae(e,t,n):this.target=new Ae(e)}update(e){if(!this.view)return;const t=this.view.camera.getPosition(),n=this.view.camera.getQuat();if(this.isLeftDown&&!this.ctrlKey){const o=Math.sin(-this.dx*.01),s=Math.cos(-this.dx*.01),c=Math.sin(-this.dy*.01),A=Math.cos(-this.dy*.01),a=new Ae(1,0,0).apply(n),d=new Ae(0,1,0).apply(n),u=new Me(a.x*c,a.y*c,a.z*c,A),m=new Me(d.x*o,d.y*o,d.z*o,s),p=new Ae(t);p.sub(this.target),p.apply(u),p.apply(m),p.add(this.target),t.set(p);const I=At(t,this.target,new Ae(0,1,0));I.mul(new Me(0,1,0,0)),n.set(I)}else if(this.isLeftDown){_.v0.set(this.target),_.v0.sub(t);const o=.005*_.v0.length(),s=new Ae(1,0,0).apply(n).scale(-this.dx*o),c=new Ae(0,1,0).apply(n).scale(this.dy*o);t.add(s),t.add(c),this.target.add(s),this.target.add(c)}if(this.deltaY!==0){const r=new Ae(this.target).sub(t);this.deltaY>0?r.scale(.05):this.deltaY<0&&r.scale(-.05),t.add(r)}this.view.camera.setPosition(t),this.view.camera.setQuat(n),this.dx=0,this.dy=0,this.deltaY=0}mouseDown(e){e.button===0?(this.isLeftDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY):e.button===2&&(this.isRightDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY)}mouseMove(e){this.dx+=e.clientX-this.lastMousePosition.x,this.dy+=e.clientY-this.lastMousePosition.y,this.ctrlKey=e.ctrlKey,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}mouseUp(e){e.button===0?this.isLeftDown=!1:e.button===2&&(this.isRightDown=!1)}mouseWheel(e){this.deltaY=e.deltaY}}const vo={speed:.1,angSpeed:.01};class Qo extends Ht{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...vo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new Ae,this._avatarNextQuat=new Me,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar,n=new ze;n.set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(o),this._velY+=-9.8*e*.1,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=.5)),this._avatarNextLoc.add(0,this._velY,0),this._keyLeft&&(_.v0.set(0,this.options.angSpeed,0),this._avatarNextQuat.mul(ht(_.v0,"ZXY",_.q0))),this._keyRight&&(_.v0.set(0,-this.options.angSpeed,0),this._avatarNextQuat.mul(ht(_.v0,"ZXY",_.q0))),t.setPosition(this._avatarNextLoc),t.setQuat(this._avatarNextQuat)}}const ko={speed:5,angSpeed:.3,jumpSpeed:15};class So extends Ht{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...ko,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new Ae,this._avatarNextAngVel=new Ae,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar;new ze().set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(r),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(r),this._keyD&&this._avatarNextVel.sub(o),this._velY+=-9.8*e,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=this.options.jumpSpeed)),this._avatarNextVel.add(0,this._velY,0),this._keyLeft&&this._avatarNextAngVel.add(0,this.options.angSpeed,0),this._keyRight&&this._avatarNextAngVel.add(0,-this.options.angSpeed,0),t.setLinearVelocity(this._avatarNextVel),t.setAngularVelocity(this._avatarNextAngVel)}}class Bn{scene;camera;controller;constructor(e){e.setView(this),this.camera=e,this.camera.setAudioListener(at.listener),this.camera.setPosition(0,0,3),this.scene=new gi,this.scene.scene.add(this.camera.object3D),this.controller=new Ei(0,0,0),this.controller.setView(this),this.controller.activate()}replaceScene(e){this.scene.scene.remove(this.camera.object3D),e.scene.add(this.camera.object3D);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller.deactivate(),this.controller=e,this.controller.setView(this),this.controller.activate()}worldToScreen(e){throw new Error("BaseViewはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("BaseViewはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("BaseViewはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("BaseViewはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("BaseViewはwaitForRender()は実装していません")}}class Qt extends mi{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new oe.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new oe.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new oe.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Or(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new oe.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Ii extends E.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 E.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const Et=new E.Vector3,_n=new E.Matrix4,Dn=new E.Matrix4,Nn=new E.Vector3,Fn=new E.Vector3;class bi{constructor(e={}){const t=this;let n,r,o,s;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(I,g){I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),_n.copy(g.matrixWorldInverse),Dn.multiplyMatrices(g.projectionMatrix,_n),d(I,I,g),this.sortObjects&&p(I)},this.setSize=function(I,g){n=I,r=g,o=n/2,s=r/2,A.style.width=I+"px",A.style.height=g+"px"};function a(I){I.isCSS2DObject&&(I.element.style.display="none");for(let g=0,l=I.children.length;g<l;g++)a(I.children[g])}function d(I,g,l){if(I.visible===!1){a(I);return}if(I.isCSS2DObject){Et.setFromMatrixPosition(I.matrixWorld),Et.applyMatrix4(Dn);const h=Et.z>=-1&&Et.z<=1&&I.layers.test(l.layers)===!0,f=I.element;f.style.display=h===!0?"":"none",h===!0&&(I.onBeforeRender(t,g,l),f.style.transform="translate("+-100*I.center.x+"%,"+-100*I.center.y+"%)translate("+(Et.x*o+o)+"px,"+(-Et.y*s+s)+"px)",f.parentNode!==A&&A.appendChild(f),I.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,I)};c.objects.set(I,C)}for(let h=0,f=I.children.length;h<f;h++)d(I.children[h],g,l)}function u(I,g){return Nn.setFromMatrixPosition(I.matrixWorld),Fn.setFromMatrixPosition(g.matrixWorld),Nn.distanceToSquared(Fn)}function m(I){const g=[];return I.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function p(I){const g=m(I).sort(function(h,f){if(h.renderOrder!==f.renderOrder)return f.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,b=c.objects.get(f).distanceToCameraSquared;return C-b}),l=g.length;for(let h=0,f=g.length;h<f;h++)g[h].element.style.zIndex=l-h}}}function On(i,e){if(e===E.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===E.TriangleFanDrawMode||e===E.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const s=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);i.setIndex(s),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===E.TriangleFanDrawMode)for(let s=1;s<=n;s++)r.push(t.getX(0)),r.push(t.getX(s)),r.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(r.push(t.getX(s)),r.push(t.getX(s+1)),r.push(t.getX(s+2))):(r.push(t.getX(s+2)),r.push(t.getX(s+1)),r.push(t.getX(s)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Ci extends E.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new No(t)}),this.register(function(t){return new Fo(t)}),this.register(function(t){return new zo(t)}),this.register(function(t){return new Vo(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new Mo(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new Do(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new Oo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new Wo(t)}),this.register(function(t){return new Yo(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=E.LoaderUtils.extractUrlBase(e);s=E.LoaderUtils.resolveURL(a,this.path)}else s=E.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new E.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(a){try{o.parse(a,s,function(d){t(d),o.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let o;const s={},c={},A=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===yi){try{s[Se.KHR_BINARY_GLTF]=new Jo(e)}catch(u){r&&r(u);return}o=JSON.parse(s[Se.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new cs(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const u=this.pluginCallbacks[d](a);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[u.name]=u,s[u.name]=!0}if(o.extensionsUsed)for(let d=0;d<o.extensionsUsed.length;++d){const u=o.extensionsUsed[d],m=o.extensionsRequired||[];switch(u){case Se.KHR_MATERIALS_UNLIT:s[u]=new _o;break;case Se.KHR_DRACO_MESH_COMPRESSION:s[u]=new Xo(o,this.dracoLoader);break;case Se.KHR_TEXTURE_TRANSFORM:s[u]=new Zo;break;case Se.KHR_MESH_QUANTIZATION:s[u]=new $o;break;default:m.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function xo(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Se={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_DISPERSION:"KHR_materials_dispersion",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_MATERIALS_BUMP:"EXT_materials_bump",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 Lo{constructor(e){this.parser=e,this.name=Se.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 o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const d=new E.Color(16777215);A.color!==void 0&&d.setRGB(A.color[0],A.color[1],A.color[2],E.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new E.DirectionalLight(d),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new E.PointLight(d),a.distance=u;break;case"spot":a=new E.SpotLight(d),a.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,a.angle=A.spot.outerConeAngle,a.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return a.position.set(0,0,0),rt(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class _o{constructor(){this.name=Se.KHR_MATERIALS_UNLIT}getMaterialType(){return E.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new E.Color(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const s=o.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],E.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,E.SRGBColorSpace))}return Promise.all(r)}}class Do{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class No{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const c=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new E.Vector2(c,c)}return Promise.all(o)}}class Fo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class Oo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(o)}}class Mo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new E.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,E.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Po{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(o)}}class Go{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const c=s.attenuationColor||[1,1,1];return t.attenuationColor=new E.Color().setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace),Promise.all(o)}}class Uo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class jo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const c=s.specularColorFactor||[1,1,1];return t.specularColor=new E.Color().setRGB(c[0],c[1],c[2],E.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,E.SRGBColorSpace)),Promise.all(o)}}class Ho{constructor(e){this.parser=e,this.name=Se.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(o)}}class qo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:E.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(o)}}class zo{constructor(e){this.parser=e,this.name=Se.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 o=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,o.source,s)}}class Vo{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class Ko{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class Wo{constructor(e){this.name=Se.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 r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.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 o.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,d=r.count,u=r.byteStride,m=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(d,u,m,r.mode,r.filter).then(function(p){return p.buffer}):s.ready.then(function(){const p=new ArrayBuffer(d*u);return s.decodeGltfBuffer(new Uint8Array(p),d,u,m,r.mode,r.filter),p})})}else return null}}class Yo{constructor(e){this.name=Se.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]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==$e.TRIANGLES&&a.mode!==$e.TRIANGLE_STRIP&&a.mode!==$e.TRIANGLE_FAN&&a.mode!==void 0)return null;const s=n.extensions[this.name].attributes,c=[],A={};for(const a in s)c.push(this.parser.getDependency("accessor",s[a]).then(d=>(A[a]=d,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const d=a.pop(),u=d.isGroup?d.children:[d],m=a[0].count,p=[];for(const I of u){const g=new E.Matrix4,l=new E.Vector3,h=new E.Quaternion,f=new E.Vector3(1,1,1),C=new E.InstancedMesh(I.geometry,I.material,m);for(let b=0;b<m;b++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,b),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,b),A.SCALE&&f.fromBufferAttribute(A.SCALE,b),C.setMatrixAt(b,g.compose(l,h,f));for(const b in A)if(b==="_COLOR_0"){const y=A[b];C.instanceColor=new E.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else b!=="TRANSLATION"&&b!=="ROTATION"&&b!=="SCALE"&&I.geometry.setAttribute(b,A[b]);E.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),p.push(C)}return d.isGroup?(d.clear(),d.add(...p),d):p[0]}))}}const yi="glTF",Bt=12,Mn={JSON:1313821514,BIN:5130562};class Jo{constructor(e){this.name=Se.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Bt),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==yi)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-Bt,o=new DataView(e,Bt);let s=0;for(;s<r;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===Mn.JSON){const a=new Uint8Array(e,Bt+s,c);this.content=n.decode(a)}else if(A===Mn.BIN){const a=Bt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Xo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Se.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const d in s){const u=An[d]||d.toLowerCase();c[u]=s[d]}for(const d in e.attributes){const u=An[d]||d.toLowerCase();if(s[d]!==void 0){const m=n.accessors[e.attributes[d]],p=Ct[m.componentType];a[u]=p.name,A[u]=m.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(u,m){r.decodeDracoFile(d,function(p){for(const I in p.attributes){const g=p.attributes[I],l=A[I];l!==void 0&&(g.normalized=l)}u(p)},c,a,E.LinearSRGBColorSpace,m)})})}}class Zo{constructor(){this.name=Se.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class $o{constructor(){this.name=Se.KHR_MESH_QUANTIZATION}}class Bi extends E.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,d=r-t,u=(n-t)/d,m=u*u,p=m*u,I=e*a,g=I-a,l=-2*p+3*m,h=p-m,f=1-l,C=h-m+u;for(let b=0;b!==c;b++){const y=s[g+b+c],R=s[g+b+A]*d,x=s[I+b+c],q=s[I+b]*d;o[b]=f*y+C*R+l*x+h*q}return o}}const es=new E.Quaternion;class ts extends Bi{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return es.fromArray(o).normalize().toArray(o),o}}const $e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Ct={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Pn={9728:E.NearestFilter,9729:E.LinearFilter,9984:E.NearestMipmapNearestFilter,9985:E.LinearMipmapNearestFilter,9986:E.NearestMipmapLinearFilter,9987:E.LinearMipmapLinearFilter},Gn={33071:E.ClampToEdgeWrapping,33648:E.MirroredRepeatWrapping,10497:E.RepeatWrapping},Kt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},An={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ut={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ns={CUBICSPLINE:void 0,LINEAR:E.InterpolateLinear,STEP:E.InterpolateDiscrete},Wt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function is(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new E.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:E.FrontSide})),i.DefaultMaterial}function dt(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function rt(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function rs(i,e,t){let n=!1,r=!1,o=!1;for(let a=0,d=e.length;a<d;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const s=[],c=[],A=[];for(let a=0,d=e.length;a<d;a++){const u=e[a];if(n){const m=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(m)}if(r){const m=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(m)}if(o){const m=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(m)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const d=a[0],u=a[1],m=a[2];return n&&(i.morphAttributes.position=d),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=m),i.morphTargetsRelative=!0,i})}function os(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ss(i){let e;const t=i.extensions&&i.extensions[Se.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Yt(t.attributes):e=i.indices+":"+Yt(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+Yt(i.targets[n]);return e}function Yt(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function cn(i){switch(i){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.")}}function as(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const As=new E.Matrix4;class cs{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new xo,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,o=!1,s=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,o=c.indexOf("Firefox")>-1,s=o?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||o&&s<98?this.textureLoader=new E.TextureLoader(this.options.manager):this.textureLoader=new E.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new E.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const c={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:n,userData:{}};return dt(o,c,r),rt(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const s=t[r].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(n[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(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(),o=(s,c)=>{const A=this.associations.get(s);A!=null&&this.associations.set(c,A);for(const[a,d]of s.children.entries())o(d,c.children[a])};return o(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 o=e(t[r]);o&&n.push(o)}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(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,s){return n.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Se.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,s){n.load(E.LoaderUtils.resolveURL(t.uri,r.path),o,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(n){const r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=Kt[r.type],c=Ct[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new E.BufferAttribute(a,s,A))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Kt[r.type],a=Ct[r.componentType],d=a.BYTES_PER_ELEMENT,u=d*A,m=r.byteOffset||0,p=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,I=r.normalized===!0;let g,l;if(p&&p!==u){const h=Math.floor(m/p),f="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+h+":"+r.count;let C=t.cache.get(f);C||(g=new a(c,h*p,r.count*p/d),C=new E.InterleavedBuffer(g,p/d),t.cache.add(f,C)),l=new E.InterleavedBufferAttribute(C,A,m%p/d,I)}else c===null?g=new a(r.count*A):g=new a(c,m,r.count*A),l=new E.BufferAttribute(g,A,I);if(r.sparse!==void 0){const h=Kt.SCALAR,f=Ct[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,b=r.sparse.values.byteOffset||0,y=new f(s[1],C,r.sparse.count*h),R=new a(s[2],b,r.sparse.count*A);c!==null&&(l=new E.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let x=0,q=y.length;x<q;x++){const v=y[x];if(l.setX(v,R[x*A]),A>=2&&l.setY(v,R[x*A+1]),A>=3&&l.setZ(v,R[x*A+2]),A>=4&&l.setW(v,R[x*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=I}return l})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let c=this.textureLoader;if(s.uri){const A=n.manager.getHandler(s.uri);A!==null&&(c=A)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,s=o.textures[e],c=o.images[t],A=(c.uri||c.bufferView)+":"+s.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=s.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const m=(o.samplers||{})[s.sampler]||{};return d.magFilter=Pn[m.magFilter]||E.LinearFilter,d.minFilter=Pn[m.minFilter]||E.LinearMipmapLinearFilter,d.wrapS=Gn[m.wrapS]||E.RepeatWrapping,d.wrapT=Gn[m.wrapT]||E.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==E.NearestFilter&&d.minFilter!==E.LinearFilter,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=r.images[e],c=self.URL||self.webkitURL;let A=s.uri||"",a=!1;if(s.bufferView!==void 0)A=n.getDependency("bufferView",s.bufferView).then(function(u){a=!0;const m=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(m),A});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(A).then(function(u){return new Promise(function(m,p){let I=m;t.isImageBitmapLoader===!0&&(I=function(g){const l=new E.Texture(g);l.needsUpdate=!0,m(l)}),t.load(E.LoaderUtils.resolveURL(u,o.path),I,void 0,p)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),rt(u,s),u.userData.mimeType=s.mimeType||as(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=d,d}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[Se.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Se.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[Se.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return r!==void 0&&(s.colorSpace=r),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new E.PointsMaterial,E.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,A.sizeAttenuation=!1,this.cache.add(c,A)),n=A}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new E.LineBasicMaterial,E.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(r||o||s){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),s&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),o&&(A.vertexColors=!0),s&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return E.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[Se.KHR_MATERIALS_UNLIT]){const u=r[Se.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new E.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const m=u.baseColorFactor;c.color.setRGB(m[0],m[1],m[2],E.LinearSRGBColorSpace),c.opacity=m[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,E.SRGBColorSpace)),c.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,c.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(a.push(t.assignTexture(c,"metalnessMap",u.metallicRoughnessTexture)),a.push(t.assignTexture(c,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=E.DoubleSide);const d=o.alphaMode||Wt.OPAQUE;if(d===Wt.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===Wt.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==E.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new E.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==E.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==E.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new E.Color().setRGB(u[0],u[1],u[2],E.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==E.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,E.SRGBColorSpace)),Promise.all(a).then(function(){const u=new s(c);return o.name&&(u.name=o.name),rt(u,o),t.associations.set(u,{materials:e}),o.extensions&&dt(r,u,o),u})}createUniqueName(e){const t=E.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 o(c){return n[Se.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return Un(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],d=ss(a),u=r[d];if(u)s.push(u.promise);else{let m;a.extensions&&a.extensions[Se.KHR_DRACO_MESH_COMPRESSION]?m=o(a):m=Un(new E.BufferGeometry,a,t),r[d]={primitive:a,promise:m},s.push(m)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],s=o.primitives,c=[];for(let A=0,a=s.length;A<a;A++){const d=s[A].material===void 0?is(this.cache):this.getDependency("material",s[A].material);c.push(d)}return c.push(t.loadGeometries(s)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),d=A[A.length-1],u=[];for(let p=0,I=d.length;p<I;p++){const g=d[p],l=s[p];let h;const f=a[p];if(l.mode===$e.TRIANGLES||l.mode===$e.TRIANGLE_STRIP||l.mode===$e.TRIANGLE_FAN||l.mode===void 0)h=o.isSkinnedMesh===!0?new E.SkinnedMesh(g,f):new E.Mesh(g,f),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===$e.TRIANGLE_STRIP?h.geometry=On(h.geometry,E.TriangleStripDrawMode):l.mode===$e.TRIANGLE_FAN&&(h.geometry=On(h.geometry,E.TriangleFanDrawMode));else if(l.mode===$e.LINES)h=new E.LineSegments(g,f);else if(l.mode===$e.LINE_STRIP)h=new E.Line(g,f);else if(l.mode===$e.LINE_LOOP)h=new E.LineLoop(g,f);else if(l.mode===$e.POINTS)h=new E.Points(g,f);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&os(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),rt(h,o),l.extensions&&dt(r,h,l),t.assignFinalMaterial(h),u.push(h)}for(let p=0,I=u.length;p<I;p++)t.associations.set(u[p],{meshes:e,primitives:p});if(u.length===1)return o.extensions&&dt(r,u[0],o),u[0];const m=new E.Group;o.extensions&&dt(r,m,o),t.associations.set(m,{meshes:e});for(let p=0,I=u.length;p<I;p++)m.add(u[p]);return m})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new E.PerspectiveCamera(E.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new E.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),rt(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),s=r,c=[],A=[];for(let a=0,d=s.length;a<d;a++){const u=s[a];if(u){c.push(u);const m=new E.Matrix4;o!==null&&m.fromArray(o.array,a*16),A.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new E.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,s=[],c=[],A=[],a=[],d=[];for(let u=0,m=r.channels.length;u<m;u++){const p=r.channels[u],I=r.samplers[p.sampler],g=p.target,l=g.node,h=r.parameters!==void 0?r.parameters[I.input]:I.input,f=r.parameters!==void 0?r.parameters[I.output]:I.output;g.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",f)),a.push(I),d.push(g))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(d)]).then(function(u){const m=u[0],p=u[1],I=u[2],g=u[3],l=u[4],h=[];for(let C=0,b=m.length;C<b;C++){const y=m[C],R=p[C],x=I[C],q=g[C],v=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const G=n._createAnimationTracks(y,R,x,q,v);if(G)for(let D=0;D<G.length;D++)h.push(G[D])}const f=new E.AnimationClip(o,void 0,h);return rt(f,r),f})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),s})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=r.children||[];for(let a=0,d=c.length;a<d;a++)s.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const d=a[0],u=a[1],m=a[2];m!==null&&d.traverse(function(p){p.isSkinnedMesh&&p.bind(m,As)});for(let p=0,I=u.length;p<I;p++)d.add(u[p]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?r.createUniqueName(o.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(a){return r._getNodeRef(r.cameraCache,o.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let d;if(o.isBone===!0?d=new E.Bone:a.length>1?d=new E.Group:a.length===1?d=a[0]:d=new E.Object3D,d!==a[0])for(let u=0,m=a.length;u<m;u++)d.add(a[u]);if(o.name&&(d.userData.name=o.name,d.name=s),rt(d,o),o.extensions&&dt(n,d,o),o.matrix!==void 0){const u=new E.Matrix4;u.fromArray(o.matrix),d.applyMatrix4(u)}else o.translation!==void 0&&d.position.fromArray(o.translation),o.rotation!==void 0&&d.quaternion.fromArray(o.rotation),o.scale!==void 0&&d.scale.fromArray(o.scale);if(!r.associations.has(d))r.associations.set(d,{});else if(o.mesh!==void 0&&r.meshCache.refs[o.mesh]>1){const u=r.associations.get(d);r.associations.set(d,{...u})}return r.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new E.Group;n.name&&(o.name=r.createUniqueName(n.name)),rt(o,n),n.extensions&&dt(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(r.getDependency("node",s[A]));return Promise.all(c).then(function(A){for(let d=0,u=A.length;d<u;d++)o.add(A[d]);const a=d=>{const u=new Map;for(const[m,p]of r.associations)(m instanceof E.Material||m instanceof E.Texture)&&u.set(m,p);return d.traverse(m=>{const p=r.associations.get(m);p!=null&&u.set(m,p)}),u};return r.associations=a(o),o})}_createAnimationTracks(e,t,n,r,o){const s=[],c=e.name?e.name:e.uuid,A=[];ut[o.path]===ut.weights?e.traverse(function(m){m.morphTargetInfluences&&A.push(m.name?m.name:m.uuid)}):A.push(c);let a;switch(ut[o.path]){case ut.weights:a=E.NumberKeyframeTrack;break;case ut.rotation:a=E.QuaternionKeyframeTrack;break;case ut.translation:case ut.scale:a=E.VectorKeyframeTrack;break;default:n.itemSize===1?a=E.NumberKeyframeTrack:a=E.VectorKeyframeTrack;break}const d=r.interpolation!==void 0?ns[r.interpolation]:E.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let m=0,p=A.length;m<p;m++){const I=new a(A[m]+"."+ut[o.path],t.array,u,d);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),s.push(I)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=cn(t.constructor),r=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof E.QuaternionKeyframeTrack?ts:Bi;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ls(i,e,t){const n=e.attributes,r=new E.Box3;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(r.set(new E.Vector3(A[0],A[1],A[2]),new E.Vector3(a[0],a[1],a[2])),c.normalized){const d=cn(Ct[c.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new E.Vector3,A=new E.Vector3;for(let a=0,d=o.length;a<d;a++){const u=o[a];if(u.POSITION!==void 0){const m=t.json.accessors[u.POSITION],p=m.min,I=m.max;if(p!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(I[2]))),m.normalized){const g=cn(Ct[m.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new E.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function Un(i,e,t){const n=e.attributes,r=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){i.setAttribute(c,A)})}for(const s in n){const c=An[s]||s.toLowerCase();c in i.attributes||r.push(o(n[s],c))}if(e.indices!==void 0&&!i.index){const s=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(s)}return E.ColorManagement.workingColorSpace!==E.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${E.ColorManagement.workingColorSpace}" not supported.`),rt(i,e),ls(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?rs(i,e.targets,t):i})}const Jt=new WeakMap;class us extends E.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 o=new E.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,E.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=E.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:o};return this.decodeGeometry(e,c).then(t).catch(s)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Jt.has(e)){const A=Jt.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(r=A,new Promise((a,d)=>{r._callbacks[o]={resolve:a,reject:d},r.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&o&&this._releaseTask(r,o)}),Jt.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new E.BufferGeometry;e.index&&t.setIndex(new E.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:r,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new E.BufferAttribute(o,s);else{const d=new E.InterleavedBuffer(o,c);a=new E.InterleavedBufferAttribute(d,s,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==E.SRGBColorSpace)return;const n=new E.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),E.ColorManagement.colorSpaceToWorking(n,E.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new E.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,o)=>{n.load(e,r,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",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(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=hs.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
141
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(o){const s=o.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,o){return r._taskLoad>o._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.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function hs(){let i,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(d){i.onModuleLoaded=function(u){d({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(d=>{const u=d.draco,m=new u.Decoder;try{const p=t(u,m,new Int8Array(A),a),I=p.attributes.map(g=>g.array.buffer);p.index&&I.push(p.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:p},I)}catch(p){console.error(p),self.postMessage({type:"error",id:c.id,error:p.message})}finally{u.destroy(m)}});break}};function t(s,c,A,a){const d=a.attributeIDs,u=a.attributeTypes;let m,p;const I=c.GetEncodedGeometryType(A);if(I===s.TRIANGULAR_MESH)m=new s.Mesh,p=c.DecodeArrayToMesh(A,A.byteLength,m);else if(I===s.POINT_CLOUD)m=new s.PointCloud,p=c.DecodeArrayToPointCloud(A,A.byteLength,m);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||m.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const g={index:null,attributes:[]};for(const l in d){const h=self[u[l]];let f,C;if(a.useUniqueIDs)C=d[l],f=c.GetAttributeByUniqueId(m,C);else{if(C=c.GetAttributeId(m,s[d[l]]),C===-1)continue;f=c.GetAttribute(m,C)}const b=r(s,c,m,l,h,f);l==="color"&&(b.vertexColorSpace=a.vertexColorSpace),g.attributes.push(b)}return I===s.TRIANGULAR_MESH&&(g.index=n(s,c,m)),s.destroy(m),g}function n(s,c,A){const d=A.num_faces()*3,u=d*4,m=s._malloc(u);c.GetTrianglesUInt32Array(A,u,m);const p=new Uint32Array(s.HEAPF32.buffer,m,d).slice();return s._free(m),{array:p,itemSize:1}}function r(s,c,A,a,d,u){const m=A.num_points(),p=u.num_components(),I=o(s,d),g=p*d.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,h=l/d.BYTES_PER_ELEMENT,f=m*g,C=m*l,b=s._malloc(f);c.GetAttributeDataArrayForAllPoints(A,u,I,f,b);const y=new d(s.HEAPF32.buffer,b,f/d.BYTES_PER_ELEMENT);let R;if(g===l)R=y.slice();else{R=new d(C/d.BYTES_PER_ELEMENT);let x=0;for(let q=0,v=y.length;q<v;q++){for(let G=0;G<p;G++)R[x+G]=y[q*p+G];x+=h}}return s._free(b),{name:a,count:m,itemSize:p,array:R,stride:h}}function o(s,c){switch(c){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}class ds{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_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:r,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,s)}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();r!==-1?(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}}const fs=0,jn=2,ps=1,Hn=2,gs=0,ms=1,Es=10,Is=0,Ti=9,wi=15,Ri=16,vi=22,Qi=37,ki=43,Si=76,xi=83,Li=97,_i=100,Di=103,Ni=109,Fi=122,Oi=123,Mi=131,Pi=132,Gi=133,Ui=134,ji=137,Hi=138,qi=139,zi=140,Vi=141,Ki=142,Wi=145,Yi=146,Ji=148,Xi=152,ln=153,bs=154,un=155,Cs=156,Zi=157,$i=158,er=165,tr=166,nr=1000054e3,ir=1000054001,rr=1000054004,or=1000054005,Tn=1000066e3,sr=1000066004;class Tt{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)+4294967296*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=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 Ye=[171,75,84,88,32,50,48,187,13,10,26,10];function qn(i){return new TextDecoder().decode(i)}function ys(i){const e=new Uint8Array(i.buffer,i.byteOffset,Ye.length);if(e[0]!==Ye[0]||e[1]!==Ye[1]||e[2]!==Ye[2]||e[3]!==Ye[3]||e[4]!==Ye[4]||e[5]!==Ye[5]||e[6]!==Ye[6]||e[7]!==Ye[7]||e[8]!==Ye[8]||e[9]!==Ye[9]||e[10]!==Ye[10]||e[11]!==Ye[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType: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:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new Tt(i,Ye.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const o=r._nextUint32(),s=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),d=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,m=new Tt(i,Ye.length+n,u,!0);for(let ie=0,Z=Math.max(t.levelCount,1);ie<Z;ie++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+m._nextUint64(),m._nextUint64()),uncompressedByteLength:m._nextUint64()});const p=new Tt(i,o,s,!0);p._skip(4);const I=p._nextUint16(),g=p._nextUint16(),l=p._nextUint16(),h=p._nextUint16(),f={vendorId:I,descriptorType:g,versionNumber:l,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:[]},C=(h/4-6)/4;for(let ie=0;ie<C;ie++){const Z={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&Z.channelType?(Z.sampleLower=p._nextInt32(),Z.sampleUpper=p._nextInt32()):(Z.sampleLower=p._nextUint32(),Z.sampleUpper=p._nextUint32()),f.samples[ie]=Z}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(f);const b=new Tt(i,c,A,!0);for(;b._offset<A;){const ie=b._nextUint32(),Z=b._scan(ie),se=qn(Z);if(t.keyValue[se]=b._nextUint8Array(ie-Z.byteLength-1),se.match(/^ktx/i)){const de=qn(t.keyValue[se]);t.keyValue[se]=de.substring(0,de.lastIndexOf("\0"))}b._skip(ie%4?4-ie%4:0)}if(d<=0)return t;const y=new Tt(i,a,d,!0),R=y._nextUint16(),x=y._nextUint16(),q=y._nextUint32(),v=y._nextUint32(),G=y._nextUint32(),D=y._nextUint32(),Q=[];for(let ie=0,Z=Math.max(t.levelCount,1);ie<Z;ie++)Q.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const F=a+y._offset,L=F+q,J=L+v,$=J+G,j=new Uint8Array(i.buffer,i.byteOffset+F,q),ee=new Uint8Array(i.buffer,i.byteOffset+L,v),ne=new Uint8Array(i.buffer,i.byteOffset+J,G),ue=new Uint8Array(i.buffer,i.byteOffset+$,D);return t.globalData={endpointCount:R,selectorCount:x,imageDescs:Q,endpointsData:j,selectorsData:ee,tablesData:ne,extendedData:ue},t}let Xt,st,hn;const Zt={env:{emscripten_notify_memory_growth:function(i){hn=new Uint8Array(st.exports.memory.buffer)}}};class Bs{init(){return Xt||(Xt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+zn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Zt)).then(this._init):WebAssembly.instantiate(Buffer.from(zn,"base64"),Zt).then(this._init),Xt)}_init(e){st=e.instance,Zt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=st.exports.malloc(n);hn.set(e,r),t=t||Number(st.exports.ZSTD_findDecompressedSize(r,n));const o=st.exports.malloc(t),s=st.exports.ZSTD_decompress(o,t,r,n),c=hn.slice(o,o+s);return st.exports.free(r),st.exports.free(o),c}}const zn="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZAC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gACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAF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JDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiD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AAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEG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DwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gAC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AYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Ts="display-p3",ws="display-p3-linear";({...E.ColorManagement.spaces[E.SRGBColorSpace]});const $t=new WeakMap;let en=0,tn;class et extends E.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ds,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&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}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),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")},typeof navigator<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new E.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new E.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(([o,s])=>{const c=et.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(et.EngineFormat),"let _EngineType = "+JSON.stringify(et.EngineType),"let _TranscoderFormat = "+JSON.stringify(et.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(et.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
142
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=s,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),a})}),en>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),en++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new E.FileLoader(this.manager);o.setPath(this.path),o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setRequestHeader(this.requestHeader),o.setResponseType("arraybuffer"),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if($t.has(e))return $t.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:d}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new E.CompressedCubeTexture(o,A,a);else{const m=o[0].mipmaps;u=t.layerCount>1?new E.CompressedArrayTexture(m,s,c,t.layerCount,A,a):new E.CompressedTexture(m,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?E.LinearFilter:E.LinearMipmapLinearFilter,u.magFilter=E.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=ar(t),u.premultiplyAlpha=!!(d&ps),u}async _createTexture(e,t={}){const n=ys(new Uint8Array(e)),r=n.vkFormat===Tn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===Is||r&&!this.workerConfig.astcHDRSupported))return vs(n);const s=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:s},[e])).then(A=>this._createTextureFrom(A.data,n));return $t.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),en--}}et.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};et.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,BC6H:22,RGB_HALF:24,RGBA_HALF:25};et.EngineFormat={RGBAFormat:E.RGBAFormat,RGBA_ASTC_4x4_Format:E.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:E.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:E.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:E.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:E.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:E.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:E.RGB_ETC1_Format,RGB_ETC2_Format:E.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:E.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:E.RGBA_S3TC_DXT1_Format};et.EngineType={UnsignedByteType:E.UnsignedByteType,HalfFloatType:E.HalfFloatType,FloatType:E.FloatType};et.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(I){const g=I.data;switch(g.type){case"init":i=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:f,height:C,hasAlpha:b,format:y,type:R,dfdFlags:x}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:f,height:C,hasAlpha:b,format:y,type:R,dfdFlags:x}},h)}catch(l){console.error(l),self.postMessage({type:"error",id:g.id,error:l.message})}});break}});function c(I){e=new Promise(g=>{t={wasmBinary:I,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const g=new t.KTX2File(new Uint8Array(I));function l(){g.close(),g.delete()}if(!g.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let h;if(g.isUASTC())h=s.UASTC;else if(g.isETC1S())h=s.ETC1S;else if(g.isHDR())h=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const f=g.getWidth(),C=g.getHeight(),b=g.getLayers()||1,y=g.getLevels(),R=g.getFaces(),x=g.getHasAlpha(),q=g.getDFDFlags(),{transcoderFormat:v,engineFormat:G,engineType:D}=u(h,f,C,x);if(!f||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const Q=[],F=[];for(let L=0;L<R;L++){const J=[];for(let $=0;$<y;$++){const j=[];let ee,ne;for(let ie=0;ie<b;ie++){const Z=g.getImageLevelInfo($,ie,L);L===0&&$===0&&ie===0&&(Z.origWidth%4!==0||Z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?(ee=Z.origWidth,ne=Z.origHeight):(ee=Z.width,ne=Z.height);let se=new Uint8Array(g.getImageTranscodedSizeInBytes($,ie,0,v));const de=g.transcodeImage(se,$,ie,L,v,0,-1,-1);if(D===r.HalfFloatType&&(se=new Uint16Array(se.buffer,se.byteOffset,se.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");j.push(se)}const ue=p(j);J.push({data:ue,width:ee,height:ne}),F.push(ue.buffer)}Q.push({mipmaps:J,width:f,height:C,format:G,type:D})}return l(),{faces:Q,buffers:F,width:f,height:C,hasAlpha:x,dfdFlags:q,format:G,type:D}}const a=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[o.ASTC_4x4,o.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC7_M5,o.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC1,o.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1,o.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.PVRTC1_4_RGB,o.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],d={[s.ETC1S]:a.filter(I=>I.basisFormat.includes(s.ETC1S)).sort((I,g)=>I.priorityETC1S-g.priorityETC1S),[s.UASTC]:a.filter(I=>I.basisFormat.includes(s.UASTC)).sort((I,g)=>I.priorityUASTC-g.priorityUASTC),[s.UASTC_HDR]:a.filter(I=>I.basisFormat.includes(s.UASTC_HDR)).sort((I,g)=>I.priorityHDR-g.priorityHDR)};function u(I,g,l,h){const f=d[I];for(let C=0;C<f.length;C++){const b=f[C];if(b.if&&!i[b.if]||!b.basisFormat.includes(I)||h&&b.transcoderFormat.length<2||b.needsPowerOfTwo&&!(m(g)&&m(l)))continue;const y=b.transcoderFormat[h?1:0],R=b.engineFormat[h?1:0],x=b.engineType[0];return{transcoderFormat:y,engineFormat:R,engineType:x}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function m(I){return I<=2?!0:(I&I-1)===0&&I!==0}function p(I){if(I.length===1)return I[0];let g=0;for(let f=0;f<I.length;f++){const C=I[f];g+=C.byteLength}const l=new Uint8Array(g);let h=0;for(let f=0;f<I.length;f++){const C=I[f];l.set(C,h),h+=C.byteLength}return l}};const Rs=new Set([E.RGBAFormat,E.RGBFormat,E.RGFormat,E.RedFormat]),nn={[Ni]:E.RGBAFormat,[Di]:E.RGFormat,[_i]:E.RedFormat,[Li]:E.RGBAFormat,[xi]:E.RGFormat,[Si]:E.RedFormat,[ki]:E.RGBAFormat,[Qi]:E.RGBAFormat,[vi]:E.RGFormat,[Ri]:E.RGFormat,[wi]:E.RedFormat,[Ti]:E.RedFormat,[Oi]:E.RGBFormat,[Fi]:E.RGBFormat,[Xi]:E.RGBA_ETC2_EAC_Format,[Ji]:E.RGB_ETC2_Format,[ln]:E.R11_EAC_Format,[bs]:E.SIGNED_R11_EAC_Format,[un]:E.RG11_EAC_Format,[Cs]:E.SIGNED_RG11_EAC_Format,[Tn]:E.RGBA_ASTC_4x4_Format,[$i]:E.RGBA_ASTC_4x4_Format,[Zi]:E.RGBA_ASTC_4x4_Format,[sr]:E.RGBA_ASTC_6x6_Format,[tr]:E.RGBA_ASTC_6x6_Format,[er]:E.RGBA_ASTC_6x6_Format,[Ui]:E.RGBA_S3TC_DXT1_Format,[Gi]:E.RGBA_S3TC_DXT1_Format,[Pi]:E.RGB_S3TC_DXT1_Format,[Mi]:E.RGB_S3TC_DXT1_Format,[Hi]:E.RGBA_S3TC_DXT3_Format,[ji]:E.RGBA_S3TC_DXT3_Format,[zi]:E.SIGNED_RED_RGTC1_Format,[qi]:E.RED_RGTC1_Format,[Ki]:E.SIGNED_RED_GREEN_RGTC2_Format,[Vi]:E.RED_GREEN_RGTC2_Format,[Yi]:E.RGBA_BPTC_Format,[Wi]:E.RGBA_BPTC_Format,[or]:E.RGBA_PVRTC_4BPPV1_Format,[ir]:E.RGBA_PVRTC_4BPPV1_Format,[rr]:E.RGBA_PVRTC_2BPPV1_Format,[nr]:E.RGBA_PVRTC_2BPPV1_Format},It={[Ni]:E.FloatType,[Di]:E.FloatType,[_i]:E.FloatType,[Li]:E.HalfFloatType,[xi]:E.HalfFloatType,[Si]:E.HalfFloatType,[ki]:E.UnsignedByteType,[Qi]:E.UnsignedByteType,[vi]:E.UnsignedByteType,[Ri]:E.UnsignedByteType,[wi]:E.UnsignedByteType,[Ti]:E.UnsignedByteType,[Oi]:E.UnsignedInt5999Type,[Fi]:E.UnsignedInt101111Type,[Xi]:E.UnsignedByteType,[Ji]:E.UnsignedByteType,[ln]:E.UnsignedByteType,[ln]:E.UnsignedByteType,[un]:E.UnsignedByteType,[un]:E.UnsignedByteType,[Tn]:E.HalfFloatType,[$i]:E.UnsignedByteType,[Zi]:E.UnsignedByteType,[sr]:E.HalfFloatType,[tr]:E.UnsignedByteType,[er]:E.UnsignedByteType,[Ui]:E.UnsignedByteType,[Gi]:E.UnsignedByteType,[Pi]:E.UnsignedByteType,[Mi]:E.UnsignedByteType,[Hi]:E.UnsignedByteType,[ji]:E.UnsignedByteType,[zi]:E.UnsignedByteType,[qi]:E.UnsignedByteType,[Ki]:E.UnsignedByteType,[Vi]:E.UnsignedByteType,[Yi]:E.UnsignedByteType,[Wi]:E.UnsignedByteType,[or]:E.UnsignedByteType,[ir]:E.UnsignedByteType,[rr]:E.UnsignedByteType,[nr]:E.UnsignedByteType};async function vs(i){const{vkFormat:e}=i;if(nn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);It[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===jn&&(tn||(tn=new Promise(async s=>{const c=new Bs;await c.init(),s(c)})),t=await tn);const n=[];for(let s=0;s<i.levels.length;s++){const c=Math.max(1,i.pixelWidth>>s),A=Math.max(1,i.pixelHeight>>s),a=i.pixelDepth?Math.max(1,i.pixelDepth>>s):0,d=i.levels[s];let u;if(i.supercompressionScheme===fs)u=d.levelData;else if(i.supercompressionScheme===jn)u=t.decode(d.levelData,d.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let m;It[e]===E.FloatType?m=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):It[e]===E.HalfFloatType?m=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):It[e]===E.UnsignedInt5999Type||It[e]===E.UnsignedInt101111Type?m=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):m=u,n.push({data:m,width:c,height:A,depth:a})}const r=i.levelCount===0||n.length>1;let o;if(Rs.has(nn[e]))o=i.pixelDepth===0?new E.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new E.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?E.NearestMipmapNearestFilter:E.NearestFilter,o.magFilter=E.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new E.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?E.LinearMipmapLinearFilter:E.LinearFilter,o.magFilter=E.LinearFilter}return o.mipmaps=n,o.type=It[e],o.format=nn[e],o.colorSpace=ar(i),o.needsUpdate=!0,Promise.resolve(o)}function ar(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===ms?e.transferFunction===Hn?E.SRGBColorSpace:E.LinearSRGBColorSpace:e.colorPrimaries===Es?e.transferFunction===Hn?Ts:ws:(e.colorPrimaries===gs||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),E.NoColorSpace)}var Ar=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbf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mbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=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]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),o,s=WebAssembly.instantiate(r,{}).then(function(h){o=h.instance,o.exports.__wasm_call_ctors()});function c(h){for(var f=new Uint8Array(h.length),C=0;C<h.length;++C){var b=h.charCodeAt(C);f[C]=b>96?b-97:b>64?b-39:b+4}for(var y=0,C=0;C<h.length;++C)f[y++]=f[C]<60?n[f[C]]:(f[C]-60)*64+f[++C];return f.buffer.slice(0,y)}function A(h,f,C,b,y,R,x){var q=h.exports.sbrk,v=b+3&-4,G=q(v*y),D=q(R.length),Q=new Uint8Array(h.exports.memory.buffer);Q.set(R,D);var F=f(G,b,y,D,R.length);if(F==0&&x&&x(G,v,y),C.set(Q.subarray(G,G+b*y)),q(G-q(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],m=0;function p(h){var f={object:new Worker(h),pending:0,requests:{}};return f.object.onmessage=function(C){var b=C.data;f.pending-=b.count,f.requests[b.id][b.action](b.value),delete f.requests[b.id]},f}function I(h){for(var f="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([f],{type:"text/javascript"}),b=URL.createObjectURL(C),y=u.length;y<h;++y)u[y]=p(b);for(var y=h;y<u.length;++y)u[y].object.postMessage({});u.length=h,URL.revokeObjectURL(b)}function g(h,f,C,b,y){for(var R=u[0],x=1;x<u.length;++x)u[x].pending<R.pending&&(R=u[x]);return new Promise(function(q,v){var G=new Uint8Array(C),D=++m;R.pending+=h,R.requests[D]={resolve:q,reject:v},R.object.postMessage({id:D,count:h,size:f,source:G,mode:b,filter:y},[G.buffer])})}function l(h){var f=h.data;if(!f.id)return self.close();self.ready.then(function(C){try{var b=new Uint8Array(f.count*f.size);A(C,C.exports[f.mode],b,f.count,f.size,f.source,C.exports[f.filter]),self.postMessage({id:f.id,count:f.count,action:"resolve",value:b},[b.buffer])}catch(y){self.postMessage({id:f.id,count:f.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(h){I(h)},decodeVertexBuffer:function(h,f,C,b,y){A(o,o.exports.meshopt_decodeVertexBuffer,h,f,C,b,o.exports[a[y]])},decodeIndexBuffer:function(h,f,C,b){A(o,o.exports.meshopt_decodeIndexBuffer,h,f,C,b)},decodeIndexSequence:function(h,f,C,b){A(o,o.exports.meshopt_decodeIndexSequence,h,f,C,b)},decodeGltfBuffer:function(h,f,C,b,y,R){A(o,o.exports[d[y]],h,f,C,b,o.exports[a[R]])},decodeGltfBufferAsync:function(h,f,C,b,y){return u.length>0?g(h,f,C,d[b],a[y]):s.then(function(){var R=new Uint8Array(h*f);return A(o,o.exports[d[b]],R,h,f,C,o.exports[a[y]]),R})}}})();function Qs(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const ks={draco:"https://unpkg.com/three@0.182/examples/jsm/libs/draco/",ktx2:"https://unpkg.com/three@0.182.0/examples/jsm/libs/basis/",meshopt:!0};function wn(i={}){const e={...ks,...i};let t=new Ci;const n=new us;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new et;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(Ar),Rn=t}let Rn=new Ci;Rn.setMeshoptDecoder(Ar);class rn extends mn{constructor(e,t){super(e,t)}}class Ss extends bt{gltf;constructor(e){super(e)}async asyncInit(e){if(ei(e)){let t=null;this.gltf=await Rn.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},Qs(s)){const{morphTargetDictionary:c,morphTargetInfluences:A}=s;Object.keys(c).forEach(a=>{const d=s.name+"."+a,u=c[a];o[d]={array:A,idx:u}})}s instanceof oe.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof oe.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]=new rn(r,new yn(s))}),t?this.syncInit(t,n,o):(t="dummy",n.dummy=new rn(r,new xn),this.syncInit(t,n,o))}else{const t=new oe.BoxGeometry,n=new oe.MeshStandardMaterial({color:16711680}),r=new oe.Mesh(t,n),o="dummy",s={};s.dummy=new rn({root:r},new xn),this.syncInit(o,s)}return this}}const cr={camera:void 0,antialias:!1,transparent:!1};class lr extends HTMLElement{options;ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;_canvas;_css2DCanvas;constructor(e){if(super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
143
143
  <style>
144
144
  :host {
145
145
  display: block;
@@ -152,7 +152,7 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I}
152
152
  }
153
153
  </style>
154
154
  <slot></slot>
155
- `,this.options={...dr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new oe.PerspectiveCamera(75,2,.01,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new Qt(this.camera3js)}this.base=new vn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new oe.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new oe.WebGLRenderer(t),kn({renderer:this.renderer}),this.renderer.setSize(600,300),this.shadowRoot.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this._canvas.width=600,this._canvas.height=300,this.css2DRenderer=new Ti,this.css2DRenderer.domElement.classList.add("css2d-layer"),this.shadowRoot.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this.animationFrameId=requestAnimationFrame(this.renderingLoop),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",n=>{this.controller?.mouseDown(n)}),this._css2DCanvas.addEventListener("mouseup",n=>{this.controller?.mouseUp(n)}),this._css2DCanvas.addEventListener("mousemove",n=>{this.controller?.mouseMove(n)}),this._css2DCanvas.addEventListener("click",n=>{this.controller?.mouseClick(n)}),this._css2DCanvas.addEventListener("mouseenter",n=>{this.controller?.mouseEnter(n)}),this._css2DCanvas.addEventListener("mouseleave",n=>{this.controller?.mouseLeave(n)}),this._css2DCanvas.addEventListener("wheel",n=>{this.controller?.mouseWheel(n)}),this._css2DCanvas.addEventListener("touchstart",n=>{this.controller?.touchStart(n)}),this._css2DCanvas.addEventListener("touchmove",n=>{this.controller?.touchMove(n)}),this._css2DCanvas.addEventListener("touchend",n=>{this.controller?.touchEnd(n)}),this._css2DCanvas.addEventListener("touchcancel",n=>{this.controller?.touchCancel(n)})}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};connectedCallback(){this.ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0||r===0||(this.renderer.setSize(n,r,!0),this.css2DRenderer.setSize(n,r),_s(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Ds(this.camera3js)&&this.camera3js.updateProjectionMatrix())}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener),window.removeEventListener("keypress",this.keyPressListener)}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new oe.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new oe.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new oe.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize(),s=this.camera3js.position;return new Ae(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new oe.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return D.v0.set(n),this.worldToScreen(D.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new oe.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new oe.Raycaster,n=new oe.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("canvas-a3",fr);function _s(i){return i.isPerspectiveCamera===!0}function Ds(i){return i.isOrthographicCamera===!0}const pr={width:600,height:300,camera:void 0};class gr extends HTMLElement{_resizeObserver;_dragging=!1;_resizing=!1;_resizeDir="";_startMouseX=0;_startMouseY=0;_startLeft=0;_startTop=0;_startWidth=0;_startHeight=0;_borderSize=5;_canvas;_css2DCanvas;_titleEl=null;_titleBar=null;_closeBtn=null;options;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;constructor(e=600,t=300,n={}){if(super(),this.options={...pr,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
155
+ `,this.options={...cr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new oe.PerspectiveCamera(75,2,.01,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new Qt(this.camera3js)}this.base=new Bn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new oe.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new oe.WebGLRenderer(t),wn({renderer:this.renderer}),this.renderer.setSize(600,300),this.shadowRoot.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this._canvas.width=600,this._canvas.height=300,this.css2DRenderer=new bi,this.css2DRenderer.domElement.classList.add("css2d-layer"),this.shadowRoot.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this.animationFrameId=requestAnimationFrame(this.renderingLoop),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",n=>{this.controller?.mouseDown(n)}),this._css2DCanvas.addEventListener("mouseup",n=>{this.controller?.mouseUp(n)}),this._css2DCanvas.addEventListener("mousemove",n=>{this.controller?.mouseMove(n)}),this._css2DCanvas.addEventListener("click",n=>{this.controller?.mouseClick(n)}),this._css2DCanvas.addEventListener("mouseenter",n=>{this.controller?.mouseEnter(n)}),this._css2DCanvas.addEventListener("mouseleave",n=>{this.controller?.mouseLeave(n)}),this._css2DCanvas.addEventListener("wheel",n=>{this.controller?.mouseWheel(n)}),this._css2DCanvas.addEventListener("touchstart",n=>{this.controller?.touchStart(n)}),this._css2DCanvas.addEventListener("touchmove",n=>{this.controller?.touchMove(n)}),this._css2DCanvas.addEventListener("touchend",n=>{this.controller?.touchEnd(n)}),this._css2DCanvas.addEventListener("touchcancel",n=>{this.controller?.touchCancel(n)})}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};connectedCallback(){this.ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0||r===0||(this.renderer.setSize(n,r,!0),this.css2DRenderer.setSize(n,r),xs(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Ls(this.camera3js)&&this.camera3js.updateProjectionMatrix())}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener),window.removeEventListener("keypress",this.keyPressListener)}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new oe.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new oe.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new oe.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize(),s=this.camera3js.position;return new Ae(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new oe.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return _.v0.set(n),this.worldToScreen(_.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new oe.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new oe.Raycaster,n=new oe.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("canvas-a3",lr);function xs(i){return i.isPerspectiveCamera===!0}function Ls(i){return i.isOrthographicCamera===!0}const ur={width:600,height:300,camera:void 0};class hr extends HTMLElement{_resizeObserver;_dragging=!1;_resizing=!1;_resizeDir="";_startMouseX=0;_startMouseY=0;_startLeft=0;_startTop=0;_startWidth=0;_startHeight=0;_borderSize=5;_canvas;_css2DCanvas;_titleEl=null;_titleBar=null;_closeBtn=null;options;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;constructor(e=600,t=300,n={}){if(super(),this.options={...ur,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
156
156
  <style>
157
157
  :host {
158
158
  position: absolute;
@@ -196,7 +196,7 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I}
196
196
  </div>
197
197
  <div class="content">
198
198
  </div>
199
- `,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new oe.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new Qt(this.camera3js)}this.base=new vn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new oe.Timer,this.renderer=new oe.WebGLRenderer,kn({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const r=this.shadowRoot.querySelector(".content");r.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new Ti,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",r.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",o=>{this.controller?.mouseDown(o)}),this._css2DCanvas.addEventListener("mouseup",o=>{this.controller?.mouseUp(o)}),this._css2DCanvas.addEventListener("mousemove",o=>{this.controller?.mouseMove(o)}),this._css2DCanvas.addEventListener("click",o=>{this.controller?.mouseClick(o)}),this._css2DCanvas.addEventListener("mouseenter",o=>{this.controller?.mouseEnter(o)}),this._css2DCanvas.addEventListener("mouseleave",o=>{this.controller?.mouseLeave(o)}),this._css2DCanvas.addEventListener("wheel",o=>{this.controller?.mouseWheel(o)}),this._css2DCanvas.addEventListener("touchstart",o=>{this.controller?.touchStart(o)}),this._css2DCanvas.addEventListener("touchmove",o=>{this.controller?.touchMove(o)}),this._css2DCanvas.addEventListener("touchend",o=>{this.controller?.touchEnd(o)}),this._css2DCanvas.addEventListener("touchcancel",o=>{this.controller?.touchCancel(o)}),document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0}),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};_resizeCanvasToContent(){const e=this.shadowRoot.querySelector(".content");let t=e.clientWidth,n=e.clientHeight;const r=Math.floor(t),o=Math.floor(n);(this._canvas.width!==r||this._canvas.height!==o)&&(this._canvas.width=r,this._canvas.height=o,Ns(this.camera3js)?(this.camera3js.aspect=r/o,this.camera3js.updateProjectionMatrix()):Fs(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(r,o),this.css2DRenderer.setSize(r,o))}connectedCallback(){this._titleEl=this.shadowRoot.querySelector(".title"),this._titleEl.textContent=this.getAttribute("title")??"Window",this._titleBar=this.shadowRoot.querySelector(".titlebar"),this._closeBtn=this.shadowRoot.querySelector(".close"),this._titleBar.addEventListener("mousedown",this._onDragStart),this._closeBtn.addEventListener("click",()=>this.remove()),this.addEventListener("mousemove",this._onHover),this.addEventListener("mousedown",this._onResizeStart),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),this._resizeObserver=new ResizeObserver(()=>{this._canvas&&this._resizeCanvasToContent()});const e=this.shadowRoot.querySelector(".content");this._resizeObserver.observe(e),this._resizeCanvasToContent()}disconnectedCallback(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._resizeObserver?.disconnect(),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener)}_onDragStart=e=>{this._resizeDir||(this._dragging=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop)};_onHover=e=>{if(this._dragging||this._resizing)return;const t=this.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,o=this._borderSize;let s="";r<o?s+="n":r>t.height-o&&(s+="s"),n<o?s+="w":n>t.width-o&&(s+="e"),this._resizeDir=s,this.style.cursor=this._cursorFromDir(s)};_cursorFromDir(e){switch(e){case"n":return"ns-resize";case"s":return"ns-resize";case"e":return"ew-resize";case"w":return"ew-resize";case"ne":return"nesw-resize";case"sw":return"nesw-resize";case"nw":return"nwse-resize";case"se":return"nwse-resize";default:return"default"}}_onResizeStart=e=>{this._resizeDir&&(this._resizing=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop,this._startWidth=this.offsetWidth,this._startHeight=this.offsetHeight)};_onMouseMove=e=>{if(this._dragging&&(this.style.left=`${this._startLeft+(e.clientX-this._startMouseX)}px`,this.style.top=`${this._startTop+(e.clientY-this._startMouseY)}px`),this._resizing){const t=e.clientX-this._startMouseX,n=e.clientY-this._startMouseY;this._resizeDir.includes("e")&&(this.style.width=`${this._startWidth+t}px`),this._resizeDir.includes("s")&&(this.style.height=`${this._startHeight+n}px`),this._resizeDir.includes("w")&&(this.style.width=`${this._startWidth-t}px`,this.style.left=`${this._startLeft+t}px`),this._resizeDir.includes("n")&&(this.style.height=`${this._startHeight-n}px`,this.style.top=`${this._startTop+n}px`)}};_onMouseUp=()=>{this._dragging=!1,this._resizing=!1};replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new oe.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new oe.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new oe.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize(),s=this.camera3js.position;return new Ae(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new oe.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return D.v0.set(n),this.worldToScreen(D.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new oe.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new oe.Raycaster,n=new oe.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("window-a3",gr);function Ns(i){return i.isPerspectiveCamera===!0}function Fs(i){return i.isOrthographicCamera===!0}const Os=`
199
+ `,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new oe.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new Qt(this.camera3js)}this.base=new Bn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new oe.Timer,this.renderer=new oe.WebGLRenderer,wn({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const r=this.shadowRoot.querySelector(".content");r.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new bi,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",r.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",o=>{this.controller?.mouseDown(o)}),this._css2DCanvas.addEventListener("mouseup",o=>{this.controller?.mouseUp(o)}),this._css2DCanvas.addEventListener("mousemove",o=>{this.controller?.mouseMove(o)}),this._css2DCanvas.addEventListener("click",o=>{this.controller?.mouseClick(o)}),this._css2DCanvas.addEventListener("mouseenter",o=>{this.controller?.mouseEnter(o)}),this._css2DCanvas.addEventListener("mouseleave",o=>{this.controller?.mouseLeave(o)}),this._css2DCanvas.addEventListener("wheel",o=>{this.controller?.mouseWheel(o)}),this._css2DCanvas.addEventListener("touchstart",o=>{this.controller?.touchStart(o)}),this._css2DCanvas.addEventListener("touchmove",o=>{this.controller?.touchMove(o)}),this._css2DCanvas.addEventListener("touchend",o=>{this.controller?.touchEnd(o)}),this._css2DCanvas.addEventListener("touchcancel",o=>{this.controller?.touchCancel(o)}),document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0}),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};_resizeCanvasToContent(){const e=this.shadowRoot.querySelector(".content");let t=e.clientWidth,n=e.clientHeight;const r=Math.floor(t),o=Math.floor(n);(this._canvas.width!==r||this._canvas.height!==o)&&(this._canvas.width=r,this._canvas.height=o,_s(this.camera3js)?(this.camera3js.aspect=r/o,this.camera3js.updateProjectionMatrix()):Ds(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(r,o),this.css2DRenderer.setSize(r,o))}connectedCallback(){this._titleEl=this.shadowRoot.querySelector(".title"),this._titleEl.textContent=this.getAttribute("title")??"Window",this._titleBar=this.shadowRoot.querySelector(".titlebar"),this._closeBtn=this.shadowRoot.querySelector(".close"),this._titleBar.addEventListener("mousedown",this._onDragStart),this._closeBtn.addEventListener("click",()=>this.remove()),this.addEventListener("mousemove",this._onHover),this.addEventListener("mousedown",this._onResizeStart),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),this._resizeObserver=new ResizeObserver(()=>{this._canvas&&this._resizeCanvasToContent()});const e=this.shadowRoot.querySelector(".content");this._resizeObserver.observe(e),this._resizeCanvasToContent()}disconnectedCallback(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._resizeObserver?.disconnect(),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener)}_onDragStart=e=>{this._resizeDir||(this._dragging=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop)};_onHover=e=>{if(this._dragging||this._resizing)return;const t=this.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,o=this._borderSize;let s="";r<o?s+="n":r>t.height-o&&(s+="s"),n<o?s+="w":n>t.width-o&&(s+="e"),this._resizeDir=s,this.style.cursor=this._cursorFromDir(s)};_cursorFromDir(e){switch(e){case"n":return"ns-resize";case"s":return"ns-resize";case"e":return"ew-resize";case"w":return"ew-resize";case"ne":return"nesw-resize";case"sw":return"nesw-resize";case"nw":return"nwse-resize";case"se":return"nwse-resize";default:return"default"}}_onResizeStart=e=>{this._resizeDir&&(this._resizing=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop,this._startWidth=this.offsetWidth,this._startHeight=this.offsetHeight)};_onMouseMove=e=>{if(this._dragging&&(this.style.left=`${this._startLeft+(e.clientX-this._startMouseX)}px`,this.style.top=`${this._startTop+(e.clientY-this._startMouseY)}px`),this._resizing){const t=e.clientX-this._startMouseX,n=e.clientY-this._startMouseY;this._resizeDir.includes("e")&&(this.style.width=`${this._startWidth+t}px`),this._resizeDir.includes("s")&&(this.style.height=`${this._startHeight+n}px`),this._resizeDir.includes("w")&&(this.style.width=`${this._startWidth-t}px`,this.style.left=`${this._startLeft+t}px`),this._resizeDir.includes("n")&&(this.style.height=`${this._startHeight-n}px`,this.style.top=`${this._startTop+n}px`)}};_onMouseUp=()=>{this._dragging=!1,this._resizing=!1};replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new oe.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new oe.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new oe.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize(),s=this.camera3js.position;return new Ae(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new oe.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return _.v0.set(n),this.worldToScreen(_.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new oe.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new oe.Raycaster,n=new oe.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("window-a3",hr);function _s(i){return i.isPerspectiveCamera===!0}function Ds(i){return i.isOrthographicCamera===!0}const Ns=`
200
200
  color: white;
201
201
  padding: 5px 10px;
202
202
  background: rgba(0, 0, 0, 0.6);
@@ -205,8 +205,8 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I}
205
205
  font-family: sans-serif;
206
206
  font-size: 14px;
207
207
  pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
208
- `,mn={testMode:!0};class Ms extends Me{constructor(e={}){super(e);const t={...mn,...e};this.setTransformer(new Jn(t))}initObject(){const e=new oe.BoxGeometry,t=new oe.MeshStandardMaterial({color:65280}),n=new oe.Mesh(e,t),r=document.createElement("div");r.textContent="Hello Box!",r.style.cssText=Os;const o=new Bi(r);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=Ut(mn,e);return new Jn(t)}}class Jn extends Rt{testMode=!0;rot=new Ae;constructor(e){super(),this.testMode=e.testMode}update(e){super.update(e),this.testMode&&(this.rot.add(e,e,e),ut(this.rot,"ZXY",this.transform.quat))}}class Ps extends E.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new E.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){const A=o.parse(JSON.parse(c));t&&t(A)},n,r)}parse(e){return new mr(e)}}class mr{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],o=Gs(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)r.push(...o[s].toShapes());return r}}function Gs(i,e,t,n){const r=Array.from(i),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&r.reverse();for(let d=0;d<r.length;d++){const u=r[d];if(u===`
209
- `)A=0,a-=s;else{const m=Us(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=m.offsetX,c.push(m.path)}}return c}function Us(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const s=new E.ShapePath;let c,A,a,d,u,m,p,I;if(o.o){const g=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,h=g.length;l<h;)switch(g[l++]){case"m":c=g[l++]*e+t,A=g[l++]*e+n,s.moveTo(c,A);break;case"l":c=g[l++]*e+t,A=g[l++]*e+n,s.lineTo(c,A);break;case"q":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,s.quadraticCurveTo(u,m,a,d);break;case"b":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,p=g[l++]*e+t,I=g[l++]*e+n,s.bezierCurveTo(u,m,p,I,a,d);break}}return{offsetX:o.ha*e,path:s}}class js extends E.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let Gt=null;async function Hs(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await oi(i),n=Ot(t,e);Gt=new mr(JSON.parse(n))}else Gt=await new Ps().loadAsync(i)}class qs extends Me{initObject(e){let t;if(ri(e)?t=e:t="ERROR",Gt==null){const n=new oe.BoxGeometry,r=new oe.MeshStandardMaterial({color:16711680});return new oe.Mesh(n,r)}else{const n={font:Gt,size:1,depth:.5,curveSegments:12},r=new js(t,n);r.center();const o=new oe.MeshStandardMaterial({color:65280});return new oe.Mesh(r,o)}}}class zs extends Me{constructor(e){super(e)}initObject(e){return e}}class Vs extends Me{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new oe.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new oe.MeshStandardMaterial({color:o});return new oe.Mesh(r,s)}}class Ks extends Me{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new oe.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new oe.MeshStandardMaterial({color:o});return new oe.Mesh(r,s)}}class Ws extends Me{constructor(){super()}initObject(){const e=new oe.Object3D,t=new oe.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new oe.AmbientLight(4210752);return e.add(n),e}}class Ys extends Me{constructor(e){super(e)}initObject(e){const t=new oe.PlaneGeometry(1,1),n=new oe.TextureLoader().load(e),r=new oe.MeshBasicMaterial({map:n});return new oe.Mesh(t,r)}}class Js extends Me{constructor(e){super(e)}initObject(e){return new Bi(e)}}const Er={touchDevice:navigator.maxTouchPoints>0};class Ir extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...Er,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
208
+ `,dn={testMode:!0};class Fs extends Oe{constructor(e={}){super(e);const t={...dn,...e};this.setTransformer(new Vn(t))}initObject(){const e=new oe.BoxGeometry,t=new oe.MeshStandardMaterial({color:65280}),n=new oe.Mesh(e,t),r=document.createElement("div");r.textContent="Hello Box!",r.style.cssText=Ns;const o=new Ii(r);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=Ot(dn,e);return new Vn(t)}}class Vn extends Rt{testMode=!0;rot=new Ae;constructor(e){super(),this.testMode=e.testMode}update(e){super.update(e),this.testMode&&(this.rot.add(e,e,e),ht(this.rot,"ZXY",this.transform.quat))}}class Os extends E.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new E.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){const A=o.parse(JSON.parse(c));t&&t(A)},n,r)}parse(e){return new dr(e)}}class dr{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],o=Ms(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)r.push(...o[s].toShapes());return r}}function Ms(i,e,t,n){const r=Array.from(i),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&r.reverse();for(let d=0;d<r.length;d++){const u=r[d];if(u===`
209
+ `)A=0,a-=s;else{const m=Ps(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=m.offsetX,c.push(m.path)}}return c}function Ps(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const s=new E.ShapePath;let c,A,a,d,u,m,p,I;if(o.o){const g=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,h=g.length;l<h;)switch(g[l++]){case"m":c=g[l++]*e+t,A=g[l++]*e+n,s.moveTo(c,A);break;case"l":c=g[l++]*e+t,A=g[l++]*e+n,s.lineTo(c,A);break;case"q":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,s.quadraticCurveTo(u,m,a,d);break;case"b":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,p=g[l++]*e+t,I=g[l++]*e+n,s.bezierCurveTo(u,m,p,I,a,d);break}}return{offsetX:o.ha*e,path:s}}class Gs extends E.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let Ft=null;async function Us(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await ti(i),n=Nt(t,e);Ft=new dr(JSON.parse(n))}else Ft=await new Os().loadAsync(i)}class js extends Oe{initObject(e){let t;if(ei(e)?t=e:t="ERROR",Ft==null){const n=new oe.BoxGeometry,r=new oe.MeshStandardMaterial({color:16711680});return new oe.Mesh(n,r)}else{const n={font:Ft,size:1,depth:.5,curveSegments:12},r=new Gs(t,n);r.center();const o=new oe.MeshStandardMaterial({color:65280});return new oe.Mesh(r,o)}}}class Hs extends Oe{constructor(e){super(e)}initObject(e){return e}}class qs extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new oe.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new oe.MeshStandardMaterial({color:o});return new oe.Mesh(r,s)}}class zs extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new oe.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new oe.MeshStandardMaterial({color:o});return new oe.Mesh(r,s)}}class Vs extends Oe{constructor(){super()}initObject(){const e=new oe.Object3D,t=new oe.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new oe.AmbientLight(4210752);return e.add(n),e}}class Ks extends Oe{constructor(e){super(e)}initObject(e){const t=new oe.PlaneGeometry(1,1),n=new oe.TextureLoader().load(e),r=new oe.MeshBasicMaterial({map:n});return new oe.Mesh(t,r)}}class Ws extends Oe{constructor(e){super(e);const t=this.object3D.children[0];this.object3D.addEventListener("removed",()=>{t.element.remove()})}initObject(e){return new Ii(e)}}const fr={touchDevice:navigator.maxTouchPoints>0};class pr extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...fr,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
210
210
  <style>
211
211
  :host {
212
212
  display: block;
@@ -289,5 +289,5 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I}
289
289
  <button class="btn left">L</button>
290
290
  <button class="btn right">R</button>
291
291
  </div>
292
- `,this.canvas=this.shadowRoot.querySelector("canvas-a3"),this.scene=this.canvas.scene,this.camera=this.canvas.camera,this.controller=this.canvas.controller,this._maxDistance=40,this._leftActive=!1,this._leftCenter={x:0,y:0},this.leftJoystick={x:0,y:0},this._rightActive=!1,this._rightCenter={x:0,y:0},this.rightJoystick={x:0,y:0},this.leftButton=!1,this.rightButton=!1,this.keys=new Set;const t=this.shadowRoot.querySelector(".joystick.left .stick");if(!t)return;t.addEventListener("pointerdown",s=>{this._leftActive=!0;const c=t.getBoundingClientRect();this._leftCenter.x=c.left+c.width/2,this._leftCenter.y=c.top+c.height/2,t.setPointerCapture(s.pointerId)}),t.addEventListener("pointermove",s=>{if(!this._leftActive)return;const c=s.clientX-this._leftCenter.x,A=s.clientY-this._leftCenter.y,a=Math.sqrt(c*c+A*A);let d=c,u=A;if(a>40){const m=Math.atan2(A,c);d=Math.cos(m)*this._maxDistance,u=Math.sin(m)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${d}px), calc(-50% + ${u}px))`,this.leftJoystick.x=d/this._maxDistance,this.leftJoystick.y=-(u/this._maxDistance)}),t.addEventListener("pointerup",()=>{this._leftActive=!1,t.style.transform="translate(-50%, -50%)",this.leftJoystick.x=0,this.leftJoystick.y=0});const n=this.shadowRoot.querySelector(".joystick.right .stick");if(!n)return;n.addEventListener("pointerdown",s=>{this._rightActive=!0;const c=n.getBoundingClientRect();this._rightCenter.x=c.left+c.width/2,this._rightCenter.y=c.top+c.height/2,n.setPointerCapture(s.pointerId)}),n.addEventListener("pointermove",s=>{if(!this._rightActive)return;const c=s.clientX-this._rightCenter.x,A=s.clientY-this._rightCenter.y,a=Math.sqrt(c*c+A*A);let d=c,u=A;if(a>40){const m=Math.atan2(A,c);d=Math.cos(m)*this._maxDistance,u=Math.sin(m)*this._maxDistance}n.style.transform=`translate(calc(-50% + ${d}px), calc(-50% + ${u}px))`,this.rightJoystick.x=d/this._maxDistance,this.rightJoystick.y=-(u/this._maxDistance)}),n.addEventListener("pointerup",()=>{this._rightActive=!1,n.style.transform="translate(-50%, -50%)",this.rightJoystick.x=0,this.rightJoystick.y=0});const r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0}),o.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(s=>{s.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(s=>{s.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){this._ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="50px",o.style.left="200px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="50px",s.style.right="200px"}else{const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="200px",o.style.left="50px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="200px",s.style.right="50px"}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e,t){return this.canvas.alert(e,t)}prompt(e,t){return this.canvas.prompt(e,t)}}customElements.define("game-canvas-a3",Ir);const br={mass:10,defaultLocation:{x:0,y:1,z:0},defaultQuat:{x:0,y:0,z:0,w:1},chassisWidth:2,chassisHeight:1,chassisLength:4,chassisOffset:{x:0,y:-.5,z:0},chassisFriction:.1,wheelFrontYPosition:0,wheelFrontZPosition:1.5,wheelFrontAxleLength:2,wheelRearYPosition:0,wheelRearZPosition:-1.5,wheelRearAxleLength:2,wheelFrontRadius:.3,wheelRearRadius:.3,wheelFrontWidth:.4,wheelRearWidth:.4,wheelFrontSuspensionRestLength:.8,wheelRearSuspensionRestLength:.8,wheelFrontDirection:{x:0,y:-1,z:0},wheelRearDirection:{x:0,y:-1,z:0},wheelFrontAxle:{x:-1,y:0,z:0},wheelRearAxle:{x:-1,y:0,z:0},wheelFrontSuspensionStiffness:24,wheelRearSuspensionStiffness:24,wheelFrontSuspensionCompression:4,wheelRearSuspensionCompression:4,wheelFrontSuspensionRelaxation:3,wheelRearSuspensionRelaxation:3,wheelFrontWheelFrictionSlip:100,wheelRearWheelFrictionSlip:100,wheelFrontMaxSuspensionTravel:.25,wheelRearMaxSuspensionTravel:.25,aerodynamicDrag:0};class Xs{opt;trans;motion;constructor(e){this.opt={...br,...e},this.trans=new Cr(this),this.motion=new yr(this)}steer(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerate(e){this.trans.controller&&(this.trans.controller.setWheelEngineForce(0,e),this.trans.controller.setWheelEngineForce(1,e),this.trans.controller.setWheelEngineForce(2,e),this.trans.controller.setWheelEngineForce(3,e))}brake(e){this.trans.controller&&(this.trans.controller.setWheelBrake(0,e),this.trans.controller.setWheelBrake(1,e),this.trans.controller.setWheelBrake(2,e),this.trans.controller.setWheelBrake(3,e))}reset(e,t){this.trans.chassisBody&&(e?this.trans.chassisBody.setTranslation({x:e.x,y:e.y,z:e.z},!0):this.trans.chassisBody.setTranslation(this.opt.defaultLocation,!0),t?this.trans.chassisBody.setRotation({x:t.x,y:t.y,z:t.z,w:t.w},!0):this.trans.chassisBody.setRotation(this.opt.defaultQuat,!0),this.trans.chassisBody.setLinvel({x:0,y:0,z:0},!0),this.trans.chassisBody.setAngvel({x:0,y:0,z:0},!0))}}class Cr{cc;transform;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.transform=new qe}init(e,t){this.transform.set(e),this.objectA3=t,this.chassisBodyDesc=new je.RigidBodyDesc(je.RigidBodyType.Dynamic),this.chassisColliderDesc=je.ColliderDesc.cuboid(this.cc.opt.chassisWidth/2,this.cc.opt.chassisHeight/2,this.cc.opt.chassisLength/2),this.chassisColliderDesc.setMass(this.cc.opt.mass),this.chassisColliderDesc.setFriction(this.cc.opt.chassisFriction)}addOneselfToPhysics(e){if(this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&nt.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),nt.delete(this.chassisCollider.handle))}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new Ae),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new Ae),this.chassisBody?e.set(this.chassisBody.angvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.angvel),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){if(!this.controller)return!0;let e=!1;return e||=this.controller.wheelIsInContact(0),e||=this.controller.wheelIsInContact(1),e||=this.controller.wheelIsInContact(2),e||=this.controller.wheelIsInContact(3),e}vv=new Ae;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new Ae(this.chassisBody.linvel());Math.abs(t.y)>3&&t.set(t.x,3*t.y/Math.abs(t.y),t.z),this.vv.lerp(this.vv,t,.9);const n=this.vv.length();n!==0&&(t.set(this.vv),t.normalize(),t.scale(-n*n*this.cc.opt.aerodynamicDrag),this.chassisBody.resetForces(!0),this.chassisBody.addForce({x:t.x,y:t.y,z:t.z},!0))}this.controller?.updateVehicle(e),this.chassisBody&&this.transform.loc.set(this.chassisBody.translation()),this.chassisBody&&this.transform.quat.set(this.chassisBody.rotation())}}class yr{cm;name;playCount;time;finishListener;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){if(!this.cm.trans.chassisBody)return{};if(!this.cm.trans.controller)return{};const t=new Ae(this.cm.trans.chassisBody.translation()),n=new Pe(this.cm.trans.chassisBody.rotation()),r=new Pe(-n.x,-n.y,-n.z,n.w),o=new Ae(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Pe(this.cm.trans.chassisBody.rotation());s.mul(r);const c=new Pe,A=new Ae,a=new Pe;{const l=this.cm.opt.wheelFrontAxle,h=this.cm.trans.controller.wheelSuspensionLength(0)||0,f=this.cm.trans.controller.wheelSteering(0)||0,C=this.cm.trans.controller.wheelRotation(0)||0;A.set(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),A.sub(0,h,0),a.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),a.mul(c)}const d=new Ae,u=new Pe;{const l=this.cm.opt.wheelFrontAxle,h=this.cm.trans.controller.wheelSuspensionLength(1)||0,f=this.cm.trans.controller.wheelSteering(1)||0,C=this.cm.trans.controller.wheelRotation(1)||0;d.set(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),d.sub(0,h,0),u.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),u.mul(c)}const m=new Ae,p=new Pe;{const l=this.cm.opt.wheelRearAxle,h=this.cm.trans.controller.wheelSuspensionLength(2)||0,f=this.cm.trans.controller.wheelSteering(2)||0,C=this.cm.trans.controller.wheelRotation(2)||0;m.set(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),m.sub(0,h,0),p.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),p.mul(c)}const I=new Ae,g=new Pe;{const l=this.cm.opt.wheelRearAxle,h=this.cm.trans.controller.wheelSuspensionLength(3)||0,f=this.cm.trans.controller.wheelSteering(3)||0,C=this.cm.trans.controller.wheelRotation(3)||0;I.set(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),I.sub(0,h,0),g.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),g.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:d,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:I,quat:g},rearLeft:{loc:m,quat:p}}}}exports.Acerola3D=Ei;exports.Action=Cn;exports.ActionObject=It;exports.AvatarPositionController=So;exports.AvatarVelocityController=Lo;exports.BaseController=Kt;exports.BaseView=vn;exports.BillboardTransformer=$n;exports.Box=Vs;exports.Camera=Ci;exports.Canvas=fr;exports.CarControl=Xs;exports.CarMotion=yr;exports.CarTransformer=Cr;exports.ClipMotion=Rn;exports.DefaultTransformer=Rt;exports.DynamicCharacterTransformer=ci;exports.FollowTransformer=ni;exports.GLTF=Ls;exports.GameCanvas=Ir;exports.Html3D=Js;exports.ImagePlane=Ys;exports.KinematicCharacterTransformer=ai;exports.ObjectA3=Me;exports.OrbitController=yi;exports.Quat=Pe;exports.RapierPhysicsEngine=vt;exports.RapierPhysicsWorld=bn;exports.SampleObject=Ms;exports.Scene=bi;exports.SmoothBillboardTransformer=ei;exports.SmoothTransformer=En;exports.Sound=st;exports.Sphere=Ks;exports.StandardLights=Ws;exports.StaticTransformer=Zn;exports.Text3D=qs;exports.ThreeCamera=Qt;exports.ThreeObject=zs;exports.Transform=qe;exports.Vec3=Ae;exports.Window=gr;exports.asyncSleep=qr;exports.collisionMap=nt;exports.deepMerge=Ut;exports.defaultCanvasOptions=dr;exports.defaultCarControlOptions=br;exports.defaultDynamicCharacterTransformerOptions=Ai;exports.defaultFollowTransformerOptions=ti;exports.defaultGameCanvasOptions=Er;exports.defaultKinematicCharacterTransformerOptions=si;exports.defaultSampleObjectOptions=mn;exports.defaultWindowOptions=pr;exports.eulerToQuaternion=ut;exports.getLookAtQuaternion=at;exports.initFont=Hs;exports.initPhysics=Hr;exports.initSound=Qo;exports.recreateGLTFLoader=kn;
292
+ `,this.canvas=this.shadowRoot.querySelector("canvas-a3"),this.scene=this.canvas.scene,this.camera=this.canvas.camera,this.controller=this.canvas.controller,this._maxDistance=40,this._leftActive=!1,this._leftCenter={x:0,y:0},this.leftJoystick={x:0,y:0},this._rightActive=!1,this._rightCenter={x:0,y:0},this.rightJoystick={x:0,y:0},this.leftButton=!1,this.rightButton=!1,this.keys=new Set;const t=this.shadowRoot.querySelector(".joystick.left .stick");if(!t)return;t.addEventListener("pointerdown",s=>{this._leftActive=!0;const c=t.getBoundingClientRect();this._leftCenter.x=c.left+c.width/2,this._leftCenter.y=c.top+c.height/2,t.setPointerCapture(s.pointerId)}),t.addEventListener("pointermove",s=>{if(!this._leftActive)return;const c=s.clientX-this._leftCenter.x,A=s.clientY-this._leftCenter.y,a=Math.sqrt(c*c+A*A);let d=c,u=A;if(a>40){const m=Math.atan2(A,c);d=Math.cos(m)*this._maxDistance,u=Math.sin(m)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${d}px), calc(-50% + ${u}px))`,this.leftJoystick.x=d/this._maxDistance,this.leftJoystick.y=-(u/this._maxDistance)}),t.addEventListener("pointerup",()=>{this._leftActive=!1,t.style.transform="translate(-50%, -50%)",this.leftJoystick.x=0,this.leftJoystick.y=0});const n=this.shadowRoot.querySelector(".joystick.right .stick");if(!n)return;n.addEventListener("pointerdown",s=>{this._rightActive=!0;const c=n.getBoundingClientRect();this._rightCenter.x=c.left+c.width/2,this._rightCenter.y=c.top+c.height/2,n.setPointerCapture(s.pointerId)}),n.addEventListener("pointermove",s=>{if(!this._rightActive)return;const c=s.clientX-this._rightCenter.x,A=s.clientY-this._rightCenter.y,a=Math.sqrt(c*c+A*A);let d=c,u=A;if(a>40){const m=Math.atan2(A,c);d=Math.cos(m)*this._maxDistance,u=Math.sin(m)*this._maxDistance}n.style.transform=`translate(calc(-50% + ${d}px), calc(-50% + ${u}px))`,this.rightJoystick.x=d/this._maxDistance,this.rightJoystick.y=-(u/this._maxDistance)}),n.addEventListener("pointerup",()=>{this._rightActive=!1,n.style.transform="translate(-50%, -50%)",this.rightJoystick.x=0,this.rightJoystick.y=0});const r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0}),o.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(s=>{s.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(s=>{s.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){this._ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="50px",o.style.left="200px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="50px",s.style.right="200px"}else{const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="200px",o.style.left="50px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="200px",s.style.right="50px"}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e,t){return this.canvas.alert(e,t)}prompt(e,t){return this.canvas.prompt(e,t)}}customElements.define("game-canvas-a3",pr);const gr={mass:10,defaultLocation:{x:0,y:1,z:0},defaultQuat:{x:0,y:0,z:0,w:1},chassisWidth:2,chassisHeight:1,chassisLength:4,chassisOffset:{x:0,y:-.5,z:0},chassisFriction:.1,wheelFrontYPosition:0,wheelFrontZPosition:1.5,wheelFrontAxleLength:2,wheelRearYPosition:0,wheelRearZPosition:-1.5,wheelRearAxleLength:2,wheelFrontRadius:.3,wheelRearRadius:.3,wheelFrontWidth:.4,wheelRearWidth:.4,wheelFrontSuspensionRestLength:.8,wheelRearSuspensionRestLength:.8,wheelFrontDirection:{x:0,y:-1,z:0},wheelRearDirection:{x:0,y:-1,z:0},wheelFrontAxle:{x:-1,y:0,z:0},wheelRearAxle:{x:-1,y:0,z:0},wheelFrontSuspensionStiffness:24,wheelRearSuspensionStiffness:24,wheelFrontSuspensionCompression:4,wheelRearSuspensionCompression:4,wheelFrontSuspensionRelaxation:3,wheelRearSuspensionRelaxation:3,wheelFrontWheelFrictionSlip:100,wheelRearWheelFrictionSlip:100,wheelFrontMaxSuspensionTravel:.25,wheelRearMaxSuspensionTravel:.25,aerodynamicDrag:0};class Ys{opt;trans;motion;constructor(e){this.opt={...gr,...e},this.trans=new mr(this),this.motion=new Er(this)}steer(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerate(e){this.trans.controller&&(this.trans.controller.setWheelEngineForce(0,e),this.trans.controller.setWheelEngineForce(1,e),this.trans.controller.setWheelEngineForce(2,e),this.trans.controller.setWheelEngineForce(3,e))}brake(e){this.trans.controller&&(this.trans.controller.setWheelBrake(0,e),this.trans.controller.setWheelBrake(1,e),this.trans.controller.setWheelBrake(2,e),this.trans.controller.setWheelBrake(3,e))}reset(e,t){this.trans.chassisBody&&(e?this.trans.chassisBody.setTranslation({x:e.x,y:e.y,z:e.z},!0):this.trans.chassisBody.setTranslation(this.opt.defaultLocation,!0),t?this.trans.chassisBody.setRotation({x:t.x,y:t.y,z:t.z,w:t.w},!0):this.trans.chassisBody.setRotation(this.opt.defaultQuat,!0),this.trans.chassisBody.setLinvel({x:0,y:0,z:0},!0),this.trans.chassisBody.setAngvel({x:0,y:0,z:0},!0))}}class mr{cc;transform;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.transform=new ze}init(e,t){this.transform.set(e),this.objectA3=t,this.chassisBodyDesc=new je.RigidBodyDesc(je.RigidBodyType.Dynamic),this.chassisColliderDesc=je.ColliderDesc.cuboid(this.cc.opt.chassisWidth/2,this.cc.opt.chassisHeight/2,this.cc.opt.chassisLength/2),this.chassisColliderDesc.setMass(this.cc.opt.mass),this.chassisColliderDesc.setFriction(this.cc.opt.chassisFriction)}addOneselfToPhysics(e){if(this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&it.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),it.delete(this.chassisCollider.handle))}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new Ae),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new Ae),this.chassisBody?e.set(this.chassisBody.angvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.angvel),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){if(!this.controller)return!0;let e=!1;return e||=this.controller.wheelIsInContact(0),e||=this.controller.wheelIsInContact(1),e||=this.controller.wheelIsInContact(2),e||=this.controller.wheelIsInContact(3),e}vv=new Ae;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new Ae(this.chassisBody.linvel());Math.abs(t.y)>3&&t.set(t.x,3*t.y/Math.abs(t.y),t.z),this.vv.lerp(this.vv,t,.9);const n=this.vv.length();n!==0&&(t.set(this.vv),t.normalize(),t.scale(-n*n*this.cc.opt.aerodynamicDrag),this.chassisBody.resetForces(!0),this.chassisBody.addForce({x:t.x,y:t.y,z:t.z},!0))}this.controller?.updateVehicle(e),this.chassisBody&&this.transform.loc.set(this.chassisBody.translation()),this.chassisBody&&this.transform.quat.set(this.chassisBody.rotation())}}class Er{cm;name;playCount;time;finishListener;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){if(!this.cm.trans.chassisBody)return{};if(!this.cm.trans.controller)return{};const t=new Ae(this.cm.trans.chassisBody.translation()),n=new Me(this.cm.trans.chassisBody.rotation()),r=new Me(-n.x,-n.y,-n.z,n.w),o=new Ae(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Me(this.cm.trans.chassisBody.rotation());s.mul(r);const c=new Me,A=new Ae,a=new Me;{const l=this.cm.opt.wheelFrontAxle,h=this.cm.trans.controller.wheelSuspensionLength(0)||0,f=this.cm.trans.controller.wheelSteering(0)||0,C=this.cm.trans.controller.wheelRotation(0)||0;A.set(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),A.sub(0,h,0),a.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),a.mul(c)}const d=new Ae,u=new Me;{const l=this.cm.opt.wheelFrontAxle,h=this.cm.trans.controller.wheelSuspensionLength(1)||0,f=this.cm.trans.controller.wheelSteering(1)||0,C=this.cm.trans.controller.wheelRotation(1)||0;d.set(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),d.sub(0,h,0),u.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),u.mul(c)}const m=new Ae,p=new Me;{const l=this.cm.opt.wheelRearAxle,h=this.cm.trans.controller.wheelSuspensionLength(2)||0,f=this.cm.trans.controller.wheelSteering(2)||0,C=this.cm.trans.controller.wheelRotation(2)||0;m.set(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),m.sub(0,h,0),p.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),p.mul(c)}const I=new Ae,g=new Me;{const l=this.cm.opt.wheelRearAxle,h=this.cm.trans.controller.wheelSuspensionLength(3)||0,f=this.cm.trans.controller.wheelSteering(3)||0,C=this.cm.trans.controller.wheelRotation(3)||0;I.set(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),I.sub(0,h,0),g.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),g.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:d,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:I,quat:g},rearLeft:{loc:m,quat:p}}}}exports.Acerola3D=fi;exports.Action=mn;exports.ActionObject=bt;exports.AvatarPositionController=Qo;exports.AvatarVelocityController=So;exports.BaseController=Ht;exports.BaseView=Bn;exports.BillboardTransformer=Yn;exports.Box=qs;exports.Camera=mi;exports.Canvas=lr;exports.CarControl=Ys;exports.CarMotion=Er;exports.CarTransformer=mr;exports.ClipMotion=yn;exports.DefaultTransformer=Rt;exports.DynamicCharacterTransformer=oi;exports.FollowTransformer=Zn;exports.GLTF=Ss;exports.GameCanvas=pr;exports.Html3D=Ws;exports.ImagePlane=Ks;exports.KinematicCharacterTransformer=ii;exports.ObjectA3=Oe;exports.OrbitController=Ei;exports.Quat=Me;exports.RapierPhysicsEngine=vt;exports.RapierPhysicsWorld=gn;exports.SampleObject=Fs;exports.Scene=gi;exports.SmoothBillboardTransformer=Jn;exports.SmoothTransformer=fn;exports.Sound=at;exports.Sphere=zs;exports.StandardLights=Vs;exports.StaticTransformer=Wn;exports.Text3D=js;exports.ThreeCamera=Qt;exports.ThreeObject=Hs;exports.Transform=ze;exports.Vec3=Ae;exports.Window=hr;exports.asyncSleep=jr;exports.collisionMap=it;exports.deepMerge=Ot;exports.defaultCanvasOptions=cr;exports.defaultCarControlOptions=gr;exports.defaultDynamicCharacterTransformerOptions=ri;exports.defaultFollowTransformerOptions=Xn;exports.defaultGameCanvasOptions=fr;exports.defaultKinematicCharacterTransformerOptions=ni;exports.defaultSampleObjectOptions=dn;exports.defaultWindowOptions=ur;exports.eulerToQuaternion=ht;exports.getLookAtQuaternion=At;exports.initFont=Us;exports.initPhysics=Ur;exports.initSound=Ro;exports.recreateGLTFLoader=wn;
293
293
  //# sourceMappingURL=a3js.cjs.js.map