a3js 0.0.32 → 0.0.34
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 +72 -72
- package/dist/a3js.cjs.js.map +1 -1
- package/dist/a3js.es.js +5413 -4992
- package/dist/a3js.es.js.map +1 -1
- package/package.json +1 -1
package/dist/a3js.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Zi=Object.create;var hn=Object.defineProperty;var $i=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty;var ir=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of er(e))!nr.call(i,r)&&r!==t&&hn(i,r,{get:()=>e[r],enumerable:!(n=$i(e,r))||n.enumerable});return i};var rr=(i,e,t)=>(t=i!=null?Zi(tr(i)):{},ir(e||!i||!i.__esModule?hn(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("three"),_n=require("fflate");function or(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const se=or(I);class Ae{_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 Ae(this)}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t):console.warn("Vec3.normalize."),this}negate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}set(e,t,n){return typeof e=="number"?(this._x=e,this._y=t,this._z=n):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,n){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=n):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=n):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,n,r){const s=new be;typeof e=="number"?s.set(e,t,n,r):s.set(e);const o=new be(this._x,this._y,this._z,0),c=new be(s).conjugate();return s.mul(o).mul(c),this._x=s.x,this._y=s.y,this._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}}class be{_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,r){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):typeof e>"u"?(this._x=this._y=this._z=0,this._w=1):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w)}clone(){return new be(this)}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t,this._w/=t):console.warn("Quat.normalize."),this}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}set(e,t,n,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,r){const s=new be(this),o=new be;return typeof e=="number"?o.set(e,t,n,r):o.set(e),this._x=s.w*o.x+s.x*o.w+s.y*o.z-s.z*o.y,this._y=s.w*o.y-s.x*o.z+s.y*o.w+s.z*o.x,this._z=s.w*o.z+s.x*o.y-s.y*o.x+s.z*o.w,this._w=s.w*o.w-s.x*o.x-s.y*o.y-s.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,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}const r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(r<.9995){const s=Math.acos(r),o=Math.sin((1-n)*s)/Math.sin(s),c=Math.sin(n*s)/Math.sin(s);this._x=o*e.x+c*t.x,this._y=o*e.y+c*t.y,this._z=o*e.z+c*t.z,this._w=o*e.w+c*t.w}else{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;const s=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);s<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/s,this._y*=1/s,this._z*=1/s,this._w*=1/s)}}}function et(i,e,t){t.normalize();const n=i.clone().sub(e).normalize(),r=new Ae().cross(n,t).normalize(),s=new Ae().cross(r,n),o=r.x,c=s.x,A=-n.x,a=r.y,d=s.y,u=-n.y,b=r.z,f=s.z,m=-n.z,E=o+d+m;if(E>0){const l=Math.sqrt(E+1)*2;return new be((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(o>d&&o>m){const l=Math.sqrt(1+o-d-m)*2;return new be(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(d>m){const l=Math.sqrt(1+d-o-m)*2;return new be((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+m-o-d)*2;return new be((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function At(i,e="XYZ"){const t=new be(0,0,0,1);for(let n=0;n<3;n++)switch(e.charAt(n)){case"X":t.mul(new be(Math.sin(i.x),0,0,Math.cos(i.x)));break;case"Y":t.mul(new be(0,Math.sin(i.y),0,Math.cos(i.y)));break;case"Z":t.mul(new be(0,0,Math.sin(i.z),Math.cos(i.z)));break}return t}class He{loc;quat;scale;constructor(){this.loc=new Ae,this.quat=new be,this.scale=new Ae(1,1,1)}set(e){if(e instanceof He)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 _e?(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 He;return e.set(this),e}}class Et{trans;constructor(){this.trans=new He}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){}setAngvel(e){}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class sr{trans;constructor(){this.trans=new He}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){}setAngvel(e){}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class xn{firstTrans;trans;lastTrans;nowTime;duration;constructor(){this.firstTrans=new He,this.trans=new He,this.lastTrans=new He,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){}setAngvel(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 wt=new Ae,Tt=new Ae;class ar extends Et{up;target;constructor(e){super(),this.up=new Ae(0,1,0),this.target=e}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=_e.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){wt.set(this.trans.loc),Tt.set(this.target.trans.loc);const t=et(wt,Tt,this.up);this.trans.quat.set(t)}}class Ar extends xn{up;target;constructor(e){super(),this.up=new Ae(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=_e.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),wt.set(this.trans.loc),Tt.set(this.target.trans.loc);const t=et(wt,Tt,this.up);this.trans.quat.set(t)}}const Vt={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function Nn(i){return typeof i=="string"}function tn(i){return i.isMesh===!0}function cr(i){return i.type==="RoundedBoxGeometry"}function lr(i){return i.type==="BoxGeometry"}function ur(i){return i.type==="SphereGeometry"}function hr(i){return i.type==="IcosahedronGeometry"}function dr(i){return i.type==="CylinderGeometry"}function fr(i){return i.type==="CapsuleGeometry"}function pr(i){return i.isBone===!0}function gr(i){return i.isPerspectiveCamera===!0}let Ge;const it=new Map;class mt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!mt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),mt.RAPIER=e,Ge=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOption(e)&&(t=e.timestep);const n=new Ge.World(e.gravity);return new nn(n,t)}isRapierWorldOption(e){return"timestep"in e}}class nn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new Ge.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let n=0;n<t;n++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{const s=it.get(t),o=it.get(n);s&&o&&e.push({objectA:s,partOfA:t,objectB:o,partOfB:n,started:r})}),e}}class dn{trans;objectA3;bodyDesc;body;colliderDescs;colliders;completeOption;constructor(e={}){this.completeOption={...Vt,...e},this.trans=new He,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOption.rigidBody){case"dynamic":e=Ge.RigidBodyDesc.dynamic();break;case"kinematic":e=Ge.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=Ge.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.completeOption,t=[];this.objectA3.object.traverse(r=>{if(tn(r)){const s=Ir(r.geometry),o=e.membership<<16|e.filter;if(s)s.colliderDesc.setCollisionGroups(o),e.collisionDetection&&s.colliderDesc.setActiveEvents(Ge.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(s.colliderDesc),s.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(s.volume);else{let c,A;switch(e.meshCollider){case"tri_mesh":c=Er(r),A=fn(r.geometry);break;case"convex_hull":c=mr(r),A=fn(r.geometry);break}c&&(c.setCollisionGroups(o),e.collisionDetection&&c.setActiveEvents(Ge.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((r,s)=>r+s,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.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&&it.set(n.handle,this.objectA3)}))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),it.delete(t.handle)})}isGrounded(){return this.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)}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})}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 Er(i){let e=null;if(tn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let s=n.index?n.index.array:null;if(s)s instanceof Uint32Array||(s=new Uint32Array(s));else{const o=n.attributes.position.count;s=new Uint32Array(o);for(let c=0;c<o;c++)s[c]=c}r instanceof Float32Array&&(e=Ge.ColliderDesc.trimesh(r,s))}return e}function mr(i){let e=null;if(tn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=Ge.ColliderDesc.convexHull(r))}return e}function fn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const s=new se.Vector3,o=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;s.set(n[d],n[d+1],n[d+2]),o.set(n[u],n[u+1],n[u+2]),c.set(n[b],n[b+1],n[b+2]),r+=s.dot(o.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)s.set(n[A],n[A+1],n[A+2]),o.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=s.dot(o.clone().cross(c));return Math.abs(r)/6}function Ir(i){if(cr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,s=.1;return{colliderDesc:Ge.ColliderDesc.roundCuboid(t-s,n-s,r-s,s),volume:2*t*2*n*2*r}}else if(lr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:Ge.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(ur(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ge.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(hr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ge.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(dr(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ge.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(fr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ge.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const Yt=new mt;async function br(){await Yt.init()}const U={v0:new Ae,v1:new Ae,v2:new Ae,v3:new Ae,v4:new Ae,q0:new be,q1:new be,q2:new be,q3:new be,q4:new be,t0:new He,t1:new He,t2:new He,t3:new He,t4:new He};function Cr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function Dn(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,s)=>{_n.unzip(new Uint8Array(t),(o,c)=>{o?s(o):r(c)})});return{zipUrl:i,unzipped:n}}function rn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return _n.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function Fn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=Br(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const yr={"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 Br(i){for(const[e,t]of Object.entries(yr))if(t.test(i))return e;return"application/octet-stream"}function Rt(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=Rt(i[n],e[n]):t[n]=e[n];return t}const wr=new se.SphereGeometry,Tr=new se.MeshStandardMaterial({color:16711680});let vr=new se.Mesh(wr,Tr);class _e{static defaultRotationOrder="XYZ";static defaultUpVector=new Ae(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 vr.clone()}initTransformer(e){return new Et}setTransformer(e){U.t0.set(this.transformer.trans),e.init(U.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new Et);else if(e==="Interpolation")this.setTransformer(new xn);else if(e==="Billboard")this.setTransformer(new ar(t));else if(e==="InterpolationBillboard")this.setTransformer(new Ar(t));else if(e==="SimplePhysics"){const n={...Vt,...t};this.setTransformer(new dn(n))}}initSimplePhysics(e){const t={...Vt,...e};this.setTransformer(new dn(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 Rr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}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"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setLocation(U.v0)}setLocationNow(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setLocationNow(U.v0)}get quat(){return this.trans.quat}setQuat(e,t,n,r){typeof e=="number"?U.q0.set(e,t,n,r):U.q0.set(e),this.transformer.setQuat(U.q0)}setQuatNow(e,t,n,r){typeof e=="number"?U.q0.set(e,t,n,r):U.q0.set(e),this.transformer.setQuatNow(U.q0)}get scale(){return this.trans.scale}setScale(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setScale(U.v0)}setScaleNow(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setScaleNow(U.v0)}setRotation(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):r.set(e),r.scale(Math.PI/360);const s=this.rotationOrder?this.rotationOrder:_e.defaultRotationOrder,o=At(r,s);this.setQuat(o)}setRotationNow(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):r.set(e);const s=this.rotationOrder?this.rotationOrder:_e.defaultRotationOrder,o=new be(0,0,0,1);for(let c=0;c<3;c++)switch(s.charAt(c)){case"X":o.mul(new be(Math.sin(r.x),0,0,Math.cos(r.x)));break;case"Y":o.mul(new be(0,Math.sin(r.y),0,Math.cos(r.y)));break;case"Z":o.mul(new be(0,0,Math.sin(r.z),Math.cos(r.z)));break}this.setQuatNow(o)}lookAt(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof _e?r.set(e.loc):r.set(e);const s=this.upVector?this.upVector:_e.defaultUpVector,o=et(this.loc,r,s);this.setQuat(o)}lookAtNow(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof _e?r.set(e.loc):r.set(e);const s=this.upVector?this.upVector:_e.defaultUpVector,o=et(this.loc,r,s);this.setQuatNow(o)}getUnitVecX(){return new Ae(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Ae(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Ae(0,0,1).apply(this.object.quaternion)}addLocation(e,t,n){const r=new Ae;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocation(r)}addLocationNow(e,t,n){const r=new Ae;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocationNow(r)}mulQuat(e,t,n,r){const s=new be;s.set(this.quat),typeof e=="number"?s.mul(e,t,n,r):s.mul(e),this.setQuat(s)}mulQuatNow(e,t,n,r){const s=new be;s.set(this.quat),typeof e=="number"?s.mul(e,t,n,r):s.mul(e),this.setQuatNow(s)}mulRotation(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),U.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:_e.defaultRotationOrder,s=At(U.v0,r);U.q0.set(this.quat),U.q0.mul(s),this.setQuat(U.q0)}mulRotationNow(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),U.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:_e.defaultRotationOrder,s=At(U.v0,r);U.q0.set(this.quat),U.q0.mul(s),this.setQuatNow(U.q0)}mulScale(e,t,n){U.v0.set(this.scale),typeof e=="number"?U.v0.set(U.v0.x*e,U.v0.y*t,U.v0.z*n):U.v0.set(U.v0.x*e.x,U.v0.y*e.y,U.v0.z*e.z),this.setScale(U.v0)}mulScaleNow(e,t,n){U.v0.set(this.scale),typeof e=="number"?U.v0.set(U.v0.x*e,U.v0.y*t,U.v0.z*n):U.v0.set(U.v0.x*e.x,U.v0.y*e.y,U.v0.z*e.z),this.setScaleNow(U.v0)}moveForward(e){U.v0.set(this.getUnitVecZ()),U.v0.scale(e),this.addLocation(U.v0)}moveForwardNow(e){U.v0.set(this.getUnitVecZ()),U.v0.scale(e),this.addLocationNow(U.v0)}moveBackward(e){U.v0.set(this.getUnitVecZ()),U.v0.scale(-e),this.addLocation(U.v0)}moveBackwardNow(e){U.v0.set(this.getUnitVecZ()),U.v0.scale(-e),this.addLocationNow(U.v0)}moveRight(e){U.v0.set(this.getUnitVecX()),U.v0.scale(-e),this.addLocation(U.v0)}moveRightNow(e){U.v0.set(this.getUnitVecX()),U.v0.scale(-e),this.addLocationNow(U.v0)}moveLeft(e){U.v0.set(this.getUnitVecX()),U.v0.scale(e),this.addLocation(U.v0)}moveLeftNow(e){U.v0.set(this.getUnitVecX()),U.v0.scale(e),this.addLocationNow(U.v0)}moveUp(e){U.v0.set(this.getUnitVecY()),U.v0.scale(e),this.addLocation(U.v0)}moveUpNow(e){U.v0.set(this.getUnitVecY()),U.v0.scale(e),this.addLocationNow(U.v0)}moveDown(e){U.v0.set(this.getUnitVecY()),U.v0.scale(-e),this.addLocation(U.v0)}moveDownNow(e){U.v0.set(this.getUnitVecY()),U.v0.scale(-e),this.addLocationNow(U.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"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setLinvel(U.v0)}setAngvel(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setAngvel(U.v0)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.addForce(U.v0)}addForceAtPoint(e,t,n,r,s,o){if(typeof e=="number")if(typeof t=="number")U.v0.set(e,t,n),U.v1.set(r,s,o);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 U.v0.set(e),U.v1.set(t);this.transformer.addForceAtPoint(U.v0,U.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.addTorque(U.v0)}applyImpulse(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.applyImpulse(U.v0)}applyImpulseAtPoint(e,t,n,r,s,o){if(typeof e=="number")if(typeof t=="number")U.v0.set(e,t,n),U.v1.set(r,s,o);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 U.v0.set(e),U.v1.set(t);this.transformer.applyImpulseAtPoint(U.v0,U.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?U.v0.set(e,t,n):U.v0.set(e),this.transformer.applyTorqueImpulse(U.v0)}isGrounded(){return this.transformer.isGrounded()}}class Rr{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}}}const Qr={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function kr(){try{nt.listener.context.state!=="running"&&await nt.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class nt extends _e{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;config;sound;constructor(e,t={}){super(),this.config=Rt(Qr,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.config.type==="positional"){const t=new se.PositionalAudio(nt.listener);t.setRefDistance(this.config.positional.refDistance),t.setMaxDistance(this.config.positional.maxDistance),t.setRolloffFactor(this.config.positional.rolloffFactor);const n=this.config.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}else{const t=new se.Audio(nt.listener);t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{nt.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class It extends _e{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.object.add(this.currentAction.shape.root),this.morphs=n}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.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0){if(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.currentAction?.shape.root&&this.object.remove(this.currentAction.shape.root),this.currentAction?.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.emoteAction=void 0,this.stateAction&&(this.object.add(this.stateAction.shape.root),this.currentAction=this.stateAction,this.stateAction.sound))){const n=this.stateAction.sound;n.play(),this.stateAction.motion.setFinishListener(()=>{n.play()})}}else this.stateAction&&(t=this.stateAction.motion.update(e));if(t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const s=this.currentAction.shape.bones[n];if(s&&(r.loc&&s.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&s.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&s.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.morphsOverwrite&&r.morphs){for(const o of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(o.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=o.vals[a];break}}}this.object.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class pn{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{}}}class On{scene;objects;avatar;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],Yt.isInitialized&&(this.physicsWorld=Yt.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 It))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld)}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 It))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld)}setAvatar(e){this.avatar=e}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 nn){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(r,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 Mn extends _e{controller;setController(e){this.controller=e}setLocation(e,t,n){const r=new Ae;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocation(r):super.setLocation(r)}setLocationNow(e,t,n){const r=new Ae;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocationNow(r):super.setLocationNow(r)}setQuat(e,t,n,r){const s=new be;typeof e=="number"?s.set(e,t,n,r):s.set(e),this.controller?this.controller.setCameraQuat(s):this.transformer.setQuat(s)}setQuatNow(e,t,n,r){const s=new be;typeof e=="number"?s.set(e,t,n,r):s.set(e),this.controller?this.controller.setCameraQuatNow(s):this.transformer.setQuatNow(s)}lookAt(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof _e?r.set(e.loc):r.set(e);const s=this.upVector?this.upVector:_e.defaultUpVector,o=et(this.loc,r,s);o.mul(new be(s.x,s.y,s.z,0)),this.setQuat(o)}lookAtNow(e,t,n){const r=new Ae;typeof e=="number"?r.set(e,t,n):e instanceof _e?r.set(e.loc):r.set(e);const s=this.upVector?this.upVector:_e.defaultUpVector,o=et(this.loc,r,s);o.mul(new be(s.x,s.y,s.z,0)),this.setQuatNow(o)}}class Qt{view;trans;constructor(){this.trans=new He}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 Pn extends Qt{preMouse;leftClick=!1;rightClick=!1;target;cameraLoc=new Ae(0,0,3);cameraQuat=new be(0,0,0,1);constructor(e,t,n){super(),this.preMouse={x:0,y:0},typeof e=="number"?this.target=new Ae(e,t,n):this.target=new Ae(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),r=.01*(e.clientY-this.preMouse.y),s=Math.sin(-n),o=Math.cos(-n),c=Math.sin(-r),A=Math.cos(-r),a=new Ae(1,0,0).apply(this.cameraQuat),d=new Ae(0,1,0).apply(this.cameraQuat),u=new be(a.x*c,a.y*c,a.z*c,A),b=new be(d.x*s,d.y*s,d.z*s,o),f=new Ae(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const m=et(this.cameraLoc,this.target,new Ae(0,1,0));m.mul(new be(0,1,0,0)),this.cameraQuat.set(m),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}else if(this.leftClick){U.v0.set(this.target),U.v0.sub(this.cameraLoc);const n=.005*U.v0.length(),r=n*(e.clientX-this.preMouse.x),s=n*(e.clientY-this.preMouse.y),o=new Ae(1,0,0).apply(this.cameraQuat).scale(-r),c=new Ae(0,1,0).apply(this.cameraQuat).scale(s);this.cameraLoc.add(o),this.cameraLoc.add(c),this.target.add(o),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 Ae(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 be(this.cameraQuat);t.conjugate();const n=new Ae(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 Sr={offset:{x:0,y:5,z:-10}};class Lr extends Qt{option;_offset;constructor(e){super(),this.option={...Sr,...e};const t=this.option.offset;this._offset=new Ae(t.x,t.y,t.z)}update(e){if(!this.view||!this.view.scene.avatar)return;const t=new He;t.set(this.view.scene.avatar),U.v0.set(this._offset),U.v0.apply(t.quat),U.v0.add(t.loc),this.view.camera.transformer.setLocationNow(U.v0);const n=this.view.camera.upVector?this.view.camera.upVector:_e.defaultUpVector;n.normalize();const r=et(U.v0,this.view.scene.avatar.loc,n);r.mul(new be(n.x,n.y,n.z,0)),this.view.camera.transformer.setQuat(r)}}const _r={offset:{x:0,y:5,z:-10}};class xr extends Qt{option;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_offset;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e){super(),this.option={..._r,...e},this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1;const t=this.option.offset;this._offset=new Ae(t.x,t.y,t.z),this._avatarNextLoc=new Ae,this._avatarNextQuat=new be,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){if(!this.view||!this.view.scene.avatar)return;const t=this.view.scene.avatar,n=new He;n.set(t);const r=t.getUnitVecZ().scale(.1),s=t.getUnitVecX().scale(.1);U.v0.set(this._offset),U.v0.apply(n.quat),U.v0.add(n.loc),this.view.camera.transformer.setLocation(U.v0);const o=this.view.camera.upVector?this.view.camera.upVector:_e.defaultUpVector;o.normalize();const c=et(U.v0,this.view.scene.avatar.loc,o);c.mul(new be(o.x,o.y,o.z,0)),this.view.camera.transformer.setQuat(c),this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(s),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(s),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(At(new Ae(0,.01,0))),this._keyRight&&this._avatarNextQuat.mul(At(new Ae(0,-.01,0))),t.setLocationNow(this._avatarNextLoc),t.setQuat(this._avatarNextQuat)}}class Gn{scene;camera;controller;constructor(e){this.scene=new On,this.camera=e,this.camera.setAudioListener(nt.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new Pn(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 bt extends Mn{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){gr(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 Un 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 lt=new I.Vector3,gn=new I.Matrix4,En=new I.Matrix4,mn=new I.Vector3,In=new I.Vector3;class Hn{constructor(e={}){const t=this;let n,r,s,o;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(m,E){m.matrixWorldAutoUpdate===!0&&m.updateMatrixWorld(),E.parent===null&&E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),gn.copy(E.matrixWorldInverse),En.multiplyMatrices(E.projectionMatrix,gn),d(m,m,E),this.sortObjects&&f(m)},this.setSize=function(m,E){n=m,r=E,s=n/2,o=r/2,A.style.width=m+"px",A.style.height=E+"px"};function a(m){m.isCSS2DObject&&(m.element.style.display="none");for(let E=0,l=m.children.length;E<l;E++)a(m.children[E])}function d(m,E,l){if(m.visible===!1){a(m);return}if(m.isCSS2DObject){lt.setFromMatrixPosition(m.matrixWorld),lt.applyMatrix4(En);const h=lt.z>=-1&<.z<=1&&m.layers.test(l.layers)===!0,p=m.element;p.style.display=h===!0?"":"none",h===!0&&(m.onBeforeRender(t,E,l),p.style.transform="translate("+-100*m.center.x+"%,"+-100*m.center.y+"%)translate("+(lt.x*s+s)+"px,"+(-lt.y*o+o)+"px)",p.parentNode!==A&&A.appendChild(p),m.onAfterRender(t,E,l));const C={distanceToCameraSquared:u(l,m)};c.objects.set(m,C)}for(let h=0,p=m.children.length;h<p;h++)d(m.children[h],E,l)}function u(m,E){return mn.setFromMatrixPosition(m.matrixWorld),In.setFromMatrixPosition(E.matrixWorld),mn.distanceToSquared(In)}function b(m){const E=[];return m.traverseVisible(function(l){l.isCSS2DObject&&E.push(l)}),E}function f(m){const E=b(m).sort(function(h,p){if(h.renderOrder!==p.renderOrder)return p.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,g=c.objects.get(p).distanceToCameraSquared;return C-g}),l=E.length;for(let h=0,p=E.length;h<p;h++)E[h].element.style.zIndex=l-h}}}function bn(i,e){if(e===I.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===I.TriangleFanDrawMode||e===I.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const o=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)o.push(A);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===I.TriangleFanDrawMode)for(let o=1;o<=n;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=i.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class jn extends I.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Mr(t)}),this.register(function(t){return new Pr(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new Ur(t)}),this.register(function(t){return new Hr(t)}),this.register(function(t){return new jr(t)}),this.register(function(t){return new qr(t)}),this.register(function(t){return new Or(t)}),this.register(function(t){return new Kr(t)}),this.register(function(t){return new Gr(t)}),this.register(function(t){return new Wr(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new Dr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Zr(t)})}load(e,t,n,r){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const a=I.LoaderUtils.extractUrlBase(e);o=I.LoaderUtils.resolveURL(a,this.path)}else o=I.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),s.manager.itemError(e),s.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{s.parse(a,o,function(d){t(d),s.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let s;const o={},c={},A=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===qn){try{o[Te.KHR_BINARY_GLTF]=new $r(e)}catch(u){r&&r(u);return}s=JSON.parse(o[Te.KHR_BINARY_GLTF].content)}else s=JSON.parse(A.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new ho(s,{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,o[u.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const u=s.extensionsUsed[d],b=s.extensionsRequired||[];switch(u){case Te.KHR_MATERIALS_UNLIT:o[u]=new Fr;break;case Te.KHR_DRACO_MESH_COMPRESSION:o[u]=new eo(s,this.dracoLoader);break;case Te.KHR_TEXTURE_TRANSFORM:o[u]=new to;break;case Te.KHR_MESH_QUANTIZATION:o[u]=new no;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(o),a.setPlugins(c),a.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,s){n.parse(e,t,r,s)})}}function Nr(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Te={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 Dr{constructor(e){this.parser=e,this.name=Te.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const s=t.json,A=((s.extensions&&s.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),$e(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,s=n.json.nodes[e],c=(s.extensions&&s.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class Fr{constructor(){this.name=Te.KHR_MATERIALS_UNLIT}getMaterialType(){return I.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new I.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],I.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",s.baseColorTexture,I.SRGBColorSpace))}return Promise.all(r)}}class Or{constructor(e){this.parser=e,this.name=Te.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class Mr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new I.Vector2(c,c)}return Promise.all(s)}}class Pr{constructor(e){this.parser=e,this.name=Te.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 r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class Gr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class Ur{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new I.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,I.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class Hr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class jr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),Promise.all(s)}}class qr{constructor(e){this.parser=e,this.name=Te.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 r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class Kr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,I.SRGBColorSpace)),Promise.all(s)}}class zr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class Wr{constructor(e){this.parser=e,this.name=Te.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,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class Vr{constructor(e){this.parser=e,this.name=Te.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){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,s.source,o)}}class Yr{constructor(e){this.parser=e,this.name=Te.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=r.images[o.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,o.source,A)}}class Jr{constructor(e){this.parser=e,this.name=Te.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=r.images[o.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,o.source,A)}}class Xr{constructor(e){this.name=Te.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const r=n.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.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 s.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,d=r.count,u=r.byteStride,b=new Uint8Array(c,A,a);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,u,b,r.mode,r.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(d*u);return o.decodeGltfBuffer(new Uint8Array(f),d,u,b,r.mode,r.filter),f})})}else return null}}class Zr{constructor(e){this.name=Te.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==Ye.TRIANGLES&&a.mode!==Ye.TRIANGLE_STRIP&&a.mode!==Ye.TRIANGLE_FAN&&a.mode!==void 0)return null;const o=n.extensions[this.name].attributes,c=[],A={};for(const a in o)c.push(this.parser.getDependency("accessor",o[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 m of u){const E=new I.Matrix4,l=new I.Vector3,h=new I.Quaternion,p=new I.Vector3(1,1,1),C=new I.InstancedMesh(m.geometry,m.material,b);for(let g=0;g<b;g++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,g),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,g),A.SCALE&&p.fromBufferAttribute(A.SCALE,g),C.setMatrixAt(g,E.compose(l,h,p));for(const g in A)if(g==="_COLOR_0"){const B=A[g];C.instanceColor=new I.InstancedBufferAttribute(B.array,B.itemSize,B.normalized)}else g!=="TRANSLATION"&&g!=="ROTATION"&&g!=="SCALE"&&m.geometry.setAttribute(g,A[g]);I.Object3D.prototype.copy.call(C,m),this.parser.assignFinalMaterial(C),f.push(C)}return d.isGroup?(d.clear(),d.add(...f),d):f[0]}))}}const qn="glTF",dt=12,Cn={JSON:1313821514,BIN:5130562};class $r{constructor(e){this.name=Te.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,dt),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!==qn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-dt,s=new DataView(e,dt);let o=0;for(;o<r;){const c=s.getUint32(o,!0);o+=4;const A=s.getUint32(o,!0);if(o+=4,A===Cn.JSON){const a=new Uint8Array(e,dt+o,c);this.content=n.decode(a)}else if(A===Cn.BIN){const a=dt+o;this.body=e.slice(a,a+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class eo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Te.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},A={},a={};for(const d in o){const u=Jt[d]||d.toLowerCase();c[u]=o[d]}for(const d in e.attributes){const u=Jt[d]||d.toLowerCase();if(o[d]!==void 0){const b=n.accessors[e.attributes[d]],f=ht[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(u,b){r.decodeDracoFile(d,function(f){for(const m in f.attributes){const E=f.attributes[m],l=A[m];l!==void 0&&(E.normalized=l)}u(f)},c,a,I.LinearSRGBColorSpace,b)})})}}class to{constructor(){this.name=Te.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 no{constructor(){this.name=Te.KHR_MESH_QUANTIZATION}}class Kn extends I.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,r){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,d=r-t,u=(n-t)/d,b=u*u,f=b*u,m=e*a,E=m-a,l=-2*f+3*b,h=f-b,p=1-l,C=h-b+u;for(let g=0;g!==c;g++){const B=o[E+g+c],Q=o[E+g+A]*d,S=o[m+g+c],j=o[m+g]*d;s[g]=p*B+C*Q+l*S+h*j}return s}}const io=new I.Quaternion;class ro extends Kn{interpolate_(e,t,n,r){const s=super.interpolate_(e,t,n,r);return io.fromArray(s).normalize().toArray(s),s}}const Ye={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ht={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},yn={9728:I.NearestFilter,9729:I.LinearFilter,9984:I.NearestMipmapNearestFilter,9985:I.LinearMipmapNearestFilter,9986:I.NearestMipmapLinearFilter,9987:I.LinearMipmapLinearFilter},Bn={33071:I.ClampToEdgeWrapping,33648:I.MirroredRepeatWrapping,10497:I.RepeatWrapping},Dt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jt={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"},st={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},oo={CUBICSPLINE:void 0,LINEAR:I.InterpolateLinear,STEP:I.InterpolateDiscrete},Ft={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function so(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new I.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:I.FrontSide})),i.DefaultMaterial}function at(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function $e(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ao(i,e,t){let n=!1,r=!1,s=!1;for(let a=0,d=e.length;a<d;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(s=!0),n&&r&&s)break}if(!n&&!r&&!s)return Promise.resolve(i);const o=[],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):i.attributes.position;o.push(b)}if(r){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(b)}if(s){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(b)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(A)]).then(function(a){const d=a[0],u=a[1],b=a[2];return n&&(i.morphAttributes.position=d),r&&(i.morphAttributes.normal=u),s&&(i.morphAttributes.color=b),i.morphTargetsRelative=!0,i})}function Ao(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function co(i){let e;const t=i.extensions&&i.extensions[Te.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ot(t.attributes):e=i.indices+":"+Ot(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+Ot(i.targets[n]);return e}function Ot(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function Xt(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function lo(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const uo=new I.Matrix4;class ho{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Nr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,s=!1,o=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,s=c.indexOf("Firefox")>-1,o=s?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||s&&o<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,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const c={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:n,userData:{}};return at(s,c,r),$e(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let c=0,A=o.length;c<A;c++)e[o[c]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),s=(o,c)=>{const A=this.associations.get(o);A!=null&&this.associations.set(c,A);for(const[a,d]of o.children.entries())s(d,c.children[a])};return s(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return n.getDependency(e,o)})),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[Te.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){n.load(I.LoaderUtils.resolveURL(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const r=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const o=Dt[r.type],c=ht[r.componentType],A=r.normalized===!0,a=new c(r.count*o);return Promise.resolve(new I.BufferAttribute(a,o,A))}const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],A=Dt[r.type],a=ht[r.componentType],d=a.BYTES_PER_ELEMENT,u=d*A,b=r.byteOffset||0,f=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let E,l;if(f&&f!==u){const h=Math.floor(b/f),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+h+":"+r.count;let C=t.cache.get(p);C||(E=new a(c,h*f,r.count*f/d),C=new I.InterleavedBuffer(E,f/d),t.cache.add(p,C)),l=new I.InterleavedBufferAttribute(C,A,b%f/d,m)}else c===null?E=new a(r.count*A):E=new a(c,b,r.count*A),l=new I.BufferAttribute(E,A,m);if(r.sparse!==void 0){const h=Dt.SCALAR,p=ht[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,g=r.sparse.values.byteOffset||0,B=new p(o[1],C,r.sparse.count*h),Q=new a(o[2],g,r.sparse.count*A);c!==null&&(l=new I.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let S=0,j=B.length;S<j;S++){const R=B[S];if(l.setX(R,Q[S*A]),A>=2&&l.setY(R,Q[S*A+1]),A>=3&&l.setZ(R,Q[S*A+2]),A>=4&&l.setW(R,Q[S*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=m}return l})}loadTexture(e){const t=this.json,n=this.options,s=t.textures[e].source,o=t.images[s];let c=this.textureLoader;if(o.uri){const A=n.manager.getHandler(o.uri);A!==null&&(c=A)}return this.loadTextureImage(e,s,c)}loadTextureImage(e,t,n){const r=this,s=this.json,o=s.textures[e],c=s.images[t],A=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const b=(s.samplers||{})[o.sampler]||{};return d.magFilter=yn[b.magFilter]||I.LinearFilter,d.minFilter=yn[b.minFilter]||I.LinearMipmapLinearFilter,d.wrapS=Bn[b.wrapS]||I.RepeatWrapping,d.wrapT=Bn[b.wrapT]||I.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==I.NearestFilter&&d.minFilter!==I.LinearFilter,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=r.images[e],c=self.URL||self.webkitURL;let A=o.uri||"",a=!1;if(o.bufferView!==void 0)A=n.getDependency("bufferView",o.bufferView).then(function(u){a=!0;const b=new Blob([u],{type:o.mimeType});return A=c.createObjectURL(b),A});else if(o.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 m=b;t.isImageBitmapLoader===!0&&(m=function(E){const l=new I.Texture(E);l.needsUpdate=!0,b(l)}),t.load(I.LoaderUtils.resolveURL(u,s.path),m,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),$e(u,o),u.userData.mimeType=o.mimeType||lo(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=d,d}assignTexture(e,t,n,r){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[Te.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Te.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=s.associations.get(o);o=s.extensions[Te.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,A)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=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(r||s||o){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),s&&(A.vertexColors=!0),o&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return I.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,s=n.materials[e];let o;const c={},A=s.extensions||{},a=[];if(A[Te.KHR_MATERIALS_UNLIT]){const u=r[Te.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),a.push(u.extendParams(c,s,t))}else{const u=s.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))),o=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)})))}s.doubleSided===!0&&(c.side=I.DoubleSide);const d=s.alphaMode||Ft.OPAQUE;if(d===Ft.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===Ft.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new I.Vector2(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;c.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&o!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==I.MeshBasicMaterial){const u=s.emissiveFactor;c.emissive=new I.Color().setRGB(u[0],u[1],u[2],I.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==I.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,I.SRGBColorSpace)),Promise.all(a).then(function(){const u=new o(c);return s.name&&(u.name=s.name),$e(u,s),t.associations.set(u,{materials:e}),s.extensions&&at(r,u,s),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,r=this.primitiveCache;function s(c){return n[Te.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return wn(A,c,t)})}const o=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],d=co(a),u=r[d];if(u)o.push(u.promise);else{let b;a.extensions&&a.extensions[Te.KHR_DRACO_MESH_COMPRESSION]?b=s(a):b=wn(new I.BufferGeometry,a,t),r[d]={primitive:a,promise:b},o.push(b)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,r=this.extensions,s=n.meshes[e],o=s.primitives,c=[];for(let A=0,a=o.length;A<a;A++){const d=o[A].material===void 0?so(this.cache):this.getDependency("material",o[A].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),d=A[A.length-1],u=[];for(let f=0,m=d.length;f<m;f++){const E=d[f],l=o[f];let h;const p=a[f];if(l.mode===Ye.TRIANGLES||l.mode===Ye.TRIANGLE_STRIP||l.mode===Ye.TRIANGLE_FAN||l.mode===void 0)h=s.isSkinnedMesh===!0?new I.SkinnedMesh(E,p):new I.Mesh(E,p),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===Ye.TRIANGLE_STRIP?h.geometry=bn(h.geometry,I.TriangleStripDrawMode):l.mode===Ye.TRIANGLE_FAN&&(h.geometry=bn(h.geometry,I.TriangleFanDrawMode));else if(l.mode===Ye.LINES)h=new I.LineSegments(E,p);else if(l.mode===Ye.LINE_STRIP)h=new I.Line(E,p);else if(l.mode===Ye.LINE_LOOP)h=new I.LineLoop(E,p);else if(l.mode===Ye.POINTS)h=new I.Points(E,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&Ao(h,s),h.name=t.createUniqueName(s.name||"mesh_"+e),$e(h,s),l.extensions&&at(r,h,l),t.assignFinalMaterial(h),u.push(h)}for(let f=0,m=u.length;f<m;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return s.extensions&&at(r,u[0],s),u[0];const b=new I.Group;s.extensions&&at(r,b,s),t.associations.set(b,{meshes:e});for(let f=0,m=u.length;f<m;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new I.PerspectiveCamera(I.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new I.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),$e(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,s=t.joints.length;r<s;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const s=r.pop(),o=r,c=[],A=[];for(let a=0,d=o.length;a<d;a++){const u=o[a];if(u){c.push(u);const b=new I.Matrix4;s!==null&&b.fromArray(s.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,r=t.animations[e],s=r.name?r.name:"animation_"+e,o=[],c=[],A=[],a=[],d=[];for(let u=0,b=r.channels.length;u<b;u++){const f=r.channels[u],m=r.samplers[f.sampler],E=f.target,l=E.node,h=r.parameters!==void 0?r.parameters[m.input]:m.input,p=r.parameters!==void 0?r.parameters[m.output]:m.output;E.node!==void 0&&(o.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",p)),a.push(m),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(d)]).then(function(u){const b=u[0],f=u[1],m=u[2],E=u[3],l=u[4],h=[];for(let C=0,g=b.length;C<g;C++){const B=b[C],Q=f[C],S=m[C],j=E[C],R=l[C];if(B===void 0)continue;B.updateMatrix&&B.updateMatrix();const F=n._createAnimationTracks(B,Q,S,j,R);if(F)for(let L=0;L<F.length;L++)h.push(F[L])}const p=new I.AnimationClip(s,void 0,h);return $e(p,r),p})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),o})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=r.children||[];for(let a=0,d=c.length;a<d;a++)o.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([s,Promise.all(o),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,uo)});for(let f=0,m=u.length;f<m;f++)d.add(u[f]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),s.camera!==void 0&&c.push(r.getDependency("camera",s.camera).then(function(a){return r._getNodeRef(r.cameraCache,s.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let d;if(s.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(s.name&&(d.userData.name=s.name,d.name=o),$e(d,s),s.extensions&&at(n,d,s),s.matrix!==void 0){const u=new I.Matrix4;u.fromArray(s.matrix),d.applyMatrix4(u)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!r.associations.has(d))r.associations.set(d,{});else if(s.mesh!==void 0&&r.meshCache.refs[s.mesh]>1){const u=r.associations.get(d);r.associations.set(d,{...u})}return r.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,s=new I.Group;n.name&&(s.name=r.createUniqueName(n.name)),$e(s,n),n.extensions&&at(t,s,n);const o=n.nodes||[],c=[];for(let A=0,a=o.length;A<a;A++)c.push(r.getDependency("node",o[A]));return Promise.all(c).then(function(A){for(let d=0,u=A.length;d<u;d++)s.add(A[d]);const a=d=>{const u=new Map;for(const[b,f]of r.associations)(b instanceof I.Material||b instanceof I.Texture)&&u.set(b,f);return d.traverse(b=>{const f=r.associations.get(b);f!=null&&u.set(b,f)}),u};return r.associations=a(s),s})}_createAnimationTracks(e,t,n,r,s){const o=[],c=e.name?e.name:e.uuid,A=[];st[s.path]===st.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(st[s.path]){case st.weights:a=I.NumberKeyframeTrack;break;case st.rotation:a=I.QuaternionKeyframeTrack;break;case st.translation:case st.scale:a=I.VectorKeyframeTrack;break;default:n.itemSize===1?a=I.NumberKeyframeTrack:a=I.VectorKeyframeTrack;break}const d=r.interpolation!==void 0?oo[r.interpolation]:I.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const m=new a(A[b]+"."+st[s.path],t.array,u,d);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),o.push(m)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Xt(t.constructor),r=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)r[s]=t[s]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof I.QuaternionKeyframeTrack?ro:Kn;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function fo(i,e,t){const n=e.attributes,r=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(r.set(new I.Vector3(A[0],A[1],A[2]),new I.Vector3(a[0],a[1],a[2])),c.normalized){const d=Xt(ht[c.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new I.Vector3,A=new I.Vector3;for(let a=0,d=s.length;a<d;a++){const u=s[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,m=b.max;if(f!==void 0&&m!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),b.normalized){const E=Xt(ht[b.componentType]);A.multiplyScalar(E)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const o=new I.Sphere;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=o}function wn(i,e,t){const n=e.attributes,r=[];function s(o,c){return t.getDependency("accessor",o).then(function(A){i.setAttribute(c,A)})}for(const o in n){const c=Jt[o]||o.toLowerCase();c in i.attributes||r.push(s(n[o],c))}if(e.indices!==void 0&&!i.index){const o=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(o)}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.`),$e(i,e),fo(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?ao(i,e.targets,t):i})}const Mt=new WeakMap;class po 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,r){const s=new I.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,I.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,s=I.LinearSRGBColorSpace,o=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:s};return this.decodeGeometry(e,c).then(t).catch(o)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Mt.has(e)){const A=Mt.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,c=this._getWorker(s,o).then(A=>(r=A,new Promise((a,d)=>{r._callbacks[s]={resolve:a,reject:d},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),Mt.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:r,array:s,itemSize:o,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(o===c)a=new I.BufferAttribute(s,o);else{const d=new I.InterleavedBuffer(s,c);a=new I.InterleavedBufferAttribute(d,o,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(s instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==I.SRGBColorSpace)return;const n=new I.Color;for(let r=0,s=e.count;r<s;r++)n.fromBufferAttribute(e,r),I.ColorManagement.colorSpaceToWorking(n,I.SRGBColorSpace),e.setXYZ(r,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((r,s)=>{n.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const s=go.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
2
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(s){const o=s.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,s){return r._taskLoad>s._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 go(){let i,e;onmessage=function(o){const c=o.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(d){i.onModuleLoaded=function(u){d({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(d=>{const u=d.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),m=f.attributes.map(E=>E.array.buffer);f.index&&m.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},m)}catch(f){console.error(f),self.postMessage({type:"error",id:c.id,error:f.message})}finally{u.destroy(b)}});break}};function t(o,c,A,a){const d=a.attributeIDs,u=a.attributeTypes;let b,f;const m=c.GetEncodedGeometryType(A);if(m===o.TRIANGULAR_MESH)b=new o.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(m===o.POINT_CLOUD)b=new o.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 E={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,o[d[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const g=r(o,c,b,l,h,p);l==="color"&&(g.vertexColorSpace=a.vertexColorSpace),E.attributes.push(g)}return m===o.TRIANGULAR_MESH&&(E.index=n(o,c,b)),o.destroy(b),E}function n(o,c,A){const d=A.num_faces()*3,u=d*4,b=o._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(o.HEAPF32.buffer,b,d).slice();return o._free(b),{array:f,itemSize:1}}function r(o,c,A,a,d,u){const b=A.num_points(),f=u.num_components(),m=s(o,d),E=f*d.BYTES_PER_ELEMENT,l=Math.ceil(E/4)*4,h=l/d.BYTES_PER_ELEMENT,p=b*E,C=b*l,g=o._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,m,p,g);const B=new d(o.HEAPF32.buffer,g,p/d.BYTES_PER_ELEMENT);let Q;if(E===l)Q=B.slice();else{Q=new d(C/d.BYTES_PER_ELEMENT);let S=0;for(let j=0,R=B.length;j<R;j++){for(let F=0;F<f;F++)Q[S+F]=B[j*f+F];S+=h}}return o._free(g),{name:a,count:b,itemSize:f,array:Q,stride:h}}function s(o,c){switch(c){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class Eo{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:r,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const mo=0,Tn=2,Io=1,vn=2,bo=0,Co=1,yo=10,Bo=0,zn=9,Wn=15,Vn=16,Yn=22,Jn=37,Xn=43,Zn=76,$n=83,ei=97,ti=100,ni=103,ii=109,ri=122,oi=123,si=131,ai=132,Ai=133,ci=134,li=137,ui=138,hi=139,di=140,fi=141,pi=142,gi=145,Ei=146,mi=148,Ii=152,Zt=153,wo=154,$t=155,To=156,bi=157,Ci=158,yi=165,Bi=166,wi=1000054e3,Ti=1000054001,vi=1000054004,Ri=1000054005,on=1000066e3,Qi=1000066004;class ft{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const ze=[171,75,84,88,32,50,48,187,13,10,26,10];function Rn(i){return new TextDecoder().decode(i)}function vo(i){const e=new Uint8Array(i.buffer,i.byteOffset,ze.length);if(e[0]!==ze[0]||e[1]!==ze[1]||e[2]!==ze[2]||e[3]!==ze[3]||e[4]!==ze[4]||e[5]!==ze[5]||e[6]!==ze[6]||e[7]!==ze[7]||e[8]!==ze[8]||e[9]!==ze[9]||e[10]!==ze[10]||e[11]!==ze[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new ft(i,ze.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const s=r._nextUint32(),o=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),d=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new ft(i,ze.length+n,u,!0);for(let re=0,oe=Math.max(t.levelCount,1);re<oe;re++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new ft(i,s,o,!0);f._skip(4);const m=f._nextUint16(),E=f._nextUint16(),l=f._nextUint16(),h=f._nextUint16(),p={vendorId:m,descriptorType:E,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 oe={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&oe.channelType?(oe.sampleLower=f._nextInt32(),oe.sampleUpper=f._nextInt32()):(oe.sampleLower=f._nextUint32(),oe.sampleUpper=f._nextUint32()),p.samples[re]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const g=new ft(i,c,A,!0);for(;g._offset<A;){const re=g._nextUint32(),oe=g._scan(re),ee=Rn(oe);if(t.keyValue[ee]=g._nextUint8Array(re-oe.byteLength-1),ee.match(/^ktx/i)){const he=Rn(t.keyValue[ee]);t.keyValue[ee]=he.substring(0,he.lastIndexOf("\0"))}g._skip(re%4?4-re%4:0)}if(d<=0)return t;const B=new ft(i,a,d,!0),Q=B._nextUint16(),S=B._nextUint16(),j=B._nextUint32(),R=B._nextUint32(),F=B._nextUint32(),L=B._nextUint32(),k=[];for(let re=0,oe=Math.max(t.levelCount,1);re<oe;re++)k.push({imageFlags:B._nextUint32(),rgbSliceByteOffset:B._nextUint32(),rgbSliceByteLength:B._nextUint32(),alphaSliceByteOffset:B._nextUint32(),alphaSliceByteLength:B._nextUint32()});const x=a+B._offset,_=x+j,V=_+R,J=V+F,q=new Uint8Array(i.buffer,i.byteOffset+x,j),X=new Uint8Array(i.buffer,i.byteOffset+_,R),Z=new Uint8Array(i.buffer,i.byteOffset+V,F),ce=new Uint8Array(i.buffer,i.byteOffset+J,L);return t.globalData={endpointCount:Q,selectorCount:S,imageDescs:k,endpointsData:q,selectorsData:X,tablesData:Z,extendedData:ce},t}let Pt,tt,en;const Gt={env:{emscripten_notify_memory_growth:function(i){en=new Uint8Array(tt.exports.memory.buffer)}}};class Ro{init(){return Pt||(Pt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Qn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Gt)).then(this._init):WebAssembly.instantiate(Buffer.from(Qn,"base64"),Gt).then(this._init),Pt)}_init(e){tt=e.instance,Gt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!tt)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=tt.exports.malloc(n);en.set(e,r),t=t||Number(tt.exports.ZSTD_findDecompressedSize(r,n));const s=tt.exports.malloc(t),o=tt.exports.ZSTD_decompress(s,t,r,n),c=en.slice(s,s+o);return tt.exports.free(r),tt.exports.free(s),c}}const Qn="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm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IAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQ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IAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAAC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LBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkx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GohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJ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okACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3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gwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Qo="display-p3",ko="display-p3-linear";({...I.ColorManagement.spaces[I.SRGBColorSpace]});const Ut=new WeakMap;let Ht=0,jt;class Je extends I.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new Eo,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 r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([s,o])=>{const c=Je.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(Je.EngineFormat),"let _EngineType = "+JSON.stringify(Je.EngineType),"let _TranscoderFormat = "+JSON.stringify(Je.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Je.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,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})}),Ht>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Ht++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new I.FileLoader(this.manager);s.setPath(this.path),s.setCrossOrigin(this.crossOrigin),s.setWithCredentials(this.withCredentials),s.setRequestHeader(this.requestHeader),s.setResponseType("arraybuffer"),s.load(e,o=>{this.parse(o,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Ut.has(e))return Ut.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:s,width:o,height:c,format:A,type:a,dfdFlags:d}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new I.CompressedCubeTexture(s,A,a);else{const b=s[0].mipmaps;u=t.layerCount>1?new I.CompressedArrayTexture(b,o,c,t.layerCount,A,a):new I.CompressedTexture(b,o,c,A,a)}return u.minFilter=s[0].mipmaps.length===1?I.LinearFilter:I.LinearMipmapLinearFilter,u.magFilter=I.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=ki(t),u.premultiplyAlpha=!!(d&Io),u}async _createTexture(e,t={}){const n=vo(new Uint8Array(e)),r=n.vkFormat===on&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===Bo||r&&!this.workerConfig.astcHDRSupported))return Lo(n);const o=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(A=>this._createTextureFrom(A.data,n));return Ut.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Ht--}}Je.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};Je.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};Je.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};Je.EngineType={UnsignedByteType:I.UnsignedByteType,HalfFloatType:I.HalfFloatType,FloatType:I.FloatType};Je.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,s=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(m){const E=m.data;switch(E.type){case"init":i=E.config,c(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:p,height:C,hasAlpha:g,format:B,type:Q,dfdFlags:S}=A(E.buffer);self.postMessage({type:"transcode",id:E.id,data:{faces:l,width:p,height:C,hasAlpha:g,format:B,type:Q,dfdFlags:S}},h)}catch(l){console.error(l),self.postMessage({type:"error",id:E.id,error:l.message})}});break}});function c(m){e=new Promise(E=>{t={wasmBinary:m,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(m){const E=new t.KTX2File(new Uint8Array(m));function l(){E.close(),E.delete()}if(!E.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let h;if(E.isUASTC())h=o.UASTC;else if(E.isETC1S())h=o.ETC1S;else if(E.isHDR())h=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const p=E.getWidth(),C=E.getHeight(),g=E.getLayers()||1,B=E.getLevels(),Q=E.getFaces(),S=E.getHasAlpha(),j=E.getDFDFlags(),{transcoderFormat:R,engineFormat:F,engineType:L}=u(h,p,C,S);if(!p||!C||!B)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const k=[],x=[];for(let _=0;_<Q;_++){const V=[];for(let J=0;J<B;J++){const q=[];let X,Z;for(let re=0;re<g;re++){const oe=E.getImageLevelInfo(J,re,_);_===0&&J===0&&re===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),B>1?(X=oe.origWidth,Z=oe.origHeight):(X=oe.width,Z=oe.height);let ee=new Uint8Array(E.getImageTranscodedSizeInBytes(J,re,0,R));const he=E.transcodeImage(ee,J,re,_,R,0,-1,-1);if(L===r.HalfFloatType&&(ee=new Uint16Array(ee.buffer,ee.byteOffset,ee.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!he)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");q.push(ee)}const ce=f(q);V.push({data:ce,width:X,height:Z}),x.push(ce.buffer)}k.push({mipmaps:V,width:p,height:C,format:F,type:L})}return l(),{faces:k,buffers:x,width:p,height:C,hasAlpha:S,dfdFlags:j,format:F,type:L}}const a=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.BC1,s.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.PVRTC1_4_RGB,s.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[o.UASTC_HDR],transcoderFormat:[s.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.RGBA32,s.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[s.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],d={[o.ETC1S]:a.filter(m=>m.basisFormat.includes(o.ETC1S)).sort((m,E)=>m.priorityETC1S-E.priorityETC1S),[o.UASTC]:a.filter(m=>m.basisFormat.includes(o.UASTC)).sort((m,E)=>m.priorityUASTC-E.priorityUASTC),[o.UASTC_HDR]:a.filter(m=>m.basisFormat.includes(o.UASTC_HDR)).sort((m,E)=>m.priorityHDR-E.priorityHDR)};function u(m,E,l,h){const p=d[m];for(let C=0;C<p.length;C++){const g=p[C];if(g.if&&!i[g.if]||!g.basisFormat.includes(m)||h&&g.transcoderFormat.length<2||g.needsPowerOfTwo&&!(b(E)&&b(l)))continue;const B=g.transcoderFormat[h?1:0],Q=g.engineFormat[h?1:0],S=g.engineType[0];return{transcoderFormat:B,engineFormat:Q,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(m){return m<=2?!0:(m&m-1)===0&&m!==0}function f(m){if(m.length===1)return m[0];let E=0;for(let p=0;p<m.length;p++){const C=m[p];E+=C.byteLength}const l=new Uint8Array(E);let h=0;for(let p=0;p<m.length;p++){const C=m[p];l.set(C,h),h+=C.byteLength}return l}};const So=new Set([I.RGBAFormat,I.RGBFormat,I.RGFormat,I.RedFormat]),qt={[ii]:I.RGBAFormat,[ni]:I.RGFormat,[ti]:I.RedFormat,[ei]:I.RGBAFormat,[$n]:I.RGFormat,[Zn]:I.RedFormat,[Xn]:I.RGBAFormat,[Jn]:I.RGBAFormat,[Yn]:I.RGFormat,[Vn]:I.RGFormat,[Wn]:I.RedFormat,[zn]:I.RedFormat,[oi]:I.RGBFormat,[ri]:I.RGBFormat,[Ii]:I.RGBA_ETC2_EAC_Format,[mi]:I.RGB_ETC2_Format,[Zt]:I.R11_EAC_Format,[wo]:I.SIGNED_R11_EAC_Format,[$t]:I.RG11_EAC_Format,[To]:I.SIGNED_RG11_EAC_Format,[on]:I.RGBA_ASTC_4x4_Format,[Ci]:I.RGBA_ASTC_4x4_Format,[bi]:I.RGBA_ASTC_4x4_Format,[Qi]:I.RGBA_ASTC_6x6_Format,[Bi]:I.RGBA_ASTC_6x6_Format,[yi]:I.RGBA_ASTC_6x6_Format,[ci]:I.RGBA_S3TC_DXT1_Format,[Ai]:I.RGBA_S3TC_DXT1_Format,[ai]:I.RGB_S3TC_DXT1_Format,[si]:I.RGB_S3TC_DXT1_Format,[ui]:I.RGBA_S3TC_DXT3_Format,[li]:I.RGBA_S3TC_DXT3_Format,[di]:I.SIGNED_RED_RGTC1_Format,[hi]:I.RED_RGTC1_Format,[pi]:I.SIGNED_RED_GREEN_RGTC2_Format,[fi]:I.RED_GREEN_RGTC2_Format,[Ei]:I.RGBA_BPTC_Format,[gi]:I.RGBA_BPTC_Format,[Ri]:I.RGBA_PVRTC_4BPPV1_Format,[Ti]:I.RGBA_PVRTC_4BPPV1_Format,[vi]:I.RGBA_PVRTC_2BPPV1_Format,[wi]:I.RGBA_PVRTC_2BPPV1_Format},ut={[ii]:I.FloatType,[ni]:I.FloatType,[ti]:I.FloatType,[ei]:I.HalfFloatType,[$n]:I.HalfFloatType,[Zn]:I.HalfFloatType,[Xn]:I.UnsignedByteType,[Jn]:I.UnsignedByteType,[Yn]:I.UnsignedByteType,[Vn]:I.UnsignedByteType,[Wn]:I.UnsignedByteType,[zn]:I.UnsignedByteType,[oi]:I.UnsignedInt5999Type,[ri]:I.UnsignedInt101111Type,[Ii]:I.UnsignedByteType,[mi]:I.UnsignedByteType,[Zt]:I.UnsignedByteType,[Zt]:I.UnsignedByteType,[$t]:I.UnsignedByteType,[$t]:I.UnsignedByteType,[on]:I.HalfFloatType,[Ci]:I.UnsignedByteType,[bi]:I.UnsignedByteType,[Qi]:I.HalfFloatType,[Bi]:I.UnsignedByteType,[yi]:I.UnsignedByteType,[ci]:I.UnsignedByteType,[Ai]:I.UnsignedByteType,[ai]:I.UnsignedByteType,[si]:I.UnsignedByteType,[ui]:I.UnsignedByteType,[li]:I.UnsignedByteType,[di]:I.UnsignedByteType,[hi]:I.UnsignedByteType,[pi]:I.UnsignedByteType,[fi]:I.UnsignedByteType,[Ei]:I.UnsignedByteType,[gi]:I.UnsignedByteType,[Ri]:I.UnsignedByteType,[Ti]:I.UnsignedByteType,[vi]:I.UnsignedByteType,[wi]:I.UnsignedByteType};async function Lo(i){const{vkFormat:e}=i;if(qt[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);ut[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===Tn&&(jt||(jt=new Promise(async o=>{const c=new Ro;await c.init(),o(c)})),t=await jt);const n=[];for(let o=0;o<i.levels.length;o++){const c=Math.max(1,i.pixelWidth>>o),A=Math.max(1,i.pixelHeight>>o),a=i.pixelDepth?Math.max(1,i.pixelDepth>>o):0,d=i.levels[o];let u;if(i.supercompressionScheme===mo)u=d.levelData;else if(i.supercompressionScheme===Tn)u=t.decode(d.levelData,d.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;ut[e]===I.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):ut[e]===I.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):ut[e]===I.UnsignedInt5999Type||ut[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 r=i.levelCount===0||n.length>1;let s;if(So.has(qt[e]))s=i.pixelDepth===0?new I.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new I.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),s.minFilter=r?I.NearestMipmapNearestFilter:I.NearestFilter,s.magFilter=I.NearestFilter,s.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new I.CompressedTexture(n,i.pixelWidth,i.pixelHeight),s.minFilter=r?I.LinearMipmapLinearFilter:I.LinearFilter,s.magFilter=I.LinearFilter}return s.mipmaps=n,s.type=ut[e],s.format=qt[e],s.colorSpace=ki(i),s.needsUpdate=!0,Promise.resolve(s)}function ki(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===Co?e.transferFunction===vn?I.SRGBColorSpace:I.LinearSRGBColorSpace:e.colorPrimaries===yo?e.transferFunction===vn?Qo:ko:(e.colorPrimaries===bo||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),I.NoColorSpace)}class sn{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let s;n.ValueTypeName==="quaternion"?s=new se.QuaternionLinearInterpolant(n.times,n.values,r):s=new se.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=s}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const[s,o]=n.split(".");let c=t[s];c||(c={},t[s]=c);const A=r.evaluate(this.time);if(o==="position")c.loc=new Ae(A[0],A[1],A[2]);else if(o==="quaternion")c.quat=new be(A[0],A[1],A[2],A[3]);else if(o==="scale")c.scale=new Ae(A[0],A[1],A[2]);else if(o==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:s,vals:a})}else console.warn(`ClipMotion: update. unknown property(${o})`)}return t}}var Si=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),s,o=WebAssembly.instantiate(r,{}).then(function(h){s=h.instance,s.exports.__wasm_call_ctors()});function c(h){for(var p=new Uint8Array(h.length),C=0;C<h.length;++C){var g=h.charCodeAt(C);p[C]=g>96?g-97:g>64?g-39:g+4}for(var B=0,C=0;C<h.length;++C)p[B++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,B)}function A(h,p,C,g,B,Q,S){var j=h.exports.sbrk,R=g+3&-4,F=j(R*B),L=j(Q.length),k=new Uint8Array(h.exports.memory.buffer);k.set(Q,L);var x=p(F,g,B,L,Q.length);if(x==0&&S&&S(F,R,B),C.set(k.subarray(F,F+g*B)),j(F-j(0)),x!=0)throw new Error("Malformed buffer data: "+x)}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 g=C.data;p.pending-=g.count,p.requests[g.id][g.action](g.value),delete p.requests[g.id]},p}function m(h){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),g=URL.createObjectURL(C),B=u.length;B<h;++B)u[B]=f(g);for(var B=h;B<u.length;++B)u[B].object.postMessage({});u.length=h,URL.revokeObjectURL(g)}function E(h,p,C,g,B){for(var Q=u[0],S=1;S<u.length;++S)u[S].pending<Q.pending&&(Q=u[S]);return new Promise(function(j,R){var F=new Uint8Array(C),L=++b;Q.pending+=h,Q.requests[L]={resolve:j,reject:R},Q.object.postMessage({id:L,count:h,size:p,source:F,mode:g,filter:B},[F.buffer])})}function l(h){var p=h.data;if(!p.id)return self.close();self.ready.then(function(C){try{var g=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],g,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:g},[g.buffer])}catch(B){self.postMessage({id:p.id,count:p.count,action:"reject",value:B})}})}return{ready:o,supported:!0,useWorkers:function(h){m(h)},decodeVertexBuffer:function(h,p,C,g,B){A(s,s.exports.meshopt_decodeVertexBuffer,h,p,C,g,s.exports[a[B]])},decodeIndexBuffer:function(h,p,C,g){A(s,s.exports.meshopt_decodeIndexBuffer,h,p,C,g)},decodeIndexSequence:function(h,p,C,g){A(s,s.exports.meshopt_decodeIndexSequence,h,p,C,g)},decodeGltfBuffer:function(h,p,C,g,B,Q){A(s,s.exports[d[B]],h,p,C,g,s.exports[a[Q]])},decodeGltfBufferAsync:function(h,p,C,g,B){return u.length>0?E(h,p,C,d[g],a[B]):o.then(function(){var Q=new Uint8Array(h*p);return A(s,s.exports[d[g]],Q,h,p,C,s.exports[a[B]]),Q})}}})();function _o(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const xo={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 Li(i={}){const e={...xo,...i};let t=new jn;const n=new po;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new Je;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(Si),an=t}let an=new jn;an.setMeshoptDecoder(Si);class No extends It{gltf;constructor(e){super(e)}async asyncInit(e){if(Nn(e)){let t=null;this.gltf=await an.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},s={};this.gltf.scene.traverse(o=>{if(o.userData.a3js={objectA3:this},_o(o)){const{morphTargetDictionary:c,morphTargetInfluences:A}=o;Object.keys(c).forEach(a=>{const d=o.name+"."+a,u=c[a];s[d]={array:A,idx:u}})}o instanceof se.Bone&&r.bones&&(r.bones[o.name]=o),o instanceof se.SkinnedMesh&&(r.skeleton=o.skeleton)}),this.gltf.animations.forEach(o=>{t||(t=o.name),n[o.name]={name:o.name,shape:r,motion:new sn(o),sound:void 0,soundContinue:!0}}),t?this.syncInit(t,n,s):(t="dummy",n.dummy={name:"dummy",shape:r,motion:new pn,sound:void 0,soundContinue:!0},this.syncInit(t,n,s))}else{const t=new se.BoxGeometry,n=new se.MeshStandardMaterial({color:16711680}),r=new se.Mesh(t,n),s="dummy",o={};o.dummy={name:"dummy",shape:{root:r},motion:new pn,sound:void 0,soundContinue:!0},this.syncInit(s,o)}return this}}const _i={camera:void 0,antialias:!1,transparent:!1};class xi extends HTMLElement{option;ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;_canvas;_css2DCanvas;constructor(e){if(super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
1
|
+
"use strict";var ar=Object.create;var En=Object.defineProperty;var Ar=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,ur=Object.prototype.hasOwnProperty;var hr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cr(e))!ur.call(i,r)&&r!==t&&En(i,r,{get:()=>e[r],enumerable:!(n=Ar(e,r))||n.enumerable});return i};var dr=(i,e,t)=>(t=i!=null?ar(lr(i)):{},hr(e||!i||!i.__esModule?En(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("three"),Mn=require("fflate");function fr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const se=fr(g);class Z{_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 Z(this)}write(e){e.x=this._x,e.y=this._y,e.z=this._z}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t):console.warn("Vec3.normalize."),this}negate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}set(e,t,n){return typeof e=="number"?(this._x=e,this._y=t,this._z=n):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,n){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=n):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=n):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):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,r){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):typeof e>"u"?(this._x=this._y=this._z=0,this._w=1):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w)}clone(){return new 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,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,r){const o=new Te(this),s=new Te;return typeof e=="number"?s.set(e,t,n,r):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 r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Xe.set(t),r<0&&(r*=-1,Xe.set(-Xe.x,-Xe.y,-Xe.z,-Xe.w)),r>.9995){this._x=(1-n)*e.x+n*Xe.x,this._y=(1-n)*e.y+n*Xe.y,this._z=(1-n)*e.z+n*Xe.z,this._w=(1-n)*e.w+n*Xe.w;const o=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);o<1e-4?(console.warn("Quat.slerp(); ???!"),this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w):(this._x*=1/o,this._y*=1/o,this._z*=1/o,this._w*=1/o)}else{const o=Math.acos(r),s=Math.sin((1-n)*o)/Math.sin(o),c=Math.sin(n*o)/Math.sin(o);this._x=s*e.x+c*Xe.x,this._y=s*e.y+c*Xe.y,this._z=s*e.z+c*Xe.z,this._w=s*e.w+c*Xe.w}}}const Xe=new Te;function At(i,e,t){t.normalize();const n=i.clone().sub(e).normalize(),r=new Z().cross(n,t).normalize(),o=new Z().cross(r,n),s=r.x,c=o.x,A=-n.x,a=r.y,h=o.y,u=-n.y,b=r.z,f=o.z,I=-n.z,E=s+h+I;if(E>0){const l=Math.sqrt(E+1)*2;return new Te((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(s>h&&s>I){const l=Math.sqrt(1+s-h-I)*2;return new Te(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(h>I){const l=Math.sqrt(1+h-s-I)*2;return new Te((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+I-s-h)*2;return new Te((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function dt(i,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(i.x),0,0,Math.cos(i.x));break;case"Y":t.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":t.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return t}function pr(i){const e=[[],[],[]],t=i.x+i.x,n=i.y+i.y,r=i.z+i.z,o=i.x*t,s=i.x*n,c=i.x*r,A=i.y*n,a=i.y*r,h=i.z*r,u=i.w*t,b=i.w*n,f=i.w*r;return e[0][0]=1-(A+h),e[0][1]=s-f,e[0][2]=c+b,e[1][0]=s+f,e[1][1]=1-(o+h),e[1][2]=a-u,e[2][0]=c-b,e[2][1]=a+u,e[2][2]=1-(o+A),e}const pt=i=>Math.max(-1,Math.min(1,i));function mn(i,e="XYZ"){const t=pr(i),n=new Z;let r=0,o=0,s=0;switch(e){case"XYZ":o=Math.asin(pt(t[0][2])),Math.abs(t[0][2])<.9999999?(r=Math.atan2(-t[1][2],t[2][2]),s=Math.atan2(-t[0][1],t[0][0])):(r=Math.atan2(t[2][1],t[1][1]),s=0);break;case"YXZ":r=Math.asin(-pt(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":r=Math.asin(pt(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(-pt(t[2][0])),Math.abs(t[2][0])<.9999999?(r=Math.atan2(t[2][1],t[2][2]),s=Math.atan2(t[1][0],t[0][0])):(r=0,s=Math.atan2(-t[0][1],t[1][1]));break;case"YZX":s=Math.asin(pt(t[1][0])),Math.abs(t[1][0])<.9999999?(r=Math.atan2(-t[1][2],t[1][1]),o=Math.atan2(-t[2][0],t[0][0])):(r=0,o=Math.atan2(t[0][2],t[2][2]));break;case"XZY":s=Math.asin(-pt(t[0][1])),Math.abs(t[0][1])<.9999999?(r=Math.atan2(t[2][1],t[1][1]),o=Math.atan2(t[0][2],t[0][0])):(r=Math.atan2(-t[1][2],t[2][2]),o=0);break}return n.set(r,o,s),n}class qe{loc;quat;scale;constructor(){this.loc=new Z,this.quat=new Te,this.scale=new Z(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 Oe?(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 wt{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 Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Pn{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 Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Gn{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 Z);const t=this.lastTrans.loc.x-this.firstTrans.loc.x,n=this.lastTrans.loc.y-this.firstTrans.loc.y,r=this.lastTrans.loc.z-this.firstTrans.loc.z;e.set(t,n,r);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 Z);const t=mn(this.firstTrans.quat,"XYZ"),n=mn(this.lastTrans.quat,"XYZ");e.set(n.x-t.x,n.y-t.y,n.z-t.z);const r=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*r*r+6*r)/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 ot=new Z,It=new Z;class gr extends wt{up;target;constructor(e){super(),this.up=new Z(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=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){ot.set(this.trans.loc),It.set(this.target.trans.loc);const t=At(ot,It,this.up);this.trans.quat.set(t)}}class Er extends Gn{up;target;constructor(e){super(),this.up=new Z(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),ot.set(this.trans.loc),It.set(this.target.trans.loc);const t=At(ot,It,this.up);this.trans.quat.set(t)}}const Un={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class mr extends Pn{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...Un,...t},this.target=e,this.lookFrom=new Z(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Oe.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e);const t=new qe;ot.set(this.trans.loc),It.set(this.target.trans.loc);const n=At(ot,It,this.up);n.mul(new Te(0,1,0,0)),t.quat.set(n),ot.set(this.lookFrom),ot.apply(this.target.quat),ot.add(this.target.loc),t.loc.set(ot),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 $t={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function jn(i){return typeof i=="string"}function an(i){return i.isMesh===!0}function Ir(i){return i.type==="RoundedBoxGeometry"}function br(i){return i.type==="BoxGeometry"}function Cr(i){return i.type==="SphereGeometry"}function yr(i){return i.type==="IcosahedronGeometry"}function Br(i){return i.type==="CylinderGeometry"}function wr(i){return i.type==="CapsuleGeometry"}function Tr(i){return i.isBone===!0}function Rr(i){return i.isPerspectiveCamera===!0}let He;const it=new Map;class Tt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Tt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Tt.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 An(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class An{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,r)=>{const o=it.get(t),s=it.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e}}class In{trans;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...$t,...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(r=>{if(an(r)){const o=kr(r.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=vr(r),A=bn(r.geometry);break;case"convex_hull":c=Qr(r),A=bn(r.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((r,o)=>r+o,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.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&&it.set(n.handle,this.objectA3)}))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),it.delete(t.handle)})}isGrounded(){return this.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 Z),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 Z),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 vr(i){let e=null;if(an(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let o=n.index?n.index.array:null;if(o)o instanceof Uint32Array||(o=new Uint32Array(o));else{const s=n.attributes.position.count;o=new Uint32Array(s);for(let c=0;c<s;c++)o[c]=c}r instanceof Float32Array&&(e=He.ColliderDesc.trimesh(r,o))}return e}function Qr(i){let e=null;if(an(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=He.ColliderDesc.convexHull(r))}return e}function bn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const o=new 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 h=A[a]*3,u=A[a+1]*3,b=A[a+2]*3;o.set(n[h],n[h+1],n[h+2]),s.set(n[u],n[u+1],n[u+2]),c.set(n[b],n[b+1],n[b+2]),r+=o.dot(s.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)o.set(n[A],n[A+1],n[A+2]),s.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=o.dot(s.clone().cross(c));return Math.abs(r)/6}function kr(i){if(Ir(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:He.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(br(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:He.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Cr(i)){const e=i.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(yr(i)){const e=i.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(Br(i)){const e=i.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(wr(i)){const e=i.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 en=new Tt;async function Sr(){await en.init()}const H={v0:new Z,v1:new Z,v2:new Z,v3:new Z,v4:new Z,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 Lr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function Hn(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Mn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function cn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Mn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function qn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=xr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const _r={"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 xr(i){for(const[e,t]of Object.entries(_r))if(t.test(i))return e;return"application/octet-stream"}function _t(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=_t(i[n],e[n]):t[n]=e[n];return t}const Nr=new se.SphereGeometry,Dr=new se.MeshStandardMaterial({color:16711680});let Fr=new se.Mesh(Nr,Dr);class Oe{static defaultRotationOrder="XYZ";static defaultUpVector=new Z(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 Fr.clone()}initTransformer(e){return new wt}setTransformer(e){H.t0.set(this.transformer.trans),e.init(H.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new wt);else if(e==="Interpolation")this.setTransformer(new Gn);else if(e==="Billboard")this.setTransformer(new gr(t));else if(e==="InterpolationBillboard")this.setTransformer(new Er(t));else if(e==="SimplePhysics"){const n={...$t,...t};this.setTransformer(new In(n))}}initSimplePhysics(e){const t={...$t,...e};this.setTransformer(new In(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 Or(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}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"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLocation(H.v0)}setLocationNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLocationNow(H.v0)}get quat(){return this.trans.quat}setQuat(e,t,n,r){typeof e=="number"?H.q0.set(e,t,n,r):H.q0.set(e),this.transformer.setQuat(H.q0)}setQuatNow(e,t,n,r){typeof e=="number"?H.q0.set(e,t,n,r):H.q0.set(e),this.transformer.setQuatNow(H.q0)}get scale(){return this.trans.scale}setScale(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setScale(H.v0)}setScaleNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setScaleNow(H.v0)}setRotation(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e),r.scale(Math.PI/360);const o=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,s=dt(r,o);this.setQuat(s)}setRotationNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e);const o=this.rotationOrder?this.rotationOrder:Oe.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(r.x),0,0,Math.cos(r.x)));break;case"Y":s.mul(new Te(0,Math.sin(r.y),0,Math.cos(r.y)));break;case"Z":s.mul(new Te(0,0,Math.sin(r.z),Math.cos(r.z)));break}this.setQuatNow(s)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);this.setQuatNow(s)}getUnitVecX(){return new Z(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Z(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Z(0,0,1).apply(this.object.quaternion)}addLocation(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocation(r)}addLocationNow(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocationNow(r)}mulQuat(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuat(o)}mulQuatNow(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuatNow(o)}mulRotation(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),H.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,o=dt(H.v0,r);H.q0.set(this.quat),H.q0.mul(o),this.setQuat(H.q0)}mulRotationNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),H.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,o=dt(H.v0,r);H.q0.set(this.quat),H.q0.mul(o),this.setQuatNow(H.q0)}mulScale(e,t,n){H.v0.set(this.scale),typeof e=="number"?H.v0.set(H.v0.x*e,H.v0.y*t,H.v0.z*n):H.v0.set(H.v0.x*e.x,H.v0.y*e.y,H.v0.z*e.z),this.setScale(H.v0)}mulScaleNow(e,t,n){H.v0.set(this.scale),typeof e=="number"?H.v0.set(H.v0.x*e,H.v0.y*t,H.v0.z*n):H.v0.set(H.v0.x*e.x,H.v0.y*e.y,H.v0.z*e.z),this.setScaleNow(H.v0)}moveForward(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(e),this.addLocation(H.v0)}moveForwardNow(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(e),this.addLocationNow(H.v0)}moveBackward(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(-e),this.addLocation(H.v0)}moveBackwardNow(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(-e),this.addLocationNow(H.v0)}moveRight(e){H.v0.set(this.getUnitVecX()),H.v0.scale(-e),this.addLocation(H.v0)}moveRightNow(e){H.v0.set(this.getUnitVecX()),H.v0.scale(-e),this.addLocationNow(H.v0)}moveLeft(e){H.v0.set(this.getUnitVecX()),H.v0.scale(e),this.addLocation(H.v0)}moveLeftNow(e){H.v0.set(this.getUnitVecX()),H.v0.scale(e),this.addLocationNow(H.v0)}moveUp(e){H.v0.set(this.getUnitVecY()),H.v0.scale(e),this.addLocation(H.v0)}moveUpNow(e){H.v0.set(this.getUnitVecY()),H.v0.scale(e),this.addLocationNow(H.v0)}moveDown(e){H.v0.set(this.getUnitVecY()),H.v0.scale(-e),this.addLocation(H.v0)}moveDownNow(e){H.v0.set(this.getUnitVecY()),H.v0.scale(-e),this.addLocationNow(H.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"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLinvel(H.v0)}getLinvel(e){return this.transformer.getLinvel(e)}setAngvel(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setAngvel(H.v0)}getAngvel(e){return this.transformer.getAngvel(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.addForce(H.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")H.v0.set(e,t,n),H.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else H.v0.set(e),H.v1.set(t);this.transformer.addForceAtPoint(H.v0,H.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.addTorque(H.v0)}applyImpulse(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.applyImpulse(H.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")H.v0.set(e,t,n),H.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else H.v0.set(e),H.v1.set(t);this.transformer.applyImpulseAtPoint(H.v0,H.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.applyTorqueImpulse(H.v0)}isGrounded(){return this.transformer.isGrounded()}}class Or{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}}}const Mr={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Pr(){try{at.listener.context.state!=="running"&&await at.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class at extends Oe{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=_t(Mr,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new se.PositionalAudio(at.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);const n=this.options.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}else{const t=new se.Audio(at.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{at.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class Rt extends Oe{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.object.add(this.currentAction.shape.root),this.morphs=n}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.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0){if(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.currentAction?.shape.root&&this.object.remove(this.currentAction.shape.root),this.currentAction?.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.emoteAction=void 0,this.stateAction&&(this.object.add(this.stateAction.shape.root),this.currentAction=this.stateAction,this.stateAction.sound))){const n=this.stateAction.sound;n.play(),this.stateAction.motion.setFinishListener(()=>{n.play()})}}else this.stateAction&&(t=this.stateAction.motion.update(e));if(t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(r.loc&&o.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&o.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&o.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.morphsOverwrite&&r.morphs){for(const s of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(s.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=s.vals[a];break}}}this.object.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class Cn{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{}}}class zn{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],en.isInitialized&&(this.physicsWorld=en.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 Rt))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld)}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 Rt))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld)}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 An){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(r,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 Kn extends Oe{controller;setController(e){this.controller=e}setLocation(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocation(r):super.setLocation(r)}setLocationNow(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocationNow(r):super.setLocationNow(r)}setQuat(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuat(o):this.transformer.setQuat(o)}setQuatNow(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuatNow(o):this.transformer.setQuatNow(o)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuatNow(s)}}class xt{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 Vn extends xt{preMouse;leftClick=!1;rightClick=!1;target;cameraLoc=new Z(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 Z(e,t,n):this.target=new Z(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),r=.01*(e.clientY-this.preMouse.y),o=Math.sin(-n),s=Math.cos(-n),c=Math.sin(-r),A=Math.cos(-r),a=new Z(1,0,0).apply(this.cameraQuat),h=new Z(0,1,0).apply(this.cameraQuat),u=new Te(a.x*c,a.y*c,a.z*c,A),b=new Te(h.x*o,h.y*o,h.z*o,s),f=new Z(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const I=At(this.cameraLoc,this.target,new Z(0,1,0));I.mul(new Te(0,1,0,0)),this.cameraQuat.set(I),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}else if(this.leftClick){H.v0.set(this.target),H.v0.sub(this.cameraLoc);const n=.005*H.v0.length(),r=n*(e.clientX-this.preMouse.x),o=n*(e.clientY-this.preMouse.y),s=new Z(1,0,0).apply(this.cameraQuat).scale(-r),c=new Z(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 Z(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 Z(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 Gr={speed:.1,angSpeed:.01};class Ur extends xt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Gr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new Z,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 r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(o),this._velY+=-9.8*e*.1,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=.5)),this._avatarNextLoc.add(0,this._velY,0),this._keyLeft&&this._avatarNextQuat.mul(dt(new Z(0,this.options.angSpeed,0))),this._keyRight&&this._avatarNextQuat.mul(dt(new Z(0,-this.options.angSpeed,0))),t.transformer.setLocation(this._avatarNextLoc),t.transformer.setQuat(this._avatarNextQuat)}}const jr={speed:5,angSpeed:.3,jumpSpeed:15};class Hr extends xt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...jr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new Z,this._avatarNextAngVel=new Z,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar;new qe().set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(r),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(r),this._keyD&&this._avatarNextVel.sub(o),this._velY+=-9.8*e,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=this.options.jumpSpeed)),this._avatarNextVel.add(0,this._velY,0),this._keyLeft&&this._avatarNextAngVel.add(new Z(0,this.options.angSpeed,0)),this._keyRight&&this._avatarNextAngVel.add(new Z(0,-this.options.angSpeed,0)),t.transformer.setLinvel(this._avatarNextVel),t.transformer.setAngvel(this._avatarNextAngVel)}}class Wn{scene;camera;controller;constructor(e){this.scene=new zn,this.camera=e,this.camera.setAudioListener(at.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new Vn(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 Kn{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){Rr(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 Yn extends g.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 g.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 g.Vector3,yn=new g.Matrix4,Bn=new g.Matrix4,wn=new g.Vector3,Tn=new g.Vector3;class Jn{constructor(e={}){const t=this;let n,r,o,s;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(I,E){I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),E.parent===null&&E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),yn.copy(E.matrixWorldInverse),Bn.multiplyMatrices(E.projectionMatrix,yn),h(I,I,E),this.sortObjects&&f(I)},this.setSize=function(I,E){n=I,r=E,o=n/2,s=r/2,A.style.width=I+"px",A.style.height=E+"px"};function a(I){I.isCSS2DObject&&(I.element.style.display="none");for(let E=0,l=I.children.length;E<l;E++)a(I.children[E])}function h(I,E,l){if(I.visible===!1){a(I);return}if(I.isCSS2DObject){gt.setFromMatrixPosition(I.matrixWorld),gt.applyMatrix4(Bn);const d=gt.z>=-1&>.z<=1&&I.layers.test(l.layers)===!0,p=I.element;p.style.display=d===!0?"":"none",d===!0&&(I.onBeforeRender(t,E,l),p.style.transform="translate("+-100*I.center.x+"%,"+-100*I.center.y+"%)translate("+(gt.x*o+o)+"px,"+(-gt.y*s+s)+"px)",p.parentNode!==A&&A.appendChild(p),I.onAfterRender(t,E,l));const C={distanceToCameraSquared:u(l,I)};c.objects.set(I,C)}for(let d=0,p=I.children.length;d<p;d++)h(I.children[d],E,l)}function u(I,E){return wn.setFromMatrixPosition(I.matrixWorld),Tn.setFromMatrixPosition(E.matrixWorld),wn.distanceToSquared(Tn)}function b(I){const E=[];return I.traverseVisible(function(l){l.isCSS2DObject&&E.push(l)}),E}function f(I){const E=b(I).sort(function(d,p){if(d.renderOrder!==p.renderOrder)return p.renderOrder-d.renderOrder;const C=c.objects.get(d).distanceToCameraSquared,m=c.objects.get(p).distanceToCameraSquared;return C-m}),l=E.length;for(let d=0,p=E.length;d<p;d++)E[d].element.style.zIndex=l-d}}}function Rn(i,e){if(e===g.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===g.TriangleFanDrawMode||e===g.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const s=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);i.setIndex(s),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===g.TriangleFanDrawMode)for(let s=1;s<=n;s++)r.push(t.getX(0)),r.push(t.getX(s)),r.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(r.push(t.getX(s)),r.push(t.getX(s+1)),r.push(t.getX(s+2))):(r.push(t.getX(s+2)),r.push(t.getX(s+1)),r.push(t.getX(s)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Xn extends g.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Wr(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new ro(t)}),this.register(function(t){return new oo(t)}),this.register(function(t){return new so(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new eo(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new to(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new io(t)}),this.register(function(t){return new no(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new ao(t)}),this.register(function(t){return new Ao(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=g.LoaderUtils.extractUrlBase(e);s=g.LoaderUtils.resolveURL(a,this.path)}else s=g.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new g.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(h){t(h),o.manager.itemEnd(e)},c)}catch(h){c(h)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let o;const s={},c={},A=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===Zn){try{s[Se.KHR_BINARY_GLTF]=new co(e)}catch(u){r&&r(u);return}o=JSON.parse(s[Se.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new Bo(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 h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](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 h=0;h<o.extensionsUsed.length;++h){const u=o.extensionsUsed[h],b=o.extensionsRequired||[];switch(u){case Se.KHR_MATERIALS_UNLIT:s[u]=new Kr;break;case Se.KHR_DRACO_MESH_COMPRESSION:s[u]=new lo(o,this.dracoLoader);break;case Se.KHR_TEXTURE_TRANSFORM:s[u]=new uo;break;case Se.KHR_MESH_QUANTIZATION:s[u]=new ho;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,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function qr(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Se={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class zr{constructor(e){this.parser=e,this.name=Se.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const h=new g.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],g.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new g.DirectionalLight(h),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new g.PointLight(h),a.distance=u;break;case"spot":a=new g.SpotLight(h),a.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,a.angle=A.spot.outerConeAngle,a.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return a.position.set(0,0,0),rt(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class Kr{constructor(){this.name=Se.KHR_MATERIALS_UNLIT}getMaterialType(){return g.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new g.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],g.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,g.SRGBColorSpace))}return Promise.all(r)}}class Vr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Wr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const c=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new g.Vector2(c,c)}return Promise.all(o)}}class Yr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class Jr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(o)}}class Xr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new g.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,g.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Zr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(o)}}class $r{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const c=s.attenuationColor||[1,1,1];return t.attenuationColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),Promise.all(o)}}class eo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class to{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const c=s.specularColorFactor||[1,1,1];return t.specularColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,g.SRGBColorSpace)),Promise.all(o)}}class no{constructor(e){this.parser=e,this.name=Se.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(o)}}class io{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(o)}}class ro{constructor(e){this.parser=e,this.name=Se.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const o=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,s)}}class oo{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class so{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class ao{constructor(e){this.name=Se.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,h=r.count,u=r.byteStride,b=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(h,u,b,r.mode,r.filter).then(function(f){return f.buffer}):s.ready.then(function(){const f=new ArrayBuffer(h*u);return s.decodeGltfBuffer(new Uint8Array(f),h,u,b,r.mode,r.filter),f})})}else return null}}class Ao{constructor(e){this.name=Se.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==$e.TRIANGLES&&a.mode!==$e.TRIANGLE_STRIP&&a.mode!==$e.TRIANGLE_FAN&&a.mode!==void 0)return null;const s=n.extensions[this.name].attributes,c=[],A={};for(const a in s)c.push(this.parser.getDependency("accessor",s[a]).then(h=>(A[a]=h,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const h=a.pop(),u=h.isGroup?h.children:[h],b=a[0].count,f=[];for(const I of u){const E=new g.Matrix4,l=new g.Vector3,d=new g.Quaternion,p=new g.Vector3(1,1,1),C=new g.InstancedMesh(I.geometry,I.material,b);for(let m=0;m<b;m++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,m),A.ROTATION&&d.fromBufferAttribute(A.ROTATION,m),A.SCALE&&p.fromBufferAttribute(A.SCALE,m),C.setMatrixAt(m,E.compose(l,d,p));for(const m in A)if(m==="_COLOR_0"){const y=A[m];C.instanceColor=new g.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else m!=="TRANSLATION"&&m!=="ROTATION"&&m!=="SCALE"&&I.geometry.setAttribute(m,A[m]);g.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),f.push(C)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const Zn="glTF",bt=12,vn={JSON:1313821514,BIN:5130562};class co{constructor(e){this.name=Se.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,bt),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Zn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-bt,o=new DataView(e,bt);let s=0;for(;s<r;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===vn.JSON){const a=new Uint8Array(e,bt+s,c);this.content=n.decode(a)}else if(A===vn.BIN){const a=bt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class lo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Se.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const h in s){const u=tn[h]||h.toLowerCase();c[u]=s[h]}for(const h in e.attributes){const u=tn[h]||h.toLowerCase();if(s[h]!==void 0){const b=n.accessors[e.attributes[h]],f=mt[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",o).then(function(h){return new Promise(function(u,b){r.decodeDracoFile(h,function(f){for(const I in f.attributes){const E=f.attributes[I],l=A[I];l!==void 0&&(E.normalized=l)}u(f)},c,a,g.LinearSRGBColorSpace,b)})})}}class uo{constructor(){this.name=Se.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class ho{constructor(){this.name=Se.KHR_MESH_QUANTIZATION}}class $n extends g.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,h=r-t,u=(n-t)/h,b=u*u,f=b*u,I=e*a,E=I-a,l=-2*f+3*b,d=f-b,p=1-l,C=d-b+u;for(let m=0;m!==c;m++){const y=s[E+m+c],Q=s[E+m+A]*h,_=s[I+m+c],j=s[I+m]*h;o[m]=p*y+C*Q+l*_+d*j}return o}}const fo=new g.Quaternion;class po extends $n{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return fo.fromArray(o).normalize().toArray(o),o}}const $e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},mt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qn={9728:g.NearestFilter,9729:g.LinearFilter,9984:g.NearestMipmapNearestFilter,9985:g.LinearMipmapNearestFilter,9986:g.NearestMipmapLinearFilter,9987:g.LinearMipmapLinearFilter},kn={33071:g.ClampToEdgeWrapping,33648:g.MirroredRepeatWrapping,10497:g.RepeatWrapping},Gt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ut={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},go={CUBICSPLINE:void 0,LINEAR:g.InterpolateLinear,STEP:g.InterpolateDiscrete},Ut={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Eo(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new g.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:g.FrontSide})),i.DefaultMaterial}function ht(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function rt(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function mo(i,e,t){let n=!1,r=!1,o=!1;for(let a=0,h=e.length;a<h;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const s=[],c=[],A=[];for(let a=0,h=e.length;a<h;a++){const u=e[a];if(n){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(b)}if(r){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(b)}if(o){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(b)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const h=a[0],u=a[1],b=a[2];return n&&(i.morphAttributes.position=h),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=b),i.morphTargetsRelative=!0,i})}function Io(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bo(i){let e;const t=i.extensions&&i.extensions[Se.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+jt(t.attributes):e=i.indices+":"+jt(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+jt(i.targets[n]);return e}function jt(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function nn(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Co(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const yo=new g.Matrix4;class Bo{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new qr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,o=!1,s=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,o=c.indexOf("Firefox")>-1,s=o?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||o&&s<98?this.textureLoader=new g.TextureLoader(this.options.manager):this.textureLoader=new g.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new g.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const c={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:n,userData:{}};return ht(o,c,r),rt(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const s=t[r].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(n[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),o=(s,c)=>{const A=this.associations.get(s);A!=null&&this.associations.set(c,A);for(const[a,h]of s.children.entries())o(h,c.children[a])};return o(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const o=e(t[r]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,s){return n.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Se.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,s){n.load(g.LoaderUtils.resolveURL(t.uri,r.path),o,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=Gt[r.type],c=mt[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new g.BufferAttribute(a,s,A))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Gt[r.type],a=mt[r.componentType],h=a.BYTES_PER_ELEMENT,u=h*A,b=r.byteOffset||0,f=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,I=r.normalized===!0;let E,l;if(f&&f!==u){const d=Math.floor(b/f),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+d+":"+r.count;let C=t.cache.get(p);C||(E=new a(c,d*f,r.count*f/h),C=new g.InterleavedBuffer(E,f/h),t.cache.add(p,C)),l=new g.InterleavedBufferAttribute(C,A,b%f/h,I)}else c===null?E=new a(r.count*A):E=new a(c,b,r.count*A),l=new g.BufferAttribute(E,A,I);if(r.sparse!==void 0){const d=Gt.SCALAR,p=mt[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,m=r.sparse.values.byteOffset||0,y=new p(s[1],C,r.sparse.count*d),Q=new a(s[2],m,r.sparse.count*A);c!==null&&(l=new g.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let _=0,j=y.length;_<j;_++){const v=y[_];if(l.setX(v,Q[_*A]),A>=2&&l.setY(v,Q[_*A+1]),A>=3&&l.setZ(v,Q[_*A+2]),A>=4&&l.setW(v,Q[_*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=I}return l})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let c=this.textureLoader;if(s.uri){const A=n.manager.getHandler(s.uri);A!==null&&(c=A)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,s=o.textures[e],c=o.images[t],A=(c.uri||c.bufferView)+":"+s.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=s.name||c.name||"",h.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(h.name=c.uri);const b=(o.samplers||{})[s.sampler]||{};return h.magFilter=Qn[b.magFilter]||g.LinearFilter,h.minFilter=Qn[b.minFilter]||g.LinearMipmapLinearFilter,h.wrapS=kn[b.wrapS]||g.RepeatWrapping,h.wrapT=kn[b.wrapT]||g.RepeatWrapping,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==g.NearestFilter&&h.minFilter!==g.LinearFilter,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=r.images[e],c=self.URL||self.webkitURL;let A=s.uri||"",a=!1;if(s.bufferView!==void 0)A=n.getDependency("bufferView",s.bufferView).then(function(u){a=!0;const 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 h=Promise.resolve(A).then(function(u){return new Promise(function(b,f){let I=b;t.isImageBitmapLoader===!0&&(I=function(E){const l=new g.Texture(E);l.needsUpdate=!0,b(l)}),t.load(g.LoaderUtils.resolveURL(u,o.path),I,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),rt(u,s),u.userData.mimeType=s.mimeType||Co(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[Se.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Se.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[Se.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return r!==void 0&&(s.colorSpace=r),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new g.PointsMaterial,g.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 g.LineBasicMaterial,g.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(r||o||s){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),s&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),o&&(A.vertexColors=!0),s&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return g.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[Se.KHR_MATERIALS_UNLIT]){const u=r[Se.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new g.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],g.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,g.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=g.DoubleSide);const h=o.alphaMode||Ut.OPAQUE;if(h===Ut.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,h===Ut.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new g.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==g.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new g.Color().setRGB(u[0],u[1],u[2],g.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==g.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,g.SRGBColorSpace)),Promise.all(a).then(function(){const u=new s(c);return o.name&&(u.name=o.name),rt(u,o),t.associations.set(u,{materials:e}),o.extensions&&ht(r,u,o),u})}createUniqueName(e){const t=g.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function o(c){return n[Se.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return Sn(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],h=bo(a),u=r[h];if(u)s.push(u.promise);else{let b;a.extensions&&a.extensions[Se.KHR_DRACO_MESH_COMPRESSION]?b=o(a):b=Sn(new g.BufferGeometry,a,t),r[h]={primitive:a,promise:b},s.push(b)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],s=o.primitives,c=[];for(let A=0,a=s.length;A<a;A++){const h=s[A].material===void 0?Eo(this.cache):this.getDependency("material",s[A].material);c.push(h)}return c.push(t.loadGeometries(s)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let f=0,I=h.length;f<I;f++){const E=h[f],l=s[f];let d;const p=a[f];if(l.mode===$e.TRIANGLES||l.mode===$e.TRIANGLE_STRIP||l.mode===$e.TRIANGLE_FAN||l.mode===void 0)d=o.isSkinnedMesh===!0?new g.SkinnedMesh(E,p):new g.Mesh(E,p),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),l.mode===$e.TRIANGLE_STRIP?d.geometry=Rn(d.geometry,g.TriangleStripDrawMode):l.mode===$e.TRIANGLE_FAN&&(d.geometry=Rn(d.geometry,g.TriangleFanDrawMode));else if(l.mode===$e.LINES)d=new g.LineSegments(E,p);else if(l.mode===$e.LINE_STRIP)d=new g.Line(E,p);else if(l.mode===$e.LINE_LOOP)d=new g.LineLoop(E,p);else if(l.mode===$e.POINTS)d=new g.Points(E,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(d.geometry.morphAttributes).length>0&&Io(d,o),d.name=t.createUniqueName(o.name||"mesh_"+e),rt(d,o),l.extensions&&ht(r,d,l),t.assignFinalMaterial(d),u.push(d)}for(let f=0,I=u.length;f<I;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return o.extensions&&ht(r,u[0],o),u[0];const b=new g.Group;o.extensions&&ht(r,b,o),t.associations.set(b,{meshes:e});for(let f=0,I=u.length;f<I;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new g.PerspectiveCamera(g.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new g.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),rt(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),s=r,c=[],A=[];for(let a=0,h=s.length;a<h;a++){const u=s[a];if(u){c.push(u);const b=new g.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 g.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,s=[],c=[],A=[],a=[],h=[];for(let u=0,b=r.channels.length;u<b;u++){const f=r.channels[u],I=r.samplers[f.sampler],E=f.target,l=E.node,d=r.parameters!==void 0?r.parameters[I.input]:I.input,p=r.parameters!==void 0?r.parameters[I.output]:I.output;E.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",d)),A.push(this.getDependency("accessor",p)),a.push(I),h.push(E))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(h)]).then(function(u){const b=u[0],f=u[1],I=u[2],E=u[3],l=u[4],d=[];for(let C=0,m=b.length;C<m;C++){const y=b[C],Q=f[C],_=I[C],j=E[C],v=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,Q,_,j,v);if(M)for(let x=0;x<M.length;x++)d.push(M[x])}const p=new g.AnimationClip(o,void 0,d);return rt(p,r),p})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),s})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=r.children||[];for(let a=0,h=c.length;a<h;a++)s.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const h=a[0],u=a[1],b=a[2];b!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(b,yo)});for(let f=0,I=u.length;f<I;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?r.createUniqueName(o.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(a){return r._getNodeRef(r.cameraCache,o.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let h;if(o.isBone===!0?h=new g.Bone:a.length>1?h=new g.Group:a.length===1?h=a[0]:h=new g.Object3D,h!==a[0])for(let u=0,b=a.length;u<b;u++)h.add(a[u]);if(o.name&&(h.userData.name=o.name,h.name=s),rt(h,o),o.extensions&&ht(n,h,o),o.matrix!==void 0){const u=new g.Matrix4;u.fromArray(o.matrix),h.applyMatrix4(u)}else o.translation!==void 0&&h.position.fromArray(o.translation),o.rotation!==void 0&&h.quaternion.fromArray(o.rotation),o.scale!==void 0&&h.scale.fromArray(o.scale);if(!r.associations.has(h))r.associations.set(h,{});else if(o.mesh!==void 0&&r.meshCache.refs[o.mesh]>1){const u=r.associations.get(h);r.associations.set(h,{...u})}return r.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new g.Group;n.name&&(o.name=r.createUniqueName(n.name)),rt(o,n),n.extensions&&ht(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(r.getDependency("node",s[A]));return Promise.all(c).then(function(A){for(let h=0,u=A.length;h<u;h++)o.add(A[h]);const a=h=>{const u=new Map;for(const[b,f]of r.associations)(b instanceof g.Material||b instanceof g.Texture)&&u.set(b,f);return h.traverse(b=>{const f=r.associations.get(b);f!=null&&u.set(b,f)}),u};return r.associations=a(o),o})}_createAnimationTracks(e,t,n,r,o){const s=[],c=e.name?e.name:e.uuid,A=[];ut[o.path]===ut.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(ut[o.path]){case ut.weights:a=g.NumberKeyframeTrack;break;case ut.rotation:a=g.QuaternionKeyframeTrack;break;case ut.translation:case ut.scale:a=g.VectorKeyframeTrack;break;default:n.itemSize===1?a=g.NumberKeyframeTrack:a=g.VectorKeyframeTrack;break}const h=r.interpolation!==void 0?go[r.interpolation]:g.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const I=new a(A[b]+"."+ut[o.path],t.array,u,h);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),s.push(I)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=nn(t.constructor),r=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof g.QuaternionKeyframeTrack?po:$n;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function wo(i,e,t){const n=e.attributes,r=new g.Box3;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(r.set(new g.Vector3(A[0],A[1],A[2]),new g.Vector3(a[0],a[1],a[2])),c.normalized){const h=nn(mt[c.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}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 g.Vector3,A=new g.Vector3;for(let a=0,h=o.length;a<h;a++){const u=o[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,I=b.max;if(f!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(I[2]))),b.normalized){const E=nn(mt[b.componentType]);A.multiplyScalar(E)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new g.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function Sn(i,e,t){const n=e.attributes,r=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){i.setAttribute(c,A)})}for(const s in n){const c=tn[s]||s.toLowerCase();c in i.attributes||r.push(o(n[s],c))}if(e.indices!==void 0&&!i.index){const s=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(s)}return g.ColorManagement.workingColorSpace!==g.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${g.ColorManagement.workingColorSpace}" not supported.`),rt(i,e),wo(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?mo(i,e.targets,t):i})}const Ht=new WeakMap;class To extends g.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,g.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=g.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:o};return this.decodeGeometry(e,c).then(t).catch(s)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Ht.has(e)){const A=Ht.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(r=A,new Promise((a,h)=>{r._callbacks[o]={resolve:a,reject:h},r.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&o&&this._releaseTask(r,o)}),Ht.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new g.BufferGeometry;e.index&&t.setIndex(new g.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:r,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new g.BufferAttribute(o,s);else{const h=new g.InterleavedBuffer(o,c);a=new g.InterleavedBufferAttribute(h,s,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==g.SRGBColorSpace)return;const n=new g.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),g.ColorManagement.colorSpaceToWorking(n,g.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new g.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,o)=>{n.load(e,r,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=Ro.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
2
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(o){const s=o.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,o){return r._taskLoad>o._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function Ro(){let i,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(h=>{const u=h.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),I=f.attributes.map(E=>E.array.buffer);f.index&&I.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},I)}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 h=a.attributeIDs,u=a.attributeTypes;let b,f;const I=c.GetEncodedGeometryType(A);if(I===s.TRIANGULAR_MESH)b=new s.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(I===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 E={index:null,attributes:[]};for(const l in h){const d=self[u[l]];let p,C;if(a.useUniqueIDs)C=h[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,s[h[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const m=r(s,c,b,l,d,p);l==="color"&&(m.vertexColorSpace=a.vertexColorSpace),E.attributes.push(m)}return I===s.TRIANGULAR_MESH&&(E.index=n(s,c,b)),s.destroy(b),E}function n(s,c,A){const h=A.num_faces()*3,u=h*4,b=s._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(s.HEAPF32.buffer,b,h).slice();return s._free(b),{array:f,itemSize:1}}function r(s,c,A,a,h,u){const b=A.num_points(),f=u.num_components(),I=o(s,h),E=f*h.BYTES_PER_ELEMENT,l=Math.ceil(E/4)*4,d=l/h.BYTES_PER_ELEMENT,p=b*E,C=b*l,m=s._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,I,p,m);const y=new h(s.HEAPF32.buffer,m,p/h.BYTES_PER_ELEMENT);let Q;if(E===l)Q=y.slice();else{Q=new h(C/h.BYTES_PER_ELEMENT);let _=0;for(let j=0,v=y.length;j<v;j++){for(let M=0;M<f;M++)Q[_+M]=y[j*f+M];_+=d}}return s._free(m),{name:a,count:b,itemSize:f,array:Q,stride:d}}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 vo{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:r,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,s)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Qo=0,Ln=2,ko=1,_n=2,So=0,Lo=1,_o=10,xo=0,ei=9,ti=15,ni=16,ii=22,ri=37,oi=43,si=76,ai=83,Ai=97,ci=100,li=103,ui=109,hi=122,di=123,fi=131,pi=132,gi=133,Ei=134,mi=137,Ii=138,bi=139,Ci=140,yi=141,Bi=142,wi=145,Ti=146,Ri=148,vi=152,rn=153,No=154,on=155,Do=156,Qi=157,ki=158,Si=165,Li=166,_i=1000054e3,xi=1000054001,Ni=1000054004,Di=1000054005,ln=1000066e3,Fi=1000066004;class Ct{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function xn(i){return new TextDecoder().decode(i)}function Fo(i){const e=new Uint8Array(i.buffer,i.byteOffset,Je.length);if(e[0]!==Je[0]||e[1]!==Je[1]||e[2]!==Je[2]||e[3]!==Je[3]||e[4]!==Je[4]||e[5]!==Je[5]||e[6]!==Je[6]||e[7]!==Je[7]||e[8]!==Je[8]||e[9]!==Je[9]||e[10]!==Je[10]||e[11]!==Je[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new Ct(i,Je.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const o=r._nextUint32(),s=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),h=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new Ct(i,Je.length+n,u,!0);for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new Ct(i,o,s,!0);f._skip(4);const I=f._nextUint16(),E=f._nextUint16(),l=f._nextUint16(),d=f._nextUint16(),p={vendorId:I,descriptorType:E,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=(d/4-6)/4;for(let oe=0;oe<C;oe++){const ae={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&ae.channelType?(ae.sampleLower=f._nextInt32(),ae.sampleUpper=f._nextInt32()):(ae.sampleLower=f._nextUint32(),ae.sampleUpper=f._nextUint32()),p.samples[oe]=ae}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const m=new Ct(i,c,A,!0);for(;m._offset<A;){const oe=m._nextUint32(),ae=m._scan(oe),Ae=xn(ae);if(t.keyValue[Ae]=m._nextUint8Array(oe-ae.byteLength-1),Ae.match(/^ktx/i)){const Ie=xn(t.keyValue[Ae]);t.keyValue[Ae]=Ie.substring(0,Ie.lastIndexOf("\0"))}m._skip(oe%4?4-oe%4:0)}if(h<=0)return t;const y=new Ct(i,a,h,!0),Q=y._nextUint16(),_=y._nextUint16(),j=y._nextUint32(),v=y._nextUint32(),M=y._nextUint32(),x=y._nextUint32(),R=[];for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)R.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const N=a+y._offset,L=N+j,W=L+v,J=W+M,K=new Uint8Array(i.buffer,i.byteOffset+N,j),ee=new Uint8Array(i.buffer,i.byteOffset+L,v),te=new Uint8Array(i.buffer,i.byteOffset+W,M),ue=new Uint8Array(i.buffer,i.byteOffset+J,x);return t.globalData={endpointCount:Q,selectorCount:_,imageDescs:R,endpointsData:K,selectorsData:ee,tablesData:te,extendedData:ue},t}let qt,st,sn;const zt={env:{emscripten_notify_memory_growth:function(i){sn=new Uint8Array(st.exports.memory.buffer)}}};class Oo{init(){return qt||(qt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Nn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,zt)).then(this._init):WebAssembly.instantiate(Buffer.from(Nn,"base64"),zt).then(this._init),qt)}_init(e){st=e.instance,zt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=st.exports.malloc(n);sn.set(e,r),t=t||Number(st.exports.ZSTD_findDecompressedSize(r,n));const o=st.exports.malloc(t),s=st.exports.ZSTD_decompress(o,t,r,n),c=sn.slice(o,o+s);return st.exports.free(r),st.exports.free(o),c}}const Nn="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwAB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AAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0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iECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAg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0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIA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AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Mo="display-p3",Po="display-p3-linear";({...g.ColorManagement.spaces[g.SRGBColorSpace]});const Kt=new WeakMap;let Vt=0,Wt;class et extends g.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new vo,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 g.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new g.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([o,s])=>{const c=et.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(et.EngineFormat),"let _EngineType = "+JSON.stringify(et.EngineType),"let _TranscoderFormat = "+JSON.stringify(et.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(et.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=s,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),a})}),Vt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Vt++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setRequestHeader(this.requestHeader),o.setResponseType("arraybuffer"),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Kt.has(e))return Kt.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:h}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new g.CompressedCubeTexture(o,A,a);else{const b=o[0].mipmaps;u=t.layerCount>1?new g.CompressedArrayTexture(b,s,c,t.layerCount,A,a):new g.CompressedTexture(b,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?g.LinearFilter:g.LinearMipmapLinearFilter,u.magFilter=g.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Oi(t),u.premultiplyAlpha=!!(h&ko),u}async _createTexture(e,t={}){const n=Fo(new Uint8Array(e)),r=n.vkFormat===ln&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===xo||r&&!this.workerConfig.astcHDRSupported))return Uo(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 Kt.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Vt--}}et.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};et.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};et.EngineFormat={RGBAFormat:g.RGBAFormat,RGBA_ASTC_4x4_Format:g.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:g.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:g.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:g.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:g.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:g.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:g.RGB_ETC1_Format,RGB_ETC2_Format:g.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:g.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:g.RGBA_S3TC_DXT1_Format};et.EngineType={UnsignedByteType:g.UnsignedByteType,HalfFloatType:g.HalfFloatType,FloatType:g.FloatType};et.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(I){const E=I.data;switch(E.type){case"init":i=E.config,c(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:d,width:p,height:C,hasAlpha:m,format:y,type:Q,dfdFlags:_}=A(E.buffer);self.postMessage({type:"transcode",id:E.id,data:{faces:l,width:p,height:C,hasAlpha:m,format:y,type:Q,dfdFlags:_}},d)}catch(l){console.error(l),self.postMessage({type:"error",id:E.id,error:l.message})}});break}});function c(I){e=new Promise(E=>{t={wasmBinary:I,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const E=new t.KTX2File(new Uint8Array(I));function l(){E.close(),E.delete()}if(!E.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let d;if(E.isUASTC())d=s.UASTC;else if(E.isETC1S())d=s.ETC1S;else if(E.isHDR())d=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const p=E.getWidth(),C=E.getHeight(),m=E.getLayers()||1,y=E.getLevels(),Q=E.getFaces(),_=E.getHasAlpha(),j=E.getDFDFlags(),{transcoderFormat:v,engineFormat:M,engineType:x}=u(d,p,C,_);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const R=[],N=[];for(let L=0;L<Q;L++){const W=[];for(let J=0;J<y;J++){const K=[];let ee,te;for(let oe=0;oe<m;oe++){const ae=E.getImageLevelInfo(J,oe,L);L===0&&J===0&&oe===0&&(ae.origWidth%4!==0||ae.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?(ee=ae.origWidth,te=ae.origHeight):(ee=ae.width,te=ae.height);let Ae=new Uint8Array(E.getImageTranscodedSizeInBytes(J,oe,0,v));const Ie=E.transcodeImage(Ae,J,oe,L,v,0,-1,-1);if(x===r.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Ie)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Ae)}const ue=f(K);W.push({data:ue,width:ee,height:te}),N.push(ue.buffer)}R.push({mipmaps:W,width:p,height:C,format:M,type:x})}return l(),{faces:R,buffers:N,width:p,height:C,hasAlpha:_,dfdFlags:j,format:M,type:x}}const a=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[o.ASTC_4x4,o.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC7_M5,o.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC1,o.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1,o.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.PVRTC1_4_RGB,o.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[s.ETC1S]:a.filter(I=>I.basisFormat.includes(s.ETC1S)).sort((I,E)=>I.priorityETC1S-E.priorityETC1S),[s.UASTC]:a.filter(I=>I.basisFormat.includes(s.UASTC)).sort((I,E)=>I.priorityUASTC-E.priorityUASTC),[s.UASTC_HDR]:a.filter(I=>I.basisFormat.includes(s.UASTC_HDR)).sort((I,E)=>I.priorityHDR-E.priorityHDR)};function u(I,E,l,d){const p=h[I];for(let C=0;C<p.length;C++){const m=p[C];if(m.if&&!i[m.if]||!m.basisFormat.includes(I)||d&&m.transcoderFormat.length<2||m.needsPowerOfTwo&&!(b(E)&&b(l)))continue;const y=m.transcoderFormat[d?1:0],Q=m.engineFormat[d?1:0],_=m.engineType[0];return{transcoderFormat:y,engineFormat:Q,engineType:_}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(I){return I<=2?!0:(I&I-1)===0&&I!==0}function f(I){if(I.length===1)return I[0];let E=0;for(let p=0;p<I.length;p++){const C=I[p];E+=C.byteLength}const l=new Uint8Array(E);let d=0;for(let p=0;p<I.length;p++){const C=I[p];l.set(C,d),d+=C.byteLength}return l}};const Go=new Set([g.RGBAFormat,g.RGBFormat,g.RGFormat,g.RedFormat]),Yt={[ui]:g.RGBAFormat,[li]:g.RGFormat,[ci]:g.RedFormat,[Ai]:g.RGBAFormat,[ai]:g.RGFormat,[si]:g.RedFormat,[oi]:g.RGBAFormat,[ri]:g.RGBAFormat,[ii]:g.RGFormat,[ni]:g.RGFormat,[ti]:g.RedFormat,[ei]:g.RedFormat,[di]:g.RGBFormat,[hi]:g.RGBFormat,[vi]:g.RGBA_ETC2_EAC_Format,[Ri]:g.RGB_ETC2_Format,[rn]:g.R11_EAC_Format,[No]:g.SIGNED_R11_EAC_Format,[on]:g.RG11_EAC_Format,[Do]:g.SIGNED_RG11_EAC_Format,[ln]:g.RGBA_ASTC_4x4_Format,[ki]:g.RGBA_ASTC_4x4_Format,[Qi]:g.RGBA_ASTC_4x4_Format,[Fi]:g.RGBA_ASTC_6x6_Format,[Li]:g.RGBA_ASTC_6x6_Format,[Si]:g.RGBA_ASTC_6x6_Format,[Ei]:g.RGBA_S3TC_DXT1_Format,[gi]:g.RGBA_S3TC_DXT1_Format,[pi]:g.RGB_S3TC_DXT1_Format,[fi]:g.RGB_S3TC_DXT1_Format,[Ii]:g.RGBA_S3TC_DXT3_Format,[mi]:g.RGBA_S3TC_DXT3_Format,[Ci]:g.SIGNED_RED_RGTC1_Format,[bi]:g.RED_RGTC1_Format,[Bi]:g.SIGNED_RED_GREEN_RGTC2_Format,[yi]:g.RED_GREEN_RGTC2_Format,[Ti]:g.RGBA_BPTC_Format,[wi]:g.RGBA_BPTC_Format,[Di]:g.RGBA_PVRTC_4BPPV1_Format,[xi]:g.RGBA_PVRTC_4BPPV1_Format,[Ni]:g.RGBA_PVRTC_2BPPV1_Format,[_i]:g.RGBA_PVRTC_2BPPV1_Format},Et={[ui]:g.FloatType,[li]:g.FloatType,[ci]:g.FloatType,[Ai]:g.HalfFloatType,[ai]:g.HalfFloatType,[si]:g.HalfFloatType,[oi]:g.UnsignedByteType,[ri]:g.UnsignedByteType,[ii]:g.UnsignedByteType,[ni]:g.UnsignedByteType,[ti]:g.UnsignedByteType,[ei]:g.UnsignedByteType,[di]:g.UnsignedInt5999Type,[hi]:g.UnsignedInt101111Type,[vi]:g.UnsignedByteType,[Ri]:g.UnsignedByteType,[rn]:g.UnsignedByteType,[rn]:g.UnsignedByteType,[on]:g.UnsignedByteType,[on]:g.UnsignedByteType,[ln]:g.HalfFloatType,[ki]:g.UnsignedByteType,[Qi]:g.UnsignedByteType,[Fi]:g.HalfFloatType,[Li]:g.UnsignedByteType,[Si]:g.UnsignedByteType,[Ei]:g.UnsignedByteType,[gi]:g.UnsignedByteType,[pi]:g.UnsignedByteType,[fi]:g.UnsignedByteType,[Ii]:g.UnsignedByteType,[mi]:g.UnsignedByteType,[Ci]:g.UnsignedByteType,[bi]:g.UnsignedByteType,[Bi]:g.UnsignedByteType,[yi]:g.UnsignedByteType,[Ti]:g.UnsignedByteType,[wi]:g.UnsignedByteType,[Di]:g.UnsignedByteType,[xi]:g.UnsignedByteType,[Ni]:g.UnsignedByteType,[_i]:g.UnsignedByteType};async function Uo(i){const{vkFormat:e}=i;if(Yt[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);Et[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===Ln&&(Wt||(Wt=new Promise(async s=>{const c=new Oo;await c.init(),s(c)})),t=await Wt);const n=[];for(let s=0;s<i.levels.length;s++){const c=Math.max(1,i.pixelWidth>>s),A=Math.max(1,i.pixelHeight>>s),a=i.pixelDepth?Math.max(1,i.pixelDepth>>s):0,h=i.levels[s];let u;if(i.supercompressionScheme===Qo)u=h.levelData;else if(i.supercompressionScheme===Ln)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;Et[e]===g.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):Et[e]===g.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):Et[e]===g.UnsignedInt5999Type||Et[e]===g.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 r=i.levelCount===0||n.length>1;let o;if(Go.has(Yt[e]))o=i.pixelDepth===0?new g.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new g.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?g.NearestMipmapNearestFilter:g.NearestFilter,o.magFilter=g.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new g.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?g.LinearMipmapLinearFilter:g.LinearFilter,o.magFilter=g.LinearFilter}return o.mipmaps=n,o.type=Et[e],o.format=Yt[e],o.colorSpace=Oi(i),o.needsUpdate=!0,Promise.resolve(o)}function Oi(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===Lo?e.transferFunction===_n?g.SRGBColorSpace:g.LinearSRGBColorSpace:e.colorPrimaries===_o?e.transferFunction===_n?Mo:Po:(e.colorPrimaries===So||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),g.NoColorSpace)}class un{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let o;n.getInterpolation()===se.InterpolateDiscrete?o=new se.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new se.QuaternionLinearInterpolant(n.times,n.values,r):o=new se.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=o}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const o=n.substring(0,n.lastIndexOf(".")),s=n.substring(n.lastIndexOf(".")+1,n.length);let c=t[o];c||(c={},t[o]=c);const A=r.evaluate(this.time);if(s==="position")c.loc=new Z(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 Z(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}}var Mi=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),o,s=WebAssembly.instantiate(r,{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function c(d){for(var p=new Uint8Array(d.length),C=0;C<d.length;++C){var m=d.charCodeAt(C);p[C]=m>96?m-97:m>64?m-39:m+4}for(var y=0,C=0;C<d.length;++C)p[y++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(d,p,C,m,y,Q,_){var j=d.exports.sbrk,v=m+3&-4,M=j(v*y),x=j(Q.length),R=new Uint8Array(d.exports.memory.buffer);R.set(Q,x);var N=p(M,m,y,x,Q.length);if(N==0&&_&&_(M,v,y),C.set(R.subarray(M,M+m*y)),j(M-j(0)),N!=0)throw new Error("Malformed buffer data: "+N)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(d){var p={object:new Worker(d),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 I(d){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),m=URL.createObjectURL(C),y=u.length;y<d;++y)u[y]=f(m);for(var y=d;y<u.length;++y)u[y].object.postMessage({});u.length=d,URL.revokeObjectURL(m)}function E(d,p,C,m,y){for(var Q=u[0],_=1;_<u.length;++_)u[_].pending<Q.pending&&(Q=u[_]);return new Promise(function(j,v){var M=new Uint8Array(C),x=++b;Q.pending+=d,Q.requests[x]={resolve:j,reject:v},Q.object.postMessage({id:x,count:d,size:p,source:M,mode:m,filter:y},[M.buffer])})}function l(d){var p=d.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(d){I(d)},decodeVertexBuffer:function(d,p,C,m,y){A(o,o.exports.meshopt_decodeVertexBuffer,d,p,C,m,o.exports[a[y]])},decodeIndexBuffer:function(d,p,C,m){A(o,o.exports.meshopt_decodeIndexBuffer,d,p,C,m)},decodeIndexSequence:function(d,p,C,m){A(o,o.exports.meshopt_decodeIndexSequence,d,p,C,m)},decodeGltfBuffer:function(d,p,C,m,y,Q){A(o,o.exports[h[y]],d,p,C,m,o.exports[a[Q]])},decodeGltfBufferAsync:function(d,p,C,m,y){return u.length>0?E(d,p,C,h[m],a[y]):s.then(function(){var Q=new Uint8Array(d*p);return A(o,o.exports[h[m]],Q,d,p,C,o.exports[a[y]]),Q})}}})();function jo(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const Ho={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 Pi(i={}){const e={...Ho,...i};let t=new Xn;const n=new To;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new et;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(Mi),hn=t}let hn=new Xn;hn.setMeshoptDecoder(Mi);class qo extends Rt{gltf;constructor(e){super(e)}async asyncInit(e){if(jn(e)){let t=null;this.gltf=await hn.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},jo(s)){const{morphTargetDictionary:c,morphTargetInfluences:A}=s;Object.keys(c).forEach(a=>{const h=s.name+"."+a,u=c[a];o[h]={array:A,idx:u}})}s instanceof se.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof se.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]={name:s.name,shape:r,motion:new un(s),sound:void 0,soundContinue:!0}}),t?this.syncInit(t,n,o):(t="dummy",n.dummy={name:"dummy",shape:r,motion:new Cn,sound:void 0,soundContinue:!0},this.syncInit(t,n,o))}else{const t=new se.BoxGeometry,n=new se.MeshStandardMaterial({color:16711680}),r=new se.Mesh(t,n),o="dummy",s={};s.dummy={name:"dummy",shape:{root:r},motion:new Cn,sound:void 0,soundContinue:!0},this.syncInit(o,s)}return this}}const Gi={camera:void 0,antialias:!1,transparent:!1};class Ui 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=`
|
|
4
4
|
<style>
|
|
5
5
|
:host {
|
|
6
6
|
display: block;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
</style>
|
|
15
15
|
<slot></slot>
|
|
16
|
-
`,this.
|
|
16
|
+
`,this.options={...Gi,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new se.PerspectiveCamera(75,2,.1,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),Pi({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 Jn,this.css2DRenderer.domElement.classList.add("css2d-layer"),this.shadowRoot.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this.animationFrameId=requestAnimationFrame(this.renderingLoop),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",n=>{this.controller?.mouseDown(n)}),this._css2DCanvas.addEventListener("mouseup",n=>{this.controller?.mouseUp(n)}),this._css2DCanvas.addEventListener("mousemove",n=>{this.controller?.mouseMove(n)}),this._css2DCanvas.addEventListener("click",n=>{this.controller?.mouseClick(n)}),this._css2DCanvas.addEventListener("mouseenter",n=>{this.controller?.mouseEnter(n)}),this._css2DCanvas.addEventListener("mouseleave",n=>{this.controller?.mouseLeave(n)}),this._css2DCanvas.addEventListener("wheel",n=>{this.controller?.mouseWheel(n)}),this._css2DCanvas.addEventListener("touchstart",n=>{this.controller?.touchStart(n)}),this._css2DCanvas.addEventListener("touchmove",n=>{this.controller?.touchMove(n)}),this._css2DCanvas.addEventListener("touchend",n=>{this.controller?.touchEnd(n)}),this._css2DCanvas.addEventListener("touchcancel",n=>{this.controller?.touchCancel(n)})}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};connectedCallback(){this.ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0||r===0||(this.renderer.setSize(n,r,!0),this.css2DRenderer.setSize(n,r),zo(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Ko(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 r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize();return new Z(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 H.v0.set(n),this.worldToScreen(H.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new se.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const h=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:h})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("canvas-a3",Ui);function zo(i){return i.isPerspectiveCamera===!0}function Ko(i){return i.isOrthographicCamera===!0}const ji={width:600,height:300,camera:void 0};class Hi 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={...ji,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
17
17
|
<style>
|
|
18
18
|
:host {
|
|
19
19
|
position: absolute;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
</div>
|
|
58
58
|
<div class="content">
|
|
59
59
|
</div>
|
|
60
|
-
`,this.
|
|
60
|
+
`,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,Pi({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const r=this.shadowRoot.querySelector(".content");r.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new Jn,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",r.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",o=>{this.controller?.mouseDown(o)}),this._css2DCanvas.addEventListener("mouseup",o=>{this.controller?.mouseUp(o)}),this._css2DCanvas.addEventListener("mousemove",o=>{this.controller?.mouseMove(o)}),this._css2DCanvas.addEventListener("click",o=>{this.controller?.mouseClick(o)}),this._css2DCanvas.addEventListener("mouseenter",o=>{this.controller?.mouseEnter(o)}),this._css2DCanvas.addEventListener("mouseleave",o=>{this.controller?.mouseLeave(o)}),this._css2DCanvas.addEventListener("wheel",o=>{this.controller?.mouseWheel(o)}),this._css2DCanvas.addEventListener("touchstart",o=>{this.controller?.touchStart(o)}),this._css2DCanvas.addEventListener("touchmove",o=>{this.controller?.touchMove(o)}),this._css2DCanvas.addEventListener("touchend",o=>{this.controller?.touchEnd(o)}),this._css2DCanvas.addEventListener("touchcancel",o=>{this.controller?.touchCancel(o)}),document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0}),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};_resizeCanvasToContent(){const e=this.shadowRoot.querySelector(".content");let t=e.clientWidth,n=e.clientHeight;const r=Math.floor(t),o=Math.floor(n);(this._canvas.width!==r||this._canvas.height!==o)&&(this._canvas.width=r,this._canvas.height=o,Vo(this.camera3js)?(this.camera3js.aspect=r/o,this.camera3js.updateProjectionMatrix()):Wo(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(r,o),this.css2DRenderer.setSize(r,o))}connectedCallback(){this._titleEl=this.shadowRoot.querySelector(".title"),this._titleEl.textContent=this.getAttribute("title")??"Window",this._titleBar=this.shadowRoot.querySelector(".titlebar"),this._closeBtn=this.shadowRoot.querySelector(".close"),this._titleBar.addEventListener("mousedown",this._onDragStart),this._closeBtn.addEventListener("click",()=>this.remove()),this.addEventListener("mousemove",this._onHover),this.addEventListener("mousedown",this._onResizeStart),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),this._resizeObserver=new ResizeObserver(()=>{this._canvas&&this._resizeCanvasToContent()});const e=this.shadowRoot.querySelector(".content");this._resizeObserver.observe(e),this._resizeCanvasToContent()}disconnectedCallback(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._resizeObserver?.disconnect(),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener)}_onDragStart=e=>{this._resizeDir||(this._dragging=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop)};_onHover=e=>{if(this._dragging||this._resizing)return;const t=this.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,o=this._borderSize;let s="";r<o?s+="n":r>t.height-o&&(s+="s"),n<o?s+="w":n>t.width-o&&(s+="e"),this._resizeDir=s,this.style.cursor=this._cursorFromDir(s)};_cursorFromDir(e){switch(e){case"n":return"ns-resize";case"s":return"ns-resize";case"e":return"ew-resize";case"w":return"ew-resize";case"ne":return"nesw-resize";case"sw":return"nesw-resize";case"nw":return"nwse-resize";case"se":return"nwse-resize";default:return"default"}}_onResizeStart=e=>{this._resizeDir&&(this._resizing=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop,this._startWidth=this.offsetWidth,this._startHeight=this.offsetHeight)};_onMouseMove=e=>{if(this._dragging&&(this.style.left=`${this._startLeft+(e.clientX-this._startMouseX)}px`,this.style.top=`${this._startTop+(e.clientY-this._startMouseY)}px`),this._resizing){const t=e.clientX-this._startMouseX,n=e.clientY-this._startMouseY;this._resizeDir.includes("e")&&(this.style.width=`${this._startWidth+t}px`),this._resizeDir.includes("s")&&(this.style.height=`${this._startHeight+n}px`),this._resizeDir.includes("w")&&(this.style.width=`${this._startWidth-t}px`,this.style.left=`${this._startLeft+t}px`),this._resizeDir.includes("n")&&(this.style.height=`${this._startHeight-n}px`,this.style.top=`${this._startTop+n}px`)}};_onMouseUp=()=>{this._dragging=!1,this._resizing=!1};replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new se.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize();return new Z(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 H.v0.set(n),this.worldToScreen(H.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new se.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new se.Raycaster,n=new se.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const h=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:h})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("window-a3",Hi);function Vo(i){return i.isPerspectiveCamera===!0}function Wo(i){return i.isOrthographicCamera===!0}const Yo=`
|
|
61
61
|
color: white;
|
|
62
62
|
padding: 5px 10px;
|
|
63
63
|
background: rgba(0, 0, 0, 0.6);
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
font-family: sans-serif;
|
|
67
67
|
font-size: 14px;
|
|
68
68
|
pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
|
|
69
|
-
`,
|
|
70
|
-
`)A=0,a-=o;else{const b=jo(u,s,A,a,t);n=="tb"?(A=0,a+=t.ascender*s):A+=b.offsetX,c.push(b.path)}}return c}function jo(i,e,t,n,r){const s=r.glyphs[i]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const o=new I.ShapePath;let c,A,a,d,u,b,f,m;if(s.o){const E=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let l=0,h=E.length;l<h;)switch(E[l++]){case"m":c=E[l++]*e+t,A=E[l++]*e+n,o.moveTo(c,A);break;case"l":c=E[l++]*e+t,A=E[l++]*e+n,o.lineTo(c,A);break;case"q":a=E[l++]*e+t,d=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,o.quadraticCurveTo(u,b,a,d);break;case"b":a=E[l++]*e+t,d=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,f=E[l++]*e+t,m=E[l++]*e+n,o.bezierCurveTo(u,b,f,m,a,d);break}}return{offsetX:s.ha*e,path:o}}class qo extends I.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let vt=null;async function Ko(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await Dn(i),n=rn(t,e);vt=new Fi(JSON.parse(n))}else vt=await new Uo().loadAsync(i)}class zo extends _e{initObject(e){let t;if(Nn(e)?t=e:t="ERROR",vt==null){const n=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,r)}else{const n={font:vt,size:1,depth:.5,curveSegments:12},r=new qo(t,n);r.center();const s=new se.MeshStandardMaterial({color:65280});return new se.Mesh(r,s)}}}var Be=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),Oi=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),Se=Be((i,e)=>{var t=i&&i.__spreadArray||function(M,Y){for(var K=0,ie=Y.length,ge=M.length;K<ie;K++,ge++)M[ge]=Y[K];return M};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(M){return M&&M.length===0}i.isEmpty=n;function r(M){return M==null?[]:Object.keys(M)}i.keys=r;function s(M){for(var Y=[],K=Object.keys(M),ie=0;ie<K.length;ie++)Y.push(M[K[ie]]);return Y}i.values=s;function o(M,Y){for(var K=[],ie=r(M),ge=0;ge<ie.length;ge++){var ve=ie[ge];K.push(Y.call(null,M[ve],ve))}return K}i.mapValues=o;function c(M,Y){for(var K=[],ie=0;ie<M.length;ie++)K.push(Y.call(null,M[ie],ie));return K}i.map=c;function A(M){for(var Y=[],K=0;K<M.length;K++){var ie=M[K];Array.isArray(ie)?Y=Y.concat(A(ie)):Y.push(ie)}return Y}i.flatten=A;function a(M){return n(M)?void 0:M[0]}i.first=a;function d(M){var Y=M&&M.length;return Y?M[Y-1]:void 0}i.last=d;function u(M,Y){if(Array.isArray(M))for(var K=0;K<M.length;K++)Y.call(null,M[K],K);else if(J(M))for(var ie=r(M),K=0;K<ie.length;K++){var ge=ie[K],ve=M[ge];Y.call(null,ve,ge)}else throw Error("non exhaustive match")}i.forEach=u;function b(M){return typeof M=="string"}i.isString=b;function f(M){return M===void 0}i.isUndefined=f;function m(M){return M instanceof Function}i.isFunction=m;function E(M,Y){return Y===void 0&&(Y=1),M.slice(Y,M.length)}i.drop=E;function l(M,Y){return Y===void 0&&(Y=1),M.slice(0,M.length-Y)}i.dropRight=l;function h(M,Y){var K=[];if(Array.isArray(M))for(var ie=0;ie<M.length;ie++){var ge=M[ie];Y.call(null,ge)&&K.push(ge)}return K}i.filter=h;function p(M,Y){return h(M,function(K){return!Y(K)})}i.reject=p;function C(M,Y){for(var K=Object.keys(M),ie={},ge=0;ge<K.length;ge++){var ve=K[ge],T=M[ve];Y(T)&&(ie[ve]=T)}return ie}i.pick=C;function g(M,Y){return J(M)?M.hasOwnProperty(Y):!1}i.has=g;function B(M,Y){return j(M,function(K){return K===Y})!==void 0}i.contains=B;function Q(M){for(var Y=[],K=0;K<M.length;K++)Y.push(M[K]);return Y}i.cloneArr=Q;function S(M){var Y={};for(var K in M)Object.prototype.hasOwnProperty.call(M,K)&&(Y[K]=M[K]);return Y}i.cloneObj=S;function j(M,Y){for(var K=0;K<M.length;K++){var ie=M[K];if(Y.call(null,ie))return ie}}i.find=j;function R(M,Y){for(var K=[],ie=0;ie<M.length;ie++){var ge=M[ie];Y.call(null,ge)&&K.push(ge)}return K}i.findAll=R;function F(M,Y,K){for(var ie=Array.isArray(M),ge=ie?M:s(M),ve=ie?[]:r(M),T=K,y=0;y<ge.length;y++)T=Y.call(null,T,ge[y],ie?y:ve[y]);return T}i.reduce=F;function L(M){return p(M,function(Y){return Y==null})}i.compact=L;function k(M,Y){Y===void 0&&(Y=function(ie){return ie});var K=[];return F(M,function(ie,ge){var ve=Y(ge);return B(K,ve)?ie:(K.push(ve),ie.concat(ge))},[])}i.uniq=k;function x(M){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];var ie=[null],ge=ie.concat(Y);return Function.bind.apply(M,ge)}i.partial=x;function _(M){return Array.isArray(M)}i.isArray=_;function V(M){return M instanceof RegExp}i.isRegExp=V;function J(M){return M instanceof Object}i.isObject=J;function q(M,Y){for(var K=0;K<M.length;K++)if(!Y(M[K],K))return!1;return!0}i.every=q;function X(M,Y){return p(M,function(K){return B(Y,K)})}i.difference=X;function Z(M,Y){for(var K=0;K<M.length;K++)if(Y(M[K]))return!0;return!1}i.some=Z;function ce(M,Y){for(var K=0;K<M.length;K++)if(M[K]===Y)return K;return-1}i.indexOf=ce;function re(M,Y){var K=Q(M);return K.sort(function(ie,ge){return Y(ie)-Y(ge)}),K}i.sortBy=re;function oe(M,Y){if(M.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var K={},ie=0;ie<M.length;ie++)K[M[ie]]=Y[ie];return K}i.zipObject=oe;function ee(M){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var ie=0;ie<Y.length;ie++)for(var ge=Y[ie],ve=r(ge),T=0;T<ve.length;T++){var y=ve[T];M[y]=ge[y]}return M}i.assign=ee;function he(M){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var ie=0;ie<Y.length;ie++)for(var ge=Y[ie],ve=r(ge),T=0;T<ve.length;T++){var y=ve[T];g(M,y)||(M[y]=ge[y])}return M}i.assignNoOverwrite=he;function P(){for(var M=[],Y=0;Y<arguments.length;Y++)M[Y]=arguments[Y];return he.apply(void 0,t([{}],M))}i.defaults=P;function H(M,Y){var K={};return u(M,function(ie){var ge=Y(ie),ve=K[ge];ve?ve.push(ie):K[ge]=[ie]}),K}i.groupBy=H;function W(M,Y){for(var K=S(M),ie=r(Y),ge=0;ge<ie.length;ge++){var ve=ie[ge],T=Y[ve];K[ve]=T}return K}i.merge=W;function $(){}i.NOOP=$;function ne(M){return M}i.IDENTITY=ne;function le(M){for(var Y=[],K=0;K<M.length;K++){var ie=M[K];Y.push(ie!==void 0?ie:void 0)}return Y}i.packArray=le;function Ce(M){console&&console.error&&console.error("Error: "+M)}i.PRINT_ERROR=Ce;function me(M){console&&console.warn&&console.warn("Warning: "+M)}i.PRINT_WARNING=me;function Ne(){return typeof Map=="function"}i.isES2015MapSupported=Ne;function je(M){return M[M.length-1]}i.peek=je;function Ve(M){var Y=new Date().getTime(),K=M(),ie=new Date().getTime(),ge=ie-Y;return{time:ge,value:K}}i.timer=Ve;function Ue(M){function Y(){}Y.prototype=M;var K=new Y;function ie(){return typeof K.bar}return ie(),ie(),M}i.toFastProperties=Ue}),An=Be((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var h=this.disjunction();this.consumeChar("/");for(var 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 g;this.isDigit()?(g=this.integerIncludingZero(),h={atLeast:C,atMost:g}):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:[o(`
|
|
71
|
-
`),
|
|
72
|
-
`);break;case"r":l=
|
|
73
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:
|
|
74
|
-
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:
|
|
75
|
-
`: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:
|
|
69
|
+
`,Dn={testMode:!0};class Jo extends Oe{constructor(e={}){super(e);const t={...Dn,...e};this.setTransformer(new Fn(t))}initObject(){const e=new se.BoxGeometry,t=new se.MeshStandardMaterial({color:65280}),n=new se.Mesh(e,t),r=document.createElement("div");r.textContent="Hello Box!",r.style.cssText=Yo;const o=new Yn(r);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=_t(Dn,e);return new Fn(t)}}class Fn extends wt{testMode=!0;rot=new Z;constructor(e){super(),this.testMode=e.testMode}update(e){if(super.update(e),this.testMode){this.rot.add(e,e,e);const t=dt(this.rot);this.trans.quat.set(t)}}}class Xo extends g.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new g.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){const A=o.parse(JSON.parse(c));t&&t(A)},n,r)}parse(e){return new qi(e)}}class qi{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],o=Zo(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)r.push(...o[s].toShapes());return r}}function Zo(i,e,t,n){const r=Array.from(i),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&r.reverse();for(let h=0;h<r.length;h++){const u=r[h];if(u===`
|
|
70
|
+
`)A=0,a-=s;else{const b=$o(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=b.offsetX,c.push(b.path)}}return c}function $o(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const s=new g.ShapePath;let c,A,a,h,u,b,f,I;if(o.o){const E=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,d=E.length;l<d;)switch(E[l++]){case"m":c=E[l++]*e+t,A=E[l++]*e+n,s.moveTo(c,A);break;case"l":c=E[l++]*e+t,A=E[l++]*e+n,s.lineTo(c,A);break;case"q":a=E[l++]*e+t,h=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,s.quadraticCurveTo(u,b,a,h);break;case"b":a=E[l++]*e+t,h=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,f=E[l++]*e+t,I=E[l++]*e+n,s.bezierCurveTo(u,b,f,I,a,h);break}}return{offsetX:o.ha*e,path:s}}class es extends g.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let Lt=null;async function ts(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await Hn(i),n=cn(t,e);Lt=new qi(JSON.parse(n))}else Lt=await new Xo().loadAsync(i)}class ns extends Oe{initObject(e){let t;if(jn(e)?t=e:t="ERROR",Lt==null){const n=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,r)}else{const n={font:Lt,size:1,depth:.5,curveSegments:12},r=new es(t,n);r.center();const o=new se.MeshStandardMaterial({color:65280});return new se.Mesh(r,o)}}}var Qe=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),zi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),De=Qe((i,e)=>{var t=i&&i.__spreadArray||function(O,Y){for(var V=0,ie=Y.length,de=O.length;V<ie;V++,de++)O[de]=Y[V];return O};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(O){return O&&O.length===0}i.isEmpty=n;function r(O){return O==null?[]:Object.keys(O)}i.keys=r;function o(O){for(var Y=[],V=Object.keys(O),ie=0;ie<V.length;ie++)Y.push(O[V[ie]]);return Y}i.values=o;function s(O,Y){for(var V=[],ie=r(O),de=0;de<ie.length;de++){var Le=ie[de];V.push(Y.call(null,O[Le],Le))}return V}i.mapValues=s;function c(O,Y){for(var V=[],ie=0;ie<O.length;ie++)V.push(Y.call(null,O[ie],ie));return V}i.map=c;function A(O){for(var Y=[],V=0;V<O.length;V++){var ie=O[V];Array.isArray(ie)?Y=Y.concat(A(ie)):Y.push(ie)}return Y}i.flatten=A;function a(O){return n(O)?void 0:O[0]}i.first=a;function h(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}i.last=h;function u(O,Y){if(Array.isArray(O))for(var V=0;V<O.length;V++)Y.call(null,O[V],V);else if(J(O))for(var ie=r(O),V=0;V<ie.length;V++){var de=ie[V],Le=O[de];Y.call(null,Le,de)}else throw Error("non exhaustive match")}i.forEach=u;function b(O){return typeof O=="string"}i.isString=b;function f(O){return O===void 0}i.isUndefined=f;function I(O){return O instanceof Function}i.isFunction=I;function E(O,Y){return Y===void 0&&(Y=1),O.slice(Y,O.length)}i.drop=E;function l(O,Y){return Y===void 0&&(Y=1),O.slice(0,O.length-Y)}i.dropRight=l;function d(O,Y){var V=[];if(Array.isArray(O))for(var ie=0;ie<O.length;ie++){var de=O[ie];Y.call(null,de)&&V.push(de)}return V}i.filter=d;function p(O,Y){return d(O,function(V){return!Y(V)})}i.reject=p;function C(O,Y){for(var V=Object.keys(O),ie={},de=0;de<V.length;de++){var Le=V[de],Ce=O[Le];Y(Ce)&&(ie[Le]=Ce)}return ie}i.pick=C;function m(O,Y){return J(O)?O.hasOwnProperty(Y):!1}i.has=m;function y(O,Y){return j(O,function(V){return V===Y})!==void 0}i.contains=y;function Q(O){for(var Y=[],V=0;V<O.length;V++)Y.push(O[V]);return Y}i.cloneArr=Q;function _(O){var Y={};for(var V in O)Object.prototype.hasOwnProperty.call(O,V)&&(Y[V]=O[V]);return Y}i.cloneObj=_;function j(O,Y){for(var V=0;V<O.length;V++){var ie=O[V];if(Y.call(null,ie))return ie}}i.find=j;function v(O,Y){for(var V=[],ie=0;ie<O.length;ie++){var de=O[ie];Y.call(null,de)&&V.push(de)}return V}i.findAll=v;function M(O,Y,V){for(var ie=Array.isArray(O),de=ie?O:o(O),Le=ie?[]:r(O),Ce=V,ce=0;ce<de.length;ce++)Ce=Y.call(null,Ce,de[ce],ie?ce:Le[ce]);return Ce}i.reduce=M;function x(O){return p(O,function(Y){return Y==null})}i.compact=x;function R(O,Y){Y===void 0&&(Y=function(ie){return ie});var V=[];return M(O,function(ie,de){var Le=Y(de);return y(V,Le)?ie:(V.push(Le),ie.concat(de))},[])}i.uniq=R;function N(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];var ie=[null],de=ie.concat(Y);return Function.bind.apply(O,de)}i.partial=N;function L(O){return Array.isArray(O)}i.isArray=L;function W(O){return O instanceof RegExp}i.isRegExp=W;function J(O){return O instanceof Object}i.isObject=J;function K(O,Y){for(var V=0;V<O.length;V++)if(!Y(O[V],V))return!1;return!0}i.every=K;function ee(O,Y){return p(O,function(V){return y(Y,V)})}i.difference=ee;function te(O,Y){for(var V=0;V<O.length;V++)if(Y(O[V]))return!0;return!1}i.some=te;function ue(O,Y){for(var V=0;V<O.length;V++)if(O[V]===Y)return V;return-1}i.indexOf=ue;function oe(O,Y){var V=Q(O);return V.sort(function(ie,de){return Y(ie)-Y(de)}),V}i.sortBy=oe;function ae(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var V={},ie=0;ie<O.length;ie++)V[O[ie]]=Y[ie];return V}i.zipObject=ae;function Ae(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var ie=0;ie<Y.length;ie++)for(var de=Y[ie],Le=r(de),Ce=0;Ce<Le.length;Ce++){var ce=Le[Ce];O[ce]=de[ce]}return O}i.assign=Ae;function Ie(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var ie=0;ie<Y.length;ie++)for(var de=Y[ie],Le=r(de),Ce=0;Ce<Le.length;Ce++){var ce=Le[Ce];m(O,ce)||(O[ce]=de[ce])}return O}i.assignNoOverwrite=Ie;function U(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return Ie.apply(void 0,t([{}],O))}i.defaults=U;function P(O,Y){var V={};return u(O,function(ie){var de=Y(ie),Le=V[de];Le?Le.push(ie):V[de]=[ie]}),V}i.groupBy=P;function q(O,Y){for(var V=_(O),ie=r(Y),de=0;de<ie.length;de++){var Le=ie[de],Ce=Y[Le];V[Le]=Ce}return V}i.merge=q;function X(){}i.NOOP=X;function ne(O){return O}i.IDENTITY=ne;function le(O){for(var Y=[],V=0;V<O.length;V++){var ie=O[V];Y.push(ie!==void 0?ie:void 0)}return Y}i.packArray=le;function we(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=we;function Re(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=Re;function Fe(){return typeof Map=="function"}i.isES2015MapSupported=Fe;function We(O){return O[O.length-1]}i.peek=We;function ze(O){var Y=new Date().getTime(),V=O(),ie=new Date().getTime(),de=ie-Y;return{time:de,value:V}}i.timer=ze;function Ke(O){function Y(){}Y.prototype=O;var V=new Y;function ie(){return typeof V.bar}return ie(),ie(),O}i.toFastProperties=Ke}),dn=Qe((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var d=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:d,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],d=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(d)}},t.prototype.alternative=function(){for(var l=[],d=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(d)}},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 d;switch(this.popChar()){case"=":d="Lookahead";break;case"!":d="NegativeLookahead";break}a(d);var p=this.disjunction();return this.consumeChar(")"),{type:d,value:p,loc:this.loc(l)}}h()},t.prototype.quantifier=function(l){var d,p=this.idx;switch(this.popChar()){case"*":d={atLeast:0,atMost:1/0};break;case"+":d={atLeast:1,atMost:1/0};break;case"?":d={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":d={atLeast:C,atMost:C};break;case",":var m;this.isDigit()?(m=this.integerIncludingZero(),d={atLeast:C,atMost:m}):d={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&d===void 0)return;a(d);break}if(!(l===!0&&d===void 0))return a(d),this.peekChar(0)==="?"?(this.consumeChar("?"),d.greedy=!1):d.greedy=!0,d.type="Quantifier",d.loc=this.loc(p),d},t.prototype.atom=function(){var l,d=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(d),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[s(`
|
|
71
|
+
`),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,d=!1;switch(this.popChar()){case"d":l=b;break;case"D":l=b,d=!0;break;case"s":l=I;break;case"S":l=I,d=!0;break;case"w":l=f;break;case"W":l=f,d=!0;break}return a(l),{type:"Set",value:l,complement:d}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=s("\f");break;case"n":l=s(`
|
|
72
|
+
`);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 d=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:d}},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`
|
|
73
|
+
`: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=[],d=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),d=!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:d,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
74
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:s("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.group=function(){var l=!0;(this.consumeChar("("),this.peekChar(0))==="?"?(this.consumeChar("?"),this.consumeChar(":"),l=!1):this.groupIdx++;var d=this.disjunction();this.consumeChar(")");var p={type:"Group",capturing:l,value:d};return l&&(p.idx=this.groupIdx),p},t.prototype.positiveInteger=function(){var l=this.popChar();if(o.test(l)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.integerIncludingZero=function(){var l=this.popChar();if(r.test(l)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.patternCharacter=function(){var l=this.popChar();switch(l){case`
|
|
75
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:s(l)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case`
|
|
76
76
|
`: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`
|
|
77
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var
|
|
78
|
-
`),
|
|
79
|
-
`;function c(E,l){l===void 0&&(l=!1);try{var
|
|
77
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var d="",p=0;p<l;p++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");d+=C}var m=parseInt(d,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]/,r=/[0-9]/,o=/[1-9]/;function s(l){return l.charCodeAt(0)}function c(l,d){l.length!==void 0?l.forEach(function(p){d.push(p)}):d.push(l)}function A(l,d){if(l[d]===!0)throw"duplicate flag "+d;l[d]=!0}function a(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function h(){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 I=[s(" "),s("\f"),s(`
|
|
78
|
+
`),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 E(){}return E.prototype.visitChildren=function(l){for(var d in l){var p=l[d];l.hasOwnProperty(d)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.forEach(function(C){this.visit(C)},this))}},E.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)},E.prototype.visitPattern=function(l){},E.prototype.visitFlags=function(l){},E.prototype.visitDisjunction=function(l){},E.prototype.visitAlternative=function(l){},E.prototype.visitStartAnchor=function(l){},E.prototype.visitEndAnchor=function(l){},E.prototype.visitWordBoundary=function(l){},E.prototype.visitNonWordBoundary=function(l){},E.prototype.visitLookahead=function(l){},E.prototype.visitNegativeLookahead=function(l){},E.prototype.visitCharacter=function(l){},E.prototype.visitSet=function(l){},E.prototype.visitGroup=function(l){},E.prototype.visitGroupBackReference=function(l){},E.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:E,VERSION:"0.5.0"}})}),fn=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=dn(),t={},n=new e.RegExpParser;function r(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function o(){t={}}i.clearRegExpParserCache=o}),is=Qe(i=>{var e=i&&i.__extends||(function(){var E=function(l,d){return E=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])},E(l,d)};return function(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");E(l,d);function p(){this.constructor=l}l.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=dn(),n=De(),r=fn(),o=Ki(),s="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|
79
|
+
`;function c(E,l){l===void 0&&(l=!1);try{var d=r.getRegExpAst(E),p=A(d.value,{},d.flags.ignoreCase);return p}catch(m){if(m.message===s)l&&n.PRINT_WARNING(""+i.failedOptimizationPrefixMsg+(" Unable to optimize: < "+E.toString()+` >
|
|
80
80
|
`)+` Complement Sets cannot be automatically optimized.
|
|
81
81
|
This will disable the lexer's first char optimizations.
|
|
82
82
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var C="";l&&(C=`
|
|
@@ -84,98 +84,98 @@
|
|
|
84
84
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),n.PRINT_ERROR(i.failedOptimizationPrefixMsg+`
|
|
85
85
|
`+(" Failed parsing: < "+E.toString()+` >
|
|
86
86
|
`)+(" Using the regexp-to-ast library version: "+t.VERSION+`
|
|
87
|
-
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(E,l,
|
|
88
|
-
`],tracer:function(
|
|
87
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(E,l,d){switch(E.type){case"Disjunction":for(var p=0;p<E.value.length;p++)A(E.value[p],l,d);break;case"Alternative":for(var C=E.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,d);break;case"Set":if(y.complement===!0)throw Error(s);n.forEach(y.value,function(j){if(typeof j=="number")a(j,l,d);else{var v=j;if(d===!0)for(var M=v.from;M<=v.to;M++)a(M,l,d);else{for(var M=v.from;M<=v.to&&M<o.minOptimizationVal;M++)a(M,l,d);if(v.to>=o.minOptimizationVal)for(var x=v.from>=o.minOptimizationVal?v.from:o.minOptimizationVal,R=v.to,N=o.charCodeToOptimizedIndex(x),L=o.charCodeToOptimizedIndex(R),W=N;W<=L;W++)l[W]=W}}});break;case"Group":A(y.value,l,d);break;default:throw Error("Non Exhaustive Match")}var Q=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&b(y)===!1||y.type!=="Group"&&Q===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(E,l,d){var p=o.charCodeToOptimizedIndex(E);l[p]=p,d===!0&&h(E,l)}function h(E,l){var d=String.fromCharCode(E),p=d.toUpperCase();if(p!==d){var C=o.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var m=d.toLowerCase();if(m!==d){var C=o.charCodeToOptimizedIndex(m.charCodeAt(0));l[C]=C}}}function u(E,l){return n.find(E.value,function(d){if(typeof d=="number")return n.contains(l,d);var p=d;return n.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(E){return E.quantifier&&E.quantifier.atLeast===0?!0:E.value?n.isArray(E.value)?n.every(E.value,b):b(E.value):!1}var f=(function(E){e(l,E);function l(d){var p=E.call(this)||this;return p.targetCharCodes=d,p.found=!1,p}return l.prototype.visitChildren=function(d){if(this.found!==!0){switch(d.type){case"Lookahead":this.visitLookahead(d);return;case"NegativeLookahead":this.visitNegativeLookahead(d);return}E.prototype.visitChildren.call(this,d)}},l.prototype.visitCharacter=function(d){n.contains(this.targetCharCodes,d.value)&&(this.found=!0)},l.prototype.visitSet=function(d){d.complement?u(d,this.targetCharCodes)===void 0&&(this.found=!0):u(d,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function I(E,l){if(l instanceof RegExp){var d=r.getRegExpAst(l),p=new f(E);return p.visit(d),p.found}else return n.find(l,function(C){return n.contains(E,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=I}),Ki=Qe(i=>{var e=i&&i.__extends||(function(){var U=function(P,q){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var le in ne)Object.prototype.hasOwnProperty.call(ne,le)&&(X[le]=ne[le])},U(P,q)};return function(P,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");U(P,q);function X(){this.constructor=P}P.prototype=q===null?Object.create(q):(X.prototype=q.prototype,new X)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.charCodeToOptimizedIndex=i.minOptimizationVal=i.buildLineBreakIssueMessage=i.LineTerminatorOptimizedTester=i.isShortPattern=i.isCustomPattern=i.cloneEmptyGroups=i.performWarningRuntimeChecks=i.performRuntimeChecks=i.addStickyFlag=i.addStartOfInput=i.findUnreachablePatterns=i.findModesThatDoNotExist=i.findInvalidGroupType=i.findDuplicatePatterns=i.findUnsupportedFlags=i.findStartOfInputAnchor=i.findEmptyMatchRegExps=i.findEndOfInputAnchor=i.findInvalidPatterns=i.findMissingPatterns=i.validatePatterns=i.analyzeTokenTypes=i.enableSticky=i.disableSticky=i.SUPPORT_STICKY=i.MODES=i.DEFAULT_MODE=void 0;var t=dn(),n=Nt(),r=De(),o=is(),s=fn(),c="PATTERN";i.DEFAULT_MODE="defaultMode",i.MODES="modes",i.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){i.SUPPORT_STICKY=!1}i.disableSticky=A;function a(){i.SUPPORT_STICKY=!0}i.enableSticky=a;function h(U,P){P=r.defaults(P,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
88
|
+
`],tracer:function(Ce,ce){return ce()}});var q=P.tracer;q("initCharCodeToOptimizedIndexMap",function(){Ie()});var X;q("Reject Lexer.NA",function(){X=r.reject(U,function(Ce){return Ce[c]===n.Lexer.NA})});var ne=!1,le;q("Transform Patterns",function(){ne=!1,le=r.map(X,function(Ce){var ce=Ce[c];if(r.isRegExp(ce)){var Ue=ce.source;return Ue.length===1&&Ue!=="^"&&Ue!=="$"&&Ue!=="."&&!ce.ignoreCase?Ue:Ue.length===2&&Ue[0]==="\\"&&!r.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],Ue[1])?Ue[1]:P.useSticky?R(ce):x(ce)}else{if(r.isFunction(ce))return ne=!0,{exec:ce};if(r.has(ce,"exec"))return ne=!0,ce;if(typeof ce=="string"){if(ce.length===1)return ce;var k=ce.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(k);return P.useSticky?R(T):x(T)}else throw Error("non exhaustive match")}})});var we,Re,Fe,We,ze;q("misc mapping",function(){we=r.map(X,function(Ce){return Ce.tokenTypeIdx}),Re=r.map(X,function(Ce){var ce=Ce.GROUP;if(ce!==n.Lexer.SKIPPED){if(r.isString(ce))return ce;if(r.isUndefined(ce))return!1;throw Error("non exhaustive match")}}),Fe=r.map(X,function(Ce){var ce=Ce.LONGER_ALT;if(ce){var Ue=r.indexOf(X,ce);return Ue}}),We=r.map(X,function(Ce){return Ce.PUSH_MODE}),ze=r.map(X,function(Ce){return r.has(Ce,"POP_MODE")})});var Ke;q("Line Terminator Handling",function(){var Ce=ue(P.lineTerminatorCharacters);Ke=r.map(X,function(ce){return!1}),P.positionTracking!=="onlyOffset"&&(Ke=r.map(X,function(ce){if(r.has(ce,"LINE_BREAKS"))return ce.LINE_BREAKS;if(ee(ce,Ce)===!1)return o.canMatchCharCode(Ce,ce.PATTERN)}))});var O,Y,V,ie;q("Misc Mapping #2",function(){O=r.map(X,J),Y=r.map(le,K),V=r.reduce(X,function(Ce,ce){var Ue=ce.GROUP;return r.isString(Ue)&&Ue!==n.Lexer.SKIPPED&&(Ce[Ue]=[]),Ce},{}),ie=r.map(le,function(Ce,ce){return{pattern:le[ce],longerAlt:Fe[ce],canLineTerminator:Ke[ce],isCustom:O[ce],short:Y[ce],group:Re[ce],push:We[ce],pop:ze[ce],tokenTypeIdx:we[ce],tokenType:X[ce]}})});var de=!0,Le=[];return P.safeMode||q("First Char Optimization",function(){Le=r.reduce(X,function(Ce,ce,Ue){if(typeof ce.PATTERN=="string"){var k=ce.PATTERN.charCodeAt(0),T=Ae(k);oe(Ce,T,ie[Ue])}else if(r.isArray(ce.START_CHARS_HINT)){var B;r.forEach(ce.START_CHARS_HINT,function(w){var D=typeof w=="string"?w.charCodeAt(0):w,F=Ae(D);B!==F&&(B=F,oe(Ce,F,ie[Ue]))})}else if(r.isRegExp(ce.PATTERN))if(ce.PATTERN.unicode)de=!1,P.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+ce.PATTERN.toString()+` > pattern.
|
|
89
89
|
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
90
90
|
This will disable the lexer's first char optimizations.
|
|
91
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var
|
|
91
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var S=o.getOptimizedStartCodesIndices(ce.PATTERN,P.ensureOptimizations);r.isEmpty(S)&&(de=!1),r.forEach(S,function(w){oe(Ce,w,ie[Ue])})}else P.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+ce.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
92
92
|
`)+` This will disable the lexer's first char optimizations.
|
|
93
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),
|
|
93
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),de=!1;return Ce},[])}),q("ArrayPacking",function(){Le=r.packArray(Le)}),{emptyGroups:V,patternIdxToConfig:ie,charCodeToPatternIdxToConfig:Le,hasCustom:ne,canBeOptimized:de}}i.analyzeTokenTypes=h;function u(U,P){var q=[],X=f(U);q=q.concat(X.errors);var ne=I(X.valid),le=ne.valid;return q=q.concat(ne.errors),q=q.concat(b(le)),q=q.concat(Q(le)),q=q.concat(_(le,P)),q=q.concat(j(le)),q}i.validatePatterns=u;function b(U){var P=[],q=r.filter(U,function(X){return r.isRegExp(X[c])});return P=P.concat(l(q)),P=P.concat(C(q)),P=P.concat(m(q)),P=P.concat(y(q)),P=P.concat(d(q)),P}function f(U){var P=r.filter(U,function(ne){return!r.has(ne,c)}),q=r.map(P,function(ne){return{message:"Token Type: ->"+ne.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[ne]}}),X=r.difference(U,P);return{errors:q,valid:X}}i.findMissingPatterns=f;function I(U){var P=r.filter(U,function(ne){var le=ne[c];return!r.isRegExp(le)&&!r.isFunction(le)&&!r.has(le,"exec")&&!r.isString(le)}),q=r.map(P,function(ne){return{message:"Token Type: ->"+ne.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:[ne]}}),X=r.difference(U,P);return{errors:q,valid:X}}i.findInvalidPatterns=I;var E=/[^\\][\$]/;function l(U){var P=(function(ne){e(le,ne);function le(){var we=ne!==null&&ne.apply(this,arguments)||this;return we.found=!1,we}return le.prototype.visitEndAnchor=function(we){this.found=!0},le})(t.BaseRegExpVisitor),q=r.filter(U,function(ne){var le=ne[c];try{var we=s.getRegExpAst(le),Re=new P;return Re.visit(we),Re.found}catch{return E.test(le.source)}}),X=r.map(q,function(ne){return{message:`Unexpected RegExp Anchor Error:
|
|
94
94
|
Token Type: ->`+ne.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
95
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[ne]}});return
|
|
95
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[ne]}});return X}i.findEndOfInputAnchor=l;function d(U){var P=r.filter(U,function(X){var ne=X[c];return ne.test("")}),q=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[X]}});return q}i.findEmptyMatchRegExps=d;var p=/[^\\[][\^]|^\^/;function C(U){var P=(function(ne){e(le,ne);function le(){var we=ne!==null&&ne.apply(this,arguments)||this;return we.found=!1,we}return le.prototype.visitStartAnchor=function(we){this.found=!0},le})(t.BaseRegExpVisitor),q=r.filter(U,function(ne){var le=ne[c];try{var we=s.getRegExpAst(le),Re=new P;return Re.visit(we),Re.found}catch{return p.test(le.source)}}),X=r.map(q,function(ne){return{message:`Unexpected RegExp Anchor Error:
|
|
96
96
|
Token Type: ->`+ne.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
97
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[ne]}});return
|
|
98
|
-
`+("Because it appears AFTER the Token Type ->"
|
|
99
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
|
|
100
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(
|
|
101
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(
|
|
102
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(
|
|
103
|
-
`),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})})
|
|
97
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[ne]}});return X}i.findStartOfInputAnchor=C;function m(U){var P=r.filter(U,function(X){var ne=X[c];return ne instanceof RegExp&&(ne.multiline||ne.global)}),q=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[X]}});return q}i.findUnsupportedFlags=m;function y(U){var P=[],q=r.map(U,function(le){return r.reduce(U,function(we,Re){return le.PATTERN.source===Re.PATTERN.source&&!r.contains(P,Re)&&Re.PATTERN!==n.Lexer.NA&&(P.push(Re),we.push(Re)),we},[])});q=r.compact(q);var X=r.filter(q,function(le){return le.length>1}),ne=r.map(X,function(le){var we=r.map(le,function(Fe){return Fe.name}),Re=r.first(le).PATTERN;return{message:"The same RegExp pattern ->"+Re+"<-"+("has been used in all of the following Token Types: "+we.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return ne}i.findDuplicatePatterns=y;function Q(U){var P=r.filter(U,function(X){if(!r.has(X,"GROUP"))return!1;var ne=X.GROUP;return ne!==n.Lexer.SKIPPED&&ne!==n.Lexer.NA&&!r.isString(ne)}),q=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[X]}});return q}i.findInvalidGroupType=Q;function _(U,P){var q=r.filter(U,function(ne){return ne.PUSH_MODE!==void 0&&!r.contains(P,ne.PUSH_MODE)}),X=r.map(q,function(ne){var le="Token Type: ->"+ne.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+ne.PUSH_MODE+"<-which does not exist";return{message:le,type:n.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[ne]}});return X}i.findModesThatDoNotExist=_;function j(U){var P=[],q=r.reduce(U,function(X,ne,le){var we=ne.PATTERN;return we===n.Lexer.NA||(r.isString(we)?X.push({str:we,idx:le,tokenType:ne}):r.isRegExp(we)&&M(we)&&X.push({str:we.source,idx:le,tokenType:ne})),X},[]);return r.forEach(U,function(X,ne){r.forEach(q,function(le){var we=le.str,Re=le.idx,Fe=le.tokenType;if(ne<Re&&v(we,X.PATTERN)){var We="Token: ->"+Fe.name+`<- can never be matched.
|
|
98
|
+
`+("Because it appears AFTER the Token Type ->"+X.name+"<-")+`in the lexer's definition.
|
|
99
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;P.push({message:We,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[X,Fe]})}})}),P}i.findUnreachablePatterns=j;function v(U,P){if(r.isRegExp(P)){var q=P.exec(U);return q!==null&&q.index===0}else{if(r.isFunction(P))return P(U,0,[],{});if(r.has(P,"exec"))return P.exec(U,0,[],{});if(typeof P=="string")return P===U;throw Error("non exhaustive match")}}function M(U){var P=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(P,function(q){return U.source.indexOf(q)!==-1})===void 0}function x(U){var P=U.ignoreCase?"i":"";return new RegExp("^(?:"+U.source+")",P)}i.addStartOfInput=x;function R(U){var P=U.ignoreCase?"iy":"y";return new RegExp(""+U.source,P)}i.addStickyFlag=R;function N(U,P,q){var X=[];return r.has(U,i.DEFAULT_MODE)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.DEFAULT_MODE+`> property in its definition
|
|
100
|
+
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(U,i.MODES)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.MODES+`> property in its definition
|
|
101
|
+
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(U,i.MODES)&&r.has(U,i.DEFAULT_MODE)&&!r.has(U.modes,U.defaultMode)&&X.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+U.defaultMode+`>which does not exist
|
|
102
|
+
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(U,i.MODES)&&r.forEach(U.modes,function(ne,le){r.forEach(ne,function(we,Re){r.isUndefined(we)&&X.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+le+"> at index: <"+Re+`>
|
|
103
|
+
`),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),X}i.performRuntimeChecks=N;function L(U,P,q){var X=[],ne=!1,le=r.compact(r.flatten(r.mapValues(U.modes,function(Fe){return Fe}))),we=r.reject(le,function(Fe){return Fe[c]===n.Lexer.NA}),Re=ue(q);return P&&r.forEach(we,function(Fe){var We=ee(Fe,Re);if(We!==!1){var ze=te(Fe,We),Ke={message:ze,type:We.issue,tokenType:Fe};X.push(Ke)}else r.has(Fe,"LINE_BREAKS")?Fe.LINE_BREAKS===!0&&(ne=!0):o.canMatchCharCode(Re,Fe.PATTERN)&&(ne=!0)}),P&&!ne&&X.push({message:`Warning: No LINE_BREAKS Found.
|
|
104
104
|
This Lexer has been defined to track line and column information,
|
|
105
105
|
But none of the Token Types can be identified as matching a line terminator.
|
|
106
106
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
107
|
-
for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS})
|
|
108
|
-
`+(" The problem is in the <"+
|
|
109
|
-
`)+(" Root cause: "+
|
|
110
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(
|
|
111
|
-
`+(" The problem is in the <"+
|
|
112
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=
|
|
113
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:r.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(
|
|
114
|
-
a boolean 2nd argument is no longer supported`);this.config=t.merge(
|
|
115
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(
|
|
107
|
+
for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),X}i.performWarningRuntimeChecks=L;function W(U){var P={},q=r.keys(U);return r.forEach(q,function(X){var ne=U[X];if(r.isArray(ne))P[X]=[];else throw Error("non exhaustive match")}),P}i.cloneEmptyGroups=W;function J(U){var P=U.PATTERN;if(r.isRegExp(P))return!1;if(r.isFunction(P)||r.has(P,"exec"))return!0;if(r.isString(P))return!1;throw Error("non exhaustive match")}i.isCustomPattern=J;function K(U){return r.isString(U)&&U.length===1?U.charCodeAt(0):!1}i.isShortPattern=K,i.LineTerminatorOptimizedTester={test:function(U){for(var P=U.length,q=this.lastIndex;q<P;q++){var X=U.charCodeAt(q);if(X===10)return this.lastIndex=q+1,!0;if(X===13)return U.charCodeAt(q+1)===10?this.lastIndex=q+2:this.lastIndex=q+1,!0}return!1},lastIndex:0};function ee(U,P){if(r.has(U,"LINE_BREAKS"))return!1;if(r.isRegExp(U.PATTERN)){try{o.canMatchCharCode(P,U.PATTERN)}catch(q){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:q.message}}return!1}else{if(r.isString(U.PATTERN))return!1;if(J(U))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function te(U,P){if(P.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
108
|
+
`+(" The problem is in the <"+U.name+`> Token Type
|
|
109
|
+
`)+(" Root cause: "+P.errMsg+`.
|
|
110
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(P.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
111
|
+
`+(" The problem is in the <"+U.name+`> Token Type
|
|
112
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=te;function ue(U){var P=r.map(U,function(q){return r.isString(q)&&q.length>0?q.charCodeAt(0):q});return P}function oe(U,P,q){U[P]===void 0?U[P]=[q]:U[P].push(q)}i.minOptimizationVal=256;var ae=[];function Ae(U){return U<i.minOptimizationVal?U:ae[U]}i.charCodeToOptimizedIndex=Ae;function Ie(){if(r.isEmpty(ae)){ae=new Array(65536);for(var U=0;U<65536;U++)ae[U]=U>255?255+~~(U/255):U}}}),Qt=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isTokenType=i.hasExtendingTokensTypesMapProperty=i.hasExtendingTokensTypesProperty=i.hasCategoriesProperty=i.hasShortKeyProperty=i.singleAssignCategoriesToksMap=i.assignCategoriesMapProp=i.assignCategoriesTokensProp=i.assignTokenDefaultProps=i.expandCategories=i.augmentTokenTypes=i.tokenIdxToClass=i.tokenShortNameIdx=i.tokenStructuredMatcherNoCategories=i.tokenStructuredMatcher=void 0;var e=De();function t(E,l){var d=E.tokenTypeIdx;return d===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[d]===!0}i.tokenStructuredMatcher=t;function n(E,l){return E.tokenTypeIdx===l.tokenTypeIdx}i.tokenStructuredMatcherNoCategories=n,i.tokenShortNameIdx=1,i.tokenIdxToClass={};function r(E){var l=o(E);s(l),A(l),c(l),e.forEach(l,function(d){d.isParent=d.categoryMatches.length>0})}i.augmentTokenTypes=r;function o(E){for(var l=e.cloneArr(E),d=E,p=!0;p;){d=e.compact(e.flatten(e.map(d,function(m){return m.CATEGORIES})));var C=e.difference(d,l);l=l.concat(C),e.isEmpty(C)?p=!1:d=C}return l}i.expandCategories=o;function s(E){e.forEach(E,function(l){h(l)||(i.tokenIdxToClass[i.tokenShortNameIdx]=l,l.tokenTypeIdx=i.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),f(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=s;function c(E){e.forEach(E,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(d,p){l.categoryMatches.push(i.tokenIdxToClass[p].tokenTypeIdx)})})}i.assignCategoriesTokensProp=c;function A(E){e.forEach(E,function(l){a([],l)})}i.assignCategoriesMapProp=A;function a(E,l){e.forEach(E,function(d){l.categoryMatchesMap[d.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(d){var p=E.concat(l);e.contains(p,d)||a(p,d)})}i.singleAssignCategoriesToksMap=a;function h(E){return e.has(E,"tokenTypeIdx")}i.hasShortKeyProperty=h;function u(E){return e.has(E,"CATEGORIES")}i.hasCategoriesProperty=u;function b(E){return e.has(E,"categoryMatches")}i.hasExtendingTokensTypesProperty=b;function f(E){return e.has(E,"categoryMatchesMap")}i.hasExtendingTokensTypesMapProperty=f;function I(E){return e.has(E,"tokenTypeIdx")}i.isTokenType=I}),Vi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultLexerErrorProvider=void 0,i.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),Nt=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=Ki(),t=De(),n=Qt(),r=Vi(),o=fn();(function(A){A[A.MISSING_PATTERN=0]="MISSING_PATTERN",A[A.INVALID_PATTERN=1]="INVALID_PATTERN",A[A.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",A[A.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",A[A.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",A[A.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",A[A.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",A[A.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",A[A.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",A[A.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",A[A.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",A[A.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",A[A.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",A[A.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",A[A.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",A[A.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",A[A.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(i.LexerDefinitionErrorType||(i.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
113
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:r.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(s);var c=(function(){function A(a,h){var u=this;if(h===void 0&&(h=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 h=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
114
|
+
a boolean 2nd argument is no longer supported`);this.config=t.merge(s,h);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,I=!0;u.TRACE_INIT("Lexer Config handling",function(){if(u.config.lineTerminatorsPattern===s.lineTerminatorsPattern)u.config.lineTerminatorsPattern=e.LineTerminatorOptimizedTester;else if(u.config.lineTerminatorCharacters===s.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
115
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(h.safeMode&&h.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):(I=!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 E=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,E))}),t.isEmpty(u.lexerDefinitionErrors)){n.augmentTokenTypes(p);var m;u.TRACE_INIT("analyzeTokenTypes",function(){m=e.analyzeTokenTypes(p,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:h.positionTracking,ensureOptimizations:h.ensureOptimizations,safeMode:h.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}),d=l.join(`-----------------------
|
|
116
116
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
117
|
-
`+
|
|
117
|
+
`+d)}t.forEach(u.lexerDefinitionWarning,function(p){t.PRINT_WARNING(p.message)}),u.TRACE_INIT("Choosing sub-methods implementations",function(){if(e.SUPPORT_STICKY?(u.chopInput=t.IDENTITY,u.match=u.matchWithTest):(u.updateLastIndex=t.NOOP,u.match=u.matchWithExec),I&&(u.handleModes=t.NOOP),u.trackStartLines===!1&&(u.computeNewColumn=t.IDENTITY),u.trackEndLines===!1&&(u.updateTokenEndLineColumnLocation=t.NOOP),/full/i.test(u.config.positionTracking))u.createTokenInstance=u.createFullToken;else if(/onlyStart/i.test(u.config.positionTracking))u.createTokenInstance=u.createStartOnlyToken;else if(/onlyOffset/i.test(u.config.positionTracking))u.createTokenInstance=u.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+u.config.positionTracking+'"');u.hasCustom?(u.addToken=u.addTokenUsingPush,u.handlePayload=u.handlePayloadWithCustom):(u.addToken=u.addTokenUsingMemberAccess,u.handlePayload=u.handlePayloadNoCustom)}),u.TRACE_INIT("Failed Optimization Warnings",function(){var p=t.reduce(u.canModeBeOptimized,function(C,m,y){return m===!1&&C.push(y),C},[]);if(h.ensureOptimizations&&!t.isEmpty(p))throw Error("Lexer Modes: < "+p.join(", ")+` > cannot be optimized.
|
|
118
118
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
119
|
-
Or inspect the console log for details on how to resolve these issues.`)}),u.TRACE_INIT("clearRegExpParserCache",function(){
|
|
119
|
+
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,h){if(h===void 0&&(h=this.defaultMode),!t.isEmpty(this.lexerDefinitionErrors)){var u=t.map(this.lexerDefinitionErrors,function(I){return I.message}),b=u.join(`-----------------------
|
|
120
120
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
121
|
-
`+b)}var f=this.tokenizeInternal(a,
|
|
122
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(g,A)&&(Q.CATEGORIES=g[A]),n.augmentTokenTypes([Q]),e.has(g,a)&&(Q.LABEL=g[a]),e.has(g,d)&&(Q.GROUP=g[d]),e.has(g,b)&&(Q.POP_MODE=g[b]),e.has(g,u)&&(Q.PUSH_MODE=g[u]),e.has(g,f)&&(Q.LONGER_ALT=g[f]),e.has(g,m)&&(Q.LINE_BREAKS=g[m]),e.has(g,E)&&(Q.START_CHARS_HINT=g[E]),Q}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function p(g,B,Q,S,j,R,F,L){return{image:B,startOffset:Q,endOffset:S,startLine:j,endLine:R,startColumn:F,endColumn:L,tokenTypeIdx:g.tokenTypeIdx,tokenType:g}}i.createTokenInstance=p;function C(g,B){return n.tokenStructuredMatcher(g,B)}i.tokenMatcher=C}),We=Be(i=>{var e=i&&i.__extends||(function(){var h=function(p,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,B){g.__proto__=B}||function(g,B){for(var Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(g[Q]=B[Q])},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 g(){this.constructor=p}p.prototype=C===null?Object.create(C):(g.prototype=C.prototype,new g)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=Se(),n=ct(),r=(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})();i.AbstractProduction=r;var s=(function(h){e(p,h);function p(C){var g=h.call(this,[])||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}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})(r);i.NonTerminal=s;var o=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.orgText="",t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.Rule=o;var c=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.ignoreAmbiguities=!1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.Alternative=c;var A=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.Option=A;var a=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.RepetitionMandatory=a;var d=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.RepetitionMandatoryWithSeparator=d;var u=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.Repetition=u;var b=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return p})(r);i.RepetitionWithSeparator=b;var f=(function(h){e(p,h);function p(C){var g=h.call(this,C.definition)||this;return g.idx=1,g.ignoreAmbiguities=!1,g.hasPredicates=!1,t.assign(g,t.pick(C,function(B){return B!==void 0})),g}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(r);i.Alternation=f;var m=(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})();i.Terminal=m;function E(h){return t.map(h,l)}i.serializeGrammar=E;function l(h){function p(B){return t.map(B,l)}if(h instanceof s)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 m({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof b)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new m({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 m){var C={type:"Terminal",name:h.terminalType.name,label:n.tokenLabel(h.terminalType),idx:h.idx},g=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(g)?g.source:g),C}else{if(h instanceof o)return{type:"Rule",name:h.name,orgText:h.orgText,definition:p(h.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),ln=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=Se(),t=We(),n=(function(){function s(){}return s.prototype.walk=function(o,c){var A=this;c===void 0&&(c=[]),e.forEach(o.definition,function(a,d){var u=e.drop(o.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")})},s.prototype.walkTerminal=function(o,c,A){},s.prototype.walkProdRef=function(o,c,A){},s.prototype.walkFlat=function(o,c,A){var a=c.concat(A);this.walk(o,a)},s.prototype.walkOption=function(o,c,A){var a=c.concat(A);this.walk(o,a)},s.prototype.walkAtLeastOne=function(o,c,A){var a=[new t.Option({definition:o.definition})].concat(c,A);this.walk(o,a)},s.prototype.walkAtLeastOneSep=function(o,c,A){var a=r(o,c,A);this.walk(o,a)},s.prototype.walkMany=function(o,c,A){var a=[new t.Option({definition:o.definition})].concat(c,A);this.walk(o,a)},s.prototype.walkManySep=function(o,c,A){var a=r(o,c,A);this.walk(o,a)},s.prototype.walkOr=function(o,c,A){var a=this,d=c.concat(A);e.forEach(o.definition,function(u){var b=new t.Alternative({definition:[u]});a.walk(b,d)})},s})();i.RestWalker=n;function r(s,o,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:s.separator})].concat(s.definition)})],a=A.concat(o,c);return a}}),yt=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=We(),t=(function(){function n(){}return n.prototype.visit=function(r){var s=r;switch(s.constructor){case e.NonTerminal:return this.visitNonTerminal(s);case e.Alternative:return this.visitAlternative(s);case e.Option:return this.visitOption(s);case e.RepetitionMandatory:return this.visitRepetitionMandatory(s);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(s);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(s);case e.Repetition:return this.visitRepetition(s);case e.Alternation:return this.visitAlternation(s);case e.Terminal:return this.visitTerminal(s);case e.Rule:return this.visitRule(s);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),St=Be(i=>{var e=i&&i.__extends||(function(){var b=function(f,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,l){E.__proto__=l}||function(E,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(E[h]=l[h])},b(f,m)};return function(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");b(f,m);function E(){this.constructor=f}f.prototype=m===null?Object.create(m):(E.prototype=m.prototype,new E)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=Se(),n=We(),r=yt();function s(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}i.isSequenceProd=s;function o(b,f){f===void 0&&(f=[]);var m=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return m?!0:b instanceof n.Alternation?t.some(b.definition,function(E){return o(E,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(E){return o(E,f)})):!1}i.isOptionalProd=o;function c(b){return b instanceof n.Alternation}i.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")}i.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var m=b!==null&&b.apply(this,arguments)||this;return m.separator="-",m.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},m}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(m){var E=m.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(m)},f.prototype.visitNonTerminal=function(m){var E=m.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(m)},f.prototype.visitOption=function(m){this.dslMethods.option.push(m)},f.prototype.visitRepetitionWithSeparator=function(m){this.dslMethods.repetitionWithSeparator.push(m)},f.prototype.visitRepetitionMandatory=function(m){this.dslMethods.repetitionMandatory.push(m)},f.prototype.visitRepetitionMandatoryWithSeparator=function(m){this.dslMethods.repetitionMandatoryWithSeparator.push(m)},f.prototype.visitRepetition=function(m){this.dslMethods.repetition.push(m)},f.prototype.visitAlternation=function(m){this.dslMethods.alternation.push(m)},f})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var d=new a;function u(b){d.reset(),b.accept(d);var f=d.dslMethods;return d.reset(),f}i.collectMethods=u}),Gi=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=Se(),t=We(),n=St();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return s(A);if(n.isBranchingProd(A))return o(A);throw Error("non exhaustive match")}i.first=r;function s(A){for(var a=[],d=A.definition,u=0,b=d.length>u,f,m=!0;b&&m;)f=d[u],m=n.isOptionalProd(f),a=a.concat(r(f)),u=u+1,b=d.length>u;return e.uniq(a)}i.firstForSequence=s;function o(A){var a=e.map(A.definition,function(d){return r(d)});return e.uniq(e.flatten(a))}i.firstForBranching=o;function c(A){return[A.terminalType]}i.firstForTerminal=c}),Ui=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),Vo=Be(i=>{var e=i&&i.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,E){m.__proto__=E}||function(m,E){for(var l in E)Object.prototype.hasOwnProperty.call(E,l)&&(m[l]=E[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 m(){this.constructor=b}b.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=ln(),n=Gi(),r=Se(),s=Ui(),o=We(),c=(function(u){e(b,u);function b(f){var m=u.call(this)||this;return m.topProd=f,m.follows={},m}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,m,E){},b.prototype.walkProdRef=function(f,m,E){var l=a(f.referencedRule,f.idx)+this.topProd.name,h=m.concat(E),p=new o.Alternative({definition:h}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var b={};return r.forEach(u,function(f){var m=new c(f).startWalking();r.assign(b,m)}),b}i.computeAllProdsFollows=A;function a(u,b){return u.name+b+s.IN}i.buildBetweenProdsFollowPrefix=a;function d(u){var b=u.terminalType.name;return b+u.idx+s.IN}i.buildInProdFollowPrefix=d}),Lt=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=ct(),t=Se(),n=Se(),r=We(),s=St();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(o){var c=o.expected,A=o.actual;o.previous,o.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(o){var c=o.firstRedundant;return o.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(o){var c=o.expectedPathsPerAlt,A=o.actual;o.previous;var a=o.customUserDescription;o.ruleName;var d="Expecting: ",u=n.first(A).image,b=`
|
|
123
|
-
but found: '`+u+"'";if(a)return
|
|
121
|
+
`+b)}var f=this.tokenizeInternal(a,h);return f},A.prototype.tokenizeInternal=function(a,h){var u=this,b,f,I,E,l,d,p,C,m,y,Q,_,j,v,M=a,x=M.length,R=0,N=0,L=this.hasCustom?0:Math.floor(a.length/10),W=new Array(L),J=[],K=this.trackStartLines?1:void 0,ee=this.trackStartLines?1:void 0,te=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,oe=this.config.lineTerminatorsPattern,ae=0,Ae=[],Ie=[],U=[],P=[];Object.freeze(P);var q=void 0;function X(){return Ae}function ne(B){var S=e.charCodeToOptimizedIndex(B),w=Ie[S];return w===void 0?P:w}var le=function(B){if(U.length===1&&B.tokenType.PUSH_MODE===void 0){var S=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(B);J.push({offset:B.startOffset,line:B.startLine!==void 0?B.startLine:void 0,column:B.startColumn!==void 0?B.startColumn:void 0,length:B.image.length,message:S})}else{U.pop();var w=t.last(U);Ae=u.patternIdxToConfig[w],Ie=u.charCodeToPatternIdxToConfig[w],ae=Ae.length;var D=u.canModeBeOptimized[w]&&u.config.safeMode===!1;Ie&&D?q=ne:q=X}};function we(B){U.push(B),Ie=this.charCodeToPatternIdxToConfig[B],Ae=this.patternIdxToConfig[B],ae=Ae.length,ae=Ae.length;var S=this.canModeBeOptimized[B]&&this.config.safeMode===!1;Ie&&S?q=ne:q=X}we.call(this,h);for(var Re;R<x;){l=null;var Fe=M.charCodeAt(R),We=q(Fe),ze=We.length;for(b=0;b<ze;b++){Re=We[b];var Ke=Re.pattern;d=null;var O=Re.short;if(O!==!1?Fe===O&&(l=Ke):Re.isCustom===!0?(v=Ke.exec(M,R,W,te),v!==null?(l=v[0],v.payload!==void 0&&(d=v.payload)):l=null):(this.updateLastIndex(Ke,R),l=this.match(Ke,a,R)),l!==null){if(E=Re.longerAlt,E!==void 0){var Y=Ae[E],V=Y.pattern;p=null,Y.isCustom===!0?(v=V.exec(M,R,W,te),v!==null?(I=v[0],v.payload!==void 0&&(p=v.payload)):I=null):(this.updateLastIndex(V,R),I=this.match(V,a,R)),I&&I.length>l.length&&(l=I,d=p,Re=Y)}break}}if(l!==null){if(C=l.length,m=Re.group,m!==void 0&&(y=Re.tokenTypeIdx,Q=this.createTokenInstance(l,R,y,Re.tokenType,K,ee,C),this.handlePayload(Q,d),m===!1?N=this.addToken(W,N,Q):te[m].push(Q)),a=this.chopInput(a,C),R=R+C,ee=this.computeNewColumn(ee,C),ue===!0&&Re.canLineTerminator===!0){var ie=0,de=void 0,Le=void 0;oe.lastIndex=0;do de=oe.test(l),de===!0&&(Le=oe.lastIndex-1,ie++);while(de===!0);ie!==0&&(K=K+ie,ee=C-Le,this.updateTokenEndLineColumnLocation(Q,m,Le,ie,K,ee,C))}this.handleModes(Re,le,we,Q)}else{for(var Ce=R,ce=K,Ue=ee,k=!1;!k&&R<x;)for(M.charCodeAt(R),a=this.chopInput(a,1),R++,f=0;f<ae;f++){var T=Ae[f],Ke=T.pattern,O=T.short;if(O!==!1?M.charCodeAt(R)===O&&(k=!0):T.isCustom===!0?k=Ke.exec(M,R,W,te)!==null:(this.updateLastIndex(Ke,R),k=Ke.exec(a)!==null),k===!0)break}_=R-Ce,j=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Ce,_,ce,Ue),J.push({offset:Ce,line:ce,column:Ue,length:_,message:j})}}return this.hasCustom||(W.length=N),{tokens:W,groups:te,errors:J}},A.prototype.handleModes=function(a,h,u,b){if(a.pop===!0){var f=a.push;h(b),f!==void 0&&u.call(this,f)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,h){return a.substring(h)},A.prototype.updateLastIndex=function(a,h){a.lastIndex=h},A.prototype.updateTokenEndLineColumnLocation=function(a,h,u,b,f,I,E){var l,d;h!==void 0&&(l=u===E-1,d=l?-1:0,b===1&&l===!0||(a.endLine=f+d,a.endColumn=I-1+-d))},A.prototype.computeNewColumn=function(a,h){return a+h},A.prototype.createTokenInstance=function(){for(var a=[],h=0;h<arguments.length;h++)a[h]=arguments[h];return null},A.prototype.createOffsetOnlyToken=function(a,h,u,b){return{image:a,startOffset:h,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,h,u,b,f,I){return{image:a,startOffset:h,startLine:f,startColumn:I,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,h,u,b,f,I,E){return{image:a,startOffset:h,endOffset:h+E-1,startLine:f,endLine:f,startColumn:I,endColumn:I+E-1,tokenTypeIdx:u,tokenType:b}},A.prototype.addToken=function(a,h,u){return 666},A.prototype.addTokenUsingPush=function(a,h,u){return a.push(u),h},A.prototype.addTokenUsingMemberAccess=function(a,h,u){return a[h]=u,h++,h},A.prototype.handlePayload=function(a,h){},A.prototype.handlePayloadNoCustom=function(a,h){},A.prototype.handlePayloadWithCustom=function(a,h){h!==null&&(a.payload=h)},A.prototype.match=function(a,h,u){return null},A.prototype.matchWithTest=function(a,h,u){var b=a.test(h);return b===!0?h.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,h){var u=a.exec(h);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,h){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(h),f=b.time,I=b.value,E=f>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&E(u+"<-- <"+a+"> time: "+f+"ms"),this.traceInitIndent--,I}else return h()},A.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",A.NA=/NOT_APPLICABLE/,A})();i.Lexer=c}),ft=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tokenMatcher=i.createTokenInstance=i.EOF=i.createToken=i.hasTokenLabel=i.tokenName=i.tokenLabel=void 0;var e=De(),t=Nt(),n=Qt();function r(m){return s(m)?m.LABEL:m.name}i.tokenLabel=r;function o(m){return m.name}i.tokenName=o;function s(m){return e.isString(m.LABEL)&&m.LABEL!==""}i.hasTokenLabel=s;var c="parent",A="categories",a="label",h="group",u="push_mode",b="pop_mode",f="longer_alt",I="line_breaks",E="start_chars_hint";function l(m){return d(m)}i.createToken=l;function d(m){var y=m.pattern,Q={};if(Q.name=m.name,e.isUndefined(y)||(Q.PATTERN=y),e.has(m,c))throw`The parent property is no longer supported.
|
|
122
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(m,A)&&(Q.CATEGORIES=m[A]),n.augmentTokenTypes([Q]),e.has(m,a)&&(Q.LABEL=m[a]),e.has(m,h)&&(Q.GROUP=m[h]),e.has(m,b)&&(Q.POP_MODE=m[b]),e.has(m,u)&&(Q.PUSH_MODE=m[u]),e.has(m,f)&&(Q.LONGER_ALT=m[f]),e.has(m,I)&&(Q.LINE_BREAKS=m[I]),e.has(m,E)&&(Q.START_CHARS_HINT=m[E]),Q}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function p(m,y,Q,_,j,v,M,x){return{image:y,startOffset:Q,endOffset:_,startLine:j,endLine:v,startColumn:M,endColumn:x,tokenTypeIdx:m.tokenTypeIdx,tokenType:m}}i.createTokenInstance=p;function C(m,y){return n.tokenStructuredMatcher(m,y)}i.tokenMatcher=C}),Ze=Qe(i=>{var e=i&&i.__extends||(function(){var d=function(p,C){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var Q in y)Object.prototype.hasOwnProperty.call(y,Q)&&(m[Q]=y[Q])},d(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");d(p,C);function m(){this.constructor=p}p.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=De(),n=ft(),r=(function(){function d(p){this._definition=p}return Object.defineProperty(d.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),d.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},d})();i.AbstractProduction=r;var o=(function(d){e(p,d);function p(C){var m=d.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})(r);i.NonTerminal=o;var s=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.orgText="",t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Rule=s;var c=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.ignoreAmbiguities=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Alternative=c;var A=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Option=A;var a=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionMandatory=a;var h=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionMandatoryWithSeparator=h;var u=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Repetition=u;var b=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionWithSeparator=b;var f=(function(d){e(p,d);function p(C){var m=d.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})(r);i.Alternation=f;var I=(function(){function d(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return d.prototype.accept=function(p){p.visit(this)},d})();i.Terminal=I;function E(d){return t.map(d,l)}i.serializeGrammar=E;function l(d){function p(y){return t.map(y,l)}if(d instanceof o)return{type:"NonTerminal",name:d.nonTerminalName,idx:d.idx};if(d instanceof c)return{type:"Alternative",definition:p(d.definition)};if(d instanceof A)return{type:"Option",idx:d.idx,definition:p(d.definition)};if(d instanceof a)return{type:"RepetitionMandatory",idx:d.idx,definition:p(d.definition)};if(d instanceof h)return{type:"RepetitionMandatoryWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof b)return{type:"RepetitionWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof u)return{type:"Repetition",idx:d.idx,definition:p(d.definition)};if(d instanceof f)return{type:"Alternation",idx:d.idx,definition:p(d.definition)};if(d instanceof I){var C={type:"Terminal",name:d.terminalType.name,label:n.tokenLabel(d.terminalType),idx:d.idx},m=d.terminalType.PATTERN;return d.terminalType.PATTERN&&(C.pattern=t.isRegExp(m)?m.source:m),C}else{if(d instanceof s)return{type:"Rule",name:d.name,orgText:d.orgText,definition:p(d.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),pn=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=De(),t=Ze(),n=(function(){function o(){}return o.prototype.walk=function(s,c){var A=this;c===void 0&&(c=[]),e.forEach(s.definition,function(a,h){var u=e.drop(s.definition,h+1);if(a instanceof t.NonTerminal)A.walkProdRef(a,u,c);else if(a instanceof t.Terminal)A.walkTerminal(a,u,c);else if(a instanceof t.Alternative)A.walkFlat(a,u,c);else if(a instanceof t.Option)A.walkOption(a,u,c);else if(a instanceof t.RepetitionMandatory)A.walkAtLeastOne(a,u,c);else if(a instanceof t.RepetitionMandatoryWithSeparator)A.walkAtLeastOneSep(a,u,c);else if(a instanceof t.RepetitionWithSeparator)A.walkManySep(a,u,c);else if(a instanceof t.Repetition)A.walkMany(a,u,c);else if(a instanceof t.Alternation)A.walkOr(a,u,c);else throw Error("non exhaustive match")})},o.prototype.walkTerminal=function(s,c,A){},o.prototype.walkProdRef=function(s,c,A){},o.prototype.walkFlat=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkOption=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkAtLeastOne=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkAtLeastOneSep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkMany=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkManySep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkOr=function(s,c,A){var a=this,h=c.concat(A);e.forEach(s.definition,function(u){var b=new t.Alternative({definition:[u]});a.walk(b,h)})},o})();i.RestWalker=n;function r(o,s,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:o.separator})].concat(o.definition)})],a=A.concat(s,c);return a}}),kt=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=Ze(),t=(function(){function n(){}return n.prototype.visit=function(r){var o=r;switch(o.constructor){case e.NonTerminal:return this.visitNonTerminal(o);case e.Alternative:return this.visitAlternative(o);case e.Option:return this.visitOption(o);case e.RepetitionMandatory:return this.visitRepetitionMandatory(o);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(o);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(o);case e.Repetition:return this.visitRepetition(o);case e.Alternation:return this.visitAlternation(o);case e.Terminal:return this.visitTerminal(o);case e.Rule:return this.visitRule(o);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),Dt=Qe(i=>{var e=i&&i.__extends||(function(){var b=function(f,I){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,l){E.__proto__=l}||function(E,l){for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(E[d]=l[d])},b(f,I)};return function(f,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");b(f,I);function E(){this.constructor=f}f.prototype=I===null?Object.create(I):(E.prototype=I.prototype,new E)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=De(),n=Ze(),r=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}i.isSequenceProd=o;function s(b,f){f===void 0&&(f=[]);var I=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return I?!0:b instanceof n.Alternation?t.some(b.definition,function(E){return s(E,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(E){return s(E,f)})):!1}i.isOptionalProd=s;function c(b){return b instanceof n.Alternation}i.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")}i.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var I=b!==null&&b.apply(this,arguments)||this;return I.separator="-",I.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},I}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(I){var E=I.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(I)},f.prototype.visitNonTerminal=function(I){var E=I.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(I)},f.prototype.visitOption=function(I){this.dslMethods.option.push(I)},f.prototype.visitRepetitionWithSeparator=function(I){this.dslMethods.repetitionWithSeparator.push(I)},f.prototype.visitRepetitionMandatory=function(I){this.dslMethods.repetitionMandatory.push(I)},f.prototype.visitRepetitionMandatoryWithSeparator=function(I){this.dslMethods.repetitionMandatoryWithSeparator.push(I)},f.prototype.visitRepetition=function(I){this.dslMethods.repetition.push(I)},f.prototype.visitAlternation=function(I){this.dslMethods.alternation.push(I)},f})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var h=new a;function u(b){h.reset(),b.accept(h);var f=h.dslMethods;return h.reset(),f}i.collectMethods=u}),Wi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=De(),t=Ze(),n=Dt();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return o(A);if(n.isBranchingProd(A))return s(A);throw Error("non exhaustive match")}i.first=r;function o(A){for(var a=[],h=A.definition,u=0,b=h.length>u,f,I=!0;b&&I;)f=h[u],I=n.isOptionalProd(f),a=a.concat(r(f)),u=u+1,b=h.length>u;return e.uniq(a)}i.firstForSequence=o;function s(A){var a=e.map(A.definition,function(h){return r(h)});return e.uniq(e.flatten(a))}i.firstForBranching=s;function c(A){return[A.terminalType]}i.firstForTerminal=c}),Yi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),rs=Qe(i=>{var e=i&&i.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,E){I.__proto__=E}||function(I,E){for(var l in E)Object.prototype.hasOwnProperty.call(E,l)&&(I[l]=E[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 I(){this.constructor=b}b.prototype=f===null?Object.create(f):(I.prototype=f.prototype,new I)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=pn(),n=Wi(),r=De(),o=Yi(),s=Ze(),c=(function(u){e(b,u);function b(f){var I=u.call(this)||this;return I.topProd=f,I.follows={},I}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,I,E){},b.prototype.walkProdRef=function(f,I,E){var l=a(f.referencedRule,f.idx)+this.topProd.name,d=I.concat(E),p=new s.Alternative({definition:d}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var b={};return r.forEach(u,function(f){var I=new c(f).startWalking();r.assign(b,I)}),b}i.computeAllProdsFollows=A;function a(u,b){return u.name+b+o.IN}i.buildBetweenProdsFollowPrefix=a;function h(u){var b=u.terminalType.name;return b+u.idx+o.IN}i.buildInProdFollowPrefix=h}),Ft=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=ft(),t=De(),n=De(),r=Ze(),o=Dt();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(s){var c=s.expected,A=s.actual;s.previous,s.ruleName;var a=e.hasTokenLabel(c),h=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+h+" 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 h="Expecting: ",u=n.first(A).image,b=`
|
|
123
|
+
but found: '`+u+"'";if(a)return h+a+b;var f=n.reduce(c,function(d,p){return d.concat(p)},[]),I=n.map(f,function(d){return"["+n.map(d,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),E=n.map(I,function(d,p){return" "+(p+1)+". "+d}),l=`one of these possible Token sequences:
|
|
124
124
|
`+E.join(`
|
|
125
|
-
`);return
|
|
126
|
-
but found: '`+u+"'";if(a)return
|
|
127
|
-
`+("<"+f.join(" ,")+">");return
|
|
128
|
-
inside top level rule: ->`+
|
|
125
|
+
`);return h+l+b},buildEarlyExitMessage:function(s){var c=s.expectedIterationPaths,A=s.actual,a=s.customUserDescription;s.ruleName;var h="Expecting: ",u=n.first(A).image,b=`
|
|
126
|
+
but found: '`+u+"'";if(a)return h+a+b;var f=n.map(c,function(E){return"["+n.map(E,function(l){return e.tokenLabel(l)}).join(",")+"]"}),I=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
127
|
+
`+("<"+f.join(" ,")+">");return h+I+b}},Object.freeze(i.defaultParserErrorProvider),i.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(s,c){var A="Invalid grammar, reference to a rule which is not defined: ->"+c.nonTerminalName+`<-
|
|
128
|
+
inside top level rule: ->`+s.name+"<-";return A}},i.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(s,c){function A(l){return l instanceof r.Terminal?l.terminalType.name:l instanceof r.NonTerminal?l.nonTerminalName:""}var a=s.name,h=n.first(c),u=h.idx,b=o.getProductionDslName(h),f=A(h),I=u>0,E="->"+b+(I?u:"")+"<- "+(f?"with argument: ->"+f+"<-":"")+`
|
|
129
129
|
appears more than once (`+c.length+" times) in the top level rule: ->"+a+`<-.
|
|
130
130
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
131
131
|
`;return E=E.replace(/[ \t]+/g," "),E=E.replace(/\s\s+/g,`
|
|
132
|
-
`),E},buildNamespaceConflictError:function(
|
|
133
|
-
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+
|
|
132
|
+
`),E},buildNamespaceConflictError:function(s){var c=`Namespace conflict found in grammar.
|
|
133
|
+
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+s.name+`>.
|
|
134
134
|
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
135
135
|
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
136
|
-
and Non-Terminal names start with a lower case letter.`;return c},buildAlternationPrefixAmbiguityError:function(
|
|
137
|
-
`+("in <OR"+A+"> inside <"+
|
|
136
|
+
and Non-Terminal names start with a lower case letter.`;return c},buildAlternationPrefixAmbiguityError:function(s){var c=n.map(s.prefixPath,function(h){return e.tokenLabel(h)}).join(", "),A=s.alternation.idx===0?"":s.alternation.idx,a="Ambiguous alternatives: <"+s.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
|
|
137
|
+
`+("in <OR"+A+"> inside <"+s.topLevelRule.name+`> Rule,
|
|
138
138
|
`)+("<"+c+`> may appears as a prefix path in all these alternatives.
|
|
139
139
|
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
140
|
-
For Further details.`;return a},buildAlternationAmbiguityError:function(
|
|
140
|
+
For Further details.`;return a},buildAlternationAmbiguityError:function(s){var c=n.map(s.prefixPath,function(h){return e.tokenLabel(h)}).join(", "),A=s.alternation.idx===0?"":s.alternation.idx,a="Ambiguous Alternatives Detected: <"+s.ambiguityIndices.join(" ,")+"> in <OR"+A+">"+(" inside <"+s.topLevelRule.name+`> Rule,
|
|
141
141
|
`)+("<"+c+`> may appears as a prefix path in all these alternatives.
|
|
142
142
|
`);return a=a+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
143
|
-
For Further details.`,a},buildEmptyRepetitionError:function(
|
|
144
|
-
This could lead to an infinite loop.`;return A},buildTokenNameError:function(
|
|
145
|
-
`)+"Only the last alternative may be an empty alternative.";return c},buildTooManyAlternativesError:function(
|
|
146
|
-
`+("<OR"+
|
|
147
|
-
has `+(
|
|
143
|
+
For Further details.`,a},buildEmptyRepetitionError:function(s){var c=o.getProductionDslName(s.repetition);s.repetition.idx!==0&&(c+=s.repetition.idx);var A="The repetition <"+c+"> within Rule <"+s.topLevelRule.name+`> can never consume any tokens.
|
|
144
|
+
This could lead to an infinite loop.`;return A},buildTokenNameError:function(s){return"deprecated"},buildEmptyAlternationError:function(s){var c="Ambiguous empty alternative: <"+(s.emptyChoiceIdx+1)+">"+(" in <OR"+s.alternation.idx+"> inside <"+s.topLevelRule.name+`> Rule.
|
|
145
|
+
`)+"Only the last alternative may be an empty alternative.";return c},buildTooManyAlternativesError:function(s){var c=`An Alternation cannot have more than 256 alternatives:
|
|
146
|
+
`+("<OR"+s.alternation.idx+"> inside <"+s.topLevelRule.name+`> Rule.
|
|
147
|
+
has `+(s.alternation.definition.length+1)+" alternatives.");return c},buildLeftRecursionError:function(s){var c=s.topLevelRule.name,A=t.map(s.leftRecursionPath,function(u){return u.name}),a=c+" --> "+A.concat([c]).join(" --> "),h=`Left Recursion found in grammar.
|
|
148
148
|
`+("rule: <"+c+`> can be invoked from itself (directly or indirectly)
|
|
149
149
|
`)+(`without consuming any Tokens. The grammar path that causes this is:
|
|
150
150
|
`+a+`
|
|
151
151
|
`)+` To fix this refactor your grammar to remove the left recursion.
|
|
152
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return d},buildInvalidRuleNameError:function(o){return"deprecated"},buildDuplicateRuleNameError:function(o){var c;o.topLevelRule instanceof r.Rule?c=o.topLevelRule.name:c=o.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+o.grammarName+"<-";return A}}}),Yo=Be(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,u){d.__proto__=u}||function(d,u){for(var 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(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=Xe(),n=Se(),r=yt();function s(c,A){var a=new o(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=s;var o=(function(c){e(A,c);function A(a,d){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=d,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(d){a.currTopLevel=d,d.accept(a)})},A.prototype.visitNonTerminal=function(a){var d=this.nameToTopRule[a.nonTerminalName];if(d)a.referencedRule=d;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=o}),_t=Be(i=>{var e=i&&i.__extends||(function(){var l=function(h,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,g){C.__proto__=g}||function(C,g){for(var B in g)Object.prototype.hasOwnProperty.call(g,B)&&(C[B]=g[B])},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(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=ln(),n=Se(),r=Gi(),s=We(),o=(function(l){e(h,l);function h(p,C){var g=l.call(this)||this;return g.topProd=p,g.path=C,g.possibleTokTypes=[],g.nextProductionName="",g.nextProductionOccurrence=0,g.found=!1,g.isAtEndOfPath=!1,g}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,g){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var B=C.concat(g);this.updateExpectedNext(),this.walk(p.referencedRule,B)}},h.prototype.updateExpectedNext=function(){n.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},h})(t.RestWalker);i.AbstractNextPossibleTokensWalker=o;var c=(function(l){e(h,l);function h(p,C){var g=l.call(this,p,C)||this;return g.path=C,g.nextTerminalName="",g.nextTerminalOccurrence=0,g.nextTerminalName=g.path.lastTok.name,g.nextTerminalOccurrence=g.path.lastTokOccurrence,g}return h.prototype.walkTerminal=function(p,C,g){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var B=C.concat(g),Q=new s.Alternative({definition:B});this.possibleTokTypes=r.first(Q),this.found=!0}},h})(o);i.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(p,C){var g=l.call(this)||this;return g.topRule=p,g.occurrence=C,g.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},g}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(p,C,g){if(p.idx===this.occurrence){var B=n.first(C.concat(g));this.result.isEndOfRule=B===void 0,B instanceof s.Terminal&&(this.result.token=B.terminalType,this.result.occurrence=B.idx)}else l.prototype.walkMany.call(this,p,C,g)},h})(A);i.NextTerminalAfterManyWalker=a;var d=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(p,C,g){if(p.idx===this.occurrence){var B=n.first(C.concat(g));this.result.isEndOfRule=B===void 0,B instanceof s.Terminal&&(this.result.token=B.terminalType,this.result.occurrence=B.idx)}else l.prototype.walkManySep.call(this,p,C,g)},h})(A);i.NextTerminalAfterManySepWalker=d;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(p,C,g){if(p.idx===this.occurrence){var B=n.first(C.concat(g));this.result.isEndOfRule=B===void 0,B instanceof s.Terminal&&(this.result.token=B.terminalType,this.result.occurrence=B.idx)}else l.prototype.walkAtLeastOne.call(this,p,C,g)},h})(A);i.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,g){if(p.idx===this.occurrence){var B=n.first(C.concat(g));this.result.isEndOfRule=B===void 0,B instanceof s.Terminal&&(this.result.token=B.terminalType,this.result.occurrence=B.idx)}else l.prototype.walkAtLeastOneSep.call(this,p,C,g)},h})(A);i.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,h,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],g=0;function B(R){return R.concat(n.drop(l,g+1))}function Q(R){var F=f(B(R),h,p);return C.concat(F)}for(;p.length<h&&g<l.length;){var S=l[g];if(S instanceof s.Alternative||S instanceof s.NonTerminal)return Q(S.definition);if(S instanceof s.Option)C=Q(S.definition);else if(S instanceof s.RepetitionMandatory){var j=S.definition.concat([new s.Repetition({definition:S.definition})]);return Q(j)}else if(S instanceof s.RepetitionMandatoryWithSeparator){var j=[new s.Alternative({definition:S.definition}),new s.Repetition({definition:[new s.Terminal({terminalType:S.separator})].concat(S.definition)})];return Q(j)}else if(S instanceof s.RepetitionWithSeparator){var j=S.definition.concat([new s.Repetition({definition:[new s.Terminal({terminalType:S.separator})].concat(S.definition)})]);C=Q(j)}else if(S instanceof s.Repetition){var j=S.definition.concat([new s.Repetition({definition:S.definition})]);C=Q(j)}else{if(S instanceof s.Alternation)return n.forEach(S.definition,function(R){n.isEmpty(R.definition)===!1&&(C=Q(R.definition))}),C;if(S instanceof s.Terminal)p.push(S.terminalType);else throw Error("non exhaustive match")}g++}return C.push({partialPath:p,suffixDef:n.drop(l,g)}),C}i.possiblePathsFrom=f;function m(l,h,p,C){var g="EXIT_NONE_TERMINAL",B=[g],Q="EXIT_ALTERNATIVE",S=!1,j=h.length,R=j-C-1,F=[],L=[];for(L.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(L);){var k=L.pop();if(k===Q){S&&n.last(L).idx<=R&&L.pop();continue}var x=k.def,_=k.idx,V=k.ruleStack,J=k.occurrenceStack;if(!n.isEmpty(x)){var q=x[0];if(q===g){var X={idx:_,def:n.drop(x),ruleStack:n.dropRight(V),occurrenceStack:n.dropRight(J)};L.push(X)}else if(q instanceof s.Terminal)if(_<j-1){var Z=_+1,ce=h[Z];if(p(ce,q.terminalType)){var X={idx:Z,def:n.drop(x),ruleStack:V,occurrenceStack:J};L.push(X)}}else if(_===j-1)F.push({nextTokenType:q.terminalType,nextTokenOccurrence:q.idx,ruleStack:V,occurrenceStack:J}),S=!0;else throw Error("non exhaustive match");else if(q instanceof s.NonTerminal){var re=n.cloneArr(V);re.push(q.nonTerminalName);var oe=n.cloneArr(J);oe.push(q.idx);var X={idx:_,def:q.definition.concat(B,n.drop(x)),ruleStack:re,occurrenceStack:oe};L.push(X)}else if(q instanceof s.Option){var ee={idx:_,def:n.drop(x),ruleStack:V,occurrenceStack:J};L.push(ee),L.push(Q);var he={idx:_,def:q.definition.concat(n.drop(x)),ruleStack:V,occurrenceStack:J};L.push(he)}else if(q instanceof s.RepetitionMandatory){var P=new s.Repetition({definition:q.definition,idx:q.idx}),H=q.definition.concat([P],n.drop(x)),X={idx:_,def:H,ruleStack:V,occurrenceStack:J};L.push(X)}else if(q instanceof s.RepetitionMandatoryWithSeparator){var W=new s.Terminal({terminalType:q.separator}),P=new s.Repetition({definition:[W].concat(q.definition),idx:q.idx}),H=q.definition.concat([P],n.drop(x)),X={idx:_,def:H,ruleStack:V,occurrenceStack:J};L.push(X)}else if(q instanceof s.RepetitionWithSeparator){var ee={idx:_,def:n.drop(x),ruleStack:V,occurrenceStack:J};L.push(ee),L.push(Q);var W=new s.Terminal({terminalType:q.separator}),$=new s.Repetition({definition:[W].concat(q.definition),idx:q.idx}),H=q.definition.concat([$],n.drop(x)),he={idx:_,def:H,ruleStack:V,occurrenceStack:J};L.push(he)}else if(q instanceof s.Repetition){var ee={idx:_,def:n.drop(x),ruleStack:V,occurrenceStack:J};L.push(ee),L.push(Q);var $=new s.Repetition({definition:q.definition,idx:q.idx}),H=q.definition.concat([$],n.drop(x)),he={idx:_,def:H,ruleStack:V,occurrenceStack:J};L.push(he)}else if(q instanceof s.Alternation)for(var ne=q.definition.length-1;ne>=0;ne--){var le=q.definition[ne],Ce={idx:_,def:le.definition.concat(n.drop(x)),ruleStack:V,occurrenceStack:J};L.push(Ce),L.push(Q)}else if(q instanceof s.Alternative)L.push({idx:_,def:q.definition.concat(n.drop(x)),ruleStack:V,occurrenceStack:J});else if(q instanceof s.Rule)L.push(E(q,_,V,J));else throw Error("non exhaustive match")}}return F}i.nextPossibleTokensAfter=m;function E(l,h,p,C){var g=n.cloneArr(p);g.push(l.name);var B=n.cloneArr(C);return B.push(1),{idx:h,def:l.definition,ruleStack:g,occurrenceStack:B}}}),xt=Be(i=>{var e=i&&i.__extends||(function(){var R=function(F,L){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,x){k.__proto__=x}||function(k,x){for(var _ in x)Object.prototype.hasOwnProperty.call(x,_)&&(k[_]=x[_])},R(F,L)};return function(F,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");R(F,L);function k(){this.constructor=F}F.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=Se(),n=_t(),r=ln(),s=Ct(),o=We(),c=yt(),A;(function(R){R[R.OPTION=0]="OPTION",R[R.REPETITION=1]="REPETITION",R[R.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",R[R.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",R[R.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",R[R.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(R){if(R instanceof o.Option)return A.OPTION;if(R instanceof o.Repetition)return A.REPETITION;if(R instanceof o.RepetitionMandatory)return A.REPETITION_MANDATORY;if(R instanceof o.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(R instanceof o.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(R instanceof o.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function d(R,F,L,k,x,_){var V=g(R,F,L),J=j(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return _(V,k,J,x)}i.buildLookaheadFuncForOr=d;function u(R,F,L,k,x,_){var V=B(R,F,x,L),J=j(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return _(V[0],J,k)}i.buildLookaheadFuncForOptionalProd=u;function b(R,F,L,k){var x=R.length,_=t.every(R,function(q){return t.every(q,function(X){return X.length===1})});if(F)return function(q){for(var X=t.map(q,function($){return $.GATE}),Z=0;Z<x;Z++){var ce=R[Z],re=ce.length,oe=X[Z];if(!(oe!==void 0&&oe.call(this)===!1))e:for(var ee=0;ee<re;ee++){for(var he=ce[ee],P=he.length,H=0;H<P;H++){var W=this.LA(H+1);if(L(W,he[H])===!1)continue e}return Z}}};if(_&&!k){var V=t.map(R,function(q){return t.flatten(q)}),J=t.reduce(V,function(q,X,Z){return t.forEach(X,function(ce){t.has(q,ce.tokenTypeIdx)||(q[ce.tokenTypeIdx]=Z),t.forEach(ce.categoryMatches,function(re){t.has(q,re)||(q[re]=Z)})}),q},[]);return function(){var q=this.LA(1);return J[q.tokenTypeIdx]}}else return function(){for(var q=0;q<x;q++){var X=R[q],Z=X.length;e:for(var ce=0;ce<Z;ce++){for(var re=X[ce],oe=re.length,ee=0;ee<oe;ee++){var he=this.LA(ee+1);if(L(he,re[ee])===!1)continue e}return q}}}}i.buildAlternativesLookAheadFunc=b;function f(R,F,L){var k=t.every(R,function(X){return X.length===1}),x=R.length;if(k&&!L){var _=t.flatten(R);if(_.length===1&&t.isEmpty(_[0].categoryMatches)){var V=_[0],J=V.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===J}}else{var q=t.reduce(_,function(X,Z,ce){return X[Z.tokenTypeIdx]=!0,t.forEach(Z.categoryMatches,function(re){X[re]=!0}),X},[]);return function(){var X=this.LA(1);return q[X.tokenTypeIdx]===!0}}}else return function(){e:for(var X=0;X<x;X++){for(var Z=R[X],ce=Z.length,re=0;re<ce;re++){var oe=this.LA(re+1);if(F(oe,Z[re])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=f;var m=(function(R){e(F,R);function F(L,k,x){var _=R.call(this)||this;return _.topProd=L,_.targetOccurrence=k,_.targetProdType=x,_}return F.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},F.prototype.checkIsTarget=function(L,k,x,_){return L.idx===this.targetOccurrence&&this.targetProdType===k?(this.restDef=x.concat(_),!0):!1},F.prototype.walkOption=function(L,k,x){this.checkIsTarget(L,A.OPTION,k,x)||R.prototype.walkOption.call(this,L,k,x)},F.prototype.walkAtLeastOne=function(L,k,x){this.checkIsTarget(L,A.REPETITION_MANDATORY,k,x)||R.prototype.walkOption.call(this,L,k,x)},F.prototype.walkAtLeastOneSep=function(L,k,x){this.checkIsTarget(L,A.REPETITION_MANDATORY_WITH_SEPARATOR,k,x)||R.prototype.walkOption.call(this,L,k,x)},F.prototype.walkMany=function(L,k,x){this.checkIsTarget(L,A.REPETITION,k,x)||R.prototype.walkOption.call(this,L,k,x)},F.prototype.walkManySep=function(L,k,x){this.checkIsTarget(L,A.REPETITION_WITH_SEPARATOR,k,x)||R.prototype.walkOption.call(this,L,k,x)},F})(r.RestWalker),E=(function(R){e(F,R);function F(L,k,x){var _=R.call(this)||this;return _.targetOccurrence=L,_.targetProdType=k,_.targetRef=x,_.result=[],_}return F.prototype.checkIsTarget=function(L,k){L.idx===this.targetOccurrence&&this.targetProdType===k&&(this.targetRef===void 0||L===this.targetRef)&&(this.result=L.definition)},F.prototype.visitOption=function(L){this.checkIsTarget(L,A.OPTION)},F.prototype.visitRepetition=function(L){this.checkIsTarget(L,A.REPETITION)},F.prototype.visitRepetitionMandatory=function(L){this.checkIsTarget(L,A.REPETITION_MANDATORY)},F.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.checkIsTarget(L,A.REPETITION_MANDATORY_WITH_SEPARATOR)},F.prototype.visitRepetitionWithSeparator=function(L){this.checkIsTarget(L,A.REPETITION_WITH_SEPARATOR)},F.prototype.visitAlternation=function(L){this.checkIsTarget(L,A.ALTERNATION)},F})(c.GAstVisitor);function l(R){for(var F=new Array(R),L=0;L<R;L++)F[L]=[];return F}function h(R){for(var F=[""],L=0;L<R.length;L++){for(var k=R[L],x=[],_=0;_<F.length;_++){var V=F[_];x.push(V+"_"+k.tokenTypeIdx);for(var J=0;J<k.categoryMatches.length;J++){var q="_"+k.categoryMatches[J];x.push(V+q)}}F=x}return F}function p(R,F,L){for(var k=0;k<R.length;k++)if(k!==L)for(var x=R[k],_=0;_<F.length;_++){var V=F[_];if(x[V]===!0)return!1}return!0}function C(R,F){for(var L=t.map(R,function(Z){return n.possiblePathsFrom([Z],1)}),k=l(L.length),x=t.map(L,function(Z){var ce={};return t.forEach(Z,function(re){var oe=h(re.partialPath);t.forEach(oe,function(ee){ce[ee]=!0})}),ce}),_=L,V=1;V<=F;V++){var J=_;_=l(J.length);for(var q=function(Z){for(var ce=J[Z],re=0;re<ce.length;re++){var oe=ce[re].partialPath,ee=ce[re].suffixDef,he=h(oe),P=p(x,he,Z);if(P||t.isEmpty(ee)||oe.length===F){var H=k[Z];if(Q(H,oe)===!1){H.push(oe);for(var W=0;W<he.length;W++){var $=he[W];x[Z][$]=!0}}}else{var ne=n.possiblePathsFrom(ee,V+1,oe);_[Z]=_[Z].concat(ne),t.forEach(ne,function(le){var Ce=h(le.partialPath);t.forEach(Ce,function(me){x[Z][me]=!0})})}}},X=0;X<J.length;X++)q(X)}return k}i.lookAheadSequenceFromAlternatives=C;function g(R,F,L,k){var x=new E(R,A.ALTERNATION,k);return F.accept(x),C(x.result,L)}i.getLookaheadPathsForOr=g;function B(R,F,L,k){var x=new E(R,L);F.accept(x);var _=x.result,V=new m(F,R,L),J=V.startWalking(),q=new o.Alternative({definition:_}),X=new o.Alternative({definition:J});return C([q,X],k)}i.getLookaheadPathsForOptionalProd=B;function Q(R,F){e:for(var L=0;L<R.length;L++){var k=R[L];if(k.length===F.length){for(var x=0;x<k.length;x++){var _=F[x],V=k[x],J=_===V||V.categoryMatchesMap[_.tokenTypeIdx]!==void 0;if(J===!1)continue e}return!0}}return!1}i.containsPath=Q;function S(R,F){return R.length<F.length&&t.every(R,function(L,k){var x=F[k];return L===x||x.categoryMatchesMap[L.tokenTypeIdx]})}i.isStrictPrefixOfPath=S;function j(R){return t.every(R,function(F){return t.every(F,function(L){return t.every(L,function(k){return t.isEmpty(k.categoryMatches)})})})}i.areTokenCategoriesNotUsed=j}),Hi=Be(i=>{var e=i&&i.__extends||(function(){var k=function(x,_){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,J){V.__proto__=J}||function(V,J){for(var q in J)Object.prototype.hasOwnProperty.call(J,q)&&(V[q]=J[q])},k(x,_)};return function(x,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");k(x,_);function V(){this.constructor=x}x.prototype=_===null?Object.create(_):(V.prototype=_.prototype,new V)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=Se(),n=Se(),r=Xe(),s=St(),o=xt(),c=_t(),A=We(),a=yt();function d(k,x,_,V,J){var q=t.map(k,function(P){return u(P,V)}),X=t.map(k,function(P){return h(P,P,V)}),Z=[],ce=[],re=[];n.every(X,n.isEmpty)&&(Z=n.map(k,function(P){return g(P,V)}),ce=n.map(k,function(P){return B(P,x,V)}),re=j(k,x,V));var oe=L(k,_,V),ee=n.map(k,function(P){return S(P,V)}),he=n.map(k,function(P){return E(P,k,J,V)});return t.flatten(q.concat(re,X,Z,ce,oe,ee,he))}i.validateGrammar=d;function u(k,x){var _=new m;k.accept(_);var V=_.allProductions,J=t.groupBy(V,b),q=t.pick(J,function(Z){return Z.length>1}),X=t.map(t.values(q),function(Z){var ce=t.first(Z),re=x.buildDuplicateFoundError(k,Z),oe=s.getProductionDslName(ce),ee={message:re,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:k.name,dslName:oe,occurrence:ce.idx},he=f(ce);return he&&(ee.parameter=he),ee});return X}function b(k){return s.getProductionDslName(k)+"_#_"+k.idx+"_#_"+f(k)}i.identifyProductionForDuplicates=b;function f(k){return k instanceof A.Terminal?k.terminalType.name:k instanceof A.NonTerminal?k.nonTerminalName:""}var m=(function(k){e(x,k);function x(){var _=k!==null&&k.apply(this,arguments)||this;return _.allProductions=[],_}return x.prototype.visitNonTerminal=function(_){this.allProductions.push(_)},x.prototype.visitOption=function(_){this.allProductions.push(_)},x.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},x.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},x.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},x.prototype.visitRepetition=function(_){this.allProductions.push(_)},x.prototype.visitAlternation=function(_){this.allProductions.push(_)},x.prototype.visitTerminal=function(_){this.allProductions.push(_)},x})(a.GAstVisitor);i.OccurrenceValidationCollector=m;function E(k,x,_,V){var J=[],q=n.reduce(x,function(Z,ce){return ce.name===k.name?Z+1:Z},0);if(q>1){var X=V.buildDuplicateRuleNameError({topLevelRule:k,grammarName:_});J.push({message:X,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:k.name})}return J}i.validateRuleDoesNotAlreadyExist=E;function l(k,x,_){var V=[],J;return t.contains(x,k)||(J="Invalid rule override, rule: ->"+k+"<- cannot be overridden in the grammar: ->"+_+"<-as it is not defined in any of the super grammars ",V.push({message:J,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:k})),V}i.validateRuleIsOverridden=l;function h(k,x,_,V){V===void 0&&(V=[]);var J=[],q=p(x.definition);if(t.isEmpty(q))return[];var X=k.name,Z=t.contains(q,k);Z&&J.push({message:_.buildLeftRecursionError({topLevelRule:k,leftRecursionPath:V}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:X});var ce=t.difference(q,V.concat([k])),re=t.map(ce,function(oe){var ee=t.cloneArr(V);return ee.push(oe),h(k,oe,_,ee)});return J.concat(t.flatten(re))}i.validateNoLeftRecursion=h;function p(k){var x=[];if(t.isEmpty(k))return x;var _=t.first(k);if(_ instanceof A.NonTerminal)x.push(_.referencedRule);else if(_ instanceof A.Alternative||_ instanceof A.Option||_ instanceof A.RepetitionMandatory||_ instanceof A.RepetitionMandatoryWithSeparator||_ instanceof A.RepetitionWithSeparator||_ instanceof A.Repetition)x=x.concat(p(_.definition));else if(_ instanceof A.Alternation)x=t.flatten(t.map(_.definition,function(X){return p(X.definition)}));else if(!(_ instanceof A.Terminal))throw Error("non exhaustive match");var V=s.isOptionalProd(_),J=k.length>1;if(V&&J){var q=t.drop(k);return x.concat(p(q))}else return x}i.getFirstNoneTerminal=p;var C=(function(k){e(x,k);function x(){var _=k!==null&&k.apply(this,arguments)||this;return _.alternations=[],_}return x.prototype.visitAlternation=function(_){this.alternations.push(_)},x})(a.GAstVisitor);function g(k,x){var _=new C;k.accept(_);var V=_.alternations,J=t.reduce(V,function(q,X){var Z=t.dropRight(X.definition),ce=t.map(Z,function(re,oe){var ee=c.nextPossibleTokensAfter([re],[],null,1);return t.isEmpty(ee)?{message:x.buildEmptyAlternationError({topLevelRule:k,alternation:X,emptyChoiceIdx:oe}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:k.name,occurrence:X.idx,alternative:oe+1}:null});return q.concat(t.compact(ce))},[]);return J}i.validateEmptyOrAlternative=g;function B(k,x,_){var V=new C;k.accept(V);var J=V.alternations;J=n.reject(J,function(X){return X.ignoreAmbiguities===!0});var q=t.reduce(J,function(X,Z){var ce=Z.idx,re=Z.maxLookahead||x,oe=o.getLookaheadPathsForOr(ce,k,re,Z),ee=R(oe,Z,k,_),he=F(oe,Z,k,_);return X.concat(ee,he)},[]);return q}i.validateAmbiguousAlternationAlternatives=B;var Q=(function(k){e(x,k);function x(){var _=k!==null&&k.apply(this,arguments)||this;return _.allProductions=[],_}return x.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},x.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},x.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},x.prototype.visitRepetition=function(_){this.allProductions.push(_)},x})(a.GAstVisitor);i.RepetionCollector=Q;function S(k,x){var _=new C;k.accept(_);var V=_.alternations,J=t.reduce(V,function(q,X){return X.definition.length>255&&q.push({message:x.buildTooManyAlternativesError({topLevelRule:k,alternation:X}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:k.name,occurrence:X.idx}),q},[]);return J}i.validateTooManyAlts=S;function j(k,x,_){var V=[];return n.forEach(k,function(J){var q=new Q;J.accept(q);var X=q.allProductions;n.forEach(X,function(Z){var ce=o.getProdType(Z),re=Z.maxLookahead||x,oe=Z.idx,ee=o.getLookaheadPathsForOptionalProd(oe,J,ce,re),he=ee[0];if(n.isEmpty(n.flatten(he))){var P=_.buildEmptyRepetitionError({topLevelRule:J,repetition:Z});V.push({message:P,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:J.name})}})}),V}i.validateSomeNonEmptyLookaheadPath=j;function R(k,x,_,V){var J=[],q=n.reduce(k,function(Z,ce,re){return x.definition[re].ignoreAmbiguities===!0||n.forEach(ce,function(oe){var ee=[re];n.forEach(k,function(he,P){re!==P&&o.containsPath(he,oe)&&x.definition[P].ignoreAmbiguities!==!0&&ee.push(P)}),ee.length>1&&!o.containsPath(J,oe)&&(J.push(oe),Z.push({alts:ee,path:oe}))}),Z},[]),X=t.map(q,function(Z){var ce=n.map(Z.alts,function(oe){return oe+1}),re=V.buildAlternationAmbiguityError({topLevelRule:_,alternation:x,ambiguityIndices:ce,prefixPath:Z.path});return{message:re,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:_.name,occurrence:x.idx,alternatives:[Z.alts]}});return X}function F(k,x,_,V){var J=[],q=n.reduce(k,function(X,Z,ce){var re=n.map(Z,function(oe){return{idx:ce,path:oe}});return X.concat(re)},[]);return n.forEach(q,function(X){var Z=x.definition[X.idx];if(Z.ignoreAmbiguities!==!0){var ce=X.idx,re=X.path,oe=n.findAll(q,function(he){return x.definition[he.idx].ignoreAmbiguities!==!0&&he.idx<ce&&o.isStrictPrefixOfPath(he.path,re)}),ee=n.map(oe,function(he){var P=[he.idx+1,ce+1],H=x.idx===0?"":x.idx,W=V.buildAlternationPrefixAmbiguityError({topLevelRule:_,alternation:x,ambiguityIndices:P,prefixPath:he.path});return{message:W,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:_.name,occurrence:H,alternatives:P}});J=J.concat(ee)}}),J}i.checkPrefixAlternativesAmbiguities=F;function L(k,x,_){var V=[],J=n.map(x,function(q){return q.name});return n.forEach(k,function(q){var X=q.name;if(n.contains(J,X)){var Z=_.buildNamespaceConflictError(q);V.push({message:Z,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:X})}}),V}}),Jo=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=Se(),t=Yo(),n=Hi(),r=Lt();function s(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=s;function o(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=o}),Bt=Be(i=>{var e=i&&i.__extends||(function(){var m=function(E,l){return m=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])},m(E,l)};return function(E,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");m(E,l);function h(){this.constructor=E}E.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=Se(),n="MismatchedTokenException",r="NoViableAltException",s="EarlyExitException",o="NotAllInputParsedException",c=[n,r,s,o];Object.freeze(c);function A(m){return t.contains(c,m.name)}i.isRecognitionException=A;var a=(function(m){e(E,m);function E(l,h){var p=this.constructor,C=m.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return E})(Error),d=(function(m){e(E,m);function E(l,h,p){var C=m.call(this,l,h)||this;return C.previousToken=p,C.name=n,C}return E})(a);i.MismatchedTokenException=d;var u=(function(m){e(E,m);function E(l,h,p){var C=m.call(this,l,h)||this;return C.previousToken=p,C.name=r,C}return E})(a);i.NoViableAltException=u;var b=(function(m){e(E,m);function E(l,h){var p=m.call(this,l,h)||this;return p.name=o,p}return E})(a);i.NotAllInputParsedException=b;var f=(function(m){e(E,m);function E(l,h,p){var C=m.call(this,l,h)||this;return C.previousToken=p,C.name=s,C}return E})(a);i.EarlyExitException=f}),ji=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=ct(),t=Se(),n=Bt(),r=Ui(),s=Xe();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function o(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=o,o.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:s.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 m=this,E=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],p=!1,C=this.LA(1),g=this.LA(1),B=function(){var Q=m.LA(0),S=m.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:Q,ruleName:m.getCurrRuleFullName()}),j=new n.MismatchedTokenException(S,C,m.LA(0));j.resyncedTokens=t.dropRight(h),m.SAVE_ERROR(j)};!p;)if(this.tokenMatcher(g,f)){B();return}else if(b.call(this)){B(),d.apply(this,u);return}else this.tokenMatcher(g,E)?p=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,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 o("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),m=t.find(u,function(E){return b.tokenMatcher(f,E)})!==void 0;return m},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 i.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,m){return m===0?i.EOF_FOLLOW_KEY:{ruleName:d.shortRuleNameToFullName(f),idxInCallingRule:b[m],inRule:d.shortRuleNameToFullName(u[m-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===i.EOF_FOLLOW_KEY)return[e.EOF];var u=d.ruleName+d.idxInCallingRule+r.IN+d.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(d,u){return this.tokenMatcher(d,e.EOF)||u.push(d),u},a.prototype.reSyncTo=function(d){for(var u=[],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,m,E,l){},a.prototype.getCurrentGrammarPath=function(d,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),m={ruleStack:b,occurrenceStack:f,lastTok:d,lastTokOccurrence:u};return m},a.prototype.getHumanReadableRuleStack=function(){var d=this;return t.map(this.RULE_STACK,function(u){return d.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,d,u,b,f,m,E){var l=this.getKeyForAutomaticLookahead(b,f),h=this.firstAfterRepMap[l];if(h===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],g=new m(C,f);h=g.startWalking(),this.firstAfterRepMap[l]=h}var B=h.token,Q=h.occurrence,S=h.isEndOfRule;this.RULE_STACK.length===1&&S&&B===void 0&&(B=e.EOF,Q=1),this.shouldInRepetitionRecoveryBeTried(B,Q,E)&&this.tryInRepetitionRecovery(a,d,u,B)}i.attemptInRepetitionRecovery=A}),un=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),Xo=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=xt(),t=Se(),n=Xe(),r=un(),s=St(),o=(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=s.collectMethods(d),b=u.alternation,f=u.repetition,m=u.option,E=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+s.getProductionDslName(p)+C,function(){var g=e.buildLookaheadFuncForOr(p.idx,d,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),B=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[d.name],r.OR_IDX,p.idx);a.setLaFuncCache(B,g)})}),t.forEach(f,function(p){a.computeLookaheadFunc(d,p.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(m,function(p){a.computeLookaheadFunc(d,p.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(d,p.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(d,p.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(h,function(p){a.computeLookaheadFunc(d,p.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,s.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,d,u,b,f){var m=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var E=e.buildLookaheadFuncForOptionalProd(a,A,b||m.maxLookahead,m.dynamicTokensEnabled,u,m.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(m.fullRuleNameToShort[A.name],d,a);m.setLaFuncCache(l,E)})},c.prototype.lookAheadBuilderForOptional=function(A,a,d){return e.buildSingleAlternativeLookaheadFunction(A,a,d)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,d,u){return e.buildAlternativesLookAheadFunc(A,a,d,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var d=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(d,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=o}),Zo=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(s,o){isNaN(s.startOffset)===!0?(s.startOffset=o.startOffset,s.endOffset=o.endOffset):s.endOffset<o.endOffset&&(s.endOffset=o.endOffset)}i.setNodeLocationOnlyOffset=e;function t(s,o){isNaN(s.startOffset)===!0?(s.startOffset=o.startOffset,s.startColumn=o.startColumn,s.startLine=o.startLine,s.endOffset=o.endOffset,s.endColumn=o.endColumn,s.endLine=o.endLine):s.endOffset<o.endOffset&&(s.endOffset=o.endOffset,s.endColumn=o.endColumn,s.endLine=o.endLine)}i.setNodeLocationFull=t;function n(s,o,c){s.children[c]===void 0?s.children[c]=[o]:s.children[c].push(o)}i.addTerminalToCst=n;function r(s,o,c){s.children[o]===void 0?s.children[o]=[c]:s.children[o].push(c)}i.addNoneTerminalToCst=r}),qi=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=Se();function t(o){return r(o.constructor)}i.classNameFromInstance=t;var n="name";function r(o){var c=o.name;return c||"anonymous"}i.functionName=r;function s(o,c){var A=Object.getOwnPropertyDescriptor(o,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(o,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=s}),$o=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=Se(),t=qi();function n(u,b){for(var f=e.keys(u),m=f.length,E=0;E<m;E++)for(var l=f[E],h=u[l],p=h.length,C=0;C<p;C++){var g=h[C];g.tokenTypeIdx===void 0&&this[g.name](g.children,b)}}i.defaultVisit=n;function r(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var m={visit:function(E,l){if(e.isArray(E)&&(E=E[0]),!e.isUndefined(E))return this[E.name](E.children,l)},validateVisitor:function(){var E=c(this,b);if(!e.isEmpty(E)){var l=e.map(E,function(h){return h.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
152
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return h},buildInvalidRuleNameError:function(s){return"deprecated"},buildDuplicateRuleNameError:function(s){var c;s.topLevelRule instanceof r.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),os=Qe(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,u){h.__proto__=u}||function(h,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(h[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 h(){this.constructor=A}A.prototype=a===null?Object.create(a):(h.prototype=a.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=tt(),n=De(),r=kt();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=o;var s=(function(c){e(A,c);function A(a,h){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=h,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(h){a.currTopLevel=h,h.accept(a)})},A.prototype.visitNonTerminal=function(a){var h=this.nameToTopRule[a.nonTerminalName];if(h)a.referencedRule=h;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=s}),Ot=Qe(i=>{var e=i&&i.__extends||(function(){var l=function(d,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(d,p)};return function(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(d,p);function C(){this.constructor=d}d.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=pn(),n=De(),r=Wi(),o=Ze(),s=(function(l){e(d,l);function d(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 d.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},d.prototype.walk=function(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},d.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)}},d.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())},d})(t.RestWalker);i.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(d,l);function d(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 d.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),Q=new o.Alternative({definition:y});this.possibleTokTypes=r.first(Q),this.found=!0}},d})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(d,l);function d(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 d.prototype.startWalking=function(){return this.walk(this.topRule),this.result},d})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.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)},d})(A);i.NextTerminalAfterManyWalker=a;var h=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.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)},d})(A);i.NextTerminalAfterManySepWalker=h;var u=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.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)},d})(A);i.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.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)},d})(A);i.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,d,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],m=0;function y(v){return v.concat(n.drop(l,m+1))}function Q(v){var M=f(y(v),d,p);return C.concat(M)}for(;p.length<d&&m<l.length;){var _=l[m];if(_ instanceof o.Alternative||_ instanceof o.NonTerminal)return Q(_.definition);if(_ instanceof o.Option)C=Q(_.definition);else if(_ instanceof o.RepetitionMandatory){var j=_.definition.concat([new o.Repetition({definition:_.definition})]);return Q(j)}else if(_ instanceof o.RepetitionMandatoryWithSeparator){var j=[new o.Alternative({definition:_.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})];return Q(j)}else if(_ instanceof o.RepetitionWithSeparator){var j=_.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})]);C=Q(j)}else if(_ instanceof o.Repetition){var j=_.definition.concat([new o.Repetition({definition:_.definition})]);C=Q(j)}else{if(_ instanceof o.Alternation)return n.forEach(_.definition,function(v){n.isEmpty(v.definition)===!1&&(C=Q(v.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}i.possiblePathsFrom=f;function I(l,d,p,C){var m="EXIT_NONE_TERMINAL",y=[m],Q="EXIT_ALTERNATIVE",_=!1,j=d.length,v=j-C-1,M=[],x=[];for(x.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(x);){var R=x.pop();if(R===Q){_&&n.last(x).idx<=v&&x.pop();continue}var N=R.def,L=R.idx,W=R.ruleStack,J=R.occurrenceStack;if(!n.isEmpty(N)){var K=N[0];if(K===m){var ee={idx:L,def:n.drop(N),ruleStack:n.dropRight(W),occurrenceStack:n.dropRight(J)};x.push(ee)}else if(K instanceof o.Terminal)if(L<j-1){var te=L+1,ue=d[te];if(p(ue,K.terminalType)){var ee={idx:te,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(ee)}}else if(L===j-1)M.push({nextTokenType:K.terminalType,nextTokenOccurrence:K.idx,ruleStack:W,occurrenceStack:J}),_=!0;else throw Error("non exhaustive match");else if(K instanceof o.NonTerminal){var oe=n.cloneArr(W);oe.push(K.nonTerminalName);var ae=n.cloneArr(J);ae.push(K.idx);var ee={idx:L,def:K.definition.concat(y,n.drop(N)),ruleStack:oe,occurrenceStack:ae};x.push(ee)}else if(K instanceof o.Option){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var Ie={idx:L,def:K.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.RepetitionMandatory){var U=new o.Repetition({definition:K.definition,idx:K.idx}),P=K.definition.concat([U],n.drop(N)),ee={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(ee)}else if(K instanceof o.RepetitionMandatoryWithSeparator){var q=new o.Terminal({terminalType:K.separator}),U=new o.Repetition({definition:[q].concat(K.definition),idx:K.idx}),P=K.definition.concat([U],n.drop(N)),ee={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(ee)}else if(K instanceof o.RepetitionWithSeparator){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var q=new o.Terminal({terminalType:K.separator}),X=new o.Repetition({definition:[q].concat(K.definition),idx:K.idx}),P=K.definition.concat([X],n.drop(N)),Ie={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.Repetition){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var X=new o.Repetition({definition:K.definition,idx:K.idx}),P=K.definition.concat([X],n.drop(N)),Ie={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.Alternation)for(var ne=K.definition.length-1;ne>=0;ne--){var le=K.definition[ne],we={idx:L,def:le.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J};x.push(we),x.push(Q)}else if(K instanceof o.Alternative)x.push({idx:L,def:K.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J});else if(K instanceof o.Rule)x.push(E(K,L,W,J));else throw Error("non exhaustive match")}}return M}i.nextPossibleTokensAfter=I;function E(l,d,p,C){var m=n.cloneArr(p);m.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:d,def:l.definition,ruleStack:m,occurrenceStack:y}}}),Mt=Qe(i=>{var e=i&&i.__extends||(function(){var v=function(M,x){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,N){R.__proto__=N}||function(R,N){for(var L in N)Object.prototype.hasOwnProperty.call(N,L)&&(R[L]=N[L])},v(M,x)};return function(M,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");v(M,x);function R(){this.constructor=M}M.prototype=x===null?Object.create(x):(R.prototype=x.prototype,new R)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=De(),n=Ot(),r=pn(),o=Qt(),s=Ze(),c=kt(),A;(function(v){v[v.OPTION=0]="OPTION",v[v.REPETITION=1]="REPETITION",v[v.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",v[v.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",v[v.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",v[v.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(v){if(v instanceof s.Option)return A.OPTION;if(v instanceof s.Repetition)return A.REPETITION;if(v instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(v instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(v instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(v instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function h(v,M,x,R,N,L){var W=m(v,M,x),J=j(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(W,R,J,N)}i.buildLookaheadFuncForOr=h;function u(v,M,x,R,N,L){var W=y(v,M,N,x),J=j(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(W[0],J,R)}i.buildLookaheadFuncForOptionalProd=u;function b(v,M,x,R){var N=v.length,L=t.every(v,function(K){return t.every(K,function(ee){return ee.length===1})});if(M)return function(K){for(var ee=t.map(K,function(X){return X.GATE}),te=0;te<N;te++){var ue=v[te],oe=ue.length,ae=ee[te];if(!(ae!==void 0&&ae.call(this)===!1))e:for(var Ae=0;Ae<oe;Ae++){for(var Ie=ue[Ae],U=Ie.length,P=0;P<U;P++){var q=this.LA(P+1);if(x(q,Ie[P])===!1)continue e}return te}}};if(L&&!R){var W=t.map(v,function(K){return t.flatten(K)}),J=t.reduce(W,function(K,ee,te){return t.forEach(ee,function(ue){t.has(K,ue.tokenTypeIdx)||(K[ue.tokenTypeIdx]=te),t.forEach(ue.categoryMatches,function(oe){t.has(K,oe)||(K[oe]=te)})}),K},[]);return function(){var K=this.LA(1);return J[K.tokenTypeIdx]}}else return function(){for(var K=0;K<N;K++){var ee=v[K],te=ee.length;e:for(var ue=0;ue<te;ue++){for(var oe=ee[ue],ae=oe.length,Ae=0;Ae<ae;Ae++){var Ie=this.LA(Ae+1);if(x(Ie,oe[Ae])===!1)continue e}return K}}}}i.buildAlternativesLookAheadFunc=b;function f(v,M,x){var R=t.every(v,function(ee){return ee.length===1}),N=v.length;if(R&&!x){var L=t.flatten(v);if(L.length===1&&t.isEmpty(L[0].categoryMatches)){var W=L[0],J=W.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===J}}else{var K=t.reduce(L,function(ee,te,ue){return ee[te.tokenTypeIdx]=!0,t.forEach(te.categoryMatches,function(oe){ee[oe]=!0}),ee},[]);return function(){var ee=this.LA(1);return K[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<N;ee++){for(var te=v[ee],ue=te.length,oe=0;oe<ue;oe++){var ae=this.LA(oe+1);if(M(ae,te[oe])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=f;var I=(function(v){e(M,v);function M(x,R,N){var L=v.call(this)||this;return L.topProd=x,L.targetOccurrence=R,L.targetProdType=N,L}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(x,R,N,L){return x.idx===this.targetOccurrence&&this.targetProdType===R?(this.restDef=N.concat(L),!0):!1},M.prototype.walkOption=function(x,R,N){this.checkIsTarget(x,A.OPTION,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkAtLeastOne=function(x,R,N){this.checkIsTarget(x,A.REPETITION_MANDATORY,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkAtLeastOneSep=function(x,R,N){this.checkIsTarget(x,A.REPETITION_MANDATORY_WITH_SEPARATOR,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkMany=function(x,R,N){this.checkIsTarget(x,A.REPETITION,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkManySep=function(x,R,N){this.checkIsTarget(x,A.REPETITION_WITH_SEPARATOR,R,N)||v.prototype.walkOption.call(this,x,R,N)},M})(r.RestWalker),E=(function(v){e(M,v);function M(x,R,N){var L=v.call(this)||this;return L.targetOccurrence=x,L.targetProdType=R,L.targetRef=N,L.result=[],L}return M.prototype.checkIsTarget=function(x,R){x.idx===this.targetOccurrence&&this.targetProdType===R&&(this.targetRef===void 0||x===this.targetRef)&&(this.result=x.definition)},M.prototype.visitOption=function(x){this.checkIsTarget(x,A.OPTION)},M.prototype.visitRepetition=function(x){this.checkIsTarget(x,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(x){this.checkIsTarget(x,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.checkIsTarget(x,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(x){this.checkIsTarget(x,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(x){this.checkIsTarget(x,A.ALTERNATION)},M})(c.GAstVisitor);function l(v){for(var M=new Array(v),x=0;x<v;x++)M[x]=[];return M}function d(v){for(var M=[""],x=0;x<v.length;x++){for(var R=v[x],N=[],L=0;L<M.length;L++){var W=M[L];N.push(W+"_"+R.tokenTypeIdx);for(var J=0;J<R.categoryMatches.length;J++){var K="_"+R.categoryMatches[J];N.push(W+K)}}M=N}return M}function p(v,M,x){for(var R=0;R<v.length;R++)if(R!==x)for(var N=v[R],L=0;L<M.length;L++){var W=M[L];if(N[W]===!0)return!1}return!0}function C(v,M){for(var x=t.map(v,function(te){return n.possiblePathsFrom([te],1)}),R=l(x.length),N=t.map(x,function(te){var ue={};return t.forEach(te,function(oe){var ae=d(oe.partialPath);t.forEach(ae,function(Ae){ue[Ae]=!0})}),ue}),L=x,W=1;W<=M;W++){var J=L;L=l(J.length);for(var K=function(te){for(var ue=J[te],oe=0;oe<ue.length;oe++){var ae=ue[oe].partialPath,Ae=ue[oe].suffixDef,Ie=d(ae),U=p(N,Ie,te);if(U||t.isEmpty(Ae)||ae.length===M){var P=R[te];if(Q(P,ae)===!1){P.push(ae);for(var q=0;q<Ie.length;q++){var X=Ie[q];N[te][X]=!0}}}else{var ne=n.possiblePathsFrom(Ae,W+1,ae);L[te]=L[te].concat(ne),t.forEach(ne,function(le){var we=d(le.partialPath);t.forEach(we,function(Re){N[te][Re]=!0})})}}},ee=0;ee<J.length;ee++)K(ee)}return R}i.lookAheadSequenceFromAlternatives=C;function m(v,M,x,R){var N=new E(v,A.ALTERNATION,R);return M.accept(N),C(N.result,x)}i.getLookaheadPathsForOr=m;function y(v,M,x,R){var N=new E(v,x);M.accept(N);var L=N.result,W=new I(M,v,x),J=W.startWalking(),K=new s.Alternative({definition:L}),ee=new s.Alternative({definition:J});return C([K,ee],R)}i.getLookaheadPathsForOptionalProd=y;function Q(v,M){e:for(var x=0;x<v.length;x++){var R=v[x];if(R.length===M.length){for(var N=0;N<R.length;N++){var L=M[N],W=R[N],J=L===W||W.categoryMatchesMap[L.tokenTypeIdx]!==void 0;if(J===!1)continue e}return!0}}return!1}i.containsPath=Q;function _(v,M){return v.length<M.length&&t.every(v,function(x,R){var N=M[R];return x===N||N.categoryMatchesMap[x.tokenTypeIdx]})}i.isStrictPrefixOfPath=_;function j(v){return t.every(v,function(M){return t.every(M,function(x){return t.every(x,function(R){return t.isEmpty(R.categoryMatches)})})})}i.areTokenCategoriesNotUsed=j}),Ji=Qe(i=>{var e=i&&i.__extends||(function(){var R=function(N,L){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,J){W.__proto__=J}||function(W,J){for(var K in J)Object.prototype.hasOwnProperty.call(J,K)&&(W[K]=J[K])},R(N,L)};return function(N,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");R(N,L);function W(){this.constructor=N}N.prototype=L===null?Object.create(L):(W.prototype=L.prototype,new W)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=De(),n=De(),r=tt(),o=Dt(),s=Mt(),c=Ot(),A=Ze(),a=kt();function h(R,N,L,W,J){var K=t.map(R,function(U){return u(U,W)}),ee=t.map(R,function(U){return d(U,U,W)}),te=[],ue=[],oe=[];n.every(ee,n.isEmpty)&&(te=n.map(R,function(U){return m(U,W)}),ue=n.map(R,function(U){return y(U,N,W)}),oe=j(R,N,W));var ae=x(R,L,W),Ae=n.map(R,function(U){return _(U,W)}),Ie=n.map(R,function(U){return E(U,R,J,W)});return t.flatten(K.concat(oe,ee,te,ue,ae,Ae,Ie))}i.validateGrammar=h;function u(R,N){var L=new I;R.accept(L);var W=L.allProductions,J=t.groupBy(W,b),K=t.pick(J,function(te){return te.length>1}),ee=t.map(t.values(K),function(te){var ue=t.first(te),oe=N.buildDuplicateFoundError(R,te),ae=o.getProductionDslName(ue),Ae={message:oe,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:R.name,dslName:ae,occurrence:ue.idx},Ie=f(ue);return Ie&&(Ae.parameter=Ie),Ae});return ee}function b(R){return o.getProductionDslName(R)+"_#_"+R.idx+"_#_"+f(R)}i.identifyProductionForDuplicates=b;function f(R){return R instanceof A.Terminal?R.terminalType.name:R instanceof A.NonTerminal?R.nonTerminalName:""}var I=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.allProductions=[],L}return N.prototype.visitNonTerminal=function(L){this.allProductions.push(L)},N.prototype.visitOption=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetition=function(L){this.allProductions.push(L)},N.prototype.visitAlternation=function(L){this.allProductions.push(L)},N.prototype.visitTerminal=function(L){this.allProductions.push(L)},N})(a.GAstVisitor);i.OccurrenceValidationCollector=I;function E(R,N,L,W){var J=[],K=n.reduce(N,function(te,ue){return ue.name===R.name?te+1:te},0);if(K>1){var ee=W.buildDuplicateRuleNameError({topLevelRule:R,grammarName:L});J.push({message:ee,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:R.name})}return J}i.validateRuleDoesNotAlreadyExist=E;function l(R,N,L){var W=[],J;return t.contains(N,R)||(J="Invalid rule override, rule: ->"+R+"<- cannot be overridden in the grammar: ->"+L+"<-as it is not defined in any of the super grammars ",W.push({message:J,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:R})),W}i.validateRuleIsOverridden=l;function d(R,N,L,W){W===void 0&&(W=[]);var J=[],K=p(N.definition);if(t.isEmpty(K))return[];var ee=R.name,te=t.contains(K,R);te&&J.push({message:L.buildLeftRecursionError({topLevelRule:R,leftRecursionPath:W}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(K,W.concat([R])),oe=t.map(ue,function(ae){var Ae=t.cloneArr(W);return Ae.push(ae),d(R,ae,L,Ae)});return J.concat(t.flatten(oe))}i.validateNoLeftRecursion=d;function p(R){var N=[];if(t.isEmpty(R))return N;var L=t.first(R);if(L instanceof A.NonTerminal)N.push(L.referencedRule);else if(L instanceof A.Alternative||L instanceof A.Option||L instanceof A.RepetitionMandatory||L instanceof A.RepetitionMandatoryWithSeparator||L instanceof A.RepetitionWithSeparator||L instanceof A.Repetition)N=N.concat(p(L.definition));else if(L instanceof A.Alternation)N=t.flatten(t.map(L.definition,function(ee){return p(ee.definition)}));else if(!(L instanceof A.Terminal))throw Error("non exhaustive match");var W=o.isOptionalProd(L),J=R.length>1;if(W&&J){var K=t.drop(R);return N.concat(p(K))}else return N}i.getFirstNoneTerminal=p;var C=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.alternations=[],L}return N.prototype.visitAlternation=function(L){this.alternations.push(L)},N})(a.GAstVisitor);function m(R,N){var L=new C;R.accept(L);var W=L.alternations,J=t.reduce(W,function(K,ee){var te=t.dropRight(ee.definition),ue=t.map(te,function(oe,ae){var Ae=c.nextPossibleTokensAfter([oe],[],null,1);return t.isEmpty(Ae)?{message:N.buildEmptyAlternationError({topLevelRule:R,alternation:ee,emptyChoiceIdx:ae}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:R.name,occurrence:ee.idx,alternative:ae+1}:null});return K.concat(t.compact(ue))},[]);return J}i.validateEmptyOrAlternative=m;function y(R,N,L){var W=new C;R.accept(W);var J=W.alternations;J=n.reject(J,function(ee){return ee.ignoreAmbiguities===!0});var K=t.reduce(J,function(ee,te){var ue=te.idx,oe=te.maxLookahead||N,ae=s.getLookaheadPathsForOr(ue,R,oe,te),Ae=v(ae,te,R,L),Ie=M(ae,te,R,L);return ee.concat(Ae,Ie)},[]);return K}i.validateAmbiguousAlternationAlternatives=y;var Q=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.allProductions=[],L}return N.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetition=function(L){this.allProductions.push(L)},N})(a.GAstVisitor);i.RepetionCollector=Q;function _(R,N){var L=new C;R.accept(L);var W=L.alternations,J=t.reduce(W,function(K,ee){return ee.definition.length>255&&K.push({message:N.buildTooManyAlternativesError({topLevelRule:R,alternation:ee}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:R.name,occurrence:ee.idx}),K},[]);return J}i.validateTooManyAlts=_;function j(R,N,L){var W=[];return n.forEach(R,function(J){var K=new Q;J.accept(K);var ee=K.allProductions;n.forEach(ee,function(te){var ue=s.getProdType(te),oe=te.maxLookahead||N,ae=te.idx,Ae=s.getLookaheadPathsForOptionalProd(ae,J,ue,oe),Ie=Ae[0];if(n.isEmpty(n.flatten(Ie))){var U=L.buildEmptyRepetitionError({topLevelRule:J,repetition:te});W.push({message:U,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:J.name})}})}),W}i.validateSomeNonEmptyLookaheadPath=j;function v(R,N,L,W){var J=[],K=n.reduce(R,function(te,ue,oe){return N.definition[oe].ignoreAmbiguities===!0||n.forEach(ue,function(ae){var Ae=[oe];n.forEach(R,function(Ie,U){oe!==U&&s.containsPath(Ie,ae)&&N.definition[U].ignoreAmbiguities!==!0&&Ae.push(U)}),Ae.length>1&&!s.containsPath(J,ae)&&(J.push(ae),te.push({alts:Ae,path:ae}))}),te},[]),ee=t.map(K,function(te){var ue=n.map(te.alts,function(ae){return ae+1}),oe=W.buildAlternationAmbiguityError({topLevelRule:L,alternation:N,ambiguityIndices:ue,prefixPath:te.path});return{message:oe,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:L.name,occurrence:N.idx,alternatives:[te.alts]}});return ee}function M(R,N,L,W){var J=[],K=n.reduce(R,function(ee,te,ue){var oe=n.map(te,function(ae){return{idx:ue,path:ae}});return ee.concat(oe)},[]);return n.forEach(K,function(ee){var te=N.definition[ee.idx];if(te.ignoreAmbiguities!==!0){var ue=ee.idx,oe=ee.path,ae=n.findAll(K,function(Ie){return N.definition[Ie.idx].ignoreAmbiguities!==!0&&Ie.idx<ue&&s.isStrictPrefixOfPath(Ie.path,oe)}),Ae=n.map(ae,function(Ie){var U=[Ie.idx+1,ue+1],P=N.idx===0?"":N.idx,q=W.buildAlternationPrefixAmbiguityError({topLevelRule:L,alternation:N,ambiguityIndices:U,prefixPath:Ie.path});return{message:q,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:L.name,occurrence:P,alternatives:U}});J=J.concat(Ae)}}),J}i.checkPrefixAlternativesAmbiguities=M;function x(R,N,L){var W=[],J=n.map(N,function(K){return K.name});return n.forEach(R,function(K){var ee=K.name;if(n.contains(J,ee)){var te=L.buildNamespaceConflictError(K);W.push({message:te,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),W}}),ss=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=De(),t=os(),n=Ji(),r=Ft();function o(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=s}),St=Qe(i=>{var e=i&&i.__extends||(function(){var I=function(E,l){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(d[C]=p[C])},I(E,l)};return function(E,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");I(E,l);function d(){this.constructor=E}E.prototype=l===null?Object.create(l):(d.prototype=l.prototype,new d)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=De(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(I){return t.contains(c,I.name)}i.isRecognitionException=A;var a=(function(I){e(E,I);function E(l,d){var p=this.constructor,C=I.call(this,l)||this;return C.token=d,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return E})(Error),h=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=n,C}return E})(a);i.MismatchedTokenException=h;var u=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=r,C}return E})(a);i.NoViableAltException=u;var b=(function(I){e(E,I);function E(l,d){var p=I.call(this,l,d)||this;return p.name=s,p}return E})(a);i.NotAllInputParsedException=b;var f=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=o,C}return E})(a);i.EarlyExitException=f}),Xi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=ft(),t=De(),n=St(),r=Yi(),o=tt();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=s,s.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(h){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(h,"recoveryEnabled")?h.recoveryEnabled:o.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(h){var u=e.createTokenInstance(h,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(h){return!0},a.prototype.tryInRepetitionRecovery=function(h,u,b,f){for(var I=this,E=this.findReSyncTokenType(),l=this.exportLexerState(),d=[],p=!1,C=this.LA(1),m=this.LA(1),y=function(){var Q=I.LA(0),_=I.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:Q,ruleName:I.getCurrRuleFullName()}),j=new n.MismatchedTokenException(_,C,I.LA(0));j.resyncedTokens=t.dropRight(d),I.SAVE_ERROR(j)};!p;)if(this.tokenMatcher(m,f)){y();return}else if(b.call(this)){y(),h.apply(this,u);return}else this.tokenMatcher(m,E)?p=!0:(m=this.SKIP_TOKEN(),this.addToResyncTokens(m,d));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(h,u,b){return!(b===!1||h===void 0||u===void 0||this.tokenMatcher(this.LA(1),h)||this.isBackTracking()||this.canPerformInRuleRecovery(h,this.getFollowsForInRuleRecovery(h,u)))},a.prototype.getFollowsForInRuleRecovery=function(h,u){var b=this.getCurrentGrammarPath(h,u),f=this.getNextPossibleTokenTypes(b);return f},a.prototype.tryInRuleRecovery=function(h,u){if(this.canRecoverWithSingleTokenInsertion(h,u)){var b=this.getTokenToInsert(h);return b}if(this.canRecoverWithSingleTokenDeletion(h)){var f=this.SKIP_TOKEN();return this.consumeToken(),f}throw new s("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(h,u){return this.canRecoverWithSingleTokenInsertion(h,u)||this.canRecoverWithSingleTokenDeletion(h)},a.prototype.canRecoverWithSingleTokenInsertion=function(h,u){var b=this;if(!this.canTokenTypeBeInsertedInRecovery(h)||t.isEmpty(u))return!1;var f=this.LA(1),I=t.find(u,function(E){return b.tokenMatcher(f,E)})!==void 0;return I},a.prototype.canRecoverWithSingleTokenDeletion=function(h){var u=this.tokenMatcher(this.LA(2),h);return u},a.prototype.isInCurrentRuleReSyncSet=function(h){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,h)},a.prototype.findReSyncTokenType=function(){for(var h=this.flattenFollowSet(),u=this.LA(1),b=2;;){var f=u.tokenType;if(t.contains(h,f))return f;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var h=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(h),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var h=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(f,I){return I===0?i.EOF_FOLLOW_KEY:{ruleName:h.shortRuleNameToFullName(f),idxInCallingRule:b[I],inRule:h.shortRuleNameToFullName(u[I-1])}})},a.prototype.flattenFollowSet=function(){var h=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return h.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(h){if(h===i.EOF_FOLLOW_KEY)return[e.EOF];var u=h.ruleName+h.idxInCallingRule+r.IN+h.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(h,u){return this.tokenMatcher(h,e.EOF)||u.push(h),u},a.prototype.reSyncTo=function(h){for(var u=[],b=this.LA(1);this.tokenMatcher(b,h)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(h,u,b,f,I,E,l){},a.prototype.getCurrentGrammarPath=function(h,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),I={ruleStack:b,occurrenceStack:f,lastTok:h,lastTokOccurrence:u};return I},a.prototype.getHumanReadableRuleStack=function(){var h=this;return t.map(this.RULE_STACK,function(u){return h.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,h,u,b,f,I,E){var l=this.getKeyForAutomaticLookahead(b,f),d=this.firstAfterRepMap[l];if(d===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],m=new I(C,f);d=m.startWalking(),this.firstAfterRepMap[l]=d}var y=d.token,Q=d.occurrence,_=d.isEndOfRule;this.RULE_STACK.length===1&&_&&y===void 0&&(y=e.EOF,Q=1),this.shouldInRepetitionRecoveryBeTried(y,Q,E)&&this.tryInRepetitionRecovery(a,h,u,y)}i.attemptInRepetitionRecovery=A}),gn=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),as=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=Mt(),t=De(),n=tt(),r=gn(),o=Dt(),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(h){a.TRACE_INIT(h.name+" Rule Lookahead",function(){var u=o.collectMethods(h),b=u.alternation,f=u.repetition,I=u.option,E=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,d=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,h,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[h.name],r.OR_IDX,p.idx);a.setLaFuncCache(y,m)})}),t.forEach(f,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(I,function(p){a.computeLookaheadFunc(h,p.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(d,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,h,u,b,f){var I=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var E=e.buildLookaheadFuncForOptionalProd(a,A,b||I.maxLookahead,I.dynamicTokensEnabled,u,I.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(I.fullRuleNameToShort[A.name],h,a);I.setLaFuncCache(l,E)})},c.prototype.lookAheadBuilderForOptional=function(A,a,h){return e.buildSingleAlternativeLookaheadFunction(A,a,h)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,h,u){return e.buildAlternativesLookAheadFunc(A,a,h,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var h=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(h,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=s}),As=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.endOffset=s.endOffset):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset)}i.setNodeLocationOnlyOffset=e;function t(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.startColumn=s.startColumn,o.startLine=s.startLine,o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine)}i.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}i.addTerminalToCst=n;function r(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}i.addNoneTerminalToCst=r}),Zi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=De();function t(s){return r(s.constructor)}i.classNameFromInstance=t;var n="name";function r(s){var c=s.name;return c||"anonymous"}i.functionName=r;function o(s,c){var A=Object.getOwnPropertyDescriptor(s,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(s,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=o}),cs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=De(),t=Zi();function n(u,b){for(var f=e.keys(u),I=f.length,E=0;E<I;E++)for(var l=f[E],d=u[l],p=d.length,C=0;C<p;C++){var m=d[C];m.tokenTypeIdx===void 0&&this[m.name](m.children,b)}}i.defaultVisit=n;function r(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var I={visit:function(E,l){if(e.isArray(E)&&(E=E[0]),!e.isUndefined(E))return this[E.name](E.children,l)},validateVisitor:function(){var E=c(this,b);if(!e.isEmpty(E)){var l=e.map(E,function(d){return d.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
153
153
|
`+(""+l.join(`
|
|
154
154
|
|
|
155
155
|
`).replace(/\n/g,`
|
|
156
|
-
`)))}}};return f.prototype=
|
|
156
|
+
`)))}}};return f.prototype=I,f.prototype.constructor=f,f._RULE_NAMES=b,f}i.createBaseSemanticVisitorConstructor=r;function o(u,b,f){var I=function(){};t.defineNameProp(I,u+"BaseSemanticsWithDefaults");var E=Object.create(f.prototype);return e.forEach(b,function(l){E[l]=n}),I.prototype=E,I.prototype.constructor=I,I}i.createBaseVisitorConstructorWithDefaults=o;var s;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(s=i.CstVisitorDefinitionError||(i.CstVisitorDefinitionError={}));function c(u,b){var f=A(u,b),I=h(u,b);return f.concat(I)}i.validateVisitor=c;function A(u,b){var f=e.map(b,function(I){if(!e.isFunction(u[I]))return{msg:"Missing visitor method: <"+I+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:s.MISSING_METHOD,methodName:I}});return e.compact(f)}i.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function h(u,b){var f=[];for(var I in u)e.isFunction(u[I])&&!e.contains(a,I)&&!e.contains(b,I)&&f.push({msg:"Redundant visitor method: <"+I+"> on "+t.functionName(u.constructor)+` CST Visitor
|
|
157
157
|
There is no Grammar Rule corresponding to this method's name.
|
|
158
|
-
`,type:o.REDUNDANT_METHOD,methodName:m});return f}i.validateRedundantMethods=d}),es=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=Zo(),t=Se(),n=$o(),r=Xe(),s=(function(){function o(){}return o.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},o.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},o.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},o.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},o.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}},o.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},o.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},o.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)},o.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},o.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)},o.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)},o.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},o.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},o.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},o.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},o.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},o})();i.TreeBuilder=s}),ts=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=Xe(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var s=this.currIdx+r;return s<0||this.tokVectorLength<=s?e.END_OF_FILE:this.tokVector[s]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),ns=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=Se(),t=Bt(),n=Xe(),r=Lt(),s=Hi(),o=We(),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=r.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 m=this.defineRule(a,d,u);return this[a]=m,m},A.prototype.OVERRIDE_RULE=function(a,d,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(s.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 o.serializeGrammar(e.values(this.gastProductionsCache))},A})();i.RecognizerApi=c}),is=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=Se(),t=un(),n=Bt(),r=xt(),s=_t(),o=Xe(),c=ji(),A=ct(),a=Ct(),d=qi(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,m){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(m,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
158
|
+
`,type:s.REDUNDANT_METHOD,methodName:I});return f}i.validateRedundantMethods=h}),ls=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=As(),t=De(),n=cs(),r=tt(),o=(function(){function s(){}return s.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},s.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},s.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},s.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.setInitialNodeLocationFullRegular=function(c){var A=this.LA(1);c.location={startOffset:A.startOffset,startLine:A.startLine,startColumn:A.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},s.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},s.prototype.cstPostRuleFull=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?(a.endOffset=A.endOffset,a.endLine=A.endLine,a.endColumn=A.endColumn):(a.startOffset=NaN,a.startLine=NaN,a.startColumn=NaN)},s.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},s.prototype.cstPostTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(a,A,c),this.setNodeLocationFromToken(a.location,A)},s.prototype.cstPostNonTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(a,A,c),this.setNodeLocationFromNode(a.location,c.location)},s.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=n.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},s.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=n.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},s.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},s.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},s.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},s})();i.TreeBuilder=o}),us=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=tt(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var o=this.currIdx+r;return o<0||this.tokVectorLength<=o?e.END_OF_FILE:this.tokVector[o]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),hs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=De(),t=St(),n=tt(),r=Ft(),o=Ji(),s=Ze(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,h,u){return this.consumeInternal(h,a,u)},A.prototype.subrule=function(a,h,u){return this.subruleInternal(h,a,u)},A.prototype.option=function(a,h){return this.optionInternal(h,a)},A.prototype.or=function(a,h){return this.orInternal(h,a)},A.prototype.many=function(a,h){return this.manyInternal(a,h)},A.prototype.atLeastOne=function(a,h){return this.atLeastOneInternal(a,h)},A.prototype.CONSUME=function(a,h){return this.consumeInternal(a,0,h)},A.prototype.CONSUME1=function(a,h){return this.consumeInternal(a,1,h)},A.prototype.CONSUME2=function(a,h){return this.consumeInternal(a,2,h)},A.prototype.CONSUME3=function(a,h){return this.consumeInternal(a,3,h)},A.prototype.CONSUME4=function(a,h){return this.consumeInternal(a,4,h)},A.prototype.CONSUME5=function(a,h){return this.consumeInternal(a,5,h)},A.prototype.CONSUME6=function(a,h){return this.consumeInternal(a,6,h)},A.prototype.CONSUME7=function(a,h){return this.consumeInternal(a,7,h)},A.prototype.CONSUME8=function(a,h){return this.consumeInternal(a,8,h)},A.prototype.CONSUME9=function(a,h){return this.consumeInternal(a,9,h)},A.prototype.SUBRULE=function(a,h){return this.subruleInternal(a,0,h)},A.prototype.SUBRULE1=function(a,h){return this.subruleInternal(a,1,h)},A.prototype.SUBRULE2=function(a,h){return this.subruleInternal(a,2,h)},A.prototype.SUBRULE3=function(a,h){return this.subruleInternal(a,3,h)},A.prototype.SUBRULE4=function(a,h){return this.subruleInternal(a,4,h)},A.prototype.SUBRULE5=function(a,h){return this.subruleInternal(a,5,h)},A.prototype.SUBRULE6=function(a,h){return this.subruleInternal(a,6,h)},A.prototype.SUBRULE7=function(a,h){return this.subruleInternal(a,7,h)},A.prototype.SUBRULE8=function(a,h){return this.subruleInternal(a,8,h)},A.prototype.SUBRULE9=function(a,h){return this.subruleInternal(a,9,h)},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,h,u){if(u===void 0&&(u=n.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var b=r.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 I=this.defineRule(a,h,u);return this[a]=I,I},A.prototype.OVERRIDE_RULE=function(a,h,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,h,u);return this[a]=f,f},A.prototype.BACKTRACK=function(a,h){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,h),!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})();i.RecognizerApi=c}),ds=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=De(),t=gn(),n=St(),r=Mt(),o=Ot(),s=tt(),c=Xi(),A=ft(),a=Qt(),h=Zi(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,I){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=a.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(I,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
159
159
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
160
160
|
For Further details.`);if(e.isArray(f)){if(e.isEmpty(f))throw Error(`A Token Vocabulary cannot be empty.
|
|
161
161
|
Note that the first argument for the parser constructor
|
|
162
162
|
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.
|
|
163
163
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
164
|
-
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 E=e.flatten(e.values(f.modes)),l=e.uniq(E);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
|
|
165
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(E,"resyncEnabled")?E.resyncEnabled:o.DEFAULT_RULE_CONFIG.resyncEnabled,h=e.has(E,"recoveryValueFunc")?E.recoveryValueFunc:o.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(Q){try{if(this.outputCst===!0){m.apply(this,Q);var S=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(S),S}else return m.apply(this,Q)}catch(j){return this.invokeRuleCatch(j,l,h)}finally{this.ruleFinallyStateUpdate()}}var g=function(Q,S){return Q===void 0&&(Q=0),this.ruleInvocationStateUpdate(p,f,Q),C.call(this,S)},B="ruleName";return g[B]=f,g.originalGrammarAction=m,g},b.prototype.invokeRuleCatch=function(f,m,E){var l=this.RULE_STACK.length===1,h=m&&!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 g=this.CST_STACK[this.CST_STACK.length-1];return g.recoveredNode=!0,g}else return E();else{if(this.outputCst){var g=this.CST_STACK[this.CST_STACK.length-1];g.recoveredNode=!0,p.partialCstResult=g}throw p}}else{if(l)return this.moveToTerminatedState(),E();throw p}}else throw f},b.prototype.optionInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.OPTION_IDX,m);return this.optionInternalLogic(f,m,E)},b.prototype.optionInternalLogic=function(f,m,E){var l=this,h=this.getLaFuncFromCache(E),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var g=h;h=function(){return C.call(l)&&g.call(l)}}}else p=f;if(h.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,m,E)},b.prototype.atLeastOneInternalLogic=function(f,m,E){var l=this,h=this.getLaFuncFromCache(E),p,C;if(m.DEF!==void 0){if(p=m.DEF,C=m.GATE,C!==void 0){var g=h;h=function(){return C.call(l)&&g.call(l)}}}else p=m;if(h.call(this)===!0)for(var B=this.doSingleRepetition(p);h.call(this)===!0&&B===!0;)B=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY,m.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,m],h,t.AT_LEAST_ONE_IDX,f,s.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,m,E)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,m,E){var l=this,h=m.DEF,p=m.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){h.call(this);for(var g=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,g,h,s.NextTerminalAfterAtLeastOneSepWalker],g,t.AT_LEAST_ONE_SEP_IDX,f,s.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,m.ERR_MSG)},b.prototype.manyInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,m,E)},b.prototype.manyInternalLogic=function(f,m,E){var l=this,h=this.getLaFuncFromCache(E),p,C;if(m.DEF!==void 0){if(p=m.DEF,C=m.GATE,C!==void 0){var g=h;h=function(){return C.call(l)&&g.call(l)}}}else p=m;for(var B=!0;h.call(this)===!0&&B===!0;)B=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,m],h,t.MANY_IDX,f,s.NextTerminalAfterManyWalker,B)},b.prototype.manySepFirstInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,m,E)},b.prototype.manySepFirstInternalLogic=function(f,m,E){var l=this,h=m.DEF,p=m.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){h.call(this);for(var g=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,g,h,s.NextTerminalAfterManySepWalker],g,t.MANY_SEP_IDX,f,s.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,m,E,l,h){for(;E();)this.CONSUME(m),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,m,E,l,h],E,t.AT_LEAST_ONE_SEP_IDX,f,h)},b.prototype.doSingleRepetition=function(f){var m=this.getLexerPosition();f.call(this);var E=this.getLexerPosition();return E>m},b.prototype.orInternal=function(f,m){var E=this.getKeyForAutomaticLookahead(t.OR_IDX,m),l=e.isArray(f)?f:f.DEF,h=this.getLaFuncFromCache(E),p=h.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(m,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),m=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(m,f))}},b.prototype.subruleInternal=function(f,m,E){var l;try{var h=E!==void 0?E.ARGS:void 0;return l=f.call(this,m,h),this.cstPostNonTerminal(l,E!==void 0&&E.LABEL!==void 0?E.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,E,f.ruleName)}},b.prototype.subruleInternalError=function(f,m,E){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,m!==void 0&&m.LABEL!==void 0?m.LABEL:E),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,m,E){var l;try{var h=this.LA(1);this.tokenMatcher(h,f)===!0?(this.consumeToken(),l=h):this.consumeInternalError(f,h,E)}catch(p){l=this.consumeInternalRecovery(f,m,p)}return this.cstPostTerminal(E!==void 0&&E.LABEL!==void 0?E.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,m,E){var l,h=this.LA(0);throw E!==void 0&&E.ERR_MSG?l=E.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:m,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,m,h))},b.prototype.consumeInternalRecovery=function(f,m,E){if(this.recoveryEnabled&&E.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,m);try{return this.tryInRuleRecovery(f,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?E:h}}else throw E},b.prototype.saveRecogState=function(){var f=this.errors,m=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:m,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,m,E){this.RULE_OCCURRENCE_STACK.push(E),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(m,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})();i.RecognizerEngine=u}),rs=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=Bt(),t=Se(),n=xt(),r=Xe(),s=(function(){function o(){}return o.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},o.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(o.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),o.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],m=[],E=1;E<=this.maxLookahead;E++)m.push(this.LA(E));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:m,previous:this.LA(0),customUserDescription:a,ruleName:d});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},o.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 m=this.LA(0),E=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:m,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(E,this.LA(1),m))},o})();i.ErrorHandler=s}),os=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=_t(),t=Se(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(s,o){var c=this.gastProductionsCache[s];if(t.isUndefined(c))throw Error("Rule ->"+s+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],o,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(s){var o=t.first(s.ruleStack),c=this.getGAstProductions(),A=c[o],a=new e.NextAfterTokenWalker(A,s).startWalking();return a},r})();i.ContentAssist=n}),ss=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=Se(),t=We(),n=kt(),r=Ct(),s=ct(),o=Xe(),c=un(),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=s.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var b=s.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
|
|
164
|
+
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 E=e.flatten(e.values(f.modes)),l=e.uniq(E);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 d=e.every(e.values(f),function(p){return e.isEmpty(p.categoryMatches)});this.tokenMatcher=d?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},b.prototype.defineRule=function(f,I,E){if(this.selfAnalysisDone)throw Error("Grammar rule <"+f+`> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
165
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(E,"resyncEnabled")?E.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,d=e.has(E,"recoveryValueFunc")?E.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(Q){try{if(this.outputCst===!0){I.apply(this,Q);var _=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(_),_}else return I.apply(this,Q)}catch(j){return this.invokeRuleCatch(j,l,d)}finally{this.ruleFinallyStateUpdate()}}var m=function(Q,_){return Q===void 0&&(Q=0),this.ruleInvocationStateUpdate(p,f,Q),C.call(this,_)},y="ruleName";return m[y]=f,m.originalGrammarAction=I,m},b.prototype.invokeRuleCatch=function(f,I,E){var l=this.RULE_STACK.length===1,d=I&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(f)){var p=f;if(d){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 E();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(),E();throw p}}else throw f},b.prototype.optionInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.OPTION_IDX,I);return this.optionInternalLogic(f,I,E)},b.prototype.optionInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=f;if(d.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,I,E)},b.prototype.atLeastOneInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=I;if(d.call(this)===!0)for(var y=this.doSingleRepetition(p);d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY,I.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,I],d,t.AT_LEAST_ONE_IDX,f,o.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,I,E)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,I,E){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){d.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,d,o.NextTerminalAfterAtLeastOneSepWalker],m,t.AT_LEAST_ONE_SEP_IDX,f,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,I.ERR_MSG)},b.prototype.manyInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,I,E)},b.prototype.manyInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=I;for(var y=!0;d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,I],d,t.MANY_IDX,f,o.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,I,E)},b.prototype.manySepFirstInternalLogic=function(f,I,E){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){d.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,d,o.NextTerminalAfterManySepWalker],m,t.MANY_SEP_IDX,f,o.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,I,E,l,d){for(;E();)this.CONSUME(I),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,I,E,l,d],E,t.AT_LEAST_ONE_SEP_IDX,f,d)},b.prototype.doSingleRepetition=function(f){var I=this.getLexerPosition();f.call(this);var E=this.getLexerPosition();return E>I},b.prototype.orInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.OR_IDX,I),l=e.isArray(f)?f:f.DEF,d=this.getLaFuncFromCache(E),p=d.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(I,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),I=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(I,f))}},b.prototype.subruleInternal=function(f,I,E){var l;try{var d=E!==void 0?E.ARGS:void 0;return l=f.call(this,I,d),this.cstPostNonTerminal(l,E!==void 0&&E.LABEL!==void 0?E.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,E,f.ruleName)}},b.prototype.subruleInternalError=function(f,I,E){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,I!==void 0&&I.LABEL!==void 0?I.LABEL:E),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,I,E){var l;try{var d=this.LA(1);this.tokenMatcher(d,f)===!0?(this.consumeToken(),l=d):this.consumeInternalError(f,d,E)}catch(p){l=this.consumeInternalRecovery(f,I,p)}return this.cstPostTerminal(E!==void 0&&E.LABEL!==void 0?E.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,I,E){var l,d=this.LA(0);throw E!==void 0&&E.ERR_MSG?l=E.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:I,previous:d,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,I,d))},b.prototype.consumeInternalRecovery=function(f,I,E){if(this.recoveryEnabled&&E.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,I);try{return this.tryInRuleRecovery(f,l)}catch(d){throw d.name===c.IN_RULE_RECOVERY_EXCEPTION?E:d}}else throw E},b.prototype.saveRecogState=function(){var f=this.errors,I=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:I,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,I,E){this.RULE_OCCURRENCE_STACK.push(E),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(I,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})();i.RecognizerEngine=u}),fs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=St(),t=De(),n=Mt(),r=tt(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},s.prototype.SAVE_ERROR=function(c){if(e.isRecognitionException(c))return c.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(c),c;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(s.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),s.prototype.raiseEarlyExitException=function(c,A,a){for(var h=this.getCurrRuleFullName(),u=this.getGAstProductions()[h],b=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),f=b[0],I=[],E=1;E<=this.maxLookahead;E++)I.push(this.LA(E));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:I,previous:this.LA(0),customUserDescription:a,ruleName:h});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(),h=this.getGAstProductions()[a],u=n.getLookaheadPathsForOr(c,h,this.maxLookahead),b=[],f=1;f<=this.maxLookahead;f++)b.push(this.LA(f));var I=this.LA(0),E=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:I,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(E,this.LA(1),I))},s})();i.ErrorHandler=o}),ps=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=Ot(),t=De(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(o,s){var c=this.gastProductionsCache[o];if(t.isUndefined(c))throw Error("Rule ->"+o+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],s,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(o){var s=t.first(o.ruleStack),c=this.getGAstProductions(),A=c[s],a=new e.NextAfterTokenWalker(A,o).startWalking();return a},r})();i.ContentAssist=n}),gs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=De(),t=Ze(),n=Nt(),r=Qt(),o=ft(),s=tt(),c=gn(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,h=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=o.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var b=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
|
|
166
166
|
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
|
|
167
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},
|
|
167
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},I=(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 j=_>0?_:"";m["CONSUME"+j]=function(v,M){return this.consumeInternalRecord(v,_,M)},m["SUBRULE"+j]=function(v,M){return this.subruleInternalRecord(v,_,M)},m["OPTION"+j]=function(v){return this.optionInternalRecord(v,_)},m["OR"+j]=function(v){return this.orInternalRecord(v,_)},m["MANY"+j]=function(v){this.manyInternalRecord(_,v)},m["MANY_SEP"+j]=function(v){this.manySepFirstInternalRecord(_,v)},m["AT_LEAST_ONE"+j]=function(v){this.atLeastOneInternalRecord(_,v)},m["AT_LEAST_ONE_SEP"+j]=function(v){this.atLeastOneSepFirstInternalRecord(_,v)}},Q=0;Q<10;Q++)y(Q);m.consume=function(_,j,v){return this.consumeInternalRecord(j,_,v)},m.subrule=function(_,j,v){return this.subruleInternalRecord(j,_,v)},m.option=function(_,j){return this.optionInternalRecord(j,_)},m.or=function(_,j){return this.orInternalRecord(j,_)},m.many=function(_,j){this.manyInternalRecord(_,j)},m.atLeastOne=function(_,j){this.atLeastOneInternalRecord(_,j)},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 Q=y>0?y:"";delete m["CONSUME"+Q],delete m["SUBRULE"+Q],delete m["OPTION"+Q],delete m["OR"+Q],delete m["MANY"+Q],delete m["MANY_SEP"+Q],delete m["AT_LEAST_ONE"+Q],delete m["AT_LEAST_ONE_SEP"+Q]}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 Q=new t.Rule({definition:[],name:m});return Q.name=m,this.recordingProdStack.push(Q),y.call(this),this.recordingProdStack.pop(),Q}catch(_){if(_.KNOWN_RECORDER_ERROR!==!0)try{_.message=_.message+`
|
|
168
168
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
169
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw
|
|
170
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
171
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
172
|
-
`+("Idx value must be a none negative value smaller than "+(
|
|
169
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw _}throw _}},C.prototype.optionInternalRecord=function(m,y){return E.call(this,t.Option,m,y)},C.prototype.atLeastOneInternalRecord=function(m,y){E.call(this,t.RepetitionMandatory,y,m)},C.prototype.atLeastOneSepFirstInternalRecord=function(m,y){E.call(this,t.RepetitionMandatoryWithSeparator,y,m,a)},C.prototype.manyInternalRecord=function(m,y){E.call(this,t.Repetition,y,m)},C.prototype.manySepFirstInternalRecord=function(m,y){E.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,Q){if(p(y),!m||e.has(m,"ruleName")===!1){var _=new Error("<SUBRULE"+d(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(m)+">")+(`
|
|
170
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw _.KNOWN_RECORDER_ERROR=!0,_}var j=e.peek(this.recordingProdStack),v=m.ruleName,M=new t.NonTerminal({idx:y,nonTerminalName:v,referencedRule:void 0});return j.definition.push(M),this.outputCst?f:A},C.prototype.consumeInternalRecord=function(m,y,Q){if(p(y),!r.hasShortKeyProperty(m)){var _=new Error("<CONSUME"+d(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(m)+">")+(`
|
|
171
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw _.KNOWN_RECORDER_ERROR=!0,_}var j=e.peek(this.recordingProdStack),v=new t.Terminal({idx:y,terminalType:m});return j.definition.push(v),b},C})();i.GastRecorder=I;function E(C,m,y,Q){Q===void 0&&(Q=!1),p(y);var _=e.peek(this.recordingProdStack),j=e.isFunction(m)?m:m.DEF,v=new C({definition:[],idx:y});return Q&&(v.separator=m.SEP),e.has(m,"MAX_LOOKAHEAD")&&(v.maxLookahead=m.MAX_LOOKAHEAD),this.recordingProdStack.push(v),j.call(this),_.definition.push(v),this.recordingProdStack.pop(),A}function l(C,m){var y=this;p(m);var Q=e.peek(this.recordingProdStack),_=e.isArray(C)===!1,j=_===!1?C:C.DEF,v=new t.Alternation({definition:[],idx:m,ignoreAmbiguities:_&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(v.maxLookahead=C.MAX_LOOKAHEAD);var M=e.some(j,function(x){return e.isFunction(x.GATE)});return v.hasPredicates=M,Q.definition.push(v),e.forEach(j,function(x){var R=new t.Alternative({definition:[]});v.definition.push(R),e.has(x,"IGNORE_AMBIGUITIES")?R.ignoreAmbiguities=x.IGNORE_AMBIGUITIES:e.has(x,"GATE")&&(R.ignoreAmbiguities=!0),y.recordingProdStack.push(R),x.ALT.call(y),y.recordingProdStack.pop()}),A}function d(C){return C===0?"":""+C}function p(C){if(C<0||C>h){var m=new Error("Invalid DSL Method idx value: <"+C+`>
|
|
172
|
+
`+("Idx value must be a none negative value smaller than "+(h+1)));throw m.KNOWN_RECORDER_ERROR=!0,m}}}),Es=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=De(),t=tt(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(o){if(e.has(o,"traceInitPerf")){var s=o.traceInitPerf,c=typeof s=="number";this.traceInitMaxIdent=c?s:1/0,this.traceInitPerf=c?s>0:s}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(o,s){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+o+">");var A=e.timer(s),a=A.time,h=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+o+"> time: "+a+"ms"),this.traceInitIndent--,h}else return s()},r})();i.PerformanceTracer=n}),ms=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var o=r.prototype;Object.getOwnPropertyNames(o).forEach(function(s){if(s!=="constructor"){var c=Object.getOwnPropertyDescriptor(o,s);c&&(c.get||c.set)?Object.defineProperty(t.prototype,s,c):t.prototype[s]=r.prototype[s]}})})}i.applyMixins=e}),tt=Qe(i=>{var e=i&&i.__extends||(function(){var Q=function(_,j){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,M){v.__proto__=M}||function(v,M){for(var x in M)Object.prototype.hasOwnProperty.call(M,x)&&(v[x]=M[x])},Q(_,j)};return function(_,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");Q(_,j);function v(){this.constructor=_}_.prototype=j===null?Object.create(j):(v.prototype=j.prototype,new v)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EmbeddedActionsParser=i.CstParser=i.Parser=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.DEFAULT_RULE_CONFIG=i.DEFAULT_PARSER_CONFIG=i.END_OF_FILE=void 0;var t=De(),n=rs(),r=ft(),o=Ft(),s=ss(),c=Xi(),A=as(),a=ls(),h=us(),u=hs(),b=ds(),f=fs(),I=ps(),E=gs(),l=Es(),d=ms();i.END_OF_FILE=r.createTokenInstance(r.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(i.END_OF_FILE),i.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(Q){Q[Q.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",Q[Q.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",Q[Q.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",Q[Q.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",Q[Q.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",Q[Q.LEFT_RECURSION=5]="LEFT_RECURSION",Q[Q.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",Q[Q.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",Q[Q.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",Q[Q.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",Q[Q.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",Q[Q.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",Q[Q.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(i.ParserDefinitionErrorType||(i.ParserDefinitionErrorType={}));function p(Q){return Q===void 0&&(Q=void 0),function(){return Q}}i.EMPTY_ALT=p;var C=(function(){function Q(_,j){this.definitionErrors=[],this.selfAnalysisDone=!1;var v=this;if(v.initErrorHandler(j),v.initLexerAdapter(),v.initLooksAhead(j),v.initRecognizerEngine(_,j),v.initRecoverable(j),v.initTreeBuilder(j),v.initContentAssist(),v.initGastRecorder(j),v.initPerformanceTracer(j),t.has(j,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
173
173
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
174
174
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
175
|
-
For further details.`);this.skipValidations=t.has(j,"skipValidations")?j.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return Q.performSelfAnalysis=function(
|
|
175
|
+
For further details.`);this.skipValidations=t.has(j,"skipValidations")?j.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return Q.performSelfAnalysis=function(_){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},Q.prototype.performSelfAnalysis=function(){var _=this;this.TRACE_INIT("performSelfAnalysis",function(){var j;_.selfAnalysisDone=!0;var v=_.className;_.TRACE_INIT("toFastProps",function(){t.toFastProperties(_)}),_.TRACE_INIT("Grammar Recording",function(){try{_.enableRecording(),t.forEach(_.definedRulesNames,function(x){var R=_[x],N=R.originalGrammarAction,L=void 0;_.TRACE_INIT(x+" Rule",function(){L=_.topLevelRuleRecord(x,N)}),_.gastProductionsCache[x]=L})}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 x=s.validateGrammar({rules:t.values(_.gastProductionsCache),maxLookahead:_.maxLookahead,tokenTypes:t.values(_.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:v});_.definitionErrors=_.definitionErrors.concat(x)}}),t.isEmpty(_.definitionErrors)&&(_.recoveryEnabled&&_.TRACE_INIT("computeAllProdsFollows",function(){var x=n.computeAllProdsFollows(t.values(_.gastProductionsCache));_.resyncFollows=x}),_.TRACE_INIT("ComputeLookaheadFunctions",function(){_.preComputeLookaheadFunctions(t.values(_.gastProductionsCache))})),!Q.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(_.definitionErrors))throw j=t.map(_.definitionErrors,function(x){return x.message}),new Error(`Parser Definition Errors detected:
|
|
176
176
|
`+j.join(`
|
|
177
177
|
-------------------------------
|
|
178
|
-
`))})},Q.DEFER_DEFINITION_ERRORS_HANDLING=!1,Q})();i.Parser=C,
|
|
178
|
+
`))})},Q.DEFER_DEFINITION_ERRORS_HANDLING=!1,Q})();i.Parser=C,d.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,h.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,I.ContentAssist,E.GastRecorder,l.PerformanceTracer]);var m=(function(Q){e(_,Q);function _(j,v){v===void 0&&(v=i.DEFAULT_PARSER_CONFIG);var M=this,x=t.cloneObj(v);return x.outputCst=!0,M=Q.call(this,j,x)||this,M}return _})(C);i.CstParser=m;var y=(function(Q){e(_,Q);function _(j,v){v===void 0&&(v=i.DEFAULT_PARSER_CONFIG);var M=this,x=t.cloneObj(v);return x.outputCst=!1,M=Q.call(this,j,x)||this,M}return _})(C);i.EmbeddedActionsParser=y}),Is=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=zi();function t(n,r){var o=r===void 0?{}:r,s=o.resourceBase,c=s===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":s,A=o.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,h=`
|
|
179
179
|
<!-- This is a generated file -->
|
|
180
180
|
<!DOCTYPE html>
|
|
181
181
|
<meta charset="utf-8">
|
|
@@ -194,7 +194,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
|
|
|
194
194
|
<script src='`+c+`src/main.js'><\/script>
|
|
195
195
|
`,f=`
|
|
196
196
|
<div id="diagrams" align="center"></div>
|
|
197
|
-
`,
|
|
197
|
+
`,I=`
|
|
198
198
|
<script>
|
|
199
199
|
window.serializedGrammar = `+JSON.stringify(n,null," ")+`;
|
|
200
200
|
<\/script>
|
|
@@ -203,10 +203,10 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
|
|
|
203
203
|
var diagramsDiv = document.getElementById("diagrams");
|
|
204
204
|
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|
205
205
|
<\/script>
|
|
206
|
-
`;return
|
|
206
|
+
`;return h+u+b+f+I+E}i.createSyntaxDiagramsCode=t}),bs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Parser=i.createSyntaxDiagramsCode=i.clearCache=i.GAstVisitor=i.serializeProduction=i.serializeGrammar=i.Terminal=i.Rule=i.RepetitionWithSeparator=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Repetition=i.Option=i.NonTerminal=i.Alternative=i.Alternation=i.defaultLexerErrorProvider=i.NoViableAltException=i.NotAllInputParsedException=i.MismatchedTokenException=i.isRecognitionException=i.EarlyExitException=i.defaultParserErrorProvider=i.tokenName=i.tokenMatcher=i.tokenLabel=i.EOF=i.createTokenInstance=i.createToken=i.LexerDefinitionErrorType=i.Lexer=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.EmbeddedActionsParser=i.CstParser=i.VERSION=void 0;var e=zi();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=tt();Object.defineProperty(i,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(i,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(i,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(i,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=Nt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=ft();Object.defineProperty(i,"createToken",{enumerable:!0,get:function(){return r.createToken}}),Object.defineProperty(i,"createTokenInstance",{enumerable:!0,get:function(){return r.createTokenInstance}}),Object.defineProperty(i,"EOF",{enumerable:!0,get:function(){return r.EOF}}),Object.defineProperty(i,"tokenLabel",{enumerable:!0,get:function(){return r.tokenLabel}}),Object.defineProperty(i,"tokenMatcher",{enumerable:!0,get:function(){return r.tokenMatcher}}),Object.defineProperty(i,"tokenName",{enumerable:!0,get:function(){return r.tokenName}});var o=Ft();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=St();Object.defineProperty(i,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(i,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(i,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(i,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(i,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=Vi();Object.defineProperty(i,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Ze();Object.defineProperty(i,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(i,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(i,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(i,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(i,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(i,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(i,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(i,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(i,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(i,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Ze();Object.defineProperty(i,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(i,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var h=kt();Object.defineProperty(i,"GAstVisitor",{enumerable:!0,get:function(){return h.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
207
207
|
It performs no action other than printing this message.
|
|
208
|
-
Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var b=
|
|
209
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return m})();i.Parser=f});const gt=ls();class us extends I.Loader{constructor(e){super(e)}load(e,t,n,r){const s=this,o=s.path===""?I.LoaderUtils.extractUrlBase(e):s.path,c=new I.FileLoader(s.manager);c.setPath(s.path),c.setRequestHeader(s.requestHeader),c.setWithCredentials(s.withCredentials),c.load(e,function(A){try{t(s.parse(A,o))}catch(a){r?r(a):console.error(a),s.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(T){const y=s(),w=new hs(y.tokens),N=new fs(y.tokenVocabulary),v=o(N.getBaseCstVisitorConstructor()),D=w.lex(T);N.input=D.tokens;const O=N.vrml();if(N.errors.length>0)throw console.error(N.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return v.visit(O)}function s(){const T=gt.createToken,y=T({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),w=T({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:y}),N=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],v=T({name:"Version",pattern:/#VRML.*/,longer_alt:w}),D=T({name:"NodeName",pattern:new RegExp(N.join("|")),longer_alt:w}),O=T({name:"DEF",pattern:/DEF/,longer_alt:w}),G=T({name:"USE",pattern:/USE/,longer_alt:w}),z=T({name:"ROUTE",pattern:/ROUTE/,longer_alt:w}),te=T({name:"TO",pattern:/TO/,longer_alt:w}),ae=T({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),Ie=T({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),ke=T({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Pe=T({name:"TrueLiteral",pattern:/TRUE/}),Le=T({name:"FalseLiteral",pattern:/FALSE/}),ye=T({name:"NullLiteral",pattern:/NULL/}),we=T({name:"LSquare",pattern:/\[/}),xe=T({name:"RSquare",pattern:/]/}),Fe=T({name:"LCurly",pattern:/{/}),Qe=T({name:"RCurly",pattern:/}/}),Me=T({name:"Comment",pattern:/#.*/,group:gt.Lexer.SKIPPED}),qe=[T({name:"WhiteSpace",pattern:/[ ,\s]/,group:gt.Lexer.SKIPPED}),D,O,G,z,te,Pe,Le,ye,v,w,y,ae,Ie,ke,we,xe,Fe,Qe,Me],Ke={};for(let Re=0,de=qe.length;Re<de;Re++){const fe=qe[Re];Ke[fe.name]=fe}return{tokens:qe,tokenVocabulary:Ke}}function o(T){class y extends T{constructor(){super(),this.validateVisitor()}vrml(v){const D={version:this.visit(v.version),nodes:[],routes:[]};for(let O=0,G=v.node.length;O<G;O++){const z=v.node[O];D.nodes.push(this.visit(z))}if(v.route)for(let O=0,G=v.route.length;O<G;O++){const z=v.route[O];D.routes.push(this.visit(z))}return D}version(v){return v.Version[0].image}node(v){const D={name:v.NodeName[0].image,fields:[]};if(v.field)for(let O=0,G=v.field.length;O<G;O++){const z=v.field[O];D.fields.push(this.visit(z))}return v.def&&(D.DEF=this.visit(v.def[0])),D}field(v){const D={name:v.Identifier[0].image,type:null,values:null};let O;return v.singleFieldValue&&(O=this.visit(v.singleFieldValue[0])),v.multiFieldValue&&(O=this.visit(v.multiFieldValue[0])),D.type=O.type,D.values=O.values,D}def(v){return(v.Identifier||v.NodeName)[0].image}use(v){return{USE:(v.Identifier||v.NodeName)[0].image}}singleFieldValue(v){return w(this,v)}multiFieldValue(v){return w(this,v)}route(v){return{FROM:v.RouteIdentifier[0].image,TO:v.RouteIdentifier[1].image}}}function w(N,v){const D={type:null,values:[]};if(v.node){D.type="node";for(let O=0,G=v.node.length;O<G;O++){const z=v.node[O];D.values.push(N.visit(z))}}if(v.use){D.type="use";for(let O=0,G=v.use.length;O<G;O++){const z=v.use[O];D.values.push(N.visit(z))}}if(v.StringLiteral){D.type="string";for(let O=0,G=v.StringLiteral.length;O<G;O++){const z=v.StringLiteral[O];D.values.push(z.image.replace(/'|"/g,""))}}if(v.NumberLiteral){D.type="number";for(let O=0,G=v.NumberLiteral.length;O<G;O++){const z=v.NumberLiteral[O];D.values.push(parseFloat(z.image))}}if(v.HexLiteral){D.type="hex";for(let O=0,G=v.HexLiteral.length;O<G;O++){const z=v.HexLiteral[O];D.values.push(z.image)}}if(v.TrueLiteral){D.type="boolean";for(let O=0,G=v.TrueLiteral.length;O<G;O++)v.TrueLiteral[O].image==="TRUE"&&D.values.push(!0)}if(v.FalseLiteral){D.type="boolean";for(let O=0,G=v.FalseLiteral.length;O<G;O++)v.FalseLiteral[O].image==="FALSE"&&D.values.push(!1)}return v.NullLiteral&&(D.type="null",v.NullLiteral.forEach(function(){D.values.push(null)})),D}return new y}function c(T){const y=T.nodes,w=new I.Scene;for(let N=0,v=y.length;N<v;N++){const D=y[N];A(D)}for(let N=0,v=y.length;N<v;N++){const D=y[N],O=a(D);O instanceof I.Object3D&&w.add(O),D.name==="WorldInfo"&&(w.userData.worldInfo=O)}return w}function A(T){T.DEF&&(n[T.DEF]=T);const y=T.fields;for(let w=0,N=y.length;w<N;w++){const v=y[w];if(v.type==="node"){const D=v.values;for(let O=0,G=D.length;O<G;O++)A(D[O])}}}function a(T){return T.USE?J(T.USE):(T.build!==void 0||(T.build=d(T)),T.build)}function d(T){const y=T.name;let w;switch(y){case"Anchor":case"Group":case"Transform":case"Collision":w=u(T);break;case"Background":w=b(T);break;case"Shape":w=f(T);break;case"Appearance":w=m(T);break;case"Material":w=E(T);break;case"ImageTexture":w=C(T);break;case"PixelTexture":w=p(T);break;case"TextureTransform":w=g(T);break;case"IndexedFaceSet":w=S(T);break;case"IndexedLineSet":w=j(T);break;case"PointSet":w=R(T);break;case"Box":w=F(T);break;case"Cone":w=L(T);break;case"Cylinder":w=k(T);break;case"Sphere":w=x(T);break;case"ElevationGrid":w=_(T);break;case"Extrusion":w=V(T);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":w=B(T);break;case"WorldInfo":w=Q(T);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",y);break}return w!==void 0&&T.DEF!==void 0&&w.hasOwnProperty("name")===!0&&(w.name=T.DEF),w}function u(T){const y=new I.Group,w=T.fields;for(let N=0,v=w.length;N<v;N++){const D=w[N],O=D.name,G=D.values;switch(O){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":q(G,y);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const z=new I.Vector3(G[0],G[1],G[2]).normalize(),te=G[3];y.quaternion.setFromAxisAngle(z,te);break;case"scale":y.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":y.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return y}function b(T){const y=new I.Group;let w,N,v,D;const O=T.fields;for(let z=0,te=O.length;z<te;z++){const ae=O[z],Ie=ae.name,ke=ae.values;switch(Ie){case"groundAngle":w=ke;break;case"groundColor":N=ke;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":v=ke;break;case"skyColor":D=ke;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const G=1e4;if(D){const z=new I.SphereGeometry(G,32,16),te=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,depthWrite:!1,depthTest:!1});D.length>3?(K(z,G,v,M(D),!0),te.vertexColors=!0):te.color.setRGB(D[0],D[1],D[2],I.SRGBColorSpace);const ae=new I.Mesh(z,te);y.add(ae)}if(N&&N.length>0){const z=new I.SphereGeometry(G,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),te=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});K(z,G,w,M(N),!1);const ae=new I.Mesh(z,te);y.add(ae)}return y.renderOrder=-1/0,y}function f(T){const y=T.fields;let w=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0}),N;for(let D=0,O=y.length;D<O;D++){const G=y[D],z=G.name,te=G.values;switch(z){case"appearance":te[0]!==null&&(w=a(te[0]));break;case"geometry":te[0]!==null&&(N=a(te[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}let v;if(N&&N.attributes.position){const D=N._type;if(D==="points"){const O=new I.PointsMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});N.attributes.color!==void 0?O.vertexColors=!0:w.isMeshPhongMaterial&&O.color.copy(w.emissive),v=new I.Points(N,O)}else if(D==="line"){const O=new I.LineBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});N.attributes.color!==void 0?O.vertexColors=!0:w.isMeshPhongMaterial&&O.color.copy(w.emissive),v=new I.LineSegments(N,O)}else N._solid!==void 0&&(w.side=N._solid?I.FrontSide:I.DoubleSide),N.attributes.color!==void 0&&(w.vertexColors=!0),v=new I.Mesh(N,w)}else v=new I.Object3D,v.visible=!1;return v}function m(T){let y=new I.MeshPhongMaterial,w;const N=T.fields;for(let v=0,D=N.length;v<D;v++){const O=N[v],G=O.name,z=O.values;switch(G){case"material":if(z[0]!==null){const ae=a(z[0]);ae.diffuseColor&&y.color.copy(ae.diffuseColor),ae.emissiveColor&&y.emissive.copy(ae.emissiveColor),ae.shininess&&(y.shininess=ae.shininess),ae.specularColor&&y.specular.copy(ae.specularColor),ae.transparency&&(y.opacity=1-ae.transparency),ae.transparency>0&&(y.transparent=!0)}else y=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const te=z[0];te!==null&&(te.name==="ImageTexture"||te.name==="PixelTexture"||te.USE)&&(y.map=a(te));break;case"textureTransform":z[0]!==null&&(w=a(z[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(y.map){if(y.map.__type){switch(y.map.__type){case Ze.INTENSITY_ALPHA:y.opacity=1;break;case Ze.RGB:y.color.set(16777215);break;case Ze.RGBA:y.color.set(16777215),y.opacity=1;break}delete y.map.__type}w&&(y.map.center.copy(w.center),y.map.rotation=w.rotation,y.map.repeat.copy(w.scale),y.map.offset.copy(w.translation))}return y}function E(T){const y={},w=T.fields;for(let N=0,v=w.length;N<v;N++){const D=w[N],O=D.name,G=D.values;switch(O){case"ambientIntensity":break;case"diffuseColor":y.diffuseColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"emissiveColor":y.emissiveColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"shininess":y.shininess=G[0];break;case"specularColor":y.specularColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"transparency":y.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return y}function l(T,y,w){let N;switch(y){case Ze.INTENSITY:N=parseInt(T),w.r=N,w.g=N,w.b=N,w.a=1;break;case Ze.INTENSITY_ALPHA:N=parseInt("0x"+T.substring(2,4)),w.r=N,w.g=N,w.b=N,w.a=parseInt("0x"+T.substring(4,6));break;case Ze.RGB:w.r=parseInt("0x"+T.substring(2,4)),w.g=parseInt("0x"+T.substring(4,6)),w.b=parseInt("0x"+T.substring(6,8)),w.a=1;break;case Ze.RGBA:w.r=parseInt("0x"+T.substring(2,4)),w.g=parseInt("0x"+T.substring(4,6)),w.b=parseInt("0x"+T.substring(6,8)),w.a=parseInt("0x"+T.substring(8,10));break}}function h(T){let y;switch(T){case 1:y=Ze.INTENSITY;break;case 2:y=Ze.INTENSITY_ALPHA;break;case 3:y=Ze.RGB;break;case 4:y=Ze.RGBA;break}return y}function p(T){let y,w=I.RepeatWrapping,N=I.RepeatWrapping;const v=T.fields;for(let D=0,O=v.length;D<O;D++){const G=v[D],z=G.name,te=G.values;switch(z){case"image":const ae=te[0],Ie=te[1],ke=te[2],Pe=h(ke),Le=new Uint8Array(4*ae*Ie),ye={r:0,g:0,b:0,a:0};for(let we=3,xe=0,Fe=te.length;we<Fe;we++,xe++){l(te[we],Pe,ye);const Qe=xe*4;Le[Qe+0]=ye.r,Le[Qe+1]=ye.g,Le[Qe+2]=ye.b,Le[Qe+3]=ye.a}y=new I.DataTexture(Le,ae,Ie),y.colorSpace=I.SRGBColorSpace,y.needsUpdate=!0,y.__type=Pe;break;case"repeatS":te[0]===!1&&(w=I.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(N=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return y&&(y.wrapS=w,y.wrapT=N),y}function C(T){let y,w=I.RepeatWrapping,N=I.RepeatWrapping;const v=T.fields;for(let D=0,O=v.length;D<O;D++){const G=v[D],z=G.name,te=G.values;switch(z){case"url":const ae=te[0];ae&&(y=ie.load(ae));break;case"repeatS":te[0]===!1&&(w=I.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(N=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return y&&(y.wrapS=w,y.wrapT=N,y.colorSpace=I.SRGBColorSpace),y}function g(T){const y={center:new I.Vector2,rotation:new I.Vector2,scale:new I.Vector2,translation:new I.Vector2},w=T.fields;for(let N=0,v=w.length;N<v;N++){const D=w[N],O=D.name,G=D.values;switch(O){case"center":y.center.set(G[0],G[1]);break;case"rotation":y.rotation=G[0];break;case"scale":y.scale.set(G[0],G[1]);break;case"translation":y.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return y}function B(T){return T.fields[0].values}function Q(T){const y={},w=T.fields;for(let N=0,v=w.length;N<v;N++){const D=w[N],O=D.name,G=D.values;switch(O){case"title":y.title=G[0];break;case"info":y.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return y}function S(T){let y,w,N,v,D=!0,O=!0,G=0,z,te,ae,Ie,ke=!0,Pe=!0;const Le=T.fields;for(let De=0,qe=Le.length;De<qe;De++){const Ke=Le[De],Re=Ke.name,de=Ke.values;switch(Re){case"color":const fe=de[0];fe!==null&&(y=a(fe));break;case"coord":const ue=de[0];ue!==null&&(w=a(ue));break;case"normal":const pe=de[0];pe!==null&&(N=a(pe));break;case"texCoord":const Ee=de[0];Ee!==null&&(v=a(Ee));break;case"ccw":D=de[0];break;case"colorIndex":z=de;break;case"colorPerVertex":ke=de[0];break;case"convex":break;case"coordIndex":te=de;break;case"creaseAngle":G=de[0];break;case"normalIndex":ae=de;break;case"normalPerVertex":Pe=de[0];break;case"solid":O=de[0];break;case"texCoordIndex":Ie=de;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Re);break}}if(te===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new I.BufferGeometry;const ye=X(te,D);let we,xe,Fe;if(y){if(ke===!0)if(z&&z.length>0){const De=X(z,D);we=ne(ye,De,y,3)}else we=me(ye,new I.Float32BufferAttribute(y,3));else if(z&&z.length>0){const De=ce(y,z),qe=Z(De,te);we=le(ye,qe)}else{const De=Z(y,te);we=le(ye,De)}Y(we)}if(N)if(Pe===!0)if(ae&&ae.length>0){const De=X(ae,D);xe=ne(ye,De,N,3)}else xe=me(ye,new I.Float32BufferAttribute(N,3));else if(ae&&ae.length>0){const De=ce(N,ae),qe=Z(De,te);xe=le(ye,qe)}else{const De=Z(N,te);xe=le(ye,De)}else xe=Ve(ye,w,G);if(v)if(Ie&&Ie.length>0){const De=X(Ie,D);Fe=ne(ye,De,v,2)}else Fe=me(ye,new I.Float32BufferAttribute(v,2));const Qe=new I.BufferGeometry,Me=me(ye,new I.Float32BufferAttribute(w,3));return Qe.setAttribute("position",Me),Qe.setAttribute("normal",xe),we&&Qe.setAttribute("color",we),Fe&&Qe.setAttribute("uv",Fe),Qe._solid=O,Qe._type="mesh",Qe}function j(T){let y,w,N,v,D=!0;const O=T.fields;for(let Ie=0,ke=O.length;Ie<ke;Ie++){const Pe=O[Ie],Le=Pe.name,ye=Pe.values;switch(Le){case"color":const we=ye[0];we!==null&&(y=a(we));break;case"coord":const xe=ye[0];xe!==null&&(w=a(xe));break;case"colorIndex":N=ye;break;case"colorPerVertex":D=ye[0];break;case"coordIndex":v=ye;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Le);break}}let G;const z=re(v);if(y){if(D===!0)if(N.length>0){const Ie=re(N);G=ne(z,Ie,y,3)}else G=me(z,new I.Float32BufferAttribute(y,3));else if(N.length>0){const Ie=ce(y,N),ke=oe(Ie,v);G=Ce(z,ke)}else{const Ie=oe(y,v);G=Ce(z,Ie)}Y(G)}const te=new I.BufferGeometry,ae=me(z,new I.Float32BufferAttribute(w,3));return te.setAttribute("position",ae),G&&te.setAttribute("color",G),te._type="line",te}function R(T){let y,w;const N=T.fields;for(let D=0,O=N.length;D<O;D++){const G=N[D],z=G.name,te=G.values;switch(z){case"color":const ae=te[0];ae!==null&&(y=a(ae));break;case"coord":const Ie=te[0];Ie!==null&&(w=a(Ie));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}const v=new I.BufferGeometry;if(v.setAttribute("position",new I.Float32BufferAttribute(w,3)),y){const D=new I.Float32BufferAttribute(y,3);Y(D),v.setAttribute("color",D)}return v._type="points",v}function F(T){const y=new I.Vector3(2,2,2),w=T.fields;for(let v=0,D=w.length;v<D;v++){const O=w[v],G=O.name,z=O.values;G==="size"?(y.x=z[0],y.y=z[1],y.z=z[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.BoxGeometry(y.x,y.y,y.z)}function L(T){let y=1,w=2,N=!1;const v=T.fields;for(let O=0,G=v.length;O<G;O++){const z=v[O],te=z.name,ae=z.values;switch(te){case"bottom":N=!ae[0];break;case"bottomRadius":y=ae[0];break;case"height":w=ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",te);break}}return new I.ConeGeometry(y,w,16,1,N)}function k(T){let y=1,w=2;const N=T.fields;for(let D=0,O=N.length;D<O;D++){const G=N[D],z=G.name,te=G.values;switch(z){case"bottom":break;case"radius":y=te[0];break;case"height":w=te[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return new I.CylinderGeometry(y,y,w,16,1)}function x(T){let y=1;const w=T.fields;for(let v=0,D=w.length;v<D;v++){const O=w[v],G=O.name,z=O.values;G==="radius"?y=z[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.SphereGeometry(y,16,16)}function _(T){let y,w,N,v,D=!0,O=!0,G=!0,z=!0,te=0,ae=2,Ie=2,ke=1,Pe=1;const Le=T.fields;for(let de=0,fe=Le.length;de<fe;de++){const ue=Le[de],pe=ue.name,Ee=ue.values;switch(pe){case"color":const Oe=Ee[0];Oe!==null&&(y=a(Oe));break;case"normal":const rt=Ee[0];rt!==null&&(w=a(rt));break;case"texCoord":const ot=Ee[0];ot!==null&&(N=a(ot));break;case"height":v=Ee;break;case"ccw":z=Ee[0];break;case"colorPerVertex":D=Ee[0];break;case"creaseAngle":te=Ee[0];break;case"normalPerVertex":O=Ee[0];break;case"solid":G=Ee[0];break;case"xDimension":ae=Ee[0];break;case"xSpacing":ke=Ee[0];break;case"zDimension":Ie=Ee[0];break;case"zSpacing":Pe=Ee[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}const ye=[],we=[],xe=[],Fe=[];for(let de=0;de<Ie;de++)for(let fe=0;fe<ae;fe++){const ue=de*ae+fe,pe=ke*de,Ee=v[ue],Oe=Pe*fe;if(ye.push(pe,Ee,Oe),y&&D===!0){const rt=y[ue*3+0],ot=y[ue*3+1],Nt=y[ue*3+2];xe.push(rt,ot,Nt)}if(w&&O===!0){const rt=w[ue*3+0],ot=w[ue*3+1],Nt=w[ue*3+2];we.push(rt,ot,Nt)}if(N){const rt=N[ue*2+0],ot=N[ue*2+1];Fe.push(rt,ot)}else Fe.push(de/(ae-1),fe/(Ie-1))}const Qe=[];for(let de=0;de<ae-1;de++)for(let fe=0;fe<Ie-1;fe++){const ue=de+fe*ae,pe=de+(fe+1)*ae,Ee=de+1+(fe+1)*ae,Oe=de+1+fe*ae;z===!0?(Qe.push(ue,Ee,pe),Qe.push(Ee,ue,Oe)):(Qe.push(ue,pe,Ee),Qe.push(Ee,Oe,ue))}const Me=me(Qe,new I.Float32BufferAttribute(ye,3)),De=me(Qe,new I.Float32BufferAttribute(Fe,2));let qe,Ke;if(y){if(D===!1){for(let de=0;de<ae-1;de++)for(let fe=0;fe<Ie-1;fe++){const ue=de+fe*(ae-1),pe=y[ue*3+0],Ee=y[ue*3+1],Oe=y[ue*3+2];xe.push(pe,Ee,Oe),xe.push(pe,Ee,Oe),xe.push(pe,Ee,Oe),xe.push(pe,Ee,Oe),xe.push(pe,Ee,Oe),xe.push(pe,Ee,Oe)}qe=new I.Float32BufferAttribute(xe,3)}else qe=me(Qe,new I.Float32BufferAttribute(xe,3));Y(qe)}if(w)if(O===!1){for(let de=0;de<ae-1;de++)for(let fe=0;fe<Ie-1;fe++){const ue=de+fe*(ae-1),pe=w[ue*3+0],Ee=w[ue*3+1],Oe=w[ue*3+2];we.push(pe,Ee,Oe),we.push(pe,Ee,Oe),we.push(pe,Ee,Oe),we.push(pe,Ee,Oe),we.push(pe,Ee,Oe),we.push(pe,Ee,Oe)}Ke=new I.Float32BufferAttribute(we,3)}else Ke=me(Qe,new I.Float32BufferAttribute(we,3));else Ke=Ve(Qe,ye,te);const Re=new I.BufferGeometry;return Re.setAttribute("position",Me),Re.setAttribute("normal",Ke),Re.setAttribute("uv",De),qe&&Re.setAttribute("color",qe),Re._solid=G,Re._type="mesh",Re}function V(T){let y=[1,1,1,-1,-1,-1,-1,1,1,1],w=[0,0,0,0,1,0],N,v,D=!0,O=!0,G=0,z=!0,te=!0;const ae=T.fields;for(let Re=0,de=ae.length;Re<de;Re++){const fe=ae[Re],ue=fe.name,pe=fe.values;switch(ue){case"beginCap":D=pe[0];break;case"ccw":O=pe[0];break;case"convex":break;case"creaseAngle":G=pe[0];break;case"crossSection":y=pe;break;case"endCap":z=pe[0];break;case"orientation":v=pe;break;case"scale":N=pe;break;case"solid":te=pe[0];break;case"spine":w=pe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ue);break}}const Ie=y[0]===y[y.length-2]&&y[1]===y[y.length-1],ke=[],Pe=new I.Vector3,Le=new I.Vector3,ye=new I.Vector3,we=new I.Vector3,xe=new I.Quaternion;for(let Re=0,de=0,fe=0,ue=w.length;Re<ue;Re+=3,de+=2,fe+=4){Pe.fromArray(w,Re),Le.x=N?N[de+0]:1,Le.y=1,Le.z=N?N[de+1]:1,ye.x=v?v[fe+0]:0,ye.y=v?v[fe+1]:0,ye.z=v?v[fe+2]:1;const pe=v?v[fe+3]:0;for(let Ee=0,Oe=y.length;Ee<Oe;Ee+=2)we.x=y[Ee+0],we.y=0,we.z=y[Ee+1],we.multiply(Le),xe.setFromAxisAngle(ye,pe),we.applyQuaternion(xe),we.add(Pe),ke.push(we.x,we.y,we.z)}const Fe=[],Qe=w.length/3,Me=y.length/2;for(let Re=0;Re<Qe-1;Re++)for(let de=0;de<Me-1;de++){const fe=de+Re*Me;let ue=de+1+Re*Me;const pe=de+(Re+1)*Me;let Ee=de+1+(Re+1)*Me;de===Me-2&&Ie===!0&&(ue=Re*Me,Ee=(Re+1)*Me),O===!0?(Fe.push(fe,ue,pe),Fe.push(pe,ue,Ee)):(Fe.push(fe,pe,ue),Fe.push(pe,Ee,ue))}if(D===!0||z===!0){const Re=[];for(let ue=0,pe=y.length;ue<pe;ue+=2)Re.push(new I.Vector2(y[ue],y[ue+1]));const de=I.ShapeUtils.triangulateShape(Re,[]),fe=[];for(let ue=0,pe=de.length;ue<pe;ue++){const Ee=de[ue];fe.push(Ee[0],Ee[1],Ee[2])}if(D===!0)for(let ue=0,pe=fe.length;ue<pe;ue+=3)O===!0?Fe.push(fe[ue+0],fe[ue+1],fe[ue+2]):Fe.push(fe[ue+0],fe[ue+2],fe[ue+1]);if(z===!0){const ue=Me*(Qe-1);for(let pe=0,Ee=fe.length;pe<Ee;pe+=3)O===!0?Fe.push(ue+fe[pe+0],ue+fe[pe+2],ue+fe[pe+1]):Fe.push(ue+fe[pe+0],ue+fe[pe+1],ue+fe[pe+2])}}const De=me(Fe,new I.Float32BufferAttribute(ke,3)),qe=Ve(Fe,ke,G),Ke=new I.BufferGeometry;return Ke.setAttribute("position",De),Ke.setAttribute("normal",qe),Ke._solid=te,Ke._type="mesh",Ke}function J(T){const y=n[T],w=a(y);return w.isObject3D||w.isMaterial?w.clone():w}function q(T,y){for(let w=0,N=T.length;w<N;w++){const v=a(T[w]);v instanceof I.Object3D&&y.add(v)}}function X(T,y){const w=[];let N=0;for(let v=0,D=T.length;v<D;v++){const O=T[N],G=T[v+(y?1:2)],z=T[v+(y?2:1)];w.push(O,G,z),(T[v+3]===-1||v+3>=D)&&(v+=3,N=v+1)}return w}function Z(T,y){const w=[];let N=0;for(let v=0,D=y.length;v<D;v++){const O=N*3,G=T[O],z=T[O+1],te=T[O+2];w.push(G,z,te),(y[v+3]===-1||v+3>=D)&&(v+=3,N++)}return w}function ce(T,y){const w=[];for(let N=0,v=y.length;N<v;N++){const O=y[N]*3,G=T[O],z=T[O+1],te=T[O+2];w.push(G,z,te)}return w}function re(T){const y=[];for(let w=0,N=T.length;w<N;w++){const v=T[w],D=T[w+1];y.push(v,D),(T[w+2]===-1||w+2>=N)&&(w+=2)}return y}function oe(T,y){const w=[];let N=0;for(let v=0,D=y.length;v<D;v++){const O=N*3,G=T[O],z=T[O+1],te=T[O+2];w.push(G,z,te),(y[v+2]===-1||v+2>=D)&&(v+=2,N++)}return w}const ee=new I.Vector3,he=new I.Vector3,P=new I.Vector3,H=new I.Vector2,W=new I.Vector2,$=new I.Vector2;function ne(T,y,w,N){const v=[];for(let D=0,O=T.length;D<O;D+=3){const G=y[D],z=y[D+1],te=y[D+2];N===2?(H.fromArray(w,G*N),W.fromArray(w,z*N),$.fromArray(w,te*N),v.push(H.x,H.y),v.push(W.x,W.y),v.push($.x,$.y)):(ee.fromArray(w,G*N),he.fromArray(w,z*N),P.fromArray(w,te*N),v.push(ee.x,ee.y,ee.z),v.push(he.x,he.y,he.z),v.push(P.x,P.y,P.z))}return new I.Float32BufferAttribute(v,N)}function le(T,y){const w=[];for(let N=0,v=0,D=T.length;N<D;N+=3,v++)ee.fromArray(y,v*3),w.push(ee.x,ee.y,ee.z),w.push(ee.x,ee.y,ee.z),w.push(ee.x,ee.y,ee.z);return new I.Float32BufferAttribute(w,3)}function Ce(T,y){const w=[];for(let N=0,v=0,D=T.length;N<D;N+=2,v++)ee.fromArray(y,v*3),w.push(ee.x,ee.y,ee.z),w.push(ee.x,ee.y,ee.z);return new I.Float32BufferAttribute(w,3)}function me(T,y){const w=y.array,N=y.itemSize,v=new w.constructor(T.length*N);let D=0,O=0;for(let G=0,z=T.length;G<z;G++){D=T[G]*N;for(let te=0;te<N;te++)v[O++]=w[D++]}return new I.Float32BufferAttribute(v,N)}const Ne=new I.Vector3,je=new I.Vector3;function Ve(T,y,w){const N=[],v={};for(let O=0,G=T.length;O<G;O+=3){const z=T[O],te=T[O+1],ae=T[O+2],Ie=new ps(z,te,ae);ee.fromArray(y,z*3),he.fromArray(y,te*3),P.fromArray(y,ae*3),je.subVectors(P,he),Ne.subVectors(ee,he),je.cross(Ne),je.normalize(),Ie.normal.copy(je),v[z]===void 0&&(v[z]=[]),v[te]===void 0&&(v[te]=[]),v[ae]===void 0&&(v[ae]=[]),v[z].push(Ie.normal),v[te].push(Ie.normal),v[ae].push(Ie.normal),N.push(Ie)}const D=[];for(let O=0,G=N.length;O<G;O++){const z=N[O],te=Ue(v[z.a],z.normal,w),ae=Ue(v[z.b],z.normal,w),Ie=Ue(v[z.c],z.normal,w);ee.fromArray(y,z.a*3),he.fromArray(y,z.b*3),P.fromArray(y,z.c*3),D.push(te.x,te.y,te.z),D.push(ae.x,ae.y,ae.z),D.push(Ie.x,Ie.y,Ie.z)}return new I.Float32BufferAttribute(D,3)}function Ue(T,y,w){const N=new I.Vector3;if(w===0)N.copy(y);else for(let v=0,D=T.length;v<D;v++)T[v].angleTo(y)<w&&N.add(T[v]);return N.normalize()}function M(T){const y=[];for(let w=0,N=T.length;w<N;w+=3)y.push(new I.Color(T[w],T[w+1],T[w+2]));return y}function Y(T){const y=new I.Color;for(let w=0;w<T.count;w++)y.fromBufferAttribute(T,w),I.ColorManagement.colorSpaceToWorking(y,I.SRGBColorSpace),T.setXYZ(w,y.r,y.g,y.b)}function K(T,y,w,N,v){const D=[],O=v===!0?0:Math.PI;for(let ke=0,Pe=N.length;ke<Pe;ke++){let Le=ke===0?0:w[ke-1];Le=v===!0?Le:O-Le;const ye=new I.Vector3;ye.setFromSphericalCoords(y,Le,0),D.push(ye)}const G=T.index,z=T.attributes.position,te=new I.BufferAttribute(new Float32Array(T.attributes.position.count*3),3),ae=new I.Vector3,Ie=new I.Color;for(let ke=0;ke<G.count;ke++){const Pe=G.getX(ke);ae.fromBufferAttribute(z,Pe);let Le,ye,we=1;for(let Qe=1;Qe<D.length;Qe++){Le=Qe-1,ye=Qe;const Me=D[Le],De=D[ye];if(v===!0){if(ae.y<=Me.y&&ae.y>De.y){we=Math.abs(Me.y-ae.y)/Math.abs(Me.y-De.y);break}}else if(ae.y>=Me.y&&ae.y<De.y){we=Math.abs(Me.y-ae.y)/Math.abs(Me.y-De.y);break}}const xe=N[Le],Fe=N[ye];Ie.copy(xe).lerp(Fe,we),I.ColorManagement.colorSpaceToWorking(Ie,I.SRGBColorSpace),te.setXYZ(Pe,Ie.r,Ie.g,Ie.b)}T.setAttribute("color",te)}const ie=new I.TextureLoader(this.manager);if(ie.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const ge=r(e);return c(ge)}}class hs{constructor(e){this.lexer=new gt.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 ds=gt.CstParser;class fs extends ds{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,s=e.RCurly,o=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,d=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,m=e.FalseLiteral,E=e.NullLiteral,l=e.DEF,h=e.USE,p=e.ROUTE,C=e.TO,g=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(g),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(s)}),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(g)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(g)}}])}),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(m)}},{ALT:function(){t.CONSUME(E)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(o),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(E)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class ps{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new I.Vector3}}const Ze={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class gs extends I.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const s=this,o=new I.FileLoader(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(c){try{t(s.parse(c))}catch(A){r?r(A):console.error(A),s.manager.itemError(e)}},n,r)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const m=[],E=r(f,c(f),m);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,E);return m}function n(f,m,E){if(E.type==="ENDSITE")return;const l={time:m,position:new I.Vector3,rotation:new I.Quaternion,scale:new I.Vector3(1,1,1)};E.frames.push(l);const h=new I.Quaternion,p=new I.Vector3(1,0,0),C=new I.Vector3(0,1,0),g=new I.Vector3(0,0,1);for(let B=0;B<E.channels.length;B++)switch(E.channels[B]){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(g,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 B=0;B<E.children.length;B++)n(f,m,E.children[B])}function r(f,m,E){const l={name:"",type:"",frames:[]};E.push(l);let h=m.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(r(f,C,E))}}function s(f,m){const E=new I.Bone;if(m.push(E),E.position.add(f.offset),E.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)E.add(s(f.children[l],m));return E}function o(f){const m=[];for(let E=0;E<f.length;E++){const l=f[E];if(l.type==="ENDSITE")continue;const h=[],p=[],C=[],g=[];for(let B=0;B<l.frames.length;B++){const Q=l.frames[B];h.push(Q.time),p.push(Q.position.x+l.offset.x),p.push(Q.position.y+l.offset.y),p.push(Q.position.z+l.offset.z),C.push(Q.rotation.x),C.push(Q.rotation.y),C.push(Q.rotation.z),C.push(Q.rotation.w),g.push(Q.scale.x),g.push(Q.scale.y),g.push(Q.scale.z)}A.animateBonePositions&&m.push(new I.VectorKeyframeTrack(l.name+".position",h,p)),A.animateBoneRotations&&m.push(new I.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&m.push(new I.VectorKeyframeTrack(l.name+".scale",h,g))}return new I.AnimationClip("animation",-1,m)}function c(f){let m;for(;(m=f.shift().trim()).length===0;);return m}const A=this,a=e.split(/[\r\n]+/g),d=t(a),u=[];s(d[0],u);const b=o(d);return{skeleton:new I.Skeleton(u),clip:b}}}let pt;async function Es(i,e){pt||(pt=new us),pt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(Fn(i,n))));const t=await pt.loadAsync(e);return pt.manager.setURLModifier(n=>n),t}let Kt;async function ms(i,e){Kt||(Kt=new gs);const t=rn(i,e);return await Kt.parse(t)}function Is(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(s=>{s instanceof se.Bone&&n.push(s)});const r=new se.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class Ln{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const zt={},Wt={};class bs extends It{comment=null;constructor(e){super(e)}async asyncInit(e){const t=await Dn(e),n=new DOMParser,r=rn(t,"CATALOG.XML"),s=n.parseFromString(r,"application/xml");if(s.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const o="http://acerola3d.sourceforge.jp/a3/catalog",c=s.getElementsByTagNameNS(o,"c");c[0]&&(this.comment=c[0].textContent);const A=s.getElementsByTagNameNS(o,"a"),a={};let d;for(const u of Array.from(A)){const b=u.getAttribute("an");if(b){d||(d=b);let f;const m=u.getAttribute("bvh");if(m){const F=t.zipUrl+"!"+m;zt[F]||(zt[F]=await ms(t,m)),f=Is(zt[F]),f&&f.clip.tracks.forEach(L=>{L.setInterpolation(se.InterpolateDiscrete)})}else f=new Ln;const E={};f.skeleton.bones.forEach(F=>{E[F.name]=F});const l=u.getAttribute("scale"),h=l?Number(l):1,p=u.getAttribute("offset"),C=new Ae;if(p){const F=p.split(" ");C.set(Number(F[0]),Number(F[1]),Number(F[2]))}const g={},B=u.getElementsByTagNameNS(o,"p");for(const F of Array.from(B)){const L=F.getAttribute("name"),k=F.getAttribute("wrl");if(L&&k){const x=t.zipUrl+"!"+k;Wt[x]||(Wt[x]=await Es(t,k)),g[L]=Wt[x].clone(!0)}}const Q=new se.Object3D;Q.add(f.skeleton.bones[0]),f instanceof Ln?Object.values(g).forEach(F=>{Q.add(F)}):Ki(Q,g),Q.position.add(C),Q.scale.set(h,h,h),Q.traverse(F=>{F.userData.a3js={objectA3:this}});let S,j=!0;const R=u.getElementsByTagNameNS(o,"s");if(R[0]){const F=R[0].getAttribute("file"),L=R[0].getAttribute("type")||"PointSound",k=R[0].getAttribute("loop")||"false",x=R[0].getAttribute("gain")||"1.0",_=R[0].getAttribute("offset")||"0.0 0.0 0.0",V=R[0].getAttribute("direction")||"0.0 0.0 1.0";j=(R[0].getAttribute("continue")||"true")==="true";const q=_.split(" ").map(P=>Number(P)),X=new Ae(q[0],q[1],q[2]),Z=V.split(" ").map(P=>Number(P)),ce=new Ae(Z[0],Z[1],Z[2]),re=L==="PointSound"||L==="ConeSound"?"positional":"audio",he=L==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(F){const P=Fn(t,F),H=URL.createObjectURL(P),W={type:re,loop:k==="true",volume:Number(x),positional:{directional:he}};S=await new nt(H,W).ready,S.setLocation(X),S.lookAt(ce),URL.revokeObjectURL(H),Q.add(S.object)}}a[b]={name:b,shape:{root:Q,bones:E,skeleton:f.skeleton},motion:new sn(f.clip,b),sound:S,soundContinue:j}}}return d&&this.syncInit(d,a),this}}function Ki(i,e){if(pr(i)){const t=e[i.name];t&&i.add(t)}i.children&&i.children.forEach(t=>{Ki(t,e)})}class Cs extends _e{constructor(e){super(e)}initObject(e){return e}}class ys extends _e{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.BoxGeometry(...t),s=n.length>0?n[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:s});return new se.Mesh(r,o)}}class Bs extends _e{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.SphereGeometry(...t),s=n.length>0?n[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:s});return new se.Mesh(r,o)}}class ws extends _e{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 Ts extends _e{constructor(e){super(e)}initObject(e){const t=new se.PlaneGeometry(1,1),n=new se.TextureLoader().load(e),r=new se.MeshBasicMaterial({map:n});return new se.Mesh(t,r)}}class vs extends _e{constructor(e){super(e)}initObject(e){return new Un(e)}}const zi={touchDevice:navigator.maxTouchPoints>0};class Wi extends HTMLElement{option;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;constructor(e={}){super(),this.option={...zi,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
208
|
+
Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var b=Is();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return b.createSyntaxDiagramsCode}});var f=(function(){function I(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|
209
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I})();i.Parser=f});const Bt=bs();class Cs extends g.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=o.path===""?g.LoaderUtils.extractUrlBase(e):o.path,c=new g.FileLoader(o.manager);c.setPath(o.path),c.setRequestHeader(o.requestHeader),c.setWithCredentials(o.withCredentials),c.load(e,function(A){try{t(o.parse(A,s))}catch(a){r?r(a):console.error(a),o.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(k){const T=o(),B=new ys(T.tokens),S=new ws(T.tokenVocabulary),w=s(S.getBaseCstVisitorConstructor()),D=B.lex(k);S.input=D.tokens;const F=S.vrml();if(S.errors.length>0)throw console.error(S.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return w.visit(F)}function o(){const k=Bt.createToken,T=k({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),B=k({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]([^\0-\x20\x22\x27\x23\x2b\x2c\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:T}),S=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],w=k({name:"Version",pattern:/#VRML.*/,longer_alt:B}),D=k({name:"NodeName",pattern:new RegExp(S.join("|")),longer_alt:B}),F=k({name:"DEF",pattern:/DEF/,longer_alt:B}),G=k({name:"USE",pattern:/USE/,longer_alt:B}),z=k({name:"ROUTE",pattern:/ROUTE/,longer_alt:B}),$=k({name:"TO",pattern:/TO/,longer_alt:B}),re=k({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),pe=k({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),ve=k({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Me=k({name:"TrueLiteral",pattern:/TRUE/}),ye=k({name:"FalseLiteral",pattern:/FALSE/}),Be=k({name:"NullLiteral",pattern:/NULL/}),fe=k({name:"LSquare",pattern:/\[/}),Ne=k({name:"RSquare",pattern:/]/}),Pe=k({name:"LCurly",pattern:/{/}),_e=k({name:"RCurly",pattern:/}/}),ke=k({name:"Comment",pattern:/#.*/,group:Bt.Lexer.SKIPPED}),Ve=[k({name:"WhiteSpace",pattern:/[ ,\s]/,group:Bt.Lexer.SKIPPED}),D,F,G,z,$,Me,ye,Be,w,B,T,re,pe,ve,fe,Ne,Pe,_e,ke],Ye={};for(let xe=0,ge=Ve.length;xe<ge;xe++){const Ee=Ve[xe];Ye[Ee.name]=Ee}return{tokens:Ve,tokenVocabulary:Ye}}function s(k){class T extends k{constructor(){super(),this.validateVisitor()}vrml(w){const D={version:this.visit(w.version),nodes:[],routes:[]};for(let F=0,G=w.node.length;F<G;F++){const z=w.node[F];D.nodes.push(this.visit(z))}if(w.route)for(let F=0,G=w.route.length;F<G;F++){const z=w.route[F];D.routes.push(this.visit(z))}return D}version(w){return w.Version[0].image}node(w){const D={name:w.NodeName[0].image,fields:[]};if(w.field)for(let F=0,G=w.field.length;F<G;F++){const z=w.field[F];D.fields.push(this.visit(z))}return w.def&&(D.DEF=this.visit(w.def[0])),D}field(w){const D={name:w.Identifier[0].image,type:null,values:null};let F;return w.singleFieldValue&&(F=this.visit(w.singleFieldValue[0])),w.multiFieldValue&&(F=this.visit(w.multiFieldValue[0])),D.type=F.type,D.values=F.values,D}def(w){return(w.Identifier||w.NodeName)[0].image}use(w){return{USE:(w.Identifier||w.NodeName)[0].image}}singleFieldValue(w){return B(this,w)}multiFieldValue(w){return B(this,w)}route(w){return{FROM:w.RouteIdentifier[0].image,TO:w.RouteIdentifier[1].image}}}function B(S,w){const D={type:null,values:[]};if(w.node){D.type="node";for(let F=0,G=w.node.length;F<G;F++){const z=w.node[F];D.values.push(S.visit(z))}}if(w.use){D.type="use";for(let F=0,G=w.use.length;F<G;F++){const z=w.use[F];D.values.push(S.visit(z))}}if(w.StringLiteral){D.type="string";for(let F=0,G=w.StringLiteral.length;F<G;F++){const z=w.StringLiteral[F];D.values.push(z.image.replace(/'|"/g,""))}}if(w.NumberLiteral){D.type="number";for(let F=0,G=w.NumberLiteral.length;F<G;F++){const z=w.NumberLiteral[F];D.values.push(parseFloat(z.image))}}if(w.HexLiteral){D.type="hex";for(let F=0,G=w.HexLiteral.length;F<G;F++){const z=w.HexLiteral[F];D.values.push(z.image)}}if(w.TrueLiteral){D.type="boolean";for(let F=0,G=w.TrueLiteral.length;F<G;F++)w.TrueLiteral[F].image==="TRUE"&&D.values.push(!0)}if(w.FalseLiteral){D.type="boolean";for(let F=0,G=w.FalseLiteral.length;F<G;F++)w.FalseLiteral[F].image==="FALSE"&&D.values.push(!1)}return w.NullLiteral&&(D.type="null",w.NullLiteral.forEach(function(){D.values.push(null)})),D}return new T}function c(k){const T=k.nodes,B=new g.Scene;for(let S=0,w=T.length;S<w;S++){const D=T[S];A(D)}for(let S=0,w=T.length;S<w;S++){const D=T[S],F=a(D);F instanceof g.Object3D&&B.add(F),D.name==="WorldInfo"&&(B.userData.worldInfo=F)}return B}function A(k){k.DEF&&(n[k.DEF]=k);const T=k.fields;for(let B=0,S=T.length;B<S;B++){const w=T[B];if(w.type==="node"){const D=w.values;for(let F=0,G=D.length;F<G;F++)A(D[F])}}}function a(k){return k.USE?te(k.USE):(k.build!==void 0||(k.build=h(k)),k.build)}function h(k){const T=k.name;let B;switch(T){case"Anchor":case"Group":case"Transform":case"Collision":B=u(k);break;case"Background":B=b(k);break;case"Shape":B=f(k);break;case"Appearance":B=I(k);break;case"Material":B=E(k);break;case"ImageTexture":B=C(k);break;case"PixelTexture":B=p(k);break;case"TextureTransform":B=m(k);break;case"IndexedFaceSet":B=M(k);break;case"IndexedLineSet":B=x(k);break;case"PointSet":B=R(k);break;case"Box":B=N(k);break;case"Cone":B=L(k);break;case"Cylinder":B=W(k);break;case"Sphere":B=J(k);break;case"ElevationGrid":B=K(k);break;case"Extrusion":B=ee(k);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":B=y(k);break;case"WorldInfo":B=Q(k);break;case"DirectionalLight":B=_(k);break;case"PointLight":B=j(k);break;case"SpotLight":B=v(k);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"Script":case"Sound":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",T);break}return B!==void 0&&k.DEF!==void 0&&B.hasOwnProperty("name")===!0&&(B.name=k.DEF),B}function u(k){const T=new g.Group,B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":ue(G,T);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const z=new g.Vector3(G[0],G[1],G[2]).normalize(),$=G[3];T.quaternion.setFromAxisAngle(z,$);break;case"scale":T.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":T.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 T}function b(k){const T=new g.Group;let B,S,w,D;const F=k.fields;for(let z=0,$=F.length;z<$;z++){const re=F[z],pe=re.name,ve=re.values;switch(pe){case"groundAngle":B=ve;break;case"groundColor":S=ve;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":w=ve;break;case"skyColor":D=ve;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}const G=1e4;if(D){const z=new g.SphereGeometry(G,32,16),$=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,depthWrite:!1,depthTest:!1});D.length>3?(Le(z,G,w,ie(D),!0),$.vertexColors=!0):$.color.setRGB(D[0],D[1],D[2],g.SRGBColorSpace);const re=new g.Mesh(z,$);T.add(re)}if(S&&S.length>0){const z=new g.SphereGeometry(G,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),$=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});Le(z,G,B,ie(S),!1);const re=new g.Mesh(z,$);T.add(re)}return T.renderOrder=-1/0,T}function f(k){const T=k.fields;let B=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0}),S;for(let D=0,F=T.length;D<F;D++){const G=T[D],z=G.name,$=G.values;switch(z){case"appearance":$[0]!==null&&(B=a($[0]));break;case"geometry":$[0]!==null&&(S=a($[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}let w;if(S&&S.attributes.position){const D=S._type;if(D==="points"){const F=new g.PointsMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.Points(S,F)}else if(D==="line"){const F=new g.LineBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.LineSegments(S,F)}else S._solid!==void 0&&(B.side=S._solid?g.FrontSide:g.DoubleSide),S.attributes.color!==void 0&&(B.vertexColors=!0),w=new g.Mesh(S,B)}else w=new g.Object3D,w.visible=!1;return w}function I(k){let T=new g.MeshPhongMaterial,B;const S=k.fields;for(let w=0,D=S.length;w<D;w++){const F=S[w],G=F.name,z=F.values;switch(G){case"material":if(z[0]!==null){const re=a(z[0]);re.diffuseColor&&T.color.copy(re.diffuseColor),re.emissiveColor&&T.emissive.copy(re.emissiveColor),re.shininess&&(T.shininess=re.shininess),re.specularColor&&T.specular.copy(re.specularColor),re.transparency&&(T.opacity=1-re.transparency),re.transparency>0&&(T.transparent=!0)}else T=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const $=z[0];$!==null&&($.name==="ImageTexture"||$.name==="PixelTexture"||$.USE)&&(T.map=a($));break;case"textureTransform":z[0]!==null&&(B=a(z[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(T.map){if(T.map.__type){switch(T.map.__type){case nt.INTENSITY_ALPHA:T.opacity=1;break;case nt.RGB:T.color.set(16777215);break;case nt.RGBA:T.color.set(16777215),T.opacity=1;break}delete T.map.__type}B&&(T.map.center.copy(B.center),T.map.rotation=B.rotation,T.map.repeat.copy(B.scale),T.map.offset.copy(B.translation))}return T}function E(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"ambientIntensity":break;case"diffuseColor":T.diffuseColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"emissiveColor":T.emissiveColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"shininess":T.shininess=G[0];break;case"specularColor":T.specularColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"transparency":T.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function l(k,T,B){let S;switch(T){case nt.INTENSITY:S=parseInt(k),B.r=S,B.g=S,B.b=S,B.a=1;break;case nt.INTENSITY_ALPHA:S=parseInt("0x"+k.substring(2,4)),B.r=S,B.g=S,B.b=S,B.a=parseInt("0x"+k.substring(4,6));break;case nt.RGB:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=1;break;case nt.RGBA:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=parseInt("0x"+k.substring(8,10));break}}function d(k){let T;switch(k){case 1:T=nt.INTENSITY;break;case 2:T=nt.INTENSITY_ALPHA;break;case 3:T=nt.RGB;break;case 4:T=nt.RGBA;break}return T}function p(k){let T,B=g.RepeatWrapping,S=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],z=G.name,$=G.values;switch(z){case"image":const re=$[0],pe=$[1],ve=$[2],Me=d(ve),ye=new Uint8Array(4*re*pe),Be={r:0,g:0,b:0,a:0};for(let fe=3,Ne=0,Pe=$.length;fe<Pe;fe++,Ne++){l($[fe],Me,Be);const _e=Ne*4;ye[_e+0]=Be.r,ye[_e+1]=Be.g,ye[_e+2]=Be.b,ye[_e+3]=Be.a}T=new g.DataTexture(ye,re,pe),T.colorSpace=g.SRGBColorSpace,T.needsUpdate=!0,T.__type=Me;break;case"repeatS":$[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(S=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return T&&(T.wrapS=B,T.wrapT=S),T}function C(k){let T,B=g.RepeatWrapping,S=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],z=G.name,$=G.values;switch(z){case"url":const re=$[0];re&&(T=Ce.load(re));break;case"repeatS":$[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(S=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return T&&(T.wrapS=B,T.wrapT=S,T.colorSpace=g.SRGBColorSpace),T}function m(k){const T={center:new g.Vector2,rotation:new g.Vector2,scale:new g.Vector2,translation:new g.Vector2},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"center":T.center.set(G[0],G[1]);break;case"rotation":T.rotation=G[0];break;case"scale":T.scale.set(G[0],G[1]);break;case"translation":T.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function y(k){return k.fields[0].values}function Q(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"title":T.title=G[0];break;case"info":T.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function _(k){let T=0;const B=new g.Color(1,1,1),S=new g.Vector3(0,0,-1);let w=1,D=!0;const F=k.fields;for(let re=0,pe=F.length;re<pe;re++){const ve=F[re],Me=ve.name,ye=ve.values;switch(Me){case"ambientIntensity":T=ye[0];break;case"color":B.set(ye[0],ye[1],ye[2]);break;case"direction":S.set(ye[0],ye[1],ye[2]);break;case"intensity":w=ye[0];break;case"on":D=ye[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Me);break}}w=D?w:0;const G=new g.Object3D,z=new g.DirectionalLight(B,w);S.normalize(),S.multiplyScalar(-10),z.position.copy(S),G.add(z);const $=new g.AmbientLight(B,w*T);return G.add($),G}function j(k){let T=0;const B=new g.Vector3(1,0,0),S=new g.Color(1,1,1);let w=1;const D=new g.Vector3(0,0,0);let F=!0,G=100;const z=k.fields;for(let ve=0,Me=z.length;ve<Me;ve++){const ye=z[ve],Be=ye.name,fe=ye.values;switch(Be){case"ambientIntensity":T=fe[0];break;case"attenuation":B.set(fe[0],fe[1],fe[2]);break;case"color":S.set(fe[0],fe[1],fe[2]);break;case"intensity":w=fe[0];break;case"location":D.set(fe[0],fe[1],fe[2]);break;case"on":F=fe[0];break;case"radius":G=fe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Be);break}}w=F?w:0;const $=new g.Object3D,re=new g.PointLight(S,w,G);re.position.copy(D),re.decay=2,$.add(re);const pe=new g.AmbientLight(S,w*T);return $.add(pe),$}function v(k){let T=0;const B=new g.Vector3(1,0,0);let S=1.570796;const w=new g.Color(1,1,1);let D=.785398;const F=new g.Vector3(0,0,-1);let G=1;const z=new g.Vector3(0,0,-1);let $=!0,re=100;const pe=k.fields;for(let fe=0,Ne=pe.length;fe<Ne;fe++){const Pe=pe[fe],_e=Pe.name,ke=Pe.values;switch(_e){case"ambientIntensity":T=ke[0];break;case"attenuation":B.set(ke[0],ke[1],ke[2]);break;case"beamWidth":S=ke[0];break;case"color":w.set(ke[0],ke[1],ke[2]);break;case"cutOffAngle":D=ke[0];break;case"direction":F.set(ke[0],ke[1],ke[2]);break;case"intensity":G=ke[0];break;case"location":z.set(ke[0],ke[1],ke[2]);break;case"on":$=ke[0];break;case"radius":re=ke[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",_e);break}}G=$?G:0;const ve=new g.Object3D;S=S>D?D:S;const Me=1-S/D,ye=new g.SpotLight(w,G,re,D,Me);F.normalize(),F.multiplyScalar(-.1),ye.position.copy(F),ye.decay=2,ve.add(ye);const Be=new g.AmbientLight(w,G*T);return ve.add(Be),ve.position.copy(z),ve}function M(k){let T,B,S,w,D=!0,F=!0,G=0,z,$,re,pe,ve=!0,Me=!0;const ye=k.fields;for(let Ge=0,Ve=ye.length;Ge<Ve;Ge++){const Ye=ye[Ge],xe=Ye.name,ge=Ye.values;switch(xe){case"color":const Ee=ge[0];Ee!==null&&(T=a(Ee));break;case"coord":const he=ge[0];he!==null&&(B=a(he));break;case"normal":const me=ge[0];me!==null&&(S=a(me));break;case"texCoord":const be=ge[0];be!==null&&(w=a(be));break;case"ccw":D=ge[0];break;case"colorIndex":z=ge;break;case"colorPerVertex":ve=ge[0];break;case"convex":break;case"coordIndex":$=ge;break;case"creaseAngle":G=ge[0];break;case"normalIndex":re=ge;break;case"normalPerVertex":Me=ge[0];break;case"solid":F=ge[0];break;case"texCoordIndex":pe=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",xe);break}}if($===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new g.BufferGeometry;const Be=oe($,D);let fe,Ne,Pe;if(T){if(ve===!0)if(z&&z.length>0){const Ge=oe(z,D);fe=Re(Be,Ge,T,3)}else fe=ze(Be,new g.Float32BufferAttribute(T,3));else if(z&&z.length>0){const Ge=Ae(T,z),Ve=ae(Ge,$);fe=Fe(Be,Ve)}else{const Ge=ae(T,$);fe=Fe(Be,Ge)}de(fe)}if(S)if(Me===!0)if(re&&re.length>0){const Ge=oe(re,D);Ne=Re(Be,Ge,S,3)}else Ne=ze(Be,new g.Float32BufferAttribute(S,3));else if(re&&re.length>0){const Ge=Ae(S,re),Ve=ae(Ge,$);Ne=Fe(Be,Ve)}else{const Ge=ae(S,$);Ne=Fe(Be,Ge)}else Ne=Y(Be,B,G);if(w)if(pe&&pe.length>0){const Ge=oe(pe,D);Pe=Re(Be,Ge,w,2)}else Pe=ze(Be,new g.Float32BufferAttribute(w,2));const _e=new g.BufferGeometry,ke=ze(Be,new g.Float32BufferAttribute(B,3));return _e.setAttribute("position",ke),_e.setAttribute("normal",Ne),fe&&_e.setAttribute("color",fe),Pe&&_e.setAttribute("uv",Pe),_e._solid=F,_e._type="mesh",_e}function x(k){let T,B,S,w,D=!0;const F=k.fields;for(let pe=0,ve=F.length;pe<ve;pe++){const Me=F[pe],ye=Me.name,Be=Me.values;switch(ye){case"color":const fe=Be[0];fe!==null&&(T=a(fe));break;case"coord":const Ne=Be[0];Ne!==null&&(B=a(Ne));break;case"colorIndex":S=Be;break;case"colorPerVertex":D=Be[0];break;case"coordIndex":w=Be;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ye);break}}let G;const z=Ie(w);if(T){if(D===!0)if(S.length>0){const pe=Ie(S);G=Re(z,pe,T,3)}else G=ze(z,new g.Float32BufferAttribute(T,3));else if(S.length>0){const pe=Ae(T,S),ve=U(pe,w);G=We(z,ve)}else{const pe=U(T,w);G=We(z,pe)}de(G)}const $=new g.BufferGeometry,re=ze(z,new g.Float32BufferAttribute(B,3));return $.setAttribute("position",re),G&&$.setAttribute("color",G),$._type="line",$}function R(k){let T,B;const S=k.fields;for(let D=0,F=S.length;D<F;D++){const G=S[D],z=G.name,$=G.values;switch(z){case"color":const re=$[0];re!==null&&(T=a(re));break;case"coord":const pe=$[0];pe!==null&&(B=a(pe));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}const w=new g.BufferGeometry;if(w.setAttribute("position",new g.Float32BufferAttribute(B,3)),T){const D=new g.Float32BufferAttribute(T,3);de(D),w.setAttribute("color",D)}return w._type="points",w}function N(k){const T=new g.Vector3(2,2,2),B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,z=F.values;G==="size"?(T.x=z[0],T.y=z[1],T.z=z[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.BoxGeometry(T.x,T.y,T.z)}function L(k){let T=1,B=2,S=!1;const w=k.fields;for(let F=0,G=w.length;F<G;F++){const z=w[F],$=z.name,re=z.values;switch($){case"bottom":S=!re[0];break;case"bottomRadius":T=re[0];break;case"height":B=re[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",$);break}}return new g.ConeGeometry(T,B,16,1,S)}function W(k){let T=1,B=2;const S=k.fields;for(let D=0,F=S.length;D<F;D++){const G=S[D],z=G.name,$=G.values;switch(z){case"bottom":break;case"radius":T=$[0];break;case"height":B=$[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return new g.CylinderGeometry(T,T,B,16,1)}function J(k){let T=1;const B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,z=F.values;G==="radius"?T=z[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.SphereGeometry(T,16,16)}function K(k){let T,B,S,w,D=!0,F=!0,G=!0,z=!0,$=0,re=2,pe=2,ve=1,Me=1;const ye=k.fields;for(let ge=0,Ee=ye.length;ge<Ee;ge++){const he=ye[ge],me=he.name,be=he.values;switch(me){case"color":const je=be[0];je!==null&&(T=a(je));break;case"normal":const ct=be[0];ct!==null&&(B=a(ct));break;case"texCoord":const lt=be[0];lt!==null&&(S=a(lt));break;case"height":w=be;break;case"ccw":z=be[0];break;case"colorPerVertex":D=be[0];break;case"creaseAngle":$=be[0];break;case"normalPerVertex":F=be[0];break;case"solid":G=be[0];break;case"xDimension":re=be[0];break;case"xSpacing":ve=be[0];break;case"zDimension":pe=be[0];break;case"zSpacing":Me=be[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",me);break}}const Be=[],fe=[],Ne=[],Pe=[];for(let ge=0;ge<pe;ge++)for(let Ee=0;Ee<re;Ee++){const he=ge*re+Ee,me=ve*ge,be=w[he],je=Me*Ee;if(Be.push(me,be,je),T&&D===!0){const ct=T[he*3+0],lt=T[he*3+1],Pt=T[he*3+2];Ne.push(ct,lt,Pt)}if(B&&F===!0){const ct=B[he*3+0],lt=B[he*3+1],Pt=B[he*3+2];fe.push(ct,lt,Pt)}if(S){const ct=S[he*2+0],lt=S[he*2+1];Pe.push(ct,lt)}else Pe.push(ge/(re-1),Ee/(pe-1))}const _e=[];for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*re,me=ge+(Ee+1)*re,be=ge+1+(Ee+1)*re,je=ge+1+Ee*re;z===!0?(_e.push(he,be,me),_e.push(be,he,je)):(_e.push(he,me,be),_e.push(be,je,he))}const ke=ze(_e,new g.Float32BufferAttribute(Be,3)),Ge=ze(_e,new g.Float32BufferAttribute(Pe,2));let Ve,Ye;if(T){if(D===!1){for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*(re-1),me=T[he*3+0],be=T[he*3+1],je=T[he*3+2];Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je)}Ve=new g.Float32BufferAttribute(Ne,3)}else Ve=ze(_e,new g.Float32BufferAttribute(Ne,3));de(Ve)}if(B)if(F===!1){for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*(re-1),me=B[he*3+0],be=B[he*3+1],je=B[he*3+2];fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je)}Ye=new g.Float32BufferAttribute(fe,3)}else Ye=ze(_e,new g.Float32BufferAttribute(fe,3));else Ye=Y(_e,Be,$);const xe=new g.BufferGeometry;return xe.setAttribute("position",ke),xe.setAttribute("normal",Ye),xe.setAttribute("uv",Ge),Ve&&xe.setAttribute("color",Ve),xe._solid=G,xe._type="mesh",xe}function ee(k){let T=[1,1,1,-1,-1,-1,-1,1,1,1],B=[0,0,0,0,1,0],S,w,D=!0,F=!0,G=0,z=!0,$=!0;const re=k.fields;for(let xe=0,ge=re.length;xe<ge;xe++){const Ee=re[xe],he=Ee.name,me=Ee.values;switch(he){case"beginCap":D=me[0];break;case"ccw":F=me[0];break;case"convex":break;case"creaseAngle":G=me[0];break;case"crossSection":T=me;break;case"endCap":z=me[0];break;case"orientation":w=me;break;case"scale":S=me;break;case"solid":$=me[0];break;case"spine":B=me;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",he);break}}const pe=T[0]===T[T.length-2]&&T[1]===T[T.length-1],ve=[],Me=new g.Vector3,ye=new g.Vector3,Be=new g.Vector3,fe=new g.Vector3,Ne=new g.Quaternion;for(let xe=0,ge=0,Ee=0,he=B.length;xe<he;xe+=3,ge+=2,Ee+=4){Me.fromArray(B,xe),ye.x=S?S[ge+0]:1,ye.y=1,ye.z=S?S[ge+1]:1,Be.x=w?w[Ee+0]:0,Be.y=w?w[Ee+1]:0,Be.z=w?w[Ee+2]:1;const me=w?w[Ee+3]:0;for(let be=0,je=T.length;be<je;be+=2)fe.x=T[be+0],fe.y=0,fe.z=T[be+1],fe.multiply(ye),Ne.setFromAxisAngle(Be,me),fe.applyQuaternion(Ne),fe.add(Me),ve.push(fe.x,fe.y,fe.z)}const Pe=[],_e=B.length/3,ke=T.length/2;for(let xe=0;xe<_e-1;xe++)for(let ge=0;ge<ke-1;ge++){const Ee=ge+xe*ke;let he=ge+1+xe*ke;const me=ge+(xe+1)*ke;let be=ge+1+(xe+1)*ke;ge===ke-2&&pe===!0&&(he=xe*ke,be=(xe+1)*ke),F===!0?(Pe.push(Ee,he,me),Pe.push(me,he,be)):(Pe.push(Ee,me,he),Pe.push(me,be,he))}if(D===!0||z===!0){const xe=[];for(let he=0,me=T.length;he<me;he+=2)xe.push(new g.Vector2(T[he],T[he+1]));const ge=g.ShapeUtils.triangulateShape(xe,[]),Ee=[];for(let he=0,me=ge.length;he<me;he++){const be=ge[he];Ee.push(be[0],be[1],be[2])}if(D===!0)for(let he=0,me=Ee.length;he<me;he+=3)F===!0?Pe.push(Ee[he+0],Ee[he+1],Ee[he+2]):Pe.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(z===!0){const he=ke*(_e-1);for(let me=0,be=Ee.length;me<be;me+=3)F===!0?Pe.push(he+Ee[me+0],he+Ee[me+2],he+Ee[me+1]):Pe.push(he+Ee[me+0],he+Ee[me+1],he+Ee[me+2])}}const Ge=ze(Pe,new g.Float32BufferAttribute(ve,3)),Ve=Y(Pe,ve,G),Ye=new g.BufferGeometry;return Ye.setAttribute("position",Ge),Ye.setAttribute("normal",Ve),Ye._solid=$,Ye._type="mesh",Ye}function te(k){const T=n[k],B=a(T);return B.isObject3D||B.isMaterial?B.clone():B}function ue(k,T){for(let B=0,S=k.length;B<S;B++){const w=a(k[B]);w instanceof g.Object3D&&T.add(w)}}function oe(k,T){const B=[];let S=0;for(let w=0,D=k.length;w<D;w++){const F=k[S],G=k[w+(T?1:2)],z=k[w+(T?2:1)];B.push(F,G,z),(k[w+3]===-1||w+3>=D)&&(w+=3,S=w+1)}return B}function ae(k,T){const B=[];let S=0;for(let w=0,D=T.length;w<D;w++){const F=S*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$),(T[w+3]===-1||w+3>=D)&&(w+=3,S++)}return B}function Ae(k,T){const B=[];for(let S=0,w=T.length;S<w;S++){const F=T[S]*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$)}return B}function Ie(k){const T=[];for(let B=0,S=k.length;B<S;B++){const w=k[B],D=k[B+1];T.push(w,D),(k[B+2]===-1||B+2>=S)&&(B+=2)}return T}function U(k,T){const B=[];let S=0;for(let w=0,D=T.length;w<D;w++){const F=S*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$),(T[w+2]===-1||w+2>=D)&&(w+=2,S++)}return B}const P=new g.Vector3,q=new g.Vector3,X=new g.Vector3,ne=new g.Vector2,le=new g.Vector2,we=new g.Vector2;function Re(k,T,B,S){const w=[];for(let D=0,F=k.length;D<F;D+=3){const G=T[D],z=T[D+1],$=T[D+2];S===2?(ne.fromArray(B,G*S),le.fromArray(B,z*S),we.fromArray(B,$*S),w.push(ne.x,ne.y),w.push(le.x,le.y),w.push(we.x,we.y)):(P.fromArray(B,G*S),q.fromArray(B,z*S),X.fromArray(B,$*S),w.push(P.x,P.y,P.z),w.push(q.x,q.y,q.z),w.push(X.x,X.y,X.z))}return new g.Float32BufferAttribute(w,S)}function Fe(k,T){const B=[];for(let S=0,w=0,D=k.length;S<D;S+=3,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function We(k,T){const B=[];for(let S=0,w=0,D=k.length;S<D;S+=2,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function ze(k,T){const B=T.array,S=T.itemSize,w=new B.constructor(k.length*S);let D=0,F=0;for(let G=0,z=k.length;G<z;G++){D=k[G]*S;for(let $=0;$<S;$++)w[F++]=B[D++]}return new g.Float32BufferAttribute(w,S)}const Ke=new g.Vector3,O=new g.Vector3;function Y(k,T,B){const S=[],w={};for(let F=0,G=k.length;F<G;F+=3){const z=k[F],$=k[F+1],re=k[F+2],pe=new Ts(z,$,re);P.fromArray(T,z*3),q.fromArray(T,$*3),X.fromArray(T,re*3),O.subVectors(X,q),Ke.subVectors(P,q),O.cross(Ke),O.normalize(),pe.normal.copy(O),w[z]===void 0&&(w[z]=[]),w[$]===void 0&&(w[$]=[]),w[re]===void 0&&(w[re]=[]),w[z].push(pe.normal),w[$].push(pe.normal),w[re].push(pe.normal),S.push(pe)}const D=[];for(let F=0,G=S.length;F<G;F++){const z=S[F],$=V(w[z.a],z.normal,B),re=V(w[z.b],z.normal,B),pe=V(w[z.c],z.normal,B);P.fromArray(T,z.a*3),q.fromArray(T,z.b*3),X.fromArray(T,z.c*3),D.push($.x,$.y,$.z),D.push(re.x,re.y,re.z),D.push(pe.x,pe.y,pe.z)}return new g.Float32BufferAttribute(D,3)}function V(k,T,B){const S=new g.Vector3;if(B===0)S.copy(T);else for(let w=0,D=k.length;w<D;w++)k[w].angleTo(T)<B&&S.add(k[w]);return S.normalize()}function ie(k){const T=[];for(let B=0,S=k.length;B<S;B+=3)T.push(new g.Color(k[B],k[B+1],k[B+2]));return T}function de(k){const T=new g.Color;for(let B=0;B<k.count;B++)T.fromBufferAttribute(k,B),g.ColorManagement.colorSpaceToWorking(T,g.SRGBColorSpace),k.setXYZ(B,T.r,T.g,T.b)}function Le(k,T,B,S,w){const D=[],F=w===!0?0:Math.PI;for(let ve=0,Me=S.length;ve<Me;ve++){let ye=ve===0?0:B[ve-1];ye=w===!0?ye:F-ye;const Be=new g.Vector3;Be.setFromSphericalCoords(T,ye,0),D.push(Be)}const G=k.index,z=k.attributes.position,$=new g.BufferAttribute(new Float32Array(k.attributes.position.count*3),3),re=new g.Vector3,pe=new g.Color;for(let ve=0;ve<G.count;ve++){const Me=G.getX(ve);re.fromBufferAttribute(z,Me);let ye,Be,fe=1;for(let _e=1;_e<D.length;_e++){ye=_e-1,Be=_e;const ke=D[ye],Ge=D[Be];if(w===!0){if(re.y<=ke.y&&re.y>Ge.y){fe=Math.abs(ke.y-re.y)/Math.abs(ke.y-Ge.y);break}}else if(re.y>=ke.y&&re.y<Ge.y){fe=Math.abs(ke.y-re.y)/Math.abs(ke.y-Ge.y);break}}const Ne=S[ye],Pe=S[Be];pe.copy(Ne).lerp(Pe,fe),g.ColorManagement.colorSpaceToWorking(pe,g.SRGBColorSpace),$.setXYZ(Me,pe.r,pe.g,pe.b)}k.setAttribute("color",$)}const Ce=new g.TextureLoader(this.manager);if(Ce.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const ce=r(e);return c(ce)}}class ys{constructor(e){this.lexer=new Bt.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 Bs=Bt.CstParser;class ws extends Bs{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,h=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,I=e.FalseLiteral,E=e.NullLiteral,l=e.DEF,d=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(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(o)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),t.RULE("use",function(){t.CONSUME(d),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(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(I)}},{ALT:function(){t.CONSUME(E)}}])})}),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(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(E)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class Ts{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new g.Vector3}}const nt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Rs extends g.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new g.FileLoader(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(c){try{t(o.parse(c))}catch(A){r?r(A):console.error(A),o.manager.itemError(e)}},n,r)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const I=[],E=r(f,c(f),I);c(f)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(f).split(/[\s]+/);const d=parseInt(l[1]);isNaN(d)&&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<d;C++)l=c(f).split(/[\s]+/),n(l,C*p,E);return I}function n(f,I,E){if(E.type==="ENDSITE")return;const l={time:I,position:new g.Vector3,rotation:new g.Quaternion,scale:new g.Vector3(1,1,1)};E.frames.push(l);const d=new g.Quaternion,p=new g.Vector3(1,0,0),C=new g.Vector3(0,1,0),m=new g.Vector3(0,0,1);for(let y=0;y<E.channels.length;y++)switch(E.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":d.setFromAxisAngle(p,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Yrotation":d.setFromAxisAngle(C,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Zrotation":d.setFromAxisAngle(m,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);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<E.children.length;y++)n(f,I,E.children[y])}function r(f,I,E){const l={name:"",type:"",frames:[]};E.push(l);let d=I.split(/[\s]+/);d[0].toUpperCase()==="END"&&d[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=d[1],l.type=d[0].toUpperCase()),c(f)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),d=c(f).split(/[\s]+/),d[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+d[0]),d.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const p=new g.Vector3(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[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"){d=c(f).split(/[\s]+/),d[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(d[1]);l.channels=d.splice(2,C),l.children=[]}for(;;){const C=c(f);if(C==="}")return l;l.children.push(r(f,C,E))}}function o(f,I){const E=new g.Bone;if(I.push(E),E.position.add(f.offset),E.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)E.add(o(f.children[l],I));return E}function s(f){const I=[];for(let E=0;E<f.length;E++){const l=f[E];if(l.type==="ENDSITE")continue;const d=[],p=[],C=[],m=[];for(let y=0;y<l.frames.length;y++){const Q=l.frames[y];d.push(Q.time),p.push(Q.position.x+l.offset.x),p.push(Q.position.y+l.offset.y),p.push(Q.position.z+l.offset.z),C.push(Q.rotation.x),C.push(Q.rotation.y),C.push(Q.rotation.z),C.push(Q.rotation.w),m.push(Q.scale.x),m.push(Q.scale.y),m.push(Q.scale.z)}A.animateBonePositions&&I.push(new g.VectorKeyframeTrack(l.name+".position",d,p)),A.animateBoneRotations&&I.push(new g.QuaternionKeyframeTrack(l.name+".quaternion",d,C)),A.animateBoneScales&&I.push(new g.VectorKeyframeTrack(l.name+".scale",d,m))}return new g.AnimationClip("animation",-1,I)}function c(f){let I;for(;(I=f.shift().trim()).length===0;);return I}const A=this,a=e.split(/[\r\n]+/g),h=t(a),u=[];o(h[0],u);const b=s(h);return{skeleton:new g.Skeleton(u),clip:b}}}let yt;async function vs(i,e){yt||(yt=new Cs),yt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(qn(i,n))));const t=await yt.loadAsync(e);return yt.manager.setURLModifier(n=>n),t}let Jt;async function Qs(i,e){Jt||(Jt=new Rs);const t=cn(i,e);return await Jt.parse(t)}function ks(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof se.Bone&&n.push(o)});const r=new se.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class On{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const Xt={},Zt={};class Ss extends Rt{comment=null;constructor(e){super(e)}async asyncInit(e){const t=await Hn(e),n=new DOMParser,r=cn(t,"CATALOG.XML"),o=n.parseFromString(r,"application/xml");if(o.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const s="http://acerola3d.sourceforge.jp/a3/catalog",c=o.getElementsByTagNameNS(s,"c");c[0]&&(this.comment=c[0].textContent);const A=o.getElementsByTagNameNS(s,"a"),a={};let h;for(const u of Array.from(A)){const b=u.getAttribute("an");if(b){h||(h=b);let f;const I=u.getAttribute("bvh");if(I){const R=t.zipUrl+"!"+I;Xt[R]||(Xt[R]=await Qs(t,I)),f=ks(Xt[R]),f&&f.clip.tracks.forEach(N=>{N.setInterpolation(se.InterpolateDiscrete)})}else f=new On;const E={};f.skeleton.bones.forEach(R=>{E[R.name]=R});const l=u.getAttribute("scale"),d=l?Number(l):1,p=u.getAttribute("offset"),C=new Z;if(p){const R=p.split(" ");C.set(Number(R[0]),Number(R[1]),Number(R[2]))}const m=u.getAttribute("rot"),y=new Z;if(m){const R=m.split(" ");y.set(Number(R[0]),Number(R[1]),Number(R[2]))}const Q={},_=u.getElementsByTagNameNS(s,"p");for(const R of Array.from(_)){const N=R.getAttribute("name"),L=R.getAttribute("wrl");if(N&&L){const W=t.zipUrl+"!"+L;Zt[W]||(Zt[W]=await vs(t,L)),Q[N]=Zt[W].clone(!0)}}const j=new se.Object3D;j.add(f.skeleton.bones[0]),f instanceof On?Object.values(Q).forEach(R=>{j.add(R)}):$i(j,Q),j.scale.set(d,d,d),y.scale(Math.PI/180),j.setRotationFromEuler(new se.Euler(y.x,y.y,y.z,"YXZ")),j.position.add(C),j.traverse(R=>{R.userData.a3js={objectA3:this}});let v,M=!0;const x=u.getElementsByTagNameNS(s,"s");if(x[0]){const R=x[0].getAttribute("file"),N=x[0].getAttribute("type")||"PointSound",L=x[0].getAttribute("loop")||"false",W=x[0].getAttribute("gain")||"1.0",J=x[0].getAttribute("offset")||"0.0 0.0 0.0",K=x[0].getAttribute("direction")||"0.0 0.0 1.0";M=(x[0].getAttribute("continue")||"true")==="true";const te=J.split(" ").map(q=>Number(q)),ue=new Z(te[0],te[1],te[2]),oe=K.split(" ").map(q=>Number(q)),ae=new Z(oe[0],oe[1],oe[2]),Ae=N==="PointSound"||N==="ConeSound"?"positional":"audio",P=N==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(R){const q=qn(t,R),X=URL.createObjectURL(q),ne={type:Ae,loop:L==="true",volume:Number(W),positional:{directional:P}};v=await new at(X,ne).ready,v.setLocation(ue),v.lookAt(ae),URL.revokeObjectURL(X),j.add(v.object)}}a[b]={name:b,shape:{root:j,bones:E,skeleton:f.skeleton},motion:new un(f.clip,b),sound:v,soundContinue:M}}}return h&&this.syncInit(h,a),this}}function $i(i,e){if(Tr(i)){const t=e[i.name];t&&i.add(t)}i.children&&i.children.forEach(t=>{$i(t,e)})}class Ls extends Oe{constructor(e){super(e)}initObject(e){return e}}class _s extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(r,s)}}class xs extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(r,s)}}class Ns extends Oe{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 Ds extends Oe{constructor(e){super(e)}initObject(e){const t=new se.PlaneGeometry(1,1),n=new se.TextureLoader().load(e),r=new se.MeshBasicMaterial({map:n});return new se.Mesh(t,r)}}class Fs extends Oe{constructor(e){super(e)}initObject(e){return new Yn(e)}}const er={touchDevice:navigator.maxTouchPoints>0};class tr extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...er,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
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 m}
|
|
|
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",o=>{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(o.pointerId)}),t.addEventListener("pointermove",o=>{if(!this._leftActive)return;const c=o.clientX-this._leftCenter.x,A=o.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",o=>{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(o.pointerId)}),n.addEventListener("pointermove",o=>{if(!this._rightActive)return;const c=o.clientX-this._rightCenter.x,A=o.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 r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const s=this.shadowRoot.querySelector(".btn.right");s&&(s.addEventListener("pointerdown",()=>{this.rightButton=!0}),s.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.option.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(o=>{o.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(o=>{o.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){}disconnectedCallback(){window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e){return this.canvas.alert(e)}prompt(e){return this.canvas.prompt(e)}}customElements.define("game-canvas-a3",Wi);const Vi={offset:.01,auto:!0,height:1.5,radius:.3};class Rs{trans;objectA3;completeOption;controller;bodyDesc;body;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOption={...Vi,...e},this.trans=new He,this.capsuleCenter=new Ae,this.nextLocation=new Ae,this.tmpV1=new Ae,this.tmpV2=new Ae}init(e,t){if(this.trans.set(e),this.completeOption.auto){const n=new se.Box3().setFromObject(t.object),r=new se.Vector3;n.getSize(r),this.completeOption.radius=Math.max(r.x,r.z)/2,this.completeOption.height=r.y-this.completeOption.radius*2,n.getCenter(r),this.capsuleCenter.set(r)}this.bodyDesc=Ge.RigidBodyDesc.kinematicPositionBased(),this.colliderDesc=Ge.ColliderDesc.capsule(this.completeOption.height,this.completeOption.radius),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.trans.set(t),this.bodyDesc.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.completeOption.offset),this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle))}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.body?this.body.setNextKinematicTranslation(e):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.body?this.body.setRotation(e,!1):this.bodyDesc?.setRotation(e),this.trans.loc.set(e)}setQuatNow(e){this.body?this.body.setRotation(e,!1):this.bodyDesc?.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){}setAngvel(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.body||!this.controller||!this.collider)return;this.trans.quat.set(this.body.rotation()),this.tmpV1.set(this.body.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.x,t.y,t.z),this.body.setNextKinematicTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.trans.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const Yi={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};class Qs{opt;trans;motion;constructor(e){this.opt={...Yi,...e},this.trans=new Ji(this),this.motion=new Xi(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 Ji{cc;trans;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.trans=new He}init(e,t){this.trans.set(e),this.objectA3=t,this.chassisBodyDesc=new Ge.RigidBodyDesc(Ge.RigidBodyType.Dynamic),this.chassisColliderDesc=Ge.ColliderDesc.cuboid(this.cc.opt.chassisWidth/2,this.cc.opt.chassisHeight/2,this.cc.opt.chassisLength/2),this.chassisColliderDesc.setMass(this.cc.opt.mass),this.chassisColliderDesc.setFriction(this.cc.opt.chassisFriction)}addOneselfToPhysics(e){if(this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&it.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),it.delete(this.chassisCollider.handle))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}setAngvel(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}update(e){this.controller?.updateVehicle(e),this.chassisBody&&this.trans.loc.set(this.chassisBody.translation()),this.chassisBody&&this.trans.quat.set(this.chassisBody.rotation())}}class Xi{cm;name;playCount;time;finishListener;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){if(!this.cm.trans.chassisBody)return{};if(!this.cm.trans.controller)return{};const t=new Ae(this.cm.trans.chassisBody.translation()),r=new be(this.cm.trans.chassisBody.rotation()).clone().conjugate(),s=new Ae(this.cm.trans.chassisBody.translation());s.add(this.cm.opt.chassisOffset),s.sub(t);const o=new be(this.cm.trans.chassisBody.rotation());o.mul(r);const c=new be,A=new Ae,a=new be;{const l=new Ae(this.cm.opt.wheelFrontAxle),h=new Ae(-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,g=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(g/2),l.y*Math.sin(g/2),l.z*Math.sin(g/2),Math.cos(g/2)),a.mul(c)}const d=new Ae,u=new be;{const l=new Ae(this.cm.opt.wheelFrontAxle),h=new Ae(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,g=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(g/2),l.y*Math.sin(g/2),l.z*Math.sin(g/2),Math.cos(g/2)),u.mul(c)}const b=new Ae,f=new be;{const l=new Ae(this.cm.opt.wheelRearAxle),h=new Ae(-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,g=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(g/2),l.y*Math.sin(g/2),l.z*Math.sin(g/2),Math.cos(g/2)),f.mul(c)}const m=new Ae,E=new be;{const l=new Ae(this.cm.opt.wheelRearAxle),h=new Ae(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,g=this.cm.trans.controller.wheelRotation(3)||0;m.set(h),m.sub(0,p,0),E.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(g/2),l.y*Math.sin(g/2),l.z*Math.sin(g/2),Math.cos(g/2)),E.mul(c)}return{chassis:{loc:s,quat:o},frontRight:{loc:d,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:m,quat:E},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=bs;exports.ActionObject=It;exports.AvatarController=xr;exports.Box=ys;exports.Camera=Mn;exports.Canvas=xi;exports.CarControl=Qs;exports.CarMotion=Xi;exports.CarTransformer=Ji;exports.CharactorTransformer=Rs;exports.ClipMotion=sn;exports.ControllerBase=Qt;exports.DefaultTransformer=Et;exports.FixedTransformer=sr;exports.FollowAvatarController=Lr;exports.GLTF=No;exports.GameCanvas=Wi;exports.GeneralCamera=bt;exports.HTML=vs;exports.Image=Ts;exports.ObjectA3=_e;exports.OrbitController=Pn;exports.Quat=be;exports.RapierPhysicsEngine=mt;exports.RapierPhysicsWorld=nn;exports.Scene=On;exports.Sound=nt;exports.Sphere=Bs;exports.StandardLights=ws;exports.Test=Go;exports.Text3D=zo;exports.ThreeJS=Cs;exports.Transform=He;exports.Vec3=Ae;exports.Window=Di;exports.asyncSleep=Cr;exports.collisionMap=it;exports.deepMerge=Rt;exports.defaultCanvasOption=_i;exports.defaultCarControlOption=Yi;exports.defaultCharactorTransOption=Vi;exports.defaultGameCanvasOption=zi;exports.defaultWindowOption=Ni;exports.getQuatOfLookAt=et;exports.initFont=Ko;exports.initPhysics=br;exports.initSound=kr;exports.vec3EulerToQuat=At;
|
|
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 h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.leftJoystick.x=h/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 h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}n.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.rightJoystick.x=h/this._maxDistance,this.rightJoystick.y=-(u/this._maxDistance)}),n.addEventListener("pointerup",()=>{this._rightActive=!1,n.style.transform="translate(-50%, -50%)",this.rightJoystick.x=0,this.rightJoystick.y=0});const r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0}),o.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(s=>{s.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(s=>{s.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){this._ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="50px",o.style.left="200px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="50px",s.style.right="200px"}else{const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="200px",o.style.left="50px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="200px",s.style.right="50px"}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e,t){return this.canvas.alert(e,t)}prompt(e,t){return this.canvas.prompt(e,t)}}customElements.define("game-canvas-a3",tr);const nr={offset:.01,auto:!0,height:1.5,radius:.3};class Os{trans;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOptions={...nr,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,r=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(r),o.quaternion.set(r.x,r.y,r.z,r.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&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),it.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 Z),e.set(0,0,0),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),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 ir={auto:!0,height:1.5,radius:.3};class Ms{trans;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;physicsWorld;constructor(e={}){this.completeOptions={...ir,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,r=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(r),o.quaternion.set(r.x,r.y,r.z,r.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&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle)),this.physicsWorld=void 0}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 Z),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 Z),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 Z(this.body.translation());t.sub(this.capsuleCenter),this.trans.loc.set(t),this.trans.quat.set(this.body.rotation())}}const rr={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 Ps{opt;trans;motion;constructor(e){this.opt={...rr,...e},this.trans=new or(this),this.motion=new sr(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 or{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&&it.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),it.delete(this.chassisCollider.handle))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new Z),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),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 Z;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new Z(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 sr{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 Z(this.cm.trans.chassisBody.translation()),r=new Te(this.cm.trans.chassisBody.rotation()).clone().conjugate(),o=new Z(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(r);const c=new Te,A=new Z,a=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(-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(d),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 h=new Z,u=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(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;h.set(d),h.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 Z,f=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(-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(d),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 I=new Z,E=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(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;I.set(d),I.sub(0,p,0),E.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)),E.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:h,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:I,quat:E},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=Ss;exports.ActionObject=Rt;exports.AvatarController=Ur;exports.AvatarController2=Hr;exports.Box=_s;exports.Camera=Kn;exports.Canvas=Ui;exports.CarControl=Ps;exports.CarMotion=sr;exports.CarTransformer=or;exports.CharacterTransformer=Os;exports.CharacterTransformer2=Ms;exports.ClipMotion=un;exports.ControllerBase=xt;exports.DefaultTransformer=wt;exports.FixedTransformer=Pn;exports.FollowTransformer=mr;exports.GLTF=qo;exports.GameCanvas=tr;exports.GeneralCamera=vt;exports.HTML=Fs;exports.Image=Ds;exports.ObjectA3=Oe;exports.OrbitController=Vn;exports.Quat=Te;exports.RapierPhysicsEngine=Tt;exports.RapierPhysicsWorld=An;exports.Scene=zn;exports.Sound=at;exports.Sphere=xs;exports.StandardLights=Ns;exports.Test=Jo;exports.Text3D=ns;exports.ThreeJS=Ls;exports.Transform=qe;exports.Vec3=Z;exports.Window=Hi;exports.asyncSleep=Lr;exports.collisionMap=it;exports.deepMerge=_t;exports.defaultCanvasOptions=Gi;exports.defaultCarControlOptions=rr;exports.defaultCharacterTrans2Options=ir;exports.defaultCharacterTransOptions=nr;exports.defaultFollowTransformerOptions=Un;exports.defaultGameCanvasOptions=er;exports.defaultWindowOptions=ji;exports.getQuatOfLookAt=At;exports.initFont=ts;exports.initPhysics=Sr;exports.initSound=Pr;exports.vec3EulerToQuat=dt;
|
|
293
293
|
//# sourceMappingURL=a3js.cjs.js.map
|