a3js 0.0.36 → 0.0.37

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 fr=Object.create;var Bn=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var mr=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty;var Ir=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gr(e))!Er.call(r,i)&&i!==t&&Bn(r,i,{get:()=>e[i],enumerable:!(n=pr(e,i))||n.enumerable});return r};var br=(r,e,t)=>(t=r!=null?fr(mr(r)):{},Ir(e||!r||!r.__esModule?Bn(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("three"),qn=require("fflate");function Cr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const se=Cr(I);class te{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}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 te(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,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e);const s=new Te(this._x,this._y,this._z,0),c=new Te(o).conjugate();return o.mul(s).mul(c),this._x=o.x,this._y=o.y,this._z=o.z,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 Te{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,n,i){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=i):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 Te(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,i){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=i):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,i){const o=new Te(this),s=new Te;return typeof e=="number"?s.set(e,t,n,i):s.set(e),this._x=o.w*s.x+o.x*s.w+o.y*s.z-o.z*s.y,this._y=o.w*s.y-o.x*s.z+o.y*s.w+o.z*s.x,this._z=o.w*s.z+o.x*s.y-o.y*s.x+o.z*s.w,this._w=o.w*s.w-o.x*s.x-o.y*s.y-o.z*s.z,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 i=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Ye.set(t),i<0&&(i*=-1,Ye.set(-Ye.x,-Ye.y,-Ye.z,-Ye.w)),i>.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(i),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 Te;function at(r,e,t){t.normalize();const n=r.clone().sub(e).normalize(),i=new te().cross(n,t).normalize(),o=new te().cross(i,n),s=i.x,c=o.x,A=-n.x,a=i.y,d=o.y,u=-n.y,b=i.z,f=o.z,E=-n.z,g=s+d+E;if(g>0){const l=Math.sqrt(g+1)*2;return new Te((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(s>d&&s>E){const l=Math.sqrt(1+s-d-E)*2;return new Te(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(d>E){const l=Math.sqrt(1+d-s-E)*2;return new Te((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+E-s-d)*2;return new Te((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function ht(r,e="XYZ"){const t=new Te(0,0,0,1);for(let n=0;n<3;n++)switch(e.charAt(n)){case"X":t.mul(Math.sin(r.x),0,0,Math.cos(r.x));break;case"Y":t.mul(0,Math.sin(r.y),0,Math.cos(r.y));break;case"Z":t.mul(0,0,Math.sin(r.z),Math.cos(r.z));break}return t}function yr(r){const e=[[],[],[]],t=r.x+r.x,n=r.y+r.y,i=r.z+r.z,o=r.x*t,s=r.x*n,c=r.x*i,A=r.y*n,a=r.y*i,d=r.z*i,u=r.w*t,b=r.w*n,f=r.w*i;return e[0][0]=1-(A+d),e[0][1]=s-f,e[0][2]=c+b,e[1][0]=s+f,e[1][1]=1-(o+d),e[1][2]=a-u,e[2][0]=c-b,e[2][1]=a+u,e[2][2]=1-(o+A),e}const ft=r=>Math.max(-1,Math.min(1,r));function wn(r,e="XYZ"){const t=yr(r),n=new te;let i=0,o=0,s=0;switch(e){case"XYZ":o=Math.asin(ft(t[0][2])),Math.abs(t[0][2])<.9999999?(i=Math.atan2(-t[1][2],t[2][2]),s=Math.atan2(-t[0][1],t[0][0])):(i=Math.atan2(t[2][1],t[1][1]),s=0);break;case"YXZ":i=Math.asin(-ft(t[1][2])),Math.abs(t[1][2])<.9999999?(o=Math.atan2(t[0][2],t[2][2]),s=Math.atan2(t[1][0],t[1][1])):(o=Math.atan2(-t[2][0],t[0][0]),s=0);break;case"ZXY":i=Math.asin(ft(t[2][1])),Math.abs(t[2][1])<.9999999?(o=Math.atan2(-t[2][0],t[2][2]),s=Math.atan2(-t[0][1],t[1][1])):(o=0,s=Math.atan2(t[1][0],t[0][0]));break;case"ZYX":o=Math.asin(-ft(t[2][0])),Math.abs(t[2][0])<.9999999?(i=Math.atan2(t[2][1],t[2][2]),s=Math.atan2(t[1][0],t[0][0])):(i=0,s=Math.atan2(-t[0][1],t[1][1]));break;case"YZX":s=Math.asin(ft(t[1][0])),Math.abs(t[1][0])<.9999999?(i=Math.atan2(-t[1][2],t[1][1]),o=Math.atan2(-t[2][0],t[0][0])):(i=0,o=Math.atan2(t[0][2],t[2][2]));break;case"XZY":s=Math.asin(-ft(t[0][1])),Math.abs(t[0][1])<.9999999?(i=Math.atan2(t[2][1],t[1][1]),o=Math.atan2(t[0][2],t[0][0])):(i=Math.atan2(-t[1][2],t[2][2]),o=0);break}return n.set(i,o,s),n}class qe{loc;quat;scale;constructor(){this.loc=new te,this.quat=new Te,this.scale=new te(1,1,1)}set(e){if(e instanceof qe)this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale);else{const t=e.trans;this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)}return this}write(e){e instanceof Pe?(e.object.position.set(this.loc.x,this.loc.y,this.loc.z),e.object.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object.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 Tt{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.trans.loc.set(e)}setLocationNow(e){this.trans.loc.set(e)}setQuat(e){this.trans.quat.set(e)}setQuatNow(e){this.trans.quat.set(e)}setScale(e){this.trans.scale.set(e)}setScaleNow(e){this.trans.scale.set(e)}setLinvel(e){}getLinvel(e){return e||new te}setAngvel(e){}getAngvel(e){return e||new te}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class zn{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||new te}setAngvel(e){}getAngvel(e){return e||new te}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Kn{firstTrans;trans;lastTrans;nowTime;duration;constructor(){this.firstTrans=new qe,this.trans=new qe,this.lastTrans=new qe,this.nowTime=0,this.duration=1}init(e,t){this.firstTrans.set(e),this.trans.set(e),this.lastTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.firstTrans.set(this.trans),this.lastTrans.loc.set(e),this.nowTime=0}setLocationNow(e){this.setLocation(e),this.nowTime=1}setQuat(e){this.firstTrans.set(this.trans),this.lastTrans.quat.set(e),this.nowTime=0}setQuatNow(e){this.setQuat(e),this.nowTime=1}setScale(e){this.firstTrans.set(this.trans),this.lastTrans.scale.set(e),this.nowTime=0}setScaleNow(e){this.setScale(e),this.nowTime=1}setLinvel(e){}getLinvel(e){e||(e=new te);const t=this.lastTrans.loc.x-this.firstTrans.loc.x,n=this.lastTrans.loc.y-this.firstTrans.loc.y,i=this.lastTrans.loc.z-this.firstTrans.loc.z;e.set(t,n,i);const o=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngvel(e){}getAngvel(e){e||(e=new te);const t=wn(this.firstTrans.quat,"XYZ"),n=wn(this.lastTrans.quat,"XYZ");e.set(n.x-t.x,n.y-t.y,n.z-t.z);const i=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*i*i+6*i)/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.nowTime+=e,this.nowTime>this.duration&&(this.nowTime=this.duration);const t=this.nowTime/this.duration,n=this.smoothstep(t);this.trans.set(this.firstTrans),this.trans.blend(this.lastTrans,n)}}const rt=new te,bt=new te;class Br extends Tt{up;target;constructor(e){super(),this.up=new te(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=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){rt.set(this.trans.loc),bt.set(this.target.trans.loc);const t=at(rt,bt,this.up);this.trans.quat.set(t)}}class wr extends Kn{up;target;constructor(e){super(),this.up=new te(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),rt.set(this.trans.loc),bt.set(this.target.trans.loc);const t=at(rt,bt,this.up);this.trans.quat.set(t)}}const Vn={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class Tr extends zn{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...Vn,...t},this.target=e,this.lookFrom=new te(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Pe.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e);const t=new qe;rt.set(this.trans.loc),bt.set(this.target.trans.loc);const n=at(rt,bt,this.up);n.mul(new Te(0,1,0,0)),t.quat.set(n),rt.set(this.lookFrom),rt.apply(this.target.quat),rt.add(this.target.loc),t.loc.set(rt),this.trans.loc.lerp(this.trans.loc,t.loc,1-this.options.smoothness),this.trans.quat.slerp(this.trans.quat,t.quat,1-this.options.smoothness)}}const on={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function Wn(r){return typeof r=="string"}function fn(r){return r.isMesh===!0}function Rr(r){return r.type==="RoundedBoxGeometry"}function vr(r){return r.type==="BoxGeometry"}function Qr(r){return r.type==="SphereGeometry"}function kr(r){return r.type==="IcosahedronGeometry"}function _r(r){return r.type==="CylinderGeometry"}function Sr(r){return r.type==="CapsuleGeometry"}function Lr(r){return r.isBone===!0}function xr(r){return r.isPerspectiveCamera===!0}let He;const nt=new Map;class Rt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Rt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Rt.RAPIER=e,He=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new He.World(e.gravity);return new pn(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class pn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new He.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,i)=>{const o=nt.get(t),s=nt.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:i})}),e}}class Tn{trans;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...on,...e},this.trans=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=He.RigidBodyDesc.dynamic();break;case"kinematic":e=He.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=He.RigidBodyDesc.fixed();break}return e.setTranslation(this.trans.loc.x,this.trans.loc.y,this.trans.loc.z),e.setRotation({x:this.trans.quat.x,y:this.trans.quat.y,z:this.trans.quat.z,w:this.trans.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object.traverse(i=>{if(fn(i)){const o=Fr(i.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(He.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=Nr(i),A=Rn(i.geometry);break;case"convex_hull":c=Dr(i),A=Rn(i.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((i,o)=>i+o,0);for(let i=0;i<this.colliderDescs.length;i++)this.colliderDescs[i].setRestitution(e.restitution),this.colliderDescs[i].setFriction(e.friction),this.colliderDescs[i].setMass(e.mass*(t[i]/n))}init(e,t){this.trans.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs()}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)}))}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.trans.loc.y<=0}setLocation(e){}setLocationNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.trans.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(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)}getLinvel(e){return e||(e=new te),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(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})}getAngvel(e){return e||(e=new te),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.trans.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.trans.quat.set(n.x,n.y,n.z,n.w)}}}function Nr(r){let e=null;if(fn(r)){const t=r;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const i=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}i instanceof Float32Array&&(e=He.ColliderDesc.trimesh(i,o))}return e}function Dr(r){let e=null;if(fn(r)){const t=r;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const i=n.attributes.position.array;i instanceof Float32Array&&(e=He.ColliderDesc.convexHull(i))}return e}function Rn(r){const e=r.attributes.position;if(!e)throw new Error("position attribute not found");const t=r.index,n=e.array;let i=0;const o=new se.Vector3,s=new se.Vector3,c=new se.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,b=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[b],n[b+1],n[b+2]),i+=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]),i+=o.dot(s.clone().cross(c));return Math.abs(i)/6}function Fr(r){if(Rr(r)){const e=r.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:He.ColliderDesc.roundCuboid(t-o,n-o,i-o,o),volume:2*t*2*n*2*i}}else if(vr(r)){const e=r.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:He.ColliderDesc.cuboid(t,n,i),volume:2*t*2*n*2*i}}else if(Qr(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(kr(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(_r(r)){const e=r.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(Sr(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const sn=new Rt;async function Or(){await sn.init()}const q={v0:new te,v1:new te,v2:new te,v3:new te,v4:new te,q0:new Te,q1:new Te,q2:new Te,q3:new Te,q4:new Te,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function Mr(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function Yn(r){const t=await(await fetch(r)).arrayBuffer(),n=await new Promise((i,o)=>{qn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):i(c)})});return{zipUrl:r,unzipped:n}}function xt(r,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),r.unzipped[e])return qn.strFromU8(r.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function an(r,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),r.unzipped[e]){const t=Gr(e);return new Blob([new Uint8Array(r.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const Pr={"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 Gr(r){for(const[e,t]of Object.entries(Pr))if(t.test(r))return e;return"application/octet-stream"}function Ot(r,e){if(!e)return r;const t={...r};for(const n in e)typeof r[n]=="object"&&typeof e[n]=="object"?t[n]=Ot(r[n],e[n]):t[n]=e[n];return t}const Ur=new se.SphereGeometry,Hr=new se.MeshStandardMaterial({color:16711680});let jr=new se.Mesh(Ur,Hr);class Pe{static defaultRotationOrder="XYZ";static defaultUpVector=new te(0,1,0);rotationOrder;upVector;object;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object=new se.Object3D;const t=this.initObject(e);t&&this.object.add(t),this.object.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return jr.clone()}initTransformer(e){return new Tt}setTransformer(e){q.t0.set(this.transformer.trans),e.init(q.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new Tt);else if(e==="Interpolation")this.setTransformer(new Kn);else if(e==="Billboard")this.setTransformer(new Br(t));else if(e==="InterpolationBillboard")this.setTransformer(new wr(t));else if(e==="SimplePhysics"){const n={...on,...t};this.setTransformer(new Tn(n))}}initSimplePhysics(e){const t={...on,...e};this.setTransformer(new Tn(t))}update(e){this.transformer.update(e),this.transformer.trans.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.object.add(e.object)}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.object.remove(e.object)}setBalloon(e){this.balloon?this.balloon.message=e:this.balloon=new qr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,i){}async clicked(){this.clickListener&&await this.clickListener(this)}get trans(){return this.transformer.trans.clone()}get loc(){return this.trans.loc}setLocation(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setLocation(q.v0)}setLocationNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setLocationNow(q.v0)}get quat(){return this.trans.quat}setQuat(e,t,n,i){typeof e=="number"?q.q0.set(e,t,n,i):q.q0.set(e),this.transformer.setQuat(q.q0)}setQuatNow(e,t,n,i){typeof e=="number"?q.q0.set(e,t,n,i):q.q0.set(e),this.transformer.setQuatNow(q.q0)}get scale(){return this.trans.scale}setScale(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setScale(q.v0)}setScaleNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setScaleNow(q.v0)}setRotation(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):i.set(e),i.scale(Math.PI/360);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=ht(i,o);this.setQuat(s)}setRotationNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):i.set(e);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=new Te(0,0,0,1);for(let c=0;c<3;c++)switch(o.charAt(c)){case"X":s.mul(new Te(Math.sin(i.x),0,0,Math.cos(i.x)));break;case"Y":s.mul(new Te(0,Math.sin(i.y),0,Math.cos(i.y)));break;case"Z":s.mul(new Te(0,0,Math.sin(i.z),Math.cos(i.z)));break}this.setQuatNow(s)}lookAt(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.loc):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.loc,i,o);this.setQuat(s)}lookAtNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.loc):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.loc,i,o);this.setQuatNow(s)}getUnitVecX(){return new te(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new te(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new te(0,0,1).apply(this.object.quaternion)}addLocation(e,t,n){const i=new te;i.set(this.loc),typeof e=="number"?i.add(e,t,n):i.add(e),this.setLocation(i)}addLocationNow(e,t,n){const i=new te;i.set(this.loc),typeof e=="number"?i.add(e,t,n):i.add(e),this.setLocationNow(i)}mulQuat(e,t,n,i){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,i):o.mul(e),this.setQuat(o)}mulQuatNow(e,t,n,i){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,i):o.mul(e),this.setQuatNow(o)}mulRotation(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),q.v0.scale(Math.PI/360);const i=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=ht(q.v0,i);q.q0.set(this.quat),q.q0.mul(o),this.setQuat(q.q0)}mulRotationNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),q.v0.scale(Math.PI/360);const i=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=ht(q.v0,i);q.q0.set(this.quat),q.q0.mul(o),this.setQuatNow(q.q0)}mulScale(e,t,n){q.v0.set(this.scale),typeof e=="number"?q.v0.set(q.v0.x*e,q.v0.y*t,q.v0.z*n):q.v0.set(q.v0.x*e.x,q.v0.y*e.y,q.v0.z*e.z),this.setScale(q.v0)}mulScaleNow(e,t,n){q.v0.set(this.scale),typeof e=="number"?q.v0.set(q.v0.x*e,q.v0.y*t,q.v0.z*n):q.v0.set(q.v0.x*e.x,q.v0.y*e.y,q.v0.z*e.z),this.setScaleNow(q.v0)}moveForward(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(e),this.addLocation(q.v0)}moveForwardNow(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(e),this.addLocationNow(q.v0)}moveBackward(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(-e),this.addLocation(q.v0)}moveBackwardNow(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(-e),this.addLocationNow(q.v0)}moveRight(e){q.v0.set(this.getUnitVecX()),q.v0.scale(-e),this.addLocation(q.v0)}moveRightNow(e){q.v0.set(this.getUnitVecX()),q.v0.scale(-e),this.addLocationNow(q.v0)}moveLeft(e){q.v0.set(this.getUnitVecX()),q.v0.scale(e),this.addLocation(q.v0)}moveLeftNow(e){q.v0.set(this.getUnitVecX()),q.v0.scale(e),this.addLocationNow(q.v0)}moveUp(e){q.v0.set(this.getUnitVecY()),q.v0.scale(e),this.addLocation(q.v0)}moveUpNow(e){q.v0.set(this.getUnitVecY()),q.v0.scale(e),this.addLocationNow(q.v0)}moveDown(e){q.v0.set(this.getUnitVecY()),q.v0.scale(-e),this.addLocation(q.v0)}moveDownNow(e){q.v0.set(this.getUnitVecY()),q.v0.scale(-e),this.addLocationNow(q.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)}setLinvel(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setLinvel(q.v0)}getLinvel(e){return this.transformer.getLinvel(e)}setAngvel(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setAngvel(q.v0)}getAngvel(e){return this.transformer.getAngvel(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.addForce(q.v0)}addForceAtPoint(e,t,n,i,o,s){if(typeof e=="number")if(typeof t=="number")q.v0.set(e,t,n),q.v1.set(i,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 q.v0.set(e),q.v1.set(t);this.transformer.addForceAtPoint(q.v0,q.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.addTorque(q.v0)}applyImpulse(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.applyImpulse(q.v0)}applyImpulseAtPoint(e,t,n,i,o,s){if(typeof e=="number")if(typeof t=="number")q.v0.set(e,t,n),q.v1.set(i,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 q.v0.set(e),q.v1.set(t);this.transformer.applyImpulseAtPoint(q.v0,q.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.applyTorqueImpulse(q.v0)}isGrounded(){return this.transformer.isGrounded()}}class qr{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 Jn{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 Et extends Pe{ready;actions;currentAction;stateAction;emoteAction;morphs;morphsOverwrite;constructor(e){super(e),this.actions={},this.morphs={},this.morphsOverwrite=!1,this.ready=this.asyncInit(e)}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object.clear(),this.morphs=n,this.stateAction?.enable(this.object,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.object,this.scene),t.enable(this.object,this.scene),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object,this.scene),t.enable(this.object,this.scene),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:n,idx:i}=this.morphs[e];n[i]=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.object,this.scene),this.emoteAction=void 0,this.stateAction&&(this.stateAction.enable(this.object,this.scene),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,i]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(i.loc&&o.position.set(i.loc.x,i.loc.y,i.loc.z),i.quat&&o.quaternion.set(i.quat.x,i.quat.y,i.quat.z,i.quat.w),i.scale&&o.scale.set(i.scale.x,i.scale.y,i.scale.z)),!this.morphsOverwrite&&i.morphs){for(const s of i.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.object.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class vn{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 ve=(r,e)=>()=>(e||(e={exports:{}},r(e.exports,e)),e.exports),Xn=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.VERSION=void 0,r.VERSION="9.0.1"}),Fe=ve((r,e)=>{var t=r&&r.__spreadArray||function(O,Y){for(var K=0,oe=Y.length,fe=O.length;K<oe;K++,fe++)O[fe]=Y[K];return O};Object.defineProperty(r,"__esModule",{value:!0}),r.toFastProperties=r.timer=r.peek=r.isES2015MapSupported=r.PRINT_WARNING=r.PRINT_ERROR=r.packArray=r.IDENTITY=r.NOOP=r.merge=r.groupBy=r.defaults=r.assignNoOverwrite=r.assign=r.zipObject=r.sortBy=r.indexOf=r.some=r.difference=r.every=r.isObject=r.isRegExp=r.isArray=r.partial=r.uniq=r.compact=r.reduce=r.findAll=r.find=r.cloneObj=r.cloneArr=r.contains=r.has=r.pick=r.reject=r.filter=r.dropRight=r.drop=r.isFunction=r.isUndefined=r.isString=r.forEach=r.last=r.first=r.flatten=r.map=r.mapValues=r.values=r.keys=r.isEmpty=void 0;function n(O){return O&&O.length===0}r.isEmpty=n;function i(O){return O==null?[]:Object.keys(O)}r.keys=i;function o(O){for(var Y=[],K=Object.keys(O),oe=0;oe<K.length;oe++)Y.push(O[K[oe]]);return Y}r.values=o;function s(O,Y){for(var K=[],oe=i(O),fe=0;fe<oe.length;fe++){var _e=oe[fe];K.push(Y.call(null,O[_e],_e))}return K}r.mapValues=s;function c(O,Y){for(var K=[],oe=0;oe<O.length;oe++)K.push(Y.call(null,O[oe],oe));return K}r.map=c;function A(O){for(var Y=[],K=0;K<O.length;K++){var oe=O[K];Array.isArray(oe)?Y=Y.concat(A(oe)):Y.push(oe)}return Y}r.flatten=A;function a(O){return n(O)?void 0:O[0]}r.first=a;function d(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}r.last=d;function u(O,Y){if(Array.isArray(O))for(var K=0;K<O.length;K++)Y.call(null,O[K],K);else if($(O))for(var oe=i(O),K=0;K<oe.length;K++){var fe=oe[K],_e=O[fe];Y.call(null,_e,fe)}else throw Error("non exhaustive match")}r.forEach=u;function b(O){return typeof O=="string"}r.isString=b;function f(O){return O===void 0}r.isUndefined=f;function E(O){return O instanceof Function}r.isFunction=E;function g(O,Y){return Y===void 0&&(Y=1),O.slice(Y,O.length)}r.drop=g;function l(O,Y){return Y===void 0&&(Y=1),O.slice(0,O.length-Y)}r.dropRight=l;function h(O,Y){var K=[];if(Array.isArray(O))for(var oe=0;oe<O.length;oe++){var fe=O[oe];Y.call(null,fe)&&K.push(fe)}return K}r.filter=h;function p(O,Y){return h(O,function(K){return!Y(K)})}r.reject=p;function C(O,Y){for(var K=Object.keys(O),oe={},fe=0;fe<K.length;fe++){var _e=K[fe],Be=O[_e];Y(Be)&&(oe[_e]=Be)}return oe}r.pick=C;function m(O,Y){return $(O)?O.hasOwnProperty(Y):!1}r.has=m;function y(O,Y){return z(O,function(K){return K===Y})!==void 0}r.contains=y;function _(O){for(var Y=[],K=0;K<O.length;K++)Y.push(O[K]);return Y}r.cloneArr=_;function S(O){var Y={};for(var K in O)Object.prototype.hasOwnProperty.call(O,K)&&(Y[K]=O[K]);return Y}r.cloneObj=S;function z(O,Y){for(var K=0;K<O.length;K++){var oe=O[K];if(Y.call(null,oe))return oe}}r.find=z;function Q(O,Y){for(var K=[],oe=0;oe<O.length;oe++){var fe=O[oe];Y.call(null,fe)&&K.push(fe)}return K}r.findAll=Q;function M(O,Y,K){for(var oe=Array.isArray(O),fe=oe?O:o(O),_e=oe?[]:i(O),Be=K,ce=0;ce<fe.length;ce++)Be=Y.call(null,Be,fe[ce],oe?ce:_e[ce]);return Be}r.reduce=M;function N(O){return p(O,function(Y){return Y==null})}r.compact=N;function k(O,Y){Y===void 0&&(Y=function(oe){return oe});var K=[];return M(O,function(oe,fe){var _e=Y(fe);return y(K,_e)?oe:(K.push(_e),oe.concat(fe))},[])}r.uniq=k;function D(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];var oe=[null],fe=oe.concat(Y);return Function.bind.apply(O,fe)}r.partial=D;function x(O){return Array.isArray(O)}r.isArray=x;function W(O){return O instanceof RegExp}r.isRegExp=W;function $(O){return O instanceof Object}r.isObject=$;function H(O,Y){for(var K=0;K<O.length;K++)if(!Y(O[K],K))return!1;return!0}r.every=H;function ee(O,Y){return p(O,function(K){return y(Y,K)})}r.difference=ee;function ie(O,Y){for(var K=0;K<O.length;K++)if(Y(O[K]))return!0;return!1}r.some=ie;function ue(O,Y){for(var K=0;K<O.length;K++)if(O[K]===Y)return K;return-1}r.indexOf=ue;function re(O,Y){var K=_(O);return K.sort(function(oe,fe){return Y(oe)-Y(fe)}),K}r.sortBy=re;function X(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var K={},oe=0;oe<O.length;oe++)K[O[oe]]=Y[oe];return K}r.zipObject=X;function ae(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var oe=0;oe<Y.length;oe++)for(var fe=Y[oe],_e=i(fe),Be=0;Be<_e.length;Be++){var ce=_e[Be];O[ce]=fe[ce]}return O}r.assign=ae;function de(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var oe=0;oe<Y.length;oe++)for(var fe=Y[oe],_e=i(fe),Be=0;Be<_e.length;Be++){var ce=_e[Be];m(O,ce)||(O[ce]=fe[ce])}return O}r.assignNoOverwrite=de;function P(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return de.apply(void 0,t([{}],O))}r.defaults=P;function j(O,Y){var K={};return u(O,function(oe){var fe=Y(oe),_e=K[fe];_e?_e.push(oe):K[fe]=[oe]}),K}r.groupBy=j;function U(O,Y){for(var K=S(O),oe=i(Y),fe=0;fe<oe.length;fe++){var _e=oe[fe],Be=Y[_e];K[_e]=Be}return K}r.merge=U;function Z(){}r.NOOP=Z;function J(O){return O}r.IDENTITY=J;function le(O){for(var Y=[],K=0;K<O.length;K++){var oe=O[K];Y.push(oe!==void 0?oe:void 0)}return Y}r.packArray=le;function ye(O){console&&console.error&&console.error("Error: "+O)}r.PRINT_ERROR=ye;function we(O){console&&console.warn&&console.warn("Warning: "+O)}r.PRINT_WARNING=we;function De(){return typeof Map=="function"}r.isES2015MapSupported=De;function ze(O){return O[O.length-1]}r.peek=ze;function Xe(O){var Y=new Date().getTime(),K=O(),oe=new Date().getTime(),fe=oe-Y;return{time:fe,value:K}}r.timer=Xe;function Oe(O){function Y(){}Y.prototype=O;var K=new Y;function oe(){return typeof K.bar}return oe(),oe(),O}r.toFastProperties=Oe}),gn=ve((r,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:r,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 p={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(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,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 p=this.disjunction();return this.consumeChar(")"),{type:h,value:p,loc:this.loc(l)}}d()},t.prototype.quantifier=function(l){var h,p=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 m;this.isDigit()?(m=this.integerIncludingZero(),h={atLeast:C,atMost:m}):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(p),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 gr=Object.create;var Qn=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var Er=Object.getOwnPropertyNames;var Ir=Object.getPrototypeOf,br=Object.prototype.hasOwnProperty;var Cr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Er(e))!br.call(r,i)&&i!==t&&Qn(r,i,{get:()=>e[i],enumerable:!(n=mr(e,i))||n.enumerable});return r};var yr=(r,e,t)=>(t=r!=null?gr(Ir(r)):{},Cr(e||!r||!r.__esModule?Qn(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("three"),Wn=require("fflate");function Br(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const se=Br(I);class te{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}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 te(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,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e);const s=new Te(this._x,this._y,this._z,0),c=new Te(o).conjugate();return o.mul(s).mul(c),this._x=o.x,this._y=o.y,this._z=o.z,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 Te{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,n,i){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=i):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 Te(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,i){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=i):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,i){const o=new Te(this),s=new Te;return typeof e=="number"?s.set(e,t,n,i):s.set(e),this._x=o.w*s.x+o.x*s.w+o.y*s.z-o.z*s.y,this._y=o.w*s.y-o.x*s.z+o.y*s.w+o.z*s.x,this._z=o.w*s.z+o.x*s.y-o.y*s.x+o.z*s.w,this._w=o.w*s.w-o.x*s.x-o.y*s.y-o.z*s.z,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 i=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Ye.set(t),i<0&&(i*=-1,Ye.set(-Ye.x,-Ye.y,-Ye.z,-Ye.w)),i>.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(i),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 Te;function at(r,e,t){t.normalize();const n=r.clone().sub(e).normalize(),i=new te().cross(n,t).normalize(),o=new te().cross(i,n),s=i.x,c=o.x,A=-n.x,a=i.y,d=o.y,u=-n.y,b=i.z,f=o.z,E=-n.z,g=s+d+E;if(g>0){const l=Math.sqrt(g+1)*2;return new Te((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(s>d&&s>E){const l=Math.sqrt(1+s-d-E)*2;return new Te(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(d>E){const l=Math.sqrt(1+d-s-E)*2;return new Te((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+E-s-d)*2;return new Te((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function ht(r,e="XYZ"){const t=new Te(0,0,0,1);for(let n=0;n<3;n++)switch(e.charAt(n)){case"X":t.mul(Math.sin(r.x),0,0,Math.cos(r.x));break;case"Y":t.mul(0,Math.sin(r.y),0,Math.cos(r.y));break;case"Z":t.mul(0,0,Math.sin(r.z),Math.cos(r.z));break}return t}function wr(r){const e=[[],[],[]],t=r.x+r.x,n=r.y+r.y,i=r.z+r.z,o=r.x*t,s=r.x*n,c=r.x*i,A=r.y*n,a=r.y*i,d=r.z*i,u=r.w*t,b=r.w*n,f=r.w*i;return e[0][0]=1-(A+d),e[0][1]=s-f,e[0][2]=c+b,e[1][0]=s+f,e[1][1]=1-(o+d),e[1][2]=a-u,e[2][0]=c-b,e[2][1]=a+u,e[2][2]=1-(o+A),e}const ft=r=>Math.max(-1,Math.min(1,r));function kn(r,e="XYZ"){const t=wr(r),n=new te;let i=0,o=0,s=0;switch(e){case"XYZ":o=Math.asin(ft(t[0][2])),Math.abs(t[0][2])<.9999999?(i=Math.atan2(-t[1][2],t[2][2]),s=Math.atan2(-t[0][1],t[0][0])):(i=Math.atan2(t[2][1],t[1][1]),s=0);break;case"YXZ":i=Math.asin(-ft(t[1][2])),Math.abs(t[1][2])<.9999999?(o=Math.atan2(t[0][2],t[2][2]),s=Math.atan2(t[1][0],t[1][1])):(o=Math.atan2(-t[2][0],t[0][0]),s=0);break;case"ZXY":i=Math.asin(ft(t[2][1])),Math.abs(t[2][1])<.9999999?(o=Math.atan2(-t[2][0],t[2][2]),s=Math.atan2(-t[0][1],t[1][1])):(o=0,s=Math.atan2(t[1][0],t[0][0]));break;case"ZYX":o=Math.asin(-ft(t[2][0])),Math.abs(t[2][0])<.9999999?(i=Math.atan2(t[2][1],t[2][2]),s=Math.atan2(t[1][0],t[0][0])):(i=0,s=Math.atan2(-t[0][1],t[1][1]));break;case"YZX":s=Math.asin(ft(t[1][0])),Math.abs(t[1][0])<.9999999?(i=Math.atan2(-t[1][2],t[1][1]),o=Math.atan2(-t[2][0],t[0][0])):(i=0,o=Math.atan2(t[0][2],t[2][2]));break;case"XZY":s=Math.asin(-ft(t[0][1])),Math.abs(t[0][1])<.9999999?(i=Math.atan2(t[2][1],t[1][1]),o=Math.atan2(t[0][2],t[0][0])):(i=Math.atan2(-t[1][2],t[2][2]),o=0);break}return n.set(i,o,s),n}class qe{loc;quat;scale;constructor(){this.loc=new te,this.quat=new Te,this.scale=new te(1,1,1)}set(e){if(e instanceof qe)this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale);else{const t=e.transform;this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)}return this}write(e){e instanceof Pe?(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 Tt{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 te}setAngularVelocity(e){}getAngularVelocity(e){return e||new te}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Yn{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 te}setAngularVelocity(e){}getAngularVelocity(e){return e||new te}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class pn{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 te);const t=this.endTransform.loc.x-this.startTransform.loc.x,n=this.endTransform.loc.y-this.startTransform.loc.y,i=this.endTransform.loc.z-this.startTransform.loc.z;e.set(t,n,i);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 te);const t=kn(this.startTransform.quat,"XYZ"),n=kn(this.endTransform.quat,"XYZ");e.set(n.x-t.x,n.y-t.y,n.z-t.z);const i=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*i*i+6*i)/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 te,bt=new te;class Jn extends Tt{up;target;constructor(e){super(),this.up=new te(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=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){rt.set(this.transform.loc),bt.set(this.target.transformer.transform.loc);const t=at(rt,bt,this.up);this.transform.quat.set(t)}}class Xn extends pn{up;target;constructor(e){super(),this.up=new te(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),rt.set(this.transform.loc),bt.set(this.target.transformer.transform.loc);const t=at(rt,bt,this.up);this.transform.quat.set(t)}}const Zn={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class Tr extends Yn{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...Zn,...t},this.target=e,this.lookFrom=new te(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Pe.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e);const t=new qe;rt.set(this.transform.loc),bt.set(this.target.transformer.transform.loc);const n=at(rt,bt,this.up);n.mul(new Te(0,1,0,0)),t.quat.set(n),rt.set(this.lookFrom),rt.apply(this.target.quat),rt.add(this.target.position),t.loc.set(rt),this.transform.loc.lerp(this.transform.loc,t.loc,1-this.options.smoothness),this.transform.quat.slerp(this.transform.quat,t.quat,1-this.options.smoothness)}}const on={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function $n(r){return typeof r=="string"}function gn(r){return r.isMesh===!0}function Rr(r){return r.type==="RoundedBoxGeometry"}function vr(r){return r.type==="BoxGeometry"}function Qr(r){return r.type==="SphereGeometry"}function kr(r){return r.type==="IcosahedronGeometry"}function Sr(r){return r.type==="CylinderGeometry"}function _r(r){return r.type==="CapsuleGeometry"}function Lr(r){return r.isBone===!0}function xr(r){return r.isPerspectiveCamera===!0}let He;const nt=new Map;class Rt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Rt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Rt.RAPIER=e,He=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new He.World(e.gravity);return new mn(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class mn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new He.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,i)=>{const o=nt.get(t),s=nt.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:i})}),e}}class Sn{transform;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...on,...e},this.transform=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=He.RigidBodyDesc.dynamic();break;case"kinematic":e=He.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=He.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(i=>{if(gn(i)){const o=Fr(i.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(He.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=Nr(i),A=_n(i.geometry);break;case"convex_hull":c=Dr(i),A=_n(i.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((i,o)=>i+o,0);for(let i=0;i<this.colliderDescs.length;i++)this.colliderDescs[i].setRestitution(e.restitution),this.colliderDescs[i].setFriction(e.friction),this.colliderDescs[i].setMass(e.mass*(t[i]/n))}init(e,t){this.transform.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs()}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)}))}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 te),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 te),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 Nr(r){let e=null;if(gn(r)){const t=r;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const i=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}i instanceof Float32Array&&(e=He.ColliderDesc.trimesh(i,o))}return e}function Dr(r){let e=null;if(gn(r)){const t=r;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const i=n.attributes.position.array;i instanceof Float32Array&&(e=He.ColliderDesc.convexHull(i))}return e}function _n(r){const e=r.attributes.position;if(!e)throw new Error("position attribute not found");const t=r.index,n=e.array;let i=0;const o=new se.Vector3,s=new se.Vector3,c=new se.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,b=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[b],n[b+1],n[b+2]),i+=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]),i+=o.dot(s.clone().cross(c));return Math.abs(i)/6}function Fr(r){if(Rr(r)){const e=r.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:He.ColliderDesc.roundCuboid(t-o,n-o,i-o,o),volume:2*t*2*n*2*i}}else if(vr(r)){const e=r.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:He.ColliderDesc.cuboid(t,n,i),volume:2*t*2*n*2*i}}else if(Qr(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(kr(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Sr(r)){const e=r.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(_r(r)){const e=r.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const sn=new Rt;async function Or(){await sn.init()}const q={v0:new te,v1:new te,v2:new te,v3:new te,v4:new te,q0:new Te,q1:new Te,q2:new Te,q3:new Te,q4:new Te,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function Mr(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function ei(r){const t=await(await fetch(r)).arrayBuffer(),n=await new Promise((i,o)=>{Wn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):i(c)})});return{zipUrl:r,unzipped:n}}function xt(r,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),r.unzipped[e])return Wn.strFromU8(r.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function an(r,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),r.unzipped[e]){const t=Gr(e);return new Blob([new Uint8Array(r.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const Pr={"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 Gr(r){for(const[e,t]of Object.entries(Pr))if(t.test(r))return e;return"application/octet-stream"}function Ot(r,e){if(!e)return r;const t={...r};for(const n in e)typeof r[n]=="object"&&typeof e[n]=="object"?t[n]=Ot(r[n],e[n]):t[n]=e[n];return t}const Ur=new se.SphereGeometry,Hr=new se.MeshStandardMaterial({color:16711680});let jr=new se.Mesh(Ur,Hr);class Pe{static defaultRotationOrder="XYZ";static defaultUpVector=new te(0,1,0);rotationOrder;upVector;object3D;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object3D=new se.Object3D;const t=this.initObject(e);t&&this.object3D.add(t),this.object3D.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return jr.clone()}initTransformer(e){return new Tt}setTransformer(e){q.t0.set(this.transformer.transform),e.init(q.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new Tt);else if(e==="Smooth")this.setTransformer(new pn);else if(e==="Billboard")this.setTransformer(new Jn(t));else if(e==="SmoothBillboard")this.setTransformer(new Xn(t));else if(e==="SimplePhysics"){const n={...on,...t};this.setTransformer(new Sn(n))}}initSimplePhysics(e){const t={...on,...e};this.setTransformer(new Sn(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 qr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,i){}async clicked(){this.clickListener&&await this.clickListener(this)}get transform(){return this.transformer.transform.clone()}get position(){return this.transform.loc}setPosition(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setPosition(q.v0)}setPositionNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setPositionNow(q.v0)}get quat(){return this.transform.quat}setQuat(e,t,n,i){typeof e=="number"?q.q0.set(e,t,n,i):q.q0.set(e),this.transformer.setQuat(q.q0)}setQuatNow(e,t,n,i){typeof e=="number"?q.q0.set(e,t,n,i):q.q0.set(e),this.transformer.setQuatNow(q.q0)}get scale(){return this.transform.scale}setScale(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setScale(q.v0)}setScaleNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setScaleNow(q.v0)}setRotation(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):i.set(e),i.scale(Math.PI/360);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=ht(i,o);this.setQuat(s)}setRotationNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):i.set(e);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=new Te(0,0,0,1);for(let c=0;c<3;c++)switch(o.charAt(c)){case"X":s.mul(new Te(Math.sin(i.x),0,0,Math.cos(i.x)));break;case"Y":s.mul(new Te(0,Math.sin(i.y),0,Math.cos(i.y)));break;case"Z":s.mul(new Te(0,0,Math.sin(i.z),Math.cos(i.z)));break}this.setQuatNow(s)}lookAt(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.position):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.position,i,o);this.setQuat(s)}lookAtNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.position):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.position,i,o);this.setQuatNow(s)}getUnitVecX(){return new te(1,0,0).apply(this.object3D.quaternion)}getUnitVecY(){return new te(0,1,0).apply(this.object3D.quaternion)}getUnitVecZ(){return new te(0,0,1).apply(this.object3D.quaternion)}translate(e,t,n){const i=new te;i.set(this.position),typeof e=="number"?i.add(e,t,n):i.add(e),this.setPosition(i)}addLocationNow(e,t,n){const i=new te;i.set(this.position),typeof e=="number"?i.add(e,t,n):i.add(e),this.setPositionNow(i)}mulQuat(e,t,n,i){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,i):o.mul(e),this.setQuat(o)}mulQuatNow(e,t,n,i){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,i):o.mul(e),this.setQuatNow(o)}mulRotation(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),q.v0.scale(Math.PI/360);const i=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=ht(q.v0,i);q.q0.set(this.quat),q.q0.mul(o),this.setQuat(q.q0)}mulRotationNow(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),q.v0.scale(Math.PI/360);const i=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=ht(q.v0,i);q.q0.set(this.quat),q.q0.mul(o),this.setQuatNow(q.q0)}scaleBy(e,t,n){q.v0.set(this.scale),typeof e=="number"?q.v0.set(q.v0.x*e,q.v0.y*t,q.v0.z*n):q.v0.set(q.v0.x*e.x,q.v0.y*e.y,q.v0.z*e.z),this.setScale(q.v0)}mulScaleNow(e,t,n){q.v0.set(this.scale),typeof e=="number"?q.v0.set(q.v0.x*e,q.v0.y*t,q.v0.z*n):q.v0.set(q.v0.x*e.x,q.v0.y*e.y,q.v0.z*e.z),this.setScaleNow(q.v0)}moveForward(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(e),this.translate(q.v0)}moveForwardNow(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(e),this.addLocationNow(q.v0)}moveBackward(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(-e),this.translate(q.v0)}moveBackwardNow(e){q.v0.set(this.getUnitVecZ()),q.v0.scale(-e),this.addLocationNow(q.v0)}moveRight(e){q.v0.set(this.getUnitVecX()),q.v0.scale(-e),this.translate(q.v0)}moveRightNow(e){q.v0.set(this.getUnitVecX()),q.v0.scale(-e),this.addLocationNow(q.v0)}moveLeft(e){q.v0.set(this.getUnitVecX()),q.v0.scale(e),this.translate(q.v0)}moveLeftNow(e){q.v0.set(this.getUnitVecX()),q.v0.scale(e),this.addLocationNow(q.v0)}moveUp(e){q.v0.set(this.getUnitVecY()),q.v0.scale(e),this.translate(q.v0)}moveUpNow(e){q.v0.set(this.getUnitVecY()),q.v0.scale(e),this.addLocationNow(q.v0)}moveDown(e){q.v0.set(this.getUnitVecY()),q.v0.scale(-e),this.translate(q.v0)}moveDownNow(e){q.v0.set(this.getUnitVecY()),q.v0.scale(-e),this.addLocationNow(q.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"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setLinearVelocity(q.v0)}getLinearVelocity(e){return this.transformer.getLinearVelocity(e)}setAngularVelocity(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.setAngularVelocity(q.v0)}getAngularVelocity(e){return this.transformer.getAngularVelocity(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.addForce(q.v0)}addForceAtPoint(e,t,n,i,o,s){if(typeof e=="number")if(typeof t=="number")q.v0.set(e,t,n),q.v1.set(i,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 q.v0.set(e),q.v1.set(t);this.transformer.addForceAtPoint(q.v0,q.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.addTorque(q.v0)}applyImpulse(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.applyImpulse(q.v0)}applyImpulseAtPoint(e,t,n,i,o,s){if(typeof e=="number")if(typeof t=="number")q.v0.set(e,t,n),q.v1.set(i,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 q.v0.set(e),q.v1.set(t);this.transformer.applyImpulseAtPoint(q.v0,q.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?q.v0.set(e,t,n):q.v0.set(e),this.transformer.applyTorqueImpulse(q.v0)}isGrounded(){return this.transformer.isGrounded()}}class qr{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 En{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 Et extends Pe{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:i}=this.morphs[e];n[i]=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,i]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(i.loc&&o.position.set(i.loc.x,i.loc.y,i.loc.z),i.quat&&o.quaternion.set(i.quat.x,i.quat.y,i.quat.z,i.quat.w),i.scale&&o.scale.set(i.scale.x,i.scale.y,i.scale.z)),!this.overwriteMorphs&&i.morphs){for(const s of i.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 Ln{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 ve=(r,e)=>()=>(e||(e={exports:{}},r(e.exports,e)),e.exports),ti=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.VERSION=void 0,r.VERSION="9.0.1"}),Fe=ve((r,e)=>{var t=r&&r.__spreadArray||function(O,Y){for(var K=0,oe=Y.length,fe=O.length;K<oe;K++,fe++)O[fe]=Y[K];return O};Object.defineProperty(r,"__esModule",{value:!0}),r.toFastProperties=r.timer=r.peek=r.isES2015MapSupported=r.PRINT_WARNING=r.PRINT_ERROR=r.packArray=r.IDENTITY=r.NOOP=r.merge=r.groupBy=r.defaults=r.assignNoOverwrite=r.assign=r.zipObject=r.sortBy=r.indexOf=r.some=r.difference=r.every=r.isObject=r.isRegExp=r.isArray=r.partial=r.uniq=r.compact=r.reduce=r.findAll=r.find=r.cloneObj=r.cloneArr=r.contains=r.has=r.pick=r.reject=r.filter=r.dropRight=r.drop=r.isFunction=r.isUndefined=r.isString=r.forEach=r.last=r.first=r.flatten=r.map=r.mapValues=r.values=r.keys=r.isEmpty=void 0;function n(O){return O&&O.length===0}r.isEmpty=n;function i(O){return O==null?[]:Object.keys(O)}r.keys=i;function o(O){for(var Y=[],K=Object.keys(O),oe=0;oe<K.length;oe++)Y.push(O[K[oe]]);return Y}r.values=o;function s(O,Y){for(var K=[],oe=i(O),fe=0;fe<oe.length;fe++){var Se=oe[fe];K.push(Y.call(null,O[Se],Se))}return K}r.mapValues=s;function c(O,Y){for(var K=[],oe=0;oe<O.length;oe++)K.push(Y.call(null,O[oe],oe));return K}r.map=c;function A(O){for(var Y=[],K=0;K<O.length;K++){var oe=O[K];Array.isArray(oe)?Y=Y.concat(A(oe)):Y.push(oe)}return Y}r.flatten=A;function a(O){return n(O)?void 0:O[0]}r.first=a;function d(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}r.last=d;function u(O,Y){if(Array.isArray(O))for(var K=0;K<O.length;K++)Y.call(null,O[K],K);else if($(O))for(var oe=i(O),K=0;K<oe.length;K++){var fe=oe[K],Se=O[fe];Y.call(null,Se,fe)}else throw Error("non exhaustive match")}r.forEach=u;function b(O){return typeof O=="string"}r.isString=b;function f(O){return O===void 0}r.isUndefined=f;function E(O){return O instanceof Function}r.isFunction=E;function g(O,Y){return Y===void 0&&(Y=1),O.slice(Y,O.length)}r.drop=g;function l(O,Y){return Y===void 0&&(Y=1),O.slice(0,O.length-Y)}r.dropRight=l;function h(O,Y){var K=[];if(Array.isArray(O))for(var oe=0;oe<O.length;oe++){var fe=O[oe];Y.call(null,fe)&&K.push(fe)}return K}r.filter=h;function p(O,Y){return h(O,function(K){return!Y(K)})}r.reject=p;function C(O,Y){for(var K=Object.keys(O),oe={},fe=0;fe<K.length;fe++){var Se=K[fe],Be=O[Se];Y(Be)&&(oe[Se]=Be)}return oe}r.pick=C;function m(O,Y){return $(O)?O.hasOwnProperty(Y):!1}r.has=m;function y(O,Y){return z(O,function(K){return K===Y})!==void 0}r.contains=y;function S(O){for(var Y=[],K=0;K<O.length;K++)Y.push(O[K]);return Y}r.cloneArr=S;function _(O){var Y={};for(var K in O)Object.prototype.hasOwnProperty.call(O,K)&&(Y[K]=O[K]);return Y}r.cloneObj=_;function z(O,Y){for(var K=0;K<O.length;K++){var oe=O[K];if(Y.call(null,oe))return oe}}r.find=z;function Q(O,Y){for(var K=[],oe=0;oe<O.length;oe++){var fe=O[oe];Y.call(null,fe)&&K.push(fe)}return K}r.findAll=Q;function M(O,Y,K){for(var oe=Array.isArray(O),fe=oe?O:o(O),Se=oe?[]:i(O),Be=K,ce=0;ce<fe.length;ce++)Be=Y.call(null,Be,fe[ce],oe?ce:Se[ce]);return Be}r.reduce=M;function N(O){return p(O,function(Y){return Y==null})}r.compact=N;function k(O,Y){Y===void 0&&(Y=function(oe){return oe});var K=[];return M(O,function(oe,fe){var Se=Y(fe);return y(K,Se)?oe:(K.push(Se),oe.concat(fe))},[])}r.uniq=k;function D(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];var oe=[null],fe=oe.concat(Y);return Function.bind.apply(O,fe)}r.partial=D;function x(O){return Array.isArray(O)}r.isArray=x;function W(O){return O instanceof RegExp}r.isRegExp=W;function $(O){return O instanceof Object}r.isObject=$;function H(O,Y){for(var K=0;K<O.length;K++)if(!Y(O[K],K))return!1;return!0}r.every=H;function ee(O,Y){return p(O,function(K){return y(Y,K)})}r.difference=ee;function ie(O,Y){for(var K=0;K<O.length;K++)if(Y(O[K]))return!0;return!1}r.some=ie;function ue(O,Y){for(var K=0;K<O.length;K++)if(O[K]===Y)return K;return-1}r.indexOf=ue;function re(O,Y){var K=S(O);return K.sort(function(oe,fe){return Y(oe)-Y(fe)}),K}r.sortBy=re;function X(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var K={},oe=0;oe<O.length;oe++)K[O[oe]]=Y[oe];return K}r.zipObject=X;function ae(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var oe=0;oe<Y.length;oe++)for(var fe=Y[oe],Se=i(fe),Be=0;Be<Se.length;Be++){var ce=Se[Be];O[ce]=fe[ce]}return O}r.assign=ae;function de(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var oe=0;oe<Y.length;oe++)for(var fe=Y[oe],Se=i(fe),Be=0;Be<Se.length;Be++){var ce=Se[Be];m(O,ce)||(O[ce]=fe[ce])}return O}r.assignNoOverwrite=de;function P(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return de.apply(void 0,t([{}],O))}r.defaults=P;function j(O,Y){var K={};return u(O,function(oe){var fe=Y(oe),Se=K[fe];Se?Se.push(oe):K[fe]=[oe]}),K}r.groupBy=j;function U(O,Y){for(var K=_(O),oe=i(Y),fe=0;fe<oe.length;fe++){var Se=oe[fe],Be=Y[Se];K[Se]=Be}return K}r.merge=U;function Z(){}r.NOOP=Z;function J(O){return O}r.IDENTITY=J;function le(O){for(var Y=[],K=0;K<O.length;K++){var oe=O[K];Y.push(oe!==void 0?oe:void 0)}return Y}r.packArray=le;function ye(O){console&&console.error&&console.error("Error: "+O)}r.PRINT_ERROR=ye;function we(O){console&&console.warn&&console.warn("Warning: "+O)}r.PRINT_WARNING=we;function De(){return typeof Map=="function"}r.isES2015MapSupported=De;function ze(O){return O[O.length-1]}r.peek=ze;function Xe(O){var Y=new Date().getTime(),K=O(),oe=new Date().getTime(),fe=oe-Y;return{time:fe,value:K}}r.timer=Xe;function Oe(O){function Y(){}Y.prototype=O;var K=new Y;function oe(){return typeof K.bar}return oe(),oe(),O}r.toFastProperties=Oe}),In=ve((r,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:r,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 p={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(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,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 p=this.disjunction();return this.consumeChar(")"),{type:h,value:p,loc:this.loc(l)}}d()},t.prototype.quantifier=function(l){var h,p=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 m;this.isDigit()?(m=this.integerIncludingZero(),h={atLeast:C,atMost:m}):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(p),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=b;break;case"D":l=b,h=!0;break;case"s":l=E;break;case"S":l=E,h=!0;break;case"w":l=f;break;case"W":l=f,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 p=this.classAtom(),C=p.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var m=this.classAtom(),y=m.type==="Character";if(y){if(m.value<p.value)throw Error("Range out of order in character class");l.push({from:p.value,to:m.value})}else c(p.value,l),l.push(s("-")),c(m.value,l)}else c(p.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 i.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="",p=0;p<l;p++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");h+=C}var m=parseInt(h,16);return{type:"Character",value:m}},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]/,i=/[0-9]/,o=/[1-9]/;function s(l){return l.charCodeAt(0)}function c(l,h){l.length!==void 0?l.forEach(function(p){h.push(p)}):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,b=[];for(u=s("0");u<=s("9");u++)b.push(u);var f=[s("_")].concat(b);for(u=s("a");u<=s("z");u++)f.push(u);for(u=s("A");u<=s("Z");u++)f.push(u);var E=[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 p=l[h];l.hasOwnProperty(h)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.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"}})}),mn=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clearRegExpParserCache=r.getRegExpAst=void 0;var e=gn(),t={},n=new e.RegExpParser;function i(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}r.getRegExpAst=i;function o(){t={}}r.clearRegExpParserCache=o}),zr=ve(r=>{var e=r&&r.__extends||(function(){var g=function(l,h){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var m in C)Object.prototype.hasOwnProperty.call(C,m)&&(p[m]=C[m])},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 p(){this.constructor=l}l.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.canMatchCharCode=r.firstCharOptimizedIndices=r.getOptimizedStartCodesIndices=r.failedOptimizationPrefixMsg=void 0;var t=gn(),n=Fe(),i=mn(),o=Zn(),s="Complement Sets are not supported for first char optimization";r.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 p=l[h];l.hasOwnProperty(h)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.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=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clearRegExpParserCache=r.getRegExpAst=void 0;var e=In(),t={},n=new e.RegExpParser;function i(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}r.getRegExpAst=i;function o(){t={}}r.clearRegExpParserCache=o}),zr=ve(r=>{var e=r&&r.__extends||(function(){var g=function(l,h){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var m in C)Object.prototype.hasOwnProperty.call(C,m)&&(p[m]=C[m])},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 p(){this.constructor=l}l.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.canMatchCharCode=r.firstCharOptimizedIndices=r.getOptimizedStartCodesIndices=r.failedOptimizationPrefixMsg=void 0;var t=In(),n=Fe(),i=bn(),o=ni(),s="Complement Sets are not supported for first char optimization";r.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
10
10
  `;function c(g,l){l===void 0&&(l=!1);try{var h=i.getRegExpAst(g),p=A(h.value,{},h.flags.ignoreCase);return p}catch(m){if(m.message===s)l&&n.PRINT_WARNING(""+r.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,17 +15,17 @@
15
15
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),n.PRINT_ERROR(r.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[]}r.getOptimizedStartCodesIndices=c;function A(g,l,h){switch(g.type){case"Disjunction":for(var p=0;p<g.value.length;p++)A(g.value[p],l,h);break;case"Alternative":for(var C=g.value,p=0;p<C.length;p++){var m=C[p];switch(m.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=m;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 Q=z;if(h===!0)for(var M=Q.from;M<=Q.to;M++)a(M,l,h);else{for(var M=Q.from;M<=Q.to&&M<o.minOptimizationVal;M++)a(M,l,h);if(Q.to>=o.minOptimizationVal)for(var N=Q.from>=o.minOptimizationVal?Q.from:o.minOptimizationVal,k=Q.to,D=o.charCodeToOptimizedIndex(N),x=o.charCodeToOptimizedIndex(k),W=D;W<=x;W++)l[W]=W}}});break;case"Group":A(y.value,l,h);break;default:throw Error("Non Exhaustive Match")}var _=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&b(y)===!1||y.type!=="Group"&&_===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}r.firstCharOptimizedIndices=A;function a(g,l,h){var p=o.charCodeToOptimizedIndex(g);l[p]=p,h===!0&&d(g,l)}function d(g,l){var h=String.fromCharCode(g),p=h.toUpperCase();if(p!==h){var C=o.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var m=h.toLowerCase();if(m!==h){var C=o.charCodeToOptimizedIndex(m.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 p=h;return n.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?n.isArray(g.value)?n.every(g.value,b):b(g.value):!1}var f=(function(g){e(l,g);function l(h){var p=g.call(this)||this;return p.targetCharCodes=h,p.found=!1,p}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 E(g,l){if(l instanceof RegExp){var h=i.getRegExpAst(l),p=new f(g);return p.visit(h),p.found}else return n.find(l,function(C){return n.contains(g,C.charCodeAt(0))})!==void 0}r.canMatchCharCode=E}),Zn=ve(r=>{var e=r&&r.__extends||(function(){var P=function(j,U){return P=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])},P(j,U)};return function(j,U){if(typeof U!="function"&&U!==null)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");P(j,U);function Z(){this.constructor=j}j.prototype=U===null?Object.create(U):(Z.prototype=U.prototype,new Z)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.charCodeToOptimizedIndex=r.minOptimizationVal=r.buildLineBreakIssueMessage=r.LineTerminatorOptimizedTester=r.isShortPattern=r.isCustomPattern=r.cloneEmptyGroups=r.performWarningRuntimeChecks=r.performRuntimeChecks=r.addStickyFlag=r.addStartOfInput=r.findUnreachablePatterns=r.findModesThatDoNotExist=r.findInvalidGroupType=r.findDuplicatePatterns=r.findUnsupportedFlags=r.findStartOfInputAnchor=r.findEmptyMatchRegExps=r.findEndOfInputAnchor=r.findInvalidPatterns=r.findMissingPatterns=r.validatePatterns=r.analyzeTokenTypes=r.enableSticky=r.disableSticky=r.SUPPORT_STICKY=r.MODES=r.DEFAULT_MODE=void 0;var t=gn(),n=Mt(),i=Fe(),o=zr(),s=mn(),c="PATTERN";r.DEFAULT_MODE="defaultMode",r.MODES="modes",r.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){r.SUPPORT_STICKY=!1}r.disableSticky=A;function a(){r.SUPPORT_STICKY=!0}r.enableSticky=a;function d(P,j){j=i.defaults(j,{useSticky:r.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
- `],tracer:function(Be,ce){return ce()}});var U=j.tracer;U("initCharCodeToOptimizedIndexMap",function(){de()});var Z;U("Reject Lexer.NA",function(){Z=i.reject(P,function(Be){return Be[c]===n.Lexer.NA})});var J=!1,le;U("Transform Patterns",function(){J=!1,le=i.map(Z,function(Be){var ce=Be[c];if(i.isRegExp(ce)){var R=ce.source;return R.length===1&&R!=="^"&&R!=="$"&&R!=="."&&!ce.ignoreCase?R:R.length===2&&R[0]==="\\"&&!i.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],R[1])?R[1]:j.useSticky?k(ce):N(ce)}else{if(i.isFunction(ce))return J=!0,{exec:ce};if(i.has(ce,"exec"))return J=!0,ce;if(typeof ce=="string"){if(ce.length===1)return ce;var w=ce.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(w);return j.useSticky?k(T):N(T)}else throw Error("non exhaustive match")}})});var ye,we,De,ze,Xe;U("misc mapping",function(){ye=i.map(Z,function(Be){return Be.tokenTypeIdx}),we=i.map(Z,function(Be){var ce=Be.GROUP;if(ce!==n.Lexer.SKIPPED){if(i.isString(ce))return ce;if(i.isUndefined(ce))return!1;throw Error("non exhaustive match")}}),De=i.map(Z,function(Be){var ce=Be.LONGER_ALT;if(ce){var R=i.indexOf(Z,ce);return R}}),ze=i.map(Z,function(Be){return Be.PUSH_MODE}),Xe=i.map(Z,function(Be){return i.has(Be,"POP_MODE")})});var Oe;U("Line Terminator Handling",function(){var Be=ue(j.lineTerminatorCharacters);Oe=i.map(Z,function(ce){return!1}),j.positionTracking!=="onlyOffset"&&(Oe=i.map(Z,function(ce){if(i.has(ce,"LINE_BREAKS"))return ce.LINE_BREAKS;if(ee(ce,Be)===!1)return o.canMatchCharCode(Be,ce.PATTERN)}))});var O,Y,K,oe;U("Misc Mapping #2",function(){O=i.map(Z,$),Y=i.map(le,H),K=i.reduce(Z,function(Be,ce){var R=ce.GROUP;return i.isString(R)&&R!==n.Lexer.SKIPPED&&(Be[R]=[]),Be},{}),oe=i.map(le,function(Be,ce){return{pattern:le[ce],longerAlt:De[ce],canLineTerminator:Oe[ce],isCustom:O[ce],short:Y[ce],group:we[ce],push:ze[ce],pop:Xe[ce],tokenTypeIdx:ye[ce],tokenType:Z[ce]}})});var fe=!0,_e=[];return j.safeMode||U("First Char Optimization",function(){_e=i.reduce(Z,function(Be,ce,R){if(typeof ce.PATTERN=="string"){var w=ce.PATTERN.charCodeAt(0),T=ae(w);re(Be,T,oe[R])}else if(i.isArray(ce.START_CHARS_HINT)){var v;i.forEach(ce.START_CHARS_HINT,function(L){var F=typeof L=="string"?L.charCodeAt(0):L,G=ae(F);v!==G&&(v=G,re(Be,G,oe[R]))})}else if(i.isRegExp(ce.PATTERN))if(ce.PATTERN.unicode)fe=!1,j.ensureOptimizations&&i.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[]}r.getOptimizedStartCodesIndices=c;function A(g,l,h){switch(g.type){case"Disjunction":for(var p=0;p<g.value.length;p++)A(g.value[p],l,h);break;case"Alternative":for(var C=g.value,p=0;p<C.length;p++){var m=C[p];switch(m.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=m;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 Q=z;if(h===!0)for(var M=Q.from;M<=Q.to;M++)a(M,l,h);else{for(var M=Q.from;M<=Q.to&&M<o.minOptimizationVal;M++)a(M,l,h);if(Q.to>=o.minOptimizationVal)for(var N=Q.from>=o.minOptimizationVal?Q.from:o.minOptimizationVal,k=Q.to,D=o.charCodeToOptimizedIndex(N),x=o.charCodeToOptimizedIndex(k),W=D;W<=x;W++)l[W]=W}}});break;case"Group":A(y.value,l,h);break;default:throw Error("Non Exhaustive Match")}var S=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&b(y)===!1||y.type!=="Group"&&S===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}r.firstCharOptimizedIndices=A;function a(g,l,h){var p=o.charCodeToOptimizedIndex(g);l[p]=p,h===!0&&d(g,l)}function d(g,l){var h=String.fromCharCode(g),p=h.toUpperCase();if(p!==h){var C=o.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var m=h.toLowerCase();if(m!==h){var C=o.charCodeToOptimizedIndex(m.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 p=h;return n.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?n.isArray(g.value)?n.every(g.value,b):b(g.value):!1}var f=(function(g){e(l,g);function l(h){var p=g.call(this)||this;return p.targetCharCodes=h,p.found=!1,p}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 E(g,l){if(l instanceof RegExp){var h=i.getRegExpAst(l),p=new f(g);return p.visit(h),p.found}else return n.find(l,function(C){return n.contains(g,C.charCodeAt(0))})!==void 0}r.canMatchCharCode=E}),ni=ve(r=>{var e=r&&r.__extends||(function(){var P=function(j,U){return P=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])},P(j,U)};return function(j,U){if(typeof U!="function"&&U!==null)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");P(j,U);function Z(){this.constructor=j}j.prototype=U===null?Object.create(U):(Z.prototype=U.prototype,new Z)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.charCodeToOptimizedIndex=r.minOptimizationVal=r.buildLineBreakIssueMessage=r.LineTerminatorOptimizedTester=r.isShortPattern=r.isCustomPattern=r.cloneEmptyGroups=r.performWarningRuntimeChecks=r.performRuntimeChecks=r.addStickyFlag=r.addStartOfInput=r.findUnreachablePatterns=r.findModesThatDoNotExist=r.findInvalidGroupType=r.findDuplicatePatterns=r.findUnsupportedFlags=r.findStartOfInputAnchor=r.findEmptyMatchRegExps=r.findEndOfInputAnchor=r.findInvalidPatterns=r.findMissingPatterns=r.validatePatterns=r.analyzeTokenTypes=r.enableSticky=r.disableSticky=r.SUPPORT_STICKY=r.MODES=r.DEFAULT_MODE=void 0;var t=In(),n=Mt(),i=Fe(),o=zr(),s=bn(),c="PATTERN";r.DEFAULT_MODE="defaultMode",r.MODES="modes",r.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){r.SUPPORT_STICKY=!1}r.disableSticky=A;function a(){r.SUPPORT_STICKY=!0}r.enableSticky=a;function d(P,j){j=i.defaults(j,{useSticky:r.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
+ `],tracer:function(Be,ce){return ce()}});var U=j.tracer;U("initCharCodeToOptimizedIndexMap",function(){de()});var Z;U("Reject Lexer.NA",function(){Z=i.reject(P,function(Be){return Be[c]===n.Lexer.NA})});var J=!1,le;U("Transform Patterns",function(){J=!1,le=i.map(Z,function(Be){var ce=Be[c];if(i.isRegExp(ce)){var R=ce.source;return R.length===1&&R!=="^"&&R!=="$"&&R!=="."&&!ce.ignoreCase?R:R.length===2&&R[0]==="\\"&&!i.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],R[1])?R[1]:j.useSticky?k(ce):N(ce)}else{if(i.isFunction(ce))return J=!0,{exec:ce};if(i.has(ce,"exec"))return J=!0,ce;if(typeof ce=="string"){if(ce.length===1)return ce;var w=ce.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(w);return j.useSticky?k(T):N(T)}else throw Error("non exhaustive match")}})});var ye,we,De,ze,Xe;U("misc mapping",function(){ye=i.map(Z,function(Be){return Be.tokenTypeIdx}),we=i.map(Z,function(Be){var ce=Be.GROUP;if(ce!==n.Lexer.SKIPPED){if(i.isString(ce))return ce;if(i.isUndefined(ce))return!1;throw Error("non exhaustive match")}}),De=i.map(Z,function(Be){var ce=Be.LONGER_ALT;if(ce){var R=i.indexOf(Z,ce);return R}}),ze=i.map(Z,function(Be){return Be.PUSH_MODE}),Xe=i.map(Z,function(Be){return i.has(Be,"POP_MODE")})});var Oe;U("Line Terminator Handling",function(){var Be=ue(j.lineTerminatorCharacters);Oe=i.map(Z,function(ce){return!1}),j.positionTracking!=="onlyOffset"&&(Oe=i.map(Z,function(ce){if(i.has(ce,"LINE_BREAKS"))return ce.LINE_BREAKS;if(ee(ce,Be)===!1)return o.canMatchCharCode(Be,ce.PATTERN)}))});var O,Y,K,oe;U("Misc Mapping #2",function(){O=i.map(Z,$),Y=i.map(le,H),K=i.reduce(Z,function(Be,ce){var R=ce.GROUP;return i.isString(R)&&R!==n.Lexer.SKIPPED&&(Be[R]=[]),Be},{}),oe=i.map(le,function(Be,ce){return{pattern:le[ce],longerAlt:De[ce],canLineTerminator:Oe[ce],isCustom:O[ce],short:Y[ce],group:we[ce],push:ze[ce],pop:Xe[ce],tokenTypeIdx:ye[ce],tokenType:Z[ce]}})});var fe=!0,Se=[];return j.safeMode||U("First Char Optimization",function(){Se=i.reduce(Z,function(Be,ce,R){if(typeof ce.PATTERN=="string"){var w=ce.PATTERN.charCodeAt(0),T=ae(w);re(Be,T,oe[R])}else if(i.isArray(ce.START_CHARS_HINT)){var v;i.forEach(ce.START_CHARS_HINT,function(L){var F=typeof L=="string"?L.charCodeAt(0):L,G=ae(F);v!==G&&(v=G,re(Be,G,oe[R]))})}else if(i.isRegExp(ce.PATTERN))if(ce.PATTERN.unicode)fe=!1,j.ensureOptimizations&&i.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+ce.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
22
  For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var B=o.getOptimizedStartCodesIndices(ce.PATTERN,j.ensureOptimizations);i.isEmpty(B)&&(fe=!1),i.forEach(B,function(L){re(Be,L,oe[R])})}else j.ensureOptimizations&&i.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+ce.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},[])}),U("ArrayPacking",function(){_e=i.packArray(_e)}),{emptyGroups:K,patternIdxToConfig:oe,charCodeToPatternIdxToConfig:_e,hasCustom:J,canBeOptimized:fe}}r.analyzeTokenTypes=d;function u(P,j){var U=[],Z=f(P);U=U.concat(Z.errors);var J=E(Z.valid),le=J.valid;return U=U.concat(J.errors),U=U.concat(b(le)),U=U.concat(_(le)),U=U.concat(S(le,j)),U=U.concat(z(le)),U}r.validatePatterns=u;function b(P){var j=[],U=i.filter(P,function(Z){return i.isRegExp(Z[c])});return j=j.concat(l(U)),j=j.concat(C(U)),j=j.concat(m(U)),j=j.concat(y(U)),j=j.concat(h(U)),j}function f(P){var j=i.filter(P,function(J){return!i.has(J,c)}),U=i.map(j,function(J){return{message:"Token Type: ->"+J.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[J]}}),Z=i.difference(P,j);return{errors:U,valid:Z}}r.findMissingPatterns=f;function E(P){var j=i.filter(P,function(J){var le=J[c];return!i.isRegExp(le)&&!i.isFunction(le)&&!i.has(le,"exec")&&!i.isString(le)}),U=i.map(j,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=i.difference(P,j);return{errors:U,valid:Z}}r.findInvalidPatterns=E;var g=/[^\\][\$]/;function l(P){var j=(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),U=i.filter(P,function(J){var le=J[c];try{var ye=s.getRegExpAst(le),we=new j;return we.visit(ye),we.found}catch{return g.test(le.source)}}),Z=i.map(U,function(J){return{message:`Unexpected RegExp Anchor Error:
24
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),fe=!1;return Be},[])}),U("ArrayPacking",function(){Se=i.packArray(Se)}),{emptyGroups:K,patternIdxToConfig:oe,charCodeToPatternIdxToConfig:Se,hasCustom:J,canBeOptimized:fe}}r.analyzeTokenTypes=d;function u(P,j){var U=[],Z=f(P);U=U.concat(Z.errors);var J=E(Z.valid),le=J.valid;return U=U.concat(J.errors),U=U.concat(b(le)),U=U.concat(S(le)),U=U.concat(_(le,j)),U=U.concat(z(le)),U}r.validatePatterns=u;function b(P){var j=[],U=i.filter(P,function(Z){return i.isRegExp(Z[c])});return j=j.concat(l(U)),j=j.concat(C(U)),j=j.concat(m(U)),j=j.concat(y(U)),j=j.concat(h(U)),j}function f(P){var j=i.filter(P,function(J){return!i.has(J,c)}),U=i.map(j,function(J){return{message:"Token Type: ->"+J.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[J]}}),Z=i.difference(P,j);return{errors:U,valid:Z}}r.findMissingPatterns=f;function E(P){var j=i.filter(P,function(J){var le=J[c];return!i.isRegExp(le)&&!i.isFunction(le)&&!i.has(le,"exec")&&!i.isString(le)}),U=i.map(j,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=i.difference(P,j);return{errors:U,valid:Z}}r.findInvalidPatterns=E;var g=/[^\\][\$]/;function l(P){var j=(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),U=i.filter(P,function(J){var le=J[c];try{var ye=s.getRegExpAst(le),we=new j;return we.visit(ye),we.found}catch{return g.test(le.source)}}),Z=i.map(U,function(J){return{message:`Unexpected RegExp Anchor Error:
25
25
  Token Type: ->`+J.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
26
  See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[J]}});return Z}r.findEndOfInputAnchor=l;function h(P){var j=i.filter(P,function(Z){var J=Z[c];return J.test("")}),U=i.map(j,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 U}r.findEmptyMatchRegExps=h;var p=/[^\\[][\^]|^\^/;function C(P){var j=(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),U=i.filter(P,function(J){var le=J[c];try{var ye=s.getRegExpAst(le),we=new j;return we.visit(ye),we.found}catch{return p.test(le.source)}}),Z=i.map(U,function(J){return{message:`Unexpected RegExp Anchor Error:
27
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}r.findStartOfInputAnchor=C;function m(P){var j=i.filter(P,function(Z){var J=Z[c];return J instanceof RegExp&&(J.multiline||J.global)}),U=i.map(j,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 U}r.findUnsupportedFlags=m;function y(P){var j=[],U=i.map(P,function(le){return i.reduce(P,function(ye,we){return le.PATTERN.source===we.PATTERN.source&&!i.contains(j,we)&&we.PATTERN!==n.Lexer.NA&&(j.push(we),ye.push(we)),ye},[])});U=i.compact(U);var Z=i.filter(U,function(le){return le.length>1}),J=i.map(Z,function(le){var ye=i.map(le,function(De){return De.name}),we=i.first(le).PATTERN;return{message:"The same RegExp pattern ->"+we+"<-"+("has been used in all of the following Token Types: "+ye.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return J}r.findDuplicatePatterns=y;function _(P){var j=i.filter(P,function(Z){if(!i.has(Z,"GROUP"))return!1;var J=Z.GROUP;return J!==n.Lexer.SKIPPED&&J!==n.Lexer.NA&&!i.isString(J)}),U=i.map(j,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 U}r.findInvalidGroupType=_;function S(P,j){var U=i.filter(P,function(J){return J.PUSH_MODE!==void 0&&!i.contains(j,J.PUSH_MODE)}),Z=i.map(U,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}r.findModesThatDoNotExist=S;function z(P){var j=[],U=i.reduce(P,function(Z,J,le){var ye=J.PATTERN;return ye===n.Lexer.NA||(i.isString(ye)?Z.push({str:ye,idx:le,tokenType:J}):i.isRegExp(ye)&&M(ye)&&Z.push({str:ye.source,idx:le,tokenType:J})),Z},[]);return i.forEach(P,function(Z,J){i.forEach(U,function(le){var ye=le.str,we=le.idx,De=le.tokenType;if(J<we&&Q(ye,Z.PATTERN)){var ze="Token: ->"+De.name+`<- can never be matched.
28
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[J]}});return Z}r.findStartOfInputAnchor=C;function m(P){var j=i.filter(P,function(Z){var J=Z[c];return J instanceof RegExp&&(J.multiline||J.global)}),U=i.map(j,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 U}r.findUnsupportedFlags=m;function y(P){var j=[],U=i.map(P,function(le){return i.reduce(P,function(ye,we){return le.PATTERN.source===we.PATTERN.source&&!i.contains(j,we)&&we.PATTERN!==n.Lexer.NA&&(j.push(we),ye.push(we)),ye},[])});U=i.compact(U);var Z=i.filter(U,function(le){return le.length>1}),J=i.map(Z,function(le){var ye=i.map(le,function(De){return De.name}),we=i.first(le).PATTERN;return{message:"The same RegExp pattern ->"+we+"<-"+("has been used in all of the following Token Types: "+ye.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return J}r.findDuplicatePatterns=y;function S(P){var j=i.filter(P,function(Z){if(!i.has(Z,"GROUP"))return!1;var J=Z.GROUP;return J!==n.Lexer.SKIPPED&&J!==n.Lexer.NA&&!i.isString(J)}),U=i.map(j,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 U}r.findInvalidGroupType=S;function _(P,j){var U=i.filter(P,function(J){return J.PUSH_MODE!==void 0&&!i.contains(j,J.PUSH_MODE)}),Z=i.map(U,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}r.findModesThatDoNotExist=_;function z(P){var j=[],U=i.reduce(P,function(Z,J,le){var ye=J.PATTERN;return ye===n.Lexer.NA||(i.isString(ye)?Z.push({str:ye,idx:le,tokenType:J}):i.isRegExp(ye)&&M(ye)&&Z.push({str:ye.source,idx:le,tokenType:J})),Z},[]);return i.forEach(P,function(Z,J){i.forEach(U,function(le){var ye=le.str,we=le.idx,De=le.tokenType;if(J<we&&Q(ye,Z.PATTERN)){var ze="Token: ->"+De.name+`<- can never be matched.
29
29
  `+("Because it appears AFTER the Token Type ->"+Z.name+"<-")+`in the lexer's definition.
30
30
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;j.push({message:ze,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[Z,De]})}})}),j}r.findUnreachablePatterns=z;function Q(P,j){if(i.isRegExp(j)){var U=j.exec(P);return U!==null&&U.index===0}else{if(i.isFunction(j))return j(P,0,[],{});if(i.has(j,"exec"))return j.exec(P,0,[],{});if(typeof j=="string")return j===P;throw Error("non exhaustive match")}}function M(P){var j=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return i.find(j,function(U){return P.source.indexOf(U)!==-1})===void 0}function N(P){var j=P.ignoreCase?"i":"";return new RegExp("^(?:"+P.source+")",j)}r.addStartOfInput=N;function k(P){var j=P.ignoreCase?"iy":"y";return new RegExp(""+P.source,j)}r.addStickyFlag=k;function D(P,j,U){var Z=[];return i.has(P,r.DEFAULT_MODE)||Z.push({message:"A MultiMode Lexer cannot be initialized without a <"+r.DEFAULT_MODE+`> property in its definition
31
31
  `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),i.has(P,r.MODES)||Z.push({message:"A MultiMode Lexer cannot be initialized without a <"+r.MODES+`> property in its definition
@@ -40,7 +40,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;j.
40
40
  `)+(" Root cause: "+j.errMsg+`.
41
41
  `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(j.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
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")}r.buildLineBreakIssueMessage=ie;function ue(P){var j=i.map(P,function(U){return i.isString(U)&&U.length>0?U.charCodeAt(0):U});return j}function re(P,j,U){P[j]===void 0?P[j]=[U]:P[j].push(U)}r.minOptimizationVal=256;var X=[];function ae(P){return P<r.minOptimizationVal?P:X[P]}r.charCodeToOptimizedIndex=ae;function de(){if(i.isEmpty(X)){X=new Array(65536);for(var P=0;P<65536;P++)X[P]=P>255?255+~~(P/255):P}}}),Qt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isTokenType=r.hasExtendingTokensTypesMapProperty=r.hasExtendingTokensTypesProperty=r.hasCategoriesProperty=r.hasShortKeyProperty=r.singleAssignCategoriesToksMap=r.assignCategoriesMapProp=r.assignCategoriesTokensProp=r.assignTokenDefaultProps=r.expandCategories=r.augmentTokenTypes=r.tokenIdxToClass=r.tokenShortNameIdx=r.tokenStructuredMatcherNoCategories=r.tokenStructuredMatcher=void 0;var e=Fe();function t(g,l){var h=g.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!0}r.tokenStructuredMatcher=t;function n(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}r.tokenStructuredMatcherNoCategories=n,r.tokenShortNameIdx=1,r.tokenIdxToClass={};function i(g){var l=o(g);s(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}r.augmentTokenTypes=i;function o(g){for(var l=e.cloneArr(g),h=g,p=!0;p;){h=e.compact(e.flatten(e.map(h,function(m){return m.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?p=!1:h=C}return l}r.expandCategories=o;function s(g){e.forEach(g,function(l){d(l)||(r.tokenIdxToClass[r.tokenShortNameIdx]=l,l.tokenTypeIdx=r.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),f(l)||(l.categoryMatchesMap={})})}r.assignTokenDefaultProps=s;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,p){l.categoryMatches.push(r.tokenIdxToClass[p].tokenTypeIdx)})})}r.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}r.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var p=g.concat(l);e.contains(p,h)||a(p,h)})}r.singleAssignCategoriesToksMap=a;function d(g){return e.has(g,"tokenTypeIdx")}r.hasShortKeyProperty=d;function u(g){return e.has(g,"CATEGORIES")}r.hasCategoriesProperty=u;function b(g){return e.has(g,"categoryMatches")}r.hasExtendingTokensTypesProperty=b;function f(g){return e.has(g,"categoryMatchesMap")}r.hasExtendingTokensTypesMapProperty=f;function E(g){return e.has(g,"tokenTypeIdx")}r.isTokenType=E}),$n=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defaultLexerErrorProvider=void 0,r.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,i,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),Mt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Lexer=r.LexerDefinitionErrorType=void 0;var e=Zn(),t=Fe(),n=Qt(),i=$n(),o=mn();(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"})(r.LexerDefinitionErrorType||(r.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
43
+ `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}r.buildLineBreakIssueMessage=ie;function ue(P){var j=i.map(P,function(U){return i.isString(U)&&U.length>0?U.charCodeAt(0):U});return j}function re(P,j,U){P[j]===void 0?P[j]=[U]:P[j].push(U)}r.minOptimizationVal=256;var X=[];function ae(P){return P<r.minOptimizationVal?P:X[P]}r.charCodeToOptimizedIndex=ae;function de(){if(i.isEmpty(X)){X=new Array(65536);for(var P=0;P<65536;P++)X[P]=P>255?255+~~(P/255):P}}}),Qt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isTokenType=r.hasExtendingTokensTypesMapProperty=r.hasExtendingTokensTypesProperty=r.hasCategoriesProperty=r.hasShortKeyProperty=r.singleAssignCategoriesToksMap=r.assignCategoriesMapProp=r.assignCategoriesTokensProp=r.assignTokenDefaultProps=r.expandCategories=r.augmentTokenTypes=r.tokenIdxToClass=r.tokenShortNameIdx=r.tokenStructuredMatcherNoCategories=r.tokenStructuredMatcher=void 0;var e=Fe();function t(g,l){var h=g.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!0}r.tokenStructuredMatcher=t;function n(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}r.tokenStructuredMatcherNoCategories=n,r.tokenShortNameIdx=1,r.tokenIdxToClass={};function i(g){var l=o(g);s(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}r.augmentTokenTypes=i;function o(g){for(var l=e.cloneArr(g),h=g,p=!0;p;){h=e.compact(e.flatten(e.map(h,function(m){return m.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?p=!1:h=C}return l}r.expandCategories=o;function s(g){e.forEach(g,function(l){d(l)||(r.tokenIdxToClass[r.tokenShortNameIdx]=l,l.tokenTypeIdx=r.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),f(l)||(l.categoryMatchesMap={})})}r.assignTokenDefaultProps=s;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,p){l.categoryMatches.push(r.tokenIdxToClass[p].tokenTypeIdx)})})}r.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}r.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var p=g.concat(l);e.contains(p,h)||a(p,h)})}r.singleAssignCategoriesToksMap=a;function d(g){return e.has(g,"tokenTypeIdx")}r.hasShortKeyProperty=d;function u(g){return e.has(g,"CATEGORIES")}r.hasCategoriesProperty=u;function b(g){return e.has(g,"categoryMatches")}r.hasExtendingTokensTypesProperty=b;function f(g){return e.has(g,"categoryMatchesMap")}r.hasExtendingTokensTypesMapProperty=f;function E(g){return e.has(g,"tokenTypeIdx")}r.isTokenType=E}),ii=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defaultLexerErrorProvider=void 0,r.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,i,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),Mt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Lexer=r.LexerDefinitionErrorType=void 0;var e=ni(),t=Fe(),n=Qt(),i=ii(),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"})(r.LexerDefinitionErrorType||(r.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
44
44
  `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:i.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 b=this.config.traceInitPerf;b===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof b=="number"&&(this.traceInitMaxIdent=b,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var f,E=!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)?(f={modes:{}},f.modes[e.DEFAULT_MODE]=t.cloneArr(a),f[e.DEFAULT_MODE]=e.DEFAULT_MODE):(E=!1,f=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))})),f.modes=f.modes?f.modes:{},t.forEach(f.modes,function(p,C){f.modes[C]=t.reject(p,function(m){return t.isUndefined(m)})});var g=t.keys(f.modes);if(t.forEach(f.modes,function(p,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(p,g))}),t.isEmpty(u.lexerDefinitionErrors)){n.augmentTokenTypes(p);var m;u.TRACE_INIT("analyzeTokenTypes",function(){m=e.analyzeTokenTypes(p,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:d.positionTracking,ensureOptimizations:d.ensureOptimizations,safeMode:d.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=m.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=m.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,m.emptyGroups),u.hasCustom=m.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=m.canBeOptimized}})}),u.defaultMode=f.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(p){return p.message}),h=l.join(`-----------------------
@@ -49,8 +49,8 @@ a boolean 2nd argument is no longer supported`);this.config=t.merge(s,d);var b=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(E){return E.message}),b=u.join(`-----------------------
51
51
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
52
- `+b)}var f=this.tokenizeInternal(a,d);return f},A.prototype.tokenizeInternal=function(a,d){var u=this,b,f,E,g,l,h,p,C,m,y,_,S,z,Q,M=a,N=M.length,k=0,D=0,x=this.hasCustom?0:Math.floor(a.length/10),W=new Array(x),$=[],H=this.trackStartLines?1:void 0,ee=this.trackStartLines?1:void 0,ie=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,re=this.config.lineTerminatorsPattern,X=0,ae=[],de=[],P=[],j=[];Object.freeze(j);var U=void 0;function Z(){return ae}function J(v){var B=e.charCodeToOptimizedIndex(v),L=de[B];return L===void 0?j:L}var le=function(v){if(P.length===1&&v.tokenType.PUSH_MODE===void 0){var B=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(v);$.push({offset:v.startOffset,line:v.startLine!==void 0?v.startLine:void 0,column:v.startColumn!==void 0?v.startColumn:void 0,length:v.image.length,message:B})}else{P.pop();var L=t.last(P);ae=u.patternIdxToConfig[L],de=u.charCodeToPatternIdxToConfig[L],X=ae.length;var F=u.canModeBeOptimized[L]&&u.config.safeMode===!1;de&&F?U=J:U=Z}};function ye(v){P.push(v),de=this.charCodeToPatternIdxToConfig[v],ae=this.patternIdxToConfig[v],X=ae.length,X=ae.length;var B=this.canModeBeOptimized[v]&&this.config.safeMode===!1;de&&B?U=J:U=Z}ye.call(this,d);for(var we;k<N;){l=null;var De=M.charCodeAt(k),ze=U(De),Xe=ze.length;for(b=0;b<Xe;b++){we=ze[b];var Oe=we.pattern;h=null;var O=we.short;if(O!==!1?De===O&&(l=Oe):we.isCustom===!0?(Q=Oe.exec(M,k,W,ie),Q!==null?(l=Q[0],Q.payload!==void 0&&(h=Q.payload)):l=null):(this.updateLastIndex(Oe,k),l=this.match(Oe,a,k)),l!==null){if(g=we.longerAlt,g!==void 0){var Y=ae[g],K=Y.pattern;p=null,Y.isCustom===!0?(Q=K.exec(M,k,W,ie),Q!==null?(E=Q[0],Q.payload!==void 0&&(p=Q.payload)):E=null):(this.updateLastIndex(K,k),E=this.match(K,a,k)),E&&E.length>l.length&&(l=E,h=p,we=Y)}break}}if(l!==null){if(C=l.length,m=we.group,m!==void 0&&(y=we.tokenTypeIdx,_=this.createTokenInstance(l,k,y,we.tokenType,H,ee,C),this.handlePayload(_,h),m===!1?D=this.addToken(W,D,_):ie[m].push(_)),a=this.chopInput(a,C),k=k+C,ee=this.computeNewColumn(ee,C),ue===!0&&we.canLineTerminator===!0){var oe=0,fe=void 0,_e=void 0;re.lastIndex=0;do fe=re.test(l),fe===!0&&(_e=re.lastIndex-1,oe++);while(fe===!0);oe!==0&&(H=H+oe,ee=C-_e,this.updateTokenEndLineColumnLocation(_,m,_e,oe,H,ee,C))}this.handleModes(we,le,ye,_)}else{for(var Be=k,ce=H,R=ee,w=!1;!w&&k<N;)for(M.charCodeAt(k),a=this.chopInput(a,1),k++,f=0;f<X;f++){var T=ae[f],Oe=T.pattern,O=T.short;if(O!==!1?M.charCodeAt(k)===O&&(w=!0):T.isCustom===!0?w=Oe.exec(M,k,W,ie)!==null:(this.updateLastIndex(Oe,k),w=Oe.exec(a)!==null),w===!0)break}S=k-Be,z=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Be,S,ce,R),$.push({offset:Be,line:ce,column:R,length:S,message:z})}}return this.hasCustom||(W.length=D),{tokens:W,groups:ie,errors:$}},A.prototype.handleModes=function(a,d,u,b){if(a.pop===!0){var f=a.push;d(b),f!==void 0&&u.call(this,f)}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,b,f,E,g){var l,h;d!==void 0&&(l=u===g-1,h=l?-1:0,b===1&&l===!0||(a.endLine=f+h,a.endColumn=E-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,b){return{image:a,startOffset:d,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,d,u,b,f,E){return{image:a,startOffset:d,startLine:f,startColumn:E,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,d,u,b,f,E,g){return{image:a,startOffset:d,endOffset:d+g-1,startLine:f,endLine:f,startColumn:E,endColumn:E+g-1,tokenTypeIdx:u,tokenType:b}},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 b=a.test(d);return b===!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 b=t.timer(d),f=b.time,E=b.value,g=f>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+f+"ms"),this.traceInitIndent--,E}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})();r.Lexer=c}),dt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tokenMatcher=r.createTokenInstance=r.EOF=r.createToken=r.hasTokenLabel=r.tokenName=r.tokenLabel=void 0;var e=Fe(),t=Mt(),n=Qt();function i(m){return s(m)?m.LABEL:m.name}r.tokenLabel=i;function o(m){return m.name}r.tokenName=o;function s(m){return e.isString(m.LABEL)&&m.LABEL!==""}r.hasTokenLabel=s;var c="parent",A="categories",a="label",d="group",u="push_mode",b="pop_mode",f="longer_alt",E="line_breaks",g="start_chars_hint";function l(m){return h(m)}r.createToken=l;function h(m){var y=m.pattern,_={};if(_.name=m.name,e.isUndefined(y)||(_.PATTERN=y),e.has(m,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(m,A)&&(_.CATEGORIES=m[A]),n.augmentTokenTypes([_]),e.has(m,a)&&(_.LABEL=m[a]),e.has(m,d)&&(_.GROUP=m[d]),e.has(m,b)&&(_.POP_MODE=m[b]),e.has(m,u)&&(_.PUSH_MODE=m[u]),e.has(m,f)&&(_.LONGER_ALT=m[f]),e.has(m,E)&&(_.LINE_BREAKS=m[E]),e.has(m,g)&&(_.START_CHARS_HINT=m[g]),_}r.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([r.EOF]);function p(m,y,_,S,z,Q,M,N){return{image:y,startOffset:_,endOffset:S,startLine:z,endLine:Q,startColumn:M,endColumn:N,tokenTypeIdx:m.tokenTypeIdx,tokenType:m}}r.createTokenInstance=p;function C(m,y){return n.tokenStructuredMatcher(m,y)}r.tokenMatcher=C}),Je=ve(r=>{var e=r&&r.__extends||(function(){var h=function(p,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(m[_]=y[_])},h(p,C)};return function(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");h(p,C);function m(){this.constructor=p}p.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.serializeProduction=r.serializeGrammar=r.Terminal=r.Alternation=r.RepetitionWithSeparator=r.Repetition=r.RepetitionMandatoryWithSeparator=r.RepetitionMandatory=r.Option=r.Alternative=r.Rule=r.NonTerminal=r.AbstractProduction=void 0;var t=Fe(),n=dt(),i=(function(){function h(p){this._definition=p}return Object.defineProperty(h.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),h.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},h})();r.AbstractProduction=i;var o=(function(h){e(p,h);function p(C){var m=h.call(this,[])||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),p.prototype.accept=function(C){C.visit(this)},p})(i);r.NonTerminal=o;var s=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.orgText="",t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Rule=s;var c=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.ignoreAmbiguities=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Alternative=c;var A=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Option=A;var a=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionMandatory=a;var d=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionMandatoryWithSeparator=d;var u=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Repetition=u;var b=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionWithSeparator=b;var f=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,m.ignoreAmbiguities=!1,m.hasPredicates=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(i);r.Alternation=f;var E=(function(){function h(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return h.prototype.accept=function(p){p.visit(this)},h})();r.Terminal=E;function g(h){return t.map(h,l)}r.serializeGrammar=g;function l(h){function p(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:p(h.definition)};if(h instanceof A)return{type:"Option",idx:h.idx,definition:p(h.definition)};if(h instanceof a)return{type:"RepetitionMandatory",idx:h.idx,definition:p(h.definition)};if(h instanceof d)return{type:"RepetitionMandatoryWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof b)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof u)return{type:"Repetition",idx:h.idx,definition:p(h.definition)};if(h instanceof f)return{type:"Alternation",idx:h.idx,definition:p(h.definition)};if(h instanceof E){var C={type:"Terminal",name:h.terminalType.name,label:n.tokenLabel(h.terminalType),idx:h.idx},m=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(m)?m.source:m),C}else{if(h instanceof s)return{type:"Rule",name:h.name,orgText:h.orgText,definition:p(h.definition)};throw Error("non exhaustive match")}}r.serializeProduction=l}),En=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RestWalker=void 0;var e=Fe(),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=i(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=i(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 b=new t.Alternative({definition:[u]});a.walk(b,d)})},o})();r.RestWalker=n;function i(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}}),kt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GAstVisitor=void 0;var e=Je(),t=(function(){function n(){}return n.prototype.visit=function(i){var o=i;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(i){},n.prototype.visitAlternative=function(i){},n.prototype.visitOption=function(i){},n.prototype.visitRepetition=function(i){},n.prototype.visitRepetitionMandatory=function(i){},n.prototype.visitRepetitionMandatoryWithSeparator=function(i){},n.prototype.visitRepetitionWithSeparator=function(i){},n.prototype.visitAlternation=function(i){},n.prototype.visitTerminal=function(i){},n.prototype.visitRule=function(i){},n})();r.GAstVisitor=t}),Pt=ve(r=>{var e=r&&r.__extends||(function(){var b=function(f,E){return b=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])},b(f,E)};return function(f,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");b(f,E);function g(){this.constructor=f}f.prototype=E===null?Object.create(E):(g.prototype=E.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.collectMethods=r.DslMethodsCollectorVisitor=r.getProductionDslName=r.isBranchingProd=r.isOptionalProd=r.isSequenceProd=void 0;var t=Fe(),n=Je(),i=kt();function o(b){return b instanceof n.Alternative||b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionMandatory||b instanceof n.RepetitionMandatoryWithSeparator||b instanceof n.RepetitionWithSeparator||b instanceof n.Terminal||b instanceof n.Rule}r.isSequenceProd=o;function s(b,f){f===void 0&&(f=[]);var E=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return E?!0:b instanceof n.Alternation?t.some(b.definition,function(g){return s(g,f)}):b instanceof n.NonTerminal&&t.contains(f,b)?!1:b instanceof n.AbstractProduction?(b instanceof n.NonTerminal&&f.push(b),t.every(b.definition,function(g){return s(g,f)})):!1}r.isOptionalProd=s;function c(b){return b instanceof n.Alternation}r.isBranchingProd=c;function A(b){if(b instanceof n.NonTerminal)return"SUBRULE";if(b instanceof n.Option)return"OPTION";if(b instanceof n.Alternation)return"OR";if(b instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(b instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(b instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(b instanceof n.Repetition)return"MANY";if(b instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}r.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var E=b!==null&&b.apply(this,arguments)||this;return E.separator="-",E.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},E}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(E){var g=E.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},f.prototype.visitNonTerminal=function(E){var g=E.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},f.prototype.visitOption=function(E){this.dslMethods.option.push(E)},f.prototype.visitRepetitionWithSeparator=function(E){this.dslMethods.repetitionWithSeparator.push(E)},f.prototype.visitRepetitionMandatory=function(E){this.dslMethods.repetitionMandatory.push(E)},f.prototype.visitRepetitionMandatoryWithSeparator=function(E){this.dslMethods.repetitionMandatoryWithSeparator.push(E)},f.prototype.visitRepetition=function(E){this.dslMethods.repetition.push(E)},f.prototype.visitAlternation=function(E){this.dslMethods.alternation.push(E)},f})(i.GAstVisitor);r.DslMethodsCollectorVisitor=a;var d=new a;function u(b){d.reset(),b.accept(d);var f=d.dslMethods;return d.reset(),f}r.collectMethods=u}),ei=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.firstForTerminal=r.firstForBranching=r.firstForSequence=r.first=void 0;var e=Fe(),t=Je(),n=Pt();function i(A){if(A instanceof t.NonTerminal)return i(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")}r.first=i;function o(A){for(var a=[],d=A.definition,u=0,b=d.length>u,f,E=!0;b&&E;)f=d[u],E=n.isOptionalProd(f),a=a.concat(i(f)),u=u+1,b=d.length>u;return e.uniq(a)}r.firstForSequence=o;function s(A){var a=e.map(A.definition,function(d){return i(d)});return e.uniq(e.flatten(a))}r.firstForBranching=s;function c(A){return[A.terminalType]}r.firstForTerminal=c}),ti=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IN=void 0,r.IN="_~IN~_"}),Kr=ve(r=>{var e=r&&r.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,g){E.__proto__=g}||function(E,g){for(var l in g)Object.prototype.hasOwnProperty.call(g,l)&&(E[l]=g[l])},u(b,f)};return function(b,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(b,f);function E(){this.constructor=b}b.prototype=f===null?Object.create(f):(E.prototype=f.prototype,new E)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.buildInProdFollowPrefix=r.buildBetweenProdsFollowPrefix=r.computeAllProdsFollows=r.ResyncFollowsWalker=void 0;var t=En(),n=ei(),i=Fe(),o=ti(),s=Je(),c=(function(u){e(b,u);function b(f){var E=u.call(this)||this;return E.topProd=f,E.follows={},E}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,E,g){},b.prototype.walkProdRef=function(f,E,g){var l=a(f.referencedRule,f.idx)+this.topProd.name,h=E.concat(g),p=new s.Alternative({definition:h}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);r.ResyncFollowsWalker=c;function A(u){var b={};return i.forEach(u,function(f){var E=new c(f).startWalking();i.assign(b,E)}),b}r.computeAllProdsFollows=A;function a(u,b){return u.name+b+o.IN}r.buildBetweenProdsFollowPrefix=a;function d(u){var b=u.terminalType.name;return b+u.idx+o.IN}r.buildInProdFollowPrefix=d}),Gt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defaultGrammarValidatorErrorProvider=r.defaultGrammarResolverErrorProvider=r.defaultParserErrorProvider=void 0;var e=dt(),t=Fe(),n=Fe(),i=Je(),o=Pt();r.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,b=`
52
+ `+b)}var f=this.tokenizeInternal(a,d);return f},A.prototype.tokenizeInternal=function(a,d){var u=this,b,f,E,g,l,h,p,C,m,y,S,_,z,Q,M=a,N=M.length,k=0,D=0,x=this.hasCustom?0:Math.floor(a.length/10),W=new Array(x),$=[],H=this.trackStartLines?1:void 0,ee=this.trackStartLines?1:void 0,ie=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,re=this.config.lineTerminatorsPattern,X=0,ae=[],de=[],P=[],j=[];Object.freeze(j);var U=void 0;function Z(){return ae}function J(v){var B=e.charCodeToOptimizedIndex(v),L=de[B];return L===void 0?j:L}var le=function(v){if(P.length===1&&v.tokenType.PUSH_MODE===void 0){var B=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(v);$.push({offset:v.startOffset,line:v.startLine!==void 0?v.startLine:void 0,column:v.startColumn!==void 0?v.startColumn:void 0,length:v.image.length,message:B})}else{P.pop();var L=t.last(P);ae=u.patternIdxToConfig[L],de=u.charCodeToPatternIdxToConfig[L],X=ae.length;var F=u.canModeBeOptimized[L]&&u.config.safeMode===!1;de&&F?U=J:U=Z}};function ye(v){P.push(v),de=this.charCodeToPatternIdxToConfig[v],ae=this.patternIdxToConfig[v],X=ae.length,X=ae.length;var B=this.canModeBeOptimized[v]&&this.config.safeMode===!1;de&&B?U=J:U=Z}ye.call(this,d);for(var we;k<N;){l=null;var De=M.charCodeAt(k),ze=U(De),Xe=ze.length;for(b=0;b<Xe;b++){we=ze[b];var Oe=we.pattern;h=null;var O=we.short;if(O!==!1?De===O&&(l=Oe):we.isCustom===!0?(Q=Oe.exec(M,k,W,ie),Q!==null?(l=Q[0],Q.payload!==void 0&&(h=Q.payload)):l=null):(this.updateLastIndex(Oe,k),l=this.match(Oe,a,k)),l!==null){if(g=we.longerAlt,g!==void 0){var Y=ae[g],K=Y.pattern;p=null,Y.isCustom===!0?(Q=K.exec(M,k,W,ie),Q!==null?(E=Q[0],Q.payload!==void 0&&(p=Q.payload)):E=null):(this.updateLastIndex(K,k),E=this.match(K,a,k)),E&&E.length>l.length&&(l=E,h=p,we=Y)}break}}if(l!==null){if(C=l.length,m=we.group,m!==void 0&&(y=we.tokenTypeIdx,S=this.createTokenInstance(l,k,y,we.tokenType,H,ee,C),this.handlePayload(S,h),m===!1?D=this.addToken(W,D,S):ie[m].push(S)),a=this.chopInput(a,C),k=k+C,ee=this.computeNewColumn(ee,C),ue===!0&&we.canLineTerminator===!0){var oe=0,fe=void 0,Se=void 0;re.lastIndex=0;do fe=re.test(l),fe===!0&&(Se=re.lastIndex-1,oe++);while(fe===!0);oe!==0&&(H=H+oe,ee=C-Se,this.updateTokenEndLineColumnLocation(S,m,Se,oe,H,ee,C))}this.handleModes(we,le,ye,S)}else{for(var Be=k,ce=H,R=ee,w=!1;!w&&k<N;)for(M.charCodeAt(k),a=this.chopInput(a,1),k++,f=0;f<X;f++){var T=ae[f],Oe=T.pattern,O=T.short;if(O!==!1?M.charCodeAt(k)===O&&(w=!0):T.isCustom===!0?w=Oe.exec(M,k,W,ie)!==null:(this.updateLastIndex(Oe,k),w=Oe.exec(a)!==null),w===!0)break}_=k-Be,z=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Be,_,ce,R),$.push({offset:Be,line:ce,column:R,length:_,message:z})}}return this.hasCustom||(W.length=D),{tokens:W,groups:ie,errors:$}},A.prototype.handleModes=function(a,d,u,b){if(a.pop===!0){var f=a.push;d(b),f!==void 0&&u.call(this,f)}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,b,f,E,g){var l,h;d!==void 0&&(l=u===g-1,h=l?-1:0,b===1&&l===!0||(a.endLine=f+h,a.endColumn=E-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,b){return{image:a,startOffset:d,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,d,u,b,f,E){return{image:a,startOffset:d,startLine:f,startColumn:E,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,d,u,b,f,E,g){return{image:a,startOffset:d,endOffset:d+g-1,startLine:f,endLine:f,startColumn:E,endColumn:E+g-1,tokenTypeIdx:u,tokenType:b}},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 b=a.test(d);return b===!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 b=t.timer(d),f=b.time,E=b.value,g=f>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+f+"ms"),this.traceInitIndent--,E}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})();r.Lexer=c}),dt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tokenMatcher=r.createTokenInstance=r.EOF=r.createToken=r.hasTokenLabel=r.tokenName=r.tokenLabel=void 0;var e=Fe(),t=Mt(),n=Qt();function i(m){return s(m)?m.LABEL:m.name}r.tokenLabel=i;function o(m){return m.name}r.tokenName=o;function s(m){return e.isString(m.LABEL)&&m.LABEL!==""}r.hasTokenLabel=s;var c="parent",A="categories",a="label",d="group",u="push_mode",b="pop_mode",f="longer_alt",E="line_breaks",g="start_chars_hint";function l(m){return h(m)}r.createToken=l;function h(m){var y=m.pattern,S={};if(S.name=m.name,e.isUndefined(y)||(S.PATTERN=y),e.has(m,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(m,A)&&(S.CATEGORIES=m[A]),n.augmentTokenTypes([S]),e.has(m,a)&&(S.LABEL=m[a]),e.has(m,d)&&(S.GROUP=m[d]),e.has(m,b)&&(S.POP_MODE=m[b]),e.has(m,u)&&(S.PUSH_MODE=m[u]),e.has(m,f)&&(S.LONGER_ALT=m[f]),e.has(m,E)&&(S.LINE_BREAKS=m[E]),e.has(m,g)&&(S.START_CHARS_HINT=m[g]),S}r.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([r.EOF]);function p(m,y,S,_,z,Q,M,N){return{image:y,startOffset:S,endOffset:_,startLine:z,endLine:Q,startColumn:M,endColumn:N,tokenTypeIdx:m.tokenTypeIdx,tokenType:m}}r.createTokenInstance=p;function C(m,y){return n.tokenStructuredMatcher(m,y)}r.tokenMatcher=C}),Je=ve(r=>{var e=r&&r.__extends||(function(){var h=function(p,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(m[S]=y[S])},h(p,C)};return function(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");h(p,C);function m(){this.constructor=p}p.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.serializeProduction=r.serializeGrammar=r.Terminal=r.Alternation=r.RepetitionWithSeparator=r.Repetition=r.RepetitionMandatoryWithSeparator=r.RepetitionMandatory=r.Option=r.Alternative=r.Rule=r.NonTerminal=r.AbstractProduction=void 0;var t=Fe(),n=dt(),i=(function(){function h(p){this._definition=p}return Object.defineProperty(h.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),h.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},h})();r.AbstractProduction=i;var o=(function(h){e(p,h);function p(C){var m=h.call(this,[])||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),p.prototype.accept=function(C){C.visit(this)},p})(i);r.NonTerminal=o;var s=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.orgText="",t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Rule=s;var c=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.ignoreAmbiguities=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Alternative=c;var A=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Option=A;var a=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionMandatory=a;var d=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionMandatoryWithSeparator=d;var u=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.Repetition=u;var b=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);r.RepetitionWithSeparator=b;var f=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,m.ignoreAmbiguities=!1,m.hasPredicates=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(i);r.Alternation=f;var E=(function(){function h(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return h.prototype.accept=function(p){p.visit(this)},h})();r.Terminal=E;function g(h){return t.map(h,l)}r.serializeGrammar=g;function l(h){function p(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:p(h.definition)};if(h instanceof A)return{type:"Option",idx:h.idx,definition:p(h.definition)};if(h instanceof a)return{type:"RepetitionMandatory",idx:h.idx,definition:p(h.definition)};if(h instanceof d)return{type:"RepetitionMandatoryWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof b)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof u)return{type:"Repetition",idx:h.idx,definition:p(h.definition)};if(h instanceof f)return{type:"Alternation",idx:h.idx,definition:p(h.definition)};if(h instanceof E){var C={type:"Terminal",name:h.terminalType.name,label:n.tokenLabel(h.terminalType),idx:h.idx},m=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(m)?m.source:m),C}else{if(h instanceof s)return{type:"Rule",name:h.name,orgText:h.orgText,definition:p(h.definition)};throw Error("non exhaustive match")}}r.serializeProduction=l}),Cn=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RestWalker=void 0;var e=Fe(),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=i(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=i(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 b=new t.Alternative({definition:[u]});a.walk(b,d)})},o})();r.RestWalker=n;function i(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}}),kt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GAstVisitor=void 0;var e=Je(),t=(function(){function n(){}return n.prototype.visit=function(i){var o=i;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(i){},n.prototype.visitAlternative=function(i){},n.prototype.visitOption=function(i){},n.prototype.visitRepetition=function(i){},n.prototype.visitRepetitionMandatory=function(i){},n.prototype.visitRepetitionMandatoryWithSeparator=function(i){},n.prototype.visitRepetitionWithSeparator=function(i){},n.prototype.visitAlternation=function(i){},n.prototype.visitTerminal=function(i){},n.prototype.visitRule=function(i){},n})();r.GAstVisitor=t}),Pt=ve(r=>{var e=r&&r.__extends||(function(){var b=function(f,E){return b=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])},b(f,E)};return function(f,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");b(f,E);function g(){this.constructor=f}f.prototype=E===null?Object.create(E):(g.prototype=E.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.collectMethods=r.DslMethodsCollectorVisitor=r.getProductionDslName=r.isBranchingProd=r.isOptionalProd=r.isSequenceProd=void 0;var t=Fe(),n=Je(),i=kt();function o(b){return b instanceof n.Alternative||b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionMandatory||b instanceof n.RepetitionMandatoryWithSeparator||b instanceof n.RepetitionWithSeparator||b instanceof n.Terminal||b instanceof n.Rule}r.isSequenceProd=o;function s(b,f){f===void 0&&(f=[]);var E=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return E?!0:b instanceof n.Alternation?t.some(b.definition,function(g){return s(g,f)}):b instanceof n.NonTerminal&&t.contains(f,b)?!1:b instanceof n.AbstractProduction?(b instanceof n.NonTerminal&&f.push(b),t.every(b.definition,function(g){return s(g,f)})):!1}r.isOptionalProd=s;function c(b){return b instanceof n.Alternation}r.isBranchingProd=c;function A(b){if(b instanceof n.NonTerminal)return"SUBRULE";if(b instanceof n.Option)return"OPTION";if(b instanceof n.Alternation)return"OR";if(b instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(b instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(b instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(b instanceof n.Repetition)return"MANY";if(b instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}r.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var E=b!==null&&b.apply(this,arguments)||this;return E.separator="-",E.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},E}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(E){var g=E.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},f.prototype.visitNonTerminal=function(E){var g=E.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},f.prototype.visitOption=function(E){this.dslMethods.option.push(E)},f.prototype.visitRepetitionWithSeparator=function(E){this.dslMethods.repetitionWithSeparator.push(E)},f.prototype.visitRepetitionMandatory=function(E){this.dslMethods.repetitionMandatory.push(E)},f.prototype.visitRepetitionMandatoryWithSeparator=function(E){this.dslMethods.repetitionMandatoryWithSeparator.push(E)},f.prototype.visitRepetition=function(E){this.dslMethods.repetition.push(E)},f.prototype.visitAlternation=function(E){this.dslMethods.alternation.push(E)},f})(i.GAstVisitor);r.DslMethodsCollectorVisitor=a;var d=new a;function u(b){d.reset(),b.accept(d);var f=d.dslMethods;return d.reset(),f}r.collectMethods=u}),ri=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.firstForTerminal=r.firstForBranching=r.firstForSequence=r.first=void 0;var e=Fe(),t=Je(),n=Pt();function i(A){if(A instanceof t.NonTerminal)return i(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")}r.first=i;function o(A){for(var a=[],d=A.definition,u=0,b=d.length>u,f,E=!0;b&&E;)f=d[u],E=n.isOptionalProd(f),a=a.concat(i(f)),u=u+1,b=d.length>u;return e.uniq(a)}r.firstForSequence=o;function s(A){var a=e.map(A.definition,function(d){return i(d)});return e.uniq(e.flatten(a))}r.firstForBranching=s;function c(A){return[A.terminalType]}r.firstForTerminal=c}),oi=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IN=void 0,r.IN="_~IN~_"}),Kr=ve(r=>{var e=r&&r.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,g){E.__proto__=g}||function(E,g){for(var l in g)Object.prototype.hasOwnProperty.call(g,l)&&(E[l]=g[l])},u(b,f)};return function(b,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(b,f);function E(){this.constructor=b}b.prototype=f===null?Object.create(f):(E.prototype=f.prototype,new E)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.buildInProdFollowPrefix=r.buildBetweenProdsFollowPrefix=r.computeAllProdsFollows=r.ResyncFollowsWalker=void 0;var t=Cn(),n=ri(),i=Fe(),o=oi(),s=Je(),c=(function(u){e(b,u);function b(f){var E=u.call(this)||this;return E.topProd=f,E.follows={},E}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,E,g){},b.prototype.walkProdRef=function(f,E,g){var l=a(f.referencedRule,f.idx)+this.topProd.name,h=E.concat(g),p=new s.Alternative({definition:h}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);r.ResyncFollowsWalker=c;function A(u){var b={};return i.forEach(u,function(f){var E=new c(f).startWalking();i.assign(b,E)}),b}r.computeAllProdsFollows=A;function a(u,b){return u.name+b+o.IN}r.buildBetweenProdsFollowPrefix=a;function d(u){var b=u.terminalType.name;return b+u.idx+o.IN}r.buildInProdFollowPrefix=d}),Gt=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defaultGrammarValidatorErrorProvider=r.defaultGrammarResolverErrorProvider=r.defaultParserErrorProvider=void 0;var e=dt(),t=Fe(),n=Fe(),i=Je(),o=Pt();r.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,b=`
54
54
  but found: '`+u+"'";if(a)return d+a+b;var f=n.reduce(c,function(h,p){return h.concat(p)},[]),E=n.map(f,function(h){return"["+n.map(h,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),g=n.map(E,function(h,p){return" "+(p+1)+". "+h}),l=`one of these possible Token sequences:
55
55
  `+g.join(`
56
56
  `);return d+l+b},buildEarlyExitMessage:function(s){var c=s.expectedIterationPaths,A=s.actual,a=s.customUserDescription;s.ruleName;var d="Expecting: ",u=n.first(A).image,b=`
@@ -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 i.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),Vr=ve(r=>{var e=r&&r.__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 b in u)Object.prototype.hasOwnProperty.call(u,b)&&(d[b]=u[b])},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(r,"__esModule",{value:!0}),r.GastRefResolverVisitor=r.resolveGrammar=void 0;var t=et(),n=Fe(),i=kt();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}r.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})(i.GAstVisitor);r.GastRefResolverVisitor=s}),Ut=ve(r=>{var e=r&&r.__extends||(function(){var l=function(h,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,m){C.__proto__=m}||function(C,m){for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(C[y]=m[y])},l(h,p)};return function(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(h,p);function C(){this.constructor=h}h.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.nextPossibleTokensAfter=r.possiblePathsFrom=r.NextTerminalAfterAtLeastOneSepWalker=r.NextTerminalAfterAtLeastOneWalker=r.NextTerminalAfterManySepWalker=r.NextTerminalAfterManyWalker=r.AbstractNextTerminalAfterProductionWalker=r.NextAfterTokenWalker=r.AbstractNextPossibleTokensWalker=void 0;var t=En(),n=Fe(),i=ei(),o=Je(),s=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topProd=p,m.path=C,m.possibleTokTypes=[],m.nextProductionName="",m.nextProductionOccurrence=0,m.found=!1,m.isAtEndOfPath=!1,m}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(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},h.prototype.walkProdRef=function(p,C,m){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var y=C.concat(m);this.updateExpectedNext(),this.walk(p.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);r.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(h,l);function h(p,C){var m=l.call(this,p,C)||this;return m.path=C,m.nextTerminalName="",m.nextTerminalOccurrence=0,m.nextTerminalName=m.path.lastTok.name,m.nextTerminalOccurrence=m.path.lastTokOccurrence,m}return h.prototype.walkTerminal=function(p,C,m){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(m),_=new o.Alternative({definition:y});this.possibleTokTypes=i.first(_),this.found=!0}},h})(s);r.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topRule=p,m.occurrence=C,m.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},m}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);r.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterManyWalker=a;var d=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterManySepWalker=d;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOneSep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,h,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],m=0;function y(Q){return Q.concat(n.drop(l,m+1))}function _(Q){var M=f(y(Q),h,p);return C.concat(M)}for(;p.length<h&&m<l.length;){var S=l[m];if(S instanceof o.Alternative||S instanceof o.NonTerminal)return _(S.definition);if(S instanceof o.Option)C=_(S.definition);else if(S instanceof o.RepetitionMandatory){var z=S.definition.concat([new o.Repetition({definition:S.definition})]);return _(z)}else if(S instanceof o.RepetitionMandatoryWithSeparator){var z=[new o.Alternative({definition:S.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:S.separator})].concat(S.definition)})];return _(z)}else if(S instanceof o.RepetitionWithSeparator){var z=S.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:S.separator})].concat(S.definition)})]);C=_(z)}else if(S instanceof o.Repetition){var z=S.definition.concat([new o.Repetition({definition:S.definition})]);C=_(z)}else{if(S instanceof o.Alternation)return n.forEach(S.definition,function(Q){n.isEmpty(Q.definition)===!1&&(C=_(Q.definition))}),C;if(S instanceof o.Terminal)p.push(S.terminalType);else throw Error("non exhaustive match")}m++}return C.push({partialPath:p,suffixDef:n.drop(l,m)}),C}r.possiblePathsFrom=f;function E(l,h,p,C){var m="EXIT_NONE_TERMINAL",y=[m],_="EXIT_ALTERNATIVE",S=!1,z=h.length,Q=z-C-1,M=[],N=[];for(N.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(N);){var k=N.pop();if(k===_){S&&n.last(N).idx<=Q&&N.pop();continue}var D=k.def,x=k.idx,W=k.ruleStack,$=k.occurrenceStack;if(!n.isEmpty(D)){var H=D[0];if(H===m){var ee={idx:x,def:n.drop(D),ruleStack:n.dropRight(W),occurrenceStack:n.dropRight($)};N.push(ee)}else if(H instanceof o.Terminal)if(x<z-1){var ie=x+1,ue=h[ie];if(p(ue,H.terminalType)){var ee={idx:ie,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ee)}}else if(x===z-1)M.push({nextTokenType:H.terminalType,nextTokenOccurrence:H.idx,ruleStack:W,occurrenceStack:$}),S=!0;else throw Error("non exhaustive match");else if(H instanceof o.NonTerminal){var re=n.cloneArr(W);re.push(H.nonTerminalName);var X=n.cloneArr($);X.push(H.idx);var ee={idx:x,def:H.definition.concat(y,n.drop(D)),ruleStack:re,occurrenceStack:X};N.push(ee)}else if(H instanceof o.Option){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(_);var de={idx:x,def:H.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.RepetitionMandatory){var P=new o.Repetition({definition:H.definition,idx:H.idx}),j=H.definition.concat([P],n.drop(D)),ee={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionMandatoryWithSeparator){var U=new o.Terminal({terminalType:H.separator}),P=new o.Repetition({definition:[U].concat(H.definition),idx:H.idx}),j=H.definition.concat([P],n.drop(D)),ee={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionWithSeparator){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(_);var U=new o.Terminal({terminalType:H.separator}),Z=new o.Repetition({definition:[U].concat(H.definition),idx:H.idx}),j=H.definition.concat([Z],n.drop(D)),de={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.Repetition){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(_);var Z=new o.Repetition({definition:H.definition,idx:H.idx}),j=H.definition.concat([Z],n.drop(D)),de={idx:x,def:j,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:x,def:le.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$};N.push(ye),N.push(_)}else if(H instanceof o.Alternative)N.push({idx:x,def:H.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$});else if(H instanceof o.Rule)N.push(g(H,x,W,$));else throw Error("non exhaustive match")}}return M}r.nextPossibleTokensAfter=E;function g(l,h,p,C){var m=n.cloneArr(p);m.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:h,def:l.definition,ruleStack:m,occurrenceStack:y}}}),Ht=ve(r=>{var e=r&&r.__extends||(function(){var Q=function(M,N){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,D){k.__proto__=D}||function(k,D){for(var x in D)Object.prototype.hasOwnProperty.call(D,x)&&(k[x]=D[x])},Q(M,N)};return function(M,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");Q(M,N);function k(){this.constructor=M}M.prototype=N===null?Object.create(N):(k.prototype=N.prototype,new k)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.areTokenCategoriesNotUsed=r.isStrictPrefixOfPath=r.containsPath=r.getLookaheadPathsForOptionalProd=r.getLookaheadPathsForOr=r.lookAheadSequenceFromAlternatives=r.buildSingleAlternativeLookaheadFunction=r.buildAlternativesLookAheadFunc=r.buildLookaheadFuncForOptionalProd=r.buildLookaheadFuncForOr=r.getProdType=r.PROD_TYPE=void 0;var t=Fe(),n=Ut(),i=En(),o=Qt(),s=Je(),c=kt(),A;(function(Q){Q[Q.OPTION=0]="OPTION",Q[Q.REPETITION=1]="REPETITION",Q[Q.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",Q[Q.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",Q[Q.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",Q[Q.ALTERNATION=5]="ALTERNATION"})(A=r.PROD_TYPE||(r.PROD_TYPE={}));function a(Q){if(Q instanceof s.Option)return A.OPTION;if(Q instanceof s.Repetition)return A.REPETITION;if(Q instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(Q instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(Q instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(Q instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}r.getProdType=a;function d(Q,M,N,k,D,x){var W=m(Q,M,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return x(W,k,$,D)}r.buildLookaheadFuncForOr=d;function u(Q,M,N,k,D,x){var W=y(Q,M,D,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return x(W[0],$,k)}r.buildLookaheadFuncForOptionalProd=u;function b(Q,M,N,k){var D=Q.length,x=t.every(Q,function(H){return t.every(H,function(ee){return ee.length===1})});if(M)return function(H){for(var ee=t.map(H,function(Z){return Z.GATE}),ie=0;ie<D;ie++){var ue=Q[ie],re=ue.length,X=ee[ie];if(!(X!==void 0&&X.call(this)===!1))e:for(var ae=0;ae<re;ae++){for(var de=ue[ae],P=de.length,j=0;j<P;j++){var U=this.LA(j+1);if(N(U,de[j])===!1)continue e}return ie}}};if(x&&!k){var W=t.map(Q,function(H){return t.flatten(H)}),$=t.reduce(W,function(H,ee,ie){return t.forEach(ee,function(ue){t.has(H,ue.tokenTypeIdx)||(H[ue.tokenTypeIdx]=ie),t.forEach(ue.categoryMatches,function(re){t.has(H,re)||(H[re]=ie)})}),H},[]);return function(){var H=this.LA(1);return $[H.tokenTypeIdx]}}else return function(){for(var H=0;H<D;H++){var ee=Q[H],ie=ee.length;e:for(var ue=0;ue<ie;ue++){for(var re=ee[ue],X=re.length,ae=0;ae<X;ae++){var de=this.LA(ae+1);if(N(de,re[ae])===!1)continue e}return H}}}}r.buildAlternativesLookAheadFunc=b;function f(Q,M,N){var k=t.every(Q,function(ee){return ee.length===1}),D=Q.length;if(k&&!N){var x=t.flatten(Q);if(x.length===1&&t.isEmpty(x[0].categoryMatches)){var W=x[0],$=W.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===$}}else{var H=t.reduce(x,function(ee,ie,ue){return ee[ie.tokenTypeIdx]=!0,t.forEach(ie.categoryMatches,function(re){ee[re]=!0}),ee},[]);return function(){var ee=this.LA(1);return H[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<D;ee++){for(var ie=Q[ee],ue=ie.length,re=0;re<ue;re++){var X=this.LA(re+1);if(M(X,ie[re])===!1)continue e}return!0}return!1}}r.buildSingleAlternativeLookaheadFunction=f;var E=(function(Q){e(M,Q);function M(N,k,D){var x=Q.call(this)||this;return x.topProd=N,x.targetOccurrence=k,x.targetProdType=D,x}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(N,k,D,x){return N.idx===this.targetOccurrence&&this.targetProdType===k?(this.restDef=D.concat(x),!0):!1},M.prototype.walkOption=function(N,k,D){this.checkIsTarget(N,A.OPTION,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkAtLeastOne=function(N,k,D){this.checkIsTarget(N,A.REPETITION_MANDATORY,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkAtLeastOneSep=function(N,k,D){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkMany=function(N,k,D){this.checkIsTarget(N,A.REPETITION,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkManySep=function(N,k,D){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M})(i.RestWalker),g=(function(Q){e(M,Q);function M(N,k,D){var x=Q.call(this)||this;return x.targetOccurrence=N,x.targetProdType=k,x.targetRef=D,x.result=[],x}return M.prototype.checkIsTarget=function(N,k){N.idx===this.targetOccurrence&&this.targetProdType===k&&(this.targetRef===void 0||N===this.targetRef)&&(this.result=N.definition)},M.prototype.visitOption=function(N){this.checkIsTarget(N,A.OPTION)},M.prototype.visitRepetition=function(N){this.checkIsTarget(N,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(N){this.checkIsTarget(N,A.ALTERNATION)},M})(c.GAstVisitor);function l(Q){for(var M=new Array(Q),N=0;N<Q;N++)M[N]=[];return M}function h(Q){for(var M=[""],N=0;N<Q.length;N++){for(var k=Q[N],D=[],x=0;x<M.length;x++){var W=M[x];D.push(W+"_"+k.tokenTypeIdx);for(var $=0;$<k.categoryMatches.length;$++){var H="_"+k.categoryMatches[$];D.push(W+H)}}M=D}return M}function p(Q,M,N){for(var k=0;k<Q.length;k++)if(k!==N)for(var D=Q[k],x=0;x<M.length;x++){var W=M[x];if(D[W]===!0)return!1}return!0}function C(Q,M){for(var N=t.map(Q,function(ie){return n.possiblePathsFrom([ie],1)}),k=l(N.length),D=t.map(N,function(ie){var ue={};return t.forEach(ie,function(re){var X=h(re.partialPath);t.forEach(X,function(ae){ue[ae]=!0})}),ue}),x=N,W=1;W<=M;W++){var $=x;x=l($.length);for(var H=function(ie){for(var ue=$[ie],re=0;re<ue.length;re++){var X=ue[re].partialPath,ae=ue[re].suffixDef,de=h(X),P=p(D,de,ie);if(P||t.isEmpty(ae)||X.length===M){var j=k[ie];if(_(j,X)===!1){j.push(X);for(var U=0;U<de.length;U++){var Z=de[U];D[ie][Z]=!0}}}else{var J=n.possiblePathsFrom(ae,W+1,X);x[ie]=x[ie].concat(J),t.forEach(J,function(le){var ye=h(le.partialPath);t.forEach(ye,function(we){D[ie][we]=!0})})}}},ee=0;ee<$.length;ee++)H(ee)}return k}r.lookAheadSequenceFromAlternatives=C;function m(Q,M,N,k){var D=new g(Q,A.ALTERNATION,k);return M.accept(D),C(D.result,N)}r.getLookaheadPathsForOr=m;function y(Q,M,N,k){var D=new g(Q,N);M.accept(D);var x=D.result,W=new E(M,Q,N),$=W.startWalking(),H=new s.Alternative({definition:x}),ee=new s.Alternative({definition:$});return C([H,ee],k)}r.getLookaheadPathsForOptionalProd=y;function _(Q,M){e:for(var N=0;N<Q.length;N++){var k=Q[N];if(k.length===M.length){for(var D=0;D<k.length;D++){var x=M[D],W=k[D],$=x===W||W.categoryMatchesMap[x.tokenTypeIdx]!==void 0;if($===!1)continue e}return!0}}return!1}r.containsPath=_;function S(Q,M){return Q.length<M.length&&t.every(Q,function(N,k){var D=M[k];return N===D||D.categoryMatchesMap[N.tokenTypeIdx]})}r.isStrictPrefixOfPath=S;function z(Q){return t.every(Q,function(M){return t.every(M,function(N){return t.every(N,function(k){return t.isEmpty(k.categoryMatches)})})})}r.areTokenCategoriesNotUsed=z}),ni=ve(r=>{var e=r&&r.__extends||(function(){var k=function(D,x){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,$){W.__proto__=$}||function(W,$){for(var H in $)Object.prototype.hasOwnProperty.call($,H)&&(W[H]=$[H])},k(D,x)};return function(D,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");k(D,x);function W(){this.constructor=D}D.prototype=x===null?Object.create(x):(W.prototype=x.prototype,new W)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.checkPrefixAlternativesAmbiguities=r.validateSomeNonEmptyLookaheadPath=r.validateTooManyAlts=r.RepetionCollector=r.validateAmbiguousAlternationAlternatives=r.validateEmptyOrAlternative=r.getFirstNoneTerminal=r.validateNoLeftRecursion=r.validateRuleIsOverridden=r.validateRuleDoesNotAlreadyExist=r.OccurrenceValidationCollector=r.identifyProductionForDuplicates=r.validateGrammar=void 0;var t=Fe(),n=Fe(),i=et(),o=Pt(),s=Ht(),c=Ut(),A=Je(),a=kt();function d(k,D,x,W,$){var H=t.map(k,function(P){return u(P,W)}),ee=t.map(k,function(P){return h(P,P,W)}),ie=[],ue=[],re=[];n.every(ee,n.isEmpty)&&(ie=n.map(k,function(P){return m(P,W)}),ue=n.map(k,function(P){return y(P,D,W)}),re=z(k,D,W));var X=N(k,x,W),ae=n.map(k,function(P){return S(P,W)}),de=n.map(k,function(P){return g(P,k,$,W)});return t.flatten(H.concat(re,ee,ie,ue,X,ae,de))}r.validateGrammar=d;function u(k,D){var x=new E;k.accept(x);var W=x.allProductions,$=t.groupBy(W,b),H=t.pick($,function(ie){return ie.length>1}),ee=t.map(t.values(H),function(ie){var ue=t.first(ie),re=D.buildDuplicateFoundError(k,ie),X=o.getProductionDslName(ue),ae={message:re,type:i.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:k.name,dslName:X,occurrence:ue.idx},de=f(ue);return de&&(ae.parameter=de),ae});return ee}function b(k){return o.getProductionDslName(k)+"_#_"+k.idx+"_#_"+f(k)}r.identifyProductionForDuplicates=b;function f(k){return k instanceof A.Terminal?k.terminalType.name:k instanceof A.NonTerminal?k.nonTerminalName:""}var E=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.allProductions=[],x}return D.prototype.visitNonTerminal=function(x){this.allProductions.push(x)},D.prototype.visitOption=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatory=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetition=function(x){this.allProductions.push(x)},D.prototype.visitAlternation=function(x){this.allProductions.push(x)},D.prototype.visitTerminal=function(x){this.allProductions.push(x)},D})(a.GAstVisitor);r.OccurrenceValidationCollector=E;function g(k,D,x,W){var $=[],H=n.reduce(D,function(ie,ue){return ue.name===k.name?ie+1:ie},0);if(H>1){var ee=W.buildDuplicateRuleNameError({topLevelRule:k,grammarName:x});$.push({message:ee,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:k.name})}return $}r.validateRuleDoesNotAlreadyExist=g;function l(k,D,x){var W=[],$;return t.contains(D,k)||($="Invalid rule override, rule: ->"+k+"<- cannot be overridden in the grammar: ->"+x+"<-as it is not defined in any of the super grammars ",W.push({message:$,type:i.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:k})),W}r.validateRuleIsOverridden=l;function h(k,D,x,W){W===void 0&&(W=[]);var $=[],H=p(D.definition);if(t.isEmpty(H))return[];var ee=k.name,ie=t.contains(H,k);ie&&$.push({message:x.buildLeftRecursionError({topLevelRule:k,leftRecursionPath:W}),type:i.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(H,W.concat([k])),re=t.map(ue,function(X){var ae=t.cloneArr(W);return ae.push(X),h(k,X,x,ae)});return $.concat(t.flatten(re))}r.validateNoLeftRecursion=h;function p(k){var D=[];if(t.isEmpty(k))return D;var x=t.first(k);if(x instanceof A.NonTerminal)D.push(x.referencedRule);else if(x instanceof A.Alternative||x instanceof A.Option||x instanceof A.RepetitionMandatory||x instanceof A.RepetitionMandatoryWithSeparator||x instanceof A.RepetitionWithSeparator||x instanceof A.Repetition)D=D.concat(p(x.definition));else if(x instanceof A.Alternation)D=t.flatten(t.map(x.definition,function(ee){return p(ee.definition)}));else if(!(x instanceof A.Terminal))throw Error("non exhaustive match");var W=o.isOptionalProd(x),$=k.length>1;if(W&&$){var H=t.drop(k);return D.concat(p(H))}else return D}r.getFirstNoneTerminal=p;var C=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.alternations=[],x}return D.prototype.visitAlternation=function(x){this.alternations.push(x)},D})(a.GAstVisitor);function m(k,D){var x=new C;k.accept(x);var W=x.alternations,$=t.reduce(W,function(H,ee){var ie=t.dropRight(ee.definition),ue=t.map(ie,function(re,X){var ae=c.nextPossibleTokensAfter([re],[],null,1);return t.isEmpty(ae)?{message:D.buildEmptyAlternationError({topLevelRule:k,alternation:ee,emptyChoiceIdx:X}),type:i.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:k.name,occurrence:ee.idx,alternative:X+1}:null});return H.concat(t.compact(ue))},[]);return $}r.validateEmptyOrAlternative=m;function y(k,D,x){var W=new C;k.accept(W);var $=W.alternations;$=n.reject($,function(ee){return ee.ignoreAmbiguities===!0});var H=t.reduce($,function(ee,ie){var ue=ie.idx,re=ie.maxLookahead||D,X=s.getLookaheadPathsForOr(ue,k,re,ie),ae=Q(X,ie,k,x),de=M(X,ie,k,x);return ee.concat(ae,de)},[]);return H}r.validateAmbiguousAlternationAlternatives=y;var _=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.allProductions=[],x}return D.prototype.visitRepetitionWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatory=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetition=function(x){this.allProductions.push(x)},D})(a.GAstVisitor);r.RepetionCollector=_;function S(k,D){var x=new C;k.accept(x);var W=x.alternations,$=t.reduce(W,function(H,ee){return ee.definition.length>255&&H.push({message:D.buildTooManyAlternativesError({topLevelRule:k,alternation:ee}),type:i.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:k.name,occurrence:ee.idx}),H},[]);return $}r.validateTooManyAlts=S;function z(k,D,x){var W=[];return n.forEach(k,function($){var H=new _;$.accept(H);var ee=H.allProductions;n.forEach(ee,function(ie){var ue=s.getProdType(ie),re=ie.maxLookahead||D,X=ie.idx,ae=s.getLookaheadPathsForOptionalProd(X,$,ue,re),de=ae[0];if(n.isEmpty(n.flatten(de))){var P=x.buildEmptyRepetitionError({topLevelRule:$,repetition:ie});W.push({message:P,type:i.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:$.name})}})}),W}r.validateSomeNonEmptyLookaheadPath=z;function Q(k,D,x,W){var $=[],H=n.reduce(k,function(ie,ue,re){return D.definition[re].ignoreAmbiguities===!0||n.forEach(ue,function(X){var ae=[re];n.forEach(k,function(de,P){re!==P&&s.containsPath(de,X)&&D.definition[P].ignoreAmbiguities!==!0&&ae.push(P)}),ae.length>1&&!s.containsPath($,X)&&($.push(X),ie.push({alts:ae,path:X}))}),ie},[]),ee=t.map(H,function(ie){var ue=n.map(ie.alts,function(X){return X+1}),re=W.buildAlternationAmbiguityError({topLevelRule:x,alternation:D,ambiguityIndices:ue,prefixPath:ie.path});return{message:re,type:i.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:x.name,occurrence:D.idx,alternatives:[ie.alts]}});return ee}function M(k,D,x,W){var $=[],H=n.reduce(k,function(ee,ie,ue){var re=n.map(ie,function(X){return{idx:ue,path:X}});return ee.concat(re)},[]);return n.forEach(H,function(ee){var ie=D.definition[ee.idx];if(ie.ignoreAmbiguities!==!0){var ue=ee.idx,re=ee.path,X=n.findAll(H,function(de){return D.definition[de.idx].ignoreAmbiguities!==!0&&de.idx<ue&&s.isStrictPrefixOfPath(de.path,re)}),ae=n.map(X,function(de){var P=[de.idx+1,ue+1],j=D.idx===0?"":D.idx,U=W.buildAlternationPrefixAmbiguityError({topLevelRule:x,alternation:D,ambiguityIndices:P,prefixPath:de.path});return{message:U,type:i.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:x.name,occurrence:j,alternatives:P}});$=$.concat(ae)}}),$}r.checkPrefixAlternativesAmbiguities=M;function N(k,D,x){var W=[],$=n.map(D,function(H){return H.name});return n.forEach(k,function(H){var ee=H.name;if(n.contains($,ee)){var ie=x.buildNamespaceConflictError(H);W.push({message:ie,type:i.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),W}}),Wr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.validateGrammar=r.resolveGrammar=void 0;var e=Fe(),t=Vr(),n=ni(),i=Gt();function o(c){c=e.defaults(c,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}r.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:i.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}r.validateGrammar=s}),_t=ve(r=>{var e=r&&r.__extends||(function(){var E=function(g,l){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(h[C]=p[C])},E(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");E(g,l);function h(){this.constructor=g}g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.EarlyExitException=r.NotAllInputParsedException=r.NoViableAltException=r.MismatchedTokenException=r.isRecognitionException=void 0;var t=Fe(),n="MismatchedTokenException",i="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,i,o,s];Object.freeze(c);function A(E){return t.contains(c,E.name)}r.isRecognitionException=A;var a=(function(E){e(g,E);function g(l,h){var p=this.constructor,C=E.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),d=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=n,C}return g})(a);r.MismatchedTokenException=d;var u=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=i,C}return g})(a);r.NoViableAltException=u;var b=(function(E){e(g,E);function g(l,h){var p=E.call(this,l,h)||this;return p.name=s,p}return g})(a);r.NotAllInputParsedException=b;var f=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=o,C}return g})(a);r.EarlyExitException=f}),ii=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.attemptInRepetitionRecovery=r.Recoverable=r.InRuleRecoveryException=r.IN_RULE_RECOVERY_EXCEPTION=r.EOF_FOLLOW_KEY=void 0;var e=dt(),t=Fe(),n=_t(),i=ti(),o=et();r.EOF_FOLLOW_KEY={},r.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=r.IN_RULE_RECOVERY_EXCEPTION,this.message=a}r.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,b,f){for(var E=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],p=!1,C=this.LA(1),m=this.LA(1),y=function(){var _=E.LA(0),S=E.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:_,ruleName:E.getCurrRuleFullName()}),z=new n.MismatchedTokenException(S,C,E.LA(0));z.resyncedTokens=t.dropRight(h),E.SAVE_ERROR(z)};!p;)if(this.tokenMatcher(m,f)){y();return}else if(b.call(this)){y(),d.apply(this,u);return}else this.tokenMatcher(m,g)?p=!0:(m=this.SKIP_TOKEN(),this.addToResyncTokens(m,h));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(d,u,b){return!(b===!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 b=this.getCurrentGrammarPath(d,u),f=this.getNextPossibleTokenTypes(b);return f},a.prototype.tryInRuleRecovery=function(d,u){if(this.canRecoverWithSingleTokenInsertion(d,u)){var b=this.getTokenToInsert(d);return b}if(this.canRecoverWithSingleTokenDeletion(d)){var f=this.SKIP_TOKEN();return this.consumeToken(),f}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 b=this;if(!this.canTokenTypeBeInsertedInRecovery(d)||t.isEmpty(u))return!1;var f=this.LA(1),E=t.find(u,function(g){return b.tokenMatcher(f,g)})!==void 0;return E},a.prototype.canRecoverWithSingleTokenDeletion=function(d){var u=this.tokenMatcher(this.LA(2),d);return u},a.prototype.isInCurrentRuleReSyncSet=function(d){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,d)},a.prototype.findReSyncTokenType=function(){for(var d=this.flattenFollowSet(),u=this.LA(1),b=2;;){var f=u.tokenType;if(t.contains(d,f))return f;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return r.EOF_FOLLOW_KEY;var d=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(d),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var d=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(f,E){return E===0?r.EOF_FOLLOW_KEY:{ruleName:d.shortRuleNameToFullName(f),idxInCallingRule:b[E],inRule:d.shortRuleNameToFullName(u[E-1])}})},a.prototype.flattenFollowSet=function(){var d=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return d.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(d){if(d===r.EOF_FOLLOW_KEY)return[e.EOF];var u=d.ruleName+d.idxInCallingRule+i.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=[],b=this.LA(1);this.tokenMatcher(b,d)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(d,u,b,f,E,g,l){},a.prototype.getCurrentGrammarPath=function(d,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),E={ruleStack:b,occurrenceStack:f,lastTok:d,lastTokOccurrence:u};return E},a.prototype.getHumanReadableRuleStack=function(){var d=this;return t.map(this.RULE_STACK,function(u){return d.shortRuleNameToFullName(u)})},a})();r.Recoverable=c;function A(a,d,u,b,f,E,g){var l=this.getKeyForAutomaticLookahead(b,f),h=this.firstAfterRepMap[l];if(h===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],m=new E(C,f);h=m.startWalking(),this.firstAfterRepMap[l]=h}var y=h.token,_=h.occurrence,S=h.isEndOfRule;this.RULE_STACK.length===1&&S&&y===void 0&&(y=e.EOF,_=1),this.shouldInRepetitionRecoveryBeTried(y,_,g)&&this.tryInRepetitionRecovery(a,d,u,y)}r.attemptInRepetitionRecovery=A}),In=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getKeyForAutomaticLookahead=r.AT_LEAST_ONE_SEP_IDX=r.MANY_SEP_IDX=r.AT_LEAST_ONE_IDX=r.MANY_IDX=r.OPTION_IDX=r.OR_IDX=r.BITS_FOR_ALT_IDX=r.BITS_FOR_RULE_IDX=r.BITS_FOR_OCCURRENCE_IDX=r.BITS_FOR_METHOD_TYPE=void 0,r.BITS_FOR_METHOD_TYPE=4,r.BITS_FOR_OCCURRENCE_IDX=8,r.BITS_FOR_RULE_IDX=12,r.BITS_FOR_ALT_IDX=8,r.OR_IDX=1<<r.BITS_FOR_OCCURRENCE_IDX,r.OPTION_IDX=2<<r.BITS_FOR_OCCURRENCE_IDX,r.MANY_IDX=3<<r.BITS_FOR_OCCURRENCE_IDX,r.AT_LEAST_ONE_IDX=4<<r.BITS_FOR_OCCURRENCE_IDX,r.MANY_SEP_IDX=5<<r.BITS_FOR_OCCURRENCE_IDX,r.AT_LEAST_ONE_SEP_IDX=6<<r.BITS_FOR_OCCURRENCE_IDX;function e(t,n,i){return i|n|t}r.getKeyForAutomaticLookahead=e,32-r.BITS_FOR_ALT_IDX}),Yr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LooksAhead=void 0;var e=Ht(),t=Fe(),n=et(),i=In(),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),b=u.alternation,f=u.repetition,E=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+o.getProductionDslName(p)+C,function(){var m=e.buildLookaheadFuncForOr(p.idx,d,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=i.getKeyForAutomaticLookahead(a.fullRuleNameToShort[d.name],i.OR_IDX,p.idx);a.setLaFuncCache(y,m)})}),t.forEach(f,function(p){a.computeLookaheadFunc(d,p.idx,i.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(d,p.idx,i.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(g,function(p){a.computeLookaheadFunc(d,p.idx,i.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(d,p.idx,i.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(h,function(p){a.computeLookaheadFunc(d,p.idx,i.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,d,u,b,f){var E=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,b||E.maxLookahead,E.dynamicTokensEnabled,u,E.lookAheadBuilderForOptional),l=i.getKeyForAutomaticLookahead(E.fullRuleNameToShort[A.name],d,a);E.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 i.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})();r.LooksAhead=s}),Jr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addNoneTerminalToCst=r.addTerminalToCst=r.setNodeLocationFull=r.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)}r.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)}r.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}r.addTerminalToCst=n;function i(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}r.addNoneTerminalToCst=i}),ri=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defineNameProp=r.functionName=r.classNameFromInstance=void 0;var e=Fe();function t(s){return i(s.constructor)}r.classNameFromInstance=t;var n="name";function i(s){var c=s.name;return c||"anonymous"}r.functionName=i;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}r.defineNameProp=o}),Xr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.validateRedundantMethods=r.validateMissingCstMethods=r.validateVisitor=r.CstVisitorDefinitionError=r.createBaseVisitorConstructorWithDefaults=r.createBaseSemanticVisitorConstructor=r.defaultVisit=void 0;var e=Fe(),t=ri();function n(u,b){for(var f=e.keys(u),E=f.length,g=0;g<E;g++)for(var l=f[g],h=u[l],p=h.length,C=0;C<p;C++){var m=h[C];m.tokenTypeIdx===void 0&&this[m.name](m.children,b)}}r.defaultVisit=n;function i(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var E={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,b);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 i.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),Vr=ve(r=>{var e=r&&r.__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 b in u)Object.prototype.hasOwnProperty.call(u,b)&&(d[b]=u[b])},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(r,"__esModule",{value:!0}),r.GastRefResolverVisitor=r.resolveGrammar=void 0;var t=et(),n=Fe(),i=kt();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}r.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})(i.GAstVisitor);r.GastRefResolverVisitor=s}),Ut=ve(r=>{var e=r&&r.__extends||(function(){var l=function(h,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,m){C.__proto__=m}||function(C,m){for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(C[y]=m[y])},l(h,p)};return function(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(h,p);function C(){this.constructor=h}h.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.nextPossibleTokensAfter=r.possiblePathsFrom=r.NextTerminalAfterAtLeastOneSepWalker=r.NextTerminalAfterAtLeastOneWalker=r.NextTerminalAfterManySepWalker=r.NextTerminalAfterManyWalker=r.AbstractNextTerminalAfterProductionWalker=r.NextAfterTokenWalker=r.AbstractNextPossibleTokensWalker=void 0;var t=Cn(),n=Fe(),i=ri(),o=Je(),s=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topProd=p,m.path=C,m.possibleTokTypes=[],m.nextProductionName="",m.nextProductionOccurrence=0,m.found=!1,m.isAtEndOfPath=!1,m}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(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},h.prototype.walkProdRef=function(p,C,m){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var y=C.concat(m);this.updateExpectedNext(),this.walk(p.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);r.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(h,l);function h(p,C){var m=l.call(this,p,C)||this;return m.path=C,m.nextTerminalName="",m.nextTerminalOccurrence=0,m.nextTerminalName=m.path.lastTok.name,m.nextTerminalOccurrence=m.path.lastTokOccurrence,m}return h.prototype.walkTerminal=function(p,C,m){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(m),S=new o.Alternative({definition:y});this.possibleTokTypes=i.first(S),this.found=!0}},h})(s);r.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topRule=p,m.occurrence=C,m.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},m}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);r.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterManyWalker=a;var d=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterManySepWalker=d;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOneSep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));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,p,C,m)},h})(A);r.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,h,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],m=0;function y(Q){return Q.concat(n.drop(l,m+1))}function S(Q){var M=f(y(Q),h,p);return C.concat(M)}for(;p.length<h&&m<l.length;){var _=l[m];if(_ instanceof o.Alternative||_ instanceof o.NonTerminal)return S(_.definition);if(_ instanceof o.Option)C=S(_.definition);else if(_ instanceof o.RepetitionMandatory){var z=_.definition.concat([new o.Repetition({definition:_.definition})]);return S(z)}else if(_ instanceof o.RepetitionMandatoryWithSeparator){var z=[new o.Alternative({definition:_.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})];return S(z)}else if(_ instanceof o.RepetitionWithSeparator){var z=_.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})]);C=S(z)}else if(_ instanceof o.Repetition){var z=_.definition.concat([new o.Repetition({definition:_.definition})]);C=S(z)}else{if(_ instanceof o.Alternation)return n.forEach(_.definition,function(Q){n.isEmpty(Q.definition)===!1&&(C=S(Q.definition))}),C;if(_ instanceof o.Terminal)p.push(_.terminalType);else throw Error("non exhaustive match")}m++}return C.push({partialPath:p,suffixDef:n.drop(l,m)}),C}r.possiblePathsFrom=f;function E(l,h,p,C){var m="EXIT_NONE_TERMINAL",y=[m],S="EXIT_ALTERNATIVE",_=!1,z=h.length,Q=z-C-1,M=[],N=[];for(N.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(N);){var k=N.pop();if(k===S){_&&n.last(N).idx<=Q&&N.pop();continue}var D=k.def,x=k.idx,W=k.ruleStack,$=k.occurrenceStack;if(!n.isEmpty(D)){var H=D[0];if(H===m){var ee={idx:x,def:n.drop(D),ruleStack:n.dropRight(W),occurrenceStack:n.dropRight($)};N.push(ee)}else if(H instanceof o.Terminal)if(x<z-1){var ie=x+1,ue=h[ie];if(p(ue,H.terminalType)){var ee={idx:ie,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ee)}}else if(x===z-1)M.push({nextTokenType:H.terminalType,nextTokenOccurrence:H.idx,ruleStack:W,occurrenceStack:$}),_=!0;else throw Error("non exhaustive match");else if(H instanceof o.NonTerminal){var re=n.cloneArr(W);re.push(H.nonTerminalName);var X=n.cloneArr($);X.push(H.idx);var ee={idx:x,def:H.definition.concat(y,n.drop(D)),ruleStack:re,occurrenceStack:X};N.push(ee)}else if(H instanceof o.Option){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(S);var de={idx:x,def:H.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.RepetitionMandatory){var P=new o.Repetition({definition:H.definition,idx:H.idx}),j=H.definition.concat([P],n.drop(D)),ee={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionMandatoryWithSeparator){var U=new o.Terminal({terminalType:H.separator}),P=new o.Repetition({definition:[U].concat(H.definition),idx:H.idx}),j=H.definition.concat([P],n.drop(D)),ee={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(ee)}else if(H instanceof o.RepetitionWithSeparator){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(S);var U=new o.Terminal({terminalType:H.separator}),Z=new o.Repetition({definition:[U].concat(H.definition),idx:H.idx}),j=H.definition.concat([Z],n.drop(D)),de={idx:x,def:j,ruleStack:W,occurrenceStack:$};N.push(de)}else if(H instanceof o.Repetition){var ae={idx:x,def:n.drop(D),ruleStack:W,occurrenceStack:$};N.push(ae),N.push(S);var Z=new o.Repetition({definition:H.definition,idx:H.idx}),j=H.definition.concat([Z],n.drop(D)),de={idx:x,def:j,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:x,def:le.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$};N.push(ye),N.push(S)}else if(H instanceof o.Alternative)N.push({idx:x,def:H.definition.concat(n.drop(D)),ruleStack:W,occurrenceStack:$});else if(H instanceof o.Rule)N.push(g(H,x,W,$));else throw Error("non exhaustive match")}}return M}r.nextPossibleTokensAfter=E;function g(l,h,p,C){var m=n.cloneArr(p);m.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:h,def:l.definition,ruleStack:m,occurrenceStack:y}}}),Ht=ve(r=>{var e=r&&r.__extends||(function(){var Q=function(M,N){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,D){k.__proto__=D}||function(k,D){for(var x in D)Object.prototype.hasOwnProperty.call(D,x)&&(k[x]=D[x])},Q(M,N)};return function(M,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");Q(M,N);function k(){this.constructor=M}M.prototype=N===null?Object.create(N):(k.prototype=N.prototype,new k)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.areTokenCategoriesNotUsed=r.isStrictPrefixOfPath=r.containsPath=r.getLookaheadPathsForOptionalProd=r.getLookaheadPathsForOr=r.lookAheadSequenceFromAlternatives=r.buildSingleAlternativeLookaheadFunction=r.buildAlternativesLookAheadFunc=r.buildLookaheadFuncForOptionalProd=r.buildLookaheadFuncForOr=r.getProdType=r.PROD_TYPE=void 0;var t=Fe(),n=Ut(),i=Cn(),o=Qt(),s=Je(),c=kt(),A;(function(Q){Q[Q.OPTION=0]="OPTION",Q[Q.REPETITION=1]="REPETITION",Q[Q.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",Q[Q.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",Q[Q.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",Q[Q.ALTERNATION=5]="ALTERNATION"})(A=r.PROD_TYPE||(r.PROD_TYPE={}));function a(Q){if(Q instanceof s.Option)return A.OPTION;if(Q instanceof s.Repetition)return A.REPETITION;if(Q instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(Q instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(Q instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(Q instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}r.getProdType=a;function d(Q,M,N,k,D,x){var W=m(Q,M,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return x(W,k,$,D)}r.buildLookaheadFuncForOr=d;function u(Q,M,N,k,D,x){var W=y(Q,M,D,N),$=z(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return x(W[0],$,k)}r.buildLookaheadFuncForOptionalProd=u;function b(Q,M,N,k){var D=Q.length,x=t.every(Q,function(H){return t.every(H,function(ee){return ee.length===1})});if(M)return function(H){for(var ee=t.map(H,function(Z){return Z.GATE}),ie=0;ie<D;ie++){var ue=Q[ie],re=ue.length,X=ee[ie];if(!(X!==void 0&&X.call(this)===!1))e:for(var ae=0;ae<re;ae++){for(var de=ue[ae],P=de.length,j=0;j<P;j++){var U=this.LA(j+1);if(N(U,de[j])===!1)continue e}return ie}}};if(x&&!k){var W=t.map(Q,function(H){return t.flatten(H)}),$=t.reduce(W,function(H,ee,ie){return t.forEach(ee,function(ue){t.has(H,ue.tokenTypeIdx)||(H[ue.tokenTypeIdx]=ie),t.forEach(ue.categoryMatches,function(re){t.has(H,re)||(H[re]=ie)})}),H},[]);return function(){var H=this.LA(1);return $[H.tokenTypeIdx]}}else return function(){for(var H=0;H<D;H++){var ee=Q[H],ie=ee.length;e:for(var ue=0;ue<ie;ue++){for(var re=ee[ue],X=re.length,ae=0;ae<X;ae++){var de=this.LA(ae+1);if(N(de,re[ae])===!1)continue e}return H}}}}r.buildAlternativesLookAheadFunc=b;function f(Q,M,N){var k=t.every(Q,function(ee){return ee.length===1}),D=Q.length;if(k&&!N){var x=t.flatten(Q);if(x.length===1&&t.isEmpty(x[0].categoryMatches)){var W=x[0],$=W.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===$}}else{var H=t.reduce(x,function(ee,ie,ue){return ee[ie.tokenTypeIdx]=!0,t.forEach(ie.categoryMatches,function(re){ee[re]=!0}),ee},[]);return function(){var ee=this.LA(1);return H[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<D;ee++){for(var ie=Q[ee],ue=ie.length,re=0;re<ue;re++){var X=this.LA(re+1);if(M(X,ie[re])===!1)continue e}return!0}return!1}}r.buildSingleAlternativeLookaheadFunction=f;var E=(function(Q){e(M,Q);function M(N,k,D){var x=Q.call(this)||this;return x.topProd=N,x.targetOccurrence=k,x.targetProdType=D,x}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(N,k,D,x){return N.idx===this.targetOccurrence&&this.targetProdType===k?(this.restDef=D.concat(x),!0):!1},M.prototype.walkOption=function(N,k,D){this.checkIsTarget(N,A.OPTION,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkAtLeastOne=function(N,k,D){this.checkIsTarget(N,A.REPETITION_MANDATORY,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkAtLeastOneSep=function(N,k,D){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkMany=function(N,k,D){this.checkIsTarget(N,A.REPETITION,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M.prototype.walkManySep=function(N,k,D){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR,k,D)||Q.prototype.walkOption.call(this,N,k,D)},M})(i.RestWalker),g=(function(Q){e(M,Q);function M(N,k,D){var x=Q.call(this)||this;return x.targetOccurrence=N,x.targetProdType=k,x.targetRef=D,x.result=[],x}return M.prototype.checkIsTarget=function(N,k){N.idx===this.targetOccurrence&&this.targetProdType===k&&(this.targetRef===void 0||N===this.targetRef)&&(this.result=N.definition)},M.prototype.visitOption=function(N){this.checkIsTarget(N,A.OPTION)},M.prototype.visitRepetition=function(N){this.checkIsTarget(N,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(N){this.checkIsTarget(N,A.ALTERNATION)},M})(c.GAstVisitor);function l(Q){for(var M=new Array(Q),N=0;N<Q;N++)M[N]=[];return M}function h(Q){for(var M=[""],N=0;N<Q.length;N++){for(var k=Q[N],D=[],x=0;x<M.length;x++){var W=M[x];D.push(W+"_"+k.tokenTypeIdx);for(var $=0;$<k.categoryMatches.length;$++){var H="_"+k.categoryMatches[$];D.push(W+H)}}M=D}return M}function p(Q,M,N){for(var k=0;k<Q.length;k++)if(k!==N)for(var D=Q[k],x=0;x<M.length;x++){var W=M[x];if(D[W]===!0)return!1}return!0}function C(Q,M){for(var N=t.map(Q,function(ie){return n.possiblePathsFrom([ie],1)}),k=l(N.length),D=t.map(N,function(ie){var ue={};return t.forEach(ie,function(re){var X=h(re.partialPath);t.forEach(X,function(ae){ue[ae]=!0})}),ue}),x=N,W=1;W<=M;W++){var $=x;x=l($.length);for(var H=function(ie){for(var ue=$[ie],re=0;re<ue.length;re++){var X=ue[re].partialPath,ae=ue[re].suffixDef,de=h(X),P=p(D,de,ie);if(P||t.isEmpty(ae)||X.length===M){var j=k[ie];if(S(j,X)===!1){j.push(X);for(var U=0;U<de.length;U++){var Z=de[U];D[ie][Z]=!0}}}else{var J=n.possiblePathsFrom(ae,W+1,X);x[ie]=x[ie].concat(J),t.forEach(J,function(le){var ye=h(le.partialPath);t.forEach(ye,function(we){D[ie][we]=!0})})}}},ee=0;ee<$.length;ee++)H(ee)}return k}r.lookAheadSequenceFromAlternatives=C;function m(Q,M,N,k){var D=new g(Q,A.ALTERNATION,k);return M.accept(D),C(D.result,N)}r.getLookaheadPathsForOr=m;function y(Q,M,N,k){var D=new g(Q,N);M.accept(D);var x=D.result,W=new E(M,Q,N),$=W.startWalking(),H=new s.Alternative({definition:x}),ee=new s.Alternative({definition:$});return C([H,ee],k)}r.getLookaheadPathsForOptionalProd=y;function S(Q,M){e:for(var N=0;N<Q.length;N++){var k=Q[N];if(k.length===M.length){for(var D=0;D<k.length;D++){var x=M[D],W=k[D],$=x===W||W.categoryMatchesMap[x.tokenTypeIdx]!==void 0;if($===!1)continue e}return!0}}return!1}r.containsPath=S;function _(Q,M){return Q.length<M.length&&t.every(Q,function(N,k){var D=M[k];return N===D||D.categoryMatchesMap[N.tokenTypeIdx]})}r.isStrictPrefixOfPath=_;function z(Q){return t.every(Q,function(M){return t.every(M,function(N){return t.every(N,function(k){return t.isEmpty(k.categoryMatches)})})})}r.areTokenCategoriesNotUsed=z}),si=ve(r=>{var e=r&&r.__extends||(function(){var k=function(D,x){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,$){W.__proto__=$}||function(W,$){for(var H in $)Object.prototype.hasOwnProperty.call($,H)&&(W[H]=$[H])},k(D,x)};return function(D,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");k(D,x);function W(){this.constructor=D}D.prototype=x===null?Object.create(x):(W.prototype=x.prototype,new W)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.checkPrefixAlternativesAmbiguities=r.validateSomeNonEmptyLookaheadPath=r.validateTooManyAlts=r.RepetionCollector=r.validateAmbiguousAlternationAlternatives=r.validateEmptyOrAlternative=r.getFirstNoneTerminal=r.validateNoLeftRecursion=r.validateRuleIsOverridden=r.validateRuleDoesNotAlreadyExist=r.OccurrenceValidationCollector=r.identifyProductionForDuplicates=r.validateGrammar=void 0;var t=Fe(),n=Fe(),i=et(),o=Pt(),s=Ht(),c=Ut(),A=Je(),a=kt();function d(k,D,x,W,$){var H=t.map(k,function(P){return u(P,W)}),ee=t.map(k,function(P){return h(P,P,W)}),ie=[],ue=[],re=[];n.every(ee,n.isEmpty)&&(ie=n.map(k,function(P){return m(P,W)}),ue=n.map(k,function(P){return y(P,D,W)}),re=z(k,D,W));var X=N(k,x,W),ae=n.map(k,function(P){return _(P,W)}),de=n.map(k,function(P){return g(P,k,$,W)});return t.flatten(H.concat(re,ee,ie,ue,X,ae,de))}r.validateGrammar=d;function u(k,D){var x=new E;k.accept(x);var W=x.allProductions,$=t.groupBy(W,b),H=t.pick($,function(ie){return ie.length>1}),ee=t.map(t.values(H),function(ie){var ue=t.first(ie),re=D.buildDuplicateFoundError(k,ie),X=o.getProductionDslName(ue),ae={message:re,type:i.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:k.name,dslName:X,occurrence:ue.idx},de=f(ue);return de&&(ae.parameter=de),ae});return ee}function b(k){return o.getProductionDslName(k)+"_#_"+k.idx+"_#_"+f(k)}r.identifyProductionForDuplicates=b;function f(k){return k instanceof A.Terminal?k.terminalType.name:k instanceof A.NonTerminal?k.nonTerminalName:""}var E=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.allProductions=[],x}return D.prototype.visitNonTerminal=function(x){this.allProductions.push(x)},D.prototype.visitOption=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatory=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetition=function(x){this.allProductions.push(x)},D.prototype.visitAlternation=function(x){this.allProductions.push(x)},D.prototype.visitTerminal=function(x){this.allProductions.push(x)},D})(a.GAstVisitor);r.OccurrenceValidationCollector=E;function g(k,D,x,W){var $=[],H=n.reduce(D,function(ie,ue){return ue.name===k.name?ie+1:ie},0);if(H>1){var ee=W.buildDuplicateRuleNameError({topLevelRule:k,grammarName:x});$.push({message:ee,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:k.name})}return $}r.validateRuleDoesNotAlreadyExist=g;function l(k,D,x){var W=[],$;return t.contains(D,k)||($="Invalid rule override, rule: ->"+k+"<- cannot be overridden in the grammar: ->"+x+"<-as it is not defined in any of the super grammars ",W.push({message:$,type:i.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:k})),W}r.validateRuleIsOverridden=l;function h(k,D,x,W){W===void 0&&(W=[]);var $=[],H=p(D.definition);if(t.isEmpty(H))return[];var ee=k.name,ie=t.contains(H,k);ie&&$.push({message:x.buildLeftRecursionError({topLevelRule:k,leftRecursionPath:W}),type:i.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(H,W.concat([k])),re=t.map(ue,function(X){var ae=t.cloneArr(W);return ae.push(X),h(k,X,x,ae)});return $.concat(t.flatten(re))}r.validateNoLeftRecursion=h;function p(k){var D=[];if(t.isEmpty(k))return D;var x=t.first(k);if(x instanceof A.NonTerminal)D.push(x.referencedRule);else if(x instanceof A.Alternative||x instanceof A.Option||x instanceof A.RepetitionMandatory||x instanceof A.RepetitionMandatoryWithSeparator||x instanceof A.RepetitionWithSeparator||x instanceof A.Repetition)D=D.concat(p(x.definition));else if(x instanceof A.Alternation)D=t.flatten(t.map(x.definition,function(ee){return p(ee.definition)}));else if(!(x instanceof A.Terminal))throw Error("non exhaustive match");var W=o.isOptionalProd(x),$=k.length>1;if(W&&$){var H=t.drop(k);return D.concat(p(H))}else return D}r.getFirstNoneTerminal=p;var C=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.alternations=[],x}return D.prototype.visitAlternation=function(x){this.alternations.push(x)},D})(a.GAstVisitor);function m(k,D){var x=new C;k.accept(x);var W=x.alternations,$=t.reduce(W,function(H,ee){var ie=t.dropRight(ee.definition),ue=t.map(ie,function(re,X){var ae=c.nextPossibleTokensAfter([re],[],null,1);return t.isEmpty(ae)?{message:D.buildEmptyAlternationError({topLevelRule:k,alternation:ee,emptyChoiceIdx:X}),type:i.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:k.name,occurrence:ee.idx,alternative:X+1}:null});return H.concat(t.compact(ue))},[]);return $}r.validateEmptyOrAlternative=m;function y(k,D,x){var W=new C;k.accept(W);var $=W.alternations;$=n.reject($,function(ee){return ee.ignoreAmbiguities===!0});var H=t.reduce($,function(ee,ie){var ue=ie.idx,re=ie.maxLookahead||D,X=s.getLookaheadPathsForOr(ue,k,re,ie),ae=Q(X,ie,k,x),de=M(X,ie,k,x);return ee.concat(ae,de)},[]);return H}r.validateAmbiguousAlternationAlternatives=y;var S=(function(k){e(D,k);function D(){var x=k!==null&&k.apply(this,arguments)||this;return x.allProductions=[],x}return D.prototype.visitRepetitionWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatory=function(x){this.allProductions.push(x)},D.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.allProductions.push(x)},D.prototype.visitRepetition=function(x){this.allProductions.push(x)},D})(a.GAstVisitor);r.RepetionCollector=S;function _(k,D){var x=new C;k.accept(x);var W=x.alternations,$=t.reduce(W,function(H,ee){return ee.definition.length>255&&H.push({message:D.buildTooManyAlternativesError({topLevelRule:k,alternation:ee}),type:i.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:k.name,occurrence:ee.idx}),H},[]);return $}r.validateTooManyAlts=_;function z(k,D,x){var W=[];return n.forEach(k,function($){var H=new S;$.accept(H);var ee=H.allProductions;n.forEach(ee,function(ie){var ue=s.getProdType(ie),re=ie.maxLookahead||D,X=ie.idx,ae=s.getLookaheadPathsForOptionalProd(X,$,ue,re),de=ae[0];if(n.isEmpty(n.flatten(de))){var P=x.buildEmptyRepetitionError({topLevelRule:$,repetition:ie});W.push({message:P,type:i.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:$.name})}})}),W}r.validateSomeNonEmptyLookaheadPath=z;function Q(k,D,x,W){var $=[],H=n.reduce(k,function(ie,ue,re){return D.definition[re].ignoreAmbiguities===!0||n.forEach(ue,function(X){var ae=[re];n.forEach(k,function(de,P){re!==P&&s.containsPath(de,X)&&D.definition[P].ignoreAmbiguities!==!0&&ae.push(P)}),ae.length>1&&!s.containsPath($,X)&&($.push(X),ie.push({alts:ae,path:X}))}),ie},[]),ee=t.map(H,function(ie){var ue=n.map(ie.alts,function(X){return X+1}),re=W.buildAlternationAmbiguityError({topLevelRule:x,alternation:D,ambiguityIndices:ue,prefixPath:ie.path});return{message:re,type:i.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:x.name,occurrence:D.idx,alternatives:[ie.alts]}});return ee}function M(k,D,x,W){var $=[],H=n.reduce(k,function(ee,ie,ue){var re=n.map(ie,function(X){return{idx:ue,path:X}});return ee.concat(re)},[]);return n.forEach(H,function(ee){var ie=D.definition[ee.idx];if(ie.ignoreAmbiguities!==!0){var ue=ee.idx,re=ee.path,X=n.findAll(H,function(de){return D.definition[de.idx].ignoreAmbiguities!==!0&&de.idx<ue&&s.isStrictPrefixOfPath(de.path,re)}),ae=n.map(X,function(de){var P=[de.idx+1,ue+1],j=D.idx===0?"":D.idx,U=W.buildAlternationPrefixAmbiguityError({topLevelRule:x,alternation:D,ambiguityIndices:P,prefixPath:de.path});return{message:U,type:i.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:x.name,occurrence:j,alternatives:P}});$=$.concat(ae)}}),$}r.checkPrefixAlternativesAmbiguities=M;function N(k,D,x){var W=[],$=n.map(D,function(H){return H.name});return n.forEach(k,function(H){var ee=H.name;if(n.contains($,ee)){var ie=x.buildNamespaceConflictError(H);W.push({message:ie,type:i.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),W}}),Wr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.validateGrammar=r.resolveGrammar=void 0;var e=Fe(),t=Vr(),n=si(),i=Gt();function o(c){c=e.defaults(c,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}r.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:i.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}r.validateGrammar=s}),St=ve(r=>{var e=r&&r.__extends||(function(){var E=function(g,l){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(h[C]=p[C])},E(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");E(g,l);function h(){this.constructor=g}g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.EarlyExitException=r.NotAllInputParsedException=r.NoViableAltException=r.MismatchedTokenException=r.isRecognitionException=void 0;var t=Fe(),n="MismatchedTokenException",i="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,i,o,s];Object.freeze(c);function A(E){return t.contains(c,E.name)}r.isRecognitionException=A;var a=(function(E){e(g,E);function g(l,h){var p=this.constructor,C=E.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),d=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=n,C}return g})(a);r.MismatchedTokenException=d;var u=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=i,C}return g})(a);r.NoViableAltException=u;var b=(function(E){e(g,E);function g(l,h){var p=E.call(this,l,h)||this;return p.name=s,p}return g})(a);r.NotAllInputParsedException=b;var f=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=o,C}return g})(a);r.EarlyExitException=f}),ai=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.attemptInRepetitionRecovery=r.Recoverable=r.InRuleRecoveryException=r.IN_RULE_RECOVERY_EXCEPTION=r.EOF_FOLLOW_KEY=void 0;var e=dt(),t=Fe(),n=St(),i=oi(),o=et();r.EOF_FOLLOW_KEY={},r.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=r.IN_RULE_RECOVERY_EXCEPTION,this.message=a}r.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,b,f){for(var E=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],p=!1,C=this.LA(1),m=this.LA(1),y=function(){var S=E.LA(0),_=E.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:S,ruleName:E.getCurrRuleFullName()}),z=new n.MismatchedTokenException(_,C,E.LA(0));z.resyncedTokens=t.dropRight(h),E.SAVE_ERROR(z)};!p;)if(this.tokenMatcher(m,f)){y();return}else if(b.call(this)){y(),d.apply(this,u);return}else this.tokenMatcher(m,g)?p=!0:(m=this.SKIP_TOKEN(),this.addToResyncTokens(m,h));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(d,u,b){return!(b===!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 b=this.getCurrentGrammarPath(d,u),f=this.getNextPossibleTokenTypes(b);return f},a.prototype.tryInRuleRecovery=function(d,u){if(this.canRecoverWithSingleTokenInsertion(d,u)){var b=this.getTokenToInsert(d);return b}if(this.canRecoverWithSingleTokenDeletion(d)){var f=this.SKIP_TOKEN();return this.consumeToken(),f}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 b=this;if(!this.canTokenTypeBeInsertedInRecovery(d)||t.isEmpty(u))return!1;var f=this.LA(1),E=t.find(u,function(g){return b.tokenMatcher(f,g)})!==void 0;return E},a.prototype.canRecoverWithSingleTokenDeletion=function(d){var u=this.tokenMatcher(this.LA(2),d);return u},a.prototype.isInCurrentRuleReSyncSet=function(d){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,d)},a.prototype.findReSyncTokenType=function(){for(var d=this.flattenFollowSet(),u=this.LA(1),b=2;;){var f=u.tokenType;if(t.contains(d,f))return f;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return r.EOF_FOLLOW_KEY;var d=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(d),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var d=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(f,E){return E===0?r.EOF_FOLLOW_KEY:{ruleName:d.shortRuleNameToFullName(f),idxInCallingRule:b[E],inRule:d.shortRuleNameToFullName(u[E-1])}})},a.prototype.flattenFollowSet=function(){var d=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return d.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(d){if(d===r.EOF_FOLLOW_KEY)return[e.EOF];var u=d.ruleName+d.idxInCallingRule+i.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=[],b=this.LA(1);this.tokenMatcher(b,d)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(d,u,b,f,E,g,l){},a.prototype.getCurrentGrammarPath=function(d,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),E={ruleStack:b,occurrenceStack:f,lastTok:d,lastTokOccurrence:u};return E},a.prototype.getHumanReadableRuleStack=function(){var d=this;return t.map(this.RULE_STACK,function(u){return d.shortRuleNameToFullName(u)})},a})();r.Recoverable=c;function A(a,d,u,b,f,E,g){var l=this.getKeyForAutomaticLookahead(b,f),h=this.firstAfterRepMap[l];if(h===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],m=new E(C,f);h=m.startWalking(),this.firstAfterRepMap[l]=h}var y=h.token,S=h.occurrence,_=h.isEndOfRule;this.RULE_STACK.length===1&&_&&y===void 0&&(y=e.EOF,S=1),this.shouldInRepetitionRecoveryBeTried(y,S,g)&&this.tryInRepetitionRecovery(a,d,u,y)}r.attemptInRepetitionRecovery=A}),yn=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getKeyForAutomaticLookahead=r.AT_LEAST_ONE_SEP_IDX=r.MANY_SEP_IDX=r.AT_LEAST_ONE_IDX=r.MANY_IDX=r.OPTION_IDX=r.OR_IDX=r.BITS_FOR_ALT_IDX=r.BITS_FOR_RULE_IDX=r.BITS_FOR_OCCURRENCE_IDX=r.BITS_FOR_METHOD_TYPE=void 0,r.BITS_FOR_METHOD_TYPE=4,r.BITS_FOR_OCCURRENCE_IDX=8,r.BITS_FOR_RULE_IDX=12,r.BITS_FOR_ALT_IDX=8,r.OR_IDX=1<<r.BITS_FOR_OCCURRENCE_IDX,r.OPTION_IDX=2<<r.BITS_FOR_OCCURRENCE_IDX,r.MANY_IDX=3<<r.BITS_FOR_OCCURRENCE_IDX,r.AT_LEAST_ONE_IDX=4<<r.BITS_FOR_OCCURRENCE_IDX,r.MANY_SEP_IDX=5<<r.BITS_FOR_OCCURRENCE_IDX,r.AT_LEAST_ONE_SEP_IDX=6<<r.BITS_FOR_OCCURRENCE_IDX;function e(t,n,i){return i|n|t}r.getKeyForAutomaticLookahead=e,32-r.BITS_FOR_ALT_IDX}),Yr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LooksAhead=void 0;var e=Ht(),t=Fe(),n=et(),i=yn(),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),b=u.alternation,f=u.repetition,E=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+o.getProductionDslName(p)+C,function(){var m=e.buildLookaheadFuncForOr(p.idx,d,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=i.getKeyForAutomaticLookahead(a.fullRuleNameToShort[d.name],i.OR_IDX,p.idx);a.setLaFuncCache(y,m)})}),t.forEach(f,function(p){a.computeLookaheadFunc(d,p.idx,i.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(d,p.idx,i.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(g,function(p){a.computeLookaheadFunc(d,p.idx,i.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(d,p.idx,i.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(h,function(p){a.computeLookaheadFunc(d,p.idx,i.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,d,u,b,f){var E=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,b||E.maxLookahead,E.dynamicTokensEnabled,u,E.lookAheadBuilderForOptional),l=i.getKeyForAutomaticLookahead(E.fullRuleNameToShort[A.name],d,a);E.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 i.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})();r.LooksAhead=s}),Jr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addNoneTerminalToCst=r.addTerminalToCst=r.setNodeLocationFull=r.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)}r.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)}r.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}r.addTerminalToCst=n;function i(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}r.addNoneTerminalToCst=i}),Ai=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.defineNameProp=r.functionName=r.classNameFromInstance=void 0;var e=Fe();function t(s){return i(s.constructor)}r.classNameFromInstance=t;var n="name";function i(s){var c=s.name;return c||"anonymous"}r.functionName=i;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}r.defineNameProp=o}),Xr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.validateRedundantMethods=r.validateMissingCstMethods=r.validateVisitor=r.CstVisitorDefinitionError=r.createBaseVisitorConstructorWithDefaults=r.createBaseSemanticVisitorConstructor=r.defaultVisit=void 0;var e=Fe(),t=Ai();function n(u,b){for(var f=e.keys(u),E=f.length,g=0;g<E;g++)for(var l=f[g],h=u[l],p=h.length,C=0;C<p;C++){var m=h[C];m.tokenTypeIdx===void 0&&this[m.name](m.children,b)}}r.defaultVisit=n;function i(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var E={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,b);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 f.prototype=E,f.prototype.constructor=f,f._RULE_NAMES=b,f}r.createBaseSemanticVisitorConstructor=i;function o(u,b,f){var E=function(){};t.defineNameProp(E,u+"BaseSemanticsWithDefaults");var g=Object.create(f.prototype);return e.forEach(b,function(l){g[l]=n}),E.prototype=g,E.prototype.constructor=E,E}r.createBaseVisitorConstructorWithDefaults=o;var s;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(s=r.CstVisitorDefinitionError||(r.CstVisitorDefinitionError={}));function c(u,b){var f=A(u,b),E=d(u,b);return f.concat(E)}r.validateVisitor=c;function A(u,b){var f=e.map(b,function(E){if(!e.isFunction(u[E]))return{msg:"Missing visitor method: <"+E+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:s.MISSING_METHOD,methodName:E}});return e.compact(f)}r.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function d(u,b){var f=[];for(var E in u)e.isFunction(u[E])&&!e.contains(a,E)&&!e.contains(b,E)&&f.push({msg:"Redundant visitor method: <"+E+"> 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:E});return f}r.validateRedundantMethods=d}),Zr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TreeBuilder=void 0;var e=Jr(),t=Fe(),n=Xr(),i=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:i.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})();r.TreeBuilder=o}),$r=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.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(i){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=i,this.tokVectorLength=i.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(i){var o=this.currIdx+i;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(i){this.currIdx=i},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})();r.LexerAdapter=t}),eo=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RecognizerApi=void 0;var e=Fe(),t=_t(),n=et(),i=Gt(),o=ni(),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 b=i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),f={message:b,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(f)}this.definedRulesNames.push(a);var E=this.defineRule(a,d,u);return this[a]=E,E},A.prototype.OVERRIDE_RULE=function(a,d,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(b);var f=this.defineRule(a,d,u);return this[a]=f,f},A.prototype.BACKTRACK=function(a,d){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,d),!0}catch(b){if(t.isRecognitionException(b))return!1;throw b}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})();r.RecognizerApi=c}),to=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RecognizerEngine=void 0;var e=Fe(),t=In(),n=_t(),i=Ht(),o=Ut(),s=et(),c=ii(),A=dt(),a=Qt(),d=ri(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,E){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(E,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
89
+ `,type:s.REDUNDANT_METHOD,methodName:E});return f}r.validateRedundantMethods=d}),Zr=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TreeBuilder=void 0;var e=Jr(),t=Fe(),n=Xr(),i=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:i.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})();r.TreeBuilder=o}),$r=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.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(i){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=i,this.tokVectorLength=i.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(i){var o=this.currIdx+i;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(i){this.currIdx=i},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})();r.LexerAdapter=t}),eo=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RecognizerApi=void 0;var e=Fe(),t=St(),n=et(),i=Gt(),o=si(),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 b=i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),f={message:b,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(f)}this.definedRulesNames.push(a);var E=this.defineRule(a,d,u);return this[a]=E,E},A.prototype.OVERRIDE_RULE=function(a,d,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(b);var f=this.defineRule(a,d,u);return this[a]=f,f},A.prototype.BACKTRACK=function(a,d){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,d),!0}catch(b){if(t.isRecognitionException(b))return!1;throw b}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})();r.RecognizerApi=c}),to=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RecognizerEngine=void 0;var e=Fe(),t=yn(),n=St(),i=Ht(),o=Ut(),s=et(),c=ai(),A=dt(),a=Qt(),d=Ai(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,E){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(E,"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(f)){if(e.isEmpty(f))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 f[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(f))this.tokensMap=e.reduce(f,function(p,C){return p[C.name]=C,p},{});else if(e.has(f,"modes")&&e.every(e.flatten(e.values(f.modes)),a.isTokenType)){var g=e.flatten(e.values(f.modes)),l=e.uniq(g);this.tokensMap=e.reduce(l,function(p,C){return p[C.name]=C,p},{})}else if(e.isObject(f))this.tokensMap=e.cloneObj(f);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(f),function(p){return e.isEmpty(p.categoryMatches)});this.tokenMatcher=h?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},b.prototype.defineRule=function(f,E,g){if(this.selfAnalysisDone)throw Error("Grammar rule <"+f+`> 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,p=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[p]=f,this.fullRuleNameToShort[f]=p;function C(_){try{if(this.outputCst===!0){E.apply(this,_);var S=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(S),S}else return E.apply(this,_)}catch(z){return this.invokeRuleCatch(z,l,h)}finally{this.ruleFinallyStateUpdate()}}var m=function(_,S){return _===void 0&&(_=0),this.ruleInvocationStateUpdate(p,f,_),C.call(this,S)},y="ruleName";return m[y]=f,m.originalGrammarAction=E,m},b.prototype.invokeRuleCatch=function(f,E,g){var l=this.RULE_STACK.length===1,h=E&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(f)){var p=f;if(h){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(p.resyncedTokens=this.reSyncTo(C),this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];return m.recoveredNode=!0,m}else return g();else{if(this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];m.recoveredNode=!0,p.partialCstResult=m}throw p}}else{if(l)return this.moveToTerminatedState(),g();throw p}}else throw f},b.prototype.optionInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,E);return this.optionInternalLogic(f,E,g)},b.prototype.optionInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=f;if(h.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,E,g)},b.prototype.atLeastOneInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;if(h.call(this)===!0)for(var y=this.doSingleRepetition(p);h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,i.PROD_TYPE.REPETITION_MANDATORY,E.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,E],h,t.AT_LEAST_ONE_IDX,f,o.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,E,g)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,h,o.NextTerminalAfterAtLeastOneSepWalker],m,t.AT_LEAST_ONE_SEP_IDX,f,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,E.ERR_MSG)},b.prototype.manyInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,E,g)},b.prototype.manyInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;for(var y=!0;h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,E],h,t.MANY_IDX,f,o.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,E,g)},b.prototype.manySepFirstInternalLogic=function(f,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,h,o.NextTerminalAfterManySepWalker],m,t.MANY_SEP_IDX,f,o.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,E,g,l,h){for(;g();)this.CONSUME(E),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,E,g,l,h],g,t.AT_LEAST_ONE_SEP_IDX,f,h)},b.prototype.doSingleRepetition=function(f){var E=this.getLexerPosition();f.call(this);var g=this.getLexerPosition();return g>E},b.prototype.orInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,E),l=e.isArray(f)?f:f.DEF,h=this.getLaFuncFromCache(g),p=h.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(E,f.ERR_MSG)},b.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var f=this.LA(1),E=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(E,f))}},b.prototype.subruleInternal=function(f,E,g){var l;try{var h=g!==void 0?g.ARGS:void 0;return l=f.call(this,E,h),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,g,f.ruleName)}},b.prototype.subruleInternalError=function(f,E,g){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,E!==void 0&&E.LABEL!==void 0?E.LABEL:g),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,E,g){var l;try{var h=this.LA(1);this.tokenMatcher(h,f)===!0?(this.consumeToken(),l=h):this.consumeInternalError(f,h,g)}catch(p){l=this.consumeInternalRecovery(f,E,p)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,E,g){var l,h=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:E,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,E,h))},b.prototype.consumeInternalRecovery=function(f,E,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,E);try{return this.tryInRuleRecovery(f,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?g:h}}else throw g},b.prototype.saveRecogState=function(){var f=this.errors,E=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:E,CST_STACK:this.CST_STACK}},b.prototype.reloadRecogState=function(f){this.errors=f.errors,this.importLexerState(f.lexerState),this.RULE_STACK=f.RULE_STACK},b.prototype.ruleInvocationStateUpdate=function(f,E,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(E,f)},b.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},b.prototype.getCurrRuleFullName=function(){var f=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[f]},b.prototype.shortRuleNameToFullName=function(f){return this.shortRuleNameToFull[f]},b.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},b.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},b})();r.RecognizerEngine=u}),no=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorHandler=void 0;var e=_t(),t=Fe(),n=Ht(),i=et(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:i.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],b=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),f=b[0],E=[],g=1;g<=this.maxLookahead;g++)E.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:E,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),b=[],f=1;f<=this.maxLookahead;f++)b.push(this.LA(f));var E=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:E,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),E))},s})();r.ErrorHandler=o}),io=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ContentAssist=void 0;var e=Ut(),t=Fe(),n=(function(){function i(){}return i.prototype.initContentAssist=function(){},i.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)},i.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},i})();r.ContentAssist=n}),ro=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GastRecorder=void 0;var e=Fe(),t=Je(),n=Mt(),i=Qt(),o=dt(),s=et(),c=In(),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});i.augmentTokenTypes([u]);var b=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,p=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[p]=f,this.fullRuleNameToShort[f]=p;function C(S){try{if(this.outputCst===!0){E.apply(this,S);var _=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(_),_}else return E.apply(this,S)}catch(z){return this.invokeRuleCatch(z,l,h)}finally{this.ruleFinallyStateUpdate()}}var m=function(S,_){return S===void 0&&(S=0),this.ruleInvocationStateUpdate(p,f,S),C.call(this,_)},y="ruleName";return m[y]=f,m.originalGrammarAction=E,m},b.prototype.invokeRuleCatch=function(f,E,g){var l=this.RULE_STACK.length===1,h=E&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(f)){var p=f;if(h){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(p.resyncedTokens=this.reSyncTo(C),this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];return m.recoveredNode=!0,m}else return g();else{if(this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];m.recoveredNode=!0,p.partialCstResult=m}throw p}}else{if(l)return this.moveToTerminatedState(),g();throw p}}else throw f},b.prototype.optionInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,E);return this.optionInternalLogic(f,E,g)},b.prototype.optionInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=f;if(h.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,E,g)},b.prototype.atLeastOneInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;if(h.call(this)===!0)for(var y=this.doSingleRepetition(p);h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,i.PROD_TYPE.REPETITION_MANDATORY,E.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,E],h,t.AT_LEAST_ONE_IDX,f,o.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,E,g)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,h,o.NextTerminalAfterAtLeastOneSepWalker],m,t.AT_LEAST_ONE_SEP_IDX,f,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,E.ERR_MSG)},b.prototype.manyInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,E,g)},b.prototype.manyInternalLogic=function(f,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;for(var y=!0;h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,E],h,t.MANY_IDX,f,o.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,E,g)},b.prototype.manySepFirstInternalLogic=function(f,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,h,o.NextTerminalAfterManySepWalker],m,t.MANY_SEP_IDX,f,o.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,E,g,l,h){for(;g();)this.CONSUME(E),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,E,g,l,h],g,t.AT_LEAST_ONE_SEP_IDX,f,h)},b.prototype.doSingleRepetition=function(f){var E=this.getLexerPosition();f.call(this);var g=this.getLexerPosition();return g>E},b.prototype.orInternal=function(f,E){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,E),l=e.isArray(f)?f:f.DEF,h=this.getLaFuncFromCache(g),p=h.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(E,f.ERR_MSG)},b.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var f=this.LA(1),E=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(E,f))}},b.prototype.subruleInternal=function(f,E,g){var l;try{var h=g!==void 0?g.ARGS:void 0;return l=f.call(this,E,h),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,g,f.ruleName)}},b.prototype.subruleInternalError=function(f,E,g){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,E!==void 0&&E.LABEL!==void 0?E.LABEL:g),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,E,g){var l;try{var h=this.LA(1);this.tokenMatcher(h,f)===!0?(this.consumeToken(),l=h):this.consumeInternalError(f,h,g)}catch(p){l=this.consumeInternalRecovery(f,E,p)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,E,g){var l,h=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:E,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,E,h))},b.prototype.consumeInternalRecovery=function(f,E,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,E);try{return this.tryInRuleRecovery(f,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?g:h}}else throw g},b.prototype.saveRecogState=function(){var f=this.errors,E=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:E,CST_STACK:this.CST_STACK}},b.prototype.reloadRecogState=function(f){this.errors=f.errors,this.importLexerState(f.lexerState),this.RULE_STACK=f.RULE_STACK},b.prototype.ruleInvocationStateUpdate=function(f,E,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(E,f)},b.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},b.prototype.getCurrRuleFullName=function(){var f=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[f]},b.prototype.shortRuleNameToFullName=function(f){return this.shortRuleNameToFull[f]},b.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},b.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},b})();r.RecognizerEngine=u}),no=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorHandler=void 0;var e=St(),t=Fe(),n=Ht(),i=et(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:i.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],b=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),f=b[0],E=[],g=1;g<=this.maxLookahead;g++)E.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:E,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),b=[],f=1;f<=this.maxLookahead;f++)b.push(this.LA(f));var E=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:E,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),E))},s})();r.ErrorHandler=o}),io=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ContentAssist=void 0;var e=Ut(),t=Fe(),n=(function(){function i(){}return i.prototype.initContentAssist=function(){},i.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)},i.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},i})();r.ContentAssist=n}),ro=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GastRecorder=void 0;var e=Fe(),t=Je(),n=Mt(),i=Qt(),o=dt(),s=et(),c=yn(),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});i.augmentTokenTypes([u]);var b=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(b);var f={name:`This CSTNode indicates the Parser is in Recording Phase
98
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},E=(function(){function C(){}return C.prototype.initGastRecorder=function(m){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var m=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(S){var z=S>0?S:"";m["CONSUME"+z]=function(Q,M){return this.consumeInternalRecord(Q,S,M)},m["SUBRULE"+z]=function(Q,M){return this.subruleInternalRecord(Q,S,M)},m["OPTION"+z]=function(Q){return this.optionInternalRecord(Q,S)},m["OR"+z]=function(Q){return this.orInternalRecord(Q,S)},m["MANY"+z]=function(Q){this.manyInternalRecord(S,Q)},m["MANY_SEP"+z]=function(Q){this.manySepFirstInternalRecord(S,Q)},m["AT_LEAST_ONE"+z]=function(Q){this.atLeastOneInternalRecord(S,Q)},m["AT_LEAST_ONE_SEP"+z]=function(Q){this.atLeastOneSepFirstInternalRecord(S,Q)}},_=0;_<10;_++)y(_);m.consume=function(S,z,Q){return this.consumeInternalRecord(z,S,Q)},m.subrule=function(S,z,Q){return this.subruleInternalRecord(z,S,Q)},m.option=function(S,z){return this.optionInternalRecord(z,S)},m.or=function(S,z){return this.orInternalRecord(z,S)},m.many=function(S,z){this.manyInternalRecord(S,z)},m.atLeastOne=function(S,z){this.atLeastOneInternalRecord(S,z)},m.ACTION=m.ACTION_RECORD,m.BACKTRACK=m.BACKTRACK_RECORD,m.LA=m.LA_RECORD})},C.prototype.disableRecording=function(){var m=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var _=y>0?y:"";delete m["CONSUME"+_],delete m["SUBRULE"+_],delete m["OPTION"+_],delete m["OR"+_],delete m["MANY"+_],delete m["MANY_SEP"+_],delete m["AT_LEAST_ONE"+_],delete m["AT_LEAST_ONE_SEP"+_]}delete m.consume,delete m.subrule,delete m.option,delete m.or,delete m.many,delete m.atLeastOne,delete m.ACTION,delete m.BACKTRACK,delete m.LA})},C.prototype.ACTION_RECORD=function(m){},C.prototype.BACKTRACK_RECORD=function(m,y){return function(){return!0}},C.prototype.LA_RECORD=function(m){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(m,y){try{var _=new t.Rule({definition:[],name:m});return _.name=m,this.recordingProdStack.push(_),y.call(this),this.recordingProdStack.pop(),_}catch(S){if(S.KNOWN_RECORDER_ERROR!==!0)try{S.message=S.message+`
98
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},E=(function(){function C(){}return C.prototype.initGastRecorder=function(m){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var m=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(_){var z=_>0?_:"";m["CONSUME"+z]=function(Q,M){return this.consumeInternalRecord(Q,_,M)},m["SUBRULE"+z]=function(Q,M){return this.subruleInternalRecord(Q,_,M)},m["OPTION"+z]=function(Q){return this.optionInternalRecord(Q,_)},m["OR"+z]=function(Q){return this.orInternalRecord(Q,_)},m["MANY"+z]=function(Q){this.manyInternalRecord(_,Q)},m["MANY_SEP"+z]=function(Q){this.manySepFirstInternalRecord(_,Q)},m["AT_LEAST_ONE"+z]=function(Q){this.atLeastOneInternalRecord(_,Q)},m["AT_LEAST_ONE_SEP"+z]=function(Q){this.atLeastOneSepFirstInternalRecord(_,Q)}},S=0;S<10;S++)y(S);m.consume=function(_,z,Q){return this.consumeInternalRecord(z,_,Q)},m.subrule=function(_,z,Q){return this.subruleInternalRecord(z,_,Q)},m.option=function(_,z){return this.optionInternalRecord(z,_)},m.or=function(_,z){return this.orInternalRecord(z,_)},m.many=function(_,z){this.manyInternalRecord(_,z)},m.atLeastOne=function(_,z){this.atLeastOneInternalRecord(_,z)},m.ACTION=m.ACTION_RECORD,m.BACKTRACK=m.BACKTRACK_RECORD,m.LA=m.LA_RECORD})},C.prototype.disableRecording=function(){var m=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var S=y>0?y:"";delete m["CONSUME"+S],delete m["SUBRULE"+S],delete m["OPTION"+S],delete m["OR"+S],delete m["MANY"+S],delete m["MANY_SEP"+S],delete m["AT_LEAST_ONE"+S],delete m["AT_LEAST_ONE_SEP"+S]}delete m.consume,delete m.subrule,delete m.option,delete m.or,delete m.many,delete m.atLeastOne,delete m.ACTION,delete m.BACKTRACK,delete m.LA})},C.prototype.ACTION_RECORD=function(m){},C.prototype.BACKTRACK_RECORD=function(m,y){return function(){return!0}},C.prototype.LA_RECORD=function(m){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(m,y){try{var S=new t.Rule({definition:[],name:m});return S.name=m,this.recordingProdStack.push(S),y.call(this),this.recordingProdStack.pop(),S}catch(_){if(_.KNOWN_RECORDER_ERROR!==!0)try{_.message=_.message+`
99
99
  This error was thrown during the "grammar recording phase" For more info see:
100
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw S}throw S}},C.prototype.optionInternalRecord=function(m,y){return g.call(this,t.Option,m,y)},C.prototype.atLeastOneInternalRecord=function(m,y){g.call(this,t.RepetitionMandatory,y,m)},C.prototype.atLeastOneSepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionMandatoryWithSeparator,y,m,a)},C.prototype.manyInternalRecord=function(m,y){g.call(this,t.Repetition,y,m)},C.prototype.manySepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionWithSeparator,y,m,a)},C.prototype.orInternalRecord=function(m,y){return l.call(this,m,y)},C.prototype.subruleInternalRecord=function(m,y,_){if(p(y),!m||e.has(m,"ruleName")===!1){var S=new Error("<SUBRULE"+h(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(m)+">")+(`
101
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var z=e.peek(this.recordingProdStack),Q=m.ruleName,M=new t.NonTerminal({idx:y,nonTerminalName:Q,referencedRule:void 0});return z.definition.push(M),this.outputCst?f:A},C.prototype.consumeInternalRecord=function(m,y,_){if(p(y),!i.hasShortKeyProperty(m)){var S=new Error("<CONSUME"+h(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(m)+">")+(`
102
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var z=e.peek(this.recordingProdStack),Q=new t.Terminal({idx:y,terminalType:m});return z.definition.push(Q),b},C})();r.GastRecorder=E;function g(C,m,y,_){_===void 0&&(_=!1),p(y);var S=e.peek(this.recordingProdStack),z=e.isFunction(m)?m:m.DEF,Q=new C({definition:[],idx:y});return _&&(Q.separator=m.SEP),e.has(m,"MAX_LOOKAHEAD")&&(Q.maxLookahead=m.MAX_LOOKAHEAD),this.recordingProdStack.push(Q),z.call(this),S.definition.push(Q),this.recordingProdStack.pop(),A}function l(C,m){var y=this;p(m);var _=e.peek(this.recordingProdStack),S=e.isArray(C)===!1,z=S===!1?C:C.DEF,Q=new t.Alternation({definition:[],idx:m,ignoreAmbiguities:S&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(Q.maxLookahead=C.MAX_LOOKAHEAD);var M=e.some(z,function(N){return e.isFunction(N.GATE)});return Q.hasPredicates=M,_.definition.push(Q),e.forEach(z,function(N){var k=new t.Alternative({definition:[]});Q.definition.push(k),e.has(N,"IGNORE_AMBIGUITIES")?k.ignoreAmbiguities=N.IGNORE_AMBIGUITIES:e.has(N,"GATE")&&(k.ignoreAmbiguities=!0),y.recordingProdStack.push(k),N.ALT.call(y),y.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function p(C){if(C<0||C>d){var m=new Error("Invalid DSL Method idx value: <"+C+`>
103
- `+("Idx value must be a none negative value smaller than "+(d+1)));throw m.KNOWN_RECORDER_ERROR=!0,m}}}),oo=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PerformanceTracer=void 0;var e=Fe(),t=et(),n=(function(){function i(){}return i.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},i.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()},i})();r.PerformanceTracer=n}),so=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.applyMixins=void 0;function e(t,n){n.forEach(function(i){var o=i.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]=i.prototype[s]}})})}r.applyMixins=e}),et=ve(r=>{var e=r&&r.__extends||(function(){var _=function(S,z){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,M){Q.__proto__=M}||function(Q,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(Q[N]=M[N])},_(S,z)};return function(S,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");_(S,z);function Q(){this.constructor=S}S.prototype=z===null?Object.create(z):(Q.prototype=z.prototype,new Q)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.EmbeddedActionsParser=r.CstParser=r.Parser=r.EMPTY_ALT=r.ParserDefinitionErrorType=r.DEFAULT_RULE_CONFIG=r.DEFAULT_PARSER_CONFIG=r.END_OF_FILE=void 0;var t=Fe(),n=Kr(),i=dt(),o=Gt(),s=Wr(),c=ii(),A=Yr(),a=Zr(),d=$r(),u=eo(),b=to(),f=no(),E=io(),g=ro(),l=oo(),h=so();r.END_OF_FILE=i.createTokenInstance(i.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(r.END_OF_FILE),r.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),r.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(_){_[_.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",_[_.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",_[_.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",_[_.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",_[_.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",_[_.LEFT_RECURSION=5]="LEFT_RECURSION",_[_.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",_[_.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",_[_.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",_[_.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",_[_.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",_[_.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",_[_.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(r.ParserDefinitionErrorType||(r.ParserDefinitionErrorType={}));function p(_){return _===void 0&&(_=void 0),function(){return _}}r.EMPTY_ALT=p;var C=(function(){function _(S,z){this.definitionErrors=[],this.selfAnalysisDone=!1;var Q=this;if(Q.initErrorHandler(z),Q.initLexerAdapter(),Q.initLooksAhead(z),Q.initRecognizerEngine(S,z),Q.initRecoverable(z),Q.initTreeBuilder(z),Q.initContentAssist(),Q.initGastRecorder(z),Q.initPerformanceTracer(z),t.has(z,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
100
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw _}throw _}},C.prototype.optionInternalRecord=function(m,y){return g.call(this,t.Option,m,y)},C.prototype.atLeastOneInternalRecord=function(m,y){g.call(this,t.RepetitionMandatory,y,m)},C.prototype.atLeastOneSepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionMandatoryWithSeparator,y,m,a)},C.prototype.manyInternalRecord=function(m,y){g.call(this,t.Repetition,y,m)},C.prototype.manySepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionWithSeparator,y,m,a)},C.prototype.orInternalRecord=function(m,y){return l.call(this,m,y)},C.prototype.subruleInternalRecord=function(m,y,S){if(p(y),!m||e.has(m,"ruleName")===!1){var _=new Error("<SUBRULE"+h(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(m)+">")+(`
101
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw _.KNOWN_RECORDER_ERROR=!0,_}var z=e.peek(this.recordingProdStack),Q=m.ruleName,M=new t.NonTerminal({idx:y,nonTerminalName:Q,referencedRule:void 0});return z.definition.push(M),this.outputCst?f:A},C.prototype.consumeInternalRecord=function(m,y,S){if(p(y),!i.hasShortKeyProperty(m)){var _=new Error("<CONSUME"+h(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(m)+">")+(`
102
+ inside top level rule: <`+this.recordingProdStack[0].name+">"));throw _.KNOWN_RECORDER_ERROR=!0,_}var z=e.peek(this.recordingProdStack),Q=new t.Terminal({idx:y,terminalType:m});return z.definition.push(Q),b},C})();r.GastRecorder=E;function g(C,m,y,S){S===void 0&&(S=!1),p(y);var _=e.peek(this.recordingProdStack),z=e.isFunction(m)?m:m.DEF,Q=new C({definition:[],idx:y});return S&&(Q.separator=m.SEP),e.has(m,"MAX_LOOKAHEAD")&&(Q.maxLookahead=m.MAX_LOOKAHEAD),this.recordingProdStack.push(Q),z.call(this),_.definition.push(Q),this.recordingProdStack.pop(),A}function l(C,m){var y=this;p(m);var S=e.peek(this.recordingProdStack),_=e.isArray(C)===!1,z=_===!1?C:C.DEF,Q=new t.Alternation({definition:[],idx:m,ignoreAmbiguities:_&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(Q.maxLookahead=C.MAX_LOOKAHEAD);var M=e.some(z,function(N){return e.isFunction(N.GATE)});return Q.hasPredicates=M,S.definition.push(Q),e.forEach(z,function(N){var k=new t.Alternative({definition:[]});Q.definition.push(k),e.has(N,"IGNORE_AMBIGUITIES")?k.ignoreAmbiguities=N.IGNORE_AMBIGUITIES:e.has(N,"GATE")&&(k.ignoreAmbiguities=!0),y.recordingProdStack.push(k),N.ALT.call(y),y.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function p(C){if(C<0||C>d){var m=new Error("Invalid DSL Method idx value: <"+C+`>
103
+ `+("Idx value must be a none negative value smaller than "+(d+1)));throw m.KNOWN_RECORDER_ERROR=!0,m}}}),oo=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PerformanceTracer=void 0;var e=Fe(),t=et(),n=(function(){function i(){}return i.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},i.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()},i})();r.PerformanceTracer=n}),so=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.applyMixins=void 0;function e(t,n){n.forEach(function(i){var o=i.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]=i.prototype[s]}})})}r.applyMixins=e}),et=ve(r=>{var e=r&&r.__extends||(function(){var S=function(_,z){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,M){Q.__proto__=M}||function(Q,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(Q[N]=M[N])},S(_,z)};return function(_,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");S(_,z);function Q(){this.constructor=_}_.prototype=z===null?Object.create(z):(Q.prototype=z.prototype,new Q)}})();Object.defineProperty(r,"__esModule",{value:!0}),r.EmbeddedActionsParser=r.CstParser=r.Parser=r.EMPTY_ALT=r.ParserDefinitionErrorType=r.DEFAULT_RULE_CONFIG=r.DEFAULT_PARSER_CONFIG=r.END_OF_FILE=void 0;var t=Fe(),n=Kr(),i=dt(),o=Gt(),s=Wr(),c=ai(),A=Yr(),a=Zr(),d=$r(),u=eo(),b=to(),f=no(),E=io(),g=ro(),l=oo(),h=so();r.END_OF_FILE=i.createTokenInstance(i.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(r.END_OF_FILE),r.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),r.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(S){S[S.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",S[S.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",S[S.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",S[S.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",S[S.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",S[S.LEFT_RECURSION=5]="LEFT_RECURSION",S[S.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",S[S.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",S[S.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",S[S.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",S[S.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",S[S.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",S[S.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(r.ParserDefinitionErrorType||(r.ParserDefinitionErrorType={}));function p(S){return S===void 0&&(S=void 0),function(){return S}}r.EMPTY_ALT=p;var C=(function(){function S(_,z){this.definitionErrors=[],this.selfAnalysisDone=!1;var Q=this;if(Q.initErrorHandler(z),Q.initLexerAdapter(),Q.initLooksAhead(z),Q.initRecognizerEngine(_,z),Q.initRecoverable(z),Q.initTreeBuilder(z),Q.initContentAssist(),Q.initGastRecorder(z),Q.initPerformanceTracer(z),t.has(z,"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:r.DEFAULT_PARSER_CONFIG.skipValidations}return _.performSelfAnalysis=function(S){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},_.prototype.performSelfAnalysis=function(){var S=this;this.TRACE_INIT("performSelfAnalysis",function(){var z;S.selfAnalysisDone=!0;var Q=S.className;S.TRACE_INIT("toFastProps",function(){t.toFastProperties(S)}),S.TRACE_INIT("Grammar Recording",function(){try{S.enableRecording(),t.forEach(S.definedRulesNames,function(N){var k=S[N],D=k.originalGrammarAction,x=void 0;S.TRACE_INIT(N+" Rule",function(){x=S.topLevelRuleRecord(N,D)}),S.gastProductionsCache[N]=x})}finally{S.disableRecording()}});var M=[];if(S.TRACE_INIT("Grammar Resolving",function(){M=s.resolveGrammar({rules:t.values(S.gastProductionsCache)}),S.definitionErrors=S.definitionErrors.concat(M)}),S.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(M)&&S.skipValidations===!1){var N=s.validateGrammar({rules:t.values(S.gastProductionsCache),maxLookahead:S.maxLookahead,tokenTypes:t.values(S.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:Q});S.definitionErrors=S.definitionErrors.concat(N)}}),t.isEmpty(S.definitionErrors)&&(S.recoveryEnabled&&S.TRACE_INIT("computeAllProdsFollows",function(){var N=n.computeAllProdsFollows(t.values(S.gastProductionsCache));S.resyncFollows=N}),S.TRACE_INIT("ComputeLookaheadFunctions",function(){S.preComputeLookaheadFunctions(t.values(S.gastProductionsCache))})),!_.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(S.definitionErrors))throw z=t.map(S.definitionErrors,function(N){return N.message}),new Error(`Parser Definition Errors detected:
106
+ For further details.`);this.skipValidations=t.has(z,"skipValidations")?z.skipValidations:r.DEFAULT_PARSER_CONFIG.skipValidations}return S.performSelfAnalysis=function(_){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},S.prototype.performSelfAnalysis=function(){var _=this;this.TRACE_INIT("performSelfAnalysis",function(){var z;_.selfAnalysisDone=!0;var Q=_.className;_.TRACE_INIT("toFastProps",function(){t.toFastProperties(_)}),_.TRACE_INIT("Grammar Recording",function(){try{_.enableRecording(),t.forEach(_.definedRulesNames,function(N){var k=_[N],D=k.originalGrammarAction,x=void 0;_.TRACE_INIT(N+" Rule",function(){x=_.topLevelRuleRecord(N,D)}),_.gastProductionsCache[N]=x})}finally{_.disableRecording()}});var M=[];if(_.TRACE_INIT("Grammar Resolving",function(){M=s.resolveGrammar({rules:t.values(_.gastProductionsCache)}),_.definitionErrors=_.definitionErrors.concat(M)}),_.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(M)&&_.skipValidations===!1){var N=s.validateGrammar({rules:t.values(_.gastProductionsCache),maxLookahead:_.maxLookahead,tokenTypes:t.values(_.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:Q});_.definitionErrors=_.definitionErrors.concat(N)}}),t.isEmpty(_.definitionErrors)&&(_.recoveryEnabled&&_.TRACE_INIT("computeAllProdsFollows",function(){var N=n.computeAllProdsFollows(t.values(_.gastProductionsCache));_.resyncFollows=N}),_.TRACE_INIT("ComputeLookaheadFunctions",function(){_.preComputeLookaheadFunctions(t.values(_.gastProductionsCache))})),!S.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(_.definitionErrors))throw z=t.map(_.definitionErrors,function(N){return N.message}),new Error(`Parser Definition Errors detected:
107
107
  `+z.join(`
108
108
  -------------------------------
109
- `))})},_.DEFER_DEFINITION_ERRORS_HANDLING=!1,_})();r.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,d.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,E.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var m=(function(_){e(S,_);function S(z,Q){Q===void 0&&(Q=r.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(Q);return N.outputCst=!0,M=_.call(this,z,N)||this,M}return S})(C);r.CstParser=m;var y=(function(_){e(S,_);function S(z,Q){Q===void 0&&(Q=r.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(Q);return N.outputCst=!1,M=_.call(this,z,N)||this,M}return S})(C);r.EmbeddedActionsParser=y}),ao=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSyntaxDiagramsCode=void 0;var e=Xn();function t(n,i){var o=i===void 0?{}:i,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
+ `))})},S.DEFER_DEFINITION_ERRORS_HANDLING=!1,S})();r.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,d.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,E.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var m=(function(S){e(_,S);function _(z,Q){Q===void 0&&(Q=r.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(Q);return N.outputCst=!0,M=S.call(this,z,N)||this,M}return _})(C);r.CstParser=m;var y=(function(S){e(_,S);function _(z,Q){Q===void 0&&(Q=r.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(Q);return N.outputCst=!1,M=S.call(this,z,N)||this,M}return _})(C);r.EmbeddedActionsParser=y}),ao=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSyntaxDiagramsCode=void 0;var e=ti();function t(n,i){var o=i===void 0?{}:i,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+b+f+E+g}r.createSyntaxDiagramsCode=t}),Ao=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Parser=r.createSyntaxDiagramsCode=r.clearCache=r.GAstVisitor=r.serializeProduction=r.serializeGrammar=r.Terminal=r.Rule=r.RepetitionWithSeparator=r.RepetitionMandatoryWithSeparator=r.RepetitionMandatory=r.Repetition=r.Option=r.NonTerminal=r.Alternative=r.Alternation=r.defaultLexerErrorProvider=r.NoViableAltException=r.NotAllInputParsedException=r.MismatchedTokenException=r.isRecognitionException=r.EarlyExitException=r.defaultParserErrorProvider=r.tokenName=r.tokenMatcher=r.tokenLabel=r.EOF=r.createTokenInstance=r.createToken=r.LexerDefinitionErrorType=r.Lexer=r.EMPTY_ALT=r.ParserDefinitionErrorType=r.EmbeddedActionsParser=r.CstParser=r.VERSION=void 0;var e=Xn();Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=et();Object.defineProperty(r,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(r,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(r,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(r,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=Mt();Object.defineProperty(r,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(r,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var i=dt();Object.defineProperty(r,"createToken",{enumerable:!0,get:function(){return i.createToken}}),Object.defineProperty(r,"createTokenInstance",{enumerable:!0,get:function(){return i.createTokenInstance}}),Object.defineProperty(r,"EOF",{enumerable:!0,get:function(){return i.EOF}}),Object.defineProperty(r,"tokenLabel",{enumerable:!0,get:function(){return i.tokenLabel}}),Object.defineProperty(r,"tokenMatcher",{enumerable:!0,get:function(){return i.tokenMatcher}}),Object.defineProperty(r,"tokenName",{enumerable:!0,get:function(){return i.tokenName}});var o=Gt();Object.defineProperty(r,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=_t();Object.defineProperty(r,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(r,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(r,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(r,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(r,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=$n();Object.defineProperty(r,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Je();Object.defineProperty(r,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(r,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(r,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(r,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(r,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(r,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(r,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(r,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(r,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(r,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Je();Object.defineProperty(r,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(r,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var d=kt();Object.defineProperty(r,"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+b+f+E+g}r.createSyntaxDiagramsCode=t}),Ao=ve(r=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Parser=r.createSyntaxDiagramsCode=r.clearCache=r.GAstVisitor=r.serializeProduction=r.serializeGrammar=r.Terminal=r.Rule=r.RepetitionWithSeparator=r.RepetitionMandatoryWithSeparator=r.RepetitionMandatory=r.Repetition=r.Option=r.NonTerminal=r.Alternative=r.Alternation=r.defaultLexerErrorProvider=r.NoViableAltException=r.NotAllInputParsedException=r.MismatchedTokenException=r.isRecognitionException=r.EarlyExitException=r.defaultParserErrorProvider=r.tokenName=r.tokenMatcher=r.tokenLabel=r.EOF=r.createTokenInstance=r.createToken=r.LexerDefinitionErrorType=r.Lexer=r.EMPTY_ALT=r.ParserDefinitionErrorType=r.EmbeddedActionsParser=r.CstParser=r.VERSION=void 0;var e=ti();Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=et();Object.defineProperty(r,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(r,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(r,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(r,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=Mt();Object.defineProperty(r,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(r,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var i=dt();Object.defineProperty(r,"createToken",{enumerable:!0,get:function(){return i.createToken}}),Object.defineProperty(r,"createTokenInstance",{enumerable:!0,get:function(){return i.createTokenInstance}}),Object.defineProperty(r,"EOF",{enumerable:!0,get:function(){return i.EOF}}),Object.defineProperty(r,"tokenLabel",{enumerable:!0,get:function(){return i.tokenLabel}}),Object.defineProperty(r,"tokenMatcher",{enumerable:!0,get:function(){return i.tokenMatcher}}),Object.defineProperty(r,"tokenName",{enumerable:!0,get:function(){return i.tokenName}});var o=Gt();Object.defineProperty(r,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=St();Object.defineProperty(r,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(r,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(r,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(r,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(r,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=ii();Object.defineProperty(r,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Je();Object.defineProperty(r,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(r,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(r,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(r,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(r,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(r,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(r,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(r,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(r,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(r,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Je();Object.defineProperty(r,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(r,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var d=kt();Object.defineProperty(r,"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
139
  Please avoid using it as it will be completely removed in the future`)}r.clearCache=u;var b=ao();Object.defineProperty(r,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return b.createSyntaxDiagramsCode}});var f=(function(){function E(){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 E})();r.Parser=f});const wt=Ao();let St,Lt;class co extends I.Loader{constructor(e){super(e)}load(e,t,n,i){St=void 0,Lt=void 0;const o=this,s=o.path===""?I.LoaderUtils.extractUrlBase(e):o.path,c=new I.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){i?i(a):console.error(a),o.manager.itemError(e)}},n,i)}parse(e,t){const n={};function i(R){const w=o(),T=new lo(w.tokens),v=new ho(w.tokenVocabulary),B=s(v.getBaseCstVisitorConstructor()),L=T.lex(R);v.input=L.tokens;const F=v.vrml();if(v.errors.length>0)throw console.error(v.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return B.visit(F)}function o(){const R=wt.createToken,w=R({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),T=R({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}),v=["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=R({name:"Version",pattern:/#VRML.*/,longer_alt:T}),L=R({name:"NodeName",pattern:new RegExp(v.join("|")),longer_alt:T}),F=R({name:"DEF",pattern:/DEF/,longer_alt:T}),G=R({name:"USE",pattern:/USE/,longer_alt:T}),V=R({name:"ROUTE",pattern:/ROUTE/,longer_alt:T}),ne=R({name:"TO",pattern:/TO/,longer_alt:T}),Ae=R({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),me=R({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),Le=R({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Se=R({name:"TrueLiteral",pattern:/TRUE/}),be=R({name:"FalseLiteral",pattern:/FALSE/}),Re=R({name:"NullLiteral",pattern:/NULL/}),pe=R({name:"LSquare",pattern:/\[/}),Qe=R({name:"RSquare",pattern:/]/}),Ge=R({name:"LCurly",pattern:/{/}),Me=R({name:"RCurly",pattern:/}/}),xe=R({name:"Comment",pattern:/#.*/,group:wt.Lexer.SKIPPED}),Ke=[R({name:"WhiteSpace",pattern:/[ ,\s]/,group:wt.Lexer.SKIPPED}),L,F,G,V,ne,Se,be,Re,B,T,w,Ae,me,Le,pe,Qe,Ge,Me,xe],Ve={};for(let Ne=0,ge=Ke.length;Ne<ge;Ne++){const Ee=Ke[Ne];Ve[Ee.name]=Ee}return{tokens:Ke,tokenVocabulary:Ve}}function s(R){class w extends R{constructor(){super(),this.validateVisitor()}vrml(B){const L={version:this.visit(B.version),nodes:[],routes:[]};for(let F=0,G=B.node.length;F<G;F++){const V=B.node[F];L.nodes.push(this.visit(V))}if(B.route)for(let F=0,G=B.route.length;F<G;F++){const V=B.route[F];L.routes.push(this.visit(V))}return L}version(B){return B.Version[0].image}node(B){const L={name:B.NodeName[0].image,fields:[]};if(B.field)for(let F=0,G=B.field.length;F<G;F++){const V=B.field[F];L.fields.push(this.visit(V))}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 F;return B.singleFieldValue&&(F=this.visit(B.singleFieldValue[0])),B.multiFieldValue&&(F=this.visit(B.multiFieldValue[0])),L.type=F.type,L.values=F.values,L}def(B){return(B.Identifier||B.NodeName)[0].image}use(B){return{USE:(B.Identifier||B.NodeName)[0].image}}singleFieldValue(B){return T(this,B)}multiFieldValue(B){return T(this,B)}route(B){return{FROM:B.RouteIdentifier[0].image,TO:B.RouteIdentifier[1].image}}}function T(v,B){const L={type:null,values:[]};if(B.node){L.type="node";for(let F=0,G=B.node.length;F<G;F++){const V=B.node[F];L.values.push(v.visit(V))}}if(B.use){L.type="use";for(let F=0,G=B.use.length;F<G;F++){const V=B.use[F];L.values.push(v.visit(V))}}if(B.StringLiteral){L.type="string";for(let F=0,G=B.StringLiteral.length;F<G;F++){const V=B.StringLiteral[F];L.values.push(V.image.replace(/'|"/g,""))}}if(B.NumberLiteral){L.type="number";for(let F=0,G=B.NumberLiteral.length;F<G;F++){const V=B.NumberLiteral[F];L.values.push(parseFloat(V.image))}}if(B.HexLiteral){L.type="hex";for(let F=0,G=B.HexLiteral.length;F<G;F++){const V=B.HexLiteral[F];L.values.push(V.image)}}if(B.TrueLiteral){L.type="boolean";for(let F=0,G=B.TrueLiteral.length;F<G;F++)B.TrueLiteral[F].image==="TRUE"&&L.values.push(!0)}if(B.FalseLiteral){L.type="boolean";for(let F=0,G=B.FalseLiteral.length;F<G;F++)B.FalseLiteral[F].image==="FALSE"&&L.values.push(!1)}return B.NullLiteral&&(L.type="null",B.NullLiteral.forEach(function(){L.values.push(null)})),L}return new w}function c(R){const w=R.nodes,T=new I.Scene;for(let v=0,B=w.length;v<B;v++){const L=w[v];A(L)}for(let v=0,B=w.length;v<B;v++){const L=w[v],F=a(L);F instanceof I.Object3D&&T.add(F),L.name==="WorldInfo"&&(T.userData.worldInfo=F)}return T}function A(R){R.DEF&&(n[R.DEF]=R);const w=R.fields;for(let T=0,v=w.length;T<v;T++){const B=w[T];if(B.type==="node"){const L=B.values;for(let F=0,G=L.length;F<G;F++)A(L[F])}}}function a(R){return R.USE?ue(R.USE):(R.build!==void 0||(R.build=d(R)),R.build)}function d(R){const w=R.name;let T;switch(w){case"Anchor":case"Group":case"Transform":case"Collision":T=u(R);break;case"Background":T=b(R);break;case"Shape":T=f(R);break;case"Appearance":T=E(R);break;case"Material":T=g(R);break;case"ImageTexture":T=C(R);break;case"PixelTexture":T=p(R);break;case"TextureTransform":T=m(R);break;case"IndexedFaceSet":T=N(R);break;case"IndexedLineSet":T=k(R);break;case"PointSet":T=D(R);break;case"Box":T=x(R);break;case"Cone":T=W(R);break;case"Cylinder":T=$(R);break;case"Sphere":T=H(R);break;case"ElevationGrid":T=ee(R);break;case"Extrusion":T=ie(R);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":T=y(R);break;case"WorldInfo":T=_(R);break;case"DirectionalLight":T=S(R);break;case"PointLight":T=z(R);break;case"SpotLight":T=Q(R);break;case"Fog":T=M(R);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 T!==void 0&&R.DEF!==void 0&&T.hasOwnProperty("name")===!0&&(T.name=R.DEF),T}function u(R){const w=new I.Group,T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":re(G,w);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const V=new I.Vector3(G[0],G[1],G[2]).normalize(),ne=G[3];w.quaternion.setFromAxisAngle(V,ne);break;case"scale":w.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":w.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function b(R){const w=new I.Group;let T,v,B,L,F,G,V,ne,Ae,me;const Le=R.fields;for(let Se=0,be=Le.length;Se<be;Se++){const Re=Le[Se],pe=Re.name,Qe=Re.values;switch(pe){case"groundAngle":T=Qe;break;case"groundColor":v=Qe;break;case"backUrl":F=Qe;break;case"bottomUrl":G=Qe;break;case"frontUrl":V=Qe;break;case"leftUrl":ne=Qe;break;case"rightUrl":Ae=Qe;break;case"topUrl":me=Qe;break;case"skyAngle":B=Qe;break;case"skyColor":L=Qe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}if(F&&G&&V&&ne&&Ae&&me)St=new I.CubeTextureLoader().load([Ae[0],ne[0],me[0],G[0],V[0],F[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(v){const Se=[];for(let be=0;be<v.length;be+=3)Se.push([v[be],v[be+1],v[be+2]]);v=Se}St=new po({skyColor:L,skyAngle:B,groundColor:v,groundAngle:T}).buildTexture()}return w}function f(R){const w=R.fields;let T=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0}),v;for(let L=0,F=w.length;L<F;L++){const G=w[L],V=G.name,ne=G.values;switch(V){case"appearance":ne[0]!==null&&(T=a(ne[0]));break;case"geometry":ne[0]!==null&&(v=a(ne[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}let B;if(v&&v.attributes.position){const L=v._type;if(L==="points"){const F=new I.PointsMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});v.attributes.color!==void 0?F.vertexColors=!0:T.isMeshPhongMaterial&&F.color.copy(T.emissive),B=new I.Points(v,F)}else if(L==="line"){const F=new I.LineBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});v.attributes.color!==void 0?F.vertexColors=!0:T.isMeshPhongMaterial&&F.color.copy(T.emissive),B=new I.LineSegments(v,F)}else v._solid!==void 0&&(T.side=v._solid?I.FrontSide:I.DoubleSide),v.attributes.color!==void 0&&(T.vertexColors=!0),B=new I.Mesh(v,T)}else B=new I.Object3D,B.visible=!1;return B}function E(R){let w=new I.MeshPhongMaterial,T;const v=R.fields;for(let B=0,L=v.length;B<L;B++){const F=v[B],G=F.name,V=F.values;switch(G){case"material":if(V[0]!==null){const Ae=a(V[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 I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const ne=V[0];ne!==null&&(ne.name==="ImageTexture"||ne.name==="PixelTexture"||ne.USE)&&(w.map=a(ne));break;case"textureTransform":V[0]!==null&&(T=a(V[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(w.map){if(w.map.__type){switch(w.map.__type){case tt.INTENSITY_ALPHA:w.opacity=1;break;case tt.RGB:w.color.set(16777215);break;case tt.RGBA:w.color.set(16777215),w.opacity=1;break}delete w.map.__type}T&&(w.map.center.copy(T.center),w.map.rotation=T.rotation,w.map.repeat.copy(T.scale),w.map.offset.copy(T.translation))}return w.map&&w.map.fookHolder&&w.map.fookHolder.fooks.push(async B=>{const L=await go(B.source.data);w.transparent=L,w.needsUpdate=L}),w}function g(R){const w={},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"ambientIntensity":break;case"diffuseColor":w.diffuseColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"emissiveColor":w.emissiveColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"shininess":w.shininess=G[0];break;case"specularColor":w.specularColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"transparency":w.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function l(R,w,T){let v;switch(w){case tt.INTENSITY:v=parseInt(R),T.r=v,T.g=v,T.b=v,T.a=1;break;case tt.INTENSITY_ALPHA:v=parseInt("0x"+R.substring(2,4)),T.r=v,T.g=v,T.b=v,T.a=parseInt("0x"+R.substring(4,6));break;case tt.RGB:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=1;break;case tt.RGBA:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=parseInt("0x"+R.substring(8,10));break}}function h(R){let w;switch(R){case 1:w=tt.INTENSITY;break;case 2:w=tt.INTENSITY_ALPHA;break;case 3:w=tt.RGB;break;case 4:w=tt.RGBA;break}return w}function p(R){let w,T=I.RepeatWrapping,v=I.RepeatWrapping;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"image":const Ae=ne[0],me=ne[1],Le=ne[2],Se=h(Le),be=new Uint8Array(4*Ae*me),Re={r:0,g:0,b:0,a:0};for(let pe=3,Qe=0,Ge=ne.length;pe<Ge;pe++,Qe++){l(ne[pe],Se,Re);const Me=Qe*4;be[Me+0]=Re.r,be[Me+1]=Re.g,be[Me+2]=Re.b,be[Me+3]=Re.a}w=new I.DataTexture(be,Ae,me),w.colorSpace=I.SRGBColorSpace,w.needsUpdate=!0,w.__type=Se;break;case"repeatS":ne[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(v=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return w&&(w.wrapS=T,w.wrapT=v),w}function C(R){let w,T=I.RepeatWrapping,v=I.RepeatWrapping;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"url":const Ae=ne[0],me={fooks:[]},Le=Se=>{me.fooks&&me.fooks.map(be=>be(Se))};Ae&&(w=_e.load(Ae,Le)),w&&(w.fookHolder=me);break;case"repeatS":ne[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(v=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return w&&(w.wrapS=T,w.wrapT=v,w.colorSpace=I.SRGBColorSpace),w}function m(R){const w={center:new I.Vector2,rotation:0,scale:new I.Vector2(1,1),translation:new I.Vector2},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"center":w.center.set(G[0],G[1]);break;case"rotation":w.rotation=G[0];break;case"scale":w.scale.set(G[0],G[1]);break;case"translation":w.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function y(R){return R.fields[0]?R.fields[0].values:{}}function _(R){const w={},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"title":w.title=G[0];break;case"info":w.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function S(R){let w=0;const T=new I.Color(1,1,1),v=new I.Vector3(0,0,-1);let B=1,L=!0;const F=R.fields;for(let Ae=0,me=F.length;Ae<me;Ae++){const Le=F[Ae],Se=Le.name,be=Le.values;switch(Se){case"ambientIntensity":w=be[0];break;case"color":T.set(be[0],be[1],be[2]);break;case"direction":v.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 G=new I.Object3D,V=new I.DirectionalLight(T,B);v.normalize(),v.multiplyScalar(-10),V.position.copy(v),G.add(V);const ne=new I.AmbientLight(T,B*w);return G.add(ne),G}function z(R){let w=0;const T=new I.Vector3(1,0,0),v=new I.Color(1,1,1);let B=1;const L=new I.Vector3(0,0,0);let F=!0,G=100;const V=R.fields;for(let Le=0,Se=V.length;Le<Se;Le++){const be=V[Le],Re=be.name,pe=be.values;switch(Re){case"ambientIntensity":w=pe[0];break;case"attenuation":T.set(pe[0],pe[1],pe[2]);break;case"color":v.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":F=pe[0];break;case"radius":G=pe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Re);break}}B=F?B:0;const ne=new I.Object3D,Ae=new I.PointLight(v,B,G);Ae.position.copy(L),Ae.decay=2,ne.add(Ae);const me=new I.AmbientLight(v,B*w);return ne.add(me),ne}function Q(R){let w=0;const T=new I.Vector3(1,0,0);let v=1.570796;const B=new I.Color(1,1,1);let L=.785398;const F=new I.Vector3(0,0,-1);let G=1;const V=new I.Vector3(0,0,-1);let ne=!0,Ae=100;const me=R.fields;for(let pe=0,Qe=me.length;pe<Qe;pe++){const Ge=me[pe],Me=Ge.name,xe=Ge.values;switch(Me){case"ambientIntensity":w=xe[0];break;case"attenuation":T.set(xe[0],xe[1],xe[2]);break;case"beamWidth":v=xe[0];break;case"color":B.set(xe[0],xe[1],xe[2]);break;case"cutOffAngle":L=xe[0];break;case"direction":F.set(xe[0],xe[1],xe[2]);break;case"intensity":G=xe[0];break;case"location":V.set(xe[0],xe[1],xe[2]);break;case"on":ne=xe[0];break;case"radius":Ae=xe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Me);break}}G=ne?G:0;const Le=new I.Object3D;v=v>L?L:v;const Se=1-v/L,be=new I.SpotLight(B,G,Ae,L,Se);F.normalize(),be.position.copy(F),be.decay=0,Le.add(be);const Re=new I.AmbientLight(B,G*w);return Le.add(Re),Le.position.copy(V),Le}function M(R){const w=new I.Color(1,1,1);let T="LINEAR",v=0;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"color":w.set(ne[0],ne[1],ne[2]);break;case"fogType":T=ne[0];break;case"visibilityRange":v=ne[0];break;case"set_bind":break;case"isBound":break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",V);break}}if(T==="LINEAR")Lt=new I.Fog(w,0,v);else if(T==="EXPONENTIAL"){let L=.02;v!==0&&(L=2.146/v),Lt=new I.FogExp2(w,L)}else console.warn("ThreeMFLoader.VRMLLoader2: Unknown fogType:",T);return new I.Object3D}function N(R){let w,T,v,B,L=!0,F=!0,G=0,V,ne,Ae,me,Le=!0,Se=!0;const be=R.fields;for(let je=0,Ke=be.length;je<Ke;je++){const Ve=be[je],Ne=Ve.name,ge=Ve.values;switch(Ne){case"color":const Ee=ge[0];Ee!==null&&(w=a(Ee));break;case"coord":const he=ge[0];he!==null&&(T=a(he));break;case"normal":const Ie=ge[0];Ie!==null&&(v=a(Ie));break;case"texCoord":const Ce=ge[0];Ce!==null&&(B=a(Ce));break;case"ccw":L=ge[0];break;case"colorIndex":V=ge;break;case"colorPerVertex":Le=ge[0];break;case"convex":break;case"coordIndex":ne=ge;break;case"creaseAngle":G=ge[0];break;case"normalIndex":Ae=ge;break;case"normalPerVertex":Se=ge[0];break;case"solid":F=ge[0];break;case"texCoordIndex":me=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ne);break}}if(ne===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new I.BufferGeometry;const Re=X(ne,L);let pe,Qe,Ge;if(w){if(Le===!0)if(V&&V.length>0){const je=X(V,L);pe=De(Re,je,w,3)}else pe=Oe(Re,new I.Float32BufferAttribute(w,3));else if(V&&V.length>0){const je=de(w,V),Ke=ae(je,ne);pe=ze(Re,Ke)}else{const je=ae(w,ne);pe=ze(Re,je)}fe(pe)}if(v)if(Se===!0)if(Ae&&Ae.length>0){const je=X(Ae,L);Qe=De(Re,je,v,3)}else Qe=Oe(Re,new I.Float32BufferAttribute(v,3));else if(Ae&&Ae.length>0){const je=de(v,Ae),Ke=ae(je,ne);Qe=ze(Re,Ke)}else{const je=ae(v,ne);Qe=ze(Re,je)}else Qe=K(Re,T,G);if(B)if(me&&me.length>0){const je=X(me,L);Ge=De(Re,je,B,2)}else Ge=Oe(Re,new I.Float32BufferAttribute(B,2));const Me=new I.BufferGeometry,xe=Oe(Re,new I.Float32BufferAttribute(T,3));return Me.setAttribute("position",xe),Me.setAttribute("normal",Qe),pe&&Me.setAttribute("color",pe),Ge&&Me.setAttribute("uv",Ge),Me._solid=F,Me._type="mesh",Me}function k(R){let w,T,v,B,L=!0;const F=R.fields;for(let me=0,Le=F.length;me<Le;me++){const Se=F[me],be=Se.name,Re=Se.values;switch(be){case"color":const pe=Re[0];pe!==null&&(w=a(pe));break;case"coord":const Qe=Re[0];Qe!==null&&(T=a(Qe));break;case"colorIndex":v=Re;break;case"colorPerVertex":L=Re[0];break;case"coordIndex":B=Re;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",be);break}}let G;const V=P(B);if(w){if(L===!0)if(v.length>0){const me=P(v);G=De(V,me,w,3)}else G=Oe(V,new I.Float32BufferAttribute(w,3));else if(v.length>0){const me=de(w,v),Le=j(me,B);G=Xe(V,Le)}else{const me=j(w,B);G=Xe(V,me)}fe(G)}const ne=new I.BufferGeometry,Ae=Oe(V,new I.Float32BufferAttribute(T,3));return ne.setAttribute("position",Ae),G&&ne.setAttribute("color",G),ne._type="line",ne}function D(R){let w,T;const v=R.fields;for(let L=0,F=v.length;L<F;L++){const G=v[L],V=G.name,ne=G.values;switch(V){case"color":const Ae=ne[0];Ae!==null&&(w=a(Ae));break;case"coord":const me=ne[0];me!==null&&(T=a(me));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}const B=new I.BufferGeometry;if(B.setAttribute("position",new I.Float32BufferAttribute(T,3)),w){const L=new I.Float32BufferAttribute(w,3);fe(L),B.setAttribute("color",L)}return B._type="points",B}function x(R){const w=new I.Vector3(2,2,2),T=R.fields;for(let B=0,L=T.length;B<L;B++){const F=T[B],G=F.name,V=F.values;G==="size"?(w.x=V[0],w.y=V[1],w.z=V[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.BoxGeometry(w.x,w.y,w.z)}function W(R){let w=1,T=2,v=!1;const B=R.fields;for(let F=0,G=B.length;F<G;F++){const V=B[F],ne=V.name,Ae=V.values;switch(ne){case"bottom":v=!Ae[0];break;case"bottomRadius":w=Ae[0];break;case"height":T=Ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ne);break}}return new I.ConeGeometry(w,T,16,1,v)}function $(R){let w=1,T=2;const v=R.fields;for(let L=0,F=v.length;L<F;L++){const G=v[L],V=G.name,ne=G.values;switch(V){case"bottom":break;case"radius":w=ne[0];break;case"height":T=ne[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return new I.CylinderGeometry(w,w,T,16,1)}function H(R){let w=1;const T=R.fields;for(let B=0,L=T.length;B<L;B++){const F=T[B],G=F.name,V=F.values;G==="radius"?w=V[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.SphereGeometry(w,16,16)}function ee(R){let w,T,v,B,L=!0,F=!0,G=!0,V=!0,ne=0,Ae=2,me=2,Le=1,Se=1;const be=R.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 At=Ce[0];At!==null&&(T=a(At));break;case"texCoord":const ct=Ce[0];ct!==null&&(v=a(ct));break;case"height":B=Ce;break;case"ccw":V=Ce[0];break;case"colorPerVertex":L=Ce[0];break;case"creaseAngle":ne=Ce[0];break;case"normalPerVertex":F=Ce[0];break;case"solid":G=Ce[0];break;case"xDimension":Ae=Ce[0];break;case"xSpacing":Le=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 Re=[],pe=[],Qe=[],Ge=[];for(let ge=0;ge<me;ge++)for(let Ee=0;Ee<Ae;Ee++){const he=ge*Ae+Ee,Ie=Le*ge,Ce=B[he],Ue=Se*Ee;if(Re.push(Ie,Ce,Ue),w&&L===!0){const At=w[he*3+0],ct=w[he*3+1],qt=w[he*3+2];Qe.push(At,ct,qt)}if(T&&F===!0){const At=T[he*3+0],ct=T[he*3+1],qt=T[he*3+2];pe.push(At,ct,qt)}if(v){const At=v[he*2+0],ct=v[he*2+1];Ge.push(At,ct)}else Ge.push(ge/(Ae-1),Ee/(me-1))}const Me=[];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;V===!0?(Me.push(he,Ce,Ie),Me.push(Ce,he,Ue)):(Me.push(he,Ie,Ce),Me.push(Ce,Ue,he))}const xe=Oe(Me,new I.Float32BufferAttribute(Re,3)),je=Oe(Me,new I.Float32BufferAttribute(Ge,2));let Ke,Ve;if(w){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=w[he*3+0],Ce=w[he*3+1],Ue=w[he*3+2];Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue)}Ke=new I.Float32BufferAttribute(Qe,3)}else Ke=Oe(Me,new I.Float32BufferAttribute(Qe,3));fe(Ke)}if(T)if(F===!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];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)}Ve=new I.Float32BufferAttribute(pe,3)}else Ve=Oe(Me,new I.Float32BufferAttribute(pe,3));else Ve=K(Me,Re,ne);const Ne=new I.BufferGeometry;return Ne.setAttribute("position",xe),Ne.setAttribute("normal",Ve),Ne.setAttribute("uv",je),Ke&&Ne.setAttribute("color",Ke),Ne._solid=G,Ne._type="mesh",Ne}function ie(R){let w=[1,1,1,-1,-1,-1,-1,1,1,1],T=[0,0,0,0,1,0],v,B,L=!0,F=!0,G=0,V=!0,ne=!0;const Ae=R.fields;for(let Ne=0,ge=Ae.length;Ne<ge;Ne++){const Ee=Ae[Ne],he=Ee.name,Ie=Ee.values;switch(he){case"beginCap":L=Ie[0];break;case"ccw":F=Ie[0];break;case"convex":break;case"creaseAngle":G=Ie[0];break;case"crossSection":w=Ie;break;case"endCap":V=Ie[0];break;case"orientation":B=Ie;break;case"scale":v=Ie;break;case"solid":ne=Ie[0];break;case"spine":T=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],Le=[],Se=new I.Vector3,be=new I.Vector3,Re=new I.Vector3,pe=new I.Vector3,Qe=new I.Quaternion;for(let Ne=0,ge=0,Ee=0,he=T.length;Ne<he;Ne+=3,ge+=2,Ee+=4){Se.fromArray(T,Ne),be.x=v?v[ge+0]:1,be.y=1,be.z=v?v[ge+1]:1,Re.x=B?B[Ee+0]:0,Re.y=B?B[Ee+1]:0,Re.z=B?B[Ee+2]:1;const Ie=B?B[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),Qe.setFromAxisAngle(Re,Ie),pe.applyQuaternion(Qe),pe.add(Se),Le.push(pe.x,pe.y,pe.z)}const Ge=[],Me=T.length/3,xe=w.length/2;for(let Ne=0;Ne<Me-1;Ne++)for(let ge=0;ge<xe-1;ge++){const Ee=ge+Ne*xe;let he=ge+1+Ne*xe;const Ie=ge+(Ne+1)*xe;let Ce=ge+1+(Ne+1)*xe;ge===xe-2&&me===!0&&(he=Ne*xe,Ce=(Ne+1)*xe),F===!0?(Ge.push(Ee,he,Ie),Ge.push(Ie,he,Ce)):(Ge.push(Ee,Ie,he),Ge.push(Ie,Ce,he))}if(L===!0||V===!0){const Ne=[];for(let he=0,Ie=w.length;he<Ie;he+=2)Ne.push(new I.Vector2(w[he],w[he+1]));const ge=I.ShapeUtils.triangulateShape(Ne,[]),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)F===!0?Ge.push(Ee[he+0],Ee[he+1],Ee[he+2]):Ge.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(V===!0){const he=xe*(Me-1);for(let Ie=0,Ce=Ee.length;Ie<Ce;Ie+=3)F===!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 je=Oe(Ge,new I.Float32BufferAttribute(Le,3)),Ke=K(Ge,Le,G),Ve=new I.BufferGeometry;return Ve.setAttribute("position",je),Ve.setAttribute("normal",Ke),Ve._solid=ne,Ve._type="mesh",Ve}function ue(R){const w=n[R],T=a(w);return T.isObject3D||T.isMaterial?T.clone():T}function re(R,w){for(let T=0,v=R.length;T<v;T++){const B=a(R[T]);B instanceof I.Object3D&&w.add(B)}}function X(R,w){const T=[];let v=0;for(let B=0,L=R.length;B<L;B++){const F=R[v],G=R[B+(w?1:2)],V=R[B+(w?2:1)];T.push(F,G,V),(R[B+3]===-1||B+3>=L)&&(B+=3,v=B+1)}return T}function ae(R,w){const T=[];let v=0;for(let B=0,L=w.length;B<L;B++){const F=v*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne),(w[B+3]===-1||B+3>=L)&&(B+=3,v++)}return T}function de(R,w){const T=[];for(let v=0,B=w.length;v<B;v++){const F=w[v]*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne)}return T}function P(R){const w=[];for(let T=0,v=R.length;T<v;T++){const B=R[T],L=R[T+1];w.push(B,L),(R[T+2]===-1||T+2>=v)&&(T+=2)}return w}function j(R,w){const T=[];let v=0;for(let B=0,L=w.length;B<L;B++){const F=v*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne),(w[B+2]===-1||B+2>=L)&&(B+=2,v++)}return T}const U=new I.Vector3,Z=new I.Vector3,J=new I.Vector3,le=new I.Vector2,ye=new I.Vector2,we=new I.Vector2;function De(R,w,T,v){const B=[];for(let L=0,F=R.length;L<F;L+=3){const G=w[L],V=w[L+1],ne=w[L+2];v===2?(le.fromArray(T,G*v),ye.fromArray(T,V*v),we.fromArray(T,ne*v),B.push(le.x,le.y),B.push(ye.x,ye.y),B.push(we.x,we.y)):(U.fromArray(T,G*v),Z.fromArray(T,V*v),J.fromArray(T,ne*v),B.push(U.x,U.y,U.z),B.push(Z.x,Z.y,Z.z),B.push(J.x,J.y,J.z))}return new I.Float32BufferAttribute(B,v)}function ze(R,w){const T=[];for(let v=0,B=0,L=R.length;v<L;v+=3,B++)U.fromArray(w,B*3),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z);return new I.Float32BufferAttribute(T,3)}function Xe(R,w){const T=[];for(let v=0,B=0,L=R.length;v<L;v+=2,B++)U.fromArray(w,B*3),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z);return new I.Float32BufferAttribute(T,3)}function Oe(R,w){const T=w.array,v=w.itemSize,B=new T.constructor(R.length*v);let L=0,F=0;for(let G=0,V=R.length;G<V;G++){L=R[G]*v;for(let ne=0;ne<v;ne++)B[F++]=T[L++]}return new I.Float32BufferAttribute(B,v)}const O=new I.Vector3,Y=new I.Vector3;function K(R,w,T){const v=[],B={};for(let F=0,G=R.length;F<G;F+=3){const V=R[F],ne=R[F+1],Ae=R[F+2],me=new fo(V,ne,Ae);U.fromArray(w,V*3),Z.fromArray(w,ne*3),J.fromArray(w,Ae*3),Y.subVectors(J,Z),O.subVectors(U,Z),Y.cross(O),Y.normalize(),me.normal.copy(Y),B[V]===void 0&&(B[V]=[]),B[ne]===void 0&&(B[ne]=[]),B[Ae]===void 0&&(B[Ae]=[]),B[V].push(me.normal),B[ne].push(me.normal),B[Ae].push(me.normal),v.push(me)}const L=[];for(let F=0,G=v.length;F<G;F++){const V=v[F],ne=oe(B[V.a],V.normal,T),Ae=oe(B[V.b],V.normal,T),me=oe(B[V.c],V.normal,T);U.fromArray(w,V.a*3),Z.fromArray(w,V.b*3),J.fromArray(w,V.c*3),L.push(ne.x,ne.y,ne.z),L.push(Ae.x,Ae.y,Ae.z),L.push(me.x,me.y,me.z)}return new I.Float32BufferAttribute(L,3)}function oe(R,w,T){const v=new I.Vector3;if(T===0)v.copy(w);else for(let B=0,L=R.length;B<L;B++)R[B].angleTo(w)<T&&v.add(R[B]);return v.normalize()}function fe(R){const w=new I.Color;for(let T=0;T<R.count;T++)w.fromBufferAttribute(R,T),I.ColorManagement.colorSpaceToWorking(w,I.SRGBColorSpace),R.setXYZ(T,w.r,w.g,w.b)}const _e=new I.TextureLoader(this.manager);if(_e.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=i(e);return c(Be)}}class lo{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 uo=wt.CstParser;class ho extends uo{constructor(e){super(e);const t=this,n=e.Version,i=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,d=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,E=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,h=e.USE,p=e.ROUTE,C=e.TO,m=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(m),t.CONSUME(i),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(m)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),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(b)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(E)}},{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(b)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class fo{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new I.Vector3}}const tt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class po{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:i=[],size:o=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=i,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 i=0;i<n;i++)if(e<=this._skyAngle[i+1]){const o=(e-this._skyAngle[i])/(this._skyAngle[i+1]-this._skyAngle[i]);return this._lerpColor(this._skyColor[i+1]??this._skyColor[this._skyColor.length-1],this._skyColor[i+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 i=this._groundAngle.length-1;if(n>=this._groundAngle[i])return this._groundColor[i+1]??this._groundColor[this._groundColor.length-1];for(let o=0;o<i;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"),i=n.createImageData(e,e),o=i.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,b=1,f=Math.sqrt(u*u+A*A+b*b),E=Math.acos(Math.max(-1,Math.min(1,A/f))),[g,l,h]=this._colorAtPitch(E),p=(s*e+a)*4;o[p]=Math.round(g*255),o[p+1]=Math.round(l*255),o[p+2]=Math.round(h*255),o[p+3]=255}}return n.putImageData(i,0,0),t}_buildTopCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),i=n.createImageData(e,e),o=i.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),b=Math.acos(Math.max(-1,Math.min(1,d/u))),[f,E,g]=this._colorAtPitch(b),l=(s*e+A)*4;o[l]=Math.round(f*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(i,0,0),t}_buildBottomCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),i=n.createImageData(e,e),o=i.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),b=Math.acos(Math.max(-1,Math.min(1,d/u))),[f,E,g]=this._colorAtPitch(b),l=(s*e+A)*4;o[l]=Math.round(f*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(i,0,0),t}_buildCubeTexture(){const e=this._buildSideCanvas(),t=this._buildTopCanvas(),n=this._buildBottomCanvas(),i=[e,e,t,n,e,e],o=new I.CubeTexture(i);return o.needsUpdate=!0,o.minFilter=I.LinearMipmapLinearFilter,o.magFilter=I.LinearFilter,o}}async function go(r){await new Promise((o,s)=>{if(r.complete)return o();r.onload=o,r.onerror=s});const e=document.createElement("canvas"),t=e.getContext("2d");e.width=r.naturalWidth,e.height=r.naturalHeight,t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height).data;for(let o=3;o<i.length;o+=4)if(i[o]<255)return!0;return!1}class mo extends I.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,i){const o=this,s=new I.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){i?i(A):console.error(A),o.manager.itemError(e)}},n,i)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const E=[],g=i(f,c(f),E);c(f)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(f).split(/[\s]+/);const h=parseInt(l[1]);isNaN(h)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(f).split(/[\s]+/);const p=parseFloat(l[2]);isNaN(p)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<h;C++)l=c(f).split(/[\s]+/),n(l,C*p,g);return E}function n(f,E,g){if(g.type==="ENDSITE")return;const l={time:E,position:new I.Vector3,rotation:new I.Quaternion,scale:new I.Vector3(1,1,1)};g.frames.push(l);const h=new I.Quaternion,p=new I.Vector3(1,0,0),C=new I.Vector3(0,1,0),m=new I.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(f.shift().trim());break;case"Yposition":l.position.y=parseFloat(f.shift().trim());break;case"Zposition":l.position.z=parseFloat(f.shift().trim());break;case"Xrotation":h.setFromAxisAngle(p,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Yrotation":h.setFromAxisAngle(C,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Zrotation":h.setFromAxisAngle(m,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Xscale":l.scale.x=parseFloat(f.shift().trim());break;case"Yscale":l.scale.y=parseFloat(f.shift().trim());break;case"Zscale":l.scale.z=parseFloat(f.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)n(f,E,g.children[y])}function i(f,E,g){const l={name:"",type:"",frames:[]};g.push(l);let h=E.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(f)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),h=c(f).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 p=new I.Vector3(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));if((isNaN(p.x)||isNaN(p.y)||isNaN(p.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=p,l.type!=="ENDSITE"){h=c(f).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(f);if(C==="}")return l;l.children.push(i(f,C,g))}}function o(f,E){const g=new I.Bone;if(E.push(g),g.position.add(f.offset),g.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)g.add(o(f.children[l],E));return g}function s(f){const E=[];for(let g=0;g<f.length;g++){const l=f[g];if(l.type==="ENDSITE")continue;const h=[],p=[],C=[],m=[];for(let y=0;y<l.frames.length;y++){const _=l.frames[y];h.push(_.time),p.push(_.position.x+l.offset.x),p.push(_.position.y+l.offset.y),p.push(_.position.z+l.offset.z),C.push(_.rotation.x),C.push(_.rotation.y),C.push(_.rotation.z),C.push(_.rotation.w),m.push(_.scale.x),m.push(_.scale.y),m.push(_.scale.z)}A.animateBonePositions&&E.push(new I.VectorKeyframeTrack(l.name+".position",h,p)),A.animateBoneRotations&&E.push(new I.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&E.push(new I.VectorKeyframeTrack(l.name+".scale",h,m))}return new I.AnimationClip("animation",-1,E)}function c(f){let E;for(;(E=f.shift().trim()).length===0;);return E}const A=this,a=e.split(/[\r\n]+/g),d=t(a),u=[];o(d[0],u);const b=s(d);return{skeleton:new I.Skeleton(u),clip:b}}}let Nt,Dt,Ct;async function Eo(r,e){Ct||(Ct=new co),Ct.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(an(r,n)))),Nt=void 0,Dt=void 0;const t=await Ct.loadAsync(e);return Nt=St,Dt=Lt,Ct.manager.setURLModifier(n=>n),t}let zt;async function Io(r,e){zt||(zt=new mo);const t=xt(r,e);return await zt.parse(t)}function bo(r){const e=r.clip.clone(),t=r.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof se.Bone&&n.push(o)});const i=new se.Skeleton(n);return i.calculateInverses(),{clip:e,skeleton:i}}class bn{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 i=n.getValueSize();let o;n.getInterpolation()===se.InterpolateDiscrete?o=new se.DiscreteInterpolant(n.times,n.values,i):n.ValueTypeName==="quaternion"?o=new se.QuaternionLinearInterpolant(n.times,n.values,i):o=new se.LinearInterpolant(n.times,n.values,i),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,i]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=i.evaluate(this.time);if(s==="position")c.loc=new te(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Te(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new te(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 Co={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function yo(){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 Pe{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=Ot(Co,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new se.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 se.Audio(st.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object.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 Qn{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const Kt={},pt={};class An extends Jn{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,i,o=!1,s=!0,c,A){super(e,t),this.loop=n,this.sound=i,this.soundLoop=o,this.soundContinue=s,this.backgroundTexture=c,this.fog=A}enable(e,t){super.enable(e,t),this.sound&&(this.sound.play(),console.log("GAHA:1 this.loop=",this.loop),console.log("GAHA:2 this.soundContinue=",this.soundContinue),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 oi extends Et{haltActionNo=0;walkActionNo=0;runActionNo=0;minWalkSpeed=.1;minRunSpeed=1;billboard=!1;comment=null;tags=[];profiles=[];thumbnails=[];rdf=null;htmlfile="";constructor(e){super(e)}async asyncInit(e){const t=await Yn(e),n=new DOMParser,i=xt(t,"CATALOG.XML"),o=n.parseFromString(i,"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.billboard=!!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 p=h.getAttribute("name");p&&this.tags.push(p)});const d=o.getElementsByTagNameNS(s,"profile");Array.from(d).forEach(h=>{const p=h.getAttribute("uri");p&&this.profiles.push(p)});const u=o.getElementsByTagNameNS(s,"thumbnail");Array.from(u).forEach(h=>{const p=h.getAttribute("src");if(p){const C=an(t,p);this.thumbnails.push(C)}});const b=o.getElementsByTagNameNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","RDF");b[0]&&(this.rdf=b[0]);const f=o.getElementsByTagNameNS(s,"htmlfile");if(f[0]){const h=f[0].getAttribute("src");h&&(this.htmlfile=xt(t,h))}const E=o.getElementsByTagNameNS(s,"a"),g={};let l;for(const h of Array.from(E)){const p=h.getAttribute("an");if(p){l||(l=p);let C;const m=h.getAttribute("bvh");if(m&&m!=="none"){const X=t.zipUrl+"!"+m;Kt[X]||(Kt[X]=await Io(t,m)),C=bo(Kt[X]),C&&C.clip.tracks.forEach(ae=>{ae.setInterpolation(se.InterpolateDiscrete)})}else C=new Qn;const y={};C.skeleton.bones.forEach(X=>{y[X.name]=X});const _=h.getAttribute("scale"),S=_?Number(_):1,z=h.getAttribute("offset"),Q=new te;if(z){const X=z.split(" ");Q.set(Number(X[0]),Number(X[1]),Number(X[2]))}const M=h.getAttribute("rot"),N=new te;if(M){const X=M.split(" ");N.set(Number(X[0]),Number(X[1]),Number(X[2]))}const k=h.getAttribute("loop")==="true";let D,x;const W={},$=h.getElementsByTagNameNS(s,"p");for(const X of Array.from($)){const ae=X.getAttribute("name"),de=X.getAttribute("wrl");if(ae&&de){const P=t.zipUrl+"!"+de;pt[P]||(pt[P]=await Eo(t,de),Nt&&(D=Nt),Dt&&(x=Dt));const j=X.getAttribute("scale");if(j){const J=Number(j);pt[P].scale.set(J,J,J)}const U=X.getAttribute("rot");if(U){const J=U.split(" ");pt[P].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(" ");pt[P].position.set(Number(J[0]),Number(J[1]),Number(J[2]))}W[ae]=pt[P].clone(!0)}}const H=new se.Object3D;H.add(C.skeleton.bones[0]),C instanceof Qn||si(H,W),Object.values(W).forEach(X=>{H.add(X)}),H.scale.set(S,S,S),N.scale(Math.PI/180),H.setRotationFromEuler(new se.Euler(N.x,N.y,N.z,"ZXY")),H.position.add(Q),H.traverse(X=>{X.userData.a3js={objectA3:this}});let ee,ie=!1,ue=!0;const re=h.getElementsByTagNameNS(s,"s");if(re[0]){const X=re[0].getAttribute("file"),ae=re[0].getAttribute("type")||"PointSound",de=re[0].getAttribute("loop")||"false";ie=de==="true";const P=re[0].getAttribute("gain")||"1.0",j=re[0].getAttribute("offset")||"0.0 0.0 0.0",U=re[0].getAttribute("direction")||"0.0 0.0 1.0";ue=(re[0].getAttribute("continue")||"true")==="true";const J=j.split(" ").map(O=>Number(O)),le=new te(J[0],J[1],J[2]),ye=U.split(" ").map(O=>Number(O)),we=new te(ye[0],ye[1],ye[2]),De=ae==="PointSound"||ae==="ConeSound"?"positional":"audio",Oe=ae==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(X){const O=an(t,X),Y=URL.createObjectURL(O),K={type:De,autoplay:!1,loop:de==="true",volume:Number(P),positional:{directional:Oe}};ee=await new st(Y,K).ready,ee.setLocation(le),ee.lookAt(we),URL.revokeObjectURL(Y),H.add(ee.object)}}g[p]=new An({root:H,bones:y,skeleton:C.skeleton},new bn(C.clip,p),k,ee,ie,ue,D,x)}}return l&&this.syncInit(l,g),this}}function si(r,e){if(Lr(r)){const t=e[r.name];t&&(r.add(t),delete e[r.name])}r.children&&r.children.forEach(t=>{si(t,e)})}class ai{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],sn.isInitialized&&(this.physicsWorld=sn.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.transformer.addOneselfToPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof oi&&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.object);{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.transformer.removeOneselfFromPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof Et&&e.currentAction instanceof An&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}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 pn){const{vertices:n,colors:i}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(i,4))}}for(const t of this.objects)t.update(e)}rapierDebug(e){e?(this.rapierLines=new se.LineSegments(new se.BufferGeometry,new se.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class Ai extends Pe{controller;setController(e){this.controller=e}setLocation(e,t,n){const i=new te;typeof e=="number"?(super.setLocation(e,t,n),i.set(e,t,n)):(super.setLocation(e),i.set(e)),this.controller?this.controller.setCameraLocation(i):super.setLocation(i)}setLocationNow(e,t,n){const i=new te;typeof e=="number"?(super.setLocation(e,t,n),i.set(e,t,n)):(super.setLocation(e),i.set(e)),this.controller?this.controller.setCameraLocationNow(i):super.setLocationNow(i)}setQuat(e,t,n,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e),this.controller?this.controller.setCameraQuat(o):this.transformer.setQuat(o)}setQuatNow(e,t,n,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e),this.controller?this.controller.setCameraQuatNow(o):this.transformer.setQuatNow(o)}lookAt(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.loc):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.loc,i,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuat(s)}lookAtNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.loc):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.loc,i,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuatNow(s)}}class jt{view;trans;constructor(){this.trans=new qe}setView(e){this.view=e}update(e){this.view&&(this.view.camera.transformer.setLocation(this.trans.loc),this.view.camera.transformer.setQuat(this.trans.quat),this.view.camera.transformer.setScale(this.trans.scale))}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){}setCameraLocation(e){this.trans.loc.set(e)}setCameraLocationNow(e){this.trans.loc.set(e)}setCameraQuat(e){this.trans.quat.set(e)}setCameraQuatNow(e){this.trans.quat.set(e)}setCameraScale(e){this.trans.scale.set(e)}setCameraScaleNow(e){this.trans.scale.set(e)}}class ci extends jt{preMouse;leftClick=!1;rightClick=!1;target;cameraLoc=new te(0,0,3);cameraQuat=new Te(0,0,0,1);constructor(e,t,n){super(),this.preMouse={x:0,y:0},typeof e=="number"?this.target=new te(e,t,n):this.target=new te(e)}update(e){this.view&&(this.view.camera.transformer.setLocation(this.cameraLoc),this.view.camera.transformer.setQuat(this.cameraQuat))}mouseDown(e){e.button===0?(this.leftClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY):e.button===2&&(this.rightClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY)}mouseMove(e){if(this.view){if(this.leftClick&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){const n=.01*(e.clientX-this.preMouse.x),i=.01*(e.clientY-this.preMouse.y),o=Math.sin(-n),s=Math.cos(-n),c=Math.sin(-i),A=Math.cos(-i),a=new te(1,0,0).apply(this.cameraQuat),d=new te(0,1,0).apply(this.cameraQuat),u=new Te(a.x*c,a.y*c,a.z*c,A),b=new Te(d.x*o,d.y*o,d.z*o,s),f=new te(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const E=at(this.cameraLoc,this.target,new te(0,1,0));E.mul(new Te(0,1,0,0)),this.cameraQuat.set(E),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}else if(this.leftClick){q.v0.set(this.target),q.v0.sub(this.cameraLoc);const n=.005*q.v0.length(),i=n*(e.clientX-this.preMouse.x),o=n*(e.clientY-this.preMouse.y),s=new te(1,0,0).apply(this.cameraQuat).scale(-i),c=new te(0,1,0).apply(this.cameraQuat).scale(o);this.cameraLoc.add(s),this.cameraLoc.add(c),this.target.add(s),this.target.add(c),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}}}mouseUp(e){e.button===0?this.leftClick=!1:e.button===2&&(this.rightClick=!1)}mouseWheel(e){const t=new te(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}setCameraQuat(e){e.normalize(),this.cameraQuat.normalize();const t=new Te(this.cameraQuat);t.conjugate();const n=new te(this.target);n.sub(this.cameraLoc),n.apply(t),n.add(this.cameraLoc),this.target.set(n),this.cameraQuat.set(e)}setCameraQuatNow(e){this.setCameraQuat(e)}}const Bo={speed:.1,angSpeed:.01};class wo extends jt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Bo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new te,this._avatarNextQuat=new Te,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 i=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(i),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(i),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&&this._avatarNextQuat.mul(ht(new te(0,this.options.angSpeed,0))),this._keyRight&&this._avatarNextQuat.mul(ht(new te(0,-this.options.angSpeed,0))),t.transformer.setLocation(this._avatarNextLoc),t.transformer.setQuat(this._avatarNextQuat)}}const To={speed:5,angSpeed:.3,jumpSpeed:15};class Ro extends jt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...To,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new te,this._avatarNextAngVel=new te,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 i=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(i),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(i),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(new te(0,this.options.angSpeed,0)),this._keyRight&&this._avatarNextAngVel.add(new te(0,-this.options.angSpeed,0)),t.transformer.setLinvel(this._avatarNextVel),t.transformer.setAngvel(this._avatarNextAngVel)}}class li{scene;camera;controller;constructor(e){this.scene=new ai,this.camera=e,this.camera.setAudioListener(st.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new ci(0,0,0),this.controller.setView(this),this.controller.activate(),this.camera.setController(this.controller)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);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(),this.camera.setController(e)}worldToScreen(e){throw new Error("ViewBaseはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("ViewBaseはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("ViewBaseはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("ViewBaseはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("ViewBaseはwaitForRender()は実装していません")}}class vt extends Ai{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new se.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new se.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object.add(this.camera),this.object.add(this.headLight),this.object.add(t)}initObject(){return new se.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){xr(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 se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class ui extends I.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 I.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 gt=new I.Vector3,kn=new I.Matrix4,_n=new I.Matrix4,Sn=new I.Vector3,Ln=new I.Vector3;class hi{constructor(e={}){const t=this;let n,i,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:i}},this.render=function(E,g){E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),kn.copy(g.matrixWorldInverse),_n.multiplyMatrices(g.projectionMatrix,kn),d(E,E,g),this.sortObjects&&f(E)},this.setSize=function(E,g){n=E,i=g,o=n/2,s=i/2,A.style.width=E+"px",A.style.height=g+"px"};function a(E){E.isCSS2DObject&&(E.element.style.display="none");for(let g=0,l=E.children.length;g<l;g++)a(E.children[g])}function d(E,g,l){if(E.visible===!1){a(E);return}if(E.isCSS2DObject){gt.setFromMatrixPosition(E.matrixWorld),gt.applyMatrix4(_n);const h=gt.z>=-1&&gt.z<=1&&E.layers.test(l.layers)===!0,p=E.element;p.style.display=h===!0?"":"none",h===!0&&(E.onBeforeRender(t,g,l),p.style.transform="translate("+-100*E.center.x+"%,"+-100*E.center.y+"%)translate("+(gt.x*o+o)+"px,"+(-gt.y*s+s)+"px)",p.parentNode!==A&&A.appendChild(p),E.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,E)};c.objects.set(E,C)}for(let h=0,p=E.children.length;h<p;h++)d(E.children[h],g,l)}function u(E,g){return Sn.setFromMatrixPosition(E.matrixWorld),Ln.setFromMatrixPosition(g.matrixWorld),Sn.distanceToSquared(Ln)}function b(E){const g=[];return E.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function f(E){const g=b(E).sort(function(h,p){if(h.renderOrder!==p.renderOrder)return p.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,m=c.objects.get(p).distanceToCameraSquared;return C-m}),l=g.length;for(let h=0,p=g.length;h<p;h++)g[h].element.style.zIndex=l-h}}}function xn(r,e){if(e===I.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===I.TriangleFanDrawMode||e===I.TriangleStripDrawMode){let t=r.getIndex();if(t===null){const s=[],c=r.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);r.setIndex(s),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===I.TriangleFanDrawMode)for(let s=1;s<=n;s++)i.push(t.getX(0)),i.push(t.getX(s)),i.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(i.push(t.getX(s)),i.push(t.getX(s+1)),i.push(t.getX(s+2))):(i.push(t.getX(s+2)),i.push(t.getX(s+1)),i.push(t.getX(s)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=r.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class di extends I.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new So(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new No(t)}),this.register(function(t){return new Do(t)}),this.register(function(t){return new Fo(t)}),this.register(function(t){return new Oo(t)}),this.register(function(t){return new _o(t)}),this.register(function(t){return new Mo(t)}),this.register(function(t){return new xo(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new Qo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new zo(t)})}load(e,t,n,i){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=I.LoaderUtils.extractUrlBase(e);s=I.LoaderUtils.resolveURL(a,this.path)}else s=I.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){i?i(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new I.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,i){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))===fi){try{s[ke.KHR_BINARY_GLTF]=new Ko(e)}catch(u){i&&i(u);return}o=JSON.parse(s[ke.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new os(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],b=o.extensionsRequired||[];switch(u){case ke.KHR_MATERIALS_UNLIT:s[u]=new ko;break;case ke.KHR_DRACO_MESH_COMPRESSION:s[u]=new Vo(o,this.dracoLoader);break;case ke.KHR_TEXTURE_TRANSFORM:s[u]=new Wo;break;case ke.KHR_MESH_QUANTIZATION:s[u]=new Yo;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function vo(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const ke={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 Qo{constructor(e){this.parser=e,this.name=ke.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;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 i=t.cache.get(n);if(i)return i;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const d=new I.Color(16777215);A.color!==void 0&&d.setRGB(A.color[0],A.color[1],A.color[2],I.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new I.DirectionalLight(d),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new I.PointLight(d),a.distance=u;break;case"spot":a=new I.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),i=Promise.resolve(a),t.cache.add(n,i),i}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 ko{constructor(){this.name=ke.KHR_MATERIALS_UNLIT}getMaterialType(){return I.MeshBasicMaterial}extendParams(e,t,n){const i=[];e.color=new I.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],I.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,I.SRGBColorSpace))}return Promise.all(i)}}class _o{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class So{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Vector2(c,c)}return Promise.all(o)}}class Lo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class xo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 No{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new I.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=i.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,I.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Do{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Fo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),Promise.all(o)}}class Oo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class Mo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,I.SRGBColorSpace)),Promise.all(o)}}class Po{constructor(e){this.parser=e,this.name=ke.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Go{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Uo{constructor(e){this.parser=e,this.name=ke.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.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 Ho{constructor(e){this.parser=e,this.name=ke.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=i.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.parser=e,this.name=ke.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=i.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 qo{constructor(e){this.name=ke.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 i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.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=i.byteOffset||0,a=i.byteLength||0,d=i.count,u=i.byteStride,b=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(d,u,b,i.mode,i.filter).then(function(f){return f.buffer}):s.ready.then(function(){const f=new ArrayBuffer(d*u);return s.decodeGltfBuffer(new Uint8Array(f),d,u,b,i.mode,i.filter),f})})}else return null}}class zo{constructor(e){this.name=ke.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 i=t.meshes[n.mesh];for(const a of i.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],b=a[0].count,f=[];for(const E of u){const g=new I.Matrix4,l=new I.Vector3,h=new I.Quaternion,p=new I.Vector3(1,1,1),C=new I.InstancedMesh(E.geometry,E.material,b);for(let m=0;m<b;m++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,m),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,m),A.SCALE&&p.fromBufferAttribute(A.SCALE,m),C.setMatrixAt(m,g.compose(l,h,p));for(const m in A)if(m==="_COLOR_0"){const y=A[m];C.instanceColor=new I.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else m!=="TRANSLATION"&&m!=="ROTATION"&&m!=="SCALE"&&E.geometry.setAttribute(m,A[m]);I.Object3D.prototype.copy.call(C,E),this.parser.assignFinalMaterial(C),f.push(C)}return d.isGroup?(d.clear(),d.add(...f),d):f[0]}))}}const fi="glTF",yt=12,Nn={JSON:1313821514,BIN:5130562};class Ko{constructor(e){this.name=ke.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,yt),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!==fi)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-yt,o=new DataView(e,yt);let s=0;for(;s<i;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===Nn.JSON){const a=new Uint8Array(e,yt+s,c);this.content=n.decode(a)}else if(A===Nn.BIN){const a=yt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Vo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ke.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const d in s){const u=cn[d]||d.toLowerCase();c[u]=s[d]}for(const d in e.attributes){const u=cn[d]||d.toLowerCase();if(s[d]!==void 0){const b=n.accessors[e.attributes[d]],f=It[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(u,b){i.decodeDracoFile(d,function(f){for(const E in f.attributes){const g=f.attributes[E],l=A[E];l!==void 0&&(g.normalized=l)}u(f)},c,a,I.LinearSRGBColorSpace,b)})})}}class Wo{constructor(){this.name=ke.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 Yo{constructor(){this.name=ke.KHR_MESH_QUANTIZATION}}class pi extends I.Interpolant{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let s=0;s!==i;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,d=i-t,u=(n-t)/d,b=u*u,f=b*u,E=e*a,g=E-a,l=-2*f+3*b,h=f-b,p=1-l,C=h-b+u;for(let m=0;m!==c;m++){const y=s[g+m+c],_=s[g+m+A]*d,S=s[E+m+c],z=s[E+m]*d;o[m]=p*y+C*_+l*S+h*z}return o}}const Jo=new I.Quaternion;class Xo extends pi{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return Jo.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},It={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Dn={9728:I.NearestFilter,9729:I.LinearFilter,9984:I.NearestMipmapNearestFilter,9985:I.LinearMipmapNearestFilter,9986:I.NearestMipmapLinearFilter,9987:I.LinearMipmapLinearFilter},Fn={33071:I.ClampToEdgeWrapping,33648:I.MirroredRepeatWrapping,10497:I.RepeatWrapping},Vt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cn={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"},Zo={CUBICSPLINE:void 0,LINEAR:I.InterpolateLinear,STEP:I.InterpolateDiscrete},Wt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function $o(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new I.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:I.FrontSide})),r.DefaultMaterial}function ut(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function it(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function es(r,e,t){let n=!1,i=!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&&(i=!0),u.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(r);const s=[],c=[],A=[];for(let a=0,d=e.length;a<d;a++){const u=e[a];if(n){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):r.attributes.position;s.push(b)}if(i){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):r.attributes.normal;c.push(b)}if(o){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):r.attributes.color;A.push(b)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const d=a[0],u=a[1],b=a[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=u),o&&(r.morphAttributes.color=b),r.morphTargetsRelative=!0,r})}function ts(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ns(r){let e;const t=r.extensions&&r.extensions[ke.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Yt(t.attributes):e=r.indices+":"+Yt(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Yt(r.targets[n]);return e}function Yt(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function ln(r){switch(r){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 is(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":r.search(/\.ktx2($|\?)/i)>0||r.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const rs=new I.Matrix4;class os{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new vo,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,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+)/);i=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&&i<17||o&&s<98?this.textureLoader=new I.TextureLoader(this.options.manager):this.textureLoader=new I.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new I.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,i=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][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:n,userData:{}};return ut(o,c,i),it(c,i),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 i=0,o=t.length;i<o;i++){const s=t[i].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const s=e[i];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 i=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,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.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[ke.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,s){n.load(I.LoaderUtils.resolveURL(t.uri,i.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 i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const s=Vt[i.type],c=It[i.componentType],A=i.normalized===!0,a=new c(i.count*s);return Promise.resolve(new I.BufferAttribute(a,s,A))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Vt[i.type],a=It[i.componentType],d=a.BYTES_PER_ELEMENT,u=d*A,b=i.byteOffset||0,f=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,E=i.normalized===!0;let g,l;if(f&&f!==u){const h=Math.floor(b/f),p="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+h+":"+i.count;let C=t.cache.get(p);C||(g=new a(c,h*f,i.count*f/d),C=new I.InterleavedBuffer(g,f/d),t.cache.add(p,C)),l=new I.InterleavedBufferAttribute(C,A,b%f/d,E)}else c===null?g=new a(i.count*A):g=new a(c,b,i.count*A),l=new I.BufferAttribute(g,A,E);if(i.sparse!==void 0){const h=Vt.SCALAR,p=It[i.sparse.indices.componentType],C=i.sparse.indices.byteOffset||0,m=i.sparse.values.byteOffset||0,y=new p(s[1],C,i.sparse.count*h),_=new a(s[2],m,i.sparse.count*A);c!==null&&(l=new I.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let S=0,z=y.length;S<z;S++){const Q=y[S];if(l.setX(Q,_[S*A]),A>=2&&l.setY(Q,_[S*A+1]),A>=3&&l.setZ(Q,_[S*A+2]),A>=4&&l.setW(Q,_[S*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=E}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 i=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 b=(o.samplers||{})[s.sampler]||{};return d.magFilter=Dn[b.magFilter]||I.LinearFilter,d.minFilter=Dn[b.minFilter]||I.LinearMipmapLinearFilter,d.wrapS=Fn[b.wrapS]||I.RepeatWrapping,d.wrapT=Fn[b.wrapT]||I.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==I.NearestFilter&&d.minFilter!==I.LinearFilter,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=i.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 b=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(b),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(b,f){let E=b;t.isImageBitmapLoader===!0&&(E=function(g){const l=new I.Texture(g);l.needsUpdate=!0,b(l)}),t.load(I.LoaderUtils.resolveURL(u,o.path),E,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),it(u,s),u.userData.mimeType=s.mimeType||is(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,i){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[ke.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[ke.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[ke.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return i!==void 0&&(s.colorSpace=i),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=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 I.PointsMaterial,I.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 I.LineBasicMaterial,I.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(i||o||s){let c="ClonedMaterial:"+n.uuid+":";i&&(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),i&&(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 I.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[ke.KHR_MATERIALS_UNLIT]){const u=i[ke.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new I.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],I.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,I.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(b){return b.getMaterialType&&b.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=I.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!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new I.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==I.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new I.Color().setRGB(u[0],u[1],u[2],I.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==I.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,I.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&&ut(i,u,o),u})}createUniqueName(e){const t=I.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(c){return n[ke.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return On(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],d=ns(a),u=i[d];if(u)s.push(u.promise);else{let b;a.extensions&&a.extensions[ke.KHR_DRACO_MESH_COMPRESSION]?b=o(a):b=On(new I.BufferGeometry,a,t),i[d]={primitive:a,promise:b},s.push(b)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,i=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?$o(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 f=0,E=d.length;f<E;f++){const g=d[f],l=s[f];let h;const p=a[f];if(l.mode===Ze.TRIANGLES||l.mode===Ze.TRIANGLE_STRIP||l.mode===Ze.TRIANGLE_FAN||l.mode===void 0)h=o.isSkinnedMesh===!0?new I.SkinnedMesh(g,p):new I.Mesh(g,p),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===Ze.TRIANGLE_STRIP?h.geometry=xn(h.geometry,I.TriangleStripDrawMode):l.mode===Ze.TRIANGLE_FAN&&(h.geometry=xn(h.geometry,I.TriangleFanDrawMode));else if(l.mode===Ze.LINES)h=new I.LineSegments(g,p);else if(l.mode===Ze.LINE_STRIP)h=new I.Line(g,p);else if(l.mode===Ze.LINE_LOOP)h=new I.LineLoop(g,p);else if(l.mode===Ze.POINTS)h=new I.Points(g,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&ts(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),it(h,o),l.extensions&&ut(i,h,l),t.assignFinalMaterial(h),u.push(h)}for(let f=0,E=u.length;f<E;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return o.extensions&&ut(i,u[0],o),u[0];const b=new I.Group;o.extensions&&ut(i,b,o),t.associations.set(b,{meshes:e});for(let f=0,E=u.length;f<E;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new I.PerspectiveCamera(I.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new I.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.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 i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),s=i,c=[],A=[];for(let a=0,d=s.length;a<d;a++){const u=s[a];if(u){c.push(u);const b=new I.Matrix4;o!==null&&b.fromArray(o.array,a*16),A.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new I.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,s=[],c=[],A=[],a=[],d=[];for(let u=0,b=i.channels.length;u<b;u++){const f=i.channels[u],E=i.samplers[f.sampler],g=f.target,l=g.node,h=i.parameters!==void 0?i.parameters[E.input]:E.input,p=i.parameters!==void 0?i.parameters[E.output]:E.output;g.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",p)),a.push(E),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 b=u[0],f=u[1],E=u[2],g=u[3],l=u[4],h=[];for(let C=0,m=b.length;C<m;C++){const y=b[C],_=f[C],S=E[C],z=g[C],Q=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,_,S,z,Q);if(M)for(let N=0;N<M.length;N++)h.push(M[N])}const p=new I.AnimationClip(o,void 0,h);return it(p,i),p})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=i.weights.length;A<a;A++)c.morphTargetInfluences[A]=i.weights[A]}),s})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=i.children||[];for(let a=0,d=c.length;a<d;a++)s.push(n.getDependency("node",c[a]));const A=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const d=a[0],u=a[1],b=a[2];b!==null&&d.traverse(function(f){f.isSkinnedMesh&&f.bind(b,rs)});for(let f=0,E=u.length;f<E;f++)d.add(u[f]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?i.createUniqueName(o.name):"",c=[],A=i._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(i.getDependency("camera",o.camera).then(function(a){return i._getNodeRef(i.cameraCache,o.camera,a)})),i._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 I.Bone:a.length>1?d=new I.Group:a.length===1?d=a[0]:d=new I.Object3D,d!==a[0])for(let u=0,b=a.length;u<b;u++)d.add(a[u]);if(o.name&&(d.userData.name=o.name,d.name=s),it(d,o),o.extensions&&ut(n,d,o),o.matrix!==void 0){const u=new I.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(!i.associations.has(d))i.associations.set(d,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const u=i.associations.get(d);i.associations.set(d,{...u})}return i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new I.Group;n.name&&(o.name=i.createUniqueName(n.name)),it(o,n),n.extensions&&ut(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(i.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[b,f]of i.associations)(b instanceof I.Material||b instanceof I.Texture)&&u.set(b,f);return d.traverse(b=>{const f=i.associations.get(b);f!=null&&u.set(b,f)}),u};return i.associations=a(o),o})}_createAnimationTracks(e,t,n,i,o){const s=[],c=e.name?e.name:e.uuid,A=[];lt[o.path]===lt.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(lt[o.path]){case lt.weights:a=I.NumberKeyframeTrack;break;case lt.rotation:a=I.QuaternionKeyframeTrack;break;case lt.translation:case lt.scale:a=I.VectorKeyframeTrack;break;default:n.itemSize===1?a=I.NumberKeyframeTrack:a=I.VectorKeyframeTrack;break}const d=i.interpolation!==void 0?Zo[i.interpolation]:I.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const E=new a(A[b]+"."+lt[o.path],t.array,u,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),s.push(E)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=ln(t.constructor),i=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof I.QuaternionKeyframeTrack?Xo:pi;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ss(r,e,t){const n=e.attributes,i=new I.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(i.set(new I.Vector3(A[0],A[1],A[2]),new I.Vector3(a[0],a[1],a[2])),c.normalized){const d=ln(It[c.componentType]);i.min.multiplyScalar(d),i.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 I.Vector3,A=new I.Vector3;for(let a=0,d=o.length;a<d;a++){const u=o[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,E=b.max;if(f!==void 0&&E!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(E[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(E[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(E[2]))),b.normalized){const g=ln(It[b.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const s=new I.Sphere;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=s}function On(r,e,t){const n=e.attributes,i=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){r.setAttribute(c,A)})}for(const s in n){const c=cn[s]||s.toLowerCase();c in r.attributes||i.push(o(n[s],c))}if(e.indices!==void 0&&!r.index){const s=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(s)}return I.ColorManagement.workingColorSpace!==I.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${I.ColorManagement.workingColorSpace}" not supported.`),it(r,e),ss(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?es(r,e.targets,t):r})}const Jt=new WeakMap;class as extends I.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new I.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,i)},n,i)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,I.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,i,o=I.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||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 i;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(i=A,new Promise((a,d)=>{i._callbacks[o]={resolve:a,reject:d},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),Jt.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new I.BufferGeometry;e.index&&t.setIndex(new I.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:i,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new I.BufferAttribute(o,s);else{const d=new I.InterleavedBuffer(o,c);a=new I.InterleavedBufferAttribute(d,s,0)}i==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(i,a)}return t}_assignVertexColorSpace(e,t){if(t!==I.SRGBColorSpace)return;const n=new I.Color;for(let i=0,o=e.count;i<o;i++)n.fromBufferAttribute(e,i),I.ColorManagement.colorSpaceToWorking(n,I.SRGBColorSpace),e.setXYZ(i,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new I.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,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 i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=As.toString(),s=["/* draco decoder */",i,"","/* 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 i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(o){const s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,o){return i._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 As(){let r,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":r=c.decoderConfig,e=new Promise(function(d){r.onModuleLoaded=function(u){d({draco:u})},DracoDecoderModule(r)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(d=>{const u=d.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),E=f.attributes.map(g=>g.array.buffer);f.index&&E.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},E)}catch(f){console.error(f),self.postMessage({type:"error",id:c.id,error:f.message})}finally{u.destroy(b)}});break}};function t(s,c,A,a){const d=a.attributeIDs,u=a.attributeTypes;let b,f;const E=c.GetEncodedGeometryType(A);if(E===s.TRIANGULAR_MESH)b=new s.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(E===s.POINT_CLOUD)b=new s.PointCloud,f=c.DecodeArrayToPointCloud(A,A.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const g={index:null,attributes:[]};for(const l in d){const h=self[u[l]];let p,C;if(a.useUniqueIDs)C=d[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,s[d[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const m=i(s,c,b,l,h,p);l==="color"&&(m.vertexColorSpace=a.vertexColorSpace),g.attributes.push(m)}return E===s.TRIANGULAR_MESH&&(g.index=n(s,c,b)),s.destroy(b),g}function n(s,c,A){const d=A.num_faces()*3,u=d*4,b=s._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(s.HEAPF32.buffer,b,d).slice();return s._free(b),{array:f,itemSize:1}}function i(s,c,A,a,d,u){const b=A.num_points(),f=u.num_components(),E=o(s,d),g=f*d.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,h=l/d.BYTES_PER_ELEMENT,p=b*g,C=b*l,m=s._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,E,p,m);const y=new d(s.HEAPF32.buffer,m,p/d.BYTES_PER_ELEMENT);let _;if(g===l)_=y.slice();else{_=new d(C/d.BYTES_PER_ELEMENT);let S=0;for(let z=0,Q=y.length;z<Q;z++){for(let M=0;M<f;M++)_[S+M]=y[z*f+M];S+=h}}return s._free(m),{name:a,count:b,itemSize:f,array:_,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 cs{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:i,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=i,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 i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].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 ls=0,Mn=2,us=1,Pn=2,hs=0,ds=1,fs=10,ps=0,gi=9,mi=15,Ei=16,Ii=22,bi=37,Ci=43,yi=76,Bi=83,wi=97,Ti=100,Ri=103,vi=109,Qi=122,ki=123,_i=131,Si=132,Li=133,xi=134,Ni=137,Di=138,Fi=139,Oi=140,Mi=141,Pi=142,Gi=145,Ui=146,Hi=148,ji=152,un=153,gs=154,hn=155,ms=156,qi=157,zi=158,Ki=165,Vi=166,Wi=1000054e3,Yi=1000054001,Ji=1000054004,Xi=1000054005,Cn=1000066e3,Zi=1000066004;class Bt{constructor(e,t,n,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,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 i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const We=[171,75,84,88,32,50,48,187,13,10,26,10];function Gn(r){return new TextDecoder().decode(r)}function Es(r){const e=new Uint8Array(r.buffer,r.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,i=new Bt(r,We.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32(),t.levelCount=i._nextUint32(),t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),A=i._nextUint32(),a=i._nextUint64(),d=i._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new Bt(r,We.length+n,u,!0);for(let re=0,X=Math.max(t.levelCount,1);re<X;re++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new Bt(r,o,s,!0);f._skip(4);const E=f._nextUint16(),g=f._nextUint16(),l=f._nextUint16(),h=f._nextUint16(),p={vendorId:E,descriptorType:g,versionNumber:l,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(h/4-6)/4;for(let re=0;re<C;re++){const X={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&X.channelType?(X.sampleLower=f._nextInt32(),X.sampleUpper=f._nextInt32()):(X.sampleLower=f._nextUint32(),X.sampleUpper=f._nextUint32()),p.samples[re]=X}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const m=new Bt(r,c,A,!0);for(;m._offset<A;){const re=m._nextUint32(),X=m._scan(re),ae=Gn(X);if(t.keyValue[ae]=m._nextUint8Array(re-X.byteLength-1),ae.match(/^ktx/i)){const de=Gn(t.keyValue[ae]);t.keyValue[ae]=de.substring(0,de.lastIndexOf("\0"))}m._skip(re%4?4-re%4:0)}if(d<=0)return t;const y=new Bt(r,a,d,!0),_=y._nextUint16(),S=y._nextUint16(),z=y._nextUint32(),Q=y._nextUint32(),M=y._nextUint32(),N=y._nextUint32(),k=[];for(let re=0,X=Math.max(t.levelCount,1);re<X;re++)k.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const D=a+y._offset,x=D+z,W=x+Q,$=W+M,H=new Uint8Array(r.buffer,r.byteOffset+D,z),ee=new Uint8Array(r.buffer,r.byteOffset+x,Q),ie=new Uint8Array(r.buffer,r.byteOffset+W,M),ue=new Uint8Array(r.buffer,r.byteOffset+$,N);return t.globalData={endpointCount:_,selectorCount:S,imageDescs:k,endpointsData:H,selectorsData:ee,tablesData:ie,extendedData:ue},t}let Xt,ot,dn;const Zt={env:{emscripten_notify_memory_growth:function(r){dn=new Uint8Array(ot.exports.memory.buffer)}}};class Is{init(){return Xt||(Xt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Un).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Zt)).then(this._init):WebAssembly.instantiate(Buffer.from(Un,"base64"),Zt).then(this._init),Xt)}_init(e){ot=e.instance,Zt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ot)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=ot.exports.malloc(n);dn.set(e,i),t=t||Number(ot.exports.ZSTD_findDecompressedSize(i,n));const o=ot.exports.malloc(t),s=ot.exports.ZSTD_decompress(o,t,i,n),c=dn.slice(o,o+s);return ot.exports.free(i),ot.exports.free(o),c}}const Un="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0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siBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIF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NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEg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KAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",bs="display-p3",Cs="display-p3-linear";({...I.ColorManagement.spaces[I.SRGBColorSpace]});const $t=new WeakMap;let en=0,tn;class $e extends I.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cs,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 I.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new I.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).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})}),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,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new I.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,i)},n,i)}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(i=>t?t(i):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:i,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:d}}=e;if(n==="error")return Promise.reject(i);let u;if(t.faceCount===6)u=new I.CompressedCubeTexture(o,A,a);else{const b=o[0].mipmaps;u=t.layerCount>1?new I.CompressedArrayTexture(b,s,c,t.layerCount,A,a):new I.CompressedTexture(b,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?I.LinearFilter:I.LinearMipmapLinearFilter,u.magFilter=I.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=$i(t),u.premultiplyAlpha=!!(d&us),u}async _createTexture(e,t={}){const n=Es(new Uint8Array(e)),i=n.vkFormat===Cn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===ps||i&&!this.workerConfig.astcHDRSupported))return Bs(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--}}$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:I.RGBAFormat,RGBA_ASTC_4x4_Format:I.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:I.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:I.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:I.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:I.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:I.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:I.RGB_ETC1_Format,RGB_ETC2_Format:I.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:I.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:I.RGBA_S3TC_DXT1_Format};$e.EngineType={UnsignedByteType:I.UnsignedByteType,HalfFloatType:I.HalfFloatType,FloatType:I.FloatType};$e.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(E){const g=E.data;switch(g.type){case"init":r=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:p,height:C,hasAlpha:m,format:y,type:_,dfdFlags:S}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:p,height:C,hasAlpha:m,format:y,type:_,dfdFlags:S}},h)}catch(l){console.error(l),self.postMessage({type:"error",id:g.id,error:l.message})}});break}});function c(E){e=new Promise(g=>{t={wasmBinary:E,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(E){const g=new t.KTX2File(new Uint8Array(E));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 p=g.getWidth(),C=g.getHeight(),m=g.getLayers()||1,y=g.getLevels(),_=g.getFaces(),S=g.getHasAlpha(),z=g.getDFDFlags(),{transcoderFormat:Q,engineFormat:M,engineType:N}=u(h,p,C,S);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const k=[],D=[];for(let x=0;x<_;x++){const W=[];for(let $=0;$<y;$++){const H=[];let ee,ie;for(let re=0;re<m;re++){const X=g.getImageLevelInfo($,re,x);x===0&&$===0&&re===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,ie=X.origHeight):(ee=X.width,ie=X.height);let ae=new Uint8Array(g.getImageTranscodedSizeInBytes($,re,0,Q));const de=g.transcodeImage(ae,$,re,x,Q,0,-1,-1);if(N===i.HalfFloatType&&(ae=new Uint16Array(ae.buffer,ae.byteOffset,ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");H.push(ae)}const ue=f(H);W.push({data:ue,width:ee,height:ie}),D.push(ue.buffer)}k.push({mipmaps:W,width:p,height:C,format:M,type:N})}return l(),{faces:k,buffers:D,width:p,height:C,hasAlpha:S,dfdFlags:z,format:M,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:[i.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:[i.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:[i.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:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[i.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:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],d={[s.ETC1S]:a.filter(E=>E.basisFormat.includes(s.ETC1S)).sort((E,g)=>E.priorityETC1S-g.priorityETC1S),[s.UASTC]:a.filter(E=>E.basisFormat.includes(s.UASTC)).sort((E,g)=>E.priorityUASTC-g.priorityUASTC),[s.UASTC_HDR]:a.filter(E=>E.basisFormat.includes(s.UASTC_HDR)).sort((E,g)=>E.priorityHDR-g.priorityHDR)};function u(E,g,l,h){const p=d[E];for(let C=0;C<p.length;C++){const m=p[C];if(m.if&&!r[m.if]||!m.basisFormat.includes(E)||h&&m.transcoderFormat.length<2||m.needsPowerOfTwo&&!(b(g)&&b(l)))continue;const y=m.transcoderFormat[h?1:0],_=m.engineFormat[h?1:0],S=m.engineType[0];return{transcoderFormat:y,engineFormat:_,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(E){return E<=2?!0:(E&E-1)===0&&E!==0}function f(E){if(E.length===1)return E[0];let g=0;for(let p=0;p<E.length;p++){const C=E[p];g+=C.byteLength}const l=new Uint8Array(g);let h=0;for(let p=0;p<E.length;p++){const C=E[p];l.set(C,h),h+=C.byteLength}return l}};const ys=new Set([I.RGBAFormat,I.RGBFormat,I.RGFormat,I.RedFormat]),nn={[vi]:I.RGBAFormat,[Ri]:I.RGFormat,[Ti]:I.RedFormat,[wi]:I.RGBAFormat,[Bi]:I.RGFormat,[yi]:I.RedFormat,[Ci]:I.RGBAFormat,[bi]:I.RGBAFormat,[Ii]:I.RGFormat,[Ei]:I.RGFormat,[mi]:I.RedFormat,[gi]:I.RedFormat,[ki]:I.RGBFormat,[Qi]:I.RGBFormat,[ji]:I.RGBA_ETC2_EAC_Format,[Hi]:I.RGB_ETC2_Format,[un]:I.R11_EAC_Format,[gs]:I.SIGNED_R11_EAC_Format,[hn]:I.RG11_EAC_Format,[ms]:I.SIGNED_RG11_EAC_Format,[Cn]:I.RGBA_ASTC_4x4_Format,[zi]:I.RGBA_ASTC_4x4_Format,[qi]:I.RGBA_ASTC_4x4_Format,[Zi]:I.RGBA_ASTC_6x6_Format,[Vi]:I.RGBA_ASTC_6x6_Format,[Ki]:I.RGBA_ASTC_6x6_Format,[xi]:I.RGBA_S3TC_DXT1_Format,[Li]:I.RGBA_S3TC_DXT1_Format,[Si]:I.RGB_S3TC_DXT1_Format,[_i]:I.RGB_S3TC_DXT1_Format,[Di]:I.RGBA_S3TC_DXT3_Format,[Ni]:I.RGBA_S3TC_DXT3_Format,[Oi]:I.SIGNED_RED_RGTC1_Format,[Fi]:I.RED_RGTC1_Format,[Pi]:I.SIGNED_RED_GREEN_RGTC2_Format,[Mi]:I.RED_GREEN_RGTC2_Format,[Ui]:I.RGBA_BPTC_Format,[Gi]:I.RGBA_BPTC_Format,[Xi]:I.RGBA_PVRTC_4BPPV1_Format,[Yi]:I.RGBA_PVRTC_4BPPV1_Format,[Ji]:I.RGBA_PVRTC_2BPPV1_Format,[Wi]:I.RGBA_PVRTC_2BPPV1_Format},mt={[vi]:I.FloatType,[Ri]:I.FloatType,[Ti]:I.FloatType,[wi]:I.HalfFloatType,[Bi]:I.HalfFloatType,[yi]:I.HalfFloatType,[Ci]:I.UnsignedByteType,[bi]:I.UnsignedByteType,[Ii]:I.UnsignedByteType,[Ei]:I.UnsignedByteType,[mi]:I.UnsignedByteType,[gi]:I.UnsignedByteType,[ki]:I.UnsignedInt5999Type,[Qi]:I.UnsignedInt101111Type,[ji]:I.UnsignedByteType,[Hi]:I.UnsignedByteType,[un]:I.UnsignedByteType,[un]:I.UnsignedByteType,[hn]:I.UnsignedByteType,[hn]:I.UnsignedByteType,[Cn]:I.HalfFloatType,[zi]:I.UnsignedByteType,[qi]:I.UnsignedByteType,[Zi]:I.HalfFloatType,[Vi]:I.UnsignedByteType,[Ki]:I.UnsignedByteType,[xi]:I.UnsignedByteType,[Li]:I.UnsignedByteType,[Si]:I.UnsignedByteType,[_i]:I.UnsignedByteType,[Di]:I.UnsignedByteType,[Ni]:I.UnsignedByteType,[Oi]:I.UnsignedByteType,[Fi]:I.UnsignedByteType,[Pi]:I.UnsignedByteType,[Mi]:I.UnsignedByteType,[Ui]:I.UnsignedByteType,[Gi]:I.UnsignedByteType,[Xi]:I.UnsignedByteType,[Yi]:I.UnsignedByteType,[Ji]:I.UnsignedByteType,[Wi]:I.UnsignedByteType};async function Bs(r){const{vkFormat:e}=r;if(nn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);mt[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;r.supercompressionScheme===Mn&&(tn||(tn=new Promise(async s=>{const c=new Is;await c.init(),s(c)})),t=await tn);const n=[];for(let s=0;s<r.levels.length;s++){const c=Math.max(1,r.pixelWidth>>s),A=Math.max(1,r.pixelHeight>>s),a=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,d=r.levels[s];let u;if(r.supercompressionScheme===ls)u=d.levelData;else if(r.supercompressionScheme===Mn)u=t.decode(d.levelData,d.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;mt[e]===I.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):mt[e]===I.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):mt[e]===I.UnsignedInt5999Type||mt[e]===I.UnsignedInt101111Type?b=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):b=u,n.push({data:b,width:c,height:A,depth:a})}const i=r.levelCount===0||n.length>1;let o;if(ys.has(nn[e]))o=r.pixelDepth===0?new I.DataTexture(n[0].data,r.pixelWidth,r.pixelHeight):new I.Data3DTexture(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth),o.minFilter=i?I.NearestMipmapNearestFilter:I.NearestFilter,o.magFilter=I.NearestFilter,o.generateMipmaps=r.levelCount===0;else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new I.CompressedTexture(n,r.pixelWidth,r.pixelHeight),o.minFilter=i?I.LinearMipmapLinearFilter:I.LinearFilter,o.magFilter=I.LinearFilter}return o.mipmaps=n,o.type=mt[e],o.format=nn[e],o.colorSpace=$i(r),o.needsUpdate=!0,Promise.resolve(o)}function $i(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===ds?e.transferFunction===Pn?I.SRGBColorSpace:I.LinearSRGBColorSpace:e.colorPrimaries===fs?e.transferFunction===Pn?bs:Cs:(e.colorPrimaries===hs||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),I.NoColorSpace)}var er=(function(){var r="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;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopb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jF;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 i=WebAssembly.validate(t)?c(e):c(r),o,s=WebAssembly.instantiate(i,{}).then(function(h){o=h.instance,o.exports.__wasm_call_ctors()});function c(h){for(var p=new Uint8Array(h.length),C=0;C<h.length;++C){var m=h.charCodeAt(C);p[C]=m>96?m-97:m>64?m-39:m+4}for(var y=0,C=0;C<h.length;++C)p[y++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(h,p,C,m,y,_,S){var z=h.exports.sbrk,Q=m+3&-4,M=z(Q*y),N=z(_.length),k=new Uint8Array(h.exports.memory.buffer);k.set(_,N);var D=p(M,m,y,N,_.length);if(D==0&&S&&S(M,Q,y),C.set(k.subarray(M,M+m*y)),z(M-z(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(h){var p={object:new Worker(h),pending:0,requests:{}};return p.object.onmessage=function(C){var m=C.data;p.pending-=m.count,p.requests[m.id][m.action](m.value),delete p.requests[m.id]},p}function E(h){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(i)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),m=URL.createObjectURL(C),y=u.length;y<h;++y)u[y]=f(m);for(var y=h;y<u.length;++y)u[y].object.postMessage({});u.length=h,URL.revokeObjectURL(m)}function g(h,p,C,m,y){for(var _=u[0],S=1;S<u.length;++S)u[S].pending<_.pending&&(_=u[S]);return new Promise(function(z,Q){var M=new Uint8Array(C),N=++b;_.pending+=h,_.requests[N]={resolve:z,reject:Q},_.object.postMessage({id:N,count:h,size:p,source:M,mode:m,filter:y},[M.buffer])})}function l(h){var p=h.data;if(!p.id)return self.close();self.ready.then(function(C){try{var m=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],m,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:m},[m.buffer])}catch(y){self.postMessage({id:p.id,count:p.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(h){E(h)},decodeVertexBuffer:function(h,p,C,m,y){A(o,o.exports.meshopt_decodeVertexBuffer,h,p,C,m,o.exports[a[y]])},decodeIndexBuffer:function(h,p,C,m){A(o,o.exports.meshopt_decodeIndexBuffer,h,p,C,m)},decodeIndexSequence:function(h,p,C,m){A(o,o.exports.meshopt_decodeIndexSequence,h,p,C,m)},decodeGltfBuffer:function(h,p,C,m,y,_){A(o,o.exports[d[y]],h,p,C,m,o.exports[a[_]])},decodeGltfBufferAsync:function(h,p,C,m,y){return u.length>0?g(h,p,C,d[m],a[y]):s.then(function(){var _=new Uint8Array(h*p);return A(o,o.exports[d[m]],_,h,p,C,o.exports[a[y]]),_})}}})();function ws(r){return"morphTargetDictionary"in r&&r.morphTargetDictionary!==void 0&&"morphTargetInfluences"in r&&Array.isArray(r.morphTargetInfluences)}const Ts={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 tr(r={}){const e={...Ts,...r};let t=new di;const n=new as;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const i=new $e;i.setTranscoderPath(e.ktx2),i.detectSupport(e.renderer),t.setKTX2Loader(i)}e.meshopt&&t.setMeshoptDecoder(er),yn=t}let yn=new di;yn.setMeshoptDecoder(er);class rn extends Jn{constructor(e,t){super(e,t)}}class Rs extends Et{gltf;constructor(e){super(e)}async asyncInit(e){if(Wn(e)){let t=null;this.gltf=await yn.loadAsync(e);const n={},i={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},ws(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 se.Bone&&i.bones&&(i.bones[s.name]=s),s instanceof se.SkinnedMesh&&(i.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]=new rn(i,new bn(s))}),t?this.syncInit(t,n,o):(t="dummy",n.dummy=new rn(i,new vn),this.syncInit(t,n,o))}else{const t=new se.BoxGeometry,n=new se.MeshStandardMaterial({color:16711680}),i=new se.Mesh(t,n),o="dummy",s={};s.dummy=new rn({root:i},new vn),this.syncInit(o,s)}return this}}const nr={camera:void 0,antialias:!1,transparent:!1};class ir 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=`
140
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E})();r.Parser=f});const wt=Ao();let _t,Lt;class co extends I.Loader{constructor(e){super(e)}load(e,t,n,i){_t=void 0,Lt=void 0;const o=this,s=o.path===""?I.LoaderUtils.extractUrlBase(e):o.path,c=new I.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){i?i(a):console.error(a),o.manager.itemError(e)}},n,i)}parse(e,t){const n={};function i(R){const w=o(),T=new lo(w.tokens),v=new ho(w.tokenVocabulary),B=s(v.getBaseCstVisitorConstructor()),L=T.lex(R);v.input=L.tokens;const F=v.vrml();if(v.errors.length>0)throw console.error(v.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return B.visit(F)}function o(){const R=wt.createToken,w=R({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),T=R({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}),v=["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=R({name:"Version",pattern:/#VRML.*/,longer_alt:T}),L=R({name:"NodeName",pattern:new RegExp(v.join("|")),longer_alt:T}),F=R({name:"DEF",pattern:/DEF/,longer_alt:T}),G=R({name:"USE",pattern:/USE/,longer_alt:T}),V=R({name:"ROUTE",pattern:/ROUTE/,longer_alt:T}),ne=R({name:"TO",pattern:/TO/,longer_alt:T}),Ae=R({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),me=R({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),Le=R({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),_e=R({name:"TrueLiteral",pattern:/TRUE/}),be=R({name:"FalseLiteral",pattern:/FALSE/}),Re=R({name:"NullLiteral",pattern:/NULL/}),pe=R({name:"LSquare",pattern:/\[/}),Qe=R({name:"RSquare",pattern:/]/}),Ge=R({name:"LCurly",pattern:/{/}),Me=R({name:"RCurly",pattern:/}/}),xe=R({name:"Comment",pattern:/#.*/,group:wt.Lexer.SKIPPED}),Ke=[R({name:"WhiteSpace",pattern:/[ ,\s]/,group:wt.Lexer.SKIPPED}),L,F,G,V,ne,_e,be,Re,B,T,w,Ae,me,Le,pe,Qe,Ge,Me,xe],Ve={};for(let Ne=0,ge=Ke.length;Ne<ge;Ne++){const Ee=Ke[Ne];Ve[Ee.name]=Ee}return{tokens:Ke,tokenVocabulary:Ve}}function s(R){class w extends R{constructor(){super(),this.validateVisitor()}vrml(B){const L={version:this.visit(B.version),nodes:[],routes:[]};for(let F=0,G=B.node.length;F<G;F++){const V=B.node[F];L.nodes.push(this.visit(V))}if(B.route)for(let F=0,G=B.route.length;F<G;F++){const V=B.route[F];L.routes.push(this.visit(V))}return L}version(B){return B.Version[0].image}node(B){const L={name:B.NodeName[0].image,fields:[]};if(B.field)for(let F=0,G=B.field.length;F<G;F++){const V=B.field[F];L.fields.push(this.visit(V))}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 F;return B.singleFieldValue&&(F=this.visit(B.singleFieldValue[0])),B.multiFieldValue&&(F=this.visit(B.multiFieldValue[0])),L.type=F.type,L.values=F.values,L}def(B){return(B.Identifier||B.NodeName)[0].image}use(B){return{USE:(B.Identifier||B.NodeName)[0].image}}singleFieldValue(B){return T(this,B)}multiFieldValue(B){return T(this,B)}route(B){return{FROM:B.RouteIdentifier[0].image,TO:B.RouteIdentifier[1].image}}}function T(v,B){const L={type:null,values:[]};if(B.node){L.type="node";for(let F=0,G=B.node.length;F<G;F++){const V=B.node[F];L.values.push(v.visit(V))}}if(B.use){L.type="use";for(let F=0,G=B.use.length;F<G;F++){const V=B.use[F];L.values.push(v.visit(V))}}if(B.StringLiteral){L.type="string";for(let F=0,G=B.StringLiteral.length;F<G;F++){const V=B.StringLiteral[F];L.values.push(V.image.replace(/'|"/g,""))}}if(B.NumberLiteral){L.type="number";for(let F=0,G=B.NumberLiteral.length;F<G;F++){const V=B.NumberLiteral[F];L.values.push(parseFloat(V.image))}}if(B.HexLiteral){L.type="hex";for(let F=0,G=B.HexLiteral.length;F<G;F++){const V=B.HexLiteral[F];L.values.push(V.image)}}if(B.TrueLiteral){L.type="boolean";for(let F=0,G=B.TrueLiteral.length;F<G;F++)B.TrueLiteral[F].image==="TRUE"&&L.values.push(!0)}if(B.FalseLiteral){L.type="boolean";for(let F=0,G=B.FalseLiteral.length;F<G;F++)B.FalseLiteral[F].image==="FALSE"&&L.values.push(!1)}return B.NullLiteral&&(L.type="null",B.NullLiteral.forEach(function(){L.values.push(null)})),L}return new w}function c(R){const w=R.nodes,T=new I.Scene;for(let v=0,B=w.length;v<B;v++){const L=w[v];A(L)}for(let v=0,B=w.length;v<B;v++){const L=w[v],F=a(L);F instanceof I.Object3D&&T.add(F),L.name==="WorldInfo"&&(T.userData.worldInfo=F)}return T}function A(R){R.DEF&&(n[R.DEF]=R);const w=R.fields;for(let T=0,v=w.length;T<v;T++){const B=w[T];if(B.type==="node"){const L=B.values;for(let F=0,G=L.length;F<G;F++)A(L[F])}}}function a(R){return R.USE?ue(R.USE):(R.build!==void 0||(R.build=d(R)),R.build)}function d(R){const w=R.name;let T;switch(w){case"Anchor":case"Group":case"Transform":case"Collision":T=u(R);break;case"Background":T=b(R);break;case"Shape":T=f(R);break;case"Appearance":T=E(R);break;case"Material":T=g(R);break;case"ImageTexture":T=C(R);break;case"PixelTexture":T=p(R);break;case"TextureTransform":T=m(R);break;case"IndexedFaceSet":T=N(R);break;case"IndexedLineSet":T=k(R);break;case"PointSet":T=D(R);break;case"Box":T=x(R);break;case"Cone":T=W(R);break;case"Cylinder":T=$(R);break;case"Sphere":T=H(R);break;case"ElevationGrid":T=ee(R);break;case"Extrusion":T=ie(R);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":T=y(R);break;case"WorldInfo":T=S(R);break;case"DirectionalLight":T=_(R);break;case"PointLight":T=z(R);break;case"SpotLight":T=Q(R);break;case"Fog":T=M(R);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 T!==void 0&&R.DEF!==void 0&&T.hasOwnProperty("name")===!0&&(T.name=R.DEF),T}function u(R){const w=new I.Group,T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":re(G,w);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const V=new I.Vector3(G[0],G[1],G[2]).normalize(),ne=G[3];w.quaternion.setFromAxisAngle(V,ne);break;case"scale":w.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":w.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function b(R){const w=new I.Group;let T,v,B,L,F,G,V,ne,Ae,me;const Le=R.fields;for(let _e=0,be=Le.length;_e<be;_e++){const Re=Le[_e],pe=Re.name,Qe=Re.values;switch(pe){case"groundAngle":T=Qe;break;case"groundColor":v=Qe;break;case"backUrl":F=Qe;break;case"bottomUrl":G=Qe;break;case"frontUrl":V=Qe;break;case"leftUrl":ne=Qe;break;case"rightUrl":Ae=Qe;break;case"topUrl":me=Qe;break;case"skyAngle":B=Qe;break;case"skyColor":L=Qe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}if(F&&G&&V&&ne&&Ae&&me)_t=new I.CubeTextureLoader().load([Ae[0],ne[0],me[0],G[0],V[0],F[0]]);else{if(L){const _e=[];for(let be=0;be<L.length;be+=3)_e.push([L[be],L[be+1],L[be+2]]);L=_e}if(v){const _e=[];for(let be=0;be<v.length;be+=3)_e.push([v[be],v[be+1],v[be+2]]);v=_e}_t=new po({skyColor:L,skyAngle:B,groundColor:v,groundAngle:T}).buildTexture()}return w}function f(R){const w=R.fields;let T=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0}),v;for(let L=0,F=w.length;L<F;L++){const G=w[L],V=G.name,ne=G.values;switch(V){case"appearance":ne[0]!==null&&(T=a(ne[0]));break;case"geometry":ne[0]!==null&&(v=a(ne[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}let B;if(v&&v.attributes.position){const L=v._type;if(L==="points"){const F=new I.PointsMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});v.attributes.color!==void 0?F.vertexColors=!0:T.isMeshPhongMaterial&&F.color.copy(T.emissive),B=new I.Points(v,F)}else if(L==="line"){const F=new I.LineBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});v.attributes.color!==void 0?F.vertexColors=!0:T.isMeshPhongMaterial&&F.color.copy(T.emissive),B=new I.LineSegments(v,F)}else v._solid!==void 0&&(T.side=v._solid?I.FrontSide:I.DoubleSide),v.attributes.color!==void 0&&(T.vertexColors=!0),B=new I.Mesh(v,T)}else B=new I.Object3D,B.visible=!1;return B}function E(R){let w=new I.MeshPhongMaterial,T;const v=R.fields;for(let B=0,L=v.length;B<L;B++){const F=v[B],G=F.name,V=F.values;switch(G){case"material":if(V[0]!==null){const Ae=a(V[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 I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const ne=V[0];ne!==null&&(ne.name==="ImageTexture"||ne.name==="PixelTexture"||ne.USE)&&(w.map=a(ne));break;case"textureTransform":V[0]!==null&&(T=a(V[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(w.map){if(w.map.__type){switch(w.map.__type){case tt.INTENSITY_ALPHA:w.opacity=1;break;case tt.RGB:w.color.set(16777215);break;case tt.RGBA:w.color.set(16777215),w.opacity=1;break}delete w.map.__type}T&&(w.map.center.copy(T.center),w.map.rotation=T.rotation,w.map.repeat.copy(T.scale),w.map.offset.copy(T.translation))}return w.map&&w.map.fookHolder&&w.map.fookHolder.fooks.push(async B=>{const L=await go(B.source.data);w.transparent=L,w.needsUpdate=L}),w}function g(R){const w={},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"ambientIntensity":break;case"diffuseColor":w.diffuseColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"emissiveColor":w.emissiveColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"shininess":w.shininess=G[0];break;case"specularColor":w.specularColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"transparency":w.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function l(R,w,T){let v;switch(w){case tt.INTENSITY:v=parseInt(R),T.r=v,T.g=v,T.b=v,T.a=1;break;case tt.INTENSITY_ALPHA:v=parseInt("0x"+R.substring(2,4)),T.r=v,T.g=v,T.b=v,T.a=parseInt("0x"+R.substring(4,6));break;case tt.RGB:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=1;break;case tt.RGBA:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=parseInt("0x"+R.substring(8,10));break}}function h(R){let w;switch(R){case 1:w=tt.INTENSITY;break;case 2:w=tt.INTENSITY_ALPHA;break;case 3:w=tt.RGB;break;case 4:w=tt.RGBA;break}return w}function p(R){let w,T=I.RepeatWrapping,v=I.RepeatWrapping;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"image":const Ae=ne[0],me=ne[1],Le=ne[2],_e=h(Le),be=new Uint8Array(4*Ae*me),Re={r:0,g:0,b:0,a:0};for(let pe=3,Qe=0,Ge=ne.length;pe<Ge;pe++,Qe++){l(ne[pe],_e,Re);const Me=Qe*4;be[Me+0]=Re.r,be[Me+1]=Re.g,be[Me+2]=Re.b,be[Me+3]=Re.a}w=new I.DataTexture(be,Ae,me),w.colorSpace=I.SRGBColorSpace,w.needsUpdate=!0,w.__type=_e;break;case"repeatS":ne[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(v=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return w&&(w.wrapS=T,w.wrapT=v),w}function C(R){let w,T=I.RepeatWrapping,v=I.RepeatWrapping;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"url":const Ae=ne[0],me={fooks:[]},Le=_e=>{me.fooks&&me.fooks.map(be=>be(_e))};Ae&&(w=Se.load(Ae,Le)),w&&(w.fookHolder=me);break;case"repeatS":ne[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(v=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return w&&(w.wrapS=T,w.wrapT=v,w.colorSpace=I.SRGBColorSpace),w}function m(R){const w={center:new I.Vector2,rotation:0,scale:new I.Vector2(1,1),translation:new I.Vector2},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"center":w.center.set(G[0],G[1]);break;case"rotation":w.rotation=G[0];break;case"scale":w.scale.set(G[0],G[1]);break;case"translation":w.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function y(R){return R.fields[0]?R.fields[0].values:{}}function S(R){const w={},T=R.fields;for(let v=0,B=T.length;v<B;v++){const L=T[v],F=L.name,G=L.values;switch(F){case"title":w.title=G[0];break;case"info":w.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return w}function _(R){let w=0;const T=new I.Color(1,1,1),v=new I.Vector3(0,0,-1);let B=1,L=!0;const F=R.fields;for(let Ae=0,me=F.length;Ae<me;Ae++){const Le=F[Ae],_e=Le.name,be=Le.values;switch(_e){case"ambientIntensity":w=be[0];break;case"color":T.set(be[0],be[1],be[2]);break;case"direction":v.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:",_e);break}}B=L?B:0;const G=new I.Object3D,V=new I.DirectionalLight(T,B);v.normalize(),v.multiplyScalar(-10),V.position.copy(v),G.add(V);const ne=new I.AmbientLight(T,B*w);return G.add(ne),G}function z(R){let w=0;const T=new I.Vector3(1,0,0),v=new I.Color(1,1,1);let B=1;const L=new I.Vector3(0,0,0);let F=!0,G=100;const V=R.fields;for(let Le=0,_e=V.length;Le<_e;Le++){const be=V[Le],Re=be.name,pe=be.values;switch(Re){case"ambientIntensity":w=pe[0];break;case"attenuation":T.set(pe[0],pe[1],pe[2]);break;case"color":v.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":F=pe[0];break;case"radius":G=pe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Re);break}}B=F?B:0;const ne=new I.Object3D,Ae=new I.PointLight(v,B,G);Ae.position.copy(L),Ae.decay=2,ne.add(Ae);const me=new I.AmbientLight(v,B*w);return ne.add(me),ne}function Q(R){let w=0;const T=new I.Vector3(1,0,0);let v=1.570796;const B=new I.Color(1,1,1);let L=.785398;const F=new I.Vector3(0,0,-1);let G=1;const V=new I.Vector3(0,0,-1);let ne=!0,Ae=100;const me=R.fields;for(let pe=0,Qe=me.length;pe<Qe;pe++){const Ge=me[pe],Me=Ge.name,xe=Ge.values;switch(Me){case"ambientIntensity":w=xe[0];break;case"attenuation":T.set(xe[0],xe[1],xe[2]);break;case"beamWidth":v=xe[0];break;case"color":B.set(xe[0],xe[1],xe[2]);break;case"cutOffAngle":L=xe[0];break;case"direction":F.set(xe[0],xe[1],xe[2]);break;case"intensity":G=xe[0];break;case"location":V.set(xe[0],xe[1],xe[2]);break;case"on":ne=xe[0];break;case"radius":Ae=xe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Me);break}}G=ne?G:0;const Le=new I.Object3D;v=v>L?L:v;const _e=1-v/L,be=new I.SpotLight(B,G,Ae,L,_e);F.normalize(),be.position.copy(F),be.decay=0,Le.add(be);const Re=new I.AmbientLight(B,G*w);return Le.add(Re),Le.position.copy(V),Le}function M(R){const w=new I.Color(1,1,1);let T="LINEAR",v=0;const B=R.fields;for(let L=0,F=B.length;L<F;L++){const G=B[L],V=G.name,ne=G.values;switch(V){case"color":w.set(ne[0],ne[1],ne[2]);break;case"fogType":T=ne[0];break;case"visibilityRange":v=ne[0];break;case"set_bind":break;case"isBound":break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",V);break}}if(T==="LINEAR")Lt=new I.Fog(w,0,v);else if(T==="EXPONENTIAL"){let L=.02;v!==0&&(L=2.146/v),Lt=new I.FogExp2(w,L)}else console.warn("ThreeMFLoader.VRMLLoader2: Unknown fogType:",T);return new I.Object3D}function N(R){let w,T,v,B,L=!0,F=!0,G=0,V,ne,Ae,me,Le=!0,_e=!0;const be=R.fields;for(let je=0,Ke=be.length;je<Ke;je++){const Ve=be[je],Ne=Ve.name,ge=Ve.values;switch(Ne){case"color":const Ee=ge[0];Ee!==null&&(w=a(Ee));break;case"coord":const he=ge[0];he!==null&&(T=a(he));break;case"normal":const Ie=ge[0];Ie!==null&&(v=a(Ie));break;case"texCoord":const Ce=ge[0];Ce!==null&&(B=a(Ce));break;case"ccw":L=ge[0];break;case"colorIndex":V=ge;break;case"colorPerVertex":Le=ge[0];break;case"convex":break;case"coordIndex":ne=ge;break;case"creaseAngle":G=ge[0];break;case"normalIndex":Ae=ge;break;case"normalPerVertex":_e=ge[0];break;case"solid":F=ge[0];break;case"texCoordIndex":me=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ne);break}}if(ne===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new I.BufferGeometry;const Re=X(ne,L);let pe,Qe,Ge;if(w){if(Le===!0)if(V&&V.length>0){const je=X(V,L);pe=De(Re,je,w,3)}else pe=Oe(Re,new I.Float32BufferAttribute(w,3));else if(V&&V.length>0){const je=de(w,V),Ke=ae(je,ne);pe=ze(Re,Ke)}else{const je=ae(w,ne);pe=ze(Re,je)}fe(pe)}if(v)if(_e===!0)if(Ae&&Ae.length>0){const je=X(Ae,L);Qe=De(Re,je,v,3)}else Qe=Oe(Re,new I.Float32BufferAttribute(v,3));else if(Ae&&Ae.length>0){const je=de(v,Ae),Ke=ae(je,ne);Qe=ze(Re,Ke)}else{const je=ae(v,ne);Qe=ze(Re,je)}else Qe=K(Re,T,G);if(B)if(me&&me.length>0){const je=X(me,L);Ge=De(Re,je,B,2)}else Ge=Oe(Re,new I.Float32BufferAttribute(B,2));const Me=new I.BufferGeometry,xe=Oe(Re,new I.Float32BufferAttribute(T,3));return Me.setAttribute("position",xe),Me.setAttribute("normal",Qe),pe&&Me.setAttribute("color",pe),Ge&&Me.setAttribute("uv",Ge),Me._solid=F,Me._type="mesh",Me}function k(R){let w,T,v,B,L=!0;const F=R.fields;for(let me=0,Le=F.length;me<Le;me++){const _e=F[me],be=_e.name,Re=_e.values;switch(be){case"color":const pe=Re[0];pe!==null&&(w=a(pe));break;case"coord":const Qe=Re[0];Qe!==null&&(T=a(Qe));break;case"colorIndex":v=Re;break;case"colorPerVertex":L=Re[0];break;case"coordIndex":B=Re;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",be);break}}let G;const V=P(B);if(w){if(L===!0)if(v.length>0){const me=P(v);G=De(V,me,w,3)}else G=Oe(V,new I.Float32BufferAttribute(w,3));else if(v.length>0){const me=de(w,v),Le=j(me,B);G=Xe(V,Le)}else{const me=j(w,B);G=Xe(V,me)}fe(G)}const ne=new I.BufferGeometry,Ae=Oe(V,new I.Float32BufferAttribute(T,3));return ne.setAttribute("position",Ae),G&&ne.setAttribute("color",G),ne._type="line",ne}function D(R){let w,T;const v=R.fields;for(let L=0,F=v.length;L<F;L++){const G=v[L],V=G.name,ne=G.values;switch(V){case"color":const Ae=ne[0];Ae!==null&&(w=a(Ae));break;case"coord":const me=ne[0];me!==null&&(T=a(me));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}const B=new I.BufferGeometry;if(B.setAttribute("position",new I.Float32BufferAttribute(T,3)),w){const L=new I.Float32BufferAttribute(w,3);fe(L),B.setAttribute("color",L)}return B._type="points",B}function x(R){const w=new I.Vector3(2,2,2),T=R.fields;for(let B=0,L=T.length;B<L;B++){const F=T[B],G=F.name,V=F.values;G==="size"?(w.x=V[0],w.y=V[1],w.z=V[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.BoxGeometry(w.x,w.y,w.z)}function W(R){let w=1,T=2,v=!1;const B=R.fields;for(let F=0,G=B.length;F<G;F++){const V=B[F],ne=V.name,Ae=V.values;switch(ne){case"bottom":v=!Ae[0];break;case"bottomRadius":w=Ae[0];break;case"height":T=Ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ne);break}}return new I.ConeGeometry(w,T,16,1,v)}function $(R){let w=1,T=2;const v=R.fields;for(let L=0,F=v.length;L<F;L++){const G=v[L],V=G.name,ne=G.values;switch(V){case"bottom":break;case"radius":w=ne[0];break;case"height":T=ne[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return new I.CylinderGeometry(w,w,T,16,1)}function H(R){let w=1;const T=R.fields;for(let B=0,L=T.length;B<L;B++){const F=T[B],G=F.name,V=F.values;G==="radius"?w=V[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.SphereGeometry(w,16,16)}function ee(R){let w,T,v,B,L=!0,F=!0,G=!0,V=!0,ne=0,Ae=2,me=2,Le=1,_e=1;const be=R.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 At=Ce[0];At!==null&&(T=a(At));break;case"texCoord":const ct=Ce[0];ct!==null&&(v=a(ct));break;case"height":B=Ce;break;case"ccw":V=Ce[0];break;case"colorPerVertex":L=Ce[0];break;case"creaseAngle":ne=Ce[0];break;case"normalPerVertex":F=Ce[0];break;case"solid":G=Ce[0];break;case"xDimension":Ae=Ce[0];break;case"xSpacing":Le=Ce[0];break;case"zDimension":me=Ce[0];break;case"zSpacing":_e=Ce[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const Re=[],pe=[],Qe=[],Ge=[];for(let ge=0;ge<me;ge++)for(let Ee=0;Ee<Ae;Ee++){const he=ge*Ae+Ee,Ie=Le*ge,Ce=B[he],Ue=_e*Ee;if(Re.push(Ie,Ce,Ue),w&&L===!0){const At=w[he*3+0],ct=w[he*3+1],qt=w[he*3+2];Qe.push(At,ct,qt)}if(T&&F===!0){const At=T[he*3+0],ct=T[he*3+1],qt=T[he*3+2];pe.push(At,ct,qt)}if(v){const At=v[he*2+0],ct=v[he*2+1];Ge.push(At,ct)}else Ge.push(ge/(Ae-1),Ee/(me-1))}const Me=[];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;V===!0?(Me.push(he,Ce,Ie),Me.push(Ce,he,Ue)):(Me.push(he,Ie,Ce),Me.push(Ce,Ue,he))}const xe=Oe(Me,new I.Float32BufferAttribute(Re,3)),je=Oe(Me,new I.Float32BufferAttribute(Ge,2));let Ke,Ve;if(w){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=w[he*3+0],Ce=w[he*3+1],Ue=w[he*3+2];Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue),Qe.push(Ie,Ce,Ue)}Ke=new I.Float32BufferAttribute(Qe,3)}else Ke=Oe(Me,new I.Float32BufferAttribute(Qe,3));fe(Ke)}if(T)if(F===!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];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)}Ve=new I.Float32BufferAttribute(pe,3)}else Ve=Oe(Me,new I.Float32BufferAttribute(pe,3));else Ve=K(Me,Re,ne);const Ne=new I.BufferGeometry;return Ne.setAttribute("position",xe),Ne.setAttribute("normal",Ve),Ne.setAttribute("uv",je),Ke&&Ne.setAttribute("color",Ke),Ne._solid=G,Ne._type="mesh",Ne}function ie(R){let w=[1,1,1,-1,-1,-1,-1,1,1,1],T=[0,0,0,0,1,0],v,B,L=!0,F=!0,G=0,V=!0,ne=!0;const Ae=R.fields;for(let Ne=0,ge=Ae.length;Ne<ge;Ne++){const Ee=Ae[Ne],he=Ee.name,Ie=Ee.values;switch(he){case"beginCap":L=Ie[0];break;case"ccw":F=Ie[0];break;case"convex":break;case"creaseAngle":G=Ie[0];break;case"crossSection":w=Ie;break;case"endCap":V=Ie[0];break;case"orientation":B=Ie;break;case"scale":v=Ie;break;case"solid":ne=Ie[0];break;case"spine":T=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],Le=[],_e=new I.Vector3,be=new I.Vector3,Re=new I.Vector3,pe=new I.Vector3,Qe=new I.Quaternion;for(let Ne=0,ge=0,Ee=0,he=T.length;Ne<he;Ne+=3,ge+=2,Ee+=4){_e.fromArray(T,Ne),be.x=v?v[ge+0]:1,be.y=1,be.z=v?v[ge+1]:1,Re.x=B?B[Ee+0]:0,Re.y=B?B[Ee+1]:0,Re.z=B?B[Ee+2]:1;const Ie=B?B[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),Qe.setFromAxisAngle(Re,Ie),pe.applyQuaternion(Qe),pe.add(_e),Le.push(pe.x,pe.y,pe.z)}const Ge=[],Me=T.length/3,xe=w.length/2;for(let Ne=0;Ne<Me-1;Ne++)for(let ge=0;ge<xe-1;ge++){const Ee=ge+Ne*xe;let he=ge+1+Ne*xe;const Ie=ge+(Ne+1)*xe;let Ce=ge+1+(Ne+1)*xe;ge===xe-2&&me===!0&&(he=Ne*xe,Ce=(Ne+1)*xe),F===!0?(Ge.push(Ee,he,Ie),Ge.push(Ie,he,Ce)):(Ge.push(Ee,Ie,he),Ge.push(Ie,Ce,he))}if(L===!0||V===!0){const Ne=[];for(let he=0,Ie=w.length;he<Ie;he+=2)Ne.push(new I.Vector2(w[he],w[he+1]));const ge=I.ShapeUtils.triangulateShape(Ne,[]),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)F===!0?Ge.push(Ee[he+0],Ee[he+1],Ee[he+2]):Ge.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(V===!0){const he=xe*(Me-1);for(let Ie=0,Ce=Ee.length;Ie<Ce;Ie+=3)F===!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 je=Oe(Ge,new I.Float32BufferAttribute(Le,3)),Ke=K(Ge,Le,G),Ve=new I.BufferGeometry;return Ve.setAttribute("position",je),Ve.setAttribute("normal",Ke),Ve._solid=ne,Ve._type="mesh",Ve}function ue(R){const w=n[R],T=a(w);return T.isObject3D||T.isMaterial?T.clone():T}function re(R,w){for(let T=0,v=R.length;T<v;T++){const B=a(R[T]);B instanceof I.Object3D&&w.add(B)}}function X(R,w){const T=[];let v=0;for(let B=0,L=R.length;B<L;B++){const F=R[v],G=R[B+(w?1:2)],V=R[B+(w?2:1)];T.push(F,G,V),(R[B+3]===-1||B+3>=L)&&(B+=3,v=B+1)}return T}function ae(R,w){const T=[];let v=0;for(let B=0,L=w.length;B<L;B++){const F=v*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne),(w[B+3]===-1||B+3>=L)&&(B+=3,v++)}return T}function de(R,w){const T=[];for(let v=0,B=w.length;v<B;v++){const F=w[v]*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne)}return T}function P(R){const w=[];for(let T=0,v=R.length;T<v;T++){const B=R[T],L=R[T+1];w.push(B,L),(R[T+2]===-1||T+2>=v)&&(T+=2)}return w}function j(R,w){const T=[];let v=0;for(let B=0,L=w.length;B<L;B++){const F=v*3,G=R[F],V=R[F+1],ne=R[F+2];T.push(G,V,ne),(w[B+2]===-1||B+2>=L)&&(B+=2,v++)}return T}const U=new I.Vector3,Z=new I.Vector3,J=new I.Vector3,le=new I.Vector2,ye=new I.Vector2,we=new I.Vector2;function De(R,w,T,v){const B=[];for(let L=0,F=R.length;L<F;L+=3){const G=w[L],V=w[L+1],ne=w[L+2];v===2?(le.fromArray(T,G*v),ye.fromArray(T,V*v),we.fromArray(T,ne*v),B.push(le.x,le.y),B.push(ye.x,ye.y),B.push(we.x,we.y)):(U.fromArray(T,G*v),Z.fromArray(T,V*v),J.fromArray(T,ne*v),B.push(U.x,U.y,U.z),B.push(Z.x,Z.y,Z.z),B.push(J.x,J.y,J.z))}return new I.Float32BufferAttribute(B,v)}function ze(R,w){const T=[];for(let v=0,B=0,L=R.length;v<L;v+=3,B++)U.fromArray(w,B*3),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z);return new I.Float32BufferAttribute(T,3)}function Xe(R,w){const T=[];for(let v=0,B=0,L=R.length;v<L;v+=2,B++)U.fromArray(w,B*3),T.push(U.x,U.y,U.z),T.push(U.x,U.y,U.z);return new I.Float32BufferAttribute(T,3)}function Oe(R,w){const T=w.array,v=w.itemSize,B=new T.constructor(R.length*v);let L=0,F=0;for(let G=0,V=R.length;G<V;G++){L=R[G]*v;for(let ne=0;ne<v;ne++)B[F++]=T[L++]}return new I.Float32BufferAttribute(B,v)}const O=new I.Vector3,Y=new I.Vector3;function K(R,w,T){const v=[],B={};for(let F=0,G=R.length;F<G;F+=3){const V=R[F],ne=R[F+1],Ae=R[F+2],me=new fo(V,ne,Ae);U.fromArray(w,V*3),Z.fromArray(w,ne*3),J.fromArray(w,Ae*3),Y.subVectors(J,Z),O.subVectors(U,Z),Y.cross(O),Y.normalize(),me.normal.copy(Y),B[V]===void 0&&(B[V]=[]),B[ne]===void 0&&(B[ne]=[]),B[Ae]===void 0&&(B[Ae]=[]),B[V].push(me.normal),B[ne].push(me.normal),B[Ae].push(me.normal),v.push(me)}const L=[];for(let F=0,G=v.length;F<G;F++){const V=v[F],ne=oe(B[V.a],V.normal,T),Ae=oe(B[V.b],V.normal,T),me=oe(B[V.c],V.normal,T);U.fromArray(w,V.a*3),Z.fromArray(w,V.b*3),J.fromArray(w,V.c*3),L.push(ne.x,ne.y,ne.z),L.push(Ae.x,Ae.y,Ae.z),L.push(me.x,me.y,me.z)}return new I.Float32BufferAttribute(L,3)}function oe(R,w,T){const v=new I.Vector3;if(T===0)v.copy(w);else for(let B=0,L=R.length;B<L;B++)R[B].angleTo(w)<T&&v.add(R[B]);return v.normalize()}function fe(R){const w=new I.Color;for(let T=0;T<R.count;T++)w.fromBufferAttribute(R,T),I.ColorManagement.colorSpaceToWorking(w,I.SRGBColorSpace),R.setXYZ(T,w.r,w.g,w.b)}const Se=new I.TextureLoader(this.manager);if(Se.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=i(e);return c(Be)}}class lo{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 uo=wt.CstParser;class ho extends uo{constructor(e){super(e);const t=this,n=e.Version,i=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,d=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,E=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,h=e.USE,p=e.ROUTE,C=e.TO,m=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(m),t.CONSUME(i),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(m)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),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(b)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(E)}},{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(b)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class fo{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new I.Vector3}}const tt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class po{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:i=[],size:o=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=i,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 i=0;i<n;i++)if(e<=this._skyAngle[i+1]){const o=(e-this._skyAngle[i])/(this._skyAngle[i+1]-this._skyAngle[i]);return this._lerpColor(this._skyColor[i+1]??this._skyColor[this._skyColor.length-1],this._skyColor[i+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 i=this._groundAngle.length-1;if(n>=this._groundAngle[i])return this._groundColor[i+1]??this._groundColor[this._groundColor.length-1];for(let o=0;o<i;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"),i=n.createImageData(e,e),o=i.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,b=1,f=Math.sqrt(u*u+A*A+b*b),E=Math.acos(Math.max(-1,Math.min(1,A/f))),[g,l,h]=this._colorAtPitch(E),p=(s*e+a)*4;o[p]=Math.round(g*255),o[p+1]=Math.round(l*255),o[p+2]=Math.round(h*255),o[p+3]=255}}return n.putImageData(i,0,0),t}_buildTopCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),i=n.createImageData(e,e),o=i.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),b=Math.acos(Math.max(-1,Math.min(1,d/u))),[f,E,g]=this._colorAtPitch(b),l=(s*e+A)*4;o[l]=Math.round(f*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(i,0,0),t}_buildBottomCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),i=n.createImageData(e,e),o=i.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),b=Math.acos(Math.max(-1,Math.min(1,d/u))),[f,E,g]=this._colorAtPitch(b),l=(s*e+A)*4;o[l]=Math.round(f*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(i,0,0),t}_buildCubeTexture(){const e=this._buildSideCanvas(),t=this._buildTopCanvas(),n=this._buildBottomCanvas(),i=[e,e,t,n,e,e],o=new I.CubeTexture(i);return o.needsUpdate=!0,o.minFilter=I.LinearMipmapLinearFilter,o.magFilter=I.LinearFilter,o}}async function go(r){await new Promise((o,s)=>{if(r.complete)return o();r.onload=o,r.onerror=s});const e=document.createElement("canvas"),t=e.getContext("2d");e.width=r.naturalWidth,e.height=r.naturalHeight,t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height).data;for(let o=3;o<i.length;o+=4)if(i[o]<255)return!0;return!1}class mo extends I.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,i){const o=this,s=new I.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){i?i(A):console.error(A),o.manager.itemError(e)}},n,i)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const E=[],g=i(f,c(f),E);c(f)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(f).split(/[\s]+/);const h=parseInt(l[1]);isNaN(h)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(f).split(/[\s]+/);const p=parseFloat(l[2]);isNaN(p)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<h;C++)l=c(f).split(/[\s]+/),n(l,C*p,g);return E}function n(f,E,g){if(g.type==="ENDSITE")return;const l={time:E,position:new I.Vector3,rotation:new I.Quaternion,scale:new I.Vector3(1,1,1)};g.frames.push(l);const h=new I.Quaternion,p=new I.Vector3(1,0,0),C=new I.Vector3(0,1,0),m=new I.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(f.shift().trim());break;case"Yposition":l.position.y=parseFloat(f.shift().trim());break;case"Zposition":l.position.z=parseFloat(f.shift().trim());break;case"Xrotation":h.setFromAxisAngle(p,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Yrotation":h.setFromAxisAngle(C,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Zrotation":h.setFromAxisAngle(m,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Xscale":l.scale.x=parseFloat(f.shift().trim());break;case"Yscale":l.scale.y=parseFloat(f.shift().trim());break;case"Zscale":l.scale.z=parseFloat(f.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)n(f,E,g.children[y])}function i(f,E,g){const l={name:"",type:"",frames:[]};g.push(l);let h=E.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(f)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),h=c(f).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 p=new I.Vector3(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));if((isNaN(p.x)||isNaN(p.y)||isNaN(p.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=p,l.type!=="ENDSITE"){h=c(f).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(f);if(C==="}")return l;l.children.push(i(f,C,g))}}function o(f,E){const g=new I.Bone;if(E.push(g),g.position.add(f.offset),g.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)g.add(o(f.children[l],E));return g}function s(f){const E=[];for(let g=0;g<f.length;g++){const l=f[g];if(l.type==="ENDSITE")continue;const h=[],p=[],C=[],m=[];for(let y=0;y<l.frames.length;y++){const S=l.frames[y];h.push(S.time),p.push(S.position.x+l.offset.x),p.push(S.position.y+l.offset.y),p.push(S.position.z+l.offset.z),C.push(S.rotation.x),C.push(S.rotation.y),C.push(S.rotation.z),C.push(S.rotation.w),m.push(S.scale.x),m.push(S.scale.y),m.push(S.scale.z)}A.animateBonePositions&&E.push(new I.VectorKeyframeTrack(l.name+".position",h,p)),A.animateBoneRotations&&E.push(new I.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&E.push(new I.VectorKeyframeTrack(l.name+".scale",h,m))}return new I.AnimationClip("animation",-1,E)}function c(f){let E;for(;(E=f.shift().trim()).length===0;);return E}const A=this,a=e.split(/[\r\n]+/g),d=t(a),u=[];o(d[0],u);const b=s(d);return{skeleton:new I.Skeleton(u),clip:b}}}let Nt,Dt,Ct;async function Eo(r,e){Ct||(Ct=new co),Ct.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(an(r,n)))),Nt=void 0,Dt=void 0;const t=await Ct.loadAsync(e);return Nt=_t,Dt=Lt,Ct.manager.setURLModifier(n=>n),t}let zt;async function Io(r,e){zt||(zt=new mo);const t=xt(r,e);return await zt.parse(t)}function bo(r){const e=r.clip.clone(),t=r.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof se.Bone&&n.push(o)});const i=new se.Skeleton(n);return i.calculateInverses(),{clip:e,skeleton:i}}class Bn{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 i=n.getValueSize();let o;n.getInterpolation()===se.InterpolateDiscrete?o=new se.DiscreteInterpolant(n.times,n.values,i):n.ValueTypeName==="quaternion"?o=new se.QuaternionLinearInterpolant(n.times,n.values,i):o=new se.LinearInterpolant(n.times,n.values,i),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,i]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=i.evaluate(this.time);if(s==="position")c.loc=new te(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Te(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new te(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 Co={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function yo(){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 Pe{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=Ot(Co,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new se.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 se.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 xn{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const Kt={},pt={};class An extends En{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,i,o=!1,s=!0,c,A){super(e,t),this.loop=n,this.sound=i,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 ci extends Et{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 ei(e),n=new DOMParser,i=xt(t,"CATALOG.XML"),o=n.parseFromString(i,"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 p=h.getAttribute("name");p&&this.tags.push(p)});const d=o.getElementsByTagNameNS(s,"profile");Array.from(d).forEach(h=>{const p=h.getAttribute("uri");p&&this.profiles.push(p)});const u=o.getElementsByTagNameNS(s,"thumbnail");Array.from(u).forEach(h=>{const p=h.getAttribute("src");if(p){const C=an(t,p);this.thumbnails.push(C)}});const b=o.getElementsByTagNameNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","RDF");b[0]&&(this.rdf=b[0]);const f=o.getElementsByTagNameNS(s,"htmlfile");if(f[0]){const h=f[0].getAttribute("src");h&&(this.htmlfile=xt(t,h))}const E=o.getElementsByTagNameNS(s,"a"),g={};let l;for(const h of Array.from(E)){const p=h.getAttribute("an");if(p){l||(l=p);let C;const m=h.getAttribute("bvh");if(m&&m!=="none"){const X=t.zipUrl+"!"+m;Kt[X]||(Kt[X]=await Io(t,m)),C=bo(Kt[X]),C&&C.clip.tracks.forEach(ae=>{ae.setInterpolation(se.InterpolateDiscrete)})}else C=new xn;const y={};C.skeleton.bones.forEach(X=>{y[X.name]=X});const S=h.getAttribute("scale"),_=S?Number(S):1,z=h.getAttribute("offset"),Q=new te;if(z){const X=z.split(" ");Q.set(Number(X[0]),Number(X[1]),Number(X[2]))}const M=h.getAttribute("rot"),N=new te;if(M){const X=M.split(" ");N.set(Number(X[0]),Number(X[1]),Number(X[2]))}const k=h.getAttribute("loop")==="true";let D,x;const W={},$=h.getElementsByTagNameNS(s,"p");for(const X of Array.from($)){const ae=X.getAttribute("name"),de=X.getAttribute("wrl");if(ae&&de){const P=t.zipUrl+"!"+de;pt[P]||(pt[P]=await Eo(t,de),Nt&&(D=Nt),Dt&&(x=Dt));const j=X.getAttribute("scale");if(j){const J=Number(j);pt[P].scale.set(J,J,J)}const U=X.getAttribute("rot");if(U){const J=U.split(" ");pt[P].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(" ");pt[P].position.set(Number(J[0]),Number(J[1]),Number(J[2]))}W[ae]=pt[P].clone(!0)}}const H=new se.Object3D;H.add(C.skeleton.bones[0]),C instanceof xn||li(H,W),Object.values(W).forEach(X=>{H.add(X)}),H.scale.set(_,_,_),N.scale(Math.PI/180),H.setRotationFromEuler(new se.Euler(N.x,N.y,N.z,"ZXY")),H.position.add(Q),H.traverse(X=>{X.userData.a3js={objectA3:this}});let ee,ie=!1,ue=!0;const re=h.getElementsByTagNameNS(s,"s");if(re[0]){const X=re[0].getAttribute("file"),ae=re[0].getAttribute("type")||"PointSound",de=re[0].getAttribute("loop")||"false";ie=de==="true";const P=re[0].getAttribute("gain")||"1.0",j=re[0].getAttribute("offset")||"0.0 0.0 0.0",U=re[0].getAttribute("direction")||"0.0 0.0 1.0";ue=(re[0].getAttribute("continue")||"true")==="true";const J=j.split(" ").map(O=>Number(O)),le=new te(J[0],J[1],J[2]),ye=U.split(" ").map(O=>Number(O)),we=new te(ye[0],ye[1],ye[2]),De=ae==="PointSound"||ae==="ConeSound"?"positional":"audio",Oe=ae==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(X){const O=an(t,X),Y=URL.createObjectURL(O),K={type:De,autoplay:!1,loop:de==="true",volume:Number(P),positional:{directional:Oe}};ee=await new st(Y,K).ready,ee.setPosition(le),ee.lookAt(we),URL.revokeObjectURL(Y),H.add(ee.object3D)}}g[p]=new An({root:H,bones:y,skeleton:C.skeleton},new Bn(C.clip,p),k,ee,ie,ue,D,x)}}return l&&this.syncInit(l,g),this}}function li(r,e){if(Lr(r)){const t=e[r.name];t&&(r.add(t),delete e[r.name])}r.children&&r.children.forEach(t=>{li(t,e)})}class ui{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],sn.isInitialized&&(this.physicsWorld=sn.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.transformer.addOneselfToPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof ci&&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.transformer.removeOneselfFromPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof Et&&e.currentAction instanceof An&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}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 mn){const{vertices:n,colors:i}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(i,4))}}for(const t of this.objects)t.update(e)}setPhysicsDebugMode(e){e?(this.rapierLines=new se.LineSegments(new se.BufferGeometry,new se.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class hi extends Pe{controller;setController(e){this.controller=e}setPosition(e,t,n){const i=new te;typeof e=="number"?(super.setPosition(e,t,n),i.set(e,t,n)):(super.setPosition(e),i.set(e)),this.controller?this.controller.setCameraLocation(i):super.setPosition(i)}setPositionNow(e,t,n){const i=new te;typeof e=="number"?(super.setPosition(e,t,n),i.set(e,t,n)):(super.setPosition(e),i.set(e)),this.controller?this.controller.setCameraLocationNow(i):super.setPositionNow(i)}setQuat(e,t,n,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e),this.controller?this.controller.setCameraQuat(o):this.transformer.setQuat(o)}setQuatNow(e,t,n,i){const o=new Te;typeof e=="number"?o.set(e,t,n,i):o.set(e),this.controller?this.controller.setCameraQuatNow(o):this.transformer.setQuatNow(o)}lookAt(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.position):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.position,i,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuat(s)}lookAtNow(e,t,n){const i=new te;typeof e=="number"?i.set(e,t,n):e instanceof Pe?i.set(e.position):i.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=at(this.position,i,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuatNow(s)}}class jt{view;transform;constructor(){this.transform=new qe}setView(e){this.view=e}update(e){this.view&&(this.view.camera.transformer.setPosition(this.transform.loc),this.view.camera.transformer.setQuat(this.transform.quat),this.view.camera.transformer.setScale(this.transform.scale))}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){}setCameraLocation(e){this.transform.loc.set(e)}setCameraLocationNow(e){this.transform.loc.set(e)}setCameraQuat(e){this.transform.quat.set(e)}setCameraQuatNow(e){this.transform.quat.set(e)}setCameraScale(e){this.transform.scale.set(e)}setCameraScaleNow(e){this.transform.scale.set(e)}}class di extends jt{lastMousePosition;isLeftDown=!1;isRightDown=!1;target;cameraLoc=new te(0,0,3);cameraQuat=new Te(0,0,0,1);constructor(e,t,n){super(),this.lastMousePosition={x:0,y:0},typeof e=="number"?this.target=new te(e,t,n):this.target=new te(e)}update(e){this.view&&(this.view.camera.transformer.setPosition(this.cameraLoc),this.view.camera.transformer.setQuat(this.cameraQuat))}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){if(this.view){if(this.isLeftDown&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){const n=.01*(e.clientX-this.lastMousePosition.x),i=.01*(e.clientY-this.lastMousePosition.y),o=Math.sin(-n),s=Math.cos(-n),c=Math.sin(-i),A=Math.cos(-i),a=new te(1,0,0).apply(this.cameraQuat),d=new te(0,1,0).apply(this.cameraQuat),u=new Te(a.x*c,a.y*c,a.z*c,A),b=new Te(d.x*o,d.y*o,d.z*o,s),f=new te(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const E=at(this.cameraLoc,this.target,new te(0,1,0));E.mul(new Te(0,1,0,0)),this.cameraQuat.set(E),this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}else if(this.isLeftDown){q.v0.set(this.target),q.v0.sub(this.cameraLoc);const n=.005*q.v0.length(),i=n*(e.clientX-this.lastMousePosition.x),o=n*(e.clientY-this.lastMousePosition.y),s=new te(1,0,0).apply(this.cameraQuat).scale(-i),c=new te(0,1,0).apply(this.cameraQuat).scale(o);this.cameraLoc.add(s),this.cameraLoc.add(c),this.target.add(s),this.target.add(c),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){const t=new te(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}setCameraQuat(e){e.normalize(),this.cameraQuat.normalize();const t=new Te(this.cameraQuat);t.conjugate();const n=new te(this.target);n.sub(this.cameraLoc),n.apply(t),n.add(this.cameraLoc),this.target.set(n),this.cameraQuat.set(e)}setCameraQuatNow(e){this.setCameraQuat(e)}}const Bo={speed:.1,angSpeed:.01};class wo extends jt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Bo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new te,this._avatarNextQuat=new Te,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 i=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(i),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(i),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&&this._avatarNextQuat.mul(ht(new te(0,this.options.angSpeed,0))),this._keyRight&&this._avatarNextQuat.mul(ht(new te(0,-this.options.angSpeed,0))),t.transformer.setPosition(this._avatarNextLoc),t.transformer.setQuat(this._avatarNextQuat)}}const To={speed:5,angSpeed:.3,jumpSpeed:15};class Ro extends jt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...To,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new te,this._avatarNextAngVel=new te,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 i=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(i),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(i),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(new te(0,this.options.angSpeed,0)),this._keyRight&&this._avatarNextAngVel.add(new te(0,-this.options.angSpeed,0)),t.transformer.setLinearVelocity(this._avatarNextVel),t.transformer.setAngularVelocity(this._avatarNextAngVel)}}class wn{scene;camera;controller;constructor(e){this.scene=new ui,this.camera=e,this.camera.setAudioListener(st.listener),this.scene.scene.add(this.camera.object3D),this.camera.setPosition(0,0,3),this.controller=new di(0,0,0),this.controller.setView(this),this.controller.activate(),this.camera.setController(this.controller)}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(),this.camera.setController(e)}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 vt extends hi{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new se.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new se.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 se.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){xr(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 se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class fi extends I.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 I.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 gt=new I.Vector3,Nn=new I.Matrix4,Dn=new I.Matrix4,Fn=new I.Vector3,On=new I.Vector3;class pi{constructor(e={}){const t=this;let n,i,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:i}},this.render=function(E,g){E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),Nn.copy(g.matrixWorldInverse),Dn.multiplyMatrices(g.projectionMatrix,Nn),d(E,E,g),this.sortObjects&&f(E)},this.setSize=function(E,g){n=E,i=g,o=n/2,s=i/2,A.style.width=E+"px",A.style.height=g+"px"};function a(E){E.isCSS2DObject&&(E.element.style.display="none");for(let g=0,l=E.children.length;g<l;g++)a(E.children[g])}function d(E,g,l){if(E.visible===!1){a(E);return}if(E.isCSS2DObject){gt.setFromMatrixPosition(E.matrixWorld),gt.applyMatrix4(Dn);const h=gt.z>=-1&&gt.z<=1&&E.layers.test(l.layers)===!0,p=E.element;p.style.display=h===!0?"":"none",h===!0&&(E.onBeforeRender(t,g,l),p.style.transform="translate("+-100*E.center.x+"%,"+-100*E.center.y+"%)translate("+(gt.x*o+o)+"px,"+(-gt.y*s+s)+"px)",p.parentNode!==A&&A.appendChild(p),E.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,E)};c.objects.set(E,C)}for(let h=0,p=E.children.length;h<p;h++)d(E.children[h],g,l)}function u(E,g){return Fn.setFromMatrixPosition(E.matrixWorld),On.setFromMatrixPosition(g.matrixWorld),Fn.distanceToSquared(On)}function b(E){const g=[];return E.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function f(E){const g=b(E).sort(function(h,p){if(h.renderOrder!==p.renderOrder)return p.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,m=c.objects.get(p).distanceToCameraSquared;return C-m}),l=g.length;for(let h=0,p=g.length;h<p;h++)g[h].element.style.zIndex=l-h}}}function Mn(r,e){if(e===I.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===I.TriangleFanDrawMode||e===I.TriangleStripDrawMode){let t=r.getIndex();if(t===null){const s=[],c=r.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);r.setIndex(s),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===I.TriangleFanDrawMode)for(let s=1;s<=n;s++)i.push(t.getX(0)),i.push(t.getX(s)),i.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(i.push(t.getX(s)),i.push(t.getX(s+1)),i.push(t.getX(s+2))):(i.push(t.getX(s+2)),i.push(t.getX(s+1)),i.push(t.getX(s)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=r.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class gi extends I.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new _o(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new No(t)}),this.register(function(t){return new Do(t)}),this.register(function(t){return new Fo(t)}),this.register(function(t){return new Oo(t)}),this.register(function(t){return new So(t)}),this.register(function(t){return new Mo(t)}),this.register(function(t){return new xo(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new Qo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new zo(t)})}load(e,t,n,i){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=I.LoaderUtils.extractUrlBase(e);s=I.LoaderUtils.resolveURL(a,this.path)}else s=I.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){i?i(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new I.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,i){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))===mi){try{s[ke.KHR_BINARY_GLTF]=new Ko(e)}catch(u){i&&i(u);return}o=JSON.parse(s[ke.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new os(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],b=o.extensionsRequired||[];switch(u){case ke.KHR_MATERIALS_UNLIT:s[u]=new ko;break;case ke.KHR_DRACO_MESH_COMPRESSION:s[u]=new Vo(o,this.dracoLoader);break;case ke.KHR_TEXTURE_TRANSFORM:s[u]=new Wo;break;case ke.KHR_MESH_QUANTIZATION:s[u]=new Yo;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function vo(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const ke={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 Qo{constructor(e){this.parser=e,this.name=ke.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;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 i=t.cache.get(n);if(i)return i;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const d=new I.Color(16777215);A.color!==void 0&&d.setRGB(A.color[0],A.color[1],A.color[2],I.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new I.DirectionalLight(d),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new I.PointLight(d),a.distance=u;break;case"spot":a=new I.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),i=Promise.resolve(a),t.cache.add(n,i),i}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 ko{constructor(){this.name=ke.KHR_MATERIALS_UNLIT}getMaterialType(){return I.MeshBasicMaterial}extendParams(e,t,n){const i=[];e.color=new I.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],I.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,I.SRGBColorSpace))}return Promise.all(i)}}class So{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class _o{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Vector2(c,c)}return Promise.all(o)}}class Lo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class xo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 No{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new I.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=i.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,I.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Do{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Fo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),Promise.all(o)}}class Oo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class Mo{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,I.SRGBColorSpace)),Promise.all(o)}}class Po{constructor(e){this.parser=e,this.name=ke.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Go{constructor(e){this.parser=e,this.name=ke.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],s=i.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 Uo{constructor(e){this.parser=e,this.name=ke.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.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 Ho{constructor(e){this.parser=e,this.name=ke.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=i.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.parser=e,this.name=ke.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=i.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 qo{constructor(e){this.name=ke.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 i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.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=i.byteOffset||0,a=i.byteLength||0,d=i.count,u=i.byteStride,b=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(d,u,b,i.mode,i.filter).then(function(f){return f.buffer}):s.ready.then(function(){const f=new ArrayBuffer(d*u);return s.decodeGltfBuffer(new Uint8Array(f),d,u,b,i.mode,i.filter),f})})}else return null}}class zo{constructor(e){this.name=ke.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 i=t.meshes[n.mesh];for(const a of i.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],b=a[0].count,f=[];for(const E of u){const g=new I.Matrix4,l=new I.Vector3,h=new I.Quaternion,p=new I.Vector3(1,1,1),C=new I.InstancedMesh(E.geometry,E.material,b);for(let m=0;m<b;m++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,m),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,m),A.SCALE&&p.fromBufferAttribute(A.SCALE,m),C.setMatrixAt(m,g.compose(l,h,p));for(const m in A)if(m==="_COLOR_0"){const y=A[m];C.instanceColor=new I.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else m!=="TRANSLATION"&&m!=="ROTATION"&&m!=="SCALE"&&E.geometry.setAttribute(m,A[m]);I.Object3D.prototype.copy.call(C,E),this.parser.assignFinalMaterial(C),f.push(C)}return d.isGroup?(d.clear(),d.add(...f),d):f[0]}))}}const mi="glTF",yt=12,Pn={JSON:1313821514,BIN:5130562};class Ko{constructor(e){this.name=ke.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,yt),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!==mi)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-yt,o=new DataView(e,yt);let s=0;for(;s<i;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===Pn.JSON){const a=new Uint8Array(e,yt+s,c);this.content=n.decode(a)}else if(A===Pn.BIN){const a=yt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Vo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ke.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const d in s){const u=cn[d]||d.toLowerCase();c[u]=s[d]}for(const d in e.attributes){const u=cn[d]||d.toLowerCase();if(s[d]!==void 0){const b=n.accessors[e.attributes[d]],f=It[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(u,b){i.decodeDracoFile(d,function(f){for(const E in f.attributes){const g=f.attributes[E],l=A[E];l!==void 0&&(g.normalized=l)}u(f)},c,a,I.LinearSRGBColorSpace,b)})})}}class Wo{constructor(){this.name=ke.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 Yo{constructor(){this.name=ke.KHR_MESH_QUANTIZATION}}class Ei extends I.Interpolant{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let s=0;s!==i;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,d=i-t,u=(n-t)/d,b=u*u,f=b*u,E=e*a,g=E-a,l=-2*f+3*b,h=f-b,p=1-l,C=h-b+u;for(let m=0;m!==c;m++){const y=s[g+m+c],S=s[g+m+A]*d,_=s[E+m+c],z=s[E+m]*d;o[m]=p*y+C*S+l*_+h*z}return o}}const Jo=new I.Quaternion;class Xo extends Ei{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return Jo.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},It={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Gn={9728:I.NearestFilter,9729:I.LinearFilter,9984:I.NearestMipmapNearestFilter,9985:I.LinearMipmapNearestFilter,9986:I.NearestMipmapLinearFilter,9987:I.LinearMipmapLinearFilter},Un={33071:I.ClampToEdgeWrapping,33648:I.MirroredRepeatWrapping,10497:I.RepeatWrapping},Vt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cn={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"},Zo={CUBICSPLINE:void 0,LINEAR:I.InterpolateLinear,STEP:I.InterpolateDiscrete},Wt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function $o(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new I.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:I.FrontSide})),r.DefaultMaterial}function ut(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function it(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function es(r,e,t){let n=!1,i=!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&&(i=!0),u.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(r);const s=[],c=[],A=[];for(let a=0,d=e.length;a<d;a++){const u=e[a];if(n){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):r.attributes.position;s.push(b)}if(i){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):r.attributes.normal;c.push(b)}if(o){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):r.attributes.color;A.push(b)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const d=a[0],u=a[1],b=a[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=u),o&&(r.morphAttributes.color=b),r.morphTargetsRelative=!0,r})}function ts(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ns(r){let e;const t=r.extensions&&r.extensions[ke.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Yt(t.attributes):e=r.indices+":"+Yt(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Yt(r.targets[n]);return e}function Yt(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function ln(r){switch(r){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 is(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":r.search(/\.ktx2($|\?)/i)>0||r.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const rs=new I.Matrix4;class os{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new vo,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,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+)/);i=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&&i<17||o&&s<98?this.textureLoader=new I.TextureLoader(this.options.manager):this.textureLoader=new I.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new I.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,i=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][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:n,userData:{}};return ut(o,c,i),it(c,i),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 i=0,o=t.length;i<o;i++){const s=t[i].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const s=e[i];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 i=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,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.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[ke.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,s){n.load(I.LoaderUtils.resolveURL(t.uri,i.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 i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const s=Vt[i.type],c=It[i.componentType],A=i.normalized===!0,a=new c(i.count*s);return Promise.resolve(new I.BufferAttribute(a,s,A))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Vt[i.type],a=It[i.componentType],d=a.BYTES_PER_ELEMENT,u=d*A,b=i.byteOffset||0,f=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,E=i.normalized===!0;let g,l;if(f&&f!==u){const h=Math.floor(b/f),p="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+h+":"+i.count;let C=t.cache.get(p);C||(g=new a(c,h*f,i.count*f/d),C=new I.InterleavedBuffer(g,f/d),t.cache.add(p,C)),l=new I.InterleavedBufferAttribute(C,A,b%f/d,E)}else c===null?g=new a(i.count*A):g=new a(c,b,i.count*A),l=new I.BufferAttribute(g,A,E);if(i.sparse!==void 0){const h=Vt.SCALAR,p=It[i.sparse.indices.componentType],C=i.sparse.indices.byteOffset||0,m=i.sparse.values.byteOffset||0,y=new p(s[1],C,i.sparse.count*h),S=new a(s[2],m,i.sparse.count*A);c!==null&&(l=new I.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let _=0,z=y.length;_<z;_++){const Q=y[_];if(l.setX(Q,S[_*A]),A>=2&&l.setY(Q,S[_*A+1]),A>=3&&l.setZ(Q,S[_*A+2]),A>=4&&l.setW(Q,S[_*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=E}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 i=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 b=(o.samplers||{})[s.sampler]||{};return d.magFilter=Gn[b.magFilter]||I.LinearFilter,d.minFilter=Gn[b.minFilter]||I.LinearMipmapLinearFilter,d.wrapS=Un[b.wrapS]||I.RepeatWrapping,d.wrapT=Un[b.wrapT]||I.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==I.NearestFilter&&d.minFilter!==I.LinearFilter,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=i.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 b=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(b),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(b,f){let E=b;t.isImageBitmapLoader===!0&&(E=function(g){const l=new I.Texture(g);l.needsUpdate=!0,b(l)}),t.load(I.LoaderUtils.resolveURL(u,o.path),E,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),it(u,s),u.userData.mimeType=s.mimeType||is(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,i){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[ke.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[ke.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[ke.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return i!==void 0&&(s.colorSpace=i),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=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 I.PointsMaterial,I.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 I.LineBasicMaterial,I.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(i||o||s){let c="ClonedMaterial:"+n.uuid+":";i&&(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),i&&(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 I.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[ke.KHR_MATERIALS_UNLIT]){const u=i[ke.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new I.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],I.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,I.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(b){return b.getMaterialType&&b.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=I.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!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new I.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==I.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new I.Color().setRGB(u[0],u[1],u[2],I.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==I.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,I.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&&ut(i,u,o),u})}createUniqueName(e){const t=I.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(c){return n[ke.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return Hn(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],d=ns(a),u=i[d];if(u)s.push(u.promise);else{let b;a.extensions&&a.extensions[ke.KHR_DRACO_MESH_COMPRESSION]?b=o(a):b=Hn(new I.BufferGeometry,a,t),i[d]={primitive:a,promise:b},s.push(b)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,i=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?$o(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 f=0,E=d.length;f<E;f++){const g=d[f],l=s[f];let h;const p=a[f];if(l.mode===Ze.TRIANGLES||l.mode===Ze.TRIANGLE_STRIP||l.mode===Ze.TRIANGLE_FAN||l.mode===void 0)h=o.isSkinnedMesh===!0?new I.SkinnedMesh(g,p):new I.Mesh(g,p),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===Ze.TRIANGLE_STRIP?h.geometry=Mn(h.geometry,I.TriangleStripDrawMode):l.mode===Ze.TRIANGLE_FAN&&(h.geometry=Mn(h.geometry,I.TriangleFanDrawMode));else if(l.mode===Ze.LINES)h=new I.LineSegments(g,p);else if(l.mode===Ze.LINE_STRIP)h=new I.Line(g,p);else if(l.mode===Ze.LINE_LOOP)h=new I.LineLoop(g,p);else if(l.mode===Ze.POINTS)h=new I.Points(g,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&ts(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),it(h,o),l.extensions&&ut(i,h,l),t.assignFinalMaterial(h),u.push(h)}for(let f=0,E=u.length;f<E;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return o.extensions&&ut(i,u[0],o),u[0];const b=new I.Group;o.extensions&&ut(i,b,o),t.associations.set(b,{meshes:e});for(let f=0,E=u.length;f<E;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new I.PerspectiveCamera(I.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new I.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.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 i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),s=i,c=[],A=[];for(let a=0,d=s.length;a<d;a++){const u=s[a];if(u){c.push(u);const b=new I.Matrix4;o!==null&&b.fromArray(o.array,a*16),A.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new I.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,s=[],c=[],A=[],a=[],d=[];for(let u=0,b=i.channels.length;u<b;u++){const f=i.channels[u],E=i.samplers[f.sampler],g=f.target,l=g.node,h=i.parameters!==void 0?i.parameters[E.input]:E.input,p=i.parameters!==void 0?i.parameters[E.output]:E.output;g.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",p)),a.push(E),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 b=u[0],f=u[1],E=u[2],g=u[3],l=u[4],h=[];for(let C=0,m=b.length;C<m;C++){const y=b[C],S=f[C],_=E[C],z=g[C],Q=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,S,_,z,Q);if(M)for(let N=0;N<M.length;N++)h.push(M[N])}const p=new I.AnimationClip(o,void 0,h);return it(p,i),p})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=i.weights.length;A<a;A++)c.morphTargetInfluences[A]=i.weights[A]}),s})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=i.children||[];for(let a=0,d=c.length;a<d;a++)s.push(n.getDependency("node",c[a]));const A=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const d=a[0],u=a[1],b=a[2];b!==null&&d.traverse(function(f){f.isSkinnedMesh&&f.bind(b,rs)});for(let f=0,E=u.length;f<E;f++)d.add(u[f]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?i.createUniqueName(o.name):"",c=[],A=i._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(i.getDependency("camera",o.camera).then(function(a){return i._getNodeRef(i.cameraCache,o.camera,a)})),i._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 I.Bone:a.length>1?d=new I.Group:a.length===1?d=a[0]:d=new I.Object3D,d!==a[0])for(let u=0,b=a.length;u<b;u++)d.add(a[u]);if(o.name&&(d.userData.name=o.name,d.name=s),it(d,o),o.extensions&&ut(n,d,o),o.matrix!==void 0){const u=new I.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(!i.associations.has(d))i.associations.set(d,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const u=i.associations.get(d);i.associations.set(d,{...u})}return i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new I.Group;n.name&&(o.name=i.createUniqueName(n.name)),it(o,n),n.extensions&&ut(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(i.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[b,f]of i.associations)(b instanceof I.Material||b instanceof I.Texture)&&u.set(b,f);return d.traverse(b=>{const f=i.associations.get(b);f!=null&&u.set(b,f)}),u};return i.associations=a(o),o})}_createAnimationTracks(e,t,n,i,o){const s=[],c=e.name?e.name:e.uuid,A=[];lt[o.path]===lt.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(lt[o.path]){case lt.weights:a=I.NumberKeyframeTrack;break;case lt.rotation:a=I.QuaternionKeyframeTrack;break;case lt.translation:case lt.scale:a=I.VectorKeyframeTrack;break;default:n.itemSize===1?a=I.NumberKeyframeTrack:a=I.VectorKeyframeTrack;break}const d=i.interpolation!==void 0?Zo[i.interpolation]:I.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const E=new a(A[b]+"."+lt[o.path],t.array,u,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),s.push(E)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=ln(t.constructor),i=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof I.QuaternionKeyframeTrack?Xo:Ei;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ss(r,e,t){const n=e.attributes,i=new I.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(i.set(new I.Vector3(A[0],A[1],A[2]),new I.Vector3(a[0],a[1],a[2])),c.normalized){const d=ln(It[c.componentType]);i.min.multiplyScalar(d),i.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 I.Vector3,A=new I.Vector3;for(let a=0,d=o.length;a<d;a++){const u=o[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,E=b.max;if(f!==void 0&&E!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(E[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(E[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(E[2]))),b.normalized){const g=ln(It[b.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const s=new I.Sphere;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=s}function Hn(r,e,t){const n=e.attributes,i=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){r.setAttribute(c,A)})}for(const s in n){const c=cn[s]||s.toLowerCase();c in r.attributes||i.push(o(n[s],c))}if(e.indices!==void 0&&!r.index){const s=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(s)}return I.ColorManagement.workingColorSpace!==I.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${I.ColorManagement.workingColorSpace}" not supported.`),it(r,e),ss(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?es(r,e.targets,t):r})}const Jt=new WeakMap;class as extends I.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new I.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,i)},n,i)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,I.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,i,o=I.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||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 i;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(i=A,new Promise((a,d)=>{i._callbacks[o]={resolve:a,reject:d},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),Jt.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new I.BufferGeometry;e.index&&t.setIndex(new I.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:i,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new I.BufferAttribute(o,s);else{const d=new I.InterleavedBuffer(o,c);a=new I.InterleavedBufferAttribute(d,s,0)}i==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(i,a)}return t}_assignVertexColorSpace(e,t){if(t!==I.SRGBColorSpace)return;const n=new I.Color;for(let i=0,o=e.count;i<o;i++)n.fromBufferAttribute(e,i),I.ColorManagement.colorSpaceToWorking(n,I.SRGBColorSpace),e.setXYZ(i,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new I.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,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 i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=As.toString(),s=["/* draco decoder */",i,"","/* 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 i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(o){const s=o.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,o){return i._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 As(){let r,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":r=c.decoderConfig,e=new Promise(function(d){r.onModuleLoaded=function(u){d({draco:u})},DracoDecoderModule(r)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(d=>{const u=d.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),E=f.attributes.map(g=>g.array.buffer);f.index&&E.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},E)}catch(f){console.error(f),self.postMessage({type:"error",id:c.id,error:f.message})}finally{u.destroy(b)}});break}};function t(s,c,A,a){const d=a.attributeIDs,u=a.attributeTypes;let b,f;const E=c.GetEncodedGeometryType(A);if(E===s.TRIANGULAR_MESH)b=new s.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(E===s.POINT_CLOUD)b=new s.PointCloud,f=c.DecodeArrayToPointCloud(A,A.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const g={index:null,attributes:[]};for(const l in d){const h=self[u[l]];let p,C;if(a.useUniqueIDs)C=d[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,s[d[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const m=i(s,c,b,l,h,p);l==="color"&&(m.vertexColorSpace=a.vertexColorSpace),g.attributes.push(m)}return E===s.TRIANGULAR_MESH&&(g.index=n(s,c,b)),s.destroy(b),g}function n(s,c,A){const d=A.num_faces()*3,u=d*4,b=s._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(s.HEAPF32.buffer,b,d).slice();return s._free(b),{array:f,itemSize:1}}function i(s,c,A,a,d,u){const b=A.num_points(),f=u.num_components(),E=o(s,d),g=f*d.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,h=l/d.BYTES_PER_ELEMENT,p=b*g,C=b*l,m=s._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,E,p,m);const y=new d(s.HEAPF32.buffer,m,p/d.BYTES_PER_ELEMENT);let S;if(g===l)S=y.slice();else{S=new d(C/d.BYTES_PER_ELEMENT);let _=0;for(let z=0,Q=y.length;z<Q;z++){for(let M=0;M<f;M++)S[_+M]=y[z*f+M];_+=h}}return s._free(m),{name:a,count:b,itemSize:f,array:S,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 cs{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:i,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=i,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 i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].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 ls=0,jn=2,us=1,qn=2,hs=0,ds=1,fs=10,ps=0,Ii=9,bi=15,Ci=16,yi=22,Bi=37,wi=43,Ti=76,Ri=83,vi=97,Qi=100,ki=103,Si=109,_i=122,Li=123,xi=131,Ni=132,Di=133,Fi=134,Oi=137,Mi=138,Pi=139,Gi=140,Ui=141,Hi=142,ji=145,qi=146,zi=148,Ki=152,un=153,gs=154,hn=155,ms=156,Vi=157,Wi=158,Yi=165,Ji=166,Xi=1000054e3,Zi=1000054001,$i=1000054004,er=1000054005,Tn=1000066e3,tr=1000066004;class Bt{constructor(e,t,n,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,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 i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const We=[171,75,84,88,32,50,48,187,13,10,26,10];function zn(r){return new TextDecoder().decode(r)}function Es(r){const e=new Uint8Array(r.buffer,r.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,i=new Bt(r,We.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32(),t.levelCount=i._nextUint32(),t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),A=i._nextUint32(),a=i._nextUint64(),d=i._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new Bt(r,We.length+n,u,!0);for(let re=0,X=Math.max(t.levelCount,1);re<X;re++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new Bt(r,o,s,!0);f._skip(4);const E=f._nextUint16(),g=f._nextUint16(),l=f._nextUint16(),h=f._nextUint16(),p={vendorId:E,descriptorType:g,versionNumber:l,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(h/4-6)/4;for(let re=0;re<C;re++){const X={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&X.channelType?(X.sampleLower=f._nextInt32(),X.sampleUpper=f._nextInt32()):(X.sampleLower=f._nextUint32(),X.sampleUpper=f._nextUint32()),p.samples[re]=X}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const m=new Bt(r,c,A,!0);for(;m._offset<A;){const re=m._nextUint32(),X=m._scan(re),ae=zn(X);if(t.keyValue[ae]=m._nextUint8Array(re-X.byteLength-1),ae.match(/^ktx/i)){const de=zn(t.keyValue[ae]);t.keyValue[ae]=de.substring(0,de.lastIndexOf("\0"))}m._skip(re%4?4-re%4:0)}if(d<=0)return t;const y=new Bt(r,a,d,!0),S=y._nextUint16(),_=y._nextUint16(),z=y._nextUint32(),Q=y._nextUint32(),M=y._nextUint32(),N=y._nextUint32(),k=[];for(let re=0,X=Math.max(t.levelCount,1);re<X;re++)k.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const D=a+y._offset,x=D+z,W=x+Q,$=W+M,H=new Uint8Array(r.buffer,r.byteOffset+D,z),ee=new Uint8Array(r.buffer,r.byteOffset+x,Q),ie=new Uint8Array(r.buffer,r.byteOffset+W,M),ue=new Uint8Array(r.buffer,r.byteOffset+$,N);return t.globalData={endpointCount:S,selectorCount:_,imageDescs:k,endpointsData:H,selectorsData:ee,tablesData:ie,extendedData:ue},t}let Xt,ot,dn;const Zt={env:{emscripten_notify_memory_growth:function(r){dn=new Uint8Array(ot.exports.memory.buffer)}}};class Is{init(){return Xt||(Xt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Kn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Zt)).then(this._init):WebAssembly.instantiate(Buffer.from(Kn,"base64"),Zt).then(this._init),Xt)}_init(e){ot=e.instance,Zt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ot)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=ot.exports.malloc(n);dn.set(e,i),t=t||Number(ot.exports.ZSTD_findDecompressedSize(i,n));const o=ot.exports.malloc(t),s=ot.exports.ZSTD_decompress(o,t,i,n),c=dn.slice(o,o+s);return ot.exports.free(i),ot.exports.free(o),c}}const Kn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9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CyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBB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BEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQg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wcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADI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Management.spaces[I.SRGBColorSpace]});const $t=new WeakMap;let en=0,tn;class $e extends I.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cs,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 I.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new I.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).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})}),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,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new I.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,i)},n,i)}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(i=>t?t(i):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:i,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:d}}=e;if(n==="error")return Promise.reject(i);let u;if(t.faceCount===6)u=new I.CompressedCubeTexture(o,A,a);else{const b=o[0].mipmaps;u=t.layerCount>1?new I.CompressedArrayTexture(b,s,c,t.layerCount,A,a):new I.CompressedTexture(b,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?I.LinearFilter:I.LinearMipmapLinearFilter,u.magFilter=I.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=nr(t),u.premultiplyAlpha=!!(d&us),u}async _createTexture(e,t={}){const n=Es(new Uint8Array(e)),i=n.vkFormat===Tn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===ps||i&&!this.workerConfig.astcHDRSupported))return Bs(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--}}$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:I.RGBAFormat,RGBA_ASTC_4x4_Format:I.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:I.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:I.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:I.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:I.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:I.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:I.RGB_ETC1_Format,RGB_ETC2_Format:I.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:I.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:I.RGBA_S3TC_DXT1_Format};$e.EngineType={UnsignedByteType:I.UnsignedByteType,HalfFloatType:I.HalfFloatType,FloatType:I.FloatType};$e.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(E){const g=E.data;switch(g.type){case"init":r=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:p,height:C,hasAlpha:m,format:y,type:S,dfdFlags:_}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:p,height:C,hasAlpha:m,format:y,type:S,dfdFlags:_}},h)}catch(l){console.error(l),self.postMessage({type:"error",id:g.id,error:l.message})}});break}});function c(E){e=new Promise(g=>{t={wasmBinary:E,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(E){const g=new t.KTX2File(new Uint8Array(E));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 p=g.getWidth(),C=g.getHeight(),m=g.getLayers()||1,y=g.getLevels(),S=g.getFaces(),_=g.getHasAlpha(),z=g.getDFDFlags(),{transcoderFormat:Q,engineFormat:M,engineType:N}=u(h,p,C,_);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const k=[],D=[];for(let x=0;x<S;x++){const W=[];for(let $=0;$<y;$++){const H=[];let ee,ie;for(let re=0;re<m;re++){const X=g.getImageLevelInfo($,re,x);x===0&&$===0&&re===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,ie=X.origHeight):(ee=X.width,ie=X.height);let ae=new Uint8Array(g.getImageTranscodedSizeInBytes($,re,0,Q));const de=g.transcodeImage(ae,$,re,x,Q,0,-1,-1);if(N===i.HalfFloatType&&(ae=new Uint16Array(ae.buffer,ae.byteOffset,ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");H.push(ae)}const ue=f(H);W.push({data:ue,width:ee,height:ie}),D.push(ue.buffer)}k.push({mipmaps:W,width:p,height:C,format:M,type:N})}return l(),{faces:k,buffers:D,width:p,height:C,hasAlpha:_,dfdFlags:z,format:M,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:[i.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:[i.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:[i.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:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[i.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:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],d={[s.ETC1S]:a.filter(E=>E.basisFormat.includes(s.ETC1S)).sort((E,g)=>E.priorityETC1S-g.priorityETC1S),[s.UASTC]:a.filter(E=>E.basisFormat.includes(s.UASTC)).sort((E,g)=>E.priorityUASTC-g.priorityUASTC),[s.UASTC_HDR]:a.filter(E=>E.basisFormat.includes(s.UASTC_HDR)).sort((E,g)=>E.priorityHDR-g.priorityHDR)};function u(E,g,l,h){const p=d[E];for(let C=0;C<p.length;C++){const m=p[C];if(m.if&&!r[m.if]||!m.basisFormat.includes(E)||h&&m.transcoderFormat.length<2||m.needsPowerOfTwo&&!(b(g)&&b(l)))continue;const y=m.transcoderFormat[h?1:0],S=m.engineFormat[h?1:0],_=m.engineType[0];return{transcoderFormat:y,engineFormat:S,engineType:_}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(E){return E<=2?!0:(E&E-1)===0&&E!==0}function f(E){if(E.length===1)return E[0];let g=0;for(let p=0;p<E.length;p++){const C=E[p];g+=C.byteLength}const l=new Uint8Array(g);let h=0;for(let p=0;p<E.length;p++){const C=E[p];l.set(C,h),h+=C.byteLength}return l}};const ys=new Set([I.RGBAFormat,I.RGBFormat,I.RGFormat,I.RedFormat]),nn={[Si]:I.RGBAFormat,[ki]:I.RGFormat,[Qi]:I.RedFormat,[vi]:I.RGBAFormat,[Ri]:I.RGFormat,[Ti]:I.RedFormat,[wi]:I.RGBAFormat,[Bi]:I.RGBAFormat,[yi]:I.RGFormat,[Ci]:I.RGFormat,[bi]:I.RedFormat,[Ii]:I.RedFormat,[Li]:I.RGBFormat,[_i]:I.RGBFormat,[Ki]:I.RGBA_ETC2_EAC_Format,[zi]:I.RGB_ETC2_Format,[un]:I.R11_EAC_Format,[gs]:I.SIGNED_R11_EAC_Format,[hn]:I.RG11_EAC_Format,[ms]:I.SIGNED_RG11_EAC_Format,[Tn]:I.RGBA_ASTC_4x4_Format,[Wi]:I.RGBA_ASTC_4x4_Format,[Vi]:I.RGBA_ASTC_4x4_Format,[tr]:I.RGBA_ASTC_6x6_Format,[Ji]:I.RGBA_ASTC_6x6_Format,[Yi]:I.RGBA_ASTC_6x6_Format,[Fi]:I.RGBA_S3TC_DXT1_Format,[Di]:I.RGBA_S3TC_DXT1_Format,[Ni]:I.RGB_S3TC_DXT1_Format,[xi]:I.RGB_S3TC_DXT1_Format,[Mi]:I.RGBA_S3TC_DXT3_Format,[Oi]:I.RGBA_S3TC_DXT3_Format,[Gi]:I.SIGNED_RED_RGTC1_Format,[Pi]:I.RED_RGTC1_Format,[Hi]:I.SIGNED_RED_GREEN_RGTC2_Format,[Ui]:I.RED_GREEN_RGTC2_Format,[qi]:I.RGBA_BPTC_Format,[ji]:I.RGBA_BPTC_Format,[er]:I.RGBA_PVRTC_4BPPV1_Format,[Zi]:I.RGBA_PVRTC_4BPPV1_Format,[$i]:I.RGBA_PVRTC_2BPPV1_Format,[Xi]:I.RGBA_PVRTC_2BPPV1_Format},mt={[Si]:I.FloatType,[ki]:I.FloatType,[Qi]:I.FloatType,[vi]:I.HalfFloatType,[Ri]:I.HalfFloatType,[Ti]:I.HalfFloatType,[wi]:I.UnsignedByteType,[Bi]:I.UnsignedByteType,[yi]:I.UnsignedByteType,[Ci]:I.UnsignedByteType,[bi]:I.UnsignedByteType,[Ii]:I.UnsignedByteType,[Li]:I.UnsignedInt5999Type,[_i]:I.UnsignedInt101111Type,[Ki]:I.UnsignedByteType,[zi]:I.UnsignedByteType,[un]:I.UnsignedByteType,[un]:I.UnsignedByteType,[hn]:I.UnsignedByteType,[hn]:I.UnsignedByteType,[Tn]:I.HalfFloatType,[Wi]:I.UnsignedByteType,[Vi]:I.UnsignedByteType,[tr]:I.HalfFloatType,[Ji]:I.UnsignedByteType,[Yi]:I.UnsignedByteType,[Fi]:I.UnsignedByteType,[Di]:I.UnsignedByteType,[Ni]:I.UnsignedByteType,[xi]:I.UnsignedByteType,[Mi]:I.UnsignedByteType,[Oi]:I.UnsignedByteType,[Gi]:I.UnsignedByteType,[Pi]:I.UnsignedByteType,[Hi]:I.UnsignedByteType,[Ui]:I.UnsignedByteType,[qi]:I.UnsignedByteType,[ji]:I.UnsignedByteType,[er]:I.UnsignedByteType,[Zi]:I.UnsignedByteType,[$i]:I.UnsignedByteType,[Xi]:I.UnsignedByteType};async function Bs(r){const{vkFormat:e}=r;if(nn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);mt[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;r.supercompressionScheme===jn&&(tn||(tn=new Promise(async s=>{const c=new Is;await c.init(),s(c)})),t=await tn);const n=[];for(let s=0;s<r.levels.length;s++){const c=Math.max(1,r.pixelWidth>>s),A=Math.max(1,r.pixelHeight>>s),a=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,d=r.levels[s];let u;if(r.supercompressionScheme===ls)u=d.levelData;else if(r.supercompressionScheme===jn)u=t.decode(d.levelData,d.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;mt[e]===I.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):mt[e]===I.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):mt[e]===I.UnsignedInt5999Type||mt[e]===I.UnsignedInt101111Type?b=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):b=u,n.push({data:b,width:c,height:A,depth:a})}const i=r.levelCount===0||n.length>1;let o;if(ys.has(nn[e]))o=r.pixelDepth===0?new I.DataTexture(n[0].data,r.pixelWidth,r.pixelHeight):new I.Data3DTexture(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth),o.minFilter=i?I.NearestMipmapNearestFilter:I.NearestFilter,o.magFilter=I.NearestFilter,o.generateMipmaps=r.levelCount===0;else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new I.CompressedTexture(n,r.pixelWidth,r.pixelHeight),o.minFilter=i?I.LinearMipmapLinearFilter:I.LinearFilter,o.magFilter=I.LinearFilter}return o.mipmaps=n,o.type=mt[e],o.format=nn[e],o.colorSpace=nr(r),o.needsUpdate=!0,Promise.resolve(o)}function nr(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===ds?e.transferFunction===qn?I.SRGBColorSpace:I.LinearSRGBColorSpace:e.colorPrimaries===fs?e.transferFunction===qn?bs:Cs:(e.colorPrimaries===hs||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),I.NoColorSpace)}var ir=(function(){var r="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 i=WebAssembly.validate(t)?c(e):c(r),o,s=WebAssembly.instantiate(i,{}).then(function(h){o=h.instance,o.exports.__wasm_call_ctors()});function c(h){for(var p=new Uint8Array(h.length),C=0;C<h.length;++C){var m=h.charCodeAt(C);p[C]=m>96?m-97:m>64?m-39:m+4}for(var y=0,C=0;C<h.length;++C)p[y++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(h,p,C,m,y,S,_){var z=h.exports.sbrk,Q=m+3&-4,M=z(Q*y),N=z(S.length),k=new Uint8Array(h.exports.memory.buffer);k.set(S,N);var D=p(M,m,y,N,S.length);if(D==0&&_&&_(M,Q,y),C.set(k.subarray(M,M+m*y)),z(M-z(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(h){var p={object:new Worker(h),pending:0,requests:{}};return p.object.onmessage=function(C){var m=C.data;p.pending-=m.count,p.requests[m.id][m.action](m.value),delete p.requests[m.id]},p}function E(h){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(i)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),m=URL.createObjectURL(C),y=u.length;y<h;++y)u[y]=f(m);for(var y=h;y<u.length;++y)u[y].object.postMessage({});u.length=h,URL.revokeObjectURL(m)}function g(h,p,C,m,y){for(var S=u[0],_=1;_<u.length;++_)u[_].pending<S.pending&&(S=u[_]);return new Promise(function(z,Q){var M=new Uint8Array(C),N=++b;S.pending+=h,S.requests[N]={resolve:z,reject:Q},S.object.postMessage({id:N,count:h,size:p,source:M,mode:m,filter:y},[M.buffer])})}function l(h){var p=h.data;if(!p.id)return self.close();self.ready.then(function(C){try{var m=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],m,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:m},[m.buffer])}catch(y){self.postMessage({id:p.id,count:p.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(h){E(h)},decodeVertexBuffer:function(h,p,C,m,y){A(o,o.exports.meshopt_decodeVertexBuffer,h,p,C,m,o.exports[a[y]])},decodeIndexBuffer:function(h,p,C,m){A(o,o.exports.meshopt_decodeIndexBuffer,h,p,C,m)},decodeIndexSequence:function(h,p,C,m){A(o,o.exports.meshopt_decodeIndexSequence,h,p,C,m)},decodeGltfBuffer:function(h,p,C,m,y,S){A(o,o.exports[d[y]],h,p,C,m,o.exports[a[S]])},decodeGltfBufferAsync:function(h,p,C,m,y){return u.length>0?g(h,p,C,d[m],a[y]):s.then(function(){var S=new Uint8Array(h*p);return A(o,o.exports[d[m]],S,h,p,C,o.exports[a[y]]),S})}}})();function ws(r){return"morphTargetDictionary"in r&&r.morphTargetDictionary!==void 0&&"morphTargetInfluences"in r&&Array.isArray(r.morphTargetInfluences)}const Ts={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 Rn(r={}){const e={...Ts,...r};let t=new gi;const n=new as;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const i=new $e;i.setTranscoderPath(e.ktx2),i.detectSupport(e.renderer),t.setKTX2Loader(i)}e.meshopt&&t.setMeshoptDecoder(ir),vn=t}let vn=new gi;vn.setMeshoptDecoder(ir);class rn extends En{constructor(e,t){super(e,t)}}class Rs extends Et{gltf;constructor(e){super(e)}async asyncInit(e){if($n(e)){let t=null;this.gltf=await vn.loadAsync(e);const n={},i={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},ws(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 se.Bone&&i.bones&&(i.bones[s.name]=s),s instanceof se.SkinnedMesh&&(i.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]=new rn(i,new Bn(s))}),t?this.syncInit(t,n,o):(t="dummy",n.dummy=new rn(i,new Ln),this.syncInit(t,n,o))}else{const t=new se.BoxGeometry,n=new se.MeshStandardMaterial({color:16711680}),i=new se.Mesh(t,n),o="dummy",s={};s.dummy=new rn({root:i},new Ln),this.syncInit(o,s)}return this}}const rr={camera:void 0,antialias:!1,transparent:!1};class or 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 E}
152
152
  }
153
153
  </style>
154
154
  <slot></slot>
155
- `,this.options={...nr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new se.PerspectiveCamera(75,2,.01,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new vt(this.camera3js)}this.base=new li(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new se.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new se.WebGLRenderer(t),tr({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 hi,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,i=t.contentRect.height;n===0||i===0||(this.renderer.setSize(n,i,!0),this.css2DRenderer.setSize(n,i),vs(this.camera3js)?(this.camera3js.aspect=n/i,this.camera3js.updateProjectionMatrix()):Qs(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 se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new se.Vector2;this.renderer.getSize(n);const i=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:i,y:o}}screenToWorld(e,t,n){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const o=i.sub(this.camera3js.position).normalize();return new te(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return q.v0.set(n),this.worldToScreen(q.v0)}screenToCamera(e,t,n){const i=this.screenToWorld(e,t,n),o=new se.Vector3(i.x,i.y,i.z);return i.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,i=e.target.getBoundingClientRect(),o=e.clientX-i.left,s=e.clientY-i.top;n.x=2*(o/i.width)-1,n.y=-2*(s/i.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 i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("button");s.textContent="OK!",i.appendChild(s),this.shadowRoot.appendChild(i),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n()})})}prompt(e,t){return new Promise(n=>{const i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),i.appendChild(s);const c=document.createElement("button");c.textContent="OK!",i.appendChild(c),this.shadowRoot.appendChild(i),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n(s.value)})})}}customElements.define("canvas-a3",ir);function vs(r){return r.isPerspectiveCamera===!0}function Qs(r){return r.isOrthographicCamera===!0}const rr={width:600,height:300,camera:void 0};class or 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={...rr,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
155
+ `,this.options={...rr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new se.PerspectiveCamera(75,2,.01,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new vt(this.camera3js)}this.base=new wn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new se.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new se.WebGLRenderer(t),Rn({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 pi,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,i=t.contentRect.height;n===0||i===0||(this.renderer.setSize(n,i,!0),this.css2DRenderer.setSize(n,i),vs(this.camera3js)?(this.camera3js.aspect=n/i,this.camera3js.updateProjectionMatrix()):Qs(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 se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new se.Vector2;this.renderer.getSize(n);const i=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:i,y:o}}screenToWorld(e,t,n){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const o=i.sub(this.camera3js.position).normalize();return new te(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return q.v0.set(n),this.worldToScreen(q.v0)}screenToCamera(e,t,n){const i=this.screenToWorld(e,t,n),o=new se.Vector3(i.x,i.y,i.z);return i.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,i=e.target.getBoundingClientRect(),o=e.clientX-i.left,s=e.clientY-i.top;n.x=2*(o/i.width)-1,n.y=-2*(s/i.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 i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("button");s.textContent="OK!",i.appendChild(s),this.shadowRoot.appendChild(i),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n()})})}prompt(e,t){return new Promise(n=>{const i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),i.appendChild(s);const c=document.createElement("button");c.textContent="OK!",i.appendChild(c),this.shadowRoot.appendChild(i),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n(s.value)})})}}customElements.define("canvas-a3",or);function vs(r){return r.isPerspectiveCamera===!0}function Qs(r){return r.isOrthographicCamera===!0}const sr={width:600,height:300,camera:void 0};class ar 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={...sr,...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 E}
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 se.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new vt(this.camera3js)}this.base=new li(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new se.Timer,this.renderer=new se.WebGLRenderer,tr({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const i=this.shadowRoot.querySelector(".content");i.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new hi,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",i.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 i=Math.floor(t),o=Math.floor(n);(this._canvas.width!==i||this._canvas.height!==o)&&(this._canvas.width=i,this._canvas.height=o,ks(this.camera3js)?(this.camera3js.aspect=i/o,this.camera3js.updateProjectionMatrix()):_s(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(i,o),this.css2DRenderer.setSize(i,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,i=e.clientY-t.top,o=this._borderSize;let s="";i<o?s+="n":i>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 se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new se.Vector2;this.renderer.getSize(n);const i=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:i,y:o}}screenToWorld(e,t,n){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const o=i.sub(this.camera3js.position).normalize();return new te(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return q.v0.set(n),this.worldToScreen(q.v0)}screenToCamera(e,t,n){const i=this.screenToWorld(e,t,n),o=new se.Vector3(i.x,i.y,i.z);return i.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,i=e.target.getBoundingClientRect(),o=e.clientX-i.left,s=e.clientY-i.top;n.x=2*(o/i.width)-1,n.y=-2*(s/i.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 i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("button");s.textContent="OK!",i.appendChild(s),this.shadowRoot.appendChild(i),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n()})})}prompt(e,t){return new Promise(n=>{const i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),i.appendChild(s);const c=document.createElement("button");c.textContent="OK!",i.appendChild(c),this.shadowRoot.appendChild(i),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n(s.value)})})}}customElements.define("window-a3",or);function ks(r){return r.isPerspectiveCamera===!0}function _s(r){return r.isOrthographicCamera===!0}const Ss=`
199
+ `,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new se.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new vt(this.camera3js)}this.base=new wn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new se.Timer,this.renderer=new se.WebGLRenderer,Rn({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const i=this.shadowRoot.querySelector(".content");i.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new pi,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",i.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 i=Math.floor(t),o=Math.floor(n);(this._canvas.width!==i||this._canvas.height!==o)&&(this._canvas.width=i,this._canvas.height=o,ks(this.camera3js)?(this.camera3js.aspect=i/o,this.camera3js.updateProjectionMatrix()):Ss(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(i,o),this.css2DRenderer.setSize(i,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,i=e.clientY-t.top,o=this._borderSize;let s="";i<o?s+="n":i>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 se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new se.Vector2;this.renderer.getSize(n);const i=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:i,y:o}}screenToWorld(e,t,n){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const o=i.sub(this.camera3js.position).normalize();return new te(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return q.v0.set(n),this.worldToScreen(q.v0)}screenToCamera(e,t,n){const i=this.screenToWorld(e,t,n),o=new se.Vector3(i.x,i.y,i.z);return i.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,i=e.target.getBoundingClientRect(),o=e.clientX-i.left,s=e.clientY-i.top;n.x=2*(o/i.width)-1,n.y=-2*(s/i.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 i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("button");s.textContent="OK!",i.appendChild(s),this.shadowRoot.appendChild(i),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n()})})}prompt(e,t){return new Promise(n=>{const i=document.createElement("div");i.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,i.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),i.appendChild(s);const c=document.createElement("button");c.textContent="OK!",i.appendChild(c),this.shadowRoot.appendChild(i),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(i),n(s.value)})})}}customElements.define("window-a3",ar);function ks(r){return r.isPerspectiveCamera===!0}function Ss(r){return r.isOrthographicCamera===!0}const _s=`
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 E}
205
205
  font-family: sans-serif;
206
206
  font-size: 14px;
207
207
  pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
208
- `,Hn={testMode:!0};class Ls extends Pe{constructor(e={}){super(e);const t={...Hn,...e};this.setTransformer(new jn(t))}initObject(){const e=new se.BoxGeometry,t=new se.MeshStandardMaterial({color:65280}),n=new se.Mesh(e,t),i=document.createElement("div");i.textContent="Hello Box!",i.style.cssText=Ss;const o=new ui(i);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=Ot(Hn,e);return new jn(t)}}class jn extends Tt{testMode=!0;rot=new te;constructor(e){super(),this.testMode=e.testMode}update(e){if(super.update(e),this.testMode){this.rot.add(e,e,e);const t=ht(this.rot);this.trans.quat.set(t)}}}class xs extends I.Loader{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new I.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,i)}parse(e){return new sr(e)}}class sr{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const i=[],o=Ns(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)i.push(...o[s].toShapes());return i}}function Ns(r,e,t,n){const i=Array.from(r),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&i.reverse();for(let d=0;d<i.length;d++){const u=i[d];if(u===`
209
- `)A=0,a-=s;else{const b=Ds(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=b.offsetX,c.push(b.path)}}return c}function Ds(r,e,t,n,i){const o=i.glyphs[r]||i.glyphs["?"];if(!o){console.error('THREE.Font: character "'+r+'" does not exists in font family '+i.familyName+".");return}const s=new I.ShapePath;let c,A,a,d,u,b,f,E;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,b=g[l++]*e+n,s.quadraticCurveTo(u,b,a,d);break;case"b":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,b=g[l++]*e+n,f=g[l++]*e+t,E=g[l++]*e+n,s.bezierCurveTo(u,b,f,E,a,d);break}}return{offsetX:o.ha*e,path:s}}class Fs extends I.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const i=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(i,t)}this.type="TextGeometry"}}let Ft=null;async function Os(r){if(r.match(/.zip$/i)){let e=r.substring(r.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await Yn(r),n=xt(t,e);Ft=new sr(JSON.parse(n))}else Ft=await new xs().loadAsync(r)}class Ms extends Pe{initObject(e){let t;if(Wn(e)?t=e:t="ERROR",Ft==null){const n=new se.BoxGeometry,i=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,i)}else{const n={font:Ft,size:1,depth:.5,curveSegments:12},i=new Fs(t,n);i.center();const o=new se.MeshStandardMaterial({color:65280});return new se.Mesh(i,o)}}}class Ps extends Pe{constructor(e){super(e)}initObject(e){return e}}class Gs extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),i=new se.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(i,s)}}class Us extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),i=new se.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(i,s)}}class Hs extends Pe{constructor(){super()}initObject(){const e=new se.Object3D,t=new se.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new se.AmbientLight(4210752);return e.add(n),e}}class js extends Pe{constructor(e){super(e)}initObject(e){const t=new se.PlaneGeometry(1,1),n=new se.TextureLoader().load(e),i=new se.MeshBasicMaterial({map:n});return new se.Mesh(t,i)}}class qs extends Pe{constructor(e){super(e)}initObject(e){return new ui(e)}}const ar={touchDevice:navigator.maxTouchPoints>0};class Ar extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...ar,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
208
+ `,fn={testMode:!0};class Ls extends Pe{constructor(e={}){super(e);const t={...fn,...e};this.setTransformer(new Vn(t))}initObject(){const e=new se.BoxGeometry,t=new se.MeshStandardMaterial({color:65280}),n=new se.Mesh(e,t),i=document.createElement("div");i.textContent="Hello Box!",i.style.cssText=_s;const o=new fi(i);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=Ot(fn,e);return new Vn(t)}}class Vn extends Tt{testMode=!0;rot=new te;constructor(e){super(),this.testMode=e.testMode}update(e){if(super.update(e),this.testMode){this.rot.add(e,e,e);const t=ht(this.rot);this.transform.quat.set(t)}}}class xs extends I.Loader{constructor(e){super(e)}load(e,t,n,i){const o=this,s=new I.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,i)}parse(e){return new Ar(e)}}class Ar{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const i=[],o=Ns(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)i.push(...o[s].toShapes());return i}}function Ns(r,e,t,n){const i=Array.from(r),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&i.reverse();for(let d=0;d<i.length;d++){const u=i[d];if(u===`
209
+ `)A=0,a-=s;else{const b=Ds(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=b.offsetX,c.push(b.path)}}return c}function Ds(r,e,t,n,i){const o=i.glyphs[r]||i.glyphs["?"];if(!o){console.error('THREE.Font: character "'+r+'" does not exists in font family '+i.familyName+".");return}const s=new I.ShapePath;let c,A,a,d,u,b,f,E;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,b=g[l++]*e+n,s.quadraticCurveTo(u,b,a,d);break;case"b":a=g[l++]*e+t,d=g[l++]*e+n,u=g[l++]*e+t,b=g[l++]*e+n,f=g[l++]*e+t,E=g[l++]*e+n,s.bezierCurveTo(u,b,f,E,a,d);break}}return{offsetX:o.ha*e,path:s}}class Fs extends I.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const i=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(i,t)}this.type="TextGeometry"}}let Ft=null;async function Os(r){if(r.match(/.zip$/i)){let e=r.substring(r.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await ei(r),n=xt(t,e);Ft=new Ar(JSON.parse(n))}else Ft=await new xs().loadAsync(r)}class Ms extends Pe{initObject(e){let t;if($n(e)?t=e:t="ERROR",Ft==null){const n=new se.BoxGeometry,i=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,i)}else{const n={font:Ft,size:1,depth:.5,curveSegments:12},i=new Fs(t,n);i.center();const o=new se.MeshStandardMaterial({color:65280});return new se.Mesh(i,o)}}}class Ps extends Pe{constructor(e){super(e)}initObject(e){return e}}class Gs extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),i=new se.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(i,s)}}class Us extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),i=new se.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(i,s)}}class Hs extends Pe{constructor(){super()}initObject(){const e=new se.Object3D,t=new se.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new se.AmbientLight(4210752);return e.add(n),e}}class js extends Pe{constructor(e){super(e)}initObject(e){const t=new se.PlaneGeometry(1,1),n=new se.TextureLoader().load(e),i=new se.MeshBasicMaterial({map:n});return new se.Mesh(t,i)}}class qs extends Pe{constructor(e){super(e)}initObject(e){return new fi(e)}}const cr={touchDevice:navigator.maxTouchPoints>0};class lr extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...cr,...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 E}
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 b=Math.atan2(A,c);d=Math.cos(b)*this._maxDistance,u=Math.sin(b)*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 b=Math.atan2(A,c);d=Math.cos(b)*this._maxDistance,u=Math.sin(b)*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 i=this.shadowRoot.querySelector(".btn.left");if(!i)return;i.addEventListener("pointerdown",()=>{this.leftButton=!0}),i.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,i=t.contentRect.height;if(!(n===0||i===0))if(n>i){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 i=Math.sqrt(t.x*t.x+t.y*t.y);i>0&&(t.x/=i,t.y/=i),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",Ar);const cr={offset:.01,auto:!0,height:1.5,radius:.3};class zs{trans;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOptions={...cr,...e},this.trans=new qe,this.capsuleCenter=new te,this.nextLocation=new te,this.tmpV1=new te,this.tmpV2=new te}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,i=new se.Quaternion,o=new se.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(i),o.quaternion.set(i.x,i.y,i.z,i.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.Box3().setFromObject(o);o.remove(t.object),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=He.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))}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new te),e.set(0,0,0),e}setAngvel(e){}getAngvel(e){return e||(e=new te),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.trans.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.trans.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const lr={auto:!0,height:1.5,radius:.3};class Ks{trans;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;physicsWorld;constructor(e={}){this.completeOptions={...lr,...e},this.trans=new qe,this.capsuleCenter=new te,this.nextLocation=new te,this.tmpV1=new te,this.tmpV2=new te}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,i=new se.Quaternion,o=new se.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(i),o.quaternion.set(i.x,i.y,i.z,i.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.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=He.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w}),this.colliderDesc=He.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.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}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(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)}getLinvel(e){return e||(e=new te),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(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})}getAngvel(e){return e||(e=new te),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 He.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.trans.loc.y<=0}update(e){if(!this.body)return;const t=new te(this.body.translation());t.sub(this.capsuleCenter),this.trans.loc.set(t),this.trans.quat.set(this.body.rotation())}}const ur={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 Vs{opt;trans;motion;constructor(e){this.opt={...ur,...e},this.trans=new hr(this),this.motion=new dr(this)}handle(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerator(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 hr{cc;trans;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.trans=new qe}init(e,t){this.trans.set(e),this.objectA3=t,this.chassisBodyDesc=new He.RigidBodyDesc(He.RigidBodyType.Dynamic),this.chassisColliderDesc=He.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))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new te),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngvel(e){}getAngvel(e){return e||(e=new te),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 te;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new te(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.trans.loc.set(this.chassisBody.translation()),this.chassisBody&&this.trans.quat.set(this.chassisBody.rotation())}}class dr{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 te(this.cm.trans.chassisBody.translation()),i=new Te(this.cm.trans.chassisBody.rotation()).clone().conjugate(),o=new te(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Te(this.cm.trans.chassisBody.rotation());s.mul(i);const c=new Te,A=new te,a=new Te;{const l=new te(this.cm.opt.wheelFrontAxle),h=new te(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(0)||0,C=this.cm.trans.controller.wheelSteering(0)||0,m=this.cm.trans.controller.wheelRotation(0)||0;A.set(h),A.sub(0,p,0),a.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),a.mul(c)}const d=new te,u=new Te;{const l=new te(this.cm.opt.wheelFrontAxle),h=new te(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(1)||0,C=this.cm.trans.controller.wheelSteering(1)||0,m=this.cm.trans.controller.wheelRotation(1)||0;d.set(h),d.sub(0,p,0),u.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),u.mul(c)}const b=new te,f=new Te;{const l=new te(this.cm.opt.wheelRearAxle),h=new te(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(2)||0,C=this.cm.trans.controller.wheelSteering(2)||0,m=this.cm.trans.controller.wheelRotation(2)||0;b.set(h),b.sub(0,p,0),f.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),f.mul(c)}const E=new te,g=new Te;{const l=new te(this.cm.opt.wheelRearAxle),h=new te(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(3)||0,C=this.cm.trans.controller.wheelSteering(3)||0,m=this.cm.trans.controller.wheelRotation(3)||0;E.set(h),E.sub(0,p,0),g.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),g.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:d,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:E,quat:g},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=oi;exports.ActionObject=Et;exports.AvatarController=wo;exports.AvatarController2=Ro;exports.Box=Gs;exports.Camera=Ai;exports.Canvas=ir;exports.CarControl=Vs;exports.CarMotion=dr;exports.CarTransformer=hr;exports.CharacterTransformer=zs;exports.CharacterTransformer2=Ks;exports.ClipMotion=bn;exports.ControllerBase=jt;exports.DefaultTransformer=Tt;exports.FixedTransformer=zn;exports.FollowTransformer=Tr;exports.GLTF=Rs;exports.GameCanvas=Ar;exports.GeneralCamera=vt;exports.HTML=qs;exports.Image=js;exports.ObjectA3=Pe;exports.OrbitController=ci;exports.Quat=Te;exports.RapierPhysicsEngine=Rt;exports.RapierPhysicsWorld=pn;exports.Scene=ai;exports.Sound=st;exports.Sphere=Us;exports.StandardLights=Hs;exports.Test=Ls;exports.Text3D=Ms;exports.ThreeJS=Ps;exports.Transform=qe;exports.Vec3=te;exports.Window=or;exports.asyncSleep=Mr;exports.collisionMap=nt;exports.deepMerge=Ot;exports.defaultCanvasOptions=nr;exports.defaultCarControlOptions=ur;exports.defaultCharacterTrans2Options=lr;exports.defaultCharacterTransOptions=cr;exports.defaultFollowTransformerOptions=Vn;exports.defaultGameCanvasOptions=ar;exports.defaultWindowOptions=rr;exports.getQuatOfLookAt=at;exports.initFont=Os;exports.initPhysics=Or;exports.initSound=yo;exports.vec3EulerToQuat=ht;
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 b=Math.atan2(A,c);d=Math.cos(b)*this._maxDistance,u=Math.sin(b)*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 b=Math.atan2(A,c);d=Math.cos(b)*this._maxDistance,u=Math.sin(b)*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 i=this.shadowRoot.querySelector(".btn.left");if(!i)return;i.addEventListener("pointerdown",()=>{this.leftButton=!0}),i.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,i=t.contentRect.height;if(!(n===0||i===0))if(n>i){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 i=Math.sqrt(t.x*t.x+t.y*t.y);i>0&&(t.x/=i,t.y/=i),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",lr);const ur={offset:.01,auto:!0,height:1.5,radius:.3};class zs{transform;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOptions={...ur,...e},this.transform=new qe,this.capsuleCenter=new te,this.nextLocation=new te,this.tmpV1=new te,this.tmpV2=new te}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new se.Vector3,i=new se.Quaternion,o=new se.Object3D;o.add(t.object3D),t.transformer.transform.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.transform.quat.write(i),o.quaternion.set(i.x,i.y,i.z,i.w),t.transformer.transform.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.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=He.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 te),e.set(0,0,0),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new te),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 hr={auto:!0,height:1.5,radius:.3};class Ks{transform;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;physicsWorld;constructor(e={}){this.completeOptions={...hr,...e},this.transform=new qe,this.capsuleCenter=new te,this.nextLocation=new te,this.tmpV1=new te,this.tmpV2=new te}init(e,t){if(this.transform.set(e),this.completeOptions.auto){const n=new se.Vector3,i=new se.Quaternion,o=new se.Object3D;o.add(t.object3D),t.transformer.transform.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.transform.quat.write(i),o.quaternion.set(i.x,i.y,i.z,i.w),t.transformer.transform.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.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=He.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w}),this.colliderDesc=He.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.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.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){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 te),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 te),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 He.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 te(this.body.translation());t.sub(this.capsuleCenter),this.transform.loc.set(t),this.transform.quat.set(this.body.rotation())}}const dr={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 Vs{opt;trans;motion;constructor(e){this.opt={...dr,...e},this.trans=new fr(this),this.motion=new pr(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 fr{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 He.RigidBodyDesc(He.RigidBodyType.Dynamic),this.chassisColliderDesc=He.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 te),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new te),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 te;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new te(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 pr{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 te(this.cm.trans.chassisBody.translation()),i=new Te(this.cm.trans.chassisBody.rotation()).clone().conjugate(),o=new te(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Te(this.cm.trans.chassisBody.rotation());s.mul(i);const c=new Te,A=new te,a=new Te;{const l=new te(this.cm.opt.wheelFrontAxle),h=new te(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(0)||0,C=this.cm.trans.controller.wheelSteering(0)||0,m=this.cm.trans.controller.wheelRotation(0)||0;A.set(h),A.sub(0,p,0),a.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),a.mul(c)}const d=new te,u=new Te;{const l=new te(this.cm.opt.wheelFrontAxle),h=new te(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(1)||0,C=this.cm.trans.controller.wheelSteering(1)||0,m=this.cm.trans.controller.wheelRotation(1)||0;d.set(h),d.sub(0,p,0),u.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),u.mul(c)}const b=new te,f=new Te;{const l=new te(this.cm.opt.wheelRearAxle),h=new te(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(2)||0,C=this.cm.trans.controller.wheelSteering(2)||0,m=this.cm.trans.controller.wheelRotation(2)||0;b.set(h),b.sub(0,p,0),f.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),f.mul(c)}const E=new te,g=new Te;{const l=new te(this.cm.opt.wheelRearAxle),h=new te(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(3)||0,C=this.cm.trans.controller.wheelSteering(3)||0,m=this.cm.trans.controller.wheelRotation(3)||0;E.set(h),E.sub(0,p,0),g.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),g.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:d,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:E,quat:g},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=ci;exports.Action=En;exports.ActionObject=Et;exports.AvatarPositionController=wo;exports.AvatarVelocityController=Ro;exports.BaseController=jt;exports.BaseView=wn;exports.BillboardTransformer=Jn;exports.Box=Gs;exports.Camera=hi;exports.Canvas=or;exports.CarControl=Vs;exports.CarMotion=pr;exports.CarTransformer=fr;exports.ClipMotion=Bn;exports.DefaultTransformer=Tt;exports.DynamicCharacterTransformer=Ks;exports.FollowTransformer=Tr;exports.GLTF=Rs;exports.GameCanvas=lr;exports.Html3D=qs;exports.ImagePlane=js;exports.KinematicCharacterTransformer=zs;exports.ObjectA3=Pe;exports.OrbitController=di;exports.Quat=Te;exports.RapierPhysicsEngine=Rt;exports.RapierPhysicsWorld=mn;exports.SampleObject=Ls;exports.Scene=ui;exports.SmoothBillboardTransformer=Xn;exports.SmoothTransformer=pn;exports.Sound=st;exports.Sphere=Us;exports.StandardLights=Hs;exports.StaticTransformer=Yn;exports.Text3D=Ms;exports.ThreeCamera=vt;exports.ThreeObject=Ps;exports.Transform=qe;exports.Vec3=te;exports.Window=ar;exports.asyncSleep=Mr;exports.collisionMap=nt;exports.deepMerge=Ot;exports.defaultCanvasOptions=rr;exports.defaultCarControlOptions=dr;exports.defaultDynamicCharacterTransformerOptions=hr;exports.defaultFollowTransformerOptions=Zn;exports.defaultGameCanvasOptions=cr;exports.defaultKinematicCharacterTransformerOptions=ur;exports.defaultSampleObjectOptions=fn;exports.defaultWindowOptions=sr;exports.eulerToQuaternion=ht;exports.getLookAtQuaternion=at;exports.initFont=Os;exports.initPhysics=Or;exports.initSound=yo;exports.recreateGLTFLoader=Rn;
293
293
  //# sourceMappingURL=a3js.cjs.js.map