a3js 0.0.31 → 0.0.32
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 +40 -40
- package/dist/a3js.cjs.js.map +1 -1
- package/dist/a3js.es.js +2428 -2361
- 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 Xi=Object.create;var hn=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var nr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $i(e))!tr.call(i,r)&&r!==t&&hn(i,r,{get:()=>e[r],enumerable:!(n=Zi(e,r))||n.enumerable});return i};var ir=(i,e,t)=>(t=i!=null?Xi(er(i)):{},nr(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 rr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const se=rr(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 gt{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 or{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 sr extends gt{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 Ar(i){return i.type==="RoundedBoxGeometry"}function cr(i){return i.type==="BoxGeometry"}function lr(i){return i.type==="SphereGeometry"}function ur(i){return i.type==="IcosahedronGeometry"}function hr(i){return i.type==="CylinderGeometry"}function dr(i){return i.type==="CapsuleGeometry"}function fr(i){return i.isBone===!0}function pr(i){return i.isPerspectiveCamera===!0}let Ge;const nt=new Map;class Et{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Et.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Et.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=nt.get(t),o=nt.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=mr(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=gr(r),A=fn(r.geometry);break;case"convex_hull":c=Er(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&&nt.set(n.handle,this.objectA3)}))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),nt.delete(t.handle)})}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.trans.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}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 gr(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 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;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 mr(i){if(Ar(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(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;return{colliderDesc:Ge.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(lr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ge.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}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?.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(dr(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 Et;async function Ir(){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 br(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 Cr(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 vt(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=vt(i[n],e[n]):t[n]=e[n];return t}const wr=new se.SphereGeometry,Tr=new se.MeshStandardMaterial({color:16711680});let Rr=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 Rr.clone()}initTransformer(e){return new gt}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 gt);else if(e==="Interpolation")this.setTransformer(new xn);else if(e==="Billboard")this.setTransformer(new sr(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 vr(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 vr{message;dir;offsetTop;offsetRight;offsetLeft;offsetBottom;constructor(e){this.message=e,this.dir="RIGHT",this.offsetTop={x:0,y:2},this.offsetRight={x:1,y:1},this.offsetLeft={x:-1,y:1},this.offsetBottom={x:0,y:0}}}class mt 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.object.remove(this.currentAction.shape.root),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&this.object.remove(this.currentAction.shape.root),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,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?(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.currentAction?.shape.root&&this.object.remove(this.currentAction?.shape.root),this.emoteAction=void 0,this.stateAction&&(this.object.add(this.stateAction.shape.root),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const 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;constructor(){this.name="dummy",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}update(e){return{}}}class Fn{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 mt))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 mt))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 On 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 Mn 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 Qr={offset:{x:0,y:5,z:-10}};class kr extends Qt{option;_offset;constructor(e){super(),this.option={...Qr,...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 Sr={offset:{x:0,y:5,z:-10}};class Lr extends Qt{option;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_offset;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e){super(),this.option={...Sr,...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)}}const _r={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function xr(){try{st.listener.context.state!=="running"&&await st.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class st extends _e{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;config;sound;constructor(e,t={}){super(),this.config=vt(_r,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.config.type==="positional"){const t=new se.PositionalAudio(st.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(st.listener);t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{st.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.play()}}class Pn{scene;camera;controller;constructor(e){this.scene=new Fn,this.camera=e,this.camera.setAudioListener(st.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new Mn(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 It extends On{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){pr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Gn 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 Un{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 Hn 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))===jn){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 jn="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!==jn)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 qn 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],v=o[E+g+A]*d,k=o[m+g+c],H=o[m+g]*d;s[g]=p*B+C*v+l*k+h*H}return s}}const io=new I.Quaternion;class ro extends qn{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"},ot={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),v=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 k=0,H=B.length;k<H;k++){const Q=B[k];if(l.setX(Q,v[k*A]),A>=2&&l.setY(Q,v[k*A+1]),A>=3&&l.setZ(Q,v[k*A+2]),A>=4&&l.setW(Q,v[k*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],v=f[C],k=m[C],H=E[C],Q=l[C];if(B===void 0)continue;B.updateMatrix&&B.updateMatrix();const M=n._createAnimationTracks(B,v,k,H,Q);if(M)for(let x=0;x<M.length;x++)h.push(M[x])}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=[];ot[s.path]===ot.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(ot[s.path]){case ot.weights:a=I.NumberKeyframeTrack;break;case ot.rotation:a=I.QuaternionKeyframeTrack;break;case ot.translation:case ot.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]+"."+ot[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:qn;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 v;if(E===l)v=B.slice();else{v=new d(C/d.BYTES_PER_ELEMENT);let k=0;for(let H=0,Q=B.length;H<Q;H++){for(let M=0;M<f;M++)v[k+M]=B[H*f+M];k+=h}}return o._free(g),{name:a,count:b,itemSize:f,array:v,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,Rn=2,bo=0,Co=1,yo=10,Bo=0,Kn=9,zn=15,Wn=16,Vn=22,Yn=37,Jn=43,Xn=76,Zn=83,$n=97,ei=100,ti=103,ni=109,ii=122,ri=123,oi=131,si=132,ai=133,Ai=134,ci=137,li=138,ui=139,hi=140,di=141,fi=142,pi=145,gi=146,Ei=148,mi=152,Zt=153,wo=154,$t=155,To=156,Ii=157,bi=158,Ci=165,yi=166,Bi=1000054e3,wi=1000054001,Ti=1000054004,Ri=1000054005,on=1000066e3,vi=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 vn(i){return new TextDecoder().decode(i)}function Ro(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),te=vn(oe);if(t.keyValue[te]=g._nextUint8Array(re-oe.byteLength-1),te.match(/^ktx/i)){const he=vn(t.keyValue[te]);t.keyValue[te]=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),v=B._nextUint16(),k=B._nextUint16(),H=B._nextUint32(),Q=B._nextUint32(),M=B._nextUint32(),x=B._nextUint32(),S=[];for(let re=0,oe=Math.max(t.levelCount,1);re<oe;re++)S.push({imageFlags:B._nextUint32(),rgbSliceByteOffset:B._nextUint32(),rgbSliceByteLength:B._nextUint32(),alphaSliceByteOffset:B._nextUint32(),alphaSliceByteLength:B._nextUint32()});const D=a+B._offset,L=D+H,V=L+Q,J=V+M,q=new Uint8Array(i.buffer,i.byteOffset+D,H),X=new Uint8Array(i.buffer,i.byteOffset+L,Q),$=new Uint8Array(i.buffer,i.byteOffset+V,M),le=new Uint8Array(i.buffer,i.byteOffset+J,x);return t.globalData={endpointCount:v,selectorCount:k,imageDescs:S,endpointsData:q,selectorsData:X,tablesData:$,extendedData:le},t}let Pt,tt,en;const Gt={env:{emscripten_notify_memory_growth:function(i){en=new Uint8Array(tt.exports.memory.buffer)}}};class vo{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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3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AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIA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EEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgA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PckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMg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AEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACA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A0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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=Qi(t),u.premultiplyAlpha=!!(d&Io),u}async _createTexture(e,t={}){const n=Ro(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:v,dfdFlags:k}=A(E.buffer);self.postMessage({type:"transcode",id:E.id,data:{faces:l,width:p,height:C,hasAlpha:g,format:B,type:v,dfdFlags:k}},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(),v=E.getFaces(),k=E.getHasAlpha(),H=E.getDFDFlags(),{transcoderFormat:Q,engineFormat:M,engineType:x}=u(h,p,C,k);if(!p||!C||!B)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const S=[],D=[];for(let L=0;L<v;L++){const V=[];for(let J=0;J<B;J++){const q=[];let X,$;for(let re=0;re<g;re++){const oe=E.getImageLevelInfo(J,re,L);L===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,$=oe.origHeight):(X=oe.width,$=oe.height);let te=new Uint8Array(E.getImageTranscodedSizeInBytes(J,re,0,Q));const he=E.transcodeImage(te,J,re,L,Q,0,-1,-1);if(x===r.HalfFloatType&&(te=new Uint16Array(te.buffer,te.byteOffset,te.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!he)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");q.push(te)}const le=f(q);V.push({data:le,width:X,height:$}),D.push(le.buffer)}S.push({mipmaps:V,width:p,height:C,format:M,type:x})}return l(),{faces:S,buffers:D,width:p,height:C,hasAlpha:k,dfdFlags:H,format:M,type:x}}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],v=g.engineFormat[h?1:0],k=g.engineType[0];return{transcoderFormat:B,engineFormat:v,engineType:k}}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={[ni]:I.RGBAFormat,[ti]:I.RGFormat,[ei]:I.RedFormat,[$n]:I.RGBAFormat,[Zn]:I.RGFormat,[Xn]:I.RedFormat,[Jn]:I.RGBAFormat,[Yn]:I.RGBAFormat,[Vn]:I.RGFormat,[Wn]:I.RGFormat,[zn]:I.RedFormat,[Kn]:I.RedFormat,[ri]:I.RGBFormat,[ii]:I.RGBFormat,[mi]:I.RGBA_ETC2_EAC_Format,[Ei]: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,[bi]:I.RGBA_ASTC_4x4_Format,[Ii]:I.RGBA_ASTC_4x4_Format,[vi]:I.RGBA_ASTC_6x6_Format,[yi]:I.RGBA_ASTC_6x6_Format,[Ci]:I.RGBA_ASTC_6x6_Format,[Ai]:I.RGBA_S3TC_DXT1_Format,[ai]:I.RGBA_S3TC_DXT1_Format,[si]:I.RGB_S3TC_DXT1_Format,[oi]:I.RGB_S3TC_DXT1_Format,[li]:I.RGBA_S3TC_DXT3_Format,[ci]:I.RGBA_S3TC_DXT3_Format,[hi]:I.SIGNED_RED_RGTC1_Format,[ui]:I.RED_RGTC1_Format,[fi]:I.SIGNED_RED_GREEN_RGTC2_Format,[di]:I.RED_GREEN_RGTC2_Format,[gi]:I.RGBA_BPTC_Format,[pi]:I.RGBA_BPTC_Format,[Ri]:I.RGBA_PVRTC_4BPPV1_Format,[wi]:I.RGBA_PVRTC_4BPPV1_Format,[Ti]:I.RGBA_PVRTC_2BPPV1_Format,[Bi]:I.RGBA_PVRTC_2BPPV1_Format},ut={[ni]:I.FloatType,[ti]:I.FloatType,[ei]:I.FloatType,[$n]:I.HalfFloatType,[Zn]:I.HalfFloatType,[Xn]:I.HalfFloatType,[Jn]:I.UnsignedByteType,[Yn]:I.UnsignedByteType,[Vn]:I.UnsignedByteType,[Wn]:I.UnsignedByteType,[zn]:I.UnsignedByteType,[Kn]:I.UnsignedByteType,[ri]:I.UnsignedInt5999Type,[ii]:I.UnsignedInt101111Type,[mi]:I.UnsignedByteType,[Ei]:I.UnsignedByteType,[Zt]:I.UnsignedByteType,[Zt]:I.UnsignedByteType,[$t]:I.UnsignedByteType,[$t]:I.UnsignedByteType,[on]:I.HalfFloatType,[bi]:I.UnsignedByteType,[Ii]:I.UnsignedByteType,[vi]:I.HalfFloatType,[yi]:I.UnsignedByteType,[Ci]:I.UnsignedByteType,[Ai]:I.UnsignedByteType,[ai]:I.UnsignedByteType,[si]:I.UnsignedByteType,[oi]:I.UnsignedByteType,[li]:I.UnsignedByteType,[ci]:I.UnsignedByteType,[hi]:I.UnsignedByteType,[ui]:I.UnsignedByteType,[fi]:I.UnsignedByteType,[di]:I.UnsignedByteType,[gi]:I.UnsignedByteType,[pi]:I.UnsignedByteType,[Ri]:I.UnsignedByteType,[wi]:I.UnsignedByteType,[Ti]:I.UnsignedByteType,[Bi]: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 vo;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=Qi(i),s.needsUpdate=!0,Promise.resolve(s)}function Qi(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===Co?e.transferFunction===Rn?I.SRGBColorSpace:I.LinearSRGBColorSpace:e.colorPrimaries===yo?e.transferFunction===Rn?Qo:ko:(e.colorPrimaries===bo||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),I.NoColorSpace)}class sn{name;time;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}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++);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 ki=(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,v,k){var H=h.exports.sbrk,Q=g+3&-4,M=H(Q*B),x=H(v.length),S=new Uint8Array(h.exports.memory.buffer);S.set(v,x);var D=p(M,g,B,x,v.length);if(D==0&&k&&k(M,Q,B),C.set(S.subarray(M,M+g*B)),H(M-H(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(h){var p={object:new Worker(h),pending:0,requests:{}};return p.object.onmessage=function(C){var 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 v=u[0],k=1;k<u.length;++k)u[k].pending<v.pending&&(v=u[k]);return new Promise(function(H,Q){var M=new Uint8Array(C),x=++b;v.pending+=h,v.requests[x]={resolve:H,reject:Q},v.object.postMessage({id:x,count:h,size:p,source:M,mode:g,filter:B},[M.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,v){A(s,s.exports[d[B]],h,p,C,g,s.exports[a[v]])},decodeGltfBufferAsync:function(h,p,C,g,B){return u.length>0?E(h,p,C,d[g],a[B]):o.then(function(){var v=new Uint8Array(h*p);return A(s,s.exports[d[g]],v,h,p,C,s.exports[a[B]]),v})}}})();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 Si(i={}){const e={...xo,...i};let t=new Hn;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(ki),an=t}let an=new Hn;an.setMeshoptDecoder(ki);class No extends mt{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)}}),t?this.syncInit(t,n,s):(t="dummy",n.dummy={name:"dummy",shape:r,motion:new pn},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},this.syncInit(s,o)}return this}}const Li={camera:void 0,antialias:!1,transparent:!1};class _i 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 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+AX5gAABgBX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ECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAX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AgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAy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ABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF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AAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",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=`
|
|
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.option={...
|
|
16
|
+
`,this.option={..._i,...e},this.option.camera)this.camera3js=this.option.camera.camera,this.camera=this.option.camera;else{const n=new se.PerspectiveCamera(75,2,.1,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new bt(this.camera3js)}this.base=new Gn(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.option.antialias,alpha:this.option.transparent};this.renderer=new se.WebGLRenderer(t),Li({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 Hn,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),Do(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Fo(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,s=(1-t.y)/2*n.y;return{x:r,y:s}}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 s=r.sub(this.camera3js.position).normalize();return new Ae(this.camera3js.position.clone().add(s.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(n),this.worldToScreen(U.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),s=new se.Vector3(r.x,r.y,r.z);return r.set(s.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof bt){const t=new se.Raycaster,n=new se.Vector2,r=e.target.getBoundingClientRect(),s=e.clientX-r.left,o=e.clientY-r.top;n.x=2*(s/r.width)-1,n.y=-2*(o/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,r.appendChild(s);const o=document.createElement("button");o.textContent="OK!",r.appendChild(o),this.shadowRoot.appendChild(r),o.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 s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,r.appendChild(s);const o=document.createElement("input");o.setAttribute("type","text"),r.appendChild(o);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(o.value)})})}}customElements.define("canvas-a3",xi);function Do(i){return i.isPerspectiveCamera===!0}function Fo(i){return i.isOrthographicCamera===!0}const Ni={width:600,height:300,camera:void 0};class Di 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;option;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;constructor(e=600,t=300,n={}){if(super(),this.option={...Ni,...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.option.camera)this.camera3js=this.option.camera.camera,this.camera=this.option.camera;else{const s=new se.PerspectiveCamera(75,e/t,.1,1e3);s.aspect=e/t,this.camera3js=s,this.camera=new
|
|
60
|
+
`,this.option.camera)this.camera3js=this.option.camera.camera,this.camera=this.option.camera;else{const s=new se.PerspectiveCamera(75,e/t,.1,1e3);s.aspect=e/t,this.camera3js=s,this.camera=new bt(this.camera3js)}this.base=new Gn(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,Li({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 Hn,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",s=>{this.controller?.mouseDown(s)}),this._css2DCanvas.addEventListener("mouseup",s=>{this.controller?.mouseUp(s)}),this._css2DCanvas.addEventListener("mousemove",s=>{this.controller?.mouseMove(s)}),this._css2DCanvas.addEventListener("click",s=>{this.controller?.mouseClick(s)}),this._css2DCanvas.addEventListener("mouseenter",s=>{this.controller?.mouseEnter(s)}),this._css2DCanvas.addEventListener("mouseleave",s=>{this.controller?.mouseLeave(s)}),this._css2DCanvas.addEventListener("wheel",s=>{this.controller?.mouseWheel(s)}),this._css2DCanvas.addEventListener("touchstart",s=>{this.controller?.touchStart(s)}),this._css2DCanvas.addEventListener("touchmove",s=>{this.controller?.touchMove(s)}),this._css2DCanvas.addEventListener("touchend",s=>{this.controller?.touchEnd(s)}),this._css2DCanvas.addEventListener("touchcancel",s=>{this.controller?.touchCancel(s)}),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=window.devicePixelRatio||1,s=Math.floor(t*r),o=Math.floor(n*r);(this._canvas.width!==s||this._canvas.height!==o)&&(this._canvas.width=s,this._canvas.height=o,Oo(this.camera3js)?(this.camera3js.aspect=s/o,this.camera3js.updateProjectionMatrix()):Mo(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(s,o),this.css2DRenderer.setSize(s,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,s=this._borderSize;let o="";r<s?o+="n":r>t.height-s&&(o+="s"),n<s?o+="w":n>t.width-s&&(o+="e"),this._resizeDir=o,this.style.cursor=this._cursorFromDir(o)};_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,s=(1-t.y)/2*n.y;return{x:r,y:s}}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 s=r.sub(this.camera3js.position).normalize();return new Ae(this.camera3js.position.clone().add(s.multiplyScalar(n)))}cameraToScreen(e){const n=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(n),this.worldToScreen(U.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),s=new se.Vector3(r.x,r.y,r.z);return r.set(s.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof bt){const t=new se.Raycaster,n=new se.Vector2,r=e.target.getBoundingClientRect(),s=e.clientX-r.left,o=e.clientY-r.top;n.x=2*(s/r.width)-1,n.y=-2*(o/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const d=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:d})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,r.appendChild(s);const o=document.createElement("button");o.textContent="OK!",r.appendChild(o),this.shadowRoot.appendChild(r),o.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 s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,r.appendChild(s);const o=document.createElement("input");o.setAttribute("type","text"),r.appendChild(o);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(o.value)})})}}customElements.define("window-a3",Di);function Oo(i){return i.isPerspectiveCamera===!0}function Mo(i){return i.isOrthographicCamera===!0}const Po=`
|
|
61
61
|
color: white;
|
|
62
62
|
padding: 5px 10px;
|
|
63
63
|
background: rgba(0, 0, 0, 0.6);
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
font-family: sans-serif;
|
|
67
67
|
font-size: 14px;
|
|
68
68
|
pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
|
|
69
|
-
`,kn={testMode:!0};class Go extends _e{constructor(e={}){super(e);const t={...kn,...e};this.setTransformer(new Sn(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=Po;const s=new
|
|
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 Rt=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);Rt=new Di(JSON.parse(n))}else Rt=await new Uo().loadAsync(i)}class zo extends _e{initObject(e){let t;if(Nn(e)?t=e:t="ERROR",Rt==null){const n=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,r)}else{const n={font:Rt,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),Fi=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(O,Y){for(var K=0,ie=Y.length,ge=O.length;K<ie;K++,ge++)O[ge]=Y[K];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 s(O){for(var Y=[],K=Object.keys(O),ie=0;ie<K.length;ie++)Y.push(O[K[ie]]);return Y}i.values=s;function o(O,Y){for(var K=[],ie=r(O),ge=0;ge<ie.length;ge++){var Re=ie[ge];K.push(Y.call(null,O[Re],Re))}return K}i.mapValues=o;function c(O,Y){for(var K=[],ie=0;ie<O.length;ie++)K.push(Y.call(null,O[ie],ie));return K}i.map=c;function A(O){for(var Y=[],K=0;K<O.length;K++){var ie=O[K];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 d(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}i.last=d;function u(O,Y){if(Array.isArray(O))for(var K=0;K<O.length;K++)Y.call(null,O[K],K);else if(J(O))for(var ie=r(O),K=0;K<ie.length;K++){var ge=ie[K],Re=O[ge];Y.call(null,Re,ge)}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 m(O){return O instanceof Function}i.isFunction=m;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 h(O,Y){var K=[];if(Array.isArray(O))for(var ie=0;ie<O.length;ie++){var ge=O[ie];Y.call(null,ge)&&K.push(ge)}return K}i.filter=h;function p(O,Y){return h(O,function(K){return!Y(K)})}i.reject=p;function C(O,Y){for(var K=Object.keys(O),ie={},ge=0;ge<K.length;ge++){var Re=K[ge],T=O[Re];Y(T)&&(ie[Re]=T)}return ie}i.pick=C;function g(O,Y){return J(O)?O.hasOwnProperty(Y):!1}i.has=g;function B(O,Y){return H(O,function(K){return K===Y})!==void 0}i.contains=B;function v(O){for(var Y=[],K=0;K<O.length;K++)Y.push(O[K]);return Y}i.cloneArr=v;function k(O){var Y={};for(var K in O)Object.prototype.hasOwnProperty.call(O,K)&&(Y[K]=O[K]);return Y}i.cloneObj=k;function H(O,Y){for(var K=0;K<O.length;K++){var ie=O[K];if(Y.call(null,ie))return ie}}i.find=H;function Q(O,Y){for(var K=[],ie=0;ie<O.length;ie++){var ge=O[ie];Y.call(null,ge)&&K.push(ge)}return K}i.findAll=Q;function M(O,Y,K){for(var ie=Array.isArray(O),ge=ie?O:s(O),Re=ie?[]:r(O),T=K,y=0;y<ge.length;y++)T=Y.call(null,T,ge[y],ie?y:Re[y]);return T}i.reduce=M;function x(O){return p(O,function(Y){return Y==null})}i.compact=x;function S(O,Y){Y===void 0&&(Y=function(ie){return ie});var K=[];return M(O,function(ie,ge){var Re=Y(ge);return B(K,Re)?ie:(K.push(Re),ie.concat(ge))},[])}i.uniq=S;function D(O){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(O,ge)}i.partial=D;function L(O){return Array.isArray(O)}i.isArray=L;function V(O){return O instanceof RegExp}i.isRegExp=V;function J(O){return O instanceof Object}i.isObject=J;function q(O,Y){for(var K=0;K<O.length;K++)if(!Y(O[K],K))return!1;return!0}i.every=q;function X(O,Y){return p(O,function(K){return B(Y,K)})}i.difference=X;function $(O,Y){for(var K=0;K<O.length;K++)if(Y(O[K]))return!0;return!1}i.some=$;function le(O,Y){for(var K=0;K<O.length;K++)if(O[K]===Y)return K;return-1}i.indexOf=le;function re(O,Y){var K=v(O);return K.sort(function(ie,ge){return Y(ie)-Y(ge)}),K}i.sortBy=re;function oe(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var K={},ie=0;ie<O.length;ie++)K[O[ie]]=Y[ie];return K}i.zipObject=oe;function te(O){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],Re=r(ge),T=0;T<Re.length;T++){var y=Re[T];O[y]=ge[y]}return O}i.assign=te;function he(O){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],Re=r(ge),T=0;T<Re.length;T++){var y=Re[T];g(O,y)||(O[y]=ge[y])}return O}i.assignNoOverwrite=he;function P(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return he.apply(void 0,t([{}],O))}i.defaults=P;function j(O,Y){var K={};return u(O,function(ie){var ge=Y(ie),Re=K[ge];Re?Re.push(ie):K[ge]=[ie]}),K}i.groupBy=j;function W(O,Y){for(var K=k(O),ie=r(Y),ge=0;ge<ie.length;ge++){var Re=ie[ge],T=Y[Re];K[Re]=T}return K}i.merge=W;function Z(){}i.NOOP=Z;function ne(O){return O}i.IDENTITY=ne;function ce(O){for(var Y=[],K=0;K<O.length;K++){var ie=O[K];Y.push(ie!==void 0?ie:void 0)}return Y}i.packArray=ce;function Ce(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=Ce;function me(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=me;function Ne(){return typeof Map=="function"}i.isES2015MapSupported=Ne;function je(O){return O[O.length-1]}i.peek=je;function Ve(O){var Y=new Date().getTime(),K=O(),ie=new Date().getTime(),ge=ie-Y;return{time:ge,value:K}}i.timer=Ve;function Ue(O){function Y(){}Y.prototype=O;var K=new Y;function ie(){return typeof K.bar}return ie(),ie(),O}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(`
|
|
69
|
+
`,kn={testMode:!0};class Go extends _e{constructor(e={}){super(e);const t={...kn,...e};this.setTransformer(new Sn(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=Po;const s=new Un(r);return s.position.set(0,.8,0),n.add(s),n}initTransformer(e){const t=Rt(kn,e);return new Sn(t)}}class Sn extends Et{testMode=!0;rot=new Ae;constructor(e){super(),this.testMode=e.testMode}update(e){if(super.update(e),this.testMode){this.rot.add(e,e,e);const t=At(this.rot);this.trans.quat.set(t)}}}class Uo extends I.Loader{constructor(e){super(e)}load(e,t,n,r){const s=this,o=new I.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){const A=s.parse(JSON.parse(c));t&&t(A)},n,r)}parse(e){return new Fi(e)}}class Fi{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],s=Ho(e,t,this.data,n);for(let o=0,c=s.length;o<c;o++)r.push(...s[o].toShapes());return r}}function Ho(i,e,t,n){const r=Array.from(i),s=e/t.resolution,o=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&r.reverse();for(let d=0;d<r.length;d++){const u=r[d];if(u===`
|
|
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
71
|
`),o("\r"),o("\u2028"),o("\u2029")]}},t.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.decimalEscapeAtom=function(){var l=this.positiveInteger();return{type:"GroupBackReference",value:l}},t.prototype.characterClassEscape=function(){var l,h=!1;switch(this.popChar()){case"d":l=b;break;case"D":l=b,h=!0;break;case"s":l=m;break;case"S":l=m,h=!0;break;case"w":l=f;break;case"W":l=f,h=!0;break}return a(l),{type:"Set",value:l,complement:h}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=o("\f");break;case"n":l=o(`
|
|
72
72
|
`);break;case"r":l=o("\r");break;case"t":l=o(" ");break;case"v":l=o("\v");break}return a(l),{type:"Character",value:l}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var l=this.popChar();if(/[a-zA-Z]/.test(l)===!1)throw Error("Invalid ");var h=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:h}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\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:o(l)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|
73
73
|
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:o(l)}}},t.prototype.characterClass=function(){var l=[],h=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),h=!0);this.isClassAtom();){var p=this.classAtom(),C=p.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var g=this.classAtom(),B=g.type==="Character";if(B){if(g.value<p.value)throw Error("Range out of order in character class");l.push({from:p.value,to:g.value})}else c(p.value,l),l.push(o("-")),c(g.value,l)}else c(p.value,l)}return this.consumeChar("]"),{type:"Set",complement:h,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
@@ -75,7 +75,7 @@
|
|
|
75
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:o(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
77
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var h="",p=0;p<l;p++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");h+=C}var g=parseInt(h,16);return{type:"Character",value:g}},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]/,s=/[1-9]/;function o(l){return l.charCodeAt(0)}function c(l,h){l.length!==void 0?l.forEach(function(p){h.push(p)}):h.push(l)}function A(l,h){if(l[h]===!0)throw"duplicate flag "+h;l[h]=!0}function a(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function d(){throw Error("Internal Error - Should never get here!")}var u,b=[];for(u=o("0");u<=o("9");u++)b.push(u);var f=[o("_")].concat(b);for(u=o("a");u<=o("z");u++)f.push(u);for(u=o("A");u<=o("Z");u++)f.push(u);var m=[o(" "),o("\f"),o(`
|
|
78
|
-
`),o("\r"),o(" "),o("\v"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\uFEFF")];function E(){}return E.prototype.visitChildren=function(l){for(var h in l){var p=l[h];l.hasOwnProperty(h)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.forEach(function(C){this.visit(C)},this))}},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"}})}),cn=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=An(),t={},n=new e.RegExpParser;function r(o){var c=o.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function s(){t={}}i.clearRegExpParserCache=s}),Wo=Be(i=>{var e=i&&i.__extends||(function(){var E=function(l,h){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(p[g]=C[g])},E(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");E(l,h);function p(){this.constructor=l}l.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=An(),n=Se(),r=cn(),s=
|
|
78
|
+
`),o("\r"),o(" "),o("\v"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\uFEFF")];function E(){}return E.prototype.visitChildren=function(l){for(var h in l){var p=l[h];l.hasOwnProperty(h)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.forEach(function(C){this.visit(C)},this))}},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"}})}),cn=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=An(),t={},n=new e.RegExpParser;function r(o){var c=o.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function s(){t={}}i.clearRegExpParserCache=s}),Wo=Be(i=>{var e=i&&i.__extends||(function(){var E=function(l,h){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(p[g]=C[g])},E(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");E(l,h);function p(){this.constructor=l}l.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=An(),n=Se(),r=cn(),s=Mi(),o="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|
79
79
|
`;function c(E,l){l===void 0&&(l=!1);try{var h=r.getRegExpAst(E),p=A(h.value,{},h.flags.ignoreCase);return p}catch(g){if(g.message===o)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.
|
|
@@ -84,32 +84,32 @@
|
|
|
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,h){switch(E.type){case"Disjunction":for(var p=0;p<E.value.length;p++)A(E.value[p],l,h);break;case"Alternative":for(var C=E.value,p=0;p<C.length;p++){var g=C[p];switch(g.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var B=g;switch(B.type){case"Character":a(B.value,l,h);break;case"Set":if(B.complement===!0)throw Error(o);n.forEach(B.value,function(
|
|
88
|
-
`],tracer:function(T,y){return y()}});var W=
|
|
87
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(E,l,h){switch(E.type){case"Disjunction":for(var p=0;p<E.value.length;p++)A(E.value[p],l,h);break;case"Alternative":for(var C=E.value,p=0;p<C.length;p++){var g=C[p];switch(g.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var B=g;switch(B.type){case"Character":a(B.value,l,h);break;case"Set":if(B.complement===!0)throw Error(o);n.forEach(B.value,function(j){if(typeof j=="number")a(j,l,h);else{var R=j;if(h===!0)for(var F=R.from;F<=R.to;F++)a(F,l,h);else{for(var F=R.from;F<=R.to&&F<s.minOptimizationVal;F++)a(F,l,h);if(R.to>=s.minOptimizationVal)for(var L=R.from>=s.minOptimizationVal?R.from:s.minOptimizationVal,k=R.to,x=s.charCodeToOptimizedIndex(L),_=s.charCodeToOptimizedIndex(k),V=x;V<=_;V++)l[V]=V}}});break;case"Group":A(B.value,l,h);break;default:throw Error("Non Exhaustive Match")}var Q=B.quantifier!==void 0&&B.quantifier.atLeast===0;if(B.type==="Group"&&b(B)===!1||B.type!=="Group"&&Q===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(E,l,h){var p=s.charCodeToOptimizedIndex(E);l[p]=p,h===!0&&d(E,l)}function d(E,l){var h=String.fromCharCode(E),p=h.toUpperCase();if(p!==h){var C=s.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var g=h.toLowerCase();if(g!==h){var C=s.charCodeToOptimizedIndex(g.charCodeAt(0));l[C]=C}}}function u(E,l){return n.find(E.value,function(h){if(typeof h=="number")return n.contains(l,h);var p=h;return n.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(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(h){var p=E.call(this)||this;return p.targetCharCodes=h,p.found=!1,p}return l.prototype.visitChildren=function(h){if(this.found!==!0){switch(h.type){case"Lookahead":this.visitLookahead(h);return;case"NegativeLookahead":this.visitNegativeLookahead(h);return}E.prototype.visitChildren.call(this,h)}},l.prototype.visitCharacter=function(h){n.contains(this.targetCharCodes,h.value)&&(this.found=!0)},l.prototype.visitSet=function(h){h.complement?u(h,this.targetCharCodes)===void 0&&(this.found=!0):u(h,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function m(E,l){if(l instanceof RegExp){var h=r.getRegExpAst(l),p=new f(E);return p.visit(h),p.found}else return n.find(l,function(C){return n.contains(E,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=m}),Mi=Be(i=>{var e=i&&i.__extends||(function(){var P=function(H,W){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,ne){$.__proto__=ne}||function($,ne){for(var le in ne)Object.prototype.hasOwnProperty.call(ne,le)&&($[le]=ne[le])},P(H,W)};return function(H,W){if(typeof W!="function"&&W!==null)throw new TypeError("Class extends value "+String(W)+" is not a constructor or null");P(H,W);function $(){this.constructor=H}H.prototype=W===null?Object.create(W):($.prototype=W.prototype,new $)}})();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=An(),n=kt(),r=Se(),s=Wo(),o=cn(),c="PATTERN";i.DEFAULT_MODE="defaultMode",i.MODES="modes",i.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){i.SUPPORT_STICKY=!1}i.disableSticky=A;function a(){i.SUPPORT_STICKY=!0}i.enableSticky=a;function d(P,H){H=r.defaults(H,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
88
|
+
`],tracer:function(T,y){return y()}});var W=H.tracer;W("initCharCodeToOptimizedIndexMap",function(){he()});var $;W("Reject Lexer.NA",function(){$=r.reject(P,function(T){return T[c]===n.Lexer.NA})});var ne=!1,le;W("Transform Patterns",function(){ne=!1,le=r.map($,function(T){var y=T[c];if(r.isRegExp(y)){var w=y.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!y.ignoreCase?w:w.length===2&&w[0]==="\\"&&!r.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:H.useSticky?k(y):L(y)}else{if(r.isFunction(y))return ne=!0,{exec:y};if(r.has(y,"exec"))return ne=!0,y;if(typeof y=="string"){if(y.length===1)return y;var N=y.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),v=new RegExp(N);return H.useSticky?k(v):L(v)}else throw Error("non exhaustive match")}})});var Ce,me,Ne,je,Ve;W("misc mapping",function(){Ce=r.map($,function(T){return T.tokenTypeIdx}),me=r.map($,function(T){var y=T.GROUP;if(y!==n.Lexer.SKIPPED){if(r.isString(y))return y;if(r.isUndefined(y))return!1;throw Error("non exhaustive match")}}),Ne=r.map($,function(T){var y=T.LONGER_ALT;if(y){var w=r.indexOf($,y);return w}}),je=r.map($,function(T){return T.PUSH_MODE}),Ve=r.map($,function(T){return r.has(T,"POP_MODE")})});var Ue;W("Line Terminator Handling",function(){var T=ce(H.lineTerminatorCharacters);Ue=r.map($,function(y){return!1}),H.positionTracking!=="onlyOffset"&&(Ue=r.map($,function(y){if(r.has(y,"LINE_BREAKS"))return y.LINE_BREAKS;if(X(y,T)===!1)return s.canMatchCharCode(T,y.PATTERN)}))});var M,Y,K,ie;W("Misc Mapping #2",function(){M=r.map($,J),Y=r.map(le,q),K=r.reduce($,function(T,y){var w=y.GROUP;return r.isString(w)&&w!==n.Lexer.SKIPPED&&(T[w]=[]),T},{}),ie=r.map(le,function(T,y){return{pattern:le[y],longerAlt:Ne[y],canLineTerminator:Ue[y],isCustom:M[y],short:Y[y],group:me[y],push:je[y],pop:Ve[y],tokenTypeIdx:Ce[y],tokenType:$[y]}})});var ge=!0,ve=[];return H.safeMode||W("First Char Optimization",function(){ve=r.reduce($,function(T,y,w){if(typeof y.PATTERN=="string"){var N=y.PATTERN.charCodeAt(0),v=ee(N);re(T,v,ie[w])}else if(r.isArray(y.START_CHARS_HINT)){var D;r.forEach(y.START_CHARS_HINT,function(G){var z=typeof G=="string"?G.charCodeAt(0):G,te=ee(z);D!==te&&(D=te,re(T,te,ie[w]))})}else if(r.isRegExp(y.PATTERN))if(y.PATTERN.unicode)ge=!1,H.ensureOptimizations&&r.PRINT_ERROR(""+s.failedOptimizationPrefixMsg+(" Unable to analyze < "+y.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 O=s.getOptimizedStartCodesIndices(y.PATTERN,H.ensureOptimizations);r.isEmpty(O)&&(ge=!1),r.forEach(O,function(G){re(T,G,ie[w])})}else H.ensureOptimizations&&r.PRINT_ERROR(""+s.failedOptimizationPrefixMsg+(" TokenType: <"+y.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`),ge=!1;return T},[])}),W("ArrayPacking",function(){
|
|
93
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),ge=!1;return T},[])}),W("ArrayPacking",function(){ve=r.packArray(ve)}),{emptyGroups:K,patternIdxToConfig:ie,charCodeToPatternIdxToConfig:ve,hasCustom:ne,canBeOptimized:ge}}i.analyzeTokenTypes=d;function u(P,H){var W=[],$=f(P);W=W.concat($.errors);var ne=m($.valid),le=ne.valid;return W=W.concat(ne.errors),W=W.concat(b(le)),W=W.concat(Q(le)),W=W.concat(S(le,H)),W=W.concat(j(le)),W}i.validatePatterns=u;function b(P){var H=[],W=r.filter(P,function($){return r.isRegExp($[c])});return H=H.concat(l(W)),H=H.concat(C(W)),H=H.concat(g(W)),H=H.concat(B(W)),H=H.concat(h(W)),H}function f(P){var H=r.filter(P,function(ne){return!r.has(ne,c)}),W=r.map(H,function(ne){return{message:"Token Type: ->"+ne.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[ne]}}),$=r.difference(P,H);return{errors:W,valid:$}}i.findMissingPatterns=f;function m(P){var H=r.filter(P,function(ne){var le=ne[c];return!r.isRegExp(le)&&!r.isFunction(le)&&!r.has(le,"exec")&&!r.isString(le)}),W=r.map(H,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]}}),$=r.difference(P,H);return{errors:W,valid:$}}i.findInvalidPatterns=m;var E=/[^\\][\$]/;function l(P){var H=(function(ne){e(le,ne);function le(){var Ce=ne!==null&&ne.apply(this,arguments)||this;return Ce.found=!1,Ce}return le.prototype.visitEndAnchor=function(Ce){this.found=!0},le})(t.BaseRegExpVisitor),W=r.filter(P,function(ne){var le=ne[c];try{var Ce=o.getRegExpAst(le),me=new H;return me.visit(Ce),me.found}catch{return E.test(le.source)}}),$=r.map(W,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 $}i.findEndOfInputAnchor=l;function h(P){var H=r.filter(P,function($){var ne=$[c];return ne.test("")}),W=r.map(H,function($){return{message:"Token Type: ->"+$.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[$]}});return W}i.findEmptyMatchRegExps=h;var p=/[^\\[][\^]|^\^/;function C(P){var H=(function(ne){e(le,ne);function le(){var Ce=ne!==null&&ne.apply(this,arguments)||this;return Ce.found=!1,Ce}return le.prototype.visitStartAnchor=function(Ce){this.found=!0},le})(t.BaseRegExpVisitor),W=r.filter(P,function(ne){var le=ne[c];try{var Ce=o.getRegExpAst(le),me=new H;return me.visit(Ce),me.found}catch{return p.test(le.source)}}),$=r.map(W,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(P,i.MODES)
|
|
101
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(P,i.MODES)&&r.has(P,i.DEFAULT_MODE)&&!r.has(P.modes,P.defaultMode)
|
|
102
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(P,i.MODES)&&r.forEach(P.modes,function(ne,
|
|
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 $}i.findStartOfInputAnchor=C;function g(P){var H=r.filter(P,function($){var ne=$[c];return ne instanceof RegExp&&(ne.multiline||ne.global)}),W=r.map(H,function($){return{message:"Token Type: ->"+$.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[$]}});return W}i.findUnsupportedFlags=g;function B(P){var H=[],W=r.map(P,function(le){return r.reduce(P,function(Ce,me){return le.PATTERN.source===me.PATTERN.source&&!r.contains(H,me)&&me.PATTERN!==n.Lexer.NA&&(H.push(me),Ce.push(me)),Ce},[])});W=r.compact(W);var $=r.filter(W,function(le){return le.length>1}),ne=r.map($,function(le){var Ce=r.map(le,function(Ne){return Ne.name}),me=r.first(le).PATTERN;return{message:"The same RegExp pattern ->"+me+"<-"+("has been used in all of the following Token Types: "+Ce.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return ne}i.findDuplicatePatterns=B;function Q(P){var H=r.filter(P,function($){if(!r.has($,"GROUP"))return!1;var ne=$.GROUP;return ne!==n.Lexer.SKIPPED&&ne!==n.Lexer.NA&&!r.isString(ne)}),W=r.map(H,function($){return{message:"Token Type: ->"+$.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[$]}});return W}i.findInvalidGroupType=Q;function S(P,H){var W=r.filter(P,function(ne){return ne.PUSH_MODE!==void 0&&!r.contains(H,ne.PUSH_MODE)}),$=r.map(W,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 $}i.findModesThatDoNotExist=S;function j(P){var H=[],W=r.reduce(P,function($,ne,le){var Ce=ne.PATTERN;return Ce===n.Lexer.NA||(r.isString(Ce)?$.push({str:Ce,idx:le,tokenType:ne}):r.isRegExp(Ce)&&F(Ce)&&$.push({str:Ce.source,idx:le,tokenType:ne})),$},[]);return r.forEach(P,function($,ne){r.forEach(W,function(le){var Ce=le.str,me=le.idx,Ne=le.tokenType;if(ne<me&&R(Ce,$.PATTERN)){var je="Token: ->"+Ne.name+`<- can never be matched.
|
|
98
|
+
`+("Because it appears AFTER the Token Type ->"+$.name+"<-")+`in the lexer's definition.
|
|
99
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;H.push({message:je,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[$,Ne]})}})}),H}i.findUnreachablePatterns=j;function R(P,H){if(r.isRegExp(H)){var W=H.exec(P);return W!==null&&W.index===0}else{if(r.isFunction(H))return H(P,0,[],{});if(r.has(H,"exec"))return H.exec(P,0,[],{});if(typeof H=="string")return H===P;throw Error("non exhaustive match")}}function F(P){var H=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(H,function(W){return P.source.indexOf(W)!==-1})===void 0}function L(P){var H=P.ignoreCase?"i":"";return new RegExp("^(?:"+P.source+")",H)}i.addStartOfInput=L;function k(P){var H=P.ignoreCase?"iy":"y";return new RegExp(""+P.source,H)}i.addStickyFlag=k;function x(P,H,W){var $=[];return r.has(P,i.DEFAULT_MODE)||$.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(P,i.MODES)||$.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(P,i.MODES)&&r.has(P,i.DEFAULT_MODE)&&!r.has(P.modes,P.defaultMode)&&$.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+P.defaultMode+`>which does not exist
|
|
102
|
+
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(P,i.MODES)&&r.forEach(P.modes,function(ne,le){r.forEach(ne,function(Ce,me){r.isUndefined(Ce)&&$.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+le+"> at index: <"+me+`>
|
|
103
|
+
`),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),$}i.performRuntimeChecks=x;function _(P,H,W){var $=[],ne=!1,le=r.compact(r.flatten(r.mapValues(P.modes,function(Ne){return Ne}))),Ce=r.reject(le,function(Ne){return Ne[c]===n.Lexer.NA}),me=ce(W);return H&&r.forEach(Ce,function(Ne){var je=X(Ne,me);if(je!==!1){var Ve=Z(Ne,je),Ue={message:Ve,type:je.issue,tokenType:Ne};$.push(Ue)}else r.has(Ne,"LINE_BREAKS")?Ne.LINE_BREAKS===!0&&(ne=!0):s.canMatchCharCode(me,Ne.PATTERN)&&(ne=!0)}),H&&!ne&&$.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})
|
|
107
|
+
for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),$}i.performWarningRuntimeChecks=_;function V(P){var H={},W=r.keys(P);return r.forEach(W,function($){var ne=P[$];if(r.isArray(ne))H[$]=[];else throw Error("non exhaustive match")}),H}i.cloneEmptyGroups=V;function J(P){var H=P.PATTERN;if(r.isRegExp(H))return!1;if(r.isFunction(H)||r.has(H,"exec"))return!0;if(r.isString(H))return!1;throw Error("non exhaustive match")}i.isCustomPattern=J;function q(P){return r.isString(P)&&P.length===1?P.charCodeAt(0):!1}i.isShortPattern=q,i.LineTerminatorOptimizedTester={test:function(P){for(var H=P.length,W=this.lastIndex;W<H;W++){var $=P.charCodeAt(W);if($===10)return this.lastIndex=W+1,!0;if($===13)return P.charCodeAt(W+1)===10?this.lastIndex=W+2:this.lastIndex=W+1,!0}return!1},lastIndex:0};function X(P,H){if(r.has(P,"LINE_BREAKS"))return!1;if(r.isRegExp(P.PATTERN)){try{s.canMatchCharCode(H,P.PATTERN)}catch(W){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:W.message}}return!1}else{if(r.isString(P.PATTERN))return!1;if(J(P))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Z(P,H){if(H.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
108
108
|
`+(" The problem is in the <"+P.name+`> Token Type
|
|
109
|
-
`)+(" Root cause: "+
|
|
110
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(
|
|
109
|
+
`)+(" Root cause: "+H.errMsg+`.
|
|
110
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(H.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
111
111
|
`+(" The problem is in the <"+P.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
|
|
112
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=Z;function ce(P){var H=r.map(P,function(W){return r.isString(W)&&W.length>0?W.charCodeAt(0):W});return H}function re(P,H,W){P[H]===void 0?P[H]=[W]:P[H].push(W)}i.minOptimizationVal=256;var oe=[];function ee(P){return P<i.minOptimizationVal?P:oe[P]}i.charCodeToOptimizedIndex=ee;function he(){if(r.isEmpty(oe)){oe=new Array(65536);for(var P=0;P<65536;P++)oe[P]=P>255?255+~~(P/255):P}}}),Ct=Be(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=Se();function t(E,l){var h=E.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!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=s(E);o(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}i.augmentTokenTypes=r;function s(E){for(var l=e.cloneArr(E),h=E,p=!0;p;){h=e.compact(e.flatten(e.map(h,function(g){return g.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?p=!1:h=C}return l}i.expandCategories=s;function o(E){e.forEach(E,function(l){d(l)||(i.tokenIdxToClass[i.tokenShortNameIdx]=l,l.tokenTypeIdx=i.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),f(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=o;function c(E){e.forEach(E,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,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(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var p=E.concat(l);e.contains(p,h)||a(p,h)})}i.singleAssignCategoriesToksMap=a;function d(E){return e.has(E,"tokenTypeIdx")}i.hasShortKeyProperty=d;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 m(E){return e.has(E,"tokenTypeIdx")}i.isTokenType=m}),Pi=Be(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,s){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),kt=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=Mi(),t=Se(),n=Ct(),r=Pi(),s=cn();(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 o={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
113
113
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:r.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(o);var c=(function(){function A(a,d){var u=this;if(d===void 0&&(d=o),this.lexerDefinition=a,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof d=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
114
114
|
a boolean 2nd argument is no longer supported`);this.config=t.merge(o,d);var b=this.config.traceInitPerf;b===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof b=="number"&&(this.traceInitMaxIdent=b,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var f,m=!0;u.TRACE_INIT("Lexer Config handling",function(){if(u.config.lineTerminatorsPattern===o.lineTerminatorsPattern)u.config.lineTerminatorsPattern=e.LineTerminatorOptimizedTester;else if(u.config.lineTerminatorCharacters===o.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
115
115
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(d.safeMode&&d.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');u.trackStartLines=/full|onlyStart/i.test(u.config.positionTracking),u.trackEndLines=/full/i.test(u.config.positionTracking),t.isArray(a)?(f={modes:{}},f.modes[e.DEFAULT_MODE]=t.cloneArr(a),f[e.DEFAULT_MODE]=e.DEFAULT_MODE):(m=!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(g){return t.isUndefined(g)})});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 g;u.TRACE_INIT("analyzeTokenTypes",function(){g=e.analyzeTokenTypes(p,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:d.positionTracking,ensureOptimizations:d.ensureOptimizations,safeMode:d.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=g.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=g.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,g.emptyGroups),u.hasCustom=g.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=g.canBeOptimized}})}),u.defaultMode=f.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(p){return p.message}),h=l.join(`-----------------------
|
|
@@ -118,8 +118,8 @@ a boolean 2nd argument is no longer supported`);this.config=t.merge(o,d);var b=t
|
|
|
118
118
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
119
119
|
Or inspect the console log for details on how to resolve these issues.`)}),u.TRACE_INIT("clearRegExpParserCache",function(){s.clearRegExpParserCache()}),u.TRACE_INIT("toFastProperties",function(){t.toFastProperties(u)})})}return A.prototype.tokenize=function(a,d){if(d===void 0&&(d=this.defaultMode),!t.isEmpty(this.lexerDefinitionErrors)){var u=t.map(this.lexerDefinitionErrors,function(m){return m.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,d);return f},A.prototype.tokenizeInternal=function(a,d){var u=this,b,f,m,E,l,h,p,C,g,B,
|
|
122
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(g,A)&&(v.CATEGORIES=g[A]),n.augmentTokenTypes([v]),e.has(g,a)&&(v.LABEL=g[a]),e.has(g,d)&&(v.GROUP=g[d]),e.has(g,b)&&(v.POP_MODE=g[b]),e.has(g,u)&&(v.PUSH_MODE=g[u]),e.has(g,f)&&(v.LONGER_ALT=g[f]),e.has(g,m)&&(v.LINE_BREAKS=g[m]),e.has(g,E)&&(v.START_CHARS_HINT=g[E]),v}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function p(g,B,v,k,H,Q,M,x){return{image:B,startOffset:v,endOffset:k,startLine:H,endLine:Q,startColumn:M,endColumn:x,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 v in B)Object.prototype.hasOwnProperty.call(B,v)&&(g[v]=B[v])},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}}),Ct=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=Ct();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}),Pi=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}),Gi=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=Pi(),r=Se(),s=Gi(),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=`
|
|
121
|
+
`+b)}var f=this.tokenizeInternal(a,d);return f},A.prototype.tokenizeInternal=function(a,d){var u=this,b,f,m,E,l,h,p,C,g,B,Q,S,j,R,F=a,L=F.length,k=0,x=0,_=this.hasCustom?0:Math.floor(a.length/10),V=new Array(_),J=[],q=this.trackStartLines?1:void 0,X=this.trackStartLines?1:void 0,Z=e.cloneEmptyGroups(this.emptyGroups),ce=this.trackStartLines,re=this.config.lineTerminatorsPattern,oe=0,ee=[],he=[],P=[],H=[];Object.freeze(H);var W=void 0;function $(){return ee}function ne(D){var O=e.charCodeToOptimizedIndex(D),G=he[O];return G===void 0?H:G}var le=function(D){if(P.length===1&&D.tokenType.PUSH_MODE===void 0){var O=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(D);J.push({offset:D.startOffset,line:D.startLine!==void 0?D.startLine:void 0,column:D.startColumn!==void 0?D.startColumn:void 0,length:D.image.length,message:O})}else{P.pop();var G=t.last(P);ee=u.patternIdxToConfig[G],he=u.charCodeToPatternIdxToConfig[G],oe=ee.length;var z=u.canModeBeOptimized[G]&&u.config.safeMode===!1;he&&z?W=ne:W=$}};function Ce(D){P.push(D),he=this.charCodeToPatternIdxToConfig[D],ee=this.patternIdxToConfig[D],oe=ee.length,oe=ee.length;var O=this.canModeBeOptimized[D]&&this.config.safeMode===!1;he&&O?W=ne:W=$}Ce.call(this,d);for(var me;k<L;){l=null;var Ne=F.charCodeAt(k),je=W(Ne),Ve=je.length;for(b=0;b<Ve;b++){me=je[b];var Ue=me.pattern;h=null;var M=me.short;if(M!==!1?Ne===M&&(l=Ue):me.isCustom===!0?(R=Ue.exec(F,k,V,Z),R!==null?(l=R[0],R.payload!==void 0&&(h=R.payload)):l=null):(this.updateLastIndex(Ue,k),l=this.match(Ue,a,k)),l!==null){if(E=me.longerAlt,E!==void 0){var Y=ee[E],K=Y.pattern;p=null,Y.isCustom===!0?(R=K.exec(F,k,V,Z),R!==null?(m=R[0],R.payload!==void 0&&(p=R.payload)):m=null):(this.updateLastIndex(K,k),m=this.match(K,a,k)),m&&m.length>l.length&&(l=m,h=p,me=Y)}break}}if(l!==null){if(C=l.length,g=me.group,g!==void 0&&(B=me.tokenTypeIdx,Q=this.createTokenInstance(l,k,B,me.tokenType,q,X,C),this.handlePayload(Q,h),g===!1?x=this.addToken(V,x,Q):Z[g].push(Q)),a=this.chopInput(a,C),k=k+C,X=this.computeNewColumn(X,C),ce===!0&&me.canLineTerminator===!0){var ie=0,ge=void 0,ve=void 0;re.lastIndex=0;do ge=re.test(l),ge===!0&&(ve=re.lastIndex-1,ie++);while(ge===!0);ie!==0&&(q=q+ie,X=C-ve,this.updateTokenEndLineColumnLocation(Q,g,ve,ie,q,X,C))}this.handleModes(me,le,Ce,Q)}else{for(var T=k,y=q,w=X,N=!1;!N&&k<L;)for(F.charCodeAt(k),a=this.chopInput(a,1),k++,f=0;f<oe;f++){var v=ee[f],Ue=v.pattern,M=v.short;if(M!==!1?F.charCodeAt(k)===M&&(N=!0):v.isCustom===!0?N=Ue.exec(F,k,V,Z)!==null:(this.updateLastIndex(Ue,k),N=Ue.exec(a)!==null),N===!0)break}S=k-T,j=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(F,T,S,y,w),J.push({offset:T,line:y,column:w,length:S,message:j})}}return this.hasCustom||(V.length=x),{tokens:V,groups:Z,errors:J}},A.prototype.handleModes=function(a,d,u,b){if(a.pop===!0){var f=a.push;d(b),f!==void 0&&u.call(this,f)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,d){return a.substring(d)},A.prototype.updateLastIndex=function(a,d){a.lastIndex=d},A.prototype.updateTokenEndLineColumnLocation=function(a,d,u,b,f,m,E){var l,h;d!==void 0&&(l=u===E-1,h=l?-1:0,b===1&&l===!0||(a.endLine=f+h,a.endColumn=m-1+-h))},A.prototype.computeNewColumn=function(a,d){return a+d},A.prototype.createTokenInstance=function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];return null},A.prototype.createOffsetOnlyToken=function(a,d,u,b){return{image:a,startOffset:d,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,d,u,b,f,m){return{image:a,startOffset:d,startLine:f,startColumn:m,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,d,u,b,f,m,E){return{image:a,startOffset:d,endOffset:d+E-1,startLine:f,endLine:f,startColumn:m,endColumn:m+E-1,tokenTypeIdx:u,tokenType:b}},A.prototype.addToken=function(a,d,u){return 666},A.prototype.addTokenUsingPush=function(a,d,u){return a.push(u),d},A.prototype.addTokenUsingMemberAccess=function(a,d,u){return a[d]=u,d++,d},A.prototype.handlePayload=function(a,d){},A.prototype.handlePayloadNoCustom=function(a,d){},A.prototype.handlePayloadWithCustom=function(a,d){d!==null&&(a.payload=d)},A.prototype.match=function(a,d,u){return null},A.prototype.matchWithTest=function(a,d,u){var b=a.test(d);return b===!0?d.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,d){var u=a.exec(d);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,d){if(this.traceInitPerf===!0){this.traceInitIndent++;var u=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(u+"--> <"+a+">");var b=t.timer(d),f=b.time,m=b.value,E=f>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&E(u+"<-- <"+a+"> time: "+f+"ms"),this.traceInitIndent--,m}else return d()},A.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",A.NA=/NOT_APPLICABLE/,A})();i.Lexer=c}),ct=Be(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=Se(),t=kt(),n=Ct();function r(g){return o(g)?g.LABEL:g.name}i.tokenLabel=r;function s(g){return g.name}i.tokenName=s;function o(g){return e.isString(g.LABEL)&&g.LABEL!==""}i.hasTokenLabel=o;var c="parent",A="categories",a="label",d="group",u="push_mode",b="pop_mode",f="longer_alt",m="line_breaks",E="start_chars_hint";function l(g){return h(g)}i.createToken=l;function h(g){var B=g.pattern,Q={};if(Q.name=g.name,e.isUndefined(B)||(Q.PATTERN=B),e.has(g,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(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
123
|
but found: '`+u+"'";if(a)return d+a+b;var f=n.reduce(c,function(h,p){return h.concat(p)},[]),m=n.map(f,function(h){return"["+n.map(h,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),E=n.map(m,function(h,p){return" "+(p+1)+". "+h}),l=`one of these possible Token sequences:
|
|
124
124
|
`+E.join(`
|
|
125
125
|
`);return d+l+b},buildEarlyExitMessage:function(o){var c=o.expectedIterationPaths,A=o.actual,a=o.customUserDescription;o.ruleName;var d="Expecting: ",u=n.first(A).image,b=`
|
|
@@ -149,33 +149,33 @@ This could lead to an infinite loop.`;return A},buildTokenNameError:function(o){
|
|
|
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=Ct();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=Pi(),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),v=new s.Alternative({definition:B});this.possibleTokTypes=r.first(v),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(Q){return Q.concat(n.drop(l,g+1))}function v(Q){var M=f(B(Q),h,p);return C.concat(M)}for(;p.length<h&&g<l.length;){var k=l[g];if(k instanceof s.Alternative||k instanceof s.NonTerminal)return v(k.definition);if(k instanceof s.Option)C=v(k.definition);else if(k instanceof s.RepetitionMandatory){var H=k.definition.concat([new s.Repetition({definition:k.definition})]);return v(H)}else if(k instanceof s.RepetitionMandatoryWithSeparator){var H=[new s.Alternative({definition:k.definition}),new s.Repetition({definition:[new s.Terminal({terminalType:k.separator})].concat(k.definition)})];return v(H)}else if(k instanceof s.RepetitionWithSeparator){var H=k.definition.concat([new s.Repetition({definition:[new s.Terminal({terminalType:k.separator})].concat(k.definition)})]);C=v(H)}else if(k instanceof s.Repetition){var H=k.definition.concat([new s.Repetition({definition:k.definition})]);C=v(H)}else{if(k instanceof s.Alternation)return n.forEach(k.definition,function(Q){n.isEmpty(Q.definition)===!1&&(C=v(Q.definition))}),C;if(k instanceof s.Terminal)p.push(k.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],v="EXIT_ALTERNATIVE",k=!1,H=h.length,Q=H-C-1,M=[],x=[];for(x.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(x);){var S=x.pop();if(S===v){k&&n.last(x).idx<=Q&&x.pop();continue}var D=S.def,L=S.idx,V=S.ruleStack,J=S.occurrenceStack;if(!n.isEmpty(D)){var q=D[0];if(q===g){var X={idx:L,def:n.drop(D),ruleStack:n.dropRight(V),occurrenceStack:n.dropRight(J)};x.push(X)}else if(q instanceof s.Terminal)if(L<H-1){var $=L+1,le=h[$];if(p(le,q.terminalType)){var X={idx:$,def:n.drop(D),ruleStack:V,occurrenceStack:J};x.push(X)}}else if(L===H-1)M.push({nextTokenType:q.terminalType,nextTokenOccurrence:q.idx,ruleStack:V,occurrenceStack:J}),k=!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:L,def:q.definition.concat(B,n.drop(D)),ruleStack:re,occurrenceStack:oe};x.push(X)}else if(q instanceof s.Option){var te={idx:L,def:n.drop(D),ruleStack:V,occurrenceStack:J};x.push(te),x.push(v);var he={idx:L,def:q.definition.concat(n.drop(D)),ruleStack:V,occurrenceStack:J};x.push(he)}else if(q instanceof s.RepetitionMandatory){var P=new s.Repetition({definition:q.definition,idx:q.idx}),j=q.definition.concat([P],n.drop(D)),X={idx:L,def:j,ruleStack:V,occurrenceStack:J};x.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}),j=q.definition.concat([P],n.drop(D)),X={idx:L,def:j,ruleStack:V,occurrenceStack:J};x.push(X)}else if(q instanceof s.RepetitionWithSeparator){var te={idx:L,def:n.drop(D),ruleStack:V,occurrenceStack:J};x.push(te),x.push(v);var W=new s.Terminal({terminalType:q.separator}),Z=new s.Repetition({definition:[W].concat(q.definition),idx:q.idx}),j=q.definition.concat([Z],n.drop(D)),he={idx:L,def:j,ruleStack:V,occurrenceStack:J};x.push(he)}else if(q instanceof s.Repetition){var te={idx:L,def:n.drop(D),ruleStack:V,occurrenceStack:J};x.push(te),x.push(v);var Z=new s.Repetition({definition:q.definition,idx:q.idx}),j=q.definition.concat([Z],n.drop(D)),he={idx:L,def:j,ruleStack:V,occurrenceStack:J};x.push(he)}else if(q instanceof s.Alternation)for(var ne=q.definition.length-1;ne>=0;ne--){var ce=q.definition[ne],Ce={idx:L,def:ce.definition.concat(n.drop(D)),ruleStack:V,occurrenceStack:J};x.push(Ce),x.push(v)}else if(q instanceof s.Alternative)x.push({idx:L,def:q.definition.concat(n.drop(D)),ruleStack:V,occurrenceStack:J});else if(q instanceof s.Rule)x.push(E(q,L,V,J));else throw Error("non exhaustive match")}}return M}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 Q=function(M,x){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,D){S.__proto__=D}||function(S,D){for(var L in D)Object.prototype.hasOwnProperty.call(D,L)&&(S[L]=D[L])},Q(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");Q(M,x);function S(){this.constructor=M}M.prototype=x===null?Object.create(x):(S.prototype=x.prototype,new S)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=Se(),n=_t(),r=ln(),s=bt(),o=We(),c=Ct(),A;(function(Q){Q[Q.OPTION=0]="OPTION",Q[Q.REPETITION=1]="REPETITION",Q[Q.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",Q[Q.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",Q[Q.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",Q[Q.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(Q){if(Q instanceof o.Option)return A.OPTION;if(Q instanceof o.Repetition)return A.REPETITION;if(Q instanceof o.RepetitionMandatory)return A.REPETITION_MANDATORY;if(Q instanceof o.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(Q instanceof o.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(Q instanceof o.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function d(Q,M,x,S,D,L){var V=g(Q,M,x),J=H(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return L(V,S,J,D)}i.buildLookaheadFuncForOr=d;function u(Q,M,x,S,D,L){var V=B(Q,M,D,x),J=H(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return L(V[0],J,S)}i.buildLookaheadFuncForOptionalProd=u;function b(Q,M,x,S){var D=Q.length,L=t.every(Q,function(q){return t.every(q,function(X){return X.length===1})});if(M)return function(q){for(var X=t.map(q,function(Z){return Z.GATE}),$=0;$<D;$++){var le=Q[$],re=le.length,oe=X[$];if(!(oe!==void 0&&oe.call(this)===!1))e:for(var te=0;te<re;te++){for(var he=le[te],P=he.length,j=0;j<P;j++){var W=this.LA(j+1);if(x(W,he[j])===!1)continue e}return $}}};if(L&&!S){var V=t.map(Q,function(q){return t.flatten(q)}),J=t.reduce(V,function(q,X,$){return t.forEach(X,function(le){t.has(q,le.tokenTypeIdx)||(q[le.tokenTypeIdx]=$),t.forEach(le.categoryMatches,function(re){t.has(q,re)||(q[re]=$)})}),q},[]);return function(){var q=this.LA(1);return J[q.tokenTypeIdx]}}else return function(){for(var q=0;q<D;q++){var X=Q[q],$=X.length;e:for(var le=0;le<$;le++){for(var re=X[le],oe=re.length,te=0;te<oe;te++){var he=this.LA(te+1);if(x(he,re[te])===!1)continue e}return q}}}}i.buildAlternativesLookAheadFunc=b;function f(Q,M,x){var S=t.every(Q,function(X){return X.length===1}),D=Q.length;if(S&&!x){var L=t.flatten(Q);if(L.length===1&&t.isEmpty(L[0].categoryMatches)){var V=L[0],J=V.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===J}}else{var q=t.reduce(L,function(X,$,le){return X[$.tokenTypeIdx]=!0,t.forEach($.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<D;X++){for(var $=Q[X],le=$.length,re=0;re<le;re++){var oe=this.LA(re+1);if(M(oe,$[re])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=f;var m=(function(Q){e(M,Q);function M(x,S,D){var L=Q.call(this)||this;return L.topProd=x,L.targetOccurrence=S,L.targetProdType=D,L}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(x,S,D,L){return x.idx===this.targetOccurrence&&this.targetProdType===S?(this.restDef=D.concat(L),!0):!1},M.prototype.walkOption=function(x,S,D){this.checkIsTarget(x,A.OPTION,S,D)||Q.prototype.walkOption.call(this,x,S,D)},M.prototype.walkAtLeastOne=function(x,S,D){this.checkIsTarget(x,A.REPETITION_MANDATORY,S,D)||Q.prototype.walkOption.call(this,x,S,D)},M.prototype.walkAtLeastOneSep=function(x,S,D){this.checkIsTarget(x,A.REPETITION_MANDATORY_WITH_SEPARATOR,S,D)||Q.prototype.walkOption.call(this,x,S,D)},M.prototype.walkMany=function(x,S,D){this.checkIsTarget(x,A.REPETITION,S,D)||Q.prototype.walkOption.call(this,x,S,D)},M.prototype.walkManySep=function(x,S,D){this.checkIsTarget(x,A.REPETITION_WITH_SEPARATOR,S,D)||Q.prototype.walkOption.call(this,x,S,D)},M})(r.RestWalker),E=(function(Q){e(M,Q);function M(x,S,D){var L=Q.call(this)||this;return L.targetOccurrence=x,L.targetProdType=S,L.targetRef=D,L.result=[],L}return M.prototype.checkIsTarget=function(x,S){x.idx===this.targetOccurrence&&this.targetProdType===S&&(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(Q){for(var M=new Array(Q),x=0;x<Q;x++)M[x]=[];return M}function h(Q){for(var M=[""],x=0;x<Q.length;x++){for(var S=Q[x],D=[],L=0;L<M.length;L++){var V=M[L];D.push(V+"_"+S.tokenTypeIdx);for(var J=0;J<S.categoryMatches.length;J++){var q="_"+S.categoryMatches[J];D.push(V+q)}}M=D}return M}function p(Q,M,x){for(var S=0;S<Q.length;S++)if(S!==x)for(var D=Q[S],L=0;L<M.length;L++){var V=M[L];if(D[V]===!0)return!1}return!0}function C(Q,M){for(var x=t.map(Q,function($){return n.possiblePathsFrom([$],1)}),S=l(x.length),D=t.map(x,function($){var le={};return t.forEach($,function(re){var oe=h(re.partialPath);t.forEach(oe,function(te){le[te]=!0})}),le}),L=x,V=1;V<=M;V++){var J=L;L=l(J.length);for(var q=function($){for(var le=J[$],re=0;re<le.length;re++){var oe=le[re].partialPath,te=le[re].suffixDef,he=h(oe),P=p(D,he,$);if(P||t.isEmpty(te)||oe.length===M){var j=S[$];if(v(j,oe)===!1){j.push(oe);for(var W=0;W<he.length;W++){var Z=he[W];D[$][Z]=!0}}}else{var ne=n.possiblePathsFrom(te,V+1,oe);L[$]=L[$].concat(ne),t.forEach(ne,function(ce){var Ce=h(ce.partialPath);t.forEach(Ce,function(me){D[$][me]=!0})})}}},X=0;X<J.length;X++)q(X)}return S}i.lookAheadSequenceFromAlternatives=C;function g(Q,M,x,S){var D=new E(Q,A.ALTERNATION,S);return M.accept(D),C(D.result,x)}i.getLookaheadPathsForOr=g;function B(Q,M,x,S){var D=new E(Q,x);M.accept(D);var L=D.result,V=new m(M,Q,x),J=V.startWalking(),q=new o.Alternative({definition:L}),X=new o.Alternative({definition:J});return C([q,X],S)}i.getLookaheadPathsForOptionalProd=B;function v(Q,M){e:for(var x=0;x<Q.length;x++){var S=Q[x];if(S.length===M.length){for(var D=0;D<S.length;D++){var L=M[D],V=S[D],J=L===V||V.categoryMatchesMap[L.tokenTypeIdx]!==void 0;if(J===!1)continue e}return!0}}return!1}i.containsPath=v;function k(Q,M){return Q.length<M.length&&t.every(Q,function(x,S){var D=M[S];return x===D||D.categoryMatchesMap[x.tokenTypeIdx]})}i.isStrictPrefixOfPath=k;function H(Q){return t.every(Q,function(M){return t.every(M,function(x){return t.every(x,function(S){return t.isEmpty(S.categoryMatches)})})})}i.areTokenCategoriesNotUsed=H}),Ui=Be(i=>{var e=i&&i.__extends||(function(){var S=function(D,L){return S=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])},S(D,L)};return function(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");S(D,L);function V(){this.constructor=D}D.prototype=L===null?Object.create(L):(V.prototype=L.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=Ct();function d(S,D,L,V,J){var q=t.map(S,function(P){return u(P,V)}),X=t.map(S,function(P){return h(P,P,V)}),$=[],le=[],re=[];n.every(X,n.isEmpty)&&($=n.map(S,function(P){return g(P,V)}),le=n.map(S,function(P){return B(P,D,V)}),re=H(S,D,V));var oe=x(S,L,V),te=n.map(S,function(P){return k(P,V)}),he=n.map(S,function(P){return E(P,S,J,V)});return t.flatten(q.concat(re,X,$,le,oe,te,he))}i.validateGrammar=d;function u(S,D){var L=new m;S.accept(L);var V=L.allProductions,J=t.groupBy(V,b),q=t.pick(J,function($){return $.length>1}),X=t.map(t.values(q),function($){var le=t.first($),re=D.buildDuplicateFoundError(S,$),oe=s.getProductionDslName(le),te={message:re,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:S.name,dslName:oe,occurrence:le.idx},he=f(le);return he&&(te.parameter=he),te});return X}function b(S){return s.getProductionDslName(S)+"_#_"+S.idx+"_#_"+f(S)}i.identifyProductionForDuplicates=b;function f(S){return S instanceof A.Terminal?S.terminalType.name:S instanceof A.NonTerminal?S.nonTerminalName:""}var m=(function(S){e(D,S);function D(){var L=S!==null&&S.apply(this,arguments)||this;return L.allProductions=[],L}return D.prototype.visitNonTerminal=function(L){this.allProductions.push(L)},D.prototype.visitOption=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetition=function(L){this.allProductions.push(L)},D.prototype.visitAlternation=function(L){this.allProductions.push(L)},D.prototype.visitTerminal=function(L){this.allProductions.push(L)},D})(a.GAstVisitor);i.OccurrenceValidationCollector=m;function E(S,D,L,V){var J=[],q=n.reduce(D,function($,le){return le.name===S.name?$+1:$},0);if(q>1){var X=V.buildDuplicateRuleNameError({topLevelRule:S,grammarName:L});J.push({message:X,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:S.name})}return J}i.validateRuleDoesNotAlreadyExist=E;function l(S,D,L){var V=[],J;return t.contains(D,S)||(J="Invalid rule override, rule: ->"+S+"<- cannot be overridden in the grammar: ->"+L+"<-as it is not defined in any of the super grammars ",V.push({message:J,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:S})),V}i.validateRuleIsOverridden=l;function h(S,D,L,V){V===void 0&&(V=[]);var J=[],q=p(D.definition);if(t.isEmpty(q))return[];var X=S.name,$=t.contains(q,S);$&&J.push({message:L.buildLeftRecursionError({topLevelRule:S,leftRecursionPath:V}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:X});var le=t.difference(q,V.concat([S])),re=t.map(le,function(oe){var te=t.cloneArr(V);return te.push(oe),h(S,oe,L,te)});return J.concat(t.flatten(re))}i.validateNoLeftRecursion=h;function p(S){var D=[];if(t.isEmpty(S))return D;var L=t.first(S);if(L instanceof A.NonTerminal)D.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)D=D.concat(p(L.definition));else if(L instanceof A.Alternation)D=t.flatten(t.map(L.definition,function(X){return p(X.definition)}));else if(!(L instanceof A.Terminal))throw Error("non exhaustive match");var V=s.isOptionalProd(L),J=S.length>1;if(V&&J){var q=t.drop(S);return D.concat(p(q))}else return D}i.getFirstNoneTerminal=p;var C=(function(S){e(D,S);function D(){var L=S!==null&&S.apply(this,arguments)||this;return L.alternations=[],L}return D.prototype.visitAlternation=function(L){this.alternations.push(L)},D})(a.GAstVisitor);function g(S,D){var L=new C;S.accept(L);var V=L.alternations,J=t.reduce(V,function(q,X){var $=t.dropRight(X.definition),le=t.map($,function(re,oe){var te=c.nextPossibleTokensAfter([re],[],null,1);return t.isEmpty(te)?{message:D.buildEmptyAlternationError({topLevelRule:S,alternation:X,emptyChoiceIdx:oe}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:S.name,occurrence:X.idx,alternative:oe+1}:null});return q.concat(t.compact(le))},[]);return J}i.validateEmptyOrAlternative=g;function B(S,D,L){var V=new C;S.accept(V);var J=V.alternations;J=n.reject(J,function(X){return X.ignoreAmbiguities===!0});var q=t.reduce(J,function(X,$){var le=$.idx,re=$.maxLookahead||D,oe=o.getLookaheadPathsForOr(le,S,re,$),te=Q(oe,$,S,L),he=M(oe,$,S,L);return X.concat(te,he)},[]);return q}i.validateAmbiguousAlternationAlternatives=B;var v=(function(S){e(D,S);function D(){var L=S!==null&&S.apply(this,arguments)||this;return L.allProductions=[],L}return D.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetition=function(L){this.allProductions.push(L)},D})(a.GAstVisitor);i.RepetionCollector=v;function k(S,D){var L=new C;S.accept(L);var V=L.alternations,J=t.reduce(V,function(q,X){return X.definition.length>255&&q.push({message:D.buildTooManyAlternativesError({topLevelRule:S,alternation:X}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:S.name,occurrence:X.idx}),q},[]);return J}i.validateTooManyAlts=k;function H(S,D,L){var V=[];return n.forEach(S,function(J){var q=new v;J.accept(q);var X=q.allProductions;n.forEach(X,function($){var le=o.getProdType($),re=$.maxLookahead||D,oe=$.idx,te=o.getLookaheadPathsForOptionalProd(oe,J,le,re),he=te[0];if(n.isEmpty(n.flatten(he))){var P=L.buildEmptyRepetitionError({topLevelRule:J,repetition:$});V.push({message:P,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:J.name})}})}),V}i.validateSomeNonEmptyLookaheadPath=H;function Q(S,D,L,V){var J=[],q=n.reduce(S,function($,le,re){return D.definition[re].ignoreAmbiguities===!0||n.forEach(le,function(oe){var te=[re];n.forEach(S,function(he,P){re!==P&&o.containsPath(he,oe)&&D.definition[P].ignoreAmbiguities!==!0&&te.push(P)}),te.length>1&&!o.containsPath(J,oe)&&(J.push(oe),$.push({alts:te,path:oe}))}),$},[]),X=t.map(q,function($){var le=n.map($.alts,function(oe){return oe+1}),re=V.buildAlternationAmbiguityError({topLevelRule:L,alternation:D,ambiguityIndices:le,prefixPath:$.path});return{message:re,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:L.name,occurrence:D.idx,alternatives:[$.alts]}});return X}function M(S,D,L,V){var J=[],q=n.reduce(S,function(X,$,le){var re=n.map($,function(oe){return{idx:le,path:oe}});return X.concat(re)},[]);return n.forEach(q,function(X){var $=D.definition[X.idx];if($.ignoreAmbiguities!==!0){var le=X.idx,re=X.path,oe=n.findAll(q,function(he){return D.definition[he.idx].ignoreAmbiguities!==!0&&he.idx<le&&o.isStrictPrefixOfPath(he.path,re)}),te=n.map(oe,function(he){var P=[he.idx+1,le+1],j=D.idx===0?"":D.idx,W=V.buildAlternationPrefixAmbiguityError({topLevelRule:L,alternation:D,ambiguityIndices:P,prefixPath:he.path});return{message:W,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:L.name,occurrence:j,alternatives:P}});J=J.concat(te)}}),J}i.checkPrefixAlternativesAmbiguities=M;function x(S,D,L){var V=[],J=n.map(D,function(q){return q.name});return n.forEach(S,function(q){var X=q.name;if(n.contains(J,X)){var $=L.buildNamespaceConflictError(q);V.push({message:$,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=Ui(),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}),yt=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}),Hi=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=yt(),r=Gi(),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 v=m.LA(0),k=m.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:v,ruleName:m.getCurrRuleFullName()}),H=new n.MismatchedTokenException(k,C,m.LA(0));H.resyncedTokens=t.dropRight(h),m.SAVE_ERROR(H)};!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,v=h.occurrence,k=h.isEndOfRule;this.RULE_STACK.length===1&&k&&B===void 0&&(B=e.EOF,v=1),this.shouldInRepetitionRecoveryBeTried(B,v,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}),ji=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=ji();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 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)+`>:
|
|
153
153
|
`+(""+l.join(`
|
|
154
154
|
|
|
155
155
|
`).replace(/\n/g,`
|
|
156
156
|
`)))}}};return f.prototype=m,f.prototype.constructor=f,f._RULE_NAMES=b,f}i.createBaseSemanticVisitorConstructor=r;function s(u,b,f){var m=function(){};t.defineNameProp(m,u+"BaseSemanticsWithDefaults");var E=Object.create(f.prototype);return e.forEach(b,function(l){E[l]=n}),m.prototype=E,m.prototype.constructor=m,m}i.createBaseVisitorConstructorWithDefaults=s;var o;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(o=i.CstVisitorDefinitionError||(i.CstVisitorDefinitionError={}));function c(u,b){var f=A(u,b),m=d(u,b);return f.concat(m)}i.validateVisitor=c;function A(u,b){var f=e.map(b,function(m){if(!e.isFunction(u[m]))return{msg:"Missing visitor method: <"+m+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:o.MISSING_METHOD,methodName:m}});return e.compact(f)}i.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function d(u,b){var f=[];for(var m in u)e.isFunction(u[m])&&!e.contains(a,m)&&!e.contains(b,m)&&f.push({msg:"Redundant visitor method: <"+m+"> 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=yt(),n=Xe(),r=Lt(),s=Ui(),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=yt(),r=xt(),s=_t(),o=Xe(),c=Hi(),A=ct(),a=bt(),d=ji(),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: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.
|
|
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
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 h=e.every(e.values(f),function(p){return e.isEmpty(p.categoryMatches)});this.tokenMatcher=h?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},b.prototype.defineRule=function(f,m,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: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(v){try{if(this.outputCst===!0){m.apply(this,v);var k=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(k),k}else return m.apply(this,v)}catch(H){return this.invokeRuleCatch(H,l,h)}finally{this.ruleFinallyStateUpdate()}}var g=function(v,k){return v===void 0&&(v=0),this.ruleInvocationStateUpdate(p,f,v),C.call(this,k)},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=yt(),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=bt(),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
|
|
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
|
|
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:{}},m=(function(){function C(){}return C.prototype.initGastRecorder=function(g){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var g=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var B=function(
|
|
167
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},m=(function(){function C(){}return C.prototype.initGastRecorder=function(g){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var g=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var B=function(S){var j=S>0?S:"";g["CONSUME"+j]=function(R,F){return this.consumeInternalRecord(R,S,F)},g["SUBRULE"+j]=function(R,F){return this.subruleInternalRecord(R,S,F)},g["OPTION"+j]=function(R){return this.optionInternalRecord(R,S)},g["OR"+j]=function(R){return this.orInternalRecord(R,S)},g["MANY"+j]=function(R){this.manyInternalRecord(S,R)},g["MANY_SEP"+j]=function(R){this.manySepFirstInternalRecord(S,R)},g["AT_LEAST_ONE"+j]=function(R){this.atLeastOneInternalRecord(S,R)},g["AT_LEAST_ONE_SEP"+j]=function(R){this.atLeastOneSepFirstInternalRecord(S,R)}},Q=0;Q<10;Q++)B(Q);g.consume=function(S,j,R){return this.consumeInternalRecord(j,S,R)},g.subrule=function(S,j,R){return this.subruleInternalRecord(j,S,R)},g.option=function(S,j){return this.optionInternalRecord(j,S)},g.or=function(S,j){return this.orInternalRecord(j,S)},g.many=function(S,j){this.manyInternalRecord(S,j)},g.atLeastOne=function(S,j){this.atLeastOneInternalRecord(S,j)},g.ACTION=g.ACTION_RECORD,g.BACKTRACK=g.BACKTRACK_RECORD,g.LA=g.LA_RECORD})},C.prototype.disableRecording=function(){var g=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var B=0;B<10;B++){var Q=B>0?B:"";delete g["CONSUME"+Q],delete g["SUBRULE"+Q],delete g["OPTION"+Q],delete g["OR"+Q],delete g["MANY"+Q],delete g["MANY_SEP"+Q],delete g["AT_LEAST_ONE"+Q],delete g["AT_LEAST_ONE_SEP"+Q]}delete g.consume,delete g.subrule,delete g.option,delete g.or,delete g.many,delete g.atLeastOne,delete g.ACTION,delete g.BACKTRACK,delete g.LA})},C.prototype.ACTION_RECORD=function(g){},C.prototype.BACKTRACK_RECORD=function(g,B){return function(){return!0}},C.prototype.LA_RECORD=function(g){return o.END_OF_FILE},C.prototype.topLevelRuleRecord=function(g,B){try{var Q=new t.Rule({definition:[],name:g});return Q.name=g,this.recordingProdStack.push(Q),B.call(this),this.recordingProdStack.pop(),Q}catch(S){if(S.KNOWN_RECORDER_ERROR!==!0)try{S.message=S.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 "+(d+1)));throw g.KNOWN_RECORDER_ERROR=!0,g}}}),as=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Se(),t=Xe(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(s){if(e.has(s,"traceInitPerf")){var o=s.traceInitPerf,c=typeof o=="number";this.traceInitMaxIdent=c?o:1/0,this.traceInitPerf=c?o>0:o}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(s,o){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+s+">");var A=e.timer(o),a=A.time,d=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+s+"> time: "+a+"ms"),this.traceInitIndent--,d}else return o()},r})();i.PerformanceTracer=n}),As=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var s=r.prototype;Object.getOwnPropertyNames(s).forEach(function(o){if(o!=="constructor"){var c=Object.getOwnPropertyDescriptor(s,o);c&&(c.get||c.set)?Object.defineProperty(t.prototype,o,c):t.prototype[o]=r.prototype[o]}})})}i.applyMixins=e}),Xe=Be(i=>{var e=i&&i.__extends||(function(){var
|
|
169
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw S}throw S}},C.prototype.optionInternalRecord=function(g,B){return E.call(this,t.Option,g,B)},C.prototype.atLeastOneInternalRecord=function(g,B){E.call(this,t.RepetitionMandatory,B,g)},C.prototype.atLeastOneSepFirstInternalRecord=function(g,B){E.call(this,t.RepetitionMandatoryWithSeparator,B,g,a)},C.prototype.manyInternalRecord=function(g,B){E.call(this,t.Repetition,B,g)},C.prototype.manySepFirstInternalRecord=function(g,B){E.call(this,t.RepetitionWithSeparator,B,g,a)},C.prototype.orInternalRecord=function(g,B){return l.call(this,g,B)},C.prototype.subruleInternalRecord=function(g,B,Q){if(p(B),!g||e.has(g,"ruleName")===!1){var S=new Error("<SUBRULE"+h(B)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(g)+">")+(`
|
|
170
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var j=e.peek(this.recordingProdStack),R=g.ruleName,F=new t.NonTerminal({idx:B,nonTerminalName:R,referencedRule:void 0});return j.definition.push(F),this.outputCst?f:A},C.prototype.consumeInternalRecord=function(g,B,Q){if(p(B),!r.hasShortKeyProperty(g)){var S=new Error("<CONSUME"+h(B)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(g)+">")+(`
|
|
171
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var j=e.peek(this.recordingProdStack),R=new t.Terminal({idx:B,terminalType:g});return j.definition.push(R),b},C})();i.GastRecorder=m;function E(C,g,B,Q){Q===void 0&&(Q=!1),p(B);var S=e.peek(this.recordingProdStack),j=e.isFunction(g)?g:g.DEF,R=new C({definition:[],idx:B});return Q&&(R.separator=g.SEP),e.has(g,"MAX_LOOKAHEAD")&&(R.maxLookahead=g.MAX_LOOKAHEAD),this.recordingProdStack.push(R),j.call(this),S.definition.push(R),this.recordingProdStack.pop(),A}function l(C,g){var B=this;p(g);var Q=e.peek(this.recordingProdStack),S=e.isArray(C)===!1,j=S===!1?C:C.DEF,R=new t.Alternation({definition:[],idx:g,ignoreAmbiguities:S&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(R.maxLookahead=C.MAX_LOOKAHEAD);var F=e.some(j,function(L){return e.isFunction(L.GATE)});return R.hasPredicates=F,Q.definition.push(R),e.forEach(j,function(L){var k=new t.Alternative({definition:[]});R.definition.push(k),e.has(L,"IGNORE_AMBIGUITIES")?k.ignoreAmbiguities=L.IGNORE_AMBIGUITIES:e.has(L,"GATE")&&(k.ignoreAmbiguities=!0),B.recordingProdStack.push(k),L.ALT.call(B),B.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function p(C){if(C<0||C>d){var g=new Error("Invalid DSL Method idx value: <"+C+`>
|
|
172
|
+
`+("Idx value must be a none negative value smaller than "+(d+1)));throw g.KNOWN_RECORDER_ERROR=!0,g}}}),as=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Se(),t=Xe(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(s){if(e.has(s,"traceInitPerf")){var o=s.traceInitPerf,c=typeof o=="number";this.traceInitMaxIdent=c?o:1/0,this.traceInitPerf=c?o>0:o}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(s,o){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+s+">");var A=e.timer(o),a=A.time,d=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+s+"> time: "+a+"ms"),this.traceInitIndent--,d}else return o()},r})();i.PerformanceTracer=n}),As=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var s=r.prototype;Object.getOwnPropertyNames(s).forEach(function(o){if(o!=="constructor"){var c=Object.getOwnPropertyDescriptor(s,o);c&&(c.get||c.set)?Object.defineProperty(t.prototype,o,c):t.prototype[o]=r.prototype[o]}})})}i.applyMixins=e}),Xe=Be(i=>{var e=i&&i.__extends||(function(){var Q=function(S,j){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,F){R.__proto__=F}||function(R,F){for(var L in F)Object.prototype.hasOwnProperty.call(F,L)&&(R[L]=F[L])},Q(S,j)};return function(S,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");Q(S,j);function R(){this.constructor=S}S.prototype=j===null?Object.create(j):(R.prototype=j.prototype,new R)}})();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=Se(),n=Vo(),r=ct(),s=Lt(),o=Jo(),c=ji(),A=Xo(),a=es(),d=ts(),u=ns(),b=is(),f=rs(),m=os(),E=ss(),l=as(),h=As();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:s.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(S,j){this.definitionErrors=[],this.selfAnalysisDone=!1;var R=this;if(R.initErrorHandler(j),R.initLexerAdapter(),R.initLooksAhead(j),R.initRecognizerEngine(S,j),R.initRecoverable(j),R.initTreeBuilder(j),R.initContentAssist(),R.initGastRecorder(j),R.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(
|
|
176
|
-
`+
|
|
175
|
+
For further details.`);this.skipValidations=t.has(j,"skipValidations")?j.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return Q.performSelfAnalysis=function(S){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},Q.prototype.performSelfAnalysis=function(){var S=this;this.TRACE_INIT("performSelfAnalysis",function(){var j;S.selfAnalysisDone=!0;var R=S.className;S.TRACE_INIT("toFastProps",function(){t.toFastProperties(S)}),S.TRACE_INIT("Grammar Recording",function(){try{S.enableRecording(),t.forEach(S.definedRulesNames,function(L){var k=S[L],x=k.originalGrammarAction,_=void 0;S.TRACE_INIT(L+" Rule",function(){_=S.topLevelRuleRecord(L,x)}),S.gastProductionsCache[L]=_})}finally{S.disableRecording()}});var F=[];if(S.TRACE_INIT("Grammar Resolving",function(){F=o.resolveGrammar({rules:t.values(S.gastProductionsCache)}),S.definitionErrors=S.definitionErrors.concat(F)}),S.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(F)&&S.skipValidations===!1){var L=o.validateGrammar({rules:t.values(S.gastProductionsCache),maxLookahead:S.maxLookahead,tokenTypes:t.values(S.tokensMap),errMsgProvider:s.defaultGrammarValidatorErrorProvider,grammarName:R});S.definitionErrors=S.definitionErrors.concat(L)}}),t.isEmpty(S.definitionErrors)&&(S.recoveryEnabled&&S.TRACE_INIT("computeAllProdsFollows",function(){var L=n.computeAllProdsFollows(t.values(S.gastProductionsCache));S.resyncFollows=L}),S.TRACE_INIT("ComputeLookaheadFunctions",function(){S.preComputeLookaheadFunctions(t.values(S.gastProductionsCache))})),!Q.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(S.definitionErrors))throw j=t.map(S.definitionErrors,function(L){return L.message}),new Error(`Parser Definition Errors detected:
|
|
176
|
+
`+j.join(`
|
|
177
177
|
-------------------------------
|
|
178
|
-
`))})},
|
|
178
|
+
`))})},Q.DEFER_DEFINITION_ERRORS_HANDLING=!1,Q})();i.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,d.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,m.ContentAssist,E.GastRecorder,l.PerformanceTracer]);var g=(function(Q){e(S,Q);function S(j,R){R===void 0&&(R=i.DEFAULT_PARSER_CONFIG);var F=this,L=t.cloneObj(R);return L.outputCst=!0,F=Q.call(this,j,L)||this,F}return S})(C);i.CstParser=g;var B=(function(Q){e(S,Q);function S(j,R){R===void 0&&(R=i.DEFAULT_PARSER_CONFIG);var F=this,L=t.cloneObj(R);return L.outputCst=!1,F=Q.call(this,j,L)||this,F}return S})(C);i.EmbeddedActionsParser=B}),cs=Be(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=Oi();function t(n,r){var s=r===void 0?{}:r,o=s.resourceBase,c=o===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":o,A=s.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,d=`
|
|
179
179
|
<!-- This is a generated file -->
|
|
180
180
|
<!DOCTYPE html>
|
|
181
181
|
<meta charset="utf-8">
|
|
@@ -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 d+u+b+f+m+E}i.createSyntaxDiagramsCode=t}),ls=Be(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=
|
|
206
|
+
`;return d+u+b+f+m+E}i.createSyntaxDiagramsCode=t}),ls=Be(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=Oi();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=Xe();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=kt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=ct();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 s=Lt();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return s.defaultParserErrorProvider}});var o=Bt();Object.defineProperty(i,"EarlyExitException",{enumerable:!0,get:function(){return o.EarlyExitException}}),Object.defineProperty(i,"isRecognitionException",{enumerable:!0,get:function(){return o.isRecognitionException}}),Object.defineProperty(i,"MismatchedTokenException",{enumerable:!0,get:function(){return o.MismatchedTokenException}}),Object.defineProperty(i,"NotAllInputParsedException",{enumerable:!0,get:function(){return o.NotAllInputParsedException}}),Object.defineProperty(i,"NoViableAltException",{enumerable:!0,get:function(){return o.NoViableAltException}});var c=Pi();Object.defineProperty(i,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=We();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=We();Object.defineProperty(i,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(i,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var d=yt();Object.defineProperty(i,"GAstVisitor",{enumerable:!0,get:function(){return d.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
207
207
|
It performs no action other than printing this message.
|
|
208
208
|
Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var b=cs();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return b.createSyntaxDiagramsCode}});var f=(function(){function m(){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 m})();i.Parser=f});const pt=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),_=new fs(y.tokenVocabulary),R=o(_.getBaseCstVisitorConstructor()),N=w.lex(T);_.input=N.tokens;const F=_.vrml();if(_.errors.length>0)throw console.error(_.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return R.visit(F)}function s(){const T=pt.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}),_=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],R=T({name:"Version",pattern:/#VRML.*/,longer_alt:w}),N=T({name:"NodeName",pattern:new RegExp(_.join("|")),longer_alt:w}),F=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}),ee=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:pt.Lexer.SKIPPED}),qe=[T({name:"WhiteSpace",pattern:/[ ,\s]/,group:pt.Lexer.SKIPPED}),N,F,G,z,ee,Pe,Le,ye,R,w,y,ae,Ie,ke,we,xe,Fe,Qe,Me],Ke={};for(let ve=0,de=qe.length;ve<de;ve++){const fe=qe[ve];Ke[fe.name]=fe}return{tokens:qe,tokenVocabulary:Ke}}function o(T){class y extends T{constructor(){super(),this.validateVisitor()}vrml(R){const N={version:this.visit(R.version),nodes:[],routes:[]};for(let F=0,G=R.node.length;F<G;F++){const z=R.node[F];N.nodes.push(this.visit(z))}if(R.route)for(let F=0,G=R.route.length;F<G;F++){const z=R.route[F];N.routes.push(this.visit(z))}return N}version(R){return R.Version[0].image}node(R){const N={name:R.NodeName[0].image,fields:[]};if(R.field)for(let F=0,G=R.field.length;F<G;F++){const z=R.field[F];N.fields.push(this.visit(z))}return R.def&&(N.DEF=this.visit(R.def[0])),N}field(R){const N={name:R.Identifier[0].image,type:null,values:null};let F;return R.singleFieldValue&&(F=this.visit(R.singleFieldValue[0])),R.multiFieldValue&&(F=this.visit(R.multiFieldValue[0])),N.type=F.type,N.values=F.values,N}def(R){return(R.Identifier||R.NodeName)[0].image}use(R){return{USE:(R.Identifier||R.NodeName)[0].image}}singleFieldValue(R){return w(this,R)}multiFieldValue(R){return w(this,R)}route(R){return{FROM:R.RouteIdentifier[0].image,TO:R.RouteIdentifier[1].image}}}function w(_,R){const N={type:null,values:[]};if(R.node){N.type="node";for(let F=0,G=R.node.length;F<G;F++){const z=R.node[F];N.values.push(_.visit(z))}}if(R.use){N.type="use";for(let F=0,G=R.use.length;F<G;F++){const z=R.use[F];N.values.push(_.visit(z))}}if(R.StringLiteral){N.type="string";for(let F=0,G=R.StringLiteral.length;F<G;F++){const z=R.StringLiteral[F];N.values.push(z.image.replace(/'|"/g,""))}}if(R.NumberLiteral){N.type="number";for(let F=0,G=R.NumberLiteral.length;F<G;F++){const z=R.NumberLiteral[F];N.values.push(parseFloat(z.image))}}if(R.HexLiteral){N.type="hex";for(let F=0,G=R.HexLiteral.length;F<G;F++){const z=R.HexLiteral[F];N.values.push(z.image)}}if(R.TrueLiteral){N.type="boolean";for(let F=0,G=R.TrueLiteral.length;F<G;F++)R.TrueLiteral[F].image==="TRUE"&&N.values.push(!0)}if(R.FalseLiteral){N.type="boolean";for(let F=0,G=R.FalseLiteral.length;F<G;F++)R.FalseLiteral[F].image==="FALSE"&&N.values.push(!1)}return R.NullLiteral&&(N.type="null",R.NullLiteral.forEach(function(){N.values.push(null)})),N}return new y}function c(T){const y=T.nodes,w=new I.Scene;for(let _=0,R=y.length;_<R;_++){const N=y[_];A(N)}for(let _=0,R=y.length;_<R;_++){const N=y[_],F=a(N);F instanceof I.Object3D&&w.add(F),N.name==="WorldInfo"&&(w.userData.worldInfo=F)}return w}function A(T){T.DEF&&(n[T.DEF]=T);const y=T.fields;for(let w=0,_=y.length;w<_;w++){const R=y[w];if(R.type==="node"){const N=R.values;for(let F=0,G=N.length;F<G;F++)A(N[F])}}}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=k(T);break;case"IndexedLineSet":w=H(T);break;case"PointSet":w=Q(T);break;case"Box":w=M(T);break;case"Cone":w=x(T);break;case"Cylinder":w=S(T);break;case"Sphere":w=D(T);break;case"ElevationGrid":w=L(T);break;case"Extrusion":w=V(T);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":w=B(T);break;case"WorldInfo":w=v(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 _=0,R=w.length;_<R;_++){const N=w[_],F=N.name,G=N.values;switch(F){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(),ee=G[3];y.quaternion.setFromAxisAngle(z,ee);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:",F);break}}return y}function b(T){const y=new I.Group;let w,_,R,N;const F=T.fields;for(let z=0,ee=F.length;z<ee;z++){const ae=F[z],Ie=ae.name,ke=ae.values;switch(Ie){case"groundAngle":w=ke;break;case"groundColor":_=ke;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":R=ke;break;case"skyColor":N=ke;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const G=1e4;if(N){const z=new I.SphereGeometry(G,32,16),ee=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,depthWrite:!1,depthTest:!1});N.length>3?(K(z,G,R,O(N),!0),ee.vertexColors=!0):ee.color.setRGB(N[0],N[1],N[2],I.SRGBColorSpace);const ae=new I.Mesh(z,ee);y.add(ae)}if(_&&_.length>0){const z=new I.SphereGeometry(G,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),ee=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});K(z,G,w,O(_),!1);const ae=new I.Mesh(z,ee);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}),_;for(let N=0,F=y.length;N<F;N++){const G=y[N],z=G.name,ee=G.values;switch(z){case"appearance":ee[0]!==null&&(w=a(ee[0]));break;case"geometry":ee[0]!==null&&(_=a(ee[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}let R;if(_&&_.attributes.position){const N=_._type;if(N==="points"){const F=new I.PointsMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});_.attributes.color!==void 0?F.vertexColors=!0:w.isMeshPhongMaterial&&F.color.copy(w.emissive),R=new I.Points(_,F)}else if(N==="line"){const F=new I.LineBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:w.opacity,transparent:w.transparent});_.attributes.color!==void 0?F.vertexColors=!0:w.isMeshPhongMaterial&&F.color.copy(w.emissive),R=new I.LineSegments(_,F)}else _._solid!==void 0&&(w.side=_._solid?I.FrontSide:I.DoubleSide),_.attributes.color!==void 0&&(w.vertexColors=!0),R=new I.Mesh(_,w)}else R=new I.Object3D,R.visible=!1;return R}function m(T){let y=new I.MeshPhongMaterial,w;const _=T.fields;for(let R=0,N=_.length;R<N;R++){const F=_[R],G=F.name,z=F.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 ee=z[0];ee!==null&&(ee.name==="ImageTexture"||ee.name==="PixelTexture"||ee.USE)&&(y.map=a(ee));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 _=0,R=w.length;_<R;_++){const N=w[_],F=N.name,G=N.values;switch(F){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:",F);break}}return y}function l(T,y,w){let _;switch(y){case Ze.INTENSITY:_=parseInt(T),w.r=_,w.g=_,w.b=_,w.a=1;break;case Ze.INTENSITY_ALPHA:_=parseInt("0x"+T.substring(2,4)),w.r=_,w.g=_,w.b=_,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,_=I.RepeatWrapping;const R=T.fields;for(let N=0,F=R.length;N<F;N++){const G=R[N],z=G.name,ee=G.values;switch(z){case"image":const ae=ee[0],Ie=ee[1],ke=ee[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=ee.length;we<Fe;we++,xe++){l(ee[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":ee[0]===!1&&(w=I.ClampToEdgeWrapping);break;case"repeatT":ee[0]===!1&&(_=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return y&&(y.wrapS=w,y.wrapT=_),y}function C(T){let y,w=I.RepeatWrapping,_=I.RepeatWrapping;const R=T.fields;for(let N=0,F=R.length;N<F;N++){const G=R[N],z=G.name,ee=G.values;switch(z){case"url":const ae=ee[0];ae&&(y=ie.load(ae));break;case"repeatS":ee[0]===!1&&(w=I.ClampToEdgeWrapping);break;case"repeatT":ee[0]===!1&&(_=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return y&&(y.wrapS=w,y.wrapT=_,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 _=0,R=w.length;_<R;_++){const N=w[_],F=N.name,G=N.values;switch(F){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:",F);break}}return y}function B(T){return T.fields[0].values}function v(T){const y={},w=T.fields;for(let _=0,R=w.length;_<R;_++){const N=w[_],F=N.name,G=N.values;switch(F){case"title":y.title=G[0];break;case"info":y.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return y}function k(T){let y,w,_,R,N=!0,F=!0,G=0,z,ee,ae,Ie,ke=!0,Pe=!0;const Le=T.fields;for(let De=0,qe=Le.length;De<qe;De++){const Ke=Le[De],ve=Ke.name,de=Ke.values;switch(ve){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&&(_=a(pe));break;case"texCoord":const Ee=de[0];Ee!==null&&(R=a(Ee));break;case"ccw":N=de[0];break;case"colorIndex":z=de;break;case"colorPerVertex":ke=de[0];break;case"convex":break;case"coordIndex":ee=de;break;case"creaseAngle":G=de[0];break;case"normalIndex":ae=de;break;case"normalPerVertex":Pe=de[0];break;case"solid":F=de[0];break;case"texCoordIndex":Ie=de;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ve);break}}if(ee===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new I.BufferGeometry;const ye=X(ee,N);let we,xe,Fe;if(y){if(ke===!0)if(z&&z.length>0){const De=X(z,N);we=ne(ye,De,y,3)}else we=me(ye,new I.Float32BufferAttribute(y,3));else if(z&&z.length>0){const De=le(y,z),qe=$(De,ee);we=ce(ye,qe)}else{const De=$(y,ee);we=ce(ye,De)}Y(we)}if(_)if(Pe===!0)if(ae&&ae.length>0){const De=X(ae,N);xe=ne(ye,De,_,3)}else xe=me(ye,new I.Float32BufferAttribute(_,3));else if(ae&&ae.length>0){const De=le(_,ae),qe=$(De,ee);xe=ce(ye,qe)}else{const De=$(_,ee);xe=ce(ye,De)}else xe=Ve(ye,w,G);if(R)if(Ie&&Ie.length>0){const De=X(Ie,N);Fe=ne(ye,De,R,2)}else Fe=me(ye,new I.Float32BufferAttribute(R,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=F,Qe._type="mesh",Qe}function H(T){let y,w,_,R,N=!0;const F=T.fields;for(let Ie=0,ke=F.length;Ie<ke;Ie++){const Pe=F[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":_=ye;break;case"colorPerVertex":N=ye[0];break;case"coordIndex":R=ye;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Le);break}}let G;const z=re(R);if(y){if(N===!0)if(_.length>0){const Ie=re(_);G=ne(z,Ie,y,3)}else G=me(z,new I.Float32BufferAttribute(y,3));else if(_.length>0){const Ie=le(y,_),ke=oe(Ie,R);G=Ce(z,ke)}else{const Ie=oe(y,R);G=Ce(z,Ie)}Y(G)}const ee=new I.BufferGeometry,ae=me(z,new I.Float32BufferAttribute(w,3));return ee.setAttribute("position",ae),G&&ee.setAttribute("color",G),ee._type="line",ee}function Q(T){let y,w;const _=T.fields;for(let N=0,F=_.length;N<F;N++){const G=_[N],z=G.name,ee=G.values;switch(z){case"color":const ae=ee[0];ae!==null&&(y=a(ae));break;case"coord":const Ie=ee[0];Ie!==null&&(w=a(Ie));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}const R=new I.BufferGeometry;if(R.setAttribute("position",new I.Float32BufferAttribute(w,3)),y){const N=new I.Float32BufferAttribute(y,3);Y(N),R.setAttribute("color",N)}return R._type="points",R}function M(T){const y=new I.Vector3(2,2,2),w=T.fields;for(let R=0,N=w.length;R<N;R++){const F=w[R],G=F.name,z=F.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 x(T){let y=1,w=2,_=!1;const R=T.fields;for(let F=0,G=R.length;F<G;F++){const z=R[F],ee=z.name,ae=z.values;switch(ee){case"bottom":_=!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:",ee);break}}return new I.ConeGeometry(y,w,16,1,_)}function S(T){let y=1,w=2;const _=T.fields;for(let N=0,F=_.length;N<F;N++){const G=_[N],z=G.name,ee=G.values;switch(z){case"bottom":break;case"radius":y=ee[0];break;case"height":w=ee[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 D(T){let y=1;const w=T.fields;for(let R=0,N=w.length;R<N;R++){const F=w[R],G=F.name,z=F.values;G==="radius"?y=z[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.SphereGeometry(y,16,16)}function L(T){let y,w,_,R,N=!0,F=!0,G=!0,z=!0,ee=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 it=Ee[0];it!==null&&(w=a(it));break;case"texCoord":const rt=Ee[0];rt!==null&&(_=a(rt));break;case"height":R=Ee;break;case"ccw":z=Ee[0];break;case"colorPerVertex":N=Ee[0];break;case"creaseAngle":ee=Ee[0];break;case"normalPerVertex":F=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=R[ue],Oe=Pe*fe;if(ye.push(pe,Ee,Oe),y&&N===!0){const it=y[ue*3+0],rt=y[ue*3+1],Nt=y[ue*3+2];xe.push(it,rt,Nt)}if(w&&F===!0){const it=w[ue*3+0],rt=w[ue*3+1],Nt=w[ue*3+2];we.push(it,rt,Nt)}if(_){const it=_[ue*2+0],rt=_[ue*2+1];Fe.push(it,rt)}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(N===!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(F===!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,ee);const ve=new I.BufferGeometry;return ve.setAttribute("position",Me),ve.setAttribute("normal",Ke),ve.setAttribute("uv",De),qe&&ve.setAttribute("color",qe),ve._solid=G,ve._type="mesh",ve}function V(T){let y=[1,1,1,-1,-1,-1,-1,1,1,1],w=[0,0,0,0,1,0],_,R,N=!0,F=!0,G=0,z=!0,ee=!0;const ae=T.fields;for(let ve=0,de=ae.length;ve<de;ve++){const fe=ae[ve],ue=fe.name,pe=fe.values;switch(ue){case"beginCap":N=pe[0];break;case"ccw":F=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":R=pe;break;case"scale":_=pe;break;case"solid":ee=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 ve=0,de=0,fe=0,ue=w.length;ve<ue;ve+=3,de+=2,fe+=4){Pe.fromArray(w,ve),Le.x=_?_[de+0]:1,Le.y=1,Le.z=_?_[de+1]:1,ye.x=R?R[fe+0]:0,ye.y=R?R[fe+1]:0,ye.z=R?R[fe+2]:1;const pe=R?R[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 ve=0;ve<Qe-1;ve++)for(let de=0;de<Me-1;de++){const fe=de+ve*Me;let ue=de+1+ve*Me;const pe=de+(ve+1)*Me;let Ee=de+1+(ve+1)*Me;de===Me-2&&Ie===!0&&(ue=ve*Me,Ee=(ve+1)*Me),F===!0?(Fe.push(fe,ue,pe),Fe.push(pe,ue,Ee)):(Fe.push(fe,pe,ue),Fe.push(pe,Ee,ue))}if(N===!0||z===!0){const ve=[];for(let ue=0,pe=y.length;ue<pe;ue+=2)ve.push(new I.Vector2(y[ue],y[ue+1]));const de=I.ShapeUtils.triangulateShape(ve,[]),fe=[];for(let ue=0,pe=de.length;ue<pe;ue++){const Ee=de[ue];fe.push(Ee[0],Ee[1],Ee[2])}if(N===!0)for(let ue=0,pe=fe.length;ue<pe;ue+=3)F===!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)F===!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=ee,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,_=T.length;w<_;w++){const R=a(T[w]);R instanceof I.Object3D&&y.add(R)}}function X(T,y){const w=[];let _=0;for(let R=0,N=T.length;R<N;R++){const F=T[_],G=T[R+(y?1:2)],z=T[R+(y?2:1)];w.push(F,G,z),(T[R+3]===-1||R+3>=N)&&(R+=3,_=R+1)}return w}function $(T,y){const w=[];let _=0;for(let R=0,N=y.length;R<N;R++){const F=_*3,G=T[F],z=T[F+1],ee=T[F+2];w.push(G,z,ee),(y[R+3]===-1||R+3>=N)&&(R+=3,_++)}return w}function le(T,y){const w=[];for(let _=0,R=y.length;_<R;_++){const F=y[_]*3,G=T[F],z=T[F+1],ee=T[F+2];w.push(G,z,ee)}return w}function re(T){const y=[];for(let w=0,_=T.length;w<_;w++){const R=T[w],N=T[w+1];y.push(R,N),(T[w+2]===-1||w+2>=_)&&(w+=2)}return y}function oe(T,y){const w=[];let _=0;for(let R=0,N=y.length;R<N;R++){const F=_*3,G=T[F],z=T[F+1],ee=T[F+2];w.push(G,z,ee),(y[R+2]===-1||R+2>=N)&&(R+=2,_++)}return w}const te=new I.Vector3,he=new I.Vector3,P=new I.Vector3,j=new I.Vector2,W=new I.Vector2,Z=new I.Vector2;function ne(T,y,w,_){const R=[];for(let N=0,F=T.length;N<F;N+=3){const G=y[N],z=y[N+1],ee=y[N+2];_===2?(j.fromArray(w,G*_),W.fromArray(w,z*_),Z.fromArray(w,ee*_),R.push(j.x,j.y),R.push(W.x,W.y),R.push(Z.x,Z.y)):(te.fromArray(w,G*_),he.fromArray(w,z*_),P.fromArray(w,ee*_),R.push(te.x,te.y,te.z),R.push(he.x,he.y,he.z),R.push(P.x,P.y,P.z))}return new I.Float32BufferAttribute(R,_)}function ce(T,y){const w=[];for(let _=0,R=0,N=T.length;_<N;_+=3,R++)te.fromArray(y,R*3),w.push(te.x,te.y,te.z),w.push(te.x,te.y,te.z),w.push(te.x,te.y,te.z);return new I.Float32BufferAttribute(w,3)}function Ce(T,y){const w=[];for(let _=0,R=0,N=T.length;_<N;_+=2,R++)te.fromArray(y,R*3),w.push(te.x,te.y,te.z),w.push(te.x,te.y,te.z);return new I.Float32BufferAttribute(w,3)}function me(T,y){const w=y.array,_=y.itemSize,R=new w.constructor(T.length*_);let N=0,F=0;for(let G=0,z=T.length;G<z;G++){N=T[G]*_;for(let ee=0;ee<_;ee++)R[F++]=w[N++]}return new I.Float32BufferAttribute(R,_)}const Ne=new I.Vector3,je=new I.Vector3;function Ve(T,y,w){const _=[],R={};for(let F=0,G=T.length;F<G;F+=3){const z=T[F],ee=T[F+1],ae=T[F+2],Ie=new ps(z,ee,ae);te.fromArray(y,z*3),he.fromArray(y,ee*3),P.fromArray(y,ae*3),je.subVectors(P,he),Ne.subVectors(te,he),je.cross(Ne),je.normalize(),Ie.normal.copy(je),R[z]===void 0&&(R[z]=[]),R[ee]===void 0&&(R[ee]=[]),R[ae]===void 0&&(R[ae]=[]),R[z].push(Ie.normal),R[ee].push(Ie.normal),R[ae].push(Ie.normal),_.push(Ie)}const N=[];for(let F=0,G=_.length;F<G;F++){const z=_[F],ee=Ue(R[z.a],z.normal,w),ae=Ue(R[z.b],z.normal,w),Ie=Ue(R[z.c],z.normal,w);te.fromArray(y,z.a*3),he.fromArray(y,z.b*3),P.fromArray(y,z.c*3),N.push(ee.x,ee.y,ee.z),N.push(ae.x,ae.y,ae.z),N.push(Ie.x,Ie.y,Ie.z)}return new I.Float32BufferAttribute(N,3)}function Ue(T,y,w){const _=new I.Vector3;if(w===0)_.copy(y);else for(let R=0,N=T.length;R<N;R++)T[R].angleTo(y)<w&&_.add(T[R]);return _.normalize()}function O(T){const y=[];for(let w=0,_=T.length;w<_;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,_,R){const N=[],F=R===!0?0:Math.PI;for(let ke=0,Pe=_.length;ke<Pe;ke++){let Le=ke===0?0:w[ke-1];Le=R===!0?Le:F-Le;const ye=new I.Vector3;ye.setFromSphericalCoords(y,Le,0),N.push(ye)}const G=T.index,z=T.attributes.position,ee=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<N.length;Qe++){Le=Qe-1,ye=Qe;const Me=N[Le],De=N[ye];if(R===!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=_[Le],Fe=_[ye];Ie.copy(xe).lerp(Fe,we),I.ColorManagement.colorSpaceToWorking(Ie,I.SRGBColorSpace),ee.setXYZ(Pe,Ie.r,Ie.g,Ie.b)}T.setAttribute("color",ee)}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 pt.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=pt.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 v=l.frames[B];h.push(v.time),p.push(v.position.x+l.offset.x),p.push(v.position.y+l.offset.y),p.push(v.position.z+l.offset.z),C.push(v.rotation.x),C.push(v.rotation.y),C.push(v.rotation.z),C.push(v.rotation.w),g.push(v.scale.x),g.push(v.scale.y),g.push(v.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 Bt;async function Es(i,e){return Bt||(Bt=new us),Bt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(Cr(i,n)))),await Bt.loadAsync(e)}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 mt{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 k=t.zipUrl+"!"+m;zt[k]||(zt[k]=await ms(t,m)),f=Is(zt[k]),f&&f.clip.tracks.forEach(H=>{H.setInterpolation(se.InterpolateDiscrete)})}else f=new Ln;const E={};f.skeleton.bones.forEach(k=>{E[k.name]=k});const l=u.getAttribute("scale"),h=l?Number(l):1,p=u.getAttribute("offset"),C=new Ae;if(p){const k=p.split(" ");C.set(Number(k[0]),Number(k[1]),Number(k[2]))}const g={},B=u.getElementsByTagNameNS(o,"p");for(const k of Array.from(B)){const H=k.getAttribute("name"),Q=k.getAttribute("wrl");if(H&&Q){const M=t.zipUrl+"!"+Q;Wt[M]||(Wt[M]=await Es(t,Q)),g[H]=Wt[M].clone(!0)}}const v=new se.Object3D;v.add(f.skeleton.bones[0]),f instanceof Ln?Object.values(g).forEach(k=>{v.add(k)}):qi(v,g),v.position.add(C),v.scale.set(h,h,h),v.traverse(k=>{k.userData.a3js={objectA3:this}}),a[b]={name:b,shape:{root:v,bones:E,skeleton:f.skeleton},motion:new sn(f.clip,b)}}}return d&&this.syncInit(d,a),this}}function qi(i,e){if(fr(i)){const t=e[i.name];t&&i.add(t)}i.children&&i.children.forEach(t=>{qi(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 Rs extends _e{constructor(e){super(e)}initObject(e){return new Gn(e)}}const Ki={touchDevice:navigator.maxTouchPoints>0};class zi extends HTMLElement{option;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;constructor(e={}){super(),this.option={...Ki,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
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=`
|
|
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()}}customElements.define("game-canvas-a3",zi);const Wi={offset:.01,auto:!0,height:1.5,radius:.3};class vs{trans;objectA3;completeOption;controller;bodyDesc;body;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOption={...Wi,...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&&nt.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),nt.delete(this.collider.handle))}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 Vi={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,wheelFLPosition:{x:1,y:0,z:1.5},wheelFRPosition:{x:-1,y:0,z:1.5},wheelRLPosition:{x:1,y:0,z:-1.5},wheelRRPosition:{x:-1,y:0,z:-1.5},wheelFLRadius:.3,wheelFRRadius:.3,wheelRLRadius:.3,wheelRRRadius:.3,wheelFLWidth:.4,wheelFRWidth:.4,wheelRLWidth:.4,wheelRRWidth:.4,wheelFLSuspensionRestLength:.8,wheelFRSuspensionRestLength:.8,wheelRLSuspensionRestLength:.8,wheelRRSuspensionRestLength:.8,wheelFLDirection:{x:0,y:-1,z:0},wheelFRDirection:{x:0,y:-1,z:0},wheelRLDirection:{x:0,y:-1,z:0},wheelRRDirection:{x:0,y:-1,z:0},wheelFLAxle:{x:-1,y:0,z:0},wheelFRAxle:{x:-1,y:0,z:0},wheelRLAxle:{x:-1,y:0,z:0},wheelRRAxle:{x:-1,y:0,z:0},wheelFLSuspensionStiffness:24,wheelFRSuspensionStiffness:24,wheelRLSuspensionStiffness:24,wheelRRSuspensionStiffness:24,wheelFLSuspensionCompression:4,wheelFRSuspensionCompression:4,wheelRLSuspensionCompression:4,wheelRRSuspensionCompression:4,wheelFLSuspensionRelaxation:3,wheelFRSuspensionRelaxation:3,wheelRLSuspensionRelaxation:3,wheelRRSuspensionRelaxation:3,wheelFLWheelFrictionSlip:100,wheelFRWheelFrictionSlip:100,wheelRLWheelFrictionSlip:100,wheelRRWheelFrictionSlip:100,wheelFLMaxSuspensionTravel:.25,wheelFRMaxSuspensionTravel:.25,wheelRLMaxSuspensionTravel:.25,wheelRRMaxSuspensionTravel:.25};class Qs{opt;trans;motion;constructor(e){this.opt={...Vi,...e},this.trans=new Yi(this),this.motion=new Ji(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 Yi{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){this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&nt.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller&&(this.controller.addWheel(this.cc.opt.wheelFLPosition,this.cc.opt.wheelFLDirection,this.cc.opt.wheelFLAxle,this.cc.opt.wheelFLSuspensionRestLength,this.cc.opt.wheelFLRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFLSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFLSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFLSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFLWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFLMaxSuspensionTravel),this.controller.addWheel(this.cc.opt.wheelFRPosition,this.cc.opt.wheelFRDirection,this.cc.opt.wheelFRAxle,this.cc.opt.wheelFRSuspensionRestLength,this.cc.opt.wheelFRRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFRSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFRSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFRSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFRWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFRMaxSuspensionTravel),this.controller.addWheel(this.cc.opt.wheelRLPosition,this.cc.opt.wheelRLDirection,this.cc.opt.wheelRLAxle,this.cc.opt.wheelRLSuspensionRestLength,this.cc.opt.wheelRLRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRLSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRLSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRLSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRLWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRLMaxSuspensionTravel),this.controller.addWheel(this.cc.opt.wheelRRPosition,this.cc.opt.wheelRRDirection,this.cc.opt.wheelRRAxle,this.cc.opt.wheelRRSuspensionRestLength,this.cc.opt.wheelRRRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRRSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRRSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRRSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRRWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRRMaxSuspensionTravel))}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),nt.delete(this.chassisCollider.handle))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}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 Ji{cm;name;playCount;time;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(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.wheelFLAxle),h=new Ae(this.cm.opt.wheelFLPosition),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.wheelFRAxle),h=new Ae(this.cm.opt.wheelFRPosition),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.wheelRLAxle),h=new Ae(this.cm.opt.wheelRLPosition),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.wheelRRAxle),h=new Ae(this.cm.opt.wheelRRPosition),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=mt;exports.AvatarController=Lr;exports.Box=ys;exports.Camera=On;exports.Canvas=_i;exports.CarControl=Qs;exports.CarMotion=Ji;exports.CarTransformer=Yi;exports.CharactorTransformer=vs;exports.ClipMotion=sn;exports.ControllerBase=Qt;exports.DefaultTransformer=gt;exports.FixedTransformer=or;exports.FollowAvatarController=kr;exports.GLTF=No;exports.GameCanvas=zi;exports.GeneralCamera=It;exports.HTML=Rs;exports.Image=Ts;exports.ObjectA3=_e;exports.OrbitController=Mn;exports.Quat=be;exports.RapierPhysicsEngine=Et;exports.RapierPhysicsWorld=nn;exports.Scene=Fn;exports.Sound=st;exports.Sphere=Bs;exports.StandardLights=ws;exports.Test=Go;exports.Text3D=zo;exports.ThreeJS=Cs;exports.Transform=He;exports.Vec3=Ae;exports.Window=Ni;exports.asyncSleep=br;exports.collisionMap=nt;exports.deepMerge=vt;exports.defaultCanvasOption=Li;exports.defaultCarControlOption=Vi;exports.defaultCharactorTransOption=Wi;exports.defaultGameCanvasOption=Ki;exports.defaultWindowOption=xi;exports.getQuatOfLookAt=et;exports.initFont=Ko;exports.initPhysics=Ir;exports.initSound=xr;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",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;
|
|
293
293
|
//# sourceMappingURL=a3js.cjs.js.map
|