@scenoco-three/editor 0.6.0 → 0.7.0

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.
Files changed (76) hide show
  1. package/README.md +31 -44
  2. package/bin/serve.js +37 -0
  3. package/dist/editor.js +12521 -0
  4. package/package.json +26 -34
  5. package/dist/cli/index.d.ts +0 -2
  6. package/dist/cli/index.js +0 -56
  7. package/dist-app/assets/EffectComposer-lekj9UUq.js +0 -1
  8. package/dist-app/assets/GLTFLoader-C2lUhzim.js +0 -1
  9. package/dist-app/assets/OutputPass-DZtd342R.js +0 -72
  10. package/dist-app/assets/Pass-BP3b3hlf.js +0 -1
  11. package/dist-app/assets/RenderPass-BjVchlYg.js +0 -1
  12. package/dist-app/assets/ShaderPass-DMXLcV9X.js +0 -24
  13. package/dist-app/assets/SkeletonUtils-Cxy_owx9.js +0 -1
  14. package/dist-app/assets/index-AxOpglZ-.css +0 -1
  15. package/dist-app/assets/index-D-Iq7tix.js +0 -4135
  16. package/dist-app/assets/inter-CaiW00F8.js +0 -1
  17. package/dist-app/assets/registry-BOM35tSr.js +0 -1433
  18. package/dist-app/assets/worker-_Lh8Vt-i.js +0 -1270
  19. package/dist-app/examples/breakout/assets/geometry/ball.geometry.xml +0 -1
  20. package/dist-app/examples/breakout/assets/geometry/brick.geometry.xml +0 -1
  21. package/dist-app/examples/breakout/assets/geometry/floor-sensor.geometry.xml +0 -1
  22. package/dist-app/examples/breakout/assets/geometry/paddle.geometry.xml +0 -1
  23. package/dist-app/examples/breakout/assets/geometry/wall-side.geometry.xml +0 -1
  24. package/dist-app/examples/breakout/assets/geometry/wall-top.geometry.xml +0 -1
  25. package/dist-app/examples/breakout/assets/materials/ball.material.xml +0 -1
  26. package/dist-app/examples/breakout/assets/materials/brick-firm.material.xml +0 -1
  27. package/dist-app/examples/breakout/assets/materials/brick-hard.material.xml +0 -1
  28. package/dist-app/examples/breakout/assets/materials/brick-soft.material.xml +0 -1
  29. package/dist-app/examples/breakout/assets/materials/paddle.material.xml +0 -10
  30. package/dist-app/examples/breakout/assets/materials/wall.material.xml +0 -1
  31. package/dist-app/examples/breakout/assets/render/neon.render.xml +0 -14
  32. package/dist-app/examples/breakout/assets/scenes/arena.prefab.xml +0 -68
  33. package/dist-app/examples/breakout/assets/scenes/brick.prefab.xml +0 -15
  34. package/dist-app/examples/breakout/assets/scenes/hud.scene.xml +0 -56
  35. package/dist-app/examples/breakout/assets/scenes/level-1.scene.xml +0 -36
  36. package/dist-app/examples/breakout/assets/scenes/level-2.scene.xml +0 -36
  37. package/dist-app/examples/breakout/assets/scenes/level-3.scene.xml +0 -36
  38. package/dist-app/examples/castle/assets/geometry/capsule.geometry.xml +0 -3
  39. package/dist-app/examples/castle/assets/geometry/cone.geometry.xml +0 -2
  40. package/dist-app/examples/castle/assets/geometry/cube.geometry.xml +0 -3
  41. package/dist-app/examples/castle/assets/geometry/cylinder.geometry.xml +0 -3
  42. package/dist-app/examples/castle/assets/geometry/plane.geometry.xml +0 -4
  43. package/dist-app/examples/castle/assets/geometry/quad.geometry.xml +0 -3
  44. package/dist-app/examples/castle/assets/geometry/sphere.geometry.xml +0 -2
  45. package/dist-app/examples/castle/assets/materials/grass.material.xml +0 -1
  46. package/dist-app/examples/castle/assets/materials/roof.material.xml +0 -1
  47. package/dist-app/examples/castle/assets/materials/stone.material.xml +0 -1
  48. package/dist-app/examples/castle/assets/materials/wood.material.xml +0 -1
  49. package/dist-app/examples/castle/assets/scenes/main.scene.xml +0 -25
  50. package/dist-app/examples/collector/assets/geometry/capsule.geometry.xml +0 -3
  51. package/dist-app/examples/collector/assets/geometry/cone.geometry.xml +0 -2
  52. package/dist-app/examples/collector/assets/geometry/cube.geometry.xml +0 -3
  53. package/dist-app/examples/collector/assets/geometry/cylinder.geometry.xml +0 -3
  54. package/dist-app/examples/collector/assets/geometry/plane.geometry.xml +0 -4
  55. package/dist-app/examples/collector/assets/geometry/quad.geometry.xml +0 -3
  56. package/dist-app/examples/collector/assets/geometry/sphere.geometry.xml +0 -2
  57. package/dist-app/examples/collector/assets/materials/crate.material.xml +0 -1
  58. package/dist-app/examples/collector/assets/materials/depot.material.xml +0 -1
  59. package/dist-app/examples/collector/assets/materials/ground.material.xml +0 -1
  60. package/dist-app/examples/collector/assets/materials/player.material.xml +0 -1
  61. package/dist-app/examples/collector/assets/scenes/crate.prefab.xml +0 -9
  62. package/dist-app/examples/collector/assets/scenes/main.scene.xml +0 -83
  63. package/dist-app/examples/playable/assets/geometry/capsule.geometry.xml +0 -3
  64. package/dist-app/examples/playable/assets/geometry/cone.geometry.xml +0 -2
  65. package/dist-app/examples/playable/assets/geometry/cube.geometry.xml +0 -3
  66. package/dist-app/examples/playable/assets/geometry/cylinder.geometry.xml +0 -3
  67. package/dist-app/examples/playable/assets/geometry/plane.geometry.xml +0 -4
  68. package/dist-app/examples/playable/assets/geometry/quad.geometry.xml +0 -3
  69. package/dist-app/examples/playable/assets/geometry/sphere.geometry.xml +0 -2
  70. package/dist-app/examples/playable/assets/materials/ground.material.xml +0 -1
  71. package/dist-app/examples/playable/assets/materials/target.material.xml +0 -2
  72. package/dist-app/examples/playable/assets/scenes/main.scene.xml +0 -53
  73. package/dist-app/examples/playable/assets/scenes/target.prefab.xml +0 -9
  74. package/dist-app/examples.json +0 -68
  75. package/dist-app/index.html +0 -14
  76. package/dist-app/model.json +0 -1
@@ -1,1433 +0,0 @@
1
- import{At as e,Ct as t,D as n,Dt as r,F as i,Gt as a,H as o,Ht as s,Jt as c,Kt as l,M as u,Mt as d,O as f,P as p,Pt as m,Rt as h,S as g,Tt as _,Vt as v,W as y,Wt as b,Xt as x,Zt as S,_ as C,_t as w,a as T,at as E,b as D,c as O,ct as ee,gt as te,h as ne,ht as re,i as ie,it as ae,kt as oe,l as se,lt as ce,m as le,n as ue,nt as k,o as de,ot as fe,p as pe,qt as A,r as me,rt as he,s as ge,st as _e,t as ve,tt as ye,u as be,v as xe,vt as Se,w as Ce,x as we,y as Te,yt as Ee,zt as De}from"./index-D-Iq7tix.js";import{n as Oe,t as ke}from"./ShaderPass-DMXLcV9X.js";import{n as Ae,t as je}from"./Pass-BP3b3hlf.js";function Me(e,t){return e.shape===`box`&&t.shape===`box`?Ne(e,t):e.shape===`capsule`&&t.shape===`capsule`?Pe(e,t):e.shape===`box`?Fe(e,t):Fe(t,e)}function Ne(e,t){return Math.abs(e.center.x-t.center.x)<=e.half.x+t.half.x&&Math.abs(e.center.y-t.center.y)<=e.half.y+t.half.y&&Math.abs(e.center.z-t.center.z)<=e.half.z+t.half.z}function Pe(e,t){let n=e.radius+t.radius;return Ie(e.a,e.b,t.a,t.b)<=n*n}function Fe(e,t){return Le(t.a,t.b,e.center,e.half)<=t.radius*t.radius}function Ie(e,t,n,r){let{d1:i,d2:a,r:o,c1:s,c2:c}=Be;i.subVectors(t,e),a.subVectors(r,n),o.subVectors(e,n);let l=i.dot(i),u=a.dot(a),d=a.dot(o),f=1e-12,p,m;if(l<=f&&u<=f)return o.dot(o);if(l<=f)p=0,m=ze(d/u);else{let e=i.dot(o);if(u<=f)m=0,p=ze(-e/l);else{let t=i.dot(a),n=l*u-t*t;p=n>f?ze((t*d-e*u)/n):0,m=(t*p+d)/u,m<0?(m=0,p=ze(-e/l)):m>1&&(m=1,p=ze((t-e)/l))}}return s.copy(e).addScaledVector(i,p),c.copy(n).addScaledVector(a,m),s.distanceToSquared(c)}function Le(e,t,n,r){let i=i=>(Be.p.copy(e).lerp(t,i),Re(Be.p,n,r)),a=0,o=1;for(let e=0;e<40;e++){let e=a+(o-a)/3,t=o-(o-a)/3;i(e)<i(t)?o=t:a=e}return i((a+o)/2)}function Re(e,t,n){let r=Math.max(0,Math.abs(e.x-t.x)-n.x),i=Math.max(0,Math.abs(e.y-t.y)-n.y),a=Math.max(0,Math.abs(e.z-t.z)-n.z);return r*r+i*i+a*a}function ze(e){return e<0?0:e>1?1:e}var Be={d1:new c,d2:new c,r:new c,c1:new c,c2:new c,p:new c},Ve=class extends de{colliders=[];bounds=[];previous=new Set;current=new Set;pairs=new Map;ids=new WeakMap;nextId=1;add(e){this.colliders.includes(e)||this.colliders.push(e)}remove(e){let t=this.colliders.indexOf(e);t!==-1&&this.colliders.splice(t,1);for(let[t,n]of this.pairs){if(n[0]!==e&&n[1]!==e)continue;this.pairs.delete(t),this.previous.delete(t),this.current.delete(t);let r=n[0]===e?n[1]:n[0];r.object3D&&e.object3D&&!r.isDestroyed&&Ue(r.object3D,e.object3D,n[0].isSensor||n[1].isSensor,`exit`)}}update(){let e=this.colliders;if(e.length===0){this.previous.clear();return}this.scene.updateMatrixWorld(),this.bounds.length=e.length;for(let t=0;t<e.length;t++)this.bounds[t]=e[t].worldBounds();this.current.clear();for(let t=0;t<e.length;t++){let n=e[t];if(n.isActiveAndEnabled)for(let r=t+1;r<e.length;r++){let i=e[r];if(!i.isActiveAndEnabled||n.object3D===i.object3D||!Me(this.bounds[t],this.bounds[r]))continue;let a=this.pairKey(n,i);this.current.add(a),this.pairs.set(a,[n,i]),this.previous.has(a)||He(n,i,`enter`),this.previous.delete(a)}}for(let e of this.previous){let t=this.pairs.get(e);t&&He(t[0],t[1],`exit`),this.pairs.delete(e)}let t=this.previous;this.previous=this.current,this.current=t}onDestroy(){this.colliders.length=0,this.bounds.length=0,this.previous.clear(),this.current.clear(),this.pairs.clear()}pairKey(e,t){let n=this.idOf(e),r=this.idOf(t);return n<r?`${n}:${r}`:`${r}:${n}`}idOf(e){let t=this.ids.get(e);return t===void 0&&this.ids.set(e,t=this.nextId++),t}};function He(e,t,n){let r=e.isSensor||t.isSensor;Ue(e.object3D,t.object3D,r,n),Ue(t.object3D,e.object3D,r,n)}function Ue(e,t,n,r){for(let i of e.components)i.isDestroyed||i._pendingDestroy||(n?r===`enter`?i.onTriggerEnter:i.onTriggerExit:r===`enter`?i.onCollisionEnter:i.onCollisionExit)?.call(i,t)}var We=class extends ge{kind=`dynamic`;gravityScale=1},Ge=class extends ge{restitution=0;friction=.5;density=1;isSensor=!1;awake(){this.requireSystem(Ve).add(this)}onDestroy(){this.getSystem(Ve)?.remove(this)}},Ke=class extends Ge{halfExtents=new c(.5,.5,.5);center=new c;half=new c;cached={shape:`box`,center:this.center,half:this.half};worldBounds(){return this.object3D.getWorldPosition(this.center),this.object3D.getWorldScale(this.half),this.half.set(Math.abs(this.half.x)*this.halfExtents.x,Math.abs(this.half.y)*this.halfExtents.y,Math.abs(this.half.z)*this.halfExtents.z),this.cached}},qe=class extends Ge{radius=.5;center=new c;scale=new c;cached={shape:`capsule`,a:this.center,b:this.center,radius:.5};worldBounds(){this.object3D.getWorldPosition(this.center),this.object3D.getWorldScale(this.scale);let e=Math.max(Math.abs(this.scale.x),Math.abs(this.scale.y),Math.abs(this.scale.z));return this.cached.radius=this.radius*e,this.cached}},Je=class extends Ge{radius=.5;halfHeight=.5;a=new c;b=new c;axis=new c;scale=new c;rotation=new _;cached={shape:`capsule`,a:this.a,b:this.b,radius:.5};worldBounds(){return this.object3D.getWorldScale(this.scale),this.object3D.getWorldPosition(this.a),this.b.copy(this.a),this.axis.set(0,this.halfHeight*Math.abs(this.scale.y),0).applyQuaternion(this.object3D.getWorldQuaternion(this.rotation)),this.a.sub(this.axis),this.b.add(this.axis),this.cached.radius=this.radius*Math.max(Math.abs(this.scale.x),Math.abs(this.scale.z)),this.cached}},Ye=class extends Ge{radius=.5;halfHeight=.5;a=new c;b=new c;axis=new c;scale=new c;rotation=new _;cached={shape:`capsule`,a:this.a,b:this.b,radius:.5};worldBounds(){return this.object3D.getWorldScale(this.scale),this.object3D.getWorldPosition(this.a),this.b.copy(this.a),this.axis.set(0,this.halfHeight*Math.abs(this.scale.y),0).applyQuaternion(this.object3D.getWorldQuaternion(this.rotation)),this.a.sub(this.axis),this.b.add(this.axis),this.cached.radius=this.radius*Math.max(Math.abs(this.scale.x),Math.abs(this.scale.z)),this.cached}},Xe=class extends Ge{halfExtents=new A(5,5);center=new c;scale=new c;half=new c;cached={shape:`box`,center:this.center,half:this.half};worldBounds(){return this.object3D.getWorldPosition(this.center),this.object3D.getWorldScale(this.scale),this.half.set(Math.abs(this.scale.x)*this.halfExtents.x,Ze,Math.abs(this.scale.z)*this.halfExtents.y),this.cached}},Ze=.05,Qe=S({BoxCollider:()=>Ke,CapsuleCollider:()=>Je,Collider:()=>Ge,Collision:()=>Ve,CylinderCollider:()=>Ye,PlaneCollider:()=>Xe,RigidBody:()=>We,SphereCollider:()=>qe,overlaps:()=>Me}),$e=Symbol.for(`preact-signals`);function et(){if(at>1)at--;else{var e,t=!1;for((function(){var e=lt;for(lt=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();it!==void 0;){var n=it;for(it=void 0,ot++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&pt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ot=0,at--,t)throw e}}function tt(e){if(at>0)return e();ct=++st,at++;try{return e()}finally{et()}}var nt,j=void 0;function rt(e){var t=j,n=nt;j=void 0,nt=void 0;try{return e()}finally{j=t,nt=n}}var it=void 0,at=0,ot=0,st=0,ct=0,lt=void 0,ut=0;function dt(e){if(j!==void 0){var t=e.n;if(t===void 0||t.t!==j)return t={i:0,S:e,p:j.s,n:void 0,t:j,e:void 0,x:void 0,r:t},j.s!==void 0&&(j.s.n=t),j.s=t,e.n=t,32&j.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=j.s,t.n=void 0,j.s.n=t,j.s=t),t}}function ft(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ft.prototype.brand=$e,ft.prototype.h=function(){return!0},ft.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?rt(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},ft.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&rt(function(){var e;(e=t.Z)==null||e.call(t)}))}},ft.prototype.subscribe=function(e){var t=this;return xt(function(){var n=t.value;rt(function(){return e(n)})},{name:`sub`})},ft.prototype.valueOf=function(){return this.value},ft.prototype.toString=function(){return this.value+``},ft.prototype.toJSON=function(){return this.value},ft.prototype.peek=function(){var e=this;return rt(function(){return e.value})},Object.defineProperty(ft.prototype,"value",{get:function(){var e=dt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ot>100)throw Error(`Cycle detected`);(function(e){at!==0&&ot===0&&e.l!==ct&&(e.l=ct,lt={S:e,v:e.v,i:e.i,o:lt})})(this),this.v=e,this.i++,ut++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{et()}}}});function M(e,t){return new ft(e,t)}function pt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function mt(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ht(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function gt(e,t){ft.call(this,void 0,t),this.x=e,this.s=void 0,this.g=ut-1,this.f=4}gt.prototype=new ft,gt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ut))return!0;if(this.g=ut,this.f|=1,this.i>0&&!pt(this))return this.f&=-2,!0;var e=j;try{mt(this),j=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return j=e,ht(this),this.f&=-2,!0},gt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ft.prototype.S.call(this,e)},gt.prototype.U=function(e){if(this.t!==void 0&&(ft.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},gt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(gt.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=dt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function N(e,t){return new gt(e,t)}function _t(e){var t=e.m;if(e.m=void 0,typeof t==`function`){at++;var n=j;j=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,vt(e),t}finally{j=n,et()}}}function vt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,_t(e)}function yt(e){if(j!==this)throw Error(`Out-of-order effect`);ht(this),j=e,this.f&=-2,8&this.f&&vt(this),et()}function bt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,nt&&nt.push(this)}bt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},bt.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,_t(this),mt(this),at++;var e=j;return j=this,yt.bind(this,e)},bt.prototype.N=function(){2&this.f||(this.f|=2,this.u=it,it=this)},bt.prototype.d=function(){this.f|=8,1&this.f||vt(this)},bt.prototype.dispose=function(){this.d()};function xt(e,t){var n=new bt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function St(e,t,n,r,i){if(!i.value&&!r.value&&t.value.onActiveChange==null)return;let a=({pointerId:e})=>{n.value=n.value.filter(t=>t!=e),!(n.value.length>0)&&t.peek().onActiveChange?.(!1)};oo(`onPointerDown`,e,({pointerId:e})=>{e!=null&&(n.value=[e,...n.value],n.value.length==1&&t.peek().onActiveChange?.(!0))}),oo(`onPointerUp`,e,a),oo(`onPointerLeave`,e,a)}function Ct(e,t){t.addEventListener(`abort`,()=>Ot(e))}function wt(e,t,n,r,i){let a=t.value.cursor,o=t.value.onHoverChange;if(!i.value&&!r.value&&o==null&&a==null){n.value.length=0;return}oo(`onPointerEnter`,e,({pointerId:e})=>{e!=null&&(n.value=[e,...n.value],n.value.length===1&&o?.(!0),a!=null&&Dt(n,a))}),oo(`onPointerLeave`,e,({pointerId:e})=>{n.value=n.value.filter(t=>t!=e),n.value.length===0&&o?.(!1),Ot(n)})}var Tt=[],Et=[];function Dt(e,t){Tt.push(e),Et.push(t),document.body.style.cursor=t}function Ot(e){let t=Tt.indexOf(e);t!=-1&&(Tt.splice(t,1),Et.splice(t,1),document.body.style.cursor=Et[Et.length-1]??`default`)}function kt(){let e=new Ee,t=e.getAttribute(`position`),n=new Float32Array(4*t.count),r=[1,0,0,1];for(let e=0;e<n.length;e++)n[e]=r[e%4];return e.setAttribute(`tangent`,new Te(n,4)),e}var At=kt();function jt(e,t,n,r,i){P(()=>{let i=r.value,a=n.value;if(i==null||a==null)return;e.center.set(0,0,0);let[o,s]=i;e.radius=Math.sqrt(o*o+s*s)*.5*t.value,e.applyMatrix4(a)},i)}var Mt=new Se,Nt=new k;function Pt(e,t,n,r,i){return(a,o)=>{let s=o.length,c=t.call(e,a,o);if(s===o.length)return c;let l=i.peek();if(l==null)return c;let u=r.peek()?.clippingRect?.peek()?.planes;n.peek().component.updateMatrix(),mo(n.peek(),Nt);outer:for(let e=o.length-1;e>=s;e--){let t=o[e];if(t.distance-=l.majorIndex*.01+l.minorIndex*1e-4+l.elementType*1e-5+l.patchIndex*1e-7,u!=null){for(let n=0;n<4;n++)if(Mt.copy(u[n]).applyMatrix4(Nt),Mt.distanceToPoint(t.point)<0){o.splice(e,1);continue outer}}}return c}}Math.PI/180,180/Math.PI;function Ft(e,t,n){return Math.max(t,Math.min(n,e))}var It=new h,Lt=new c,Rt=new k,zt=new k;function Bt(e,t,n,r){return(n,i)=>{if(e.peek().component.updateMatrix(),mo(e.peek(),zt),It.copy(t).applyMatrix4(zt),!It.intersectsSphere(n))return;r.updateMatrixWorld(!0),Lt.copy(n.center).applyMatrix4(Rt.copy(r.matrixWorld).invert()),Lt.x=Ft(Lt.x,-.5,.5),Lt.y=Ft(Lt.y,-.5,.5),Lt.z=0;let a=new A(Lt.x,Lt.y);Lt.applyMatrix4(r.matrixWorld);let o=n.center.distanceTo(Lt);o>n.radius||i.push({distance:o,object:r,point:Lt.clone(),uv:a,normal:new c(0,0,1)})}}var Vt={glass:class extends ee{constructor(){super({roughness:.1,reflectivity:.5,iridescence:.001,thickness:.05,metalness:.3,ior:2})}},metal:class extends ee{constructor(){super({iridescence:.001,metalness:.8,roughness:.1})}},plastic:class extends _e{constructor(){super({specular:`#111`,shininess:100})}}};function Ht(e){return typeof e==`string`?Vt[e]:e}function Ut(e,t){for(;t>=e.length;){let t=0,n=0;if(e.length>0){let r=e[e.length-1];t+=r.offset+r.elements.length,n=Math.min(0,r.missingSpace),r.missingSpace-=n}e.push({add:[],missingSpace:n,offset:t,elements:[]})}}function Wt(e,t,n){Ut(e,0);let r=e[e.length-1];r.missingSpace+=t-n}function Gt(e,t,n,r){Ut(e,t);let i=e[t];return i.missingSpace+=1,i.missingSpace<=0?(r(n,i,i.elements.length),i.elements.push(n),!1):(i.add.push(n),!0)}function Kt(e,t,n,r,i,a,o,s){if(t>=e.length)throw Error(`no bucket at index ${t}`);let c=e[t];--c.missingSpace;let l=c.add.indexOf(n);if(l!=-1)return c.add.splice(l,1),!1;if(r==null||r>=c.elements.length)throw Error(`no element at index ${r}`);if(c.add.length>0){let e=c.add.shift();return c.elements[r]=e,i(e,c,r),!1}let u=c.offset,d=c.elements.length-1;if(d!=r){let e=u+d;s(u+r,e,e+1);let t=c.elements[d];c.elements[r]=t,o(t,r)}if(a(u+d),--c.elements.length,t<e.length-1)return!0;let f=c;for(;f.elements.length===0&&f.add.length==0&&t>0;){let n=e[t-1];n.missingSpace+=f.missingSpace,f=e[--t]}return e.length=t+1,!1}function qt(e,t,n){let r=e.length,i=-1;for(let t=0;t<r;t++){let a=e[t];a.elements.length+a.add.length>0&&(i=t);let o=t===r-1;if(!o&&a.missingSpace===0)continue;let s=a.missingSpace<0;for(let r=t-1;r>=0;r--){let i=e[r];if(i.missingSpace===0)continue;let c=i.missingSpace<0;if(c&&(o||s)){Jt(e,n,r,t,Math.abs(i.missingSpace));continue}if(!s&&!c)continue;let l=Math.min(Math.abs(i.missingSpace),Math.abs(a.missingSpace));s?Yt(e,n,r,t,l):Jt(e,n,r,t,l)}}let a=e[i];for(let t=i+1;t<r;t++)a.missingSpace+=e[t].missingSpace;r=e.length=i+1;for(let n=0;n<r;n++){let r=e[n],{elements:i,add:a}=r,o=a.length;for(let e=0;e<o;e++){let n=a[e];t(n,r,i.length),i.push(n)}a.length=0}}function Jt(e,t,n,r,i){let a=e[r],o=e[n+1].offset;t(o-i,o,a.offset+a.elements.length);let s=e[n];s.missingSpace+=i,a.missingSpace-=i;for(let t=n+1;t<=r;t++)e[t].offset-=i}function Yt(e,t,n,r,i){let a=e[r],o=e[n+1].offset;t(o+i,o,a.offset+a.elements.length);let s=e[n];s.missingSpace-=i,a.missingSpace+=i;for(let t=n+1;t<=r;t++)e[t].offset+=i}function Xt(e,t){Zt(e,t),e.fragmentShader=e.fragmentShader.replace(`#include <clipping_planes_fragment>`,`#include <clipping_planes_fragment>
2
- ${en(t,void 0)}
3
- `)}function Zt(e,t){e.vertexShader=e.vertexShader.replace(`#include <common>`,` #include <common>
4
- out vec4 borderRadius;
5
- ${t?``:`uniform highp mat4 data;`}`),e.vertexShader=e.vertexShader.replace(`#include <uv_vertex>`,` #include <uv_vertex>
6
- highp int packedBorderRadius = int(data[2].x);
7
- borderRadius = vec4(
8
- float(packedBorderRadius / 125000 % 50),
9
- float(packedBorderRadius / 2500 % 50),
10
- float(packedBorderRadius / 50 % 50),
11
- float(packedBorderRadius % 50)
12
- ) * 0.01;`),t&&(e.vertexShader=e.vertexShader.replace(`#include <common>`,` #include <common>
13
- attribute highp mat4 aData;
14
- attribute mat4 aClipping;
15
- out mat4 data;
16
- out mat4 clipping;
17
- out vec3 localPosition;`),e.vertexShader=e.vertexShader.replace(`#include <uv_vertex>`,` #include <uv_vertex>
18
- data = aData;
19
- clipping = aClipping;
20
- localPosition = (instanceMatrix * vec4(position, 1.0)).xyz;`)),e.fragmentShader=Qt(t)+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace(`#include <clipping_planes_fragment>`,$t(t))}function Qt(e){return`${e?`in`:`uniform`} highp mat4 data;
21
- in vec4 borderRadius;
22
- ${e?`
23
- in vec3 localPosition;
24
- in mat4 clipping;`:``}
25
-
26
- float min4(vec4 v) {
27
- vec2 tmp = min(v.xy, v.zw);
28
- return min(tmp.x, tmp.y);
29
- }
30
-
31
- float max4(vec4 v) {
32
- vec2 tmp = max(v.xy, v.zw);
33
- return max(tmp.x, tmp.y);
34
- }
35
-
36
- vec2 radiusDistance(float radius, vec2 outside, vec2 border, vec2 borderSize) {
37
- vec2 outerRadius = vec2(radius);
38
- vec2 innerRadius = outerRadius - borderSize;
39
-
40
- vec2 radiusWeightUnnorm = abs(innerRadius - border);
41
- float sum = radiusWeightUnnorm.x + radiusWeightUnnorm.y;
42
- vec2 radiusWeight = sum > 0.0 ? radiusWeightUnnorm / sum : vec2(0.5);
43
-
44
- return vec2(
45
- radius - distance(outside, outerRadius),
46
- dot(radiusWeight, innerRadius) - distance(border, innerRadius)
47
- );
48
- }
49
-
50
- vec2 calculateCornerIntersection(float cornerRadius, vec2 borderSizes, float aspectRatio) {
51
- float tmp1 = cornerRadius - borderSizes.y;
52
- vec2 xIntersection = vec2(tmp1, tmp1 / aspectRatio);
53
-
54
- float tmp2 = cornerRadius - borderSizes.x;
55
- vec2 yIntersection = vec2(tmp2 * aspectRatio, tmp2);
56
-
57
- return min(xIntersection, yIntersection);
58
- }
59
- `}function $t(e){return` ${e?`
60
- vec4 plane;
61
- float distanceToPlane, planeDistanceGradient;
62
- float clipOpacity = 1.0;
63
-
64
- for(int i = 0; i < 4; i++) {
65
- plane = clipping[i];
66
- distanceToPlane = dot(localPosition, plane.xyz) + plane.w;
67
- planeDistanceGradient = max(fwidth(distanceToPlane) * 0.5, 0.00001);
68
- clipOpacity *= smoothstep(-planeDistanceGradient, planeDistanceGradient, distanceToPlane);
69
-
70
- if (clipOpacity < 0.01) discard;
71
- }`:``}
72
-
73
- vec4 absoluteBorderSize = data[0];
74
- vec3 backgroundColor = data[1].xyz;
75
- float backgroundOpacity = data[1].w;
76
- vec3 borderColor = data[2].yzw;
77
- float borderOpacity = data[3].x;
78
- float borderBend = data[3].y;
79
- vec2 dimensions = data[3].zw;
80
-
81
- float aspectRatio = dimensions.x / dimensions.y;
82
- vec4 borderSize = absoluteBorderSize / dimensions.yyyy;
83
-
84
- vec2 uvFlipped = vec2(vUv.x, 1.0 - vUv.y);
85
- vec4 v_outsideDistance = vec4(
86
- uvFlipped.y,
87
- (1.0 - uvFlipped.x) * aspectRatio,
88
- 1.0 - uvFlipped.y,
89
- uvFlipped.x * aspectRatio
90
- );
91
- vec4 v_borderDistance = v_outsideDistance - borderSize;
92
-
93
- vec2 distance = vec2(min4(v_outsideDistance), min4(v_borderDistance));
94
-
95
- vec4 negateBorderDistance = vec4(1.0) - v_borderDistance;
96
- float maxWeight = max4(negateBorderDistance);
97
- vec4 borderWeight = step(maxWeight, negateBorderDistance);
98
-
99
- vec4 insideBorder = vec4(0.0);
100
-
101
- vec2 cornerPos;
102
- float cornerRadius;
103
- vec2 cornerBorderSizes;
104
-
105
- if (all(lessThan(v_outsideDistance.wx, borderRadius.xx))) {
106
- cornerPos = v_outsideDistance.wx;
107
- cornerRadius = borderRadius.x;
108
- cornerBorderSizes = borderSize.wx;
109
- distance = radiusDistance(cornerRadius, cornerPos, v_borderDistance.wx, cornerBorderSizes);
110
-
111
- vec2 lineIntersection = calculateCornerIntersection(cornerRadius, cornerBorderSizes, aspectRatio);
112
- insideBorder.wx = max(vec2(0.0), lineIntersection - v_borderDistance.wx);
113
- }
114
- else if (all(lessThan(v_outsideDistance.yx, borderRadius.yy))) {
115
- cornerPos = v_outsideDistance.yx;
116
- cornerRadius = borderRadius.y;
117
- cornerBorderSizes = borderSize.yx;
118
- distance = radiusDistance(cornerRadius, cornerPos, v_borderDistance.yx, cornerBorderSizes);
119
-
120
- vec2 lineIntersection = calculateCornerIntersection(cornerRadius, cornerBorderSizes, aspectRatio);
121
- insideBorder.yx = max(vec2(0.0), lineIntersection - v_borderDistance.yx);
122
- }
123
- else if (all(lessThan(v_outsideDistance.yz, borderRadius.zz))) {
124
- cornerPos = v_outsideDistance.yz;
125
- cornerRadius = borderRadius.z;
126
- cornerBorderSizes = borderSize.yz;
127
- distance = radiusDistance(cornerRadius, cornerPos, v_borderDistance.yz, cornerBorderSizes);
128
-
129
- vec2 lineIntersection = calculateCornerIntersection(cornerRadius, cornerBorderSizes, aspectRatio);
130
- insideBorder.yz = max(vec2(0.0), lineIntersection - v_borderDistance.yz);
131
- }
132
- else if (all(lessThan(v_outsideDistance.zw, borderRadius.ww))) {
133
- cornerPos = v_outsideDistance.zw;
134
- cornerRadius = borderRadius.w;
135
- cornerBorderSizes = borderSize.zw;
136
- distance = radiusDistance(cornerRadius, cornerPos, v_borderDistance.zw, cornerBorderSizes);
137
-
138
- vec2 lineIntersection = calculateCornerIntersection(cornerRadius, cornerBorderSizes, aspectRatio);
139
- insideBorder.zw = max(vec2(0.0), lineIntersection - v_borderDistance.zw);
140
- }
141
-
142
- float insideBorderSum = dot(insideBorder, vec4(1.0));
143
- if (insideBorderSum > 0.0) {
144
- borderWeight = insideBorder / insideBorderSum;
145
- }
146
-
147
- #include <clipping_planes_fragment>`}function en(e,t){return`vec2 distanceGradient = fwidth(distance);
148
- float outer = smoothstep(-distanceGradient.x, distanceGradient.x, distance.x);
149
- float inner = smoothstep(-distanceGradient.y, distanceGradient.y, distance.y);
150
-
151
- float transition = 1.0 - step(0.1, outer - inner) * (1.0 - inner);
152
-
153
- float fullBackgroundOpacity = ${t==null?``:`${t} * `}backgroundOpacity;
154
- float fullBorderOpacity = min(1.0, borderOpacity + fullBackgroundOpacity);
155
-
156
- float outOpacity = ${e?`clipOpacity * `:``}outer * mix(fullBorderOpacity, fullBackgroundOpacity, transition);
157
-
158
- if (outOpacity < 0.01) {
159
- discard;
160
- }`}function tn(e,t){Zt(e,t),e.fragmentShader=e.fragmentShader.replace(`#include <color_fragment>`,` #include <color_fragment>
161
- ${en(t,`diffuseColor.a`)}
162
-
163
- vec3 mainColor = diffuseColor.rgb * backgroundColor;
164
- float borderMix = borderOpacity / max(fullBorderOpacity, 0.001);
165
- diffuseColor.rgb = mix(mix(mainColor, borderColor, borderMix), mainColor, transition);
166
- diffuseColor.a = outOpacity;
167
- `),e.fragmentShader=e.fragmentShader.replace(`#include <normal_fragment_maps>`,` #include <normal_fragment_maps>
168
-
169
- vec3 bitangent = normalize(vBitangent);
170
- vec3 tangent = normalize(vTangent);
171
-
172
- mat4 directions = mat4(
173
- vec4(bitangent, 1.0),
174
- vec4(tangent, 1.0),
175
- vec4(-bitangent, 1.0),
176
- vec4(-tangent, 1.0)
177
- );
178
-
179
- float currentBorderSize = distance.x - distance.y;
180
- float outsideNormalWeight = currentBorderSize < 1e-5 ? 0.0 :
181
- max(0.0, -distance.y / currentBorderSize) * -borderBend;
182
-
183
- vec3 outsideNormal = (borderWeight * transpose(directions)).xyz;
184
- normal = normalize(mix(normal, outsideNormal, outsideNormalWeight));
185
- `)}function nn(e,t){let n=new e;n.defines??={},n.side=0,n.clipShadows=!0,n.transparent=!0,n.toneMapped=!1,n.shadowSide=0,n.defines.USE_UV=``,n.defines.USE_TANGENT=``;let r=n.onBeforeCompile;return n.onBeforeCompile=(e,i)=>{r.call(n,e,i),t.type===`normal`&&(e.uniforms.data={value:t.data}),tn(e,t.type===`instanced`)},n}var rn=class extends fe{info;constructor(e){super(),this.info=e,this.defines??={},this.defines.USE_UV=``,this.clipShadows=!0}onBeforeCompile(e,t){super.onBeforeCompile(e,t),this.info.type===`normal`&&(e.uniforms.data={value:this.info.data}),Xt(e,this.info.type===`instanced`)}},an=class extends E{info;constructor(e){super({depthPacking:r}),this.info=e,this.defines??={},this.defines.USE_UV=``,this.clipShadows=!0}onBeforeCompile(e,t){super.onBeforeCompile(e,t),this.info.type===`normal`&&(e.uniforms.data={value:this.info.data}),Xt(e,this.info.type===`instanced`)}},on=new an({type:`instanced`}),sn=new rn({type:`instanced`}),cn=class e extends he{root;instanceMatrix;count=0;isInstancedMesh=!0;instanceColor=null;morphTexture=null;boundingBox=new xe;boundingSphere=new h;customUpdateMatrixWorld=()=>mo(this.root,this.matrixWorld);constructor(e,t,n,r){let i=kt();super(i),this.root=e,this.instanceMatrix=t,this.pointerEvents=`none`,i.attributes.aData=n,i.attributes.aClipping=r,this.customDepthMaterial=on,this.customDistanceMaterial=sn,this.frustumCulled=!1,e.onUpdateMatrixWorldSet.add(this.customUpdateMatrixWorld)}dispose(){this.root.onUpdateMatrixWorldSet.delete(this.customUpdateMatrixWorld),this.dispatchEvent({type:`dispose`}),this.geometry.dispose()}clone(){let t=new e(this.root,this.instanceMatrix,this.geometry.attributes.aData,this.geometry.attributes.aClipping);return t.count=this.count,t.material=this.material,t}copy(){throw Error(`InstancedPanelMesh.copy() is not supported. Use clone() instead.`)}computeBoundingBox(){}computeBoundingSphere(){}updateMorphTargets(){}raycast(){}spherecast(){}},ln=String.raw`[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))(?:[eE][+-]?\d+)?`,un=RegExp(`^${ln}$`),dn=RegExp(`^${ln}%$`),fn=RegExp(`^${ln}px$`),pn=RegExp(`^${ln}(vh|dvh|svh|lvh|vw|dvw|svw|lvw)$`);function mn(e){return typeof e==`string`&&un.test(e)}function hn(e){return typeof e==`string`&&dn.test(e)}function gn(e){return typeof e==`string`&&fn.test(e)}function _n(e){return typeof e==`string`&&pn.test(e)}function vn(e){return _n(e)&&e.endsWith(`vh`)}function yn(e){return _n(e)&&e.endsWith(`vw`)}function bn(e,t,n,r){if(typeof e==`number`)return e;if(hn(e)){let n=Number.parseFloat(e);return t==null?n:t()*n/100}if(vn(e)){let t=Number.parseFloat(e);return r==null?t:r*t/100}if(yn(e)){let t=Number.parseFloat(e);return n==null?t:n*t/100}if(mn(e))return Number(e);if(gn(e))return Number(e.slice(0,-2));throw Error(`Invalid number: ${e}`)}function xn(e){return typeof e==`number`?e:Number(e)}function Sn(e){return gn(e)?Number(e.slice(0,-2)):xn(e)}function Cn(e,t,n){if(e==null||typeof e==`number`||hn(e))return e;if(mn(e))return Number(e);if(gn(e))return Number(e.slice(0,-2));if(yn(e))return t*Number.parseFloat(e)/100;if(vn(e))return n*Number.parseFloat(e)/100;throw Error(`Invalid Yoga point: ${e}`)}var wn=Symbol(`nextFrame`),Tn=class{object;root;orderInfo;panelGroupProperties;mesh;instanceMatrix;instanceData;instanceClipping;instanceMaterial;buckets=[];elementCount=0;bufferElementSize=0;instanceDataOnUpdate;nextUpdateTime;nextUpdateTimeoutRef;activateElement=(e,t,n)=>{let r=t.offset+n;this.instanceData.set(e.materialConfig.defaultData,16*r),this.instanceData.addUpdateRange(16*r,16),this.instanceData.needsUpdate=!0,e.activate(t,n)};setElementIndex=(e,t)=>{e.setIndexInBucket(t)};bufferCopyWithin=(e,t,n)=>{En(this.instanceMatrix,e,t,n),En(this.instanceData,e,t,n),En(this.instanceClipping,e,t,n)};clearBufferAt=e=>{let t=e*16;this.instanceMatrix.array.fill(0,t,t+16),this.instanceMatrix.addUpdateRange(t,16),this.instanceMatrix.needsUpdate=!0};constructor(e,t,n,r){this.object=e,this.root=t,this.orderInfo=n,this.panelGroupProperties=r;let i=Ht(r.panelMaterialClass);this.instanceMaterial=nn(i,{type:`instanced`}),this.instanceMaterial.depthTest=r.depthTest,this.instanceMaterial.depthWrite=r.depthWrite}updateCount(){let e=this.buckets[this.buckets.length-1],t=e.offset+e.elements.length;this.mesh!=null&&(this.mesh.count=t,this.mesh.visible=t>0,this.root.requestRender?.())}requestUpdate(e){if(this.nextUpdateTime==wn)return;let t=performance.now()+e;this.nextUpdateTime!=null&&this.nextUpdateTime<t||(this.nextUpdateTime=t,clearTimeout(this.nextUpdateTimeoutRef),this.nextUpdateTimeoutRef=setTimeout(this.requestUpdateNextFrame.bind(this),e))}requestUpdateNextFrame(){this.nextUpdateTime=wn,clearTimeout(this.nextUpdateTimeoutRef),this.nextUpdateTimeoutRef=void 0,this.root.requestFrame?.()}insert(e,t){if(this.elementCount+=1,!Gt(this.buckets,e,t,this.activateElement)){this.updateCount();return}this.requestUpdateNextFrame()}delete(e,t,n){if(--this.elementCount,!Kt(this.buckets,e,n,t,this.activateElement,this.clearBufferAt,this.setElementIndex,this.bufferCopyWithin)){this.updateCount();return}this.root.requestRender?.(),this.requestUpdate(1e3)}onFrame(){this.nextUpdateTime==wn&&(this.nextUpdateTime=void 0,this.update())}update(){if(this.elementCount===0){this.mesh!=null&&(this.mesh.visible=!1);return}this.elementCount>this.bufferElementSize?(this.resize(),qt(this.buckets,this.activateElement,this.bufferCopyWithin)):this.elementCount<=this.bufferElementSize/3?(qt(this.buckets,this.activateElement,this.bufferCopyWithin),this.resize()):qt(this.buckets,this.activateElement,this.bufferCopyWithin),this.mesh.count=this.elementCount,this.mesh.visible=!0}resize(){let e=this.bufferElementSize;this.bufferElementSize=Math.ceil(this.elementCount*1.5),this.mesh!=null&&(this.mesh.dispose(),this.object.remove(this.mesh)),Wt(this.buckets,e,this.bufferElementSize);let t=new Float32Array(this.bufferElementSize*16);this.instanceMatrix!=null&&t.set(this.instanceMatrix.array.subarray(0,t.length)),this.instanceMatrix=new p(t,16,!1),this.instanceMatrix.setUsage(n);let r=new Float32Array(this.bufferElementSize*16);this.instanceData!=null&&r.set(this.instanceData.array.subarray(0,r.length)),this.instanceData=new p(r,16,!1),this.instanceDataOnUpdate=(e,t)=>{this.instanceData.addUpdateRange(e,t),this.instanceData.needsUpdate=!0},this.instanceData.setUsage(n);let i=new Float32Array(this.bufferElementSize*16);this.instanceClipping!=null&&i.set(this.instanceClipping.array.subarray(0,i.length)),this.instanceClipping=new p(i,16,!1),this.instanceClipping.setUsage(n),this.mesh=new cn(this.root,this.instanceMatrix,this.instanceData,this.instanceClipping),this.mesh.renderOrder=xn(this.panelGroupProperties.renderOrder),So(this.mesh,{peek:()=>this.root},{value:this.orderInfo}),this.mesh.material=this.instanceMaterial,this.mesh.receiveShadow=this.panelGroupProperties.receiveShadow,this.mesh.castShadow=this.panelGroupProperties.castShadow,this.object.addUnsafe(this.mesh)}destroy(){clearTimeout(this.nextUpdateTimeoutRef),this.mesh!=null&&(this.object.remove(this.mesh),this.mesh?.dispose(),this.instanceMaterial.dispose())}};function En(e,t,n,r){let i=e.itemSize,a=n*i,o=r*i,s=t*i;e.array.copyWithin(s,a,o);let c=o-a;e.addUpdateRange(a,c),e.addUpdateRange(s,c),e.needsUpdate=!0}var Dn=class{root;object;map=new Map;constructor(e,t){this.root=e,this.object=t}init(e){let t=()=>this.traverse(e=>e.onFrame());this.root.onFrameSet.add(t),e.addEventListener(`abort`,()=>{this.root.onFrameSet.delete(t),this.traverse(e=>e.destroy())})}traverse(e){for(let t of this.map.values())for(let n of t.values())e(n)}getGroup({majorIndex:e,minorIndex:t},n){let r=Ht(n.panelMaterialClass),i=this.map.get(r);i??this.map.set(r,i=new Map);let a=[e,t,n.renderOrder,n.depthTest,n.depthWrite,n.receiveShadow,n.castShadow].join(`,`),o=i.get(a);return o??i.set(a,o=new Tn(this.object,this.root,{elementType:vo.Panel,minorIndex:t,majorIndex:e,patchIndex:0},n)),o}},On=new k;function kn(e,t,n,r){return N(()=>{let i=n.value,a=t.value;if(i==null||a==null)return;let[o,s]=i,c=xn(e.value.pixelSize),l=new k;if(l.makeScale(o*c,s*c,1),r!=null){let[e,t]=r.value;l.premultiply(On.makeTranslation(e*c,t*c,0))}return l.premultiply(a)})}var An=(()=>{var e=import.meta.url;return(function(t){t||={};var n;n||=t===void 0?{}:t;var r,i;n.ready=new Promise(function(e,t){r=e,i=t});var a=Object.assign({},n),o=``;typeof document<`u`&&document.currentScript&&(o=document.currentScript.src),e&&(o=e),o=o.indexOf(`blob:`)===0?``:o.substr(0,o.replace(/[?#].*/,``).lastIndexOf(`/`)+1);var s=n.print||console.log.bind(console),c=n.printErr||console.warn.bind(console);Object.assign(n,a),a=null;var l;n.wasmBinary&&(l=n.wasmBinary),n.noExitRuntime,typeof WebAssembly!=`object`&&ne(`no native wasm support detected`);var u,d=!1;function f(e,t,n){n=t+n;for(var r=``;!(t>=n);){var i=e[t++];if(!i)break;if(i&128){var a=e[t++]&63;if((i&224)==192)r+=String.fromCharCode((i&31)<<6|a);else{var o=e[t++]&63;i=(i&240)==224?(i&15)<<12|a<<6|o:(i&7)<<18|a<<12|o<<6|e[t++]&63,65536>i?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023))}}else r+=String.fromCharCode(i)}return r}var p,m,h,g,_,v,y,b,x;function S(){var e=u.buffer;p=e,n.HEAP8=m=new Int8Array(e),n.HEAP16=g=new Int16Array(e),n.HEAP32=v=new Int32Array(e),n.HEAPU8=h=new Uint8Array(e),n.HEAPU16=_=new Uint16Array(e),n.HEAPU32=y=new Uint32Array(e),n.HEAPF32=b=new Float32Array(e),n.HEAPF64=x=new Float64Array(e)}var C,w=[],T=[],E=[];function D(){var e=n.preRun.shift();w.unshift(e)}var O=0,ee=null,te=null;function ne(e){throw n.onAbort&&n.onAbort(e),e=`Aborted(`+e+`)`,c(e),d=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),i(e),e}function re(e){return e.startsWith(`data:application/octet-stream;base64,`)}var ie=`data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfGAEf39/fABgA39/fQBgBn9/fX99fwF/ArUBHgFhAWEAHwFhAWIAAwFhAWMACQFhAWQAFgFhAWUAEQFhAWYAIAFhAWcAAAFhAWgAIQFhAWkAAwFhAWoAAAFhAWsAFwFhAWwACgFhAW0ABQFhAW4AAwFhAW8AAQFhAXAAFwFhAXEABgFhAXIAAAFhAXMAIgFhAXQACgFhAXUADQFhAXYAFgFhAXcAAgFhAXgAAwFhAXkAGAFhAXoAAgFhAUEAAQFhAUIAEQFhAUMAAQFhAUQAAAOiAqACAgMSBwcACRkDAAoRBgYKEwAPDxMBBiMTCgcHGgMUASQFJRQHAwMKCgMmAQYYDxobFAAKBw8KBwMDAgkCAAAFGwACBwIHBgIDAQMIDAABKAkHBQURACkZASoAAAIrLAIALQcHBy4HLwkFCgMCMA0xAgMJAgACAQYKAQIBBQEACQIFAQEABQAODQ0GFQIBHBUGAgkCEAAAAAUyDzMMBQYINAUCAwUODg41AgMCAgIDBgICNgIBDAwMAQsLCwsLCx0CAAIAAAABABABBQICAQMCEgMMCwEBA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BgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAtIAQF/IwBBEGsiBCQAIAQgAzYCDAJAIABFBEBBAEEAIAEgAiAEKAIMEHEMAQsgACgC9AMgACABIAIgBCgCDBBxCyAEQRBqJAALkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAWIQH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQu1AQECfyAAKAIEQQFqIgEgACgCACICKALsAyACKALoAyICa0ECdU8EQANAIAAoAggiAUUEQCAAQQA2AgggAEIANwIADwsgACABKAIENgIAIAAgASgCCDYCBCAAIAEoAgA2AgggARAjIAAoAgRBAWoiASAAKAI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uwDIAIoAugDIgJrQQJ1SQRAIAIgAUECdGooAgAiASgC3AMNAyABLwAVIAEtABdBEHRyIgJBgOAAcUGAwABHBEAgAkEIdkEPcSICBH8gAgUgAC0AFUEEdgtBBUYEQCAALQAUQQhxDQQLIAEtAABBAnENAyAEIAEgBBshBAsgA0EQahAuIAMoAhQiASADKAIQIgJyDQEMAwsLEAIACyABIQQLIAMoAhgiAQRAA0AgASgCACECIAEQIyACIgENAAsLIARFBEAgACoCmAMhBQwBCyAEEE4gBCoCoAOSIQULIANBIGokACAFC6EDAQh/AkAgACgC6AMiBSAAKALsAyIHRwRAA0AgACAFKAIAIgIoAuQDRwRAAkAgACgC9AMoAgAiAQRAIAIgACAGIAERBgAiAQ0BC0GIBBAeIgEgAigCEDYCECABIAIpAgg3AgggASACKQIANwIAIAFBFGogAkEUakHoABArGiABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jA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DAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBXBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELrhQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECYLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBXRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDC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AIbRQRAQbgwIAMgBBBJDwsgAyAEEHALIgEBfiABIAKtIAOtQiCGhCAEIAARFQAiBUIgiKckASAFpwuoAQEFfyAAKAJUIgMoAgAhBSADKAIEIgQgACgCFCAAKAIcIgdrIgYgBCAGSRsiBgRAIAUgByAGECsaIAMgAygCACAGaiIFNgIAIAMgAygCBCAGayIENgIECyAEIAIgAiAESxsiBARAIAUgASAEECsaIAMgAygCACAEaiIFNgIAIAMgAygCBCAEazYCBAsgBUEAOgAAIAAgACgCLCIBNgIcIAAgATYCFCACCwQAQgALBABBAAuKBQIGfgJ/IAEgASgCAEEHakF4cSIBQRBqNgIAIAAhCSABKQMAIQMgASkDCCEGIwBBIGsiCCQAAkAgBkL///////////8AgyIEQoCAgICAgMCAPH0gBEKAgICAgIDA/8MAfVQEQCAGQgSGIANCPIiEIQQgA0L//////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgC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rIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEwEB4gAkEwECshACACQTBqJAAgAAs7AQF/IAEgACgCBCIFQQF1aiEBIAAoAgAhACABIAIgAyAEIAVBAXEEfyABKAIAIABqKAIABSAACxEdAAs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERIACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRDAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRCwALYQECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB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AIAAoAgAtAABBBHFBAnYLegECfyMAQRBrIgEkACAAKAIAIgAoAggEQANAIAAtAAAiAkEEcUUEQCAAIAJBBHI6AAAgACgCECICBEAgACACEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyABQRBqJAAPCyABQYAINgIAIABBBUHYJSABECwQJAALLgEBfyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgBBADYCEAsXACAAKAIEKAIIIgAgACgCACgCCBEAAAsuAQF/IAAoAgghAiAAIAE2AgggAgRAIAIgAigCACgCBBEAAAsgACgCAEEFNgIQCz4BAX8gACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIAIgBBADYCCCAAIAAtAABB7wFxOgAAC0kBAX8jAEEQayIGJAAgBiABKAIEKAIEIgEgAiADIAQgBSABKAIAKAIIERAAIAAgBisDALY4AgAgACAGKwMItjgCBCAGQRBqJAALcwECfyMAQRBrIgIkACAAKAIEIQMgACABNgIEIAMEQCADIAMoAgAoAgQRAAALIAAoAgAiACgC6AMgACgC7ANHBEAgAkH5IzYCACAAQQVB2CUgAhAsECQACyAAQQQ2AgggACAALQAAQRByOgAAIAJBEGokAAs8AQF/AkAgACgCACIAKALsAyAAKALoAyIAa0ECdSABTQ0AIAAgAUECdGooAgAiAEUNACAAKAIEIQILIAILGQAgACgCACgC5AMiAEUEQEEADwsgACgCBAsXACAAKAIAIgAoAuwDIAAoAugDa0ECdQuOAwEDfyMAQdACayICJAACQCAAKAIAIgAoAuwDIAAoAugDRg0AIAEoAgAiAygC5AMhASAAIAMQb0UNACAAIAFGBEAgAkEIakEAQcQCECoaIAJBADoAGCACQgA3AxAgAkGAgID+BzYCDCACQRxqQQBBxAEQKhogAkHgAWohBCACQSBqIQEDQCABQoCAgPyLgIDAv383AhAgAUKBgICAEDcCCCABQoCAgPyLgIDAv383AgAgAUEYaiIBIARHDQALIAJCgICA/IuAgMC/fzcD8AEgAkKBgICAEDcD6AEgAkKAgID8i4CAwL9/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B0AANsdAADUHQAAxB0AANsdAADiHQAAdmlpaWQAAADUHQAAxB0AAOIdAADbHQAAxR0AAMIdAADFHQAA2x0AAMIdAADFHQAA4h0AAMUdAADiHQAAxR0AANsdAABkaWlpAAAAAOEdAADEHQAA2x0AAGZpaWkAAAAA1B0AAMQdAADEHQAA3B0AANQdAADEHQAAxB0AANwdAADFHQAAxB0AAMQdAADEHQAAxB0AANwdAADUHQAAxB0AANUdAADVHQAAxB0AANQdAADEHQAAoR0AANQdAADEHQAAuR0AANUdAADFHQAAAAAAANQdAADEHQAA4h0AAOIdAADbHQAAdmlpZGRpAADBHQAAxR0AQcArC0EZAAoAGRkZAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBBkSwLIQ4AAAAAAAAAABkACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT`;if(!re(ie)){var ae=ie;ie=n.locateFile?n.locateFile(ae,o):o+ae}function oe(){var e=ie;try{if(e==ie&&l)return new Uint8Array(l);if(re(e))try{var t=wt(e.slice(37)),n=new Uint8Array(t.length);for(e=0;e<t.length;++e)n[e]=t.charCodeAt(e);var r=n}catch{throw Error(`Converting base64 string to bytes failed.`)}else r=void 0;var i=r;if(i)return i;throw`both async and sync fetching of the wasm failed`}catch(e){ne(e)}}function se(){return l||typeof fetch!=`function`?Promise.resolve().then(function(){return oe()}):fetch(ie,{credentials:`same-origin`}).then(function(e){if(!e.ok)throw`failed to load wasm binary file at '`+ie+`'`;return e.arrayBuffer()}).catch(function(){return oe()})}function ce(e){for(;0<e.length;)e.shift()(n)}function le(e){if(e===void 0)return`_unknown`;e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return 48<=t&&57>=t?`_`+e:e}function ue(e,t){return e=le(e),function(){return t.apply(this,arguments)}}var k=[{},{value:void 0},{value:null},{value:!0},{value:!1}],de=[];function fe(e){var t=Error,n=ue(e,function(t){this.name=e,this.message=t,t=Error(t).stack,t!==void 0&&(this.stack=this.toString()+`
186
- `+t.replace(/^Error(:[^\n]*)?\n/,``))});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+`: `+this.message},n}var pe=void 0;function A(e){throw new pe(e)}var me=e=>(e||A(`Cannot use deleted val. handle = `+e),k[e].value),he=e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=de.length?de.pop():k.length;return k[t]={ga:1,value:e},t}},ge=void 0,_e=void 0;function ve(e){for(var t=``;h[e];)t+=_e[h[e++]];return t}var ye=[];function be(){for(;ye.length;){var e=ye.pop();e.M.$=!1,e.delete()}}var xe=void 0,Se={};function Ce(e,t){for(t===void 0&&A(`ptr should not be undefined`);e.R;)t=e.ba(t),e=e.R;return t}var we={};function Te(e){e=Et(e);var t=ve(e);return Ot(e),t}function Ee(e,t){var n=we[e];return n===void 0&&A(t+` has unknown type `+Te(e)),n}function De(){}var Oe=!1;function ke(e){--e.count.value,e.count.value===0&&(e.T?e.U.W(e.T):e.P.N.W(e.O))}function Ae(e,t,n){return t===n?e:n.R===void 0?null:(e=Ae(e,t,n.R),e===null?null:n.na(e))}var je={};function Me(e,t){return t=Ce(e,t),Se[t]}var Ne=void 0;function Pe(e){throw new Ne(e)}function Fe(e,t){return t.P&&t.O||Pe(`makeClassHandle requires ptr and ptrType`),!!t.U!=!!t.T&&Pe(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},Ie(Object.create(e,{M:{value:t}}))}function Ie(e){return typeof FinalizationRegistry>`u`?(Ie=e=>e,e):(Oe=new FinalizationRegistry(e=>{ke(e.M)}),Ie=e=>{var t=e.M;return t.T&&Oe.register(e,{M:t},e),e},De=e=>{Oe.unregister(e)},Ie(e))}var Le={};function Re(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function ze(e){return this.fromWireType(v[e>>2])}var Be={},Ve={};function He(e,t,n){function r(t){t=n(t),t.length!==e.length&&Pe(`Mismatched type converter count`);for(var r=0;r<e.length;++r)We(e[r],t[r])}e.forEach(function(e){Ve[e]=t});var i=Array(t.length),a=[],o=0;t.forEach((e,t)=>{we.hasOwnProperty(e)?i[t]=we[e]:(a.push(e),Be.hasOwnProperty(e)||(Be[e]=[]),Be[e].push(()=>{i[t]=we[e],++o,o===a.length&&r(i)}))}),a.length===0&&r(i)}function Ue(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw TypeError(`Unknown type size: `+e)}}function We(e,t,n={}){if(!(`argPackAdvance`in t))throw TypeError(`registerType registeredInstance requires argPackAdvance`);var r=t.name;if(e||A(`type "`+r+`" must have a positive integer typeid pointer`),we.hasOwnProperty(e)){if(n.ua)return;A(`Cannot register type '`+r+`' twice`)}we[e]=t,delete Ve[e],Be.hasOwnProperty(e)&&(t=Be[e],delete Be[e],t.forEach(e=>e()))}function Ge(e){A(e.M.P.N.name+` instance already deleted`)}function Ke(){}function qe(e,t,n){if(e[t].S===void 0){var r=e[t];e[t]=function(){return e[t].S.hasOwnProperty(arguments.length)||A(`Function '`+n+`' called with an invalid number of arguments (`+arguments.length+`) - expects one of (`+e[t].S+`)!`),e[t].S[arguments.length].apply(this,arguments)},e[t].S=[],e[t].S[r.Z]=r}}function Je(e,t){n.hasOwnProperty(e)?(A(`Cannot register public name '`+e+`' twice`),qe(n,e,e),n.hasOwnProperty(void 0)&&A(`Cannot register multiple overloads of a function with the same number of arguments (undefined)!`),n[e].S[void 0]=t):n[e]=t}function Ye(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.X=n,this.W=r,this.R=i,this.pa=a,this.ba=o,this.na=s,this.ja=[]}function Xe(e,t,n){for(;t!==n;)t.ba||A(`Expected null or instance of `+n.name+`, got an instance of `+t.name),e=t.ba(e),t=t.R;return e}function Ze(e,t){return t===null?(this.ea&&A(`null is not a valid `+this.name),0):(t.M||A(`Cannot pass "`+ct(t)+`" as a `+this.name),t.M.O||A(`Cannot pass deleted object as a pointer of type `+this.name),Xe(t.M.O,t.M.P.N,this.N))}function Qe(e,t){if(t===null){if(this.ea&&A(`null is not a valid `+this.name),this.da){var n=this.fa();return e!==null&&e.push(this.W,n),n}return 0}if(t.M||A(`Cannot pass "`+ct(t)+`" as a `+this.name),t.M.O||A(`Cannot pass deleted object as a pointer of type `+this.name),!this.ca&&t.M.P.ca&&A(`Cannot convert argument of type `+(t.M.U?t.M.U.name:t.M.P.name)+` to parameter type `+this.name),n=Xe(t.M.O,t.M.P.N,this.N),this.da)switch(t.M.T===void 0&&A(`Passing raw pointer to smart pointer is illegal`),this.Ba){case 0:t.M.U===this?n=t.M.T:A(`Cannot convert argument of type `+(t.M.U?t.M.U.name:t.M.P.name)+` to parameter type `+this.name);break;case 1:n=t.M.T;break;case 2:if(t.M.U===this)n=t.M.T;else{var r=t.clone();n=this.xa(n,he(function(){r.delete()})),e!==null&&e.push(this.W,n)}break;default:A(`Unsupporting sharing policy`)}return n}function $e(e,t){return t===null?(this.ea&&A(`null is not a valid `+this.name),0):(t.M||A(`Cannot pass "`+ct(t)+`" as a `+this.name),t.M.O||A(`Cannot pass deleted object as a pointer of type `+this.name),t.M.P.ca&&A(`Cannot convert argument of type `+t.M.P.name+` to parameter type `+this.name),Xe(t.M.O,t.M.P.N,this.N))}function et(e,t,n,r){this.name=e,this.N=t,this.ea=n,this.ca=r,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,t.R===void 0?(this.toWireType=r?Ze:$e,this.V=null):this.toWireType=Qe}function tt(e,t){n.hasOwnProperty(e)||Pe(`Replacing nonexistant public symbol`),n[e]=t,n[e].Z=void 0}function nt(e,t){var r=[];return function(){if(r.length=0,Object.assign(r,arguments),e.includes(`j`)){var i=n[`dynCall_`+e];i=r&&r.length?i.apply(null,[t].concat(r)):i.call(null,t)}else i=C.get(t).apply(null,r);return i}}function j(e,t){e=ve(e);var n=e.includes(`j`)?nt(e,t):C.get(t);return typeof n!=`function`&&A(`unknown function pointer with signature `+e+`: `+t),n}var rt=void 0;function it(e,t){function n(e){i[e]||we[e]||(Ve[e]?Ve[e].forEach(n):(r.push(e),i[e]=!0))}var r=[],i={};throw t.forEach(n),new rt(e+`: `+r.map(Te).join([`, `]))}function at(e,t,n,r,i){var a=t.length;2>a&&A(`argTypes array size mismatch! Must at least get return value and 'this' types!`);var o=t[1]!==null&&n!==null,s=!1;for(n=1;n<t.length;++n)if(t[n]!==null&&t[n].V===void 0){s=!0;break}var c=t[0].name!==`void`,l=a-2,u=Array(l),d=[],f=[];return function(){if(arguments.length!==l&&A(`function `+e+` called with `+arguments.length+` arguments, expected `+l+` args!`),f.length=0,d.length=o?2:1,d[0]=i,o){var n=t[1].toWireType(f,this);d[1]=n}for(var a=0;a<l;++a)u[a]=t[a+2].toWireType(f,arguments[a]),d.push(u[a]);if(a=r.apply(null,d),s)Re(f);else for(var p=o?1:2;p<t.length;p++){var m=p===1?n:u[p-2];t[p].V!==null&&t[p].V(m)}return n=c?t[0].fromWireType(a):void 0,n}}function ot(e,t){for(var n=[],r=0;r<e;r++)n.push(y[t+4*r>>2]);return n}function st(e){4<e&&--k[e].ga===0&&(k[e]=void 0,de.push(e))}function ct(e){if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e}function lt(e,t){switch(t){case 2:return function(e){return this.fromWireType(b[e>>2])};case 3:return function(e){return this.fromWireType(x[e>>3])};default:throw TypeError(`Unknown float type: `+e)}}function ut(e,t,n){switch(t){case 0:return n?function(e){return m[e]}:function(e){return h[e]};case 1:return n?function(e){return g[e>>1]}:function(e){return _[e>>1]};case 2:return n?function(e){return v[e>>2]}:function(e){return y[e>>2]};default:throw TypeError(`Unknown integer type: `+e)}}function dt(e,t){for(var n=``,r=0;!(r>=t/2);++r){var i=g[e+2*r>>1];if(i==0)break;n+=String.fromCharCode(i)}return n}function ft(e,t,n){if(n===void 0&&(n=2147483647),2>n)return 0;n-=2;var r=t;n=n<2*e.length?n/2:e.length;for(var i=0;i<n;++i)g[t>>1]=e.charCodeAt(i),t+=2;return g[t>>1]=0,t-r}function M(e){return 2*e.length}function pt(e,t){for(var n=0,r=``;!(n>=t/4);){var i=v[e+4*n>>2];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023)):r+=String.fromCharCode(i)}return r}function mt(e,t,n){if(n===void 0&&(n=2147483647),4>n)return 0;var r=t;n=r+n-4;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a){var o=e.charCodeAt(++i);a=65536+((a&1023)<<10)|o&1023}if(v[t>>2]=a,t+=4,t+4>n)break}return v[t>>2]=0,t-r}function ht(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&++n,t+=4}return t}var gt={};function N(e){var t=gt[e];return t===void 0?ve(e):t}var _t=[];function vt(e){var t=_t.length;return _t.push(e),t}function yt(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=Ee(y[t+4*r>>2],`parameter `+r);return n}var bt=[],xt=[null,[],[]];pe=n.BindingError=fe(`BindingError`),n.count_emval_handles=function(){for(var e=0,t=5;t<k.length;++t)k[t]!==void 0&&++e;return e},n.get_first_emval=function(){for(var e=5;e<k.length;++e)if(k[e]!==void 0)return k[e];return null},ge=n.PureVirtualError=fe(`PureVirtualError`);for(var St=Array(256),Ct=0;256>Ct;++Ct)St[Ct]=String.fromCharCode(Ct);_e=St,n.getInheritedInstanceCount=function(){return Object.keys(Se).length},n.getLiveInheritedInstances=function(){var e=[],t;for(t in Se)Se.hasOwnProperty(t)&&e.push(Se[t]);return e},n.flushPendingDeletes=be,n.setDelayFunction=function(e){xe=e,ye.length&&xe&&xe(be)},Ne=n.InternalError=fe(`InternalError`),Ke.prototype.isAliasOf=function(e){if(!(this instanceof Ke&&e instanceof Ke))return!1;var t=this.M.P.N,n=this.M.O,r=e.M.P.N;for(e=e.M.O;t.R;)n=t.ba(n),t=t.R;for(;r.R;)e=r.ba(e),r=r.R;return t===r&&n===e},Ke.prototype.clone=function(){if(this.M.O||Ge(this),this.M.aa)return this.M.count.value+=1,this;var e=Ie,t=Object,n=t.create,r=Object.getPrototypeOf(this),i=this.M;return e=e(n.call(t,r,{M:{value:{count:i.count,$:i.$,aa:i.aa,O:i.O,P:i.P,T:i.T,U:i.U}}})),e.M.count.value+=1,e.M.$=!1,e},Ke.prototype.delete=function(){this.M.O||Ge(this),this.M.$&&!this.M.aa&&A(`Object already scheduled for deletion`),De(this),ke(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},Ke.prototype.isDeleted=function(){return!this.M.O},Ke.prototype.deleteLater=function(){return this.M.O||Ge(this),this.M.$&&!this.M.aa&&A(`Object already scheduled for deletion`),ye.push(this),ye.length===1&&xe&&xe(be),this.M.$=!0,this},et.prototype.qa=function(e){return this.ka&&(e=this.ka(e)),e},et.prototype.ha=function(e){this.W&&this.W(e)},et.prototype.argPackAdvance=8,et.prototype.readValueFromPointer=ze,et.prototype.deleteObject=function(e){e!==null&&e.delete()},et.prototype.fromWireType=function(e){function t(){return this.da?Fe(this.N.X,{P:this.wa,O:n,U:this,T:e}):Fe(this.N.X,{P:this,O:e})}var n=this.qa(e);if(!n)return this.ha(e),null;var r=Me(this.N,n);if(r!==void 0)return r.M.count.value===0?(r.M.O=n,r.M.T=e,r.clone()):(r=r.clone(),this.ha(e),r);if(r=this.N.pa(n),r=je[r],!r)return t.call(this);r=this.ca?r.la:r.pointerType;var i=Ae(n,this.N,r.N);return i===null?t.call(this):this.da?Fe(r.N.X,{P:r,O:i,U:this,T:e}):Fe(r.N.X,{P:r,O:i})},rt=n.UnboundTypeError=fe(`UnboundTypeError`);var wt=typeof atob==`function`?atob:function(e){var t=``,n=0;e=e.replace(/[^A-Za-z0-9\+\/=]/g,``);do{var r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`.indexOf(e.charAt(n++)),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`.indexOf(e.charAt(n++)),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`.indexOf(e.charAt(n++)),o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`.indexOf(e.charAt(n++));r=r<<2|i>>4,i=(i&15)<<4|a>>2;var s=(a&3)<<6|o;t+=String.fromCharCode(r),a!==64&&(t+=String.fromCharCode(i)),o!==64&&(t+=String.fromCharCode(s))}while(n<e.length);return t},Tt={l:function(e,t,n,r){ne(`Assertion failed: `+(e?f(h,e):``)+`, at: `+[t?t?f(h,t):``:`unknown filename`,n,r?r?f(h,r):``:`unknown function`])},q:function(e,t,n){e=ve(e),t=Ee(t,`wrapper`),n=me(n);var r=[].slice,i=t.N,a=i.X,o=i.R.X,s=i.R.constructor;for(var c in e=ue(e,function(){i.R.ja.forEach(function(e){if(this[e]===o[e])throw new ge(`Pure virtual function `+e+` must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:a}),this.__construct.apply(this,r.call(arguments))}),a.__construct=function(){this===a&&A(`Pass correct 'this' to __construct`);var e=s.implement.apply(void 0,[this].concat(r.call(arguments)));De(e);var t=e.M;e.notifyOnDestruction(),t.aa=!0,Object.defineProperties(this,{M:{value:t}}),Ie(this),e=t.O,e=Ce(i,e),Se.hasOwnProperty(e)?A(`Tried to register registered instance: `+e):Se[e]=this},a.__destruct=function(){this===a&&A(`Pass correct 'this' to __destruct`),De(this);var e=this.M.O;e=Ce(i,e),Se.hasOwnProperty(e)?delete Se[e]:A(`Tried to unregister unregistered instance: `+e)},e.prototype=Object.create(a),n)e.prototype[c]=n[c];return he(e)},j:function(e){var t=Le[e];delete Le[e];var n=t.fa,r=t.W,i=t.ia,a=i.map(e=>e.ta).concat(i.map(e=>e.za));He([e],a,e=>{var a={};return i.forEach((t,n)=>{var r=e[n],o=t.ra,s=t.sa,c=e[n+i.length],l=t.ya,u=t.Aa;a[t.oa]={read:e=>r.fromWireType(o(s,e)),write:(e,t)=>{var n=[];l(u,e,c.toWireType(n,t)),Re(n)}}}),[{name:t.name,fromWireType:function(e){var t={},n;for(n in a)t[n]=a[n].read(e);return r(e),t},toWireType:function(e,t){for(var i in a)if(!(i in t))throw TypeError(`Missing field: "`+i+`"`);var o=n();for(i in a)a[i].write(o,t[i]);return e!==null&&e.push(r,o),o},argPackAdvance:8,readValueFromPointer:ze,V:r}]})},v:function(){},B:function(e,t,n,r,i){var a=Ue(n);t=ve(t),We(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:i},argPackAdvance:8,readValueFromPointer:function(e){if(n===1)var r=m;else if(n===2)r=g;else if(n===4)r=v;else throw TypeError(`Unknown boolean type size: `+t);return this.fromWireType(r[e>>a])},V:null})},f:function(e,t,n,r,i,a,o,s,c,l,u,d,f){u=ve(u),a=j(i,a),s&&=j(o,s),l&&=j(c,l),f=j(d,f);var p=le(u);Je(p,function(){it(`Cannot construct `+u+` due to unbound types`,[r])}),He([e,t,n],r?[r]:[],function(t){if(t=t[0],r)var n=t.N,i=n.X;else i=Ke.prototype;t=ue(p,function(){if(Object.getPrototypeOf(this)!==o)throw new pe(`Use 'new' to construct `+u);if(c.Y===void 0)throw new pe(u+` has no accessible constructor`);var e=c.Y[arguments.length];if(e===void 0)throw new pe(`Tried to invoke ctor of `+u+` with invalid number of parameters (`+arguments.length+`) - expected (`+Object.keys(c.Y).toString()+`) parameters instead!`);return e.apply(this,arguments)});var o=Object.create(i,{constructor:{value:t}});t.prototype=o;var c=new Ye(u,t,o,f,n,a,s,l);n=new et(u,c,!0,!1),i=new et(u+`*`,c,!1,!1);var d=new et(u+` const*`,c,!1,!0);return je[e]={pointerType:i,la:d},tt(p,t),[n,i,d]})},d:function(e,t,n,r,i,a,o){var s=ot(n,r);t=ve(t),a=j(i,a),He([],[e],function(e){function r(){it(`Cannot call `+i+` due to unbound types`,s)}e=e[0];var i=e.name+`.`+t;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]);var c=e.N.constructor;return c[t]===void 0?(r.Z=n-1,c[t]=r):(qe(c,t,i),c[t].S[n-1]=r),He([],s,function(e){return e=at(i,[e[0],null].concat(e.slice(1)),null,a,o),c[t].S===void 0?(e.Z=n-1,c[t]=e):c[t].S[n-1]=e,[]}),[]})},p:function(e,t,n,r,i,a){0<t||ne();var o=ot(t,n);i=j(r,i),He([],[e],function(e){e=e[0];var n=`constructor `+e.name;if(e.N.Y===void 0&&(e.N.Y=[]),e.N.Y[t-1]!==void 0)throw new pe(`Cannot register multiple constructors with identical number of parameters (`+(t-1)+`) for class '`+e.name+`'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.N.Y[t-1]=()=>{it(`Cannot construct `+e.name+` due to unbound types`,o)},He([],o,function(r){return r.splice(1,0,null),e.N.Y[t-1]=at(n,r,null,i,a),[]}),[]})},a:function(e,t,n,r,i,a,o,s){var c=ot(n,r);t=ve(t),a=j(i,a),He([],[e],function(e){function r(){it(`Cannot call `+i+` due to unbound types`,c)}e=e[0];var i=e.name+`.`+t;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.N.ja.push(t);var l=e.N.X,u=l[t];return u===void 0||u.S===void 0&&u.className!==e.name&&u.Z===n-2?(r.Z=n-2,r.className=e.name,l[t]=r):(qe(l,t,i),l[t].S[n-2]=r),He([],c,function(r){return r=at(i,r,e,a,o),l[t].S===void 0?(r.Z=n-2,l[t]=r):l[t].S[n-2]=r,[]}),[]})},A:function(e,t){t=ve(t),We(e,{name:t,fromWireType:function(e){var t=me(e);return st(e),t},toWireType:function(e,t){return he(t)},argPackAdvance:8,readValueFromPointer:ze,V:null})},n:function(e,t,n){n=Ue(n),t=ve(t),We(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:lt(t,n),V:null})},e:function(e,t,n,r,i){t=ve(t),i===-1&&(i=4294967295),i=Ue(n);var a=e=>e;if(r===0){var o=32-8*n;a=e=>e<<o>>>o}n=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t},We(e,{name:t,fromWireType:a,toWireType:n,argPackAdvance:8,readValueFromPointer:ut(t,i,r!==0),V:null})},b:function(e,t,n){function r(e){e>>=2;var t=y;return new i(p,t[e+1],t[e])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];n=ve(n),We(e,{name:n,fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{ua:!0})},o:function(e,t){t=ve(t);var n=t===`std::string`;We(e,{name:t,fromWireType:function(e){var t=y[e>>2],r=e+4;if(n)for(var i=r,a=0;a<=t;++a){var o=r+a;if(a==t||h[o]==0){if(i=i?f(h,i,o-i):``,s===void 0)var s=i;else s+=`\0`,s+=i;i=o+1}}else{for(s=Array(t),a=0;a<t;++a)s[a]=String.fromCharCode(h[r+a]);s=s.join(``)}return Ot(e),s},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;if(i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||A(`Cannot pass non-string to std::string`),n&&i){var a=0;for(r=0;r<t.length;++r){var o=t.charCodeAt(r);127>=o?a++:2047>=o?a+=2:55296<=o&&57343>=o?(a+=4,++r):a+=3}r=a}else r=t.length;if(a=Dt(4+r+1),o=a+4,y[a>>2]=r,n&&i){if(i=o,o=r+1,r=h,0<o){o=i+o-1;for(var s=0;s<t.length;++s){var c=t.charCodeAt(s);if(55296<=c&&57343>=c){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(127>=c){if(i>=o)break;r[i++]=c}else{if(2047>=c){if(i+1>=o)break;r[i++]=192|c>>6}else{if(65535>=c){if(i+2>=o)break;r[i++]=224|c>>12}else{if(i+3>=o)break;r[i++]=240|c>>18,r[i++]=128|c>>12&63}r[i++]=128|c>>6&63}r[i++]=128|c&63}}r[i]=0}}else if(i)for(i=0;i<r;++i)s=t.charCodeAt(i),255<s&&(Ot(o),A(`String has UTF-16 code units that do not fit in 8 bits`)),h[o+i]=s;else for(i=0;i<r;++i)h[o+i]=t[i];return e!==null&&e.push(Ot,a),a},argPackAdvance:8,readValueFromPointer:ze,V:function(e){Ot(e)}})},i:function(e,t,n){if(n=ve(n),t===2)var r=dt,i=ft,a=M,o=()=>_,s=1;else t===4&&(r=pt,i=mt,a=ht,o=()=>y,s=2);We(e,{name:n,fromWireType:function(e){for(var n=y[e>>2],i=o(),a,c=e+4,l=0;l<=n;++l){var u=e+4+l*t;(l==n||i[u>>s]==0)&&(c=r(c,u-c),a===void 0?a=c:(a+=`\0`,a+=c),c=u+t)}return Ot(e),a},toWireType:function(e,r){typeof r!=`string`&&A(`Cannot pass non-string to C++ string type `+n);var o=a(r),c=Dt(4+o+t);return y[c>>2]=o>>s,i(r,c+4,o+t),e!==null&&e.push(Ot,c),c},argPackAdvance:8,readValueFromPointer:ze,V:function(e){Ot(e)}})},k:function(e,t,n,r,i,a){Le[e]={name:ve(t),fa:j(n,r),W:j(i,a),ia:[]}},h:function(e,t,n,r,i,a,o,s,c,l){Le[e].ia.push({oa:ve(t),ta:n,ra:j(r,i),sa:a,za:o,ya:j(s,c),Aa:l})},C:function(e,t){t=ve(t),We(e,{va:!0,name:t,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(e,t,n,r,i){e=_t[e],t=me(t),n=N(n);var a=[];return y[r>>2]=he(a),e(t,n,a,i)},t:function(e,t,n,r){e=_t[e],t=me(t),n=N(n),e(t,n,null,r)},g:st,m:function(e,t){var n=yt(e,t),r=n[0];t=r.name+`_$`+n.slice(1).map(function(e){return e.name}).join(`_`)+`$`;var i=bt[t];if(i!==void 0)return i;var a=Array(e-1);return i=vt((t,i,o,s)=>{for(var c=0,l=0;l<e-1;++l)a[l]=n[l+1].readValueFromPointer(s+c),c+=n[l+1].argPackAdvance;for(t=t[i].apply(t,a),l=0;l<e-1;++l)n[l+1].ma&&n[l+1].ma(a[l]);if(!r.va)return r.toWireType(o,t)}),bt[t]=i},D:function(e){4<e&&(k[e].ga+=1)},r:function(e){Re(me(e)),st(e)},c:function(){ne(``)},x:function(e,t,n){h.copyWithin(e,t,t+n)},w:function(e){var t=h.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var i=Math;r=Math.max(e,r),i=i.min.call(i,2147483648,r+(65536-r%65536)%65536);a:{try{u.grow(i-p.byteLength+65535>>>16),S();var a=1;break a}catch{}a=void 0}if(a)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(e,t,n,r){for(var i=0,a=0;a<n;a++){var o=y[t>>2],l=y[t+4>>2];t+=8;for(var u=0;u<l;u++){var d=h[o+u],p=xt[e];d===0||d===10?((e===1?s:c)(f(p,0)),p.length=0):p.push(d)}i+=l}return y[r>>2]=i,0}};(function(){function e(e){n.asm=e.exports,u=n.asm.E,S(),C=n.asm.J,T.unshift(n.asm.F),O--,n.monitorRunDependencies&&n.monitorRunDependencies(O),O==0&&(ee!==null&&(clearInterval(ee),ee=null),te&&(e=te,te=null,e()))}function t(t){e(t.instance)}function r(e){return se().then(function(e){return WebAssembly.instantiate(e,a)}).then(function(e){return e}).then(e,function(e){c(`failed to asynchronously prepare wasm: `+e),ne(e)})}var a={a:Tt};if(O++,n.monitorRunDependencies&&n.monitorRunDependencies(O),n.instantiateWasm)try{return n.instantiateWasm(a,e)}catch(e){c(`Module.instantiateWasm callback failed with error: `+e),i(e)}return(function(){return l||typeof WebAssembly.instantiateStreaming!=`function`||re(ie)||typeof fetch!=`function`?r(t):fetch(ie,{credentials:`same-origin`}).then(function(e){return WebAssembly.instantiateStreaming(e,a).then(t,function(e){return c(`wasm streaming compile failed: `+e),c(`falling back to ArrayBuffer instantiation`),r(t)})})})().catch(i),{}})(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.F).apply(null,arguments)};var Et=n.___getTypeName=function(){return(Et=n.___getTypeName=n.asm.G).apply(null,arguments)};n.__embind_initialize_bindings=function(){return(n.__embind_initialize_bindings=n.asm.H).apply(null,arguments)};var Dt=n._malloc=function(){return(Dt=n._malloc=n.asm.I).apply(null,arguments)},Ot=n._free=function(){return(Ot=n._free=n.asm.K).apply(null,arguments)};n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.L).apply(null,arguments)};var kt;te=function e(){kt||At(),kt||(te=e)};function At(){function e(){if(!kt&&(kt=!0,n.calledRun=!0,!d)){if(ce(T),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();E.unshift(e)}ce(E)}}if(!(0<O)){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)D();ce(w),0<O||(n.setStatus?(n.setStatus(`Running...`),setTimeout(function(){setTimeout(function(){n.setStatus(``)},1),e()},1)):e())}}if(n.preInit)for(typeof n.preInit==`function`&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return At(),t.ready})})(),jn=function(e){return e[e.Auto=0]=`Auto`,e[e.FlexStart=1]=`FlexStart`,e[e.Center=2]=`Center`,e[e.FlexEnd=3]=`FlexEnd`,e[e.Stretch=4]=`Stretch`,e[e.Baseline=5]=`Baseline`,e[e.SpaceBetween=6]=`SpaceBetween`,e[e.SpaceAround=7]=`SpaceAround`,e[e.SpaceEvenly=8]=`SpaceEvenly`,e}({}),Mn=function(e){return e[e.BorderBox=0]=`BorderBox`,e[e.ContentBox=1]=`ContentBox`,e}({}),Nn=function(e){return e[e.Width=0]=`Width`,e[e.Height=1]=`Height`,e}({}),Pn=function(e){return e[e.Inherit=0]=`Inherit`,e[e.LTR=1]=`LTR`,e[e.RTL=2]=`RTL`,e}({}),Fn=function(e){return e[e.Flex=0]=`Flex`,e[e.None=1]=`None`,e[e.Contents=2]=`Contents`,e}({}),In=function(e){return e[e.Left=0]=`Left`,e[e.Top=1]=`Top`,e[e.Right=2]=`Right`,e[e.Bottom=3]=`Bottom`,e[e.Start=4]=`Start`,e[e.End=5]=`End`,e[e.Horizontal=6]=`Horizontal`,e[e.Vertical=7]=`Vertical`,e[e.All=8]=`All`,e}({}),Ln=function(e){return e[e.None=0]=`None`,e[e.StretchFlexBasis=1]=`StretchFlexBasis`,e[e.AbsolutePositionWithoutInsetsExcludesPadding=2]=`AbsolutePositionWithoutInsetsExcludesPadding`,e[e.AbsolutePercentAgainstInnerSize=4]=`AbsolutePercentAgainstInnerSize`,e[e.All=2147483647]=`All`,e[e.Classic=2147483646]=`Classic`,e}({}),Rn=function(e){return e[e.WebFlexBasis=0]=`WebFlexBasis`,e}({}),zn=function(e){return e[e.Column=0]=`Column`,e[e.ColumnReverse=1]=`ColumnReverse`,e[e.Row=2]=`Row`,e[e.RowReverse=3]=`RowReverse`,e}({}),Bn=function(e){return e[e.Column=0]=`Column`,e[e.Row=1]=`Row`,e[e.All=2]=`All`,e}({}),Vn=function(e){return e[e.FlexStart=0]=`FlexStart`,e[e.Center=1]=`Center`,e[e.FlexEnd=2]=`FlexEnd`,e[e.SpaceBetween=3]=`SpaceBetween`,e[e.SpaceAround=4]=`SpaceAround`,e[e.SpaceEvenly=5]=`SpaceEvenly`,e}({}),Hn=function(e){return e[e.Error=0]=`Error`,e[e.Warn=1]=`Warn`,e[e.Info=2]=`Info`,e[e.Debug=3]=`Debug`,e[e.Verbose=4]=`Verbose`,e[e.Fatal=5]=`Fatal`,e}({}),Un=function(e){return e[e.Undefined=0]=`Undefined`,e[e.Exactly=1]=`Exactly`,e[e.AtMost=2]=`AtMost`,e}({}),Wn=function(e){return e[e.Default=0]=`Default`,e[e.Text=1]=`Text`,e}({}),Gn=function(e){return e[e.Visible=0]=`Visible`,e[e.Hidden=1]=`Hidden`,e[e.Scroll=2]=`Scroll`,e}({}),Kn=function(e){return e[e.Static=0]=`Static`,e[e.Relative=1]=`Relative`,e[e.Absolute=2]=`Absolute`,e}({}),qn=function(e){return e[e.Undefined=0]=`Undefined`,e[e.Point=1]=`Point`,e[e.Percent=2]=`Percent`,e[e.Auto=3]=`Auto`,e}({}),Jn=function(e){return e[e.NoWrap=0]=`NoWrap`,e[e.Wrap=1]=`Wrap`,e[e.WrapReverse=2]=`WrapReverse`,e}({}),Yn={ALIGN_AUTO:jn.Auto,ALIGN_FLEX_START:jn.FlexStart,ALIGN_CENTER:jn.Center,ALIGN_FLEX_END:jn.FlexEnd,ALIGN_STRETCH:jn.Stretch,ALIGN_BASELINE:jn.Baseline,ALIGN_SPACE_BETWEEN:jn.SpaceBetween,ALIGN_SPACE_AROUND:jn.SpaceAround,ALIGN_SPACE_EVENLY:jn.SpaceEvenly,BOX_SIZING_BORDER_BOX:Mn.BorderBox,BOX_SIZING_CONTENT_BOX:Mn.ContentBox,DIMENSION_WIDTH:Nn.Width,DIMENSION_HEIGHT:Nn.Height,DIRECTION_INHERIT:Pn.Inherit,DIRECTION_LTR:Pn.LTR,DIRECTION_RTL:Pn.RTL,DISPLAY_FLEX:Fn.Flex,DISPLAY_NONE:Fn.None,DISPLAY_CONTENTS:Fn.Contents,EDGE_LEFT:In.Left,EDGE_TOP:In.Top,EDGE_RIGHT:In.Right,EDGE_BOTTOM:In.Bottom,EDGE_START:In.Start,EDGE_END:In.End,EDGE_HORIZONTAL:In.Horizontal,EDGE_VERTICAL:In.Vertical,EDGE_ALL:In.All,ERRATA_NONE:Ln.None,ERRATA_STRETCH_FLEX_BASIS:Ln.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:Ln.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:Ln.AbsolutePercentAgainstInnerSize,ERRATA_ALL:Ln.All,ERRATA_CLASSIC:Ln.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:Rn.WebFlexBasis,FLEX_DIRECTION_COLUMN:zn.Column,FLEX_DIRECTION_COLUMN_REVERSE:zn.ColumnReverse,FLEX_DIRECTION_ROW:zn.Row,FLEX_DIRECTION_ROW_REVERSE:zn.RowReverse,GUTTER_COLUMN:Bn.Column,GUTTER_ROW:Bn.Row,GUTTER_ALL:Bn.All,JUSTIFY_FLEX_START:Vn.FlexStart,JUSTIFY_CENTER:Vn.Center,JUSTIFY_FLEX_END:Vn.FlexEnd,JUSTIFY_SPACE_BETWEEN:Vn.SpaceBetween,JUSTIFY_SPACE_AROUND:Vn.SpaceAround,JUSTIFY_SPACE_EVENLY:Vn.SpaceEvenly,LOG_LEVEL_ERROR:Hn.Error,LOG_LEVEL_WARN:Hn.Warn,LOG_LEVEL_INFO:Hn.Info,LOG_LEVEL_DEBUG:Hn.Debug,LOG_LEVEL_VERBOSE:Hn.Verbose,LOG_LEVEL_FATAL:Hn.Fatal,MEASURE_MODE_UNDEFINED:Un.Undefined,MEASURE_MODE_EXACTLY:Un.Exactly,MEASURE_MODE_AT_MOST:Un.AtMost,NODE_TYPE_DEFAULT:Wn.Default,NODE_TYPE_TEXT:Wn.Text,OVERFLOW_VISIBLE:Gn.Visible,OVERFLOW_HIDDEN:Gn.Hidden,OVERFLOW_SCROLL:Gn.Scroll,POSITION_TYPE_STATIC:Kn.Static,POSITION_TYPE_RELATIVE:Kn.Relative,POSITION_TYPE_ABSOLUTE:Kn.Absolute,UNIT_UNDEFINED:qn.Undefined,UNIT_POINT:qn.Point,UNIT_PERCENT:qn.Percent,UNIT_AUTO:qn.Auto,WRAP_NO_WRAP:Jn.NoWrap,WRAP_WRAP:Jn.Wrap,WRAP_WRAP_REVERSE:Jn.WrapReverse};function Xn(e){function t(e,t,n){let r=e[t];e[t]=function(){var e=[...arguments];return n.call(this,r,...e)}}for(let n of[`setPosition`,`setMargin`,`setFlexBasis`,`setWidth`,`setHeight`,`setMinWidth`,`setMinHeight`,`setMaxWidth`,`setMaxHeight`,`setPadding`,`setGap`]){let r={[qn.Point]:e.Node.prototype[n],[qn.Percent]:e.Node.prototype[`${n}Percent`],[qn.Auto]:e.Node.prototype[`${n}Auto`]};t(e.Node.prototype,n,function(e){var t=[...arguments].slice(1);let i=t.pop(),a,o;if(i===`auto`)a=qn.Auto,o=void 0;else if(typeof i==`object`)a=i.unit,o=i.valueOf();else if(a=typeof i==`string`&&i.endsWith(`%`)?qn.Percent:qn.Point,o=parseFloat(i),i!==void 0&&!Number.isNaN(i)&&Number.isNaN(o))throw Error(`Invalid value ${i} for ${n}`);if(!r[a])throw Error(`Failed to execute "${n}": Unsupported unit '${i}'`);return o===void 0?r[a].call(this,...t):r[a].call(this,...t,o)})}function n(t){return e.MeasureCallback.implement({measure:function(){let{width:e,height:n}=t(...arguments);return{width:e??NaN,height:n??NaN}}})}t(e.Node.prototype,`setMeasureFunc`,function(e,t){return t?e.call(this,n(t)):this.unsetMeasureFunc()});function r(t){return e.DirtiedCallback.implement({dirtied:t})}return t(e.Node.prototype,`setDirtiedFunc`,function(e,t){e.call(this,r(t))}),t(e.Config.prototype,`free`,function(){e.Config.destroy(this)}),t(e.Node,`create`,(t,n)=>n?e.Node.createWithConfig(n):e.Node.createDefault()),t(e.Node.prototype,`free`,function(){e.Node.destroy(this)}),t(e.Node.prototype,`freeRecursive`,function(){for(let e=0,t=this.getChildCount();e<t;++e)this.getChild(0).freeRecursive();this.free()}),t(e.Node.prototype,`calculateLayout`,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Pn.LTR;return e.call(this,t,n,r)}),{Config:e.Config,Node:e.Node,...Yn}}async function Zn(){return Xn(await An())}var Qn=Math.cos(45/180*Math.PI),$n=[new Se,new Se,new Se,new Se],er=new c,tr=class{planes;facePlane;originalCenter;constructor(e,t,n,r,i){this.originalCenter=new c(t,n,0).applyMatrix4(e),this.facePlane=new Se(new c(0,0,1),0).applyMatrix4(e);let a=r/2,o=i/2,s=n+o,l=t+a,u=-n+o,d=-t+a;this.planes=[new Se(new c(0,-1,0),u).applyMatrix4(e),new Se(new c(-1,0,0),d).applyMatrix4(e),new Se(new c(0,1,0),s).applyMatrix4(e),new Se(new c(1,0,0),l).applyMatrix4(e)]}min({planes:e}){for(let t=0;t<4;t++){let n=this.facePlane,r=e[t],i=n.normal.dot(r.normal);if(Math.abs(i)>.99)return this;let a=$n[t];if(Math.abs(i)<.01){a.copy(r);continue}a.normal.crossVectors(n.normal,r.normal).normalize().cross(n.normal).negate();let o=1-i*i,s=(n.constant-r.constant*i)/o,c=(r.constant-n.constant*i)/o;er.copy(n.normal).multiplyScalar(s).addScaledVector(r.normal,c),a.constant=-er.dot(a.normal)}let t=this.planes[0].normal;for(;$n[0].normal.dot(t)>Qn;)break;for(let t=0;t<4;t++){let n=this.planes[t],r=(t+0)%4;$n[r].distanceToPoint(this.originalCenter)<n.distanceToPoint(this.originalCenter)&&n.copy(e[r])}return this}toArray(e,t){for(let n=0;n<4;n++){let{normal:r,constant:i}=this.planes[n];r.toArray(e,t),e[t+3]=i,t+=4}}},nr=[new c,new c,new c,new c],rr=[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]];function ir(e,t,n,r){return N(()=>{let i=e.value;if(i==null)return!1;let a=n.value;if(a==null)return!0;let o=t.value,s=i.clippingRect.value;if(s==null||o==null)return!1;let[c,l]=a,u=r.value;for(let e=0;e<4;e++){let[t,n]=rr[e];nr[e].set(t*u*c,n*u*l,0).applyMatrix4(o)}let{planes:d}=s,f;for(let e=0;e<4;e++){let t=d[e];f=!0;for(let e=0;e<4;e++){let n=nr[e];t.distanceToPoint(n)>=0&&(f=!1)}if(f)return!0}return!1})}function ar(e,{overflow:t,borderInset:n,size:r},i,a){return N(()=>{let o=e.value,s=a?.value;if(o==null||t.value===Gn.Visible)return s;let c=r.value,l=n.value;if(c==null||l==null)return;let[u,d]=c,[f,p,m,h]=l,g=i.value,_=new tr(o,(p-h)*g/2,(f-m)*g/2,(u-h-p)*g,(d-f-m)*g);return s!=null&&_.min(s),_})}var or=new Se(new c(-1,0,0),2**53-1),sr=new Float32Array(16);for(let e=0;e<4;e++)or.normal.toArray(sr,e*4),sr[e*4+3]=or.constant;function cr(e){let t=()=>e.root.peek().component.parent?.matrixWorld;return[,,,,].fill(void 0).map((n,r)=>new ur(()=>e.parentContainer.peek()?.clippingRect.value?.planes[r],t))}var lr=new Se,ur=class{getLocalPlane;getGlobalMatrix;get normal(){return this.computeInto(lr),lr.normal}get constant(){return this.computeInto(lr),lr.constant}isPlane=!0;constructor(e,t){this.getLocalPlane=e,this.getGlobalMatrix=t}computeInto(e){let t=this.getLocalPlane(),n=this.getGlobalMatrix();return t==null||n==null?e.copy(or):e.copy(t).applyMatrix4(n)}set(e,t){return this}setComponents(e,t,n,r){return this}setFromNormalAndCoplanarPoint(e,t){return this}setFromCoplanarPoints(e,t,n){return this}clone(){return this.computeInto(new Se)}copy(e){return this.computeInto(e),this}normalize(){return this}negate(){return this}distanceToPoint(e){return this.computeInto(lr).distanceToPoint(e)}distanceToSphere(e){return this.computeInto(lr).distanceToSphere(e)}projectPoint(e,t){return this.computeInto(lr).projectPoint(e,t)}intersectLine(e,t){return this.computeInto(lr).intersectLine(e,t)}intersectsLine(e){return this.computeInto(lr).intersectsLine(e)}intersectsBox(e){return this.computeInto(lr).intersectsBox(e)}intersectsSphere(e){return this.computeInto(lr).intersectsSphere(e)}coplanarPoint(e){return this.computeInto(lr).coplanarPoint(e)}applyMatrix4(e,t){return this}translate(e){return this}equals(e){return this.computeInto(lr).equals(e)}isIntersectionLine(e){return this.computeInto(lr).isIntersectionLine(e)}},dr=class{group;minorIndex;matrix;size;borderInset;clippingRect;materialConfig;indexInBucket;bucket;insertedIntoGroup=!1;active=M(!1);abortController;constructor(e,t,n,r,i,a,o,s,c,l){this.group=t,this.minorIndex=n,this.matrix=r,this.size=i,this.borderInset=a,this.clippingRect=o,this.materialConfig=c;let u=c.setters;P(()=>{if(!(!s.value||!this.active.value))return e.subscribePropertyKeys(t=>{c.hasProperty(t)&&P(()=>{let n=this.getIndexInBuffer();if(n==null)return;let{instanceData:r,instanceDataOnUpdate:a,root:o}=this.group;u[t](r.array,r.itemSize*n,e.value[t],i,e.signal.opacity,a),o.requestRender?.()},l)})},l);let d=c.computedIsVisibile(e,a,i,s);P(()=>{if(d.value){this.requestShow();return}this.hide()},l),l.addEventListener(`abort`,()=>this.hide())}setIndexInBucket(e){this.indexInBucket=e}getIndexInBuffer(){if(!(this.bucket==null||this.indexInBucket==null))return this.bucket.offset+this.indexInBucket}activate(e,t){this.bucket=e,this.indexInBucket=t,this.active.value=!0,this.abortController=new AbortController,P(()=>{let e=this.matrix.value;if(e==null)return;let t=this.getIndexInBuffer();if(t==null)return;let n=t*16,{instanceMatrix:r,root:i}=this.group;e.toArray(r.array,n),r.addUpdateRange(n,16),r.needsUpdate=!0,i.requestRender?.()},this.abortController.signal),P(()=>{let e=this.getIndexInBuffer(),t=this.size.value;if(e==null||t==null)return;let[n,r]=t,{instanceData:i,root:a}=this.group,{array:o}=i,s=e*16+14;o[s]=n,o[s+1]=r,i.addUpdateRange(s,2),i.needsUpdate=!0,a.requestRender?.()},this.abortController.signal),P(()=>{let e=this.getIndexInBuffer(),t=this.borderInset.value;if(e==null||t==null)return;let{instanceData:n,root:r}=this.group,i=e*16+0;n.array.set(t,i),n.addUpdateRange(i,4),n.needsUpdate=!0,r.requestRender?.()},this.abortController.signal),P(()=>{let e=this.getIndexInBuffer();if(e==null)return;let{instanceClipping:t,root:n}=this.group,r=e*16,i=this.clippingRect?.value;i==null?t.array.set(sr,r):i.toArray(t.array,r),t.addUpdateRange(r,16),t.needsUpdate=!0,n.requestRender?.()},this.abortController.signal)}requestShow(){this.insertedIntoGroup||(this.insertedIntoGroup=!0,this.group.insert(this.minorIndex,this))}hide(){this.insertedIntoGroup&&(this.active.value=!1,this.group.delete(this.minorIndex,this.indexInBucket,this),this.insertedIntoGroup=!1,this.bucket=void 0,this.indexInBucket=void 0,this.abortController?.abort(),this.abortController=void 0)}};function fr(e){return N(()=>({panelMaterialClass:Ht(e.value.panelMaterialClass),castShadow:e.value.castShadow,receiveShadow:e.value.receiveShadow,depthWrite:e.value.depthWrite??!1,depthTest:e.value.depthTest,renderOrder:xn(e.value.renderOrder??0)}))}function pr(e,t,n,r,i,a,o,s,c,l,u){P(()=>{let u=e.enabled.value,d=n.value;if(!u||d==null)return;let f=new AbortController;return new dr(e,t.value.panelGroupManager.getGroup(d,r.value),d.patchIndex,i,a,o,s,c,l,f.signal),()=>f.abort()},u)}var mr=new Ce,hr=/^rgba\((\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\)$/,gr=/^#(?:([0-9a-f]{3})([0-9a-f])|([0-9a-f]{6})([0-9a-f]{2}))$/i;function _r(e,t,n,r,i){let a;if(Array.isArray(n)){for(let r=0;r<n.length;r++)e[r+t]=n[r];e[t+3]=(n.length===3?1:e[t+3])*r}else if(n===`transparent`)e.fill(0,t,t+4);else if(typeof n==`string`&&(a=n.match(hr))!=null){for(let n=0;n<3;n++)e[n+t]=parseFloat(a[n+1])/255;e[3+t]=parseFloat(a[4])*r}else if(typeof n==`string`&&(a=n.match(gr))!=null){let n=a[1]??a[3],i=a[2]==null?a[4]:`${a[2]}${a[2]}`;mr.set(`#${n}`).toArray(e,t),e[t+3]=Number.parseInt(i,16)/255*r}else mr.set(n).toArray(e,t),e[t+3]=r;i?.(t,4)}function vr(e,t){return e.xoffset*t}function yr(e,t,n,r){return n==null?0:e.getKerning(n,r.id)*t}function br(e,t,n){let[r,i]=n?.component.size.value??[];return bn(e,t,r,i)}function xr(e,t,n){return(n?.yoffset??0)*e+(t-e)/2}function Sr(e,t,n){return t.xadvance*e+n}function Cr(e){return e}function wr(e,t){return Math.max(e,1)*t}var Tr={backgroundColor:(e,t,n,r,i,a)=>_r(e,t+4,n,br(i.value,()=>1),a),borderBottomLeftRadius:(e,t,n,{value:r},i,a)=>{r!=null&&Er(e,t+8,0,n,r[1],a)},borderBottomRightRadius:(e,t,n,{value:r},i,a)=>r!=null&&Er(e,t+8,1,n,r[1],a),borderTopRightRadius:(e,t,n,{value:r},i,a)=>r!=null&&Er(e,t+8,2,n,r[1],a),borderTopLeftRadius:(e,t,n,{value:r},i,a)=>r!=null&&Er(e,t+8,3,n,r[1],a),borderColor:(e,t,n,r,i,a)=>_r(e,t+9,n,br(i.value,()=>1),a),borderBend:(e,t,n,r,i,a)=>Dr(e,t+13,br(n,()=>1),a)};function Er(e,t,n,r,i,a){kr(e,t,n,br(r,()=>i),i),a?.(t,1)}function Dr(e,t,n,r){e[t]=n,r?.(t,1)}function Or(e,t,n){let r=50**t;return e+(n-Math.floor(e/r)%50)*r}function kr(e,t,n,r,i){e[t]=Or(e[t],n,i===0?0:Ft(Math.ceil((r??0)/i*100),0,49))}var Ar={backgroundColor:`transparent`,borderColor:`transparent`,borderBottomLeftRadius:0,borderTopLeftRadius:0,borderBottomRightRadius:0,borderTopRightRadius:0,borderBend:0},jr=1,Mr;function Nr(){if(Mr==null){let e={};for(let t in Ar)e[t]=t;Mr=Fr(e)}return Mr}var Pr=[0,0,0,0];function Fr(e,t){let n={...Ar,...t},r={};for(let t in e){let i=Tr[t],a=n[t];r[e[t]]=(e,t,n,r,o,s)=>i(e,t,n??a,r,o,s)}let i=new Float32Array(16);return _r(i,4,n.backgroundColor,jr,void 0),_r(i,9,n.borderColor,jr,void 0),i[13]=n.borderBend,{hasProperty:e=>e in r,defaultData:i,setters:r,computedIsVisibile:(t,r,i,a)=>N(()=>{let o=r.value,s=i.value;if(o==null||s==null)return!1;let c=e.backgroundColor==null?n.backgroundColor:t.value[e.backgroundColor]??n.backgroundColor,l=e.borderColor==null?n.borderColor:t.value[e.borderColor]??n.borderColor,u=br(t.value.opacity??jr,()=>1);_r(Pr,0,c??n.backgroundColor,u);let[d,f]=s,p=d>0&&f>0&&Pr[3]>0;_r(Pr,0,l??n.borderColor,u);let m=o.some(e=>e>0)&&Pr[3]>0;return!p&&!m?!1:a.value})}}function Ir(e,t,n){if(t==null)return n;let r=e[t];if(r==null)throw Error(`unexpected value ${t}, expected ${Object.keys(e).join(`, `)}`);return r}function Lr(e,t){let[n,r]=t.component.size.value??[0,0];return Cn(e,n,r)}function Rr(e){return e==null?void 0:Sn(e)}var zr={static:0,relative:1,absolute:2},Br={auto:0,"flex-start":1,center:2,"flex-end":3,stretch:4,baseline:5,"space-between":6,"space-around":7,"space-evenly":8},Vr={column:0,"column-reverse":1,row:2,"row-reverse":3},Hr={"no-wrap":0,wrap:1,"wrap-reverse":2},Ur={"flex-start":0,center:1,"flex-end":2,"space-between":3,"space-around":4,"space-evenly":5},Wr={visible:0,hidden:1,scroll:2},Gr={flex:0,none:1,contents:2},Kr={positionType:(e,t,n)=>{t.setPositionType(Ir(zr,n,1))},positionTop:(e,t,n)=>{if(n===`auto`){t.setPositionAuto(1);return}t.setPosition(1,Lr(n,e))},positionLeft:(e,t,n)=>{if(n===`auto`){t.setPositionAuto(0);return}t.setPosition(0,Lr(n,e))},positionRight:(e,t,n)=>{if(n===`auto`){t.setPositionAuto(2);return}t.setPosition(2,Lr(n,e))},positionBottom:(e,t,n)=>{if(n===`auto`){t.setPositionAuto(3);return}t.setPosition(3,Lr(n,e))},alignContent:(e,t,n)=>{t.setAlignContent(Ir(Br,n,4))},alignItems:(e,t,n)=>{t.setAlignItems(Ir(Br,n,4))},alignSelf:(e,t,n)=>{t.setAlignSelf(Ir(Br,n,0))},flexDirection:(e,t,n)=>{t.setFlexDirection(Ir(Vr,n,2))},flexWrap:(e,t,n)=>{t.setFlexWrap(Ir(Hr,n,0))},justifyContent:(e,t,n)=>{t.setJustifyContent(Ir(Ur,n,0))},marginTop:(e,t,n)=>{if(n===`auto`){t.setMarginAuto(1);return}t.setMargin(1,Lr(n,e))},marginLeft:(e,t,n)=>{if(n===`auto`){t.setMarginAuto(0);return}t.setMargin(0,Lr(n,e))},marginRight:(e,t,n)=>{if(n===`auto`){t.setMarginAuto(2);return}t.setMargin(2,Lr(n,e))},marginBottom:(e,t,n)=>{if(n===`auto`){t.setMarginAuto(3);return}t.setMargin(3,Lr(n,e))},flexBasis:(e,t,n)=>{if(n===`auto`){t.setFlexBasisAuto();return}t.setFlexBasis(Lr(n,e)??NaN)},flexGrow:(e,t,n)=>{t.setFlexGrow(Rr(n)??0)},flexShrink:(e,t,n)=>{t.setFlexShrink(Rr(n)??1)},width:(e,t,n)=>{if(n===`auto`){t.setWidthAuto();return}t.setWidth(Lr(n,e)??NaN)},height:(e,t,n)=>{if(n===`auto`){t.setHeightAuto();return}t.setHeight(Lr(n,e)??NaN)},minWidth:(e,t,n)=>{t.setMinWidth(Lr(n,e))},minHeight:(e,t,n)=>{t.setMinHeight(Lr(n,e))},maxWidth:(e,t,n)=>{t.setMaxWidth(Lr(n,e))},maxHeight:(e,t,n)=>{t.setMaxHeight(Lr(n,e))},boxSizing:(e,t,n)=>{t.setBoxSizing(Rr(n)??0)},aspectRatio:(e,t,n)=>{t.setAspectRatio(Rr(n))},borderTopWidth:(e,t,n)=>{t.setBorder(1,Rr(n))},borderLeftWidth:(e,t,n)=>{t.setBorder(0,Rr(n))},borderRightWidth:(e,t,n)=>{t.setBorder(2,Rr(n))},borderBottomWidth:(e,t,n)=>{t.setBorder(3,Rr(n))},overflow:(e,t,n)=>{t.setOverflow(Ir(Wr,n,0))},display:(e,t,n)=>{t.setDisplay(Ir(Gr,n,0))},paddingTop:(e,t,n)=>{t.setPadding(1,Lr(n,e))},paddingLeft:(e,t,n)=>{t.setPadding(0,Lr(n,e))},paddingRight:(e,t,n)=>{t.setPadding(2,Lr(n,e))},paddingBottom:(e,t,n)=>{t.setPadding(3,Lr(n,e))},gapRow:(e,t,n)=>{t.setGap(1,Lr(n,e))},gapColumn:(e,t,n)=>{t.setGap(0,Lr(n,e))},direction:(e,t,n)=>{t.setDirection(Rr(n)??0)}};function qr(e){let t=e.create();return t.setUseWebDefaults(!0),t.setPointScaleFactor(100),t.setExperimentalFeatureEnabled(Rn.WebFlexBasis,!0),t}var Jr=M(void 0);Zn().then(({Node:e,Config:t})=>{let n=qr(t);Jr.value=()=>e.create(n)}).catch(console.error);var Yr=()=>Jr.value?.();function Xr(e){return e===`measureFunc`?!0:e in Kr}var Zr=class{component;children=[];yogaNode;layoutChangeListeners=new Set;customLayouting;active=M(!1);constructor(e){this.component=e,P(()=>{let e=Yr();if(e!=null)return this.yogaNode=e,this.active.value=!0,this.updateMeasureFunction(),()=>{this.yogaNode?.getParent()?.removeChild(this.yogaNode),this.yogaNode?.free()}},e.abortSignal),P(()=>{if(!e.properties.enabled.value||!this.active.value)return;let t=new AbortController,n=e.properties.subscribePropertyKeys(n=>{Xr(n)&&P(()=>{Kr[n](e.root.value,this.yogaNode,e.properties.value[n]),this.component.root.peek().requestCalculateLayout()},t.signal)});return()=>{n(),t.abort()}},e.abortSignal),P(()=>{let t=e.parentContainer.value;if(t!=null)return t.node.addChild(this),()=>t.node.removeChild(this)},e.abortSignal)}setCustomLayouting(e){this.customLayouting=e,this.updateMeasureFunction()}updateMeasureFunction(){this.customLayouting==null||!this.active.value||(Qr(this.yogaNode,this.customLayouting.measure),this.component.root.peek().requestCalculateLayout())}calculateLayout(){this.yogaNode!=null&&(this.commit(this.yogaNode.getFlexDirection()),this.yogaNode.calculateLayout(void 0,void 0),tt(()=>this.updateMeasurements(!0,void 0,void 0)))}addChild(e){this.children.push(e),this.component.root.peek().requestCalculateLayout()}removeChild(e){let t=this.children.indexOf(e);t!==-1&&(this.children.splice(t,1),this.component.root.peek().requestCalculateLayout())}commit(e){if(this.yogaNode==null)throw Error(`commit cannot be called without a yoga node`);let t=e===zn.Column||e===zn.ColumnReverse;if(this.customLayouting!=null&&this.component.properties.peek()[t?`minHeight`:`minWidth`]===void 0&&this.yogaNode[t?`setMinHeight`:`setMinWidth`](t?this.customLayouting.minHeight:this.customLayouting.minWidth),this.component.properties.peek().flexShrink==null){let e=this.component.properties.peek().height!=null;this.yogaNode.setFlexShrink(e&&t?0:void 0)}let n;this.children.sort((e,t)=>{if(n??=e.component.parent?.children,n==null)return 0;let r=e.component,i=t.component,a=n.indexOf(r);if(a===-1)throw Error(`parent mismatch`);let o=n.indexOf(i);if(o===-1)throw Error(`parent mismatch`);return a-o});let r=0,i=this.yogaNode.getChild(r),a=this.children[r];for(;a!=null||i!=null;){if(a!=null&&i!=null&&ni(i,ti(a.yogaNode))){a=this.children[++r],i=this.yogaNode.getChild(r);continue}if(i!=null&&this.yogaNode.removeChild(i),a!=null){let e=ti(a.yogaNode);e.getParent()?.removeChild(e),this.yogaNode.insertChild(e,r),a=this.children[++r]}i=this.yogaNode.getChild(r)}let o=this.children.length;for(let e=0;e<o;e++)this.children[e].commit(this.yogaNode.getFlexDirection())}updateMeasurements(e,t,n){if(this.yogaNode==null)throw Error(`update measurements cannot be called without a yoga node`);this.component.overflow.value=this.yogaNode.getOverflow(),e&&=this.yogaNode.getDisplay()!=Fn.None,this.component.displayed.value=e;let r=this.yogaNode.getComputedWidth(),i=this.yogaNode.getComputedHeight();$r(this.component.size,r,i),t??=r,n??=i;let a=this.yogaNode.getComputedLeft(),o=this.yogaNode.getComputedTop(),s=a+r*.5-t*.5,c=-(o+i*.5-n*.5);$r(this.component.relativeCenter,s,c);let l=this.yogaNode.getComputedPadding(In.Top),u=this.yogaNode.getComputedPadding(In.Left),d=this.yogaNode.getComputedPadding(In.Right),f=this.yogaNode.getComputedPadding(In.Bottom);ei(this.component.paddingInset,l,d,f,u);let p=this.yogaNode.getComputedBorder(In.Top),m=this.yogaNode.getComputedBorder(In.Right),h=this.yogaNode.getComputedBorder(In.Bottom),g=this.yogaNode.getComputedBorder(In.Left);ei(this.component.borderInset,p,m,h,g);for(let e of this.layoutChangeListeners)e();let _=this.children.length,v=0,y=0;for(let t=0;t<_;t++){let[n,a]=this.children[t].updateMeasurements(e,r,i);v=Math.max(v,n),y=Math.max(y,a)}if(v-=g,y-=p,this.component.overflow.value===Gn.Scroll){v+=d,y+=u;let e=r-g-m,t=i-p-h,n=v-e,a=y-t,o=n>.5,s=a>.5;$r(this.component.maxScrollPosition,o?n:void 0,s?a:void 0),$r(this.component.scrollable,o,s)}else $r(this.component.maxScrollPosition,void 0,void 0),$r(this.component.scrollable,!1,!1);let b=this.component.overflow.value===Gn.Visible;return[a+Math.max(r,b?v:0),o+Math.max(i,b?y:0)]}addLayoutChangeListener(e){return this.layoutChangeListeners.add(e),()=>void this.layoutChangeListeners.delete(e)}};function Qr(e,t){if(t==null){e.setMeasureFunc(null);return}e.setMeasureFunc((e,n,r,i)=>{let a=t(e,n,r,i);return a.width=Math.ceil(a.width*100)/100,a.height=Math.ceil(a.height*100)/100,a}),e.markDirty()}function $r(e,t,n){let r=e.value;if(r!=null){let[e,i]=r;if(e===t&&i===n)return}e.value=[t,n]}function ei(e,t,n,r,i){let a=e.value;if(a!=null){let[e,o,s,c]=a;if(e==t&&o==n&&s==r&&c==i)return}e.value=[t,n,r,i]}function ti(e){if(e==null)throw Error(`commit cannot be called with a children that miss a yoga node`);return e}function ni(e,t){return e.M.O===t.M.O}var ri=Object.assign({},{borderWidth:[`borderBottomWidth`,`borderTopWidth`,`borderLeftWidth`,`borderRightWidth`],borderXWidth:[`borderLeftWidth`,`borderRightWidth`],borderYWidth:[`borderTopWidth`,`borderBottomWidth`],inset:[`positionTop`,`positionLeft`,`positionRight`,`positionBottom`],padding:[`paddingBottom`,`paddingTop`,`paddingLeft`,`paddingRight`],paddingX:[`paddingLeft`,`paddingRight`],paddingInline:[`paddingLeft`,`paddingRight`],paddingInlineStart:[`paddingLeft`],paddingInlineEnd:[`paddingRight`],paddingY:[`paddingTop`,`paddingBottom`],paddingBlock:[`paddingTop`,`paddingBottom`],paddingBlockStart:[`paddingTop`],paddingBlockEnd:[`paddingBottom`],margin:[`marginBottom`,`marginTop`,`marginLeft`,`marginRight`],marginX:[`marginLeft`,`marginRight`],marginInline:[`marginLeft`,`marginRight`],marginInlineStart:[`marginLeft`],marginInlineEnd:[`marginRight`],marginY:[`marginTop`,`marginBottom`],marginBlock:[`marginTop`,`marginBottom`],marginBlockStart:[`marginTop`],marginBlockEnd:[`marginBottom`],gap:[`gapRow`,`gapColumn`]},{borderRadius:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],borderTopRadius:[`borderTopLeftRadius`,`borderTopRightRadius`],borderLeftRadius:[`borderTopLeftRadius`,`borderBottomLeftRadius`],borderRightRadius:[`borderTopRightRadius`,`borderBottomRightRadius`],borderBottomRadius:[`borderBottomLeftRadius`,`borderBottomRightRadius`]},{scrollbarBorderRadius:[`scrollbarBorderTopLeftRadius`,`scrollbarBorderTopRightRadius`,`scrollbarBorderBottomLeftRadius`,`scrollbarBorderBottomRightRadius`],scrollbarBorderTopRadius:[`scrollbarBorderTopLeftRadius`,`scrollbarBorderTopRightRadius`],scrollbarBorderLeftRadius:[`scrollbarBorderTopLeftRadius`,`scrollbarBorderBottomLeftRadius`],scrollbarBorderRightRadius:[`scrollbarBorderTopRightRadius`,`scrollbarBorderBottomRightRadius`],scrollbarBorderBottomRadius:[`scrollbarBorderBottomLeftRadius`,`scrollbarBorderBottomRightRadius`],scrollbarBorderWidth:[`scrollbarBorderBottomWidth`,`scrollbarBorderTopWidth`,`scrollbarBorderLeftWidth`,`scrollbarBorderRightWidth`],scrollbarBorderXWidth:[`scrollbarBorderLeftWidth`,`scrollbarBorderRightWidth`],scrollbarBorderYWidth:[`scrollbarBorderTopWidth`,`scrollbarBorderBottomWidth`]},{transformScale:[`transformScaleX`,`transformScaleY`,`transformScaleZ`]},{caretBorderRadius:[`caretBorderTopLeftRadius`,`caretBorderTopRightRadius`,`caretBorderBottomLeftRadius`,`caretBorderBottomRightRadius`],caretBorderTopRadius:[`caretBorderTopLeftRadius`,`caretBorderTopRightRadius`],caretBorderLeftRadius:[`caretBorderTopLeftRadius`,`caretBorderBottomLeftRadius`],caretBorderRightRadius:[`caretBorderTopRightRadius`,`caretBorderBottomRightRadius`],caretBorderBottomRadius:[`caretBorderBottomLeftRadius`,`caretBorderBottomRightRadius`],caretBorderWidth:[`caretBorderBottomWidth`,`caretBorderTopWidth`,`caretBorderLeftWidth`,`caretBorderRightWidth`],caretBorderXWidth:[`caretBorderLeftWidth`,`caretBorderRightWidth`],caretBorderYWidth:[`caretBorderTopWidth`,`caretBorderBottomWidth`]},{selectionBorderRadius:[`selectionBorderTopLeftRadius`,`selectionBorderTopRightRadius`,`selectionBorderBottomLeftRadius`,`selectionBorderBottomRightRadius`],selectionBorderTopRadius:[`selectionBorderTopLeftRadius`,`selectionBorderTopRightRadius`],selectionBorderLeftRadius:[`selectionBorderTopLeftRadius`,`selectionBorderBottomLeftRadius`],selectionBorderRightRadius:[`selectionBorderTopRightRadius`,`selectionBorderBottomRightRadius`],selectionBorderBottomRadius:[`selectionBorderBottomLeftRadius`,`selectionBorderBottomRightRadius`],selectionBorderWidth:[`selectionBorderBottomWidth`,`selectionBorderTopWidth`,`selectionBorderLeftWidth`,`selectionBorderRightWidth`],selectionBorderXWidth:[`selectionBorderLeftWidth`,`selectionBorderRightWidth`],selectionBorderYWidth:[`selectionBorderTopWidth`,`selectionBorderBottomWidth`]}),ii=typeof matchMedia>`u`?void 0:matchMedia?.(`(prefers-color-scheme: dark)`),ai=M(ii?.matches??!1);ii?.addEventListener(`change`,e=>ai.value=e.matches);var oi=M(`system`),si=N(()=>{switch(oi.value){case`system`:return ai.value;case`dark`:return!0;case`light`:return!1}}),ci={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},li=Object.keys(ci),ui=li.length;function di(e){let t={};for(let n=0;n<ui;n++){let r=li[n];t[r]=()=>(e.value.component.size.value?.[0]??0)>ci[r]}return t}function fi(e){return{hover:()=>e.value.length>0}}function pi(e){return{active:()=>e.value.length>0}}var mi={dark:()=>si.value};function hi(e){return e==null?{focus:()=>!1}:{focus:()=>e.value}}function gi(e){return e==null?{placeholderStyle:()=>!1}:{placeholderStyle:()=>e.value}}var _i=[`dark`,`hover`,`active`,`focus`,...li];function vi(e,t,n,r,i){return{...mi,...di(e),...fi(t),...pi(n),...hi(r),...gi(i)}}var yi=class{apply;defaults;onLayerIndicesChanged;enabled=M(!1);value=new Proxy({},{get:(e,t)=>this.getSignal(t).value});signal=new Proxy({},{get:(e,t)=>this.getSignal(t)});peekProxy=new Proxy({},{get:(e,t)=>this.peekValue(t)});propertyStateMap={};propertiesLayers=new Map;propertyKeys;propertyKeySubscriptions=new Set;constructor(e,t,n){this.apply=e,this.defaults=t,this.onLayerIndicesChanged=n,this.propertyKeys=t==null?[]:Array.from(Object.keys(t))}peek(){return this.peekProxy}subscribePropertyKeys(e){for(let t of this.propertyKeys)e(t);return this.propertyKeySubscriptions.add(e),()=>this.propertyKeySubscriptions.delete(e)}clearProvidedLayer(e,t){this.propertiesLayers.delete(t);for(let n in e){if(e[n]===void 0)continue;let r=this.propertyStateMap[n];r!=null&&(r.cleanup?.(),r.cleanup=void 0,r.layerIndex==t&&this.update(n,r))}}setLayer(e,t){let n=this.propertiesLayers.get(e),r=n==null;tt(()=>{if(n!=null&&this.clearProvidedLayer(n,e),t===void 0)return;this.propertiesLayers.set(e,n={});let r=Object.entries(t);for(let[t,i]of r)this.apply(t,i,this.setProperty.bind(this,n,e),e)}),r&&this.onLayerIndicesChanged?.()}getSignal(e){let t=this.propertyStateMap[e];return t??(this.propertyStateMap[e]=t={signal:new ft,layerIndex:null},this.update(e,t)),t.signal}peekValue(e){let t=this.propertyStateMap[e];if(t!=null)return t.signal.peek();let n=this.defaults?.[e],r=Array.from(this.propertiesLayers.keys()).sort((e,t)=>e-t),[i]=rt(()=>bi(0,r,this.propertiesLayers,e,n));return i}set(e,t,n){let r=this.propertiesLayers.get(e);r??this.propertiesLayers.set(e,r={}),this.apply(t,n,this.setProperty.bind(this,r,e),e)}setProperty(e,t,n,r){if(!this.propertyKeys.includes(n)){this.propertyKeys.push(n);for(let e of this.propertyKeySubscriptions)e(n)}if(e[n]===r)return;e[n]=r;let i=this.propertyStateMap[n];i!=null&&(i.layerIndex!=null&&t>i.layerIndex||this.enabled.peek()&&this.update(n,i))}update(e,t){t.cleanup?.(),t.cleanup=void 0;let n=this.defaults?.[e],r;if(r=this.enabled.peek()?bi(0,Array.from(this.propertiesLayers.keys()).sort((e,t)=>e-t),this.propertiesLayers,e,n,r=>t.cleanup=xt(()=>{let[i,a]=bi(r,Array.from(this.propertiesLayers.keys()).sort((e,t)=>e-t),this.propertiesLayers,e,n);t.signal.value=i,t.layerIndex=a})):n instanceof ft?[n.peek(),1/0]:[n,2**53-1],r==null)return;let[i,a]=r;t.signal.value=i,t.layerIndex=a}setEnabled(e){this.enabled.peek()!==e&&(this.enabled.value=e,this.updateAll())}updateAll(){for(let e in this.propertyStateMap)this.update(e,this.propertyStateMap[e])}destroy(){for(let e in this.propertyStateMap)this.propertyStateMap[e].cleanup?.();this.propertyStateMap={},this.propertyKeySubscriptions.clear()}};function bi(e,t,n,r,i,a){let o,s,c=t[Symbol.iterator]();do{if(s=c.next().value??2**53-1,s<e)continue;if(o=s===2**53-1?i:n.get(s)[r],typeof o==`object`&&o instanceof ft){if(a!=null){a(s);return}o=o.value}if(o!==void 0)break}while(s!=2**53-1);return o===`initial`&&(o=i),[o,s]}var xi=1e3,Si=1002,Ci={important:Si*0,placeholderStyle:Si*1,focus:Si*2,active:Si*3,hover:Si*4,dark:Si*5,"2xl":Si*6,xl:Si*7,lg:Si*8,md:Si*9,sm:Si*10,base:Si*11},wi=Object.keys(Ci).filter(e=>e!=`base`);function Ti(e){if(e.type!=`class`&&e.type!=`default-overrides`&&e.type!=`base`)return e.type===`star-inheritance`?Si*12:12025;let t=Ci[e.section];if(e.type!=`class`)return e.type===`default-overrides`?t+xi+1:t;let n=e.classIndex;if(n>=xi)throw Error(`class index "${n}" exceeds the maximum number of classes (${xi})`);return t+(xi-1)-n+1}var Ei={scrollbarWidth:10,visibility:`visible`,opacity:1,depthTest:!0,renderOrder:0,fontSize:16,letterSpacing:0,lineHeight:`120%`,wordBreak:`break-word`,verticalAlign:`middle`,textAlign:`left`,fontWeight:`normal`,caretWidth:1.5,receiveShadow:!1,castShadow:!1,panelMaterialClass:ae,pixelSize:.01,anchorX:`center`,anchorY:`center`,tabSize:8,whiteSpace:`normal`},Di=new Map,Oi=new s;function ki(e,t){let n=Di.get(e);if(n instanceof Set){n.add(t);return}if(n!=null){t(n);return}let r=new Set;r.add(t),Di.set(e,r),Ai(e).then(t=>{for(let e of r)e(t);Di.set(e,t)}).catch(console.error)}async function Ai(e){let t=await ji(e),n=typeof t==`object`?t:await(await fetch(t)).json();if(n.pages.length!==1)throw Error(`only supporting exactly 1 page`);let r=await Oi.loadAsync(new URL(n.pages[0],typeof t==`string`?new URL(t,window.location.href):void 0).href);return r.flipY=!1,new zi(n,r)}function ji(e){return typeof e==`function`?e():e}var Mi={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900,"extra-black":950},Ni={inter:{light:()=>me(async()=>{let{inter:e}=await import(`./inter-CaiW00F8.js`);return{inter:e}},[],import.meta.url).then(({inter:e})=>e.light),medium:()=>me(async()=>{let{inter:e}=await import(`./inter-CaiW00F8.js`);return{inter:e}},[],import.meta.url).then(({inter:e})=>e.medium),"semi-bold":()=>me(async()=>{let{inter:e}=await import(`./inter-CaiW00F8.js`);return{inter:e}},[],import.meta.url).then(({inter:e})=>e[`semi-bold`]),bold:()=>me(async()=>{let{inter:e}=await import(`./inter-CaiW00F8.js`);return{inter:e}},[],import.meta.url).then(({inter:e})=>e.bold)}};function Pi(e,t){return N(()=>{let n=e.value.fontFamilies,r=t.value?.fontFamilies.value;return r==null?n:n==null?r:{...r,...n}})}function Fi(e,t){let n=M(void 0);return xt(()=>{if(!e.enabled.value)return;let r=e.value.fontWeight;if(typeof r==`string`&&(r=parseFloat(r),isNaN(r))){if(r=e.value.fontWeight,!(r in Mi))throw Error(`unknown font weight "${r}"`);r=Mi[r]}let i=e.value.fontFamily,a=t.value??Ni;i??=Object.keys(a)[0];let o=a[i];if(o==null){let e=Object.keys(a);o=a[e[0]],console.error(`unknown font family "${i}". Available font families are ${e.map(e=>`"${e}"`).join(`, `)}. Falling back to "${e[0]}".`)}let s=Ii(o,r),c=!1;return ki(s,e=>!c&&(n.value=e)),()=>c=!0}),n}function Ii(e,t){let n=1/0,r;for(let i of Object.keys(e)){let a=Math.abs(t-Li(i));if(a===0)return e[i];a<n&&(n=a,r=e[i])}if(r==null)throw Error(`font family has no entries ${e}`);return r}function Li(e){if(e in Mi)return Mi[e];let t=parseFloat(e);if(isNaN(t))throw Error(`invalid font weight "${e}"`);return t}var Ri={id:-1,index:0,char:``,chnl:0,page:0,x:0,y:0,width:.5,height:.5,xadvance:.6,xoffset:0,yoffset:.3,uvX:0,uvY:0,uvWidth:0,uvHeight:0,renderSolid:!0},zi=class{page;glyphInfoMap=new Map;kerningMap=new Map;pageWidth;pageHeight;distanceRange;constructor(e,t){this.page=t;let{scaleW:n,scaleH:r,lineHeight:i}=e.common,{size:a}=e.info;this.pageWidth=n,this.pageHeight=r,this.distanceRange=e.distanceField.distanceRange;for(let t of e.chars){let e={...t,uvX:t.x/n,uvY:t.y/r,uvWidth:t.width/n,uvHeight:t.height/r,width:t.width/a,height:t.height/a,xadvance:t.xadvance/a,xoffset:t.xoffset/a,yoffset:(t.yoffset-(i-a))/a};this.glyphInfoMap.set(e.char,e)}for(let{first:t,second:n,amount:r}of e.kernings)this.kerningMap.set(`${t}/${n}`,r/a)}getGlyphInfo(e){let t=this.glyphInfoMap.get(e);if(t)return t;if(e===`
187
- `){let e=this.glyphInfoMap.get(` `);if(e)return e}return console.warn(`Missing glyph info for character "${e}"`),Ri}getKerning(e,t){return this.kerningMap.get(`${e}/${t}`)??0}};function Bi(e,t,n){t[n+0]=e.uvX,t[n+1]=e.uvY+e.uvHeight,t[n+2]=e.uvWidth,t[n+3]=-e.uvHeight}var Vi=class extends yi{conditionals;usedConditionals={hover:M(!1),active:M(!1)};constructor(e,t,n){super((t,n,r)=>{if(t in e){let i=e[t];for(let e of i)r(e,n);return}r(t,n)},n,()=>{this.usedConditionals.active.value=Hi(this.propertiesLayers,`active`),this.usedConditionals.hover.value=Hi(this.propertiesLayers,`hover`)}),this.conditionals=t}setLayersWithConditionals(e,t){tt(()=>{this.setLayer(Ti({...e,section:`base`}),t);for(let n of wi){let r=Ti({...e,section:n});if(t==null||!(n in t)){this.setLayer(r,void 0);continue}let i=n==`important`?void 0:this.conditionals[n],a=t[n];i!=null&&(a=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,N(()=>i()?t instanceof ft?t.value:t:void 0)]))),this.setLayer(r,a)}})}};function Hi(e,t){let n=Ti({type:`base`,section:t});for(let t of e.keys())if(n<=t&&t<n+1002)return!0;return!1}var Ui=new c,Wi=new c,Gi=new c,Ki=new k,qi=new f,Ji=new _,Yi=Math.PI/180;function Xi([e,t,n]){return Ji.setFromEuler(qi.set(e*Yi,t*Yi,n*Yi))}var Zi=`center`,Qi=`center`;function $i({relativeCenter:e,size:t,properties:n,root:r}){return N(()=>{let i=e.value;if(i==null)return;let[a,o]=i,s=xn(n.value.pixelSize),c=new k().makeTranslation(a*s,o*s,0),l=!0,u=n.value.transformOriginX??Zi,d=n.value.transformOriginY??Qi;if(u!=`center`||d!=`center`){let e=t.value;if(e==null)return;let[n,r]=e;l=!1,Gi.set(-lo[u]*n*s,-uo[d]*r*s,0),c.multiply(Ki.makeTranslation(Gi)),Gi.negate()}let f=n.value.transformTranslateX??0,p=n.value.transformTranslateY??0,m=n.value.transformTranslateZ??0,h=n.value.transformRotateX??0,g=n.value.transformRotateY??0,_=n.value.transformRotateZ??0,v=n.value.transformScaleX??1,y=n.value.transformScaleY??1,b=n.value.transformScaleZ??1,x=[xn(h),xn(g),xn(_)],S=[br(f,()=>t.value?.[0]??0,r.value),-br(p,()=>t.value?.[1]??0,r.value),br(m)],C=[br(v,()=>1,r.value),br(y,()=>1,r.value),br(b,()=>1,r.value)];return(S.some(e=>e!=0)||x.some(e=>e!=0)||C.some(e=>e!=1))&&c.multiply(Ki.compose(Ui.fromArray(S).multiplyScalar(s),Xi(x),Wi.fromArray(C))),l||c.multiply(Ki.makeTranslation(Gi)),c})}var ea={},ta=class{properties;starProperties;list=[];constructor(e,t){this.properties=e,this.starProperties=t}*[Symbol.iterator](){for(let e in this.list)e!=null&&(yield e)}set(...e){let t=Math.max(e.length,this.list.length);this.list.length=e.length;for(let n=0;n<t;n++){let t={type:`class`,classIndex:n},r=e[n],i=r==null?void 0:this.resolveClassRef(r);this.properties.setLayersWithConditionals(t,i),this.starProperties.setLayersWithConditionals(t,na(i))}}add(...e){tt(()=>{for(let t of e){let e=0;for(;this.list[e]!=null;)e++;this.list[e]=t;let n={type:`class`,classIndex:e},r=this.resolveClassRef(t);this.properties.setLayersWithConditionals(n,r),this.starProperties.setLayersWithConditionals(n,na(r))}})}remove(...e){tt(()=>{for(let t of e){let e=this.list.indexOf(t);if(e===-1){console.warn(`Class '${t}' not found in the classList`);return}e+1===this.list.length?this.list.splice(e,1):this.list[e]=void 0;let n={type:`class`,classIndex:e};this.properties.setLayersWithConditionals(n,void 0),this.starProperties.setLayersWithConditionals(n,void 0)}})}toggle(e){this.contains(e)?this.remove(e):this.add(e)}contains(e){return this.list.includes(e)}replace(e,t){return this.contains(e)?(this.remove(e),this.add(t),!0):!1}resolveClassRef(e){if(e!=null){if(typeof e!=`string`)return e;if(!(e in ea)){console.warn(`class "${e}" not present in the global stylesheet`);return}return ea[e]}}};function na(e){if(e==null)return;let t;`*`in e&&(t={...e[`*`]});for(let n in _i){let r=e[n]?.[`*`];r!=null&&(t??={},t[n]=r)}return t}var ra={"keep-all":({text:e,fontSize:t,font:n,letterSpacing:r},i,a,o)=>{let s=a;o.charIndexOffset=s,o.nonWhitespaceCharLength=0,o.charLength=0,o.nonWhitespaceWidth=0,o.whitespacesBetween=0;let c=0,l=0;for(;a<e.length;a++){let i=e[a];if(i===`
188
- `){o.charLength=a-s+1;return}if(c+=Sr(t,n.getGlyphInfo(i),r),i===` `){l+=1;continue}o.nonWhitespaceWidth=c,o.whitespacesBetween=l,o.nonWhitespaceCharLength=a-s+1}o.charLength=a-s},"break-all":({text:e,fontSize:t,font:n,letterSpacing:r},i,a,o)=>{let s=a;o.charIndexOffset=s,o.nonWhitespaceCharLength=0,o.charLength=0,o.nonWhitespaceWidth=0,o.whitespacesBetween=0;let c=0,l=0;for(;a<e.length;a++){let u=e[a];if(u===`
189
- `){o.charLength=a-s+1;return}if(c+=Sr(t,n.getGlyphInfo(u),r),u===` `){l+=1;continue}if(o.nonWhitespaceWidth>0&&i!=null&&c>i)break;o.nonWhitespaceCharLength=a-s+1,o.nonWhitespaceWidth=c,o.whitespacesBetween=l}o.charLength=a-s},"break-word":({text:e,fontSize:t,font:n,letterSpacing:r},i,a,o)=>{let s=a;o.charIndexOffset=s,o.nonWhitespaceCharLength=0,o.charLength=0,o.nonWhitespaceWidth=0,o.whitespacesBetween=0;let c=0,l=0;for(;a<e.length;a++){let u=e[a];if(u===`
190
- `){o.charLength=a-s+1;break}if(c+=Sr(t,n.getGlyphInfo(u),r),u===` `){l+=1,o.charLength=a-s+1;continue}if(o.nonWhitespaceWidth>0&&i!=null&&c>i)break;let d=e[a+1];(d===` `||d===`
191
- `||d==null)&&(o.charLength=a-s+1,o.nonWhitespaceCharLength=o.charLength,o.nonWhitespaceWidth=c,o.whitespacesBetween=l)}}},ia={};function aa(e){return N(()=>{let t=e.value;if(t==null)return;let{width:n}=oa(t,0),{height:r}=oa(t,void 0);return{minHeight:r,minWidth:n,measure:(e,n)=>oa(t,n===Un.Undefined?void 0:e)}})}function oa(e,t){let n=ra[e.wordBreak],r=e.text,i=0,a=0,o=0;for(;o<r.length;)n(e,t,o,ia),i=Math.max(i,ia.nonWhitespaceWidth),a+=1,o=ia.charLength+ia.charIndexOffset;return r[r.length-1]===`
192
- `&&(a+=1),{width:i,height:wr(a,e.lineHeight)}}function sa(e,t,n){let r=[],i=ra[e.wordBreak],a=e.text,o=0;for(;o<a.length;){let n={};i(e,t,o,n),r.push(n),o=n.charLength+n.charIndexOffset}return(r.length===0||a[a.length-1]===`
193
- `)&&r.push({charLength:0,nonWhitespaceWidth:0,whitespacesBetween:0,charIndexOffset:a.length,nonWhitespaceCharLength:0}),{lines:r,availableHeight:n,availableWidth:t,...e}}function ca(e,t,n,r,i){let a=sa(e,t,n),o=[],{font:s,fontSize:c,letterSpacing:l=0,lineHeight:u=1.2,text:d}=a,f=da(a),p=ua(a,i)-n/2;for(let e=0;e<a.lines.length;e++){let n=a.lines[e],i=[],m=r===`justify`&&n.whitespacesBetween>0?(t-n.nonWhitespaceWidth)/n.whitespacesBetween:0,h=la(t,n.nonWhitespaceWidth,r)-t/2,g;for(let e=n.charIndexOffset;e<n.charIndexOffset+n.charLength;e++){let t=d[e],r=s.getGlyphInfo(t);if(h+=yr(s,c,g,r),g=r.id,t===` `||e>n.nonWhitespaceCharLength+n.charIndexOffset){i.push({type:`whitespace`,charIndex:e,x:h+vr(r,c),width:f}),h+=m+Sr(c,r,l);continue}i.push({type:`glyph`,charIndex:e,char:t,glyphInfo:r,x:h+vr(r,c),y:-(p+xr(c,u,r)),width:r.width*c}),h+=Sr(c,r,l)}o.push({...n,entries:i}),p+=Cr(u)}return{...a,lines:o,textAlign:r,verticalAlign:i}}function la(e,t,n){switch(n){case`right`:return e-t;case`center`:return(e-t)/2;default:return 0}}function ua(e,t){switch(t){case`center`:case`middle`:return(e.availableHeight-wr(e.lines.length,e.lineHeight))/2;case`bottom`:return e.availableHeight-wr(e.lines.length,e.lineHeight);default:return 0}}function da({font:e,fontSize:t}){return e.getGlyphInfo(` `).xadvance*t}function fa(e,t,{fontSize:n,letterSpacing:r,lineHeight:i,wordBreak:a}){let o=br(n),s;return s=typeof i==`string`&&i.endsWith(`px`)?parseFloat(i):o*br(i,()=>1),{font:e,text:t,fontSize:o,letterSpacing:br(r),lineHeight:s,wordBreak:a}}var pa=/[\t\n ]+/gm,ma=/[\t ]+/g,ha=/[\t ]*\n[\t ]*/gm,ga=/^[ \t]+|[ \t]+$/g;function _a(e,t){return N(()=>{let n=t.value;if(n==null)return;let r=e.value.text,i=Array.isArray(r)?r.map(va).join(``):va(r),a=xn(e.value.tabSize);switch(e.value.whiteSpace){case`pre`:i=i.replaceAll(` `,` `.repeat(a));break;case`pre-line`:i=i.replaceAll(ma,` `).replaceAll(ha,`
194
- `).replaceAll(ga,``);break;default:i=i.replaceAll(pa,` `).trim();break}return fa(n,i,e.value)})}function va(e){return e instanceof ft&&(e=e.value),e==null?``:String(e)}var ya=new k,ba=new _,xa=new c(1,1,1),Sa=new c;function Ca(e){return N(()=>{let t=e.paddingInset.value,n=e.borderInset.value;return t==null||n==null?ya:wa(t,n,xn(e.properties.value.pixelSize),e.globalMatrix.value??ya)})}function wa(e,t,n,r=ya){let[i,a,o,s]=e,[c,l,u,d]=t,f=i+c,p=a+l,m=o+u,h=s+d;return Sa.set((h-p)*.5*n,(m-f)*.5*n,0),new k().compose(Sa,ba,xa).premultiply(r)}function Ta(e){let t=_a(e.properties,e.fontSignal),n=aa(t);return{layout:N(()=>{let n=t.value,{size:{value:r},paddingInset:{value:i},borderInset:{value:a}}=e;if(n==null||r==null||i==null||a==null)return;let[o,s]=r,[c,l,u,d]=i,[f,p,m,h]=a;return ca(n,o-l-d-p-h,s-c-u-f-m,e.properties.value.textAlign,e.properties.value.verticalAlign)}),customLayouting:n}}var Ea=class extends ae{constructor(e){super({transparent:!0,depthWrite:!1,toneMapped:!1}),this.onBeforeCompile=(t,n)=>{e.page.anisotropy=n.capabilities.getMaxAnisotropy(),t.uniforms.fontPage={value:e.page},t.uniforms.pageSize={value:[e.pageWidth,e.pageHeight]},t.uniforms.distanceRange={value:e.distanceRange},t.vertexShader=`attribute vec4 instanceUVOffset;
195
- varying vec2 fontUv;
196
- attribute vec4 instanceRGBA;
197
- varying vec4 rgba;
198
- attribute mat4 instanceClipping;
199
- varying mat4 clipping;
200
- varying vec3 localPosition;
201
- attribute float instanceRenderSolid;
202
- varying float renderSolid;
203
- `+t.vertexShader,t.vertexShader=t.vertexShader.replace(`#include <uv_vertex>`,`#include <uv_vertex>
204
- fontUv = instanceUVOffset.xy + uv * instanceUVOffset.zw;
205
- rgba = instanceRGBA;
206
- clipping = instanceClipping;
207
- localPosition = (instanceMatrix * vec4(position, 1.0)).xyz;
208
- renderSolid = instanceRenderSolid;`),t.fragmentShader=`uniform sampler2D fontPage;
209
- uniform vec2 pageSize;
210
- uniform int distanceRange;
211
- varying vec2 fontUv;
212
- varying vec4 rgba;
213
- varying mat4 clipping;
214
- varying vec3 localPosition;
215
- varying float renderSolid;
216
- float median(float r, float g, float b) {
217
- return max(min(r, g), min(max(r, g), b));
218
- }
219
- float getDistance() {
220
- vec3 msdf = texture(fontPage, fontUv).rgb;
221
- return median(msdf.r, msdf.g, msdf.b);
222
- }
223
- `+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace(`#include <map_fragment>`,` #include <map_fragment>
224
- vec4 plane;
225
- float distanceToPlane, distanceGradient;
226
- float clipOpacity = 1.0;
227
- for(int i = 0; i < 4; i++) {
228
- plane = clipping[ i ];
229
- distanceToPlane = dot( localPosition, plane.xyz ) + plane.w;
230
- distanceGradient = max(fwidth( distanceToPlane ) / 2.0, 0.00001);
231
- clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
232
-
233
- if ( clipOpacity == 0.0 ) discard;
234
- }
235
- // Distance to the edge of the glyph in texels.
236
- float dist = (getDistance() - 0.5) * float(distanceRange);
237
-
238
- // Calculate the antialiasing distance based on the number of texels per screen pixel.
239
- float aaDist = length(fwidth(fontUv * pageSize)) * 0.5;
240
-
241
- // Clamp the antialiasing distance to avoid excessive blurring.
242
- aaDist = clamp(aaDist, 0.0, float(distanceRange) * 0.5);
243
-
244
- float alpha = smoothstep(-aaDist, aaDist, dist);
245
-
246
- if (alpha <= 0.0 && renderSolid <= 0.5) discard;
247
-
248
- // Apply gamma correction to improve text appearance, or override for synthetic solid glyphs.
249
- float gamma = 1.3;
250
- alpha = renderSolid > 0.5 ? 1.0 : pow(alpha, 1.0 / gamma);
251
-
252
- diffuseColor.a *= clipOpacity * alpha;
253
- diffuseColor *= rgba;
254
- `)}}},Da=class e extends he{root;instanceMatrix;instanceRGBA;instanceUV;instanceClipping;instanceRenderSolid;count=0;isInstancedMesh=!0;instanceColor=null;morphTexture=null;boundingBox=new xe;boundingSphere=new h;customUpdateMatrixWorld=()=>mo(this.root,this.matrixWorld);constructor(e,t,n,r,i,a,o){let s=new Ee;s.translate(.5,-.5,0),super(s,o),this.root=e,this.instanceMatrix=t,this.instanceRGBA=n,this.instanceUV=r,this.instanceClipping=i,this.instanceRenderSolid=a,this.pointerEvents=`none`,s.attributes.instanceUVOffset=r,s.attributes.instanceRGBA=n,s.attributes.instanceClipping=i,s.attributes.instanceRenderSolid=a,this.frustumCulled=!1,e.onUpdateMatrixWorldSet.add(this.customUpdateMatrixWorld)}clone(){let t=new e(this.root,this.instanceMatrix,this.instanceRGBA,this.instanceUV,this.instanceClipping,this.instanceRenderSolid,this.material);return t.count=this.count,t}copy(){throw Error(`InstancedGlyphMesh.copy() is not supported. Use clone() instead.`)}dispose(){this.root.onUpdateMatrixWorldSet.delete(this.customUpdateMatrixWorld),this.dispatchEvent({type:`dispose`}),this.geometry.dispose()}computeBoundingBox(){}computeBoundingSphere(){}updateMorphTargets(){}raycast(){}spherecast(){}},Oa=new k,ka=new k;function Aa(e){return N(()=>({font:e.value}))}var ja=class{group;baseMatrix;color;opacity;clippingRect;index;hidden=!0;glyphInfo;x=0;y=0;fontSize=0;pixelSize=0;constructor(e,t,n,r,i){this.group=e,this.baseMatrix=t,this.color=n,this.opacity=r,this.clippingRect=i}getX(e){return this.glyphInfo==null?this.x:this.x+e*this.glyphInfo.width*this.fontSize}show(){this.hidden&&(this.hidden=!1,this.group.requestActivate(this))}hide(){this.hidden||(this.hidden=!0,this.group.delete(this))}activate(e){this.index=e,this.writeUpdatedMatrix(),this.writeUV(),this.writeRenderSolid(),this.updateColor(this.color,this.opacity),this.updateClippingRect(this.clippingRect)}setIndex(e){this.index=e}updateClippingRect(e){if(this.clippingRect=e,this.index==null)return;let t=this.index*16,{instanceClipping:n,root:r}=this.group;this.clippingRect==null?n.set(sr,t):this.clippingRect.toArray(n.array,t),n.addUpdateRange(t,16),n.needsUpdate=!0,r.requestRender?.()}updateColor(e,t){if(this.color=e,this.opacity=t,this.index==null)return;let{instanceRGBA:n,root:r}=this.group,i=n.itemSize*this.index;_r(n.array,i,e,t),n.addUpdateRange(i,4),n.needsUpdate=!0,r.requestRender?.()}updateGlyphAndTransformation(e,t,n,r,i){this.glyphInfo===e&&this.x===t&&this.y===n&&this.fontSize===r&&this.pixelSize===i||(this.glyphInfo!=e&&(this.glyphInfo=e,this.writeUV(),this.writeRenderSolid()),this.x=t,this.y=n,this.fontSize=r,this.pixelSize=i,this.writeUpdatedMatrix())}updateBaseMatrix(e){this.baseMatrix!==e&&(this.baseMatrix=e,this.writeUpdatedMatrix())}writeUV(){if(this.index==null||this.glyphInfo==null)return;let e=this.index*4,{instanceUV:t,root:n}=this.group;Bi(this.glyphInfo,t.array,e),t.addUpdateRange(e,4),t.needsUpdate=!0,n.requestRender?.()}writeRenderSolid(){if(this.index==null||this.glyphInfo==null)return;let{instanceRenderSolid:e,root:t}=this.group,n=this.index*1;e.array[n]=+!!this.glyphInfo.renderSolid,e.addUpdateRange(n,1),e.needsUpdate=!0,t.requestRender?.()}writeUpdatedMatrix(){if(this.index==null||this.glyphInfo==null||this.baseMatrix==null)return;let e=this.index*16,{instanceMatrix:t,root:n}=this.group;t.addUpdateRange(e,16),Oa.makeTranslation(this.x*this.pixelSize,this.y*this.pixelSize,0).multiply(ka.makeScale(this.fontSize*this.glyphInfo.width*this.pixelSize,this.fontSize*this.glyphInfo.height*this.pixelSize,1)).premultiply(this.baseMatrix),Oa.toArray(t.array,e),t.needsUpdate=!0,n.requestRender?.()}},Ma=class{root;object;map=new Map;constructor(e,t){this.root=e,this.object=t}init(e){let t=e=>this.traverse(t=>t.onFrame(e));this.root.onFrameSet.add(t),e.addEventListener(`abort`,()=>{this.root.onFrameSet.delete(t),this.traverse(e=>e.destroy())})}traverse(e){for(let t of this.map.values())for(let n of t.values())e(n)}getGroup({majorIndex:e,minorIndex:t},n,r,i,a){let o=this.map.get(a);o??this.map.set(a,o=new Map);let s=[e,t,n,r,i].join(`,`),c=o?.get(s);return c??o.set(s,c=new Na(this.object,a,this.root,{majorIndex:e,minorIndex:t,elementType:vo.Text,patchIndex:0},n,r,i)),c}},Na=class{object;root;orderInfo;renderOrder;instanceMatrix;instanceUV;instanceRGBA;instanceClipping;instanceRenderSolid;glyphs=[];requestedGlyphs=[];holeIndicies=[];mesh;instanceMaterial;timeTillDecimate;constructor(e,t,n,r,i,a,o){this.object=e,this.root=n,this.orderInfo=r,this.renderOrder=o,this.instanceMaterial=new Ea(t),this.instanceMaterial.depthTest=i,this.instanceMaterial.depthWrite=a}requestActivate(e){let t=this.holeIndicies.shift();if(t!=null){this.glyphs[t]=e,e.activate(t),this.root.requestRender?.();return}if(this.mesh==null||this.mesh.count>=this.instanceMatrix.count){this.requestedGlyphs.push(e),this.root.requestFrame?.();return}let n=this.mesh.count;this.glyphs[n]=e,e.activate(n),this.mesh.count+=1,this.root.requestRender?.()}delete(e){if(e.index==null){let t=this.requestedGlyphs.indexOf(e);if(t===-1)return;this.requestedGlyphs.splice(t,1);return}this.root.requestRender?.();let t=this.requestedGlyphs.shift();if(t!=null){t.activate(e.index),this.glyphs[e.index]=t,e.index=void 0;return}if(e.index===this.glyphs.length-1){--this.glyphs.length,--this.mesh.count,e.index=void 0;return}let n=e.index*16;this.instanceMatrix.array.fill(0,n,n+16),this.instanceMatrix.addUpdateRange(n,16),this.instanceMatrix.needsUpdate=!0,this.holeIndicies.push(e.index),this.glyphs[e.index]=void 0,e.index=void 0}onFrame(e){let t=this.glyphs.length-this.holeIndicies.length+this.requestedGlyphs.length;if(this.mesh!=null&&(this.mesh.visible=t>0),t===0)return;let n=this.instanceMatrix?.count??0;if(t<n/3?this.timeTillDecimate??=1:this.timeTillDecimate=void 0,this.timeTillDecimate!=null&&(this.timeTillDecimate-=e),(this.timeTillDecimate==null||this.timeTillDecimate>0)&&t<=n)return;this.timeTillDecimate=void 0,this.resize(t);let r=this.mesh.count,i=this.requestedGlyphs.length;for(let e=0;e<i;e++){let t=this.requestedGlyphs[e];t.activate(r+e),this.glyphs[r+e]=t}this.mesh.count+=i,this.mesh.visible=!0,this.requestedGlyphs.length=0}resize(e){let t=Math.ceil(e*1.5),r=new Float32Array(t*16),i=new Float32Array(t*4),a=new Float32Array(t*4),o=new Float32Array(t*16),s=new Float32Array(t*1);this.instanceMatrix=new p(r,16,!1),this.instanceMatrix.setUsage(n),this.instanceUV=new p(i,4,!1),this.instanceUV.setUsage(n),this.instanceRGBA=new p(a,4,!1),this.instanceRGBA.setUsage(n),this.instanceClipping=new p(o,16,!1),this.instanceClipping.setUsage(n),this.instanceRenderSolid=new p(s,1,!1),this.instanceRenderSolid.setUsage(n);let c=this.mesh;if(this.mesh=new Da(this.root,this.instanceMatrix,this.instanceRGBA,this.instanceUV,this.instanceClipping,this.instanceRenderSolid,this.instanceMaterial),this.mesh.renderOrder=this.renderOrder,c!=null){this.holeIndicies.sort((e,t)=>e-t);let e=this.holeIndicies.length,t=0,n=0;for(;n<e;){let e=this.holeIndicies[n];Pa(t-n,t,e,c,this.mesh),t=e+1,this.glyphs.splice(e-n,1),n++}if(Pa(t-n,t,c.count,c,this.mesh),this.holeIndicies.length>0)for(let e=this.holeIndicies[0];e<this.glyphs.length;e++)this.glyphs[e].setIndex(e);this.holeIndicies.length=0,this.object.remove(c),c.dispose()}So(this.mesh,{peek:()=>this.root},{value:this.orderInfo}),this.mesh.count=this.glyphs.length,this.object.addUnsafe(this.mesh)}destroy(){this.mesh!=null&&(this.object.remove(this.mesh),this.mesh.dispose(),this.instanceMaterial.dispose())}};function Pa(e,t,n,r,i){Fa(e,t,n,r.instanceMatrix.array,i.instanceMatrix.array,16),Fa(e,t,n,r.instanceUV.array,i.instanceUV.array,4),Fa(e,t,n,r.instanceRGBA.array,i.instanceRGBA.array,4),Fa(e,t,n,r.instanceClipping.array,i.instanceClipping.array,16),Fa(e,t,n,r.instanceRenderSolid.array,i.instanceRenderSolid.array,1)}function Fa(e,t,n,r,i,a){if(t===n)return;let o=e*a,s=t*a,c=n*a;i.set(r.subarray(s,c),o)}var Ia={verticalAlign:`middle`};function La(e,t,n){P(()=>{let r=e.fontSignal.value,i=e.orderInfo.value;if(r==null||i==null)return;let a=new Ra(e.root.value.glyphGroupManager.getGroup(i,e.properties.value.depthTest,e.properties.value.depthWrite??!1,xn(e.properties.value.renderOrder??0),r),e.properties,n,e.globalTextMatrix,e.isVisible,t);return()=>a.destroy()},e.abortSignal)}var Ra=class{group;properties;layoutSignal;matrix;parentClippingRect;glyphLines=[];unsubscribeInitialList=[];unsubscribeShowList=[];constructor(e,t,n,r,i,a){this.group=e,this.properties=t,this.layoutSignal=n,this.matrix=r,this.parentClippingRect=a,this.unsubscribeInitialList=[xt(()=>{if(!i.value||br(this.properties.value.opacity,()=>1)<.01){this.hide();return}this.show()})]}show(){this.unsubscribeShowList.length>0||(za(this.glyphLines,e=>e.show()),this.unsubscribeShowList.push(xt(()=>{let e=this.matrix.value;e!=null&&za(this.glyphLines,t=>t.updateBaseMatrix(e))}),xt(()=>{let e=this.parentClippingRect?.value;za(this.glyphLines,t=>t.updateClippingRect(e))}),xt(()=>{let e=this.properties.value.color,t=br(this.properties.value.opacity,()=>1);za(this.glyphLines,n=>n.updateColor(e??0,t))}),xt(()=>{let e=this.layoutSignal.value;if(e==null)return;let{lines:t,fontSize:n=16}=e,r=t.length,i=xn(this.properties.value.pixelSize);for(let e=0;e<r;e++){e===this.glyphLines.length&&this.glyphLines.push([]);let{entries:r}=t[e],a=this.glyphLines[e];for(let e=0;e<r.length;e++){let t=r[e];if(t.type===`whitespace`){typeof a[e]==`number`?a[e]=t.x:a.splice(e,0,t.x);continue}let o=a[e];for(;e<a.length&&typeof o==`number`;)a.splice(e,1),o=a[e];let s=o;s??(a[e]=s=new ja(this.group,this.matrix.peek(),this.properties.peek().color??0,br(this.properties.peek().opacity,()=>1),this.parentClippingRect?.peek())),s.updateGlyphAndTransformation(t.glyphInfo,t.x,t.y,n,i),s.show()}let o=a.length,s=r.length;for(let e=s;e<o;e++){let t=a[e];typeof t!=`number`&&t.hide()}a.length=s}za(this.glyphLines,e=>e.hide(),r),this.glyphLines.length=r})))}hide(){let e=this.unsubscribeShowList.length;if(e!==0){for(let t=0;t<e;t++)this.unsubscribeShowList[t]();this.unsubscribeShowList.length=0,za(this.glyphLines,e=>e.hide())}}destroy(){this.hide(),this.glyphLines.length=0;let e=this.unsubscribeInitialList.length;for(let t=0;t<e;t++)this.unsubscribeInitialList[t]()}};function za(e,t,n=0){let r=e.length;for(let i=n;i<r;i++){let n=e[i],r=n.length;for(let e=0;e<r;e++){let r=n[e];typeof r!=`number`&&t(r)}}}function Ba(e,t){let n=N(()=>e.parentContainer.value==null?Va(e,t):e.parentContainer.value.root.value);return P(()=>{let t=n.value;if(t.component!=e||!e.isAttached.value)return;let r=new AbortController;t.glyphGroupManager.init(r.signal),t.panelGroupManager.init(r.signal),t.requestCalculateLayout=Ha(t,e);let i=()=>void(t.reversePainterSortStableCache=void 0);return t.onFrameSet.add(i),r.signal.addEventListener(`abort`,()=>t.onFrameSet.delete(i)),()=>r.abort()},e.abortSignal),n}function Va(e,t){let n={isUpdateRunning:!1,onFrameSet:new Set,requestFrame:t?.requestFrame,requestRender(){n.isUpdateRunning||t?.requestFrame()},onUpdateMatrixWorldSet:new Set,requestCalculateLayout:()=>{},component:e};return Object.assign(n,{glyphGroupManager:new Ma(n,e),panelGroupManager:new Dn(n,e)})}function Ha(e,t){let n=!0,r=()=>{n&&(n=!1,t.node.calculateLayout())};return e.onFrameSet.add(r),t.abortSignal.addEventListener(`abort`,()=>e.onFrameSet.delete(r)),()=>{n=!0,e.requestFrame?.()}}function Ua(e,t){let n=t.value;if(n==null)return;let[r,i]=n,a=xn(e.value.pixelSize);return new k().makeTranslation(lo[e.value.anchorX]*r*a,uo[e.value.anchorY]*i*a,0)}var Wa=`depthTest.depthWrite.renderOrder.pixelSize.opacity.color.fill.textAlign.verticalAlign.fontSize.letterSpacing.lineHeight.wordBreak.fontFamily.fontWeight.visibility.scrollbarBorderRightWidth.scrollbarBorderTopWidth.scrollbarBorderLeftWidth.scrollbarBorderBottomWidth.scrollbarColor.scrollbarWidth.scrollbarBorderTopLeftRadius.scrollbarBorderTopRightRadius.scrollbarBorderBottomLeftRadius.scrollbarBorderBottomRightRadius.scrollbarBorderColor.scrollbarBorderBend.caretColor.caretWidth.caretBorderRightWidth.caretBorderTopWidth.caretBorderLeftWidth.caretBorderBottomWidth.caretBorderTopLeftRadius.caretBorderTopRightRadius.caretBorderBottomLeftRadius.caretBorderBottomRightRadius.caretBorderColor.caretBorderBend.selectionColor.selectionWidth.selectionBorderRightWidth.selectionBorderTopWidth.selectionBorderLeftWidth.selectionBorderBottomWidth.selectionBorderTopLeftRadius.selectionBorderTopRightRadius.selectionBorderBottomLeftRadius.selectionBorderBottomRightRadius.selectionBorderColor.selectionBorderBend.pointerEvents.pointerEventsType.pointerEventsOrder`.split(`.`),Ga=new k,Ka=new h,qa=new k,Ja=()=>!1;Ti({type:`base`,section:`base`});var Ya=new Vi(ri,new Proxy({},{get:()=>Ja}));Ya.setEnabled(!0);var Xa=class e extends he{inputProperties;initialClasses;abortController=new AbortController;handlers;orderInfo=M(void 0);isVisible;isClipped;boundingSphere=new h;properties;starProperties;node;size=M(void 0);relativeCenter=M(void 0);borderInset=M(void 0);overflow=M(Gn.Visible);displayed=M(!1);scrollable=M([!1,!1]);paddingInset=M(void 0);maxScrollPosition=M([void 0,void 0]);root;parentContainer=M(void 0);isAttached=M(!1);isRootAttached=N(()=>this.parentContainer.value?.isRootAttached.value??this.isAttached.value);hoveredList=M([]);activeList=M([]);ancestorsHaveListenersSignal;globalMatrix;globalPanelMatrix;abortSignal=this.abortController.signal;classList;needsRenderTraversal;renderTraversalChildCount=M(0);constructor(t,n,r){super(At,r?.material),this.inputProperties=t,this.initialClasses=n,this.matrixAutoUpdate=!1;let i=()=>{tt(()=>{let t=this.parent!=null;this.parentContainer.value=this.parent instanceof e?this.parent:void 0,this.isAttached.value=t})};this.addEventListener(`added`,i),this.addEventListener(`removed`,i),this.root=Ba(this,r?.renderContext);let a=vi(this.root,this.hoveredList,this.activeList,r?.hasFocus,r?.isPlaceholder);this.properties=new Vi(ri,a,r?.defaults??Ei),this.properties.setLayersWithConditionals({type:`default-overrides`},{width:N(()=>{let e=this.properties.value.sizeX;if(e!=null)return Sn(e)/xn(this.properties.value.pixelSize)}),height:N(()=>{let e=this.properties.value.sizeY;if(e!=null)return Sn(e)/xn(this.properties.value.pixelSize)}),...r?.defaultOverrides}),P(()=>{if(!this.properties.enabled.value)return;let e=this.parentContainer.value?.properties,t=Ti({type:`inheritance`}),n=e?.subscribePropertyKeys(n=>{if(!Wa.includes(n))return;let r=e.signal[n];this.properties.set(t,n,r)});return()=>{n?.(),this.properties.setLayer(t,void 0)}},this.abortSignal),this.starProperties=new Vi(ri,a),this.starProperties.setLayersWithConditionals({type:`default-overrides`},na(r?.defaultOverrides)),P(()=>{let e=this.isRootAttached.value;this.properties.setEnabled(e),this.starProperties.setEnabled(e)},this.abortSignal),P(()=>{if(!this.properties.enabled.value||!this.starProperties.enabled.value)return;let e=this.parentContainer.value?.starProperties??Ya,t=Ti({type:`star-inheritance`}),n=e?.subscribePropertyKeys(n=>{let r=e.signal[n];this.starProperties.set(t,n,r),this.properties.set(t,n,r)});return()=>{n?.(),this.properties.setLayer(t,void 0),this.starProperties.setLayer(t,void 0)}},this.abortSignal),this.resetProperties(t),this.classList=new ta(this.properties,this.starProperties),n!=null&&this.classList.add(...n),P(()=>{let e=this.properties.value.id;if(e==null)return;let t=`__id__${e}`;if(t in ea)return this.classList.add(t),()=>this.classList.remove(t)},this.abortSignal),this.node=new Zr(this),this.globalMatrix=$a(N(()=>this.parentContainer.value?.childrenMatrix.value??Ua(this.properties,this.size)),$i(this));let o=N(()=>xn(this.properties.value.pixelSize));this.isClipped=ir(this.parentContainer,this.globalMatrix,this.size,o),this.isVisible=eo(this,this.isClipped,this.properties),this.handlers=ro(this.properties,this.starProperties,this.hoveredList,this.activeList,r?.dynamicHandlers),this.ancestorsHaveListenersSignal=io(this.parentContainer,this.handlers),this.globalPanelMatrix=kn(this.properties,this.globalMatrix,this.size,void 0),this.raycast=Pt(this,this.raycast.bind(this),this.root,this.parentContainer,this.orderInfo),this.spherecast=Pt(this,Bt(this.root,this.boundingSphere,this.globalPanelMatrix,this),this.root,this.parentContainer,this.orderInfo),Ct(this.hoveredList,this.abortSignal),jt(this.boundingSphere,o,this.globalMatrix,this.size,this.abortSignal);let s=r?.hasNonUikitChildren??!0,c=r?.isRenderless??!1;if(this.needsRenderTraversal=N(()=>!c||this.parentContainer.value==null||this.renderTraversalChildCount.value>0),P(()=>{let e=this.parentContainer.value;if(!(e==null||!this.needsRenderTraversal.value))return e.renderTraversalChildCount.value=e.renderTraversalChildCount.peek()+1,()=>{e.renderTraversalChildCount.value=e.renderTraversalChildCount.peek()-1}},this.abortSignal),c&&P(()=>{this.visible=this.needsRenderTraversal.value},this.abortSignal),co(this,s),P(()=>{let{value:e}=this.handlers;for(let t in e)this.addEventListener(Za(t),e[t]);return()=>{for(let t in e)this.removeEventListener(Za(t),e[t])}},this.abortSignal),!s){let t=({child:t})=>{if(!(t instanceof e||t instanceof cn||t instanceof Da))throw Error(`Only pmndrs/uikit components can be added as children to this component. Got ${t.constructor.name} instead.`)};this.addEventListener(`childadded`,t),this.abortSignal.addEventListener(`abort`,()=>this.removeEventListener(`childadded`,t))}}raycast(e,t){return this.root.peek().component.updateMatrix(),mo(this.root.peek(),qa),Ka.copy(this.boundingSphere).applyMatrix4(qa),e.ray.intersectsSphere(Ka)?(this.updateWorldMatrix(!1,!1),super.raycast(e,t),!1):!1}updateMatrixWorld(){this.updateWorldMatrix(!1,!0)}updateWorldMatrix(e,t){let n=this.root.peek().component,r=n.parent;if(e&&r?.updateWorldMatrix(!0,!1),this===n&&n.updateMatrix(),mo(this.root.peek(),qa),this.matrixWorld.multiplyMatrices(qa,this.globalPanelMatrix.peek()??Ga),t&&this.root.peek().component===this)for(let e of this.root.value.onUpdateMatrixWorldSet)e()}setProperties(e){this.resetProperties({...this.inputProperties,...e})}resetProperties(e){this.inputProperties=e,this.properties.setLayersWithConditionals({type:`base`},e),this.starProperties.setLayersWithConditionals({type:`base`},na(e))}update(e){let t=this.root.peek();if(t.component==this){t.isUpdateRunning=!0;for(let t of this.root.peek().onFrameSet)t(e);t.isUpdateRunning=!1}}copyInto(t,n){if(t.name=this.name,t.up.copy(this.up),t.position.copy(this.position),t.rotation.order=this.rotation.order,t.quaternion.copy(this.quaternion),t.scale.copy(this.scale),t.matrix.copy(this.matrix),t.matrixWorld.copy(this.matrixWorld),t.matrixAutoUpdate=this.matrixAutoUpdate,t.matrixWorldAutoUpdate=this.matrixWorldAutoUpdate,t.layers.mask=this.layers.mask,t.visible=this.visible,t.castShadow=this.castShadow,t.receiveShadow=this.receiveShadow,t.frustumCulled=this.frustumCulled,t.renderOrder=this.renderOrder,t.animations=this.animations.slice(),t.userData=JSON.parse(JSON.stringify(this.userData)),n!==!1)for(let n of this.children)n instanceof cn||n instanceof Da||n instanceof e&&t.add(n.clone())}clone(t){let n=new e(this.inputProperties,this.initialClasses);return this.copyInto(n,t),n}copy(e,t){throw Error(`Component.copy() is not supported because uikit components require constructor-based initialization. Use Component.clone() instead.`)}dispose(){this.parent?.remove(this),this.abortController.abort()}addUnsafe(...e){for(let t of e)super.add(t);return this}};function Za(e){return e.slice(2).toLowerCase()}function Qa(e,t,n,r=!1){if(e instanceof t)return e;let i;if(e instanceof Xa&&(i=e.parentContainer.value),r&&(i??=e.parent),!(n===0||i==null))return Qa(i,t,n-1,r)}function $a(e,t){return N(()=>{let n=t.value,r=e.value;if(!(n==null||r==null))return r.clone().multiply(n)})}function eo(e,t,n){return N(()=>e.displayed.value&&(t==null||!t?.value)&&n.value.visibility===`visible`)}function to(e,t,n,r,i,...a){P(()=>{let r=!1,o;return t(fo(i),...a).then(t=>{r||(e.value=o=t)}).catch(console.error),()=>{r=!0,o!=null&&n!=null&&n(o)}},r)}var no=[`onClick`,`onContextMenu`,`onDblClick`,`onPointerCancel`,`onPointerDown`,`onPointerEnter`,`onPointerLeave`,`onPointerMove`,`onPointerOut`,`onPointerOver`,`onPointerUp`,`onWheel`];function ro(e,t,n,r,i){return N(()=>{if(!e.enabled.value)return{};let a={};for(let t of no){let n=e.value[t];n!=null&&(a[t]=n)}return ao(a,i?.value),wt(a,e,n,e.usedConditionals.hover,t.usedConditionals.hover),St(a,e,r,e.usedConditionals.active,t.usedConditionals.active),a})}function io(e,t){return N(()=>(e.value?.ancestorsHaveListenersSignal.value??!1)||Object.keys(t.value).length>0)}function ao(e,t){for(let n in t)oo(n,e,t[n])}function oo(e,t,n){if(n==null)return;let r=t[e];if(r==null){t[e]=n;return}t[e]=(e=>{r(e),n(e)})}function so(e,t,n,r){if(n!=null&&!r.aborted){let e=n.subscribe(()=>{t.peek().requestRender?.()});r.addEventListener(`abort`,e)}P(()=>{let n=t.value;if(n.component===e)return;let r=e.updateWorldMatrix.bind(e,!1,!0);return n.onUpdateMatrixWorldSet.add(r),()=>n.onUpdateMatrixWorldSet.delete(r)},r)}function co(e,t){e.defaultPointerEvents=`auto`,P(()=>{e.ancestorsHaveListeners=e.ancestorsHaveListenersSignal.value,e.pointerEvents=e.isVisible.value?e.properties.value.pointerEvents:`none`,e.pointerEventsOrder=xn(e.properties.value.pointerEventsOrder??0),e.pointerEventsType=e.properties.value.pointerEventsType},e.abortSignal),P(()=>{if(!e.properties.enabled.value)return;let n=e.root.value.component;if(e.intersectChildren=t||n===e,!t&&e.properties.value.pointerEvents===`none`||n===e)return;n.interactableDescendants??=[];let r=n.interactableDescendants;return r.push(e),()=>{let t=r.indexOf(e);t!==-1&&r.splice(t,1)}},e.abortSignal)}function P(e,t){if(t.aborted)return;let n=xt(e);t.addEventListener(`abort`,n)}var lo={left:.5,center:0,middle:0,right:-.5},uo={top:-.5,center:0,middle:0,bottom:.5};function fo(e){if(e=e instanceof ft?e.value:e,e!==`initial`)return e}function po(e,t){return N(()=>t.map(t=>{let n=e.value[t];return n==null?0:Sn(n)}))}function mo(e,t){let n=e.component;if(n.parent==null){t.copy(n.matrix);return}t.multiplyMatrices(n.parent.matrixWorld,n.matrix)}var ho=Symbol(`reverse-painter-sort-stable-cache-key`),go=Symbol(`order-info-key`);function _o(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;let n=e.z,r=t.z,i=e.object[ho],a=t.object[ho];if(i!=null){let e=i.peek();e.reversePainterSortStableCache??=n,n=e.reversePainterSortStableCache}if(a!=null){let e=a.peek();e.reversePainterSortStableCache??=r,r=e.reversePainterSortStableCache}return i!=null&&i.peek()===a?.peek()?yo(e.object[go].value,t.object[go].value):n===r?e.id-t.id:r-n}var vo={Panel:0,Image:1,Content:2,Custom:3,Text:4};function yo(e,t){if(e==null||t==null)return 0;let n=e.majorIndex-t.majorIndex;return n!=0||(n=e.minorIndex-t.minorIndex,n!=0)||(n=e.elementType-t.elementType,n!=0)?n:e.patchIndex-t.patchIndex}function bo(e,t,n,r,i,a,o){P(()=>{if(!t.enabled.value){e.value=void 0;return}if(a.value===void 0){e.value=void 0;return}let o=a.value,s=xn(t.value[n]??o?.majorIndex??0),c,l;o==null?(c=0,l=0):r>o.elementType?(c=o.minorIndex,l=0):r!=o.elementType||!xo(fo(i),fo(o.instancedGroupDependencies))?(c=o.minorIndex+1,l=0):(c=o.minorIndex,l=o.patchIndex+1),l+=xn(t.value.zIndexOffset??0),e.value={instancedGroupDependencies:i,elementType:r,majorIndex:s,minorIndex:c,patchIndex:l}},o)}function xo(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=0;for(let r in e){if(e[r]!=t[r])return!1;++n}return n===Object.keys(t).length}function So(e,t,n){e[ho]=t,e[go]=n}var Co=new c,wo=new c;function To(e,t,n){return N(()=>{let r=n.value;if(r==null)return;let[i,a]=t.value,o=xn(e.value.pixelSize);return new k().makeTranslation(-i*o,a*o,0).premultiply(r)})}function Eo(e){return N(()=>{let t=e.value,[n,r]=t?.anyAncestorScrollable?.value??[!1,!1],[i,a]=t?.scrollable.value??[!1,!1];return[n||i,r||a]})}function Do(e,t,n,r){let i=N(()=>t.scrollable.value.some(e=>e)??!1);P(()=>{if(!i.value){e.value=void 0;return}let n=e=>{`releasePointerCapture`in t&&typeof t.releasePointerCapture==`function`&&e.pointerId!=null&&t.releasePointerCapture(e.pointerId),!(e.pointerId==null||!t.downPointerMap.delete(e.pointerId)||t.scrollPosition.value==null)&&(e.stopImmediatePropagation?.(),!(t.downPointerMap.size>0)&&(t.root.peek().requestRender?.(),r()))};e.value={onPointerDown:e=>{e.stopImmediatePropagation?.();let n=t.worldToLocal(e.point.clone()),r=e.nativeEvent!=null&&typeof e.nativeEvent==`object`&&`pointerType`in e.nativeEvent&&e.nativeEvent.pointerType===`mouse`,i=r?Ko(n,Sn(t.properties.peek().scrollbarWidth??0),t.size.peek(),t.maxScrollPosition.peek(),t.borderInset.peek(),t.scrollPosition.peek()):void 0;e.pointerId==null||r&&i==null||(`setPointerCapture`in e.object&&typeof e.object.setPointerCapture==`function`&&e.object.setPointerCapture(e.pointerId),t.downPointerMap.set(e.pointerId,i==null?{type:`scroll-panel`,timestamp:performance.now(),localPoint:n}:{type:`scroll-bar`,localPoint:n,axisIndex:i}))},onPointerUp:n,onPointerLeave:n,onPointerCancel:n,onPointerMove:e=>{if(e.pointerId==null)return;let n=t.downPointerMap.get(e.pointerId);if(n==null)return;if(e.stopImmediatePropagation?.(),t.worldToLocal(wo.copy(e.point)),Co.copy(wo).sub(n.localPoint),Co.x*=t.size.peek()?.[0]??0,Co.y*=t.size.peek()?.[1]??0,n.localPoint.copy(wo),n.type===`scroll-bar`){let i=t.size.peek();if(i==null)return;Uo(Co,n.axisIndex,i,t.borderInset.peek(),t.maxScrollPosition.peek(),Sn(t.properties.peek().scrollbarWidth??0)),Oo(t,e,Co.x,-Co.y,void 0,!1),r();return}let i=performance.now(),a=i-n.timestamp;Oo(t,e,-Co.x,Co.y,a,!0),r(),n.timestamp=i},onWheel:e=>{let{nativeEvent:n}=e;typeof n!=`object`||!n||!(`deltaX`in n)||typeof n.deltaX!=`number`||!(`deltaY`in n)||typeof n.deltaY!=`number`||(Oo(t,e,n.deltaX,n.deltaY,void 0,!1),r())}}},n)}function Oo(e,t,n,r,i,a){let o=e.scrollPosition.value;if(o==null)return;let[s,c]=t==null?[!1,!1]:jo(t.nativeEvent);s&&(n=0),c&&(r=0);let[l,u]=o,[d,f]=e.maxScrollPosition.value,[p,m]=o,[h,g]=e.anyAncestorScrollable?.value??[!1,!1];p=No(l,d,n,a&&!h),m=No(u,f,r,a&&!g),i!=null&&i>0&&e.scrollVelocity.set(n,r).divideScalar(i),t!=null&&Mo(t.nativeEvent,s||Math.min(l,(d??0)-l)>5,c||Math.min(u,(f??0)-u)>5),!(e.properties.peek().onScroll?.(p,m,e.scrollPosition,t)===!1||l===p&&u===m)&&(e.scrollPosition.value=[p,m])}function ko(e){let t=M(!1),n=()=>{let n=e.scrollPosition.value,[r,i]=e.maxScrollPosition.value,a=n!=null&&(e.scrollVelocity.x!==0||e.scrollVelocity.y!==0||Math.abs(Fo(n[0],0,r??0))>1||Math.abs(Fo(n[1],0,i??0))>1);t.value=a,a&&e.root.peek().requestFrame?.()},r=t=>{if(e.downPointerMap.size>0)return;let r=e.scrollPosition.value;if(r==null){n();return}let i=0,a=0,[o,s]=r,[c,l]=e.maxScrollPosition.value,u=Fo(o,0,c??0),d=Fo(s,0,l??0);i+=u*-.3,a+=d*-.3,i+=e.scrollVelocity.x*t,a+=e.scrollVelocity.y*t,e.scrollVelocity.multiplyScalar(.9),Math.abs(e.scrollVelocity.x)<.01&&(e.scrollVelocity.x=0),Math.abs(e.scrollVelocity.y)<.01&&(e.scrollVelocity.y=0),(i!==0||a!==0)&&Oo(e,void 0,i,a,void 0,!0),n()};return P(n,e.abortSignal),P(()=>{if(!t.value)return;let n=e.root.value;return n.onFrameSet.add(r),n.requestFrame?.(),()=>n.onFrameSet.delete(r)},e.abortSignal),n}var Ao=Symbol(`was-scrolled`);function jo(e){return e[Ao]??[!1,!1]}function Mo(e,t,n){e[Ao]=[t,n]}function No(e,t,n,r){if(n===0)return e;let i=Fo(e,0,t??0);Po(n)===Po(i)&&(n*=Math.max(0,1-Math.abs(i)/100));let a=e+n;return r&&t!=null?a:Ft(a,0,t??0)}function Po(e){return e>=0}function Fo(e,t,n){return e<t?e-t:e>n?e-n:0}var Io=[`scrollbarBorderLeftWidth`,`scrollbarBorderRightWidth`,`scrollbarBorderTopWidth`,`scrollbarBorderBottomWidth`];function Lo(e,t,n,r){let i=M(void 0);bo(i,e.properties,`scrollbarZIndex`,vo.Panel,r,n,e.abortSignal);let a=po(e.properties,Io);Bo(e,0,t,i,r,a),Bo(e,1,t,i,r,a)}var Ro;function zo(){return Ro??=Fr({backgroundColor:`scrollbarColor`,borderBottomLeftRadius:`scrollbarBorderBottomLeftRadius`,borderBottomRightRadius:`scrollbarBorderBottomRightRadius`,borderTopRightRadius:`scrollbarBorderTopRightRadius`,borderTopLeftRadius:`scrollbarBorderTopLeftRadius`,borderColor:`scrollbarBorderColor`,borderBend:`scrollbarBorderBend`},{backgroundColor:16777215}),Ro}function Bo(e,t,n,r,i,a){let o=N(()=>Vo(t,Sn(e.properties.value.scrollbarWidth??0),e.size.value,e.maxScrollPosition.value,e.borderInset.value,e.scrollPosition.value)),s=N(()=>o.value?.slice(0,2)??[0,0]),c=N(()=>o.value?.slice(2,4)??[0,0]),l=kn(e.properties,e.globalMatrix,c,s);pr(e.properties,e.root,r,i,l,c,a,n,e.isVisible,zo(),e.abortSignal)}function Vo(e,t,n,r,i,a){if(n==null||i==null||a==null)return;let o=r[e];if(o==null)return;let s=[0,0,0,0],c=1-e,l=n[e]-i[c]-i[c+2],u=Ho(l,o,t),d=l-u,f=a[e],p=1-e;return s[e]=n[e]*.5-u*.5-i[(e+3)%4]-d*Ft(f/o,0,1),s[p]=n[p]*.5-t*.5-i[p+1],e===0&&(s[0]*=-1,s[1]*=-1),s[e+2]=u,s[c+2]=t,s}function Ho(e,t,n){return Math.max(n,e*e/(t+e))}function Uo(e,t,n,r,i,a){let o=i[t];if(n==null||r==null||o==null)return;let s=e.getComponent(t),c=n[t]-r[1-t]-r[1-t+2],l=c-Ho(c,o,a);e.setComponent(t,s/l*o),e.setComponent(1-t,0),e.z=0}var Wo=new C,Go=new A;function Ko(e,t,n,r,i,a){if(n!=null){Go.copy(e),Go.x*=n[0],Go.y*=n[1];for(let e=0;e<2;e++)if(Yo(Go,e,t,n,r,i,a))return e}}var qo=new A,Jo=new A;function Yo(e,t,n,r,i,a,o){let s=Vo(t,n,r,i,a,o);return s==null?!1:(Wo.setFromCenterAndSize(qo.fromArray(s,0),Jo.fromArray(s,2)),Wo.containsPoint(e))}var Xo=class e extends Xa{inputConfig;downPointerMap=new Map;scrollVelocity=new A;anyAncestorScrollable;clippingRect;childrenMatrix;fontFamilies;scrollPosition=M([0,0]);constructor(e,t,n){let r=M(void 0);super(e,t,{hasNonUikitChildren:!1,isRenderless:!0,dynamicHandlers:r,...n}),this.inputConfig=n,this.material.visible=!1;let i=ko(this);Do(r,this,this.abortSignal,i),this.childrenMatrix=To(this.properties,this.scrollPosition,this.globalMatrix);let a=N(()=>this.parentContainer.value?.clippingRect.value);this.fontFamilies=Pi(this.properties,this.parentContainer),this.clippingRect=ar(this.globalMatrix,this,N(()=>xn(this.properties.value.pixelSize)),a),this.anyAncestorScrollable=Eo(this.parentContainer);let o=fr(this.properties);bo(this.orderInfo,this.properties,`zIndex`,vo.Panel,o,N(()=>this.parentContainer.value==null?null:this.parentContainer.value.orderInfo.value),this.abortSignal),pr(this.properties,this.root,this.orderInfo,o,this.globalPanelMatrix,this.size,this.borderInset,a,this.isVisible,Nr(),this.abortSignal),Lo(this,a,this.orderInfo,o)}clone(t){let n=new e(this.inputProperties,this.initialClasses,this.inputConfig);return this.copyInto(n,t),n}},Zo={...Ei,objectFit:`fill`,keepAspectRatio:!0},Qo=class e extends Xa{inputConfig;texture=M(void 0);constructor(e,t,n){let r=M(void 0);super(e,t,{defaults:Zo,hasNonUikitChildren:!1,...n,defaultOverrides:{aspectRatio:r,...n?.defaultOverrides}}),this.inputConfig=n,bo(this.orderInfo,this.properties,`zIndex`,vo.Image,void 0,N(()=>this.parentContainer.value==null?null:this.parentContainer.value.orderInfo.value),this.abortSignal),this.frustumCulled=!1,So(this,this.root,this.orderInfo),(n?.loadTexture??!0)&&to(this.texture,ns,ts,this.abortSignal,this.properties.signal.src);let i=cr(this),a=is().computedIsVisibile(this.properties,this.borderInset,this.size,N(()=>this.isVisible.value&&this.texture.value!=null)),o=new Float32Array(16),s={data:o,type:`normal`};this.customDepthMaterial=new an(s),this.customDistanceMaterial=new rn(s),this.customDepthMaterial.clippingPlanes=i,this.customDistanceMaterial.clippingPlanes=i,P(()=>{this.material.depthTest=this.properties.value.depthTest,this.root.peek().requestRender?.()},this.abortSignal),P(()=>{this.material.depthWrite=this.properties.value.depthWrite??!1,this.root.peek().requestRender?.()},this.abortSignal),P(()=>{this.material.map=this.texture.value??null,this.material.needsUpdate=!0,this.root.peek().requestRender?.()},this.abortSignal),P(()=>{let e=nn(Ht(this.properties.value.panelMaterialClass),s);return e.clippingPlanes=i,e.map=this.material.map,e.depthWrite=this.material.depthWrite,e.depthTest=this.material.depthTest,this.material=e,()=>e.dispose()},this.abortSignal),P(()=>{this.renderOrder=xn(this.properties.value.renderOrder??0),this.root.peek().requestRender?.()},this.abortSignal),P(()=>{this.castShadow=this.properties.value.castShadow,this.root.peek().requestRender?.()},this.abortSignal),P(()=>{this.receiveShadow=this.properties.value.receiveShadow,this.root.peek().requestRender?.()},this.abortSignal),so(this,this.root,this.globalPanelMatrix,this.abortSignal);let c=is();P(()=>{if(!this.isVisible.value)return;o.set(c.defaultData);let e=xt(()=>{let e=this.size.value;e!=null&&o.set(e,14)}),t=xt(()=>{let e=this.borderInset.value;e!=null&&o.set(e,0)});return this.root.peek().requestRender?.(),()=>{e(),t()}},this.abortSignal),P(()=>{this.isVisible.value&&(_r(o,4,16777215,br(this.properties.value.opacity??1,()=>1),void 0),this.root.peek().requestRender?.())},this.abortSignal);let l=c.setters;P(()=>{if(this.isVisible.value)return this.properties.subscribePropertyKeys(e=>{c.hasProperty(e)&&P(()=>{l[e](o,0,this.properties.value[e],this.size,this.properties.signal.opacity,void 0),this.root.peek().requestRender?.()},this.abortSignal)})},this.abortSignal),P(()=>{let e=this.texture.value,t=this.size.value,n=this.borderInset.value;if(e==null||t==null||n==null)return;if(e.matrix.identity(),this.root.peek().requestRender?.(),this.properties.value.objectFit===`fill`||e==null){$o(n,t,e);return}let{width:r,height:i}=e.source.data,a=r/i,[o,s]=t,[c,l,u,d]=n,f=(o-d-l)/(s-c-u);a>f?e.matrix.translate(-(.5*(f-a))/f,0).scale(f/a,1):e.matrix.translate(0,-(.5*(a-f))/a).scale(1,a/f),$o(n,t,e)},this.abortSignal),P(()=>{this.visible=a.value,this.root.peek().requestRender?.()},this.abortSignal),P(()=>{if(!this.properties.value.keepAspectRatio){r.value=void 0;return}let e=this.texture.value;if(e==null){r.value=void 0;return}let t=e.source.data;r.value=(t.videoWidth??t.naturalWidth??t.width)/(t.videoHeight??t.naturalHeight??t.height)},this.abortSignal)}clone(t){let n=new e(this.inputProperties,this.initialClasses,this.inputConfig);return this.copyInto(n,t),n}add(){throw Error(`the image component can not have any children`)}};function $o(e,t,n){let[r,i]=t,[a,o,s,c]=e,l=r-c-o,u=i-a-s;n.matrix.translate(-1+(c+l)/r,-1+(a+u)/i).scale(r/l,i/u)}var es=new s;function ts(e){e?.disposable===!0&&e.dispose()}async function ns(e){if(e==null)return Promise.resolve(void 0);if(e instanceof v)return Promise.resolve(e);try{let t=await es.loadAsync(e);return t.colorSpace=d,t.matrixAutoUpdate=!1,Object.assign(t,{disposable:!0})}catch(e){console.error(e);return}}var rs;function is(){return rs??=Fr({borderBend:`borderBend`,borderBottomLeftRadius:`borderBottomLeftRadius`,borderBottomRightRadius:`borderBottomRightRadius`,borderColor:`borderColor`,borderTopLeftRadius:`borderTopLeftRadius`,borderTopRightRadius:`borderTopRightRadius`},{backgroundColor:16777215}),rs}var as={...Ei,...Ia},os=class e extends Xa{inputConfig;backgroundOrderInfo=M(void 0);backgroundGroupDeps;fontSignal;textLayout;globalTextMatrix;constructor(e,t,n){super(e,t,{defaults:as,hasNonUikitChildren:!1,isRenderless:!0,...n}),this.inputConfig=n,this.material.visible=!1;let r=N(()=>this.parentContainer.value?.clippingRect.value);this.backgroundGroupDeps=fr(this.properties),this.globalTextMatrix=Ca(this),bo(this.backgroundOrderInfo,this.properties,`zIndex`,vo.Panel,this.backgroundGroupDeps,N(()=>this.parentContainer.value==null?null:this.parentContainer.value.orderInfo.value),this.abortSignal);let i=Pi(this.properties,this.parentContainer);this.fontSignal=Fi(this.properties,i),bo(this.orderInfo,this.properties,`zIndex`,vo.Text,Aa(this.fontSignal),this.backgroundOrderInfo,this.abortSignal),pr(this.properties,this.root,this.backgroundOrderInfo,this.backgroundGroupDeps,this.globalPanelMatrix,this.size,this.borderInset,r,this.isVisible,Nr(),this.abortSignal);let{layout:a,customLayouting:o}=Ta(this);this.textLayout=a,La(this,r,this.textLayout),P(()=>this.node.setCustomLayouting(o.value),this.abortSignal)}clone(t){let n=new e(this.inputProperties,this.initialClasses,this.inputConfig);return this.copyInto(n,t),n}add(){throw Error(`the text component can not have any children`)}},ss=new A,cs=class e extends Xo{renderer;inputConfig;sizeX;sizeY;transformTranslateZ;pixelSize;constructor(e,t,n,r){let i=M(0),a=M(0),o=M(0),s=M(0);super(t,n,{...r,defaultOverrides:{sizeX:i,sizeY:a,pixelSize:s,transformTranslateZ:o,pointerEvents:`listener`,...r?.defaultOverrides}}),this.renderer=e,this.inputConfig=r,this.sizeX=i,this.sizeY=a,this.transformTranslateZ=o,this.pixelSize=s}clone(t){let n=new e(this.renderer,this.inputProperties,this.initialClasses,this.inputConfig);return this.copyInto(n,t),n}update(e){super.update(e);let t=Qa(this,we,2,!0);if(!(t instanceof w||t instanceof te))throw Error(`fullscreen can only be added to a camera`);let n=xn(this.properties.peek().distanceToCamera??t.near+.1);tt(()=>{let e;if(t instanceof w){let r=2*Math.tan(Math.PI*t.fov/360)*n;e=r/this.renderer.getSize(ss).y,this.sizeY.value=r,this.sizeX.value=r*t.aspect}else if(t instanceof te){let n=(t.top-t.bottom)/t.zoom,r=(t.right-t.left)/t.zoom;e=n/this.renderer.getSize(ss).y,this.sizeY.value=n,this.sizeX.value=r}else return;this.renderer.xr.getSession()?.interactionMode===`screen-space`&&(e*=window.devicePixelRatio),this.pixelSize.value=e,this.transformTranslateZ.value=-n/e})}},ls=class{nativeEvent;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;relatedTarget=null;get altKey(){return this.getFromNative(`altKey`,!1)}get button(){return this.getFromNative(`button`,0)}get buttons(){return this.getFromNative(`buttons`,0)}get clientX(){return this.getFromNative(`clientX`,0)}get clientY(){return this.getFromNative(`clientY`,0)}get ctrlKey(){return this.getFromNative(`ctrlKey`,!1)}get layerX(){return this.getFromNative(`layerX`,0)}get layerY(){return this.getFromNative(`layerY`,0)}get metaKey(){return this.getFromNative(`metaKey`,!1)}get movementX(){return this.getFromNative(`movementX`,0)}get movementY(){return this.getFromNative(`movementY`,0)}get offsetX(){return this.getFromNative(`offsetX`,0)}get offsetY(){return this.getFromNative(`offsetY`,0)}get pageX(){return this.getFromNative(`pageX`,0)}get pageY(){return this.getFromNative(`pageY`,0)}get screenX(){return this.getFromNative(`screenX`,0)}get screenY(){return this.getFromNative(`screenY`,0)}get shiftKey(){return this.getFromNative(`shiftKey`,!1)}get x(){return this.getFromNative(`x`,0)}get y(){return this.getFromNative(`y`,0)}get detail(){return this.getFromNative(`detail`,0)}get view(){return this.getFromNative(`view`,null)}get which(){return this.getFromNative(`which`,0)}get cancelBubble(){return this.getFromNative(`cancelBubble`,!1)}get composed(){return this.getFromNative(`composed`,!1)}get eventPhase(){return this.getFromNative(`eventPhase`,0)}get isTrusted(){return this.getFromNative(`isTrusted`,!1)}get returnValue(){return this.getFromNative(`returnValue`,!1)}get timeStamp(){return this.getFromNative(`timeStamp`,0)}get cancelable(){return this.getFromNative(`cancelable`,!1)}get defaultPrevented(){return this.getFromNative(`defaultPrevented`,!1)}constructor(e){this.nativeEvent=e}getFromNative(e,t){return e in this.nativeEvent?this.nativeEvent[e]:t}},us=new c,ds=class e extends ls{type;bubbles;internalPointer;intersection;camera;currentObject;object;propagationState;get pointerId(){return this.internalPointer.id}get pointerType(){return this.internalPointer.type}get pointerState(){return this.internalPointer.state}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return this._pointer??=(us.copy(this.intersection.point).project(this.camera),new A(us.x,us.y)),this._pointer}_ray;get ray(){if(this._ray!=null)return this._ray;switch(this.intersection.details.type){case`screen-ray`:case`ray`:case`sphere`:return this._ray=new oe(this.intersection.pointerPosition,new c(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case`lines`:return this._ray=new oe(this.intersection.details.line.start,this.intersection.details.line.end.clone().sub(this.intersection.details.line.start).normalize())}}_intersections=[];get intersections(){return this._intersections??=[{...this.intersection,eventObject:this.currentObject}],this._intersections}_unprojectedPoint;get unprojectedPoint(){if(this._unprojectedPoint==null){let e=this.pointer;this._unprojectedPoint=new c(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}get stopped(){return this.propagationState.stoppedImmediate||this.propagationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw Error(`not supported`)}constructor(e,t,n,r,i,a,o=i.object,s=o,c={stopped:!t,stoppedImmediate:!1}){super(n),this.type=e,this.bubbles=t,this.internalPointer=r,this.intersection=i,this.camera=a,this.currentObject=o,this.object=s,this.propagationState=c}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(t){return new e(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,t,this.target,this.propagationState)}},fs=class e extends ds{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,r,i,a){super(`wheel`,!0,e,t,n,r,i,a)}retarget(t){return new e(this.nativeEvent,this.internalPointer,this.intersection,this.camera,t,this.target)}};function ps(e){ms(e,e.currentObject)}function ms(e,t){if(t==null)return;let n=_s(t,e.type);if(n!=null&&n.length>0){let r=e.retarget(t),i=n.length;for(let e=0;e<i&&!r.stoppedImmediate;e++)n[e](r)}e.stopped||ms(e,t.parent)}var hs={click:`onClick`,contextmenu:`onContextMenu`,dblclick:`onDoubleClick`,pointercancel:`onPointerCancel`,pointerdown:`onPointerDown`,pointerenter:`onPointerEnter`,pointerleave:`onPointerLeave`,pointermove:`onPointerMove`,pointerout:`onPointerOut`,pointerover:`onPointerOver`,pointerup:`onPointerUp`,wheel:`onWheel`},gs=Object.keys(hs);function _s(e,t){if(e._listeners!=null&&t in e._listeners)return e._listeners[t];let n;if(e.isVoidObject&&t===`click`&&e.parent?.__r3f!=null&&(n=e.parent.__r3f.root.getState().onPointerMissed),e.__r3f!=null&&(n=e.__r3f.handlers[hs[t]]),n!=null)return[n]}var vs=new De(1e10),ys=new Map;function bs(e){let t=ys.get(e);return t??(t=new he(vs),t.isVoidObject=!0,t.parent=e,t.pointerEventsOrder=-1/0,ys.set(e,t)),t}function xs(e,t,n){let r=t.normal??t.face?.normal;return r==null?!1:(e.setFromNormalAndCoplanarPoint(r,t.localPoint),e.applyMatrix4(n),!0)}function Ss(e,t,n){if(t===`none`||t===`listener`&&!e)return!1;if(n===`all`)return!0;if(typeof n==`function`)return({id:e,type:t,state:r})=>n(e,t,r);let r,i;return`deny`in n?(i=!0,r=n.deny):(i=!1,r=n.allow),Array.isArray(r)?e=>Cs(r.includes(e.type),i):e=>Cs(r===e.type,i)}function Cs(e,t){return t?!e:e}function ws(e,t,n,r=!1,i,a,o){let s=r||Ts(e,t),c=t.pointerEvents??i,l=c??t.defaultPointerEvents??`listener`,u=t.pointerEventsType??a??`all`,d=t.pointerEventsOrder??o??0,f=Ss(s,l,u),p=n.length;if(p===1)(f===!0||typeof f==`function`&&f(n[0]))&&Es(n[0],t,l,u,d);else if(f===!0)for(let e=0;e<p;e++)Es(n[e],t,l,u,d);else if(typeof f==`function`)for(let e=0;e<p;e++){let r=n[e];f(r)&&Es(r,t,l,u,d)}if(t.children.length===0||t.intersectChildren===!1)return;let m=t.interactableDescendants??t.children,h=m.length;for(let t=0;t<h;t++)ws(e,m[t],n,s,c,u,d)}function Ts(e,t){if(t.ancestorsHaveListeners||e===`pointer`&&t.ancestorsHavePointerListeners||e===`wheel`&&t.ancestorsHaveWheelListeners||t.__r3f!=null&&t.__r3f?.eventCount>0&&(e===`wheel`&&t.__r3f.handlers.onWheel!=null||e===`pointer`&&Object.keys(t.__r3f.handlers).some(e=>e!=`onWheel`)))return!0;if(t._listeners==null)return!1;if(e===`wheel`){let e=t._listeners.wheel;return e!=null&&e.length>0}let n=Object.entries(t._listeners),r=n.length;for(let e=0;e<r;e++){let t=n[e];if(t[0]!==`wheel`&&gs.includes(t[0])&&t[1]!=null&&t[1].length>0)return!0}return!1}function Es({intersector:e,options:t},n,r,i,a){t.filter?.(n,r,i,a)!==!1&&e.executeIntersection(n,a)}function Ds(e,t,{customSort:n=Os}={},r){let i,a,o,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(r?.(s)===!1)continue;let l=t?.[c];(i==null||n(s,l,i,a)<0)&&(o=c,i=s,a=l)}return o}function Os(e,t=0,n,r=0){return t==r?e.distance-n.distance:r-t}var ks=1e7;function As(e,t,n,r,i,a=0){let o=t.direction.clone().multiplyScalar(ks),s=ks;return{distance:s+a,object:bs(e),point:o,normal:t.origin.clone().sub(o).normalize(),details:n(o,s),pointerPosition:r,pointerQuaternion:i,pointOnFace:o,localPoint:o}}function js(e,t,n){for(;n>0;)e.push(t),--n}var Ms=Symbol(`buttonsDownTime`),Ns=Symbol(`buttonsClickTime`);globalThis.pointerEventspointerMap??=new Map,re.prototype.setPointerCapture=function(e){Ps(e)?.setCapture(this)},re.prototype.releasePointerCapture=function(e){let t=Ps(e);t==null||!t.hasCaptured(this)||t.setCapture(void 0)},re.prototype.hasPointerCapture=function(e){return Ps(e)?.hasCaptured(this)??!1};function Ps(e){return globalThis.pointerEventspointerMap?.get(e)}var Fs=class{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,r,i,a,o,s,c={}){this.id=e,this.type=t,this.state=n,this.intersector=r,this.getCamera=i,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=s,this.options=c,globalThis.pointerEventspointerMap?.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(this.clearPointerCapture(),e!=null&&this.intersection!=null&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(!e&&this.pointerCapture!=null&&this.clearPointerCapture(),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return this.pointerCapture==null?(this.intersector.startIntersection(n),ws(e,t,[this]),this.intersector.finalizeIntersection(t)):this.intersector.intersectPointerCapture(this.pointerCapture,n)}setIntersection(e){this.intersection=e}commit(e,t){let n=this.getCamera(),r=this.prevEnabled?this.prevIntersection:void 0,i=this.enabled?this.intersection:void 0;r!=null&&r.object!=i?.object&&ps(new ds(`pointerout`,!0,e,this,r,n));let a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,Is(i?.object,this.pointerEntered,a,this.pointerEnteredHelper);let o=a.length;for(let t=0;t<o;t++){let i=a[t];ps(new ds(`pointerleave`,!1,e,this,r,n,i))}i!=null&&r?.object!=i.object&&ps(new ds(`pointerover`,!0,e,this,i,n));for(let t=this.pointerEnteredHelper.length-1;t>=0;t--){let r=this.pointerEnteredHelper[t];ps(new ds(`pointerenter`,!1,e,this,i,n,r))}if(t&&i!=null&&ps(new ds(`pointermove`,!0,e,this,i,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;let e=this.onFirstMove.length;for(let t=0;t<e;t++)this.onFirstMove[t](n);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection(`pointer`,e,t),this.commit(t,!0)}over(e,t){this.wasMoved||(this.intersection=this.computeIntersection(`pointer`,e,t),this.commit(t,!1))}emitMove(e){this.intersection!=null&&ps(new ds(`pointermove`,!0,e,this,this.intersection,this.getCamera()))}down(e){if(this.buttonsDown.add(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.down.bind(this,e));return}if(this.intersection==null)return;ps(new ds(`pointerdown`,!0,e,this,this.intersection,this.getCamera()));let{object:t}=this.intersection;t[Ms]??=new Map,t[Ms].set(e.button,e.timeStamp),this.buttonsDownTime.set(e.button,e.timeStamp)}up(e){if(this.buttonsDown.delete(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.up.bind(this,e));return}if(this.intersection==null)return;let{clickThesholdMs:t,contextMenuButton:n=2,dblClickThresholdMs:r=500,clickThresholdMs:i=t??300}=this.options;this.clearPointerCapture();let a=Ls(this.buttonsDownTime,this.intersection.object[Ms],e.button,e.timeStamp,i),o=this.getCamera();if(a&&e.button===n&&ps(new ds(`contextmenu`,!0,e,this,this.intersection,o)),ps(new ds(`pointerup`,!0,e,this,this.intersection,o)),!a||e.button===n)return;ps(new ds(`click`,!0,e,this,this.intersection,o));let{object:s}=this.intersection,c=s[Ns]??=new Map,l=c.get(e.button);if(l==null||e.timeStamp-l>r){c.set(e.button,e.timeStamp);return}ps(new ds(`dblclick`,!0,e,this,this.intersection,o)),c.delete(e.button)}cancel(e){this.buttonsDown.clear(),this.buttonsDownTime.clear(),this.clearPointerCapture(),this.onFirstMove.length=0,!(!this.enabled||!this.wasMoved||this.intersection==null)&&ps(new ds(`pointercancel`,!0,e,this,this.intersection,this.getCamera()))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n){this.onFirstMove.push(this.wheel.bind(this,e,t,n));return}n||(this.wheelIntersection=this.computeIntersection(`wheel`,e,t));let r=n?this.intersection:this.wheelIntersection;r!=null&&ps(new fs(t,this,r,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t){this.onFirstMove.push(this.emitWheel.bind(this,e,t));return}let n=t?this.intersection:this.wheelIntersection;n!=null&&ps(new fs(e,this,n,this.getCamera()))}exit(e){(this.buttonsDown.size>0||this.pointerCapture!=null)&&this.cancel(e),this.wasMoved&&(this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}clearPointerCapture(){this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0)}};function Is(e,t,n,r){if(e==null)return;let i=n.indexOf(e);i==-1?r.push(e):n.splice(i,1),t.push(e),Is(e.parent,t,n,r)}function Ls(e,t,n,r,i){if(t==null)return!1;let a=t.get(n);return!(a==null||r-a>i||a!=e.get(n))}var Rs=new b,zs=new b,Bs=new A,Vs=new A,Hs=new A,Us=new c,Ws=new k,Gs=new c;function Ks(e,t,n){Gs.copy(t).applyMatrix4(Ws.copy(n.matrixWorld).invert());let r=n.geometry.attributes.uv;if(r==null||!(r instanceof Te))return!1;let i;return qs(n,(e,t,a)=>{n.getVertexPosition(e,Rs.a),n.getVertexPosition(t,Rs.b),n.getVertexPosition(a,Rs.c);let o=Rs.closestPointToPoint(Gs,Us).distanceTo(Gs);i!=null&&o>=i||(i=o,zs.copy(Rs),Bs.fromBufferAttribute(r,e),Vs.fromBufferAttribute(r,t),Hs.fromBufferAttribute(r,a))}),i==null?!1:(zs.closestPointToPoint(Gs,Us),zs.getInterpolation(Us,Bs,Vs,Hs,e),!0)}function qs(e,t){let n=e.geometry.drawRange;if(e.geometry.index!=null){let r=e.geometry.index,i=Math.max(0,n.start),a=Math.min(r.count,n.start+n.count);for(let e=i;e<a;e+=3)t(r.getX(e),r.getX(e+1),r.getX(e+2));return}let r=e.geometry.attributes.position;if(r==null)return;let i=Math.max(0,n.start),a=Math.min(r.count,n.start+n.count);for(let e=i;e<a;e+=3)t(e,e+1,e+2)}new k,new y,new c,new Se,new oe,new A,new c(0,0,0),new c(0,0,1);var Js=new k,Ys=new c;new c(0,0,-1),new Se;var Xs=new A,Zs=new c,Qs=class{prepareTransformation;options;raycaster=new e;cameraQuaternion=new _;fromPosition=new c;fromQuaternion=new _;coords=new A;viewPlane=new Se;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},n){let r=e.details;if(r.type!=`screen-ray`)throw Error(`unable to process a pointer capture of type "${e.details.type}" with a camera ray intersector`);if(!this.startIntersection(n))return e;this.viewPlane.constant-=r.distanceViewPlane;let i=this.raycaster.ray.intersectPlane(this.viewPlane,new c);if(i==null)return e;e.object.updateWorldMatrix(!0,!1),xs(this.viewPlane,e,e.object.matrixWorld);let a=e.uv;return e.object instanceof he&&Ks(Xs,i,e.object)&&(a=Xs.clone()),{...e,details:{...r,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:a,object:t,point:i,pointOnFace:i,pointerPosition:this.raycaster.ray.origin.clone(),pointerQuaternion:this.cameraQuaternion.clone()}}startIntersection(e){let t=this.prepareTransformation(e,this.coords);return t==null?!1:(t.updateWorldMatrix(!0,!1),t.matrixWorld.decompose(this.fromPosition,this.fromQuaternion,Ys),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(Zs),this.raycaster.ray.origin),!0)}executeIntersection(e,t){let n=this.intersects.length;e.raycast(this.raycaster,this.intersects),js(this.pointerEventsOrders,t,this.intersects.length-n)}finalizeIntersection(e){let t=this.fromPosition.clone(),n=this.cameraQuaternion.clone(),r=this.raycaster.ray.direction.clone(),i=Ds(this.intersects,this.pointerEventsOrders,this.options),a=i==null?void 0:this.intersects[i];return this.intersects.length=0,this.pointerEventsOrders.length=0,a==null?As(e,this.raycaster.ray,(e,t)=>({type:`screen-ray`,distanceViewPlane:t,screenPoint:this.coords.clone(),direction:r}),t,n):(a.object.updateWorldMatrix(!0,!1),Js.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:`screen-ray`,distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:r},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(Js)}))}};new c,new A,new k,new c,new _,new Se,new h,new c,new c,new c,new c(1e-4,1e-4,1e-4),new k;var $s=23412;function ec(){return $s++}function tc(e,t,n){if(!(t instanceof globalThis.MouseEvent))return n.set(0,0);let{width:r,height:i,top:a,left:o}=e.getBoundingClientRect(),s=t.clientX-o,c=t.clientY-a;return n.set(s/r*2-1,-(c/i)*2+1)}function nc(e,t,n,r){return rc(e,typeof t==`function`?t:()=>t,n,tc.bind(null,e),e.setPointerCapture.bind(e),t=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)},{pointerTypePrefix:`screen-`,...r})}function rc(e,t,n,r,i,a,o={}){let s=o?.forwardPointerCapture??!0,c=new Map,l=o.pointerTypePrefix??`forward-`,u=(e,u)=>{let d=c.get(e.pointerId);return d??(d=new Fs(ec(),`${l}${e.pointerType}`,e.pointerState,new Qs((e,n)=>(r(e,n),t()),o),t,void 0,s?i.bind(null,e.pointerId):void 0,s?a.bind(null,e.pointerId):void 0,o),u!=`move`&&u!=`wheel`&&(d.setIntersection(d.computeIntersection(`pointer`,n,e)),d.commit(e,!1)),c.set(e.pointerId,d),d)},d=new Map,f=new Map,p=[],m=[],h=(e,t,r)=>{switch(e){case`move`:r.move(n,t);return;case`over`:r.move(n,t);return;case`wheel`:r.wheel(n,t);return;case`cancel`:r.cancel(t);return;case`down`:if(!ic(t))return;r.down(t);return;case`up`:if(!ic(t))return;r.up(t);return;case`exit`:f.delete(r),d.delete(r),r.exit(t);return}},g=(e,t)=>{let n=u(t,e);e===`move`&&f.set(n,t),e===`wheel`&&d.set(n,t),o.batchEvents??!0?m.push({type:e,event:t}):h(e,t,n)},_=g.bind(null,`move`),v=g.bind(null,`over`),y=g.bind(null,`cancel`),b=g.bind(null,`down`),x=g.bind(null,`up`),S=g.bind(null,`wheel`),C=g.bind(null,`exit`);return e.addEventListener(`pointermove`,_),e.addEventListener(`pointerover`,v),e.addEventListener(`pointercancel`,y),e.addEventListener(`pointerdown`,b),e.addEventListener(`pointerup`,x),e.addEventListener(`wheel`,S),e.addEventListener(`pointerleave`,C),{destroy(){e.removeEventListener(`pointermove`,_),e.removeEventListener(`pointerover`,v),e.removeEventListener(`pointercancel`,y),e.removeEventListener(`pointerdown`,b),e.removeEventListener(`pointerup`,x),e.removeEventListener(`wheel`,S),e.removeEventListener(`pointerleave`,C),f.clear(),d.clear()},update(){let e=m.length;for(let t=0;t<e;t++){let{type:e,event:n}=m[t],r=u(n,e);if(e===`move`&&(p.push(r),f.get(r)!=n)){r.emitMove(n);continue}if(e===`wheel`&&d.get(r)!=n){r.emitWheel(n);continue}h(e,n,r)}if(m.length=0,o.intersectEveryFrame??!1)for(let[e,t]of f.entries())p.includes(e)||e.move(n,t);p.length=0}}}function ic(e){return e.button!=null}function ac(){return{x:0,y:0,layout:`vertical`,alignX:`start`,alignY:`start`,gap:0,padding:0,radius:0,border:0,opacity:1,backgroundOpacity:1}}var oc=new WeakMap;function sc(e){let t=oc.get(e);return t||oc.set(e,t=ac()),t}function cc(e){let t=fc(sc(e));t.display=e.activeInHierarchy===!1?`none`:`flex`,e.setProperties(t)}var lc={topLeft:[`left`,`top`],top:[`center`,`top`],topRight:[`right`,`top`],left:[`left`,`middle`],center:[`center`,`middle`],right:[`right`,`middle`],bottomLeft:[`left`,`bottom`],bottom:[`center`,`bottom`],bottomRight:[`right`,`bottom`],stretchTop:[`stretch`,`top`],stretchBottom:[`stretch`,`bottom`],stretchLeft:[`left`,`stretch`],stretchRight:[`right`,`stretch`],stretch:[`stretch`,`stretch`]},uc={start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`,stretch:`flex-start`},dc={start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`,between:`stretch`};function fc(e){let t=e.layout===`horizontal`,n={flexDirection:t?`row`:`column`,justifyContent:t?uc[e.alignX]:uc[e.alignY],alignItems:t?dc[e.alignY]:dc[e.alignX],gap:e.gap,padding:e.padding,borderRadius:e.radius,borderWidth:e.border,opacity:e.opacity};if(e.background!==void 0){let{r:t,g:r,b:i}=e.background;n.backgroundColor=e.backgroundOpacity<1?[t,r,i,e.backgroundOpacity]:e.background}e.borderColor!==void 0&&(n.borderColor=e.borderColor),e.color!==void 0&&(n.color=e.color),e.fontSize!==void 0&&(n.fontSize=e.fontSize),e.fontWeight!==void 0&&(n.fontWeight=e.fontWeight),e.textAlign!==void 0&&(n.textAlign=e.textAlign),e.text!==void 0&&(n.text=e.text),e.src!==void 0&&(n.src=e.src);let[r,i]=e.anchor?lc[e.anchor]:[void 0,void 0];return r===void 0||i===void 0?(e.width!==void 0&&(n.width=e.width),e.height!==void 0&&(n.height=e.height),n):(n.positionType=`absolute`,pc(n,r,e.x,`Left`,`Right`),pc(n,i,e.y,`Top`,`Bottom`),r!==`stretch`&&e.width!==void 0&&(n.width=e.width),i!==`stretch`&&e.height!==void 0&&(n.height=e.height),n)}function pc(e,t,n,r,i){if(t===`left`||t===`top`){e[`position${r}`]=n;return}if(t===`right`||t===`bottom`){e[`position${i}`]=n;return}if(t===`stretch`){e[`position${r}`]=n,e[`position${i}`]=n;return}e[`position${r}`]=n>=0?n*2:0,e[`position${i}`]=n>=0?0:n*-2,e[`margin${r}`]=`auto`,e[`margin${i}`]=`auto`}function mc(){let e=Xa.prototype;for(let t of[`anchor`,`x`,`y`,`width`,`height`,`layout`,`alignX`,`alignY`,`gap`,`padding`,`background`,`radius`,`border`,`borderColor`,`opacity`,`backgroundOpacity`,`color`,`fontSize`,`fontWeight`,`textAlign`])Object.defineProperty(e,t,{configurable:!0,get(){return sc(this)[t]},set(e){sc(this)[t]=e,cc(this)}});Object.defineProperty(e,"_rect",{configurable:!0,get(){return sc(this)}})}mc();function hc(e,t){let n=()=>{let n=gc(e);if(n){t(n);return}_c(e).addEventListener(`added`,r)},r=()=>{_c(e).removeEventListener(`added`,r),n()};e.addEventListener(`added`,r)}function gc(e){for(let t=e;t;t=t.parent)if(t.isScene)return t;return null}function _c(e){let t=e;for(;t.parent;)t=t.parent;return t}var vc=class extends de{elements=new Set;shown=new WeakMap;events;configured;reported=new Set;layout(e){this.update(e)}update(e){let t=ve.current?.renderer;t&&this.configure(t),this.events?.update();for(let n of this.elements)if(this.syncActivation(n),!(n.parent instanceof Xa)){if(n instanceof cs){if(!t)continue;if(!n.parent?.isCamera){this.report(`<Canvas> must be a child of the camera node — skipping its layout`);continue}let e=n;e.renderer!==t&&(e.renderer=t)}try{n.update(e*1e3)}catch(e){this.report(e instanceof Error?e.message:String(e))}}}onDestroy(){this.events?.destroy(),this.events=void 0,this.elements.clear(),this.configured=void 0}add(e){this.elements.add(e),e.addEventListener(`removed`,()=>{e.parent||this.elements.delete(e)})}syncActivation(e){let t=e.activeInHierarchy;this.shown.get(e)!==t&&(this.shown.set(e,t),cc(e))}configure(e){this.configured!==e&&(this.configured=e,this.events?.destroy(),e.localClippingEnabled=!0,e.setTransparentSort(_o),this.events=nc(e.domElement,()=>this.scene.mainCamera,this.scene))}report(e){this.reported.has(e)||(this.reported.add(e),console.error(`[scenoco] ui: ${e}`))}};function yc(e){hc(e,t=>{t.requireSystem(vc).add(e)}),cc(e)}var bc=class extends cs{constructor(){super(void 0),yc(this)}},xc=class extends Xo{constructor(){super(),yc(this)}},Sc=class extends os{constructor(){super(),yc(this)}get text(){return sc(this).text??``}set text(e){sc(this).text=e,cc(this)}},Cc=class extends Qo{constructor(){super(),yc(this)}get src(){return sc(this).src}set src(e){sc(this).src=e,cc(this)}},wc=S({Canvas:()=>bc,Image:()=>Cc,Panel:()=>xc,Text:()=>Sc,UIRenderer:()=>vc,toUikitProperties:()=>fc}),Tc=class extends ue{curve=4;exposure=1;apply({renderer:e}){e.toneMapping=this.curve,e.toneMappingExposure=this.exposure}},Ec=class extends ue{enabled=!0;type=2;apply({renderer:e}){e.shadowMap.enabled=this.enabled,e.shadowMap.type=this.type}},Dc={name:`LuminosityHighPassShader`,uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ce(0)},defaultOpacity:{value:0}},vertexShader:`
255
-
256
- varying vec2 vUv;
257
-
258
- void main() {
259
-
260
- vUv = uv;
261
-
262
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
263
-
264
- }`,fragmentShader:`
265
-
266
- uniform sampler2D tDiffuse;
267
- uniform vec3 defaultColor;
268
- uniform float defaultOpacity;
269
- uniform float luminosityThreshold;
270
- uniform float smoothWidth;
271
-
272
- varying vec2 vUv;
273
-
274
- void main() {
275
-
276
- vec4 texel = texture2D( tDiffuse, vUv );
277
-
278
- float v = luminance( texel.xyz );
279
-
280
- vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );
281
-
282
- float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );
283
-
284
- gl_FragColor = mix( outputColor, texel, alpha );
285
-
286
- }`},Oc=class e extends Ae{constructor(e,t=1,n,r){super(),this.strength=t,this.radius=n,this.threshold=r,this.resolution=e===void 0?new A(256,256):new A(e.x,e.y),this.clearColor=new Ce(0,0,0),this.needsSwap=!1,this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let i=Math.round(this.resolution.x/2),a=Math.round(this.resolution.y/2);this.renderTargetBright=new x(i,a,{type:u}),this.renderTargetBright.texture.name=`UnrealBloomPass.bright`,this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){let t=new x(i,a,{type:u});t.texture.name=`UnrealBloomPass.h`+e,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);let n=new x(i,a,{type:u});n.texture.name=`UnrealBloomPass.v`+e,n.texture.generateMipmaps=!1,this.renderTargetsVertical.push(n),i=Math.round(i/2),a=Math.round(a/2)}let o=Dc;this.highPassUniforms=l.clone(o.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new m({uniforms:this.highPassUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader}),this.separableBlurMaterials=[];let s=[6,10,14,18,22];i=Math.round(this.resolution.x/2),a=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this._getSeparableBlurMaterial(s[e])),this.separableBlurMaterials[e].uniforms.invSize.value=new A(1/i,1/a),i=Math.round(i/2),a=Math.round(a/2);this.compositeMaterial=this._getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1;let d=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=d,this.bloomTintColors=[new c(1,1,1),new c(1,1,1),new c(1,1,1),new c(1,1,1),new c(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,this.copyUniforms=l.clone(Oe.uniforms),this.blendMaterial=new m({uniforms:this.copyUniforms,vertexShader:Oe.vertexShader,fragmentShader:Oe.fragmentShader,premultipliedAlpha:!0,blending:2,depthTest:!1,depthWrite:!1,transparent:!0}),this._oldClearColor=new Ce,this._oldClearAlpha=1,this._basic=new ae,this._fsQuad=new je(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this._basic.dispose(),this._fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),r=Math.round(t/2);this.renderTargetBright.setSize(n,r);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(n,r),this.renderTargetsVertical[e].setSize(n,r),this.separableBlurMaterials[e].uniforms.invSize.value=new A(1/n,1/r),n=Math.round(n/2),r=Math.round(r/2)}render(t,n,r,i,a){t.getClearColor(this._oldClearColor),this._oldClearAlpha=t.getClearAlpha();let o=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),a&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this._fsQuad.material=this._basic,this._basic.map=r.texture,t.setRenderTarget(null),t.clear(),this._fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=r.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this._fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this._fsQuad.render(t);let s=this.renderTargetBright;for(let n=0;n<this.nMips;n++)this._fsQuad.material=this.separableBlurMaterials[n],this.separableBlurMaterials[n].uniforms.colorTexture.value=s.texture,this.separableBlurMaterials[n].uniforms.direction.value=e.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[n]),t.clear(),this._fsQuad.render(t),this.separableBlurMaterials[n].uniforms.colorTexture.value=this.renderTargetsHorizontal[n].texture,this.separableBlurMaterials[n].uniforms.direction.value=e.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[n]),t.clear(),this._fsQuad.render(t),s=this.renderTargetsVertical[n];this._fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this._fsQuad.render(t),this._fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,a&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this._fsQuad.render(t)):(t.setRenderTarget(r),this._fsQuad.render(t)),t.setClearColor(this._oldClearColor,this._oldClearAlpha),t.autoClear=o}_getSeparableBlurMaterial(e){let t=[],n=e/3;for(let r=0;r<e;r++)t.push(.39894*Math.exp(-.5*r*r/(n*n))/n);return new m({defines:{KERNEL_RADIUS:e},uniforms:{colorTexture:{value:null},invSize:{value:new A(.5,.5)},direction:{value:new A(.5,.5)},gaussianCoefficients:{value:t}},vertexShader:`
287
-
288
- varying vec2 vUv;
289
-
290
- void main() {
291
-
292
- vUv = uv;
293
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
294
-
295
- }`,fragmentShader:`
296
-
297
- #include <common>
298
-
299
- varying vec2 vUv;
300
-
301
- uniform sampler2D colorTexture;
302
- uniform vec2 invSize;
303
- uniform vec2 direction;
304
- uniform float gaussianCoefficients[KERNEL_RADIUS];
305
-
306
- void main() {
307
-
308
- float weightSum = gaussianCoefficients[0];
309
- vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;
310
-
311
- for ( int i = 1; i < KERNEL_RADIUS; i ++ ) {
312
-
313
- float x = float( i );
314
- float w = gaussianCoefficients[i];
315
- vec2 uvOffset = direction * invSize * x;
316
- vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;
317
- vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;
318
- diffuseSum += ( sample1 + sample2 ) * w;
319
-
320
- }
321
-
322
- gl_FragColor = vec4( diffuseSum, 1.0 );
323
-
324
- }`})}_getCompositeMaterial(e){return new m({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`
325
-
326
- varying vec2 vUv;
327
-
328
- void main() {
329
-
330
- vUv = uv;
331
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
332
-
333
- }`,fragmentShader:`
334
-
335
- varying vec2 vUv;
336
-
337
- uniform sampler2D blurTexture1;
338
- uniform sampler2D blurTexture2;
339
- uniform sampler2D blurTexture3;
340
- uniform sampler2D blurTexture4;
341
- uniform sampler2D blurTexture5;
342
- uniform float bloomStrength;
343
- uniform float bloomRadius;
344
- uniform float bloomFactors[NUM_MIPS];
345
- uniform vec3 bloomTintColors[NUM_MIPS];
346
-
347
- float lerpBloomFactor( const in float factor ) {
348
-
349
- float mirrorFactor = 1.2 - factor;
350
- return mix( factor, mirrorFactor, bloomRadius );
351
-
352
- }
353
-
354
- void main() {
355
-
356
- // 3.0 for backwards compatibility with previous alpha-based intensity
357
- vec3 bloom = 3.0 * bloomStrength * (
358
- lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +
359
- lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +
360
- lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +
361
- lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +
362
- lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb
363
- );
364
-
365
- float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );
366
- gl_FragColor = vec4( bloom, bloomAlpha );
367
-
368
- }`})}};Oc.BlurDirectionX=new A(1,0),Oc.BlurDirectionY=new A(0,1);var kc=class extends ue{strength=.6;radius=.4;threshold=.85;createPass(){return new Oc(new A(256,256),this.strength,this.radius,this.threshold)}},Ac={name:`VignetteShader`,uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:`
369
-
370
- varying vec2 vUv;
371
-
372
- void main() {
373
-
374
- vUv = uv;
375
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
376
-
377
- }`,fragmentShader:`
378
-
379
- uniform float offset;
380
- uniform float darkness;
381
-
382
- uniform sampler2D tDiffuse;
383
-
384
- varying vec2 vUv;
385
-
386
- void main() {
387
-
388
- // Eskil's vignette
389
-
390
- vec4 texel = texture2D( tDiffuse, vUv );
391
- vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );
392
- gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );
393
-
394
- }`},jc=class extends ue{offset=1;darkness=1;createPass(){let e=new ke(Ac);return e.uniforms.offset.value=this.offset,e.uniforms.darkness.value=this.darkness,e}},Mc=S({Bloom:()=>kc,Shadows:()=>Ec,ToneMapping:()=>Tc,Vignette:()=>jc}),Nc=class extends T{get duration(){return this.isLoaded?this.value?.duration??0:0}async fetch(){if(!Ic())return null;try{return await new ne().loadAsync(this.url)}catch(e){return console.error(`[scenoco] failed to load audio clip "${this.url}":`,e),null}}};function Pc(e){let t=Fc.get(e);return t||(t=ie(new Nc(e)),Fc.set(e,t)),t}var Fc=new Map;function Ic(){return typeof window<`u`&&`AudioContext`in window}var Lc=class extends de{volume=1;listener=null;attachedTo=null;appliedVolume=1;awake(){Ic()&&(this.listener=new le,this.listener.setMasterVolume(this.volume),this.appliedVolume=this.volume,window.addEventListener(`pointerdown`,this.resume),window.addEventListener(`keydown`,this.resume))}update(){let e=this.listener;if(!e)return;let t=this.scene.mainCamera;t&&t!==this.attachedTo&&(t.add(e),this.attachedTo=t),this.volume!==this.appliedVolume&&(e.setMasterVolume(this.volume),this.appliedVolume=this.volume)}onDestroy(){this.listener&&(window.removeEventListener(`pointerdown`,this.resume),window.removeEventListener(`keydown`,this.resume),this.listener.removeFromParent(),this.listener=null,this.attachedTo=null)}resume=()=>{let e=this.listener?.context;e?.state===`suspended`&&e.resume()}},Rc=class extends ge{clip;playOnAwake=!0;loop=!1;volume=1;pitch=1;spatial=!1;minDistance=1;maxDistance=1e4;audio=null;mixer=null;start(){if(!this.clip){console.error(`[scenoco] AudioSource has no clip. Point it at a sound file: <AudioSource clip="../audio/engine.ogg" />`);return}this.mixer=this.requireSystem(Lc);let e=this.mixer.listener;if(!e)return;let n=this.spatial?new t(e):new pe(e);n instanceof t&&(n.setRefDistance(this.minDistance),n.setMaxDistance(this.maxDistance),this.object3D.add(n)),n.setLoop(this.loop),n.setVolume(this.volume),n.setPlaybackRate(this.pitch),this.audio=n,this.playOnAwake&&this.play()}onDisable(){this.stop()}onDestroy(){let e=this.audio;e&&(e.isPlaying&&e.stop(),e.disconnect(),e.removeFromParent(),this.audio=null,this.mixer=null)}get isPlaying(){return this.audio?.isPlaying??!1}play(){let e=this.buffer();!e||!this.audio||(this.audio.isPlaying&&this.audio.stop(),this.audio.setBuffer(e),this.audio.play())}stop(){this.audio?.isPlaying&&this.audio.stop()}pause(){this.audio?.isPlaying&&this.audio.pause()}playOneShot(e=this.clip,n=1){let r=this.mixer?.listener,i=e?.isLoaded?e.value:null;if(!r||!i)return;let a=this.spatial?new t(r):new pe(r);a instanceof t&&(a.setRefDistance(this.minDistance),a.setMaxDistance(this.maxDistance),this.object3D.add(a)),a.setBuffer(i),a.setVolume(this.volume*n),a.setPlaybackRate(this.pitch),a.onEnded=()=>{a.disconnect(),a.removeFromParent()},a.play()}setVolume(e){this.volume=e,this.audio?.setVolume(e)}buffer(){return this.clip?.isLoaded?this.clip.value:null}},zc=S({AudioClip:()=>Nc,AudioMixer:()=>Lc,AudioSource:()=>Rc,hasWebAudio:()=>Ic,sharedClip:()=>Pc}),Bc=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`),Vc=1234567,Hc=Math.PI/180,Uc=180/Math.PI;function Wc(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Bc[e&255]+Bc[e>>8&255]+Bc[e>>16&255]+Bc[e>>24&255]+`-`+Bc[t&255]+Bc[t>>8&255]+`-`+Bc[t>>16&15|64]+Bc[t>>24&255]+`-`+Bc[n&63|128]+Bc[n>>8&255]+`-`+Bc[n>>16&255]+Bc[n>>24&255]+Bc[r&255]+Bc[r>>8&255]+Bc[r>>16&255]+Bc[r>>24&255]).toLowerCase()}function Gc(e,t,n){return Math.max(t,Math.min(n,e))}function Kc(e,t){return(e%t+t)%t}function qc(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Jc(e,t,n){return e===t?0:(n-e)/(t-e)}function Yc(e,t,n){return(1-n)*e+n*t}function Xc(e,t,n,r){return Yc(e,t,1-Math.exp(-n*r))}function Zc(e,t=1){return t-Math.abs(Kc(e,t*2)-t)}function Qc(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function $c(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function el(e,t){return e+Math.floor(Math.random()*(t-e+1))}function tl(e,t){return e+Math.random()*(t-e)}function nl(e){return e*(.5-Math.random())}function rl(e){e!==void 0&&(Vc=e);let t=Vc+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function il(e){return e*Hc}function al(e){return e*Uc}function ol(e){return(e&e-1)==0&&e!==0}function sl(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function cl(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function ll(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:console.warn(`../math.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function ul(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function dl(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var fl={DEG2RAD:Hc,RAD2DEG:Uc,generateUUID:Wc,clamp:Gc,euclideanModulo:Kc,mapLinear:qc,inverseLerp:Jc,lerp:Yc,damp:Xc,pingpong:Zc,smoothstep:Qc,smootherstep:$c,randInt:el,randFloat:tl,randFloatSpread:nl,seededRandom:rl,degToRad:il,radToDeg:al,isPowerOfTwo:ol,ceilPowerOfTwo:sl,floorPowerOfTwo:cl,setQuaternionFromProperEuler:ll,normalize:dl,denormalize:ul},pl=class e{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o===0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=1-o,t=s*d+c*f+l*p+u*m,n=t>=0?1:-1,r=1-t*t;if(r>2**-52){let i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}let i=o*n;if(s=s*e+d*i,c=c*e+f*i,l=l*e+p*i,u=u*e+m*i,e===1-o){let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new e(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:console.warn(`../math.Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<2**-52?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Gc(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;let s=1-o*o;if(s<=2**-52){let e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}let c=Math.sqrt(s),l=Math.atan2(c,o),u=Math.sin((1-t)*l)/c,d=Math.sin(t*l)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},F=class e{constructor(t=0,n=0,r=0){this.isVector3=!0,e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(hl.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(hl.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ml.copy(this).projectOnVector(e),this.sub(ml)}reflect(e){return this.sub(ml.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Gc(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},ml=new F,hl=new pl,gl=2e3,_l=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){this.isMatrix4=!0,e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}extractPosition(e){return console.warn(`THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().`),this.copyPosition(e)}multiplyToArray(e,t,n){return console.error(`THREE.Matrix4: .multiplyToArray() has been removed.`),this}setRotationFromQuaternion(e){return this.makeRotationFromQuaternion(e)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/vl.setFromMatrixColumn(e,0).length(),i=1/vl.setFromMatrixColumn(e,1).length(),a=1/vl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(bl,e,xl)}lookAt(e,t,n){let r=this.elements;return wl.subVectors(e,t),wl.lengthSq()===0&&(wl.z=1),wl.normalize(),Sl.crossVectors(n,wl),Sl.lengthSq()===0&&(Math.abs(n.z)===1?wl.x+=1e-4:wl.z+=1e-4,wl.normalize(),Sl.crossVectors(n,wl)),Sl.normalize(),Cl.crossVectors(wl,Sl),r[0]=Sl.x,r[4]=Cl.x,r[8]=wl.x,r[1]=Sl.y,r[5]=Cl.y,r[9]=wl.y,r[2]=Sl.z,r[6]=Cl.z,r[10]=wl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],ee=r[2],te=r[6],ne=r[10],re=r[14],ie=r[3],ae=r[7],oe=r[11],se=r[15];return i[0]=a*x+o*T+s*ee+c*ie,i[4]=a*S+o*E+s*te+c*ae,i[8]=a*C+o*D+s*ne+c*oe,i[12]=a*w+o*O+s*re+c*se,i[1]=l*x+u*T+d*ee+f*ie,i[5]=l*S+u*E+d*te+f*ae,i[9]=l*C+u*D+d*ne+f*oe,i[13]=l*w+u*O+d*re+f*se,i[2]=p*x+m*T+h*ee+g*ie,i[6]=p*S+m*E+h*te+g*ae,i[10]=p*C+m*D+h*ne+g*oe,i[14]=p*w+m*O+h*re+g*se,i[3]=_*x+v*T+y*ee+b*ie,i[7]=_*S+v*E+y*te+b*ae,i[11]=_*C+v*D+y*ne+b*oe,i[15]=_*w+v*O+y*re+b*se,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=vl.set(r[0],r[1],r[2]).length(),a=vl.set(r[4],r[5],r[6]).length(),o=vl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],yl.copy(this);let s=1/i,c=1/a,l=1/o;return yl.elements[0]*=s,yl.elements[1]*=s,yl.elements[2]*=s,yl.elements[4]*=c,yl.elements[5]*=c,yl.elements[6]*=c,yl.elements[8]*=l,yl.elements[9]*=l,yl.elements[10]*=l,t.setFromRotationMatrix(yl),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=gl){let s=this.elements,c=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),d=(n+r)/(n-r),f,p;if(o===2e3)f=-(a+i)/(a-i),p=-2*a*i/(a-i);else if(o===2001)f=-a/(a-i),p=-a*i/(a-i);else throw Error(`Matrix4.makePerspective(): Invalid coordinate system: `+o);return s[0]=c,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=l,s[9]=d,s[13]=0,s[2]=0,s[6]=0,s[10]=f,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=gl){let s=this.elements,c=1/(t-e),l=1/(n-r),u=1/(a-i),d=(t+e)*c,f=(n+r)*l,p,m;if(o===2e3)p=(a+i)*u,m=-2*u;else if(o===2001)p=i*u,m=-1*u;else throw Error(`../math.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return s[0]=2*c,s[4]=0,s[8]=0,s[12]=-d,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-f,s[2]=0,s[6]=0,s[10]=m,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},vl=new F,yl=new _l,bl=new F(0,0,0),xl=new F(1,1,1),Sl=new F,Cl=new F,wl=new F,Tl=new _l,El=new pl,Dl=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new e(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(Gc(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-Gc(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(Gc(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-Gc(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(Gc(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-Gc(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:console.warn(`../math.Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Tl.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Tl,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return El.setFromEuler(this),this.setFromQuaternion(El,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(e){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Dl.DEFAULT_ORDER=`XYZ`;var Ol=class e{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new e(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Gc(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Ol.isVector2=!0;var kl=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new e(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Al=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(jl.makeScale(e,t)),this}rotate(e){return this.premultiply(jl.makeRotation(-e)),this}translate(e,t){return this.premultiply(jl.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new e().fromArray(this.elements)}},jl=new Al,Ml;(function(e){e[e.Random=0]=`Random`,e[e.Loop=1]=`Loop`,e[e.PingPong=2]=`PingPong`,e[e.Burst=3]=`Burst`})(Ml||={});function Nl(e,t,n,r){let i;switch(Ml.Random===e?t=Math.random():Ml.Burst===e&&r.isBursting&&(t=r.burstParticleIndex/r.burstParticleCount),i=n>0?Math.floor(t/n)*n:t,e){case Ml.Loop:i%=1;break;case Ml.PingPong:i=Math.abs(i%2-1);break}return i}var Pl=class e{constructor(e,t,n,r){this.p=[e,t,n,r]}genValue(e){let t=e*e,n=e*e*e,r=1-e,i=r*r,a=i*r;return this.p[0]*a+this.p[1]*i*e*3+this.p[2]*r*t*3+this.p[3]*n}derivativeCoefficients(e){let t=[];for(let n=e,r=n.length-1;r>0;r--){let e=[];for(let t=0;t<r;t++){let i=r*(n[t+1]-n[t]);e.push(i)}t.push(e),n=e}return t}getSlope(e){let t=this.derivativeCoefficients(this.p)[0],n=1-e,r=n*n,i=n*e*2,a=e*e;return r*t[0]+i*t[1]+a*t[2]}controlCurve(e,t){this.p[1]=e/3+this.p[0],this.p[2]=this.p[3]-t/3}hull(e){let t=this.p,n=[],r,i=0,a=0,o=0,s=[];for(s[i++]=t[0],s[i++]=t[1],s[i++]=t[2],s[i++]=t[3];t.length>1;){for(n=[],a=0,o=t.length-1;a<o;a++)r=e*t[a]+(1-e)*t[a+1],s[i++]=r,n.push(r);t=n}return s}split(t){let n=this.hull(t);return{left:new e(n[0],n[4],n[7],n[9]),right:new e(n[9],n[8],n[6],n[3]),span:n}}clone(){return new e(this.p[0],this.p[1],this.p[2],this.p[3])}toJSON(){return{p0:this.p[0],p1:this.p[1],p2:this.p[2],p3:this.p[3]}}static fromJSON(t){return new e(t.p0,t.p1,t.p2,t.p3)}},Fl=e=>({r:e.x,g:e.y,b:e.z,a:e.w}),Il=e=>new kl(e.r,e.g,e.b,e.a),Ll=(e,t)=>{switch(t){case`Vector3`:return new F(e.x,e.y,e.z);case`Vector4`:return new kl(e.x,e.y,e.z,e.w);case`Color`:return new F(e.r,e.g,e.b);case`Number`:return e;default:return e}},Rl=(e,t)=>{switch(t){case`Vector3`:return{x:e.x,y:e.y,z:e.z};case`Vector4`:return{x:e.x,y:e.y,z:e.z,w:e.w};case`Color`:return{r:e.x,g:e.y,b:e.z};case`Number`:return e;default:return e}},zl=class e{constructor(e,t){this.a=e,this.b=t,this.type=`value`}startGen(e){}genColor(e,t){let n=Math.random();return t.copy(this.a).lerp(this.b,n)}toJSON(){return{type:`RandomColor`,a:Fl(this.a),b:Fl(this.b)}}static fromJSON(t){return new e(Il(t.a),Il(t.b))}clone(){return new e(this.a.clone(),this.b.clone())}},Bl=class e{constructor(e,t){this.a=e,this.b=t,this.indexCount=-1,this.type=`value`}startGen(e){this.indexCount=e.length,e.push(Math.random())}genColor(e,t){return this.indexCount===-1&&this.startGen(e),t.copy(this.a).lerp(this.b,e[this.indexCount])}toJSON(){return{type:`ColorRange`,a:Fl(this.a),b:Fl(this.b)}}static fromJSON(t){return new e(Il(t.a),Il(t.b))}clone(){return new e(this.a.clone(),this.b.clone())}},Vl=class e{constructor(e,t){this.subType=t,this.type=`function`,this.keys=e}findKey(e){let t=0,n=0,r=this.keys.length-1;for(;n+1<r;)if(t=Math.floor((n+r)/2),e<this.getStartX(t))r=t-1;else if(e>this.getEndX(t))n=t+1;else return t;for(let t=n;t<=r;t++)if(e>=this.getStartX(t)&&e<=this.getEndX(t))return t;return-1}getStartX(e){return this.keys[e][1]}getEndX(e){return e+1<this.keys.length?this.keys[e+1][1]:1}genValue(e,t){let n=this.findKey(t);return this.subType===`Number`?n===-1?this.keys[0][0]:n+1>=this.keys.length?this.keys[this.keys.length-1][0]:(this.keys[n+1][0]-this.keys[n][0])*((t-this.getStartX(n))/(this.getEndX(n)-this.getStartX(n)))+this.keys[n][0]:n===-1?e.copy(this.keys[0][0]):n+1>=this.keys.length?e.copy(this.keys[this.keys.length-1][0]):e.copy(this.keys[n][0]).lerp(this.keys[n+1][0],(t-this.getStartX(n))/(this.getEndX(n)-this.getStartX(n)))}toJSON(){return this.keys[0][0].constructor.name,{type:`CLinearFunction`,subType:this.subType,keys:this.keys.map(([e,t])=>({value:Rl(e,this.subType),pos:t}))}}static fromJSON(t){return new e(t.keys.map(e=>[Ll(e.value,t.subType),e.pos]),t.subType)}clone(){return this.subType===`Number`?new e(this.keys.map(([e,t])=>[e,t]),this.subType):new e(this.keys.map(([e,t])=>[e.clone(),t]),this.subType)}},Hl=new F,Ul=class e{constructor(e=[[new F(0,0,0),0],[new F(1,1,1),0]],t=[[1,0],[1,1]]){this.type=`function`,this.color=new Vl(e,`Color`),this.alpha=new Vl(t,`Number`)}genColor(e,t,n){return this.color.genValue(Hl,n),t.set(Hl.x,Hl.y,Hl.z,this.alpha.genValue(1,n))}toJSON(){return{type:`Gradient`,color:this.color.toJSON(),alpha:this.alpha.toJSON()}}static fromJSON(t){if(t.functions){let n=t.functions.map(e=>[Bl.fromJSON(e.function).a,e.start]);return t.functions.length>0&&n.push([Bl.fromJSON(t.functions[t.functions.length-1].function).b,1]),new e(n.map(e=>[new F(e[0].x,e[0].y,e[0].z),e[1]]),n.map(e=>[e[0].w,e[1]]))}else{let n=new e;return n.alpha=Vl.fromJSON(t.alpha),n.color=Vl.fromJSON(t.color),n}}clone(){let t=new e;return t.alpha=this.alpha.clone(),t.color=this.color.clone(),t}startGen(e){}},Wl=new kl,Gl=class e{constructor(e,t){this.indexCount=0,this.type=`function`,this.gradient1=e,this.gradient2=t}startGen(e){this.indexCount=e.length,e.push(Math.random())}genColor(e,t,n){return this.gradient1.genColor(e,t,n),this.gradient2.genColor(e,Wl,n),e&&e[this.indexCount]!==void 0?t.lerp(Wl,e[this.indexCount]):t.lerp(Wl,Math.random()),t}toJSON(){return{type:`RandomColorBetweenGradient`,gradient1:this.gradient1.toJSON(),gradient2:this.gradient2.toJSON()}}static fromJSON(t){return new e(Ul.fromJSON(t.gradient1),Ul.fromJSON(t.gradient2))}clone(){return new e(this.gradient1.clone(),this.gradient2.clone())}},Kl=class e{constructor(e){this.color=e,this.type=`value`}startGen(e){}genColor(e,t){return t.copy(this.color)}toJSON(){return{type:`ConstantColor`,color:Fl(this.color)}}static fromJSON(t){return new e(Il(t.color))}clone(){return new e(this.color.clone())}};function ql(e){switch(e.type){case`ConstantColor`:return Kl.fromJSON(e);case`ColorRange`:return Bl.fromJSON(e);case`RandomColor`:return zl.fromJSON(e);case`Gradient`:return Ul.fromJSON(e);case`RandomColorBetweenGradient`:return Gl.fromJSON(e);default:return new Kl(new kl(1,1,1,1))}}var I=class e{constructor(e){this.value=e,this.type=`value`}startGen(e){}genValue(e){return this.value}toJSON(){return{type:`ConstantValue`,value:this.value}}static fromJSON(t){return new e(t.value)}clone(){return new e(this.value)}},Jl=class e{constructor(e,t){this.a=e,this.b=t,this.indexCount=-1,this.type=`value`}startGen(e){this.indexCount=e.length,e.push(Math.random())}genValue(e){return this.indexCount===-1&&this.startGen(e),fl.lerp(this.a,this.b,e[this.indexCount])}toJSON(){return{type:`IntervalValue`,a:this.a,b:this.b}}static fromJSON(t){return new e(t.a,t.b)}clone(){return new e(this.a,this.b)}},Yl=class{constructor(){this.functions=[]}findFunction(e){let t=0,n=0,r=this.functions.length-1;for(;n+1<r;)if(t=Math.floor((n+r)/2),e<this.getStartX(t))r=t-1;else if(e>this.getEndX(t))n=t+1;else return t;for(let t=n;t<=r;t++)if(e>=this.functions[t][1]&&e<=this.getEndX(t))return t;return-1}getStartX(e){return this.functions[e][1]}setStartX(e,t){e>0&&(this.functions[e][1]=t)}getEndX(e){return e+1<this.functions.length?this.functions[e+1][1]:1}setEndX(e,t){e+1<this.functions.length&&(this.functions[e+1][1]=t)}insertFunction(e,t){let n=this.findFunction(e);this.functions.splice(n+1,0,[t,e])}removeFunction(e){return this.functions.splice(e,1)[0][0]}getFunction(e){return this.functions[e][0]}setFunction(e,t){this.functions[e][0]=t}get numOfFunctions(){return this.functions.length}},Xl=class e extends Yl{constructor(e=[[new Pl(0,1/3,1/3*2,1),0]]){super(),this.type=`function`,this.functions=e}genValue(e,t=0){let n=this.findFunction(t);return n===-1?0:this.functions[n][0].genValue((t-this.getStartX(n))/(this.getEndX(n)-this.getStartX(n)))}toSVG(e,t){if(t<1)return``;let n=[`M`,0,this.functions[0][0].p[0]].join(` `);for(let r=1/t;r<=1;r+=1/t)n=[n,`L`,r*e,this.genValue(void 0,r)].join(` `);return n}toJSON(){return{type:`PiecewiseBezier`,functions:this.functions.map(([e,t])=>({function:e.toJSON(),start:t}))}}static fromJSON(t){return new e(t.functions.map(e=>[Pl.fromJSON(e.function),e.start]))}clone(){return new e(this.functions.map(([e,t])=>[e.clone(),t]))}startGen(e){}};function L(e){switch(e.type){case`ConstantValue`:return I.fromJSON(e);case`IntervalValue`:return Jl.fromJSON(e);case`PiecewiseBezier`:return Xl.fromJSON(e);default:return new I(0)}}var Zl=class e{constructor(){this.indexCount=0,this.type=`rotation`}startGen(e){this.indexCount=e.length,e.push(new pl);let t,n,r,i,a,o;do t=Math.random()*2-1,n=Math.random()*2-1,r=t*t+n*n;while(r>1);do i=Math.random()*2-1,a=Math.random()*2-1,o=i*i+a*a;while(o>1);let s=Math.sqrt((1-r)/o);e[this.indexCount].set(t,n,s*i,s*a)}genValue(e,t,n,r){return this.indexCount===-1&&this.startGen(e),t.copy(e[this.indexCount]),t}toJSON(){return{type:`RandomQuat`}}static fromJSON(t){return new e}clone(){return new e}},Ql=class e{constructor(e,t){this.axis=e,this.angle=t,this.type=`rotation`}startGen(e){this.angle.startGen(e)}genValue(e,t,n,r){return t.setFromAxisAngle(this.axis,this.angle.genValue(e,r)*n)}toJSON(){return{type:`AxisAngle`,axis:{x:this.axis.x,y:this.axis.y,z:this.axis.z},angle:this.angle.toJSON()}}static fromJSON(t){return new e(new F(t.axis.x,t.axis.y,t.axis.z),L(t.angle))}clone(){return new e(this.axis.clone(),this.angle.clone())}},$l=class e{constructor(e,t,n,r){this.angleX=e,this.angleY=t,this.angleZ=n,this.type=`rotation`,this.eular=new Dl(0,0,0,r)}startGen(e){this.angleX.startGen(e),this.angleY.startGen(e),this.angleZ.startGen(e)}genValue(e,t,n,r){return this.eular.set(this.angleX.genValue(e,r)*n,this.angleY.genValue(e,r)*n,this.angleZ.genValue(e,r)*n),t.setFromEuler(this.eular)}toJSON(){return{type:`Euler`,angleX:this.angleX.toJSON(),angleY:this.angleY.toJSON(),angleZ:this.angleZ.toJSON(),eulerOrder:this.eular.order}}static fromJSON(t){return new e(L(t.angleX),L(t.angleY),L(t.angleZ),t.eulerOrder)}clone(){return new e(this.angleX,this.angleY,this.angleZ,this.eular.order)}};function eu(e){switch(e.type){case`AxisAngle`:return Ql.fromJSON(e);case`Euler`:return $l.fromJSON(e);case`RandomQuat`:return Zl.fromJSON(e);default:return new Zl}}var tu=class e{constructor(e,t,n){this.x=e,this.y=t,this.z=n,this.type=`vec3function`}startGen(e){this.x.startGen(e),this.y.startGen(e),this.z.startGen(e)}genValue(e,t,n){return t.set(this.x.genValue(e,n),this.y.genValue(e,n),this.z.genValue(e,n))}toJSON(){return{type:`Vector3Function`,x:this.x.toJSON(),y:this.y.toJSON(),z:this.z.toJSON()}}static fromJSON(t){return new e(L(t.x),L(t.y),L(t.z))}clone(){return new e(this.x,this.y,this.z)}};function nu(e){switch(e.type){case`Vector3Function`:return tu.fromJSON(e);default:return new tu(new I(0),new I(0),new I(0))}}function ru(e){switch(e.type){case`ConstantValue`:case`IntervalValue`:case`PiecewiseBezier`:return L(e);case`AxisAngle`:case`RandomQuat`:case`Euler`:return eu(e);case`Vector3Function`:return nu(e);default:return new I(0)}}var iu=class e{constructor(e={}){this.type=`cone`,this.currentValue=0,this.radius=e.radius??10,this.arc=e.arc??2*Math.PI,this.thickness=e.thickness??1,this.angle=e.angle??Math.PI/6,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[]}update(e,t){Ml.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t)}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t),r=fl.lerp(1-this.thickness,1,Math.random()),i=n*this.arc,a=Math.sqrt(r),o=Math.sin(i),s=Math.cos(i);e.position.x=a*s,e.position.y=a*o,e.position.z=0;let c=this.angle*a;e.velocity.set(0,0,Math.cos(c)).addScaledVector(e.position,Math.sin(c)).multiplyScalar(e.startSpeed),e.position.multiplyScalar(this.radius)}toJSON(){return{type:`cone`,radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({radius:t.radius,arc:t.arc,thickness:t.thickness,angle:t.angle,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}},au=class e{constructor(e={}){this.type=`circle`,this.currentValue=0,this.radius=e.radius??10,this.arc=e.arc??2*Math.PI,this.thickness=e.thickness??1,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[]}update(e,t){this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t),r=fl.lerp(1-this.thickness,1,Math.random()),i=n*this.arc;e.position.x=Math.cos(i),e.position.y=Math.sin(i),e.position.z=0,e.velocity.copy(e.position).multiplyScalar(e.startSpeed),e.position.multiplyScalar(this.radius*r)}toJSON(){return{type:`circle`,radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}};function ou(e,t){return Math.floor(Math.random()*(t-e))+e}var su=new F(0,1,0),cu=new F(0,0,0),lu=new F(1,1,1),uu=new F(0,0,1),du=class e{constructor(e={}){this.type=`donut`,this.currentValue=0,this.radius=e.radius??10,this.arc=e.arc??2*Math.PI,this.thickness=e.thickness??1,this.donutRadius=e.donutRadius??this.radius*.2,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[],this._m1=new _l}update(e,t){Ml.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t)}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t),r=Math.random(),i=fl.lerp(1-this.thickness,1,Math.random()),a=n*this.arc,o=r*Math.PI*2,s=Math.sin(a),c=Math.cos(a);if(e.position.x=this.radius*c,e.position.y=this.radius*s,e.position.z=0,e.velocity.z=this.donutRadius*i*Math.sin(o),e.velocity.x=this.donutRadius*i*Math.cos(o)*c,e.velocity.y=this.donutRadius*i*Math.cos(o)*s,e.position.add(e.velocity),e.velocity.normalize().multiplyScalar(e.startSpeed),e.rotation instanceof pl){let t=e.rotation;t.x===0&&t.y===0&&t.z===0&&t.w===1&&(this._m1.lookAt(cu,e.velocity,su),e.rotation.setFromRotationMatrix(this._m1))}}toJSON(){return{type:`donut`,radius:this.radius,arc:this.arc,thickness:this.thickness,donutRadius:this.donutRadius,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({radius:t.radius,arc:t.arc,thickness:t.thickness,donutRadius:t.donutRadius,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({radius:this.radius,arc:this.arc,thickness:this.thickness,donutRadius:this.donutRadius,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}},fu=class e{constructor(){this.type=`point`,this._m1=new _l}update(e,t){}initialize(e){let t=Math.random(),n=Math.random(),r=t*Math.PI*2,i=Math.acos(2*n-1),a=Math.cbrt(Math.random()),o=Math.sin(r),s=Math.cos(r),c=Math.sin(i),l=Math.cos(i);if(e.velocity.x=a*c*s,e.velocity.y=a*c*o,e.velocity.z=a*l,e.velocity.multiplyScalar(e.startSpeed),e.position.setScalar(0),e.rotation instanceof pl){let t=e.rotation;t.x===0&&t.y===0&&t.z===0&&t.w===1&&(this._m1.lookAt(cu,e.velocity,su),e.rotation.setFromRotationMatrix(this._m1))}}toJSON(){return{type:`point`}}static fromJSON(t){return new e}clone(){return new e}},pu=class e{constructor(e={}){this.type=`sphere`,this.currentValue=0,this.radius=e.radius??10,this.arc=e.arc??2*Math.PI,this.thickness=e.thickness??1,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[],this._m1=new _l}update(e,t){Ml.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t)}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t),r=Math.random(),i=fl.lerp(1-this.thickness,1,Math.random()),a=n*this.arc,o=Math.acos(2*r-1),s=Math.sin(a),c=Math.cos(a),l=Math.sin(o),u=Math.cos(o);if(e.position.x=l*c,e.position.y=l*s,e.position.z=u,e.velocity.copy(e.position).multiplyScalar(e.startSpeed),e.position.multiplyScalar(this.radius*i),e.rotation instanceof pl){let t=e.rotation;t.x===0&&t.y===0&&t.z===0&&t.w===1&&(this._m1.lookAt(cu,e.position,su),e.rotation.setFromRotationMatrix(this._m1))}}toJSON(){return{type:`sphere`,radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}},mu=class e{constructor(e={}){this.type=`hemisphere`,this.currentValue=0,this.radius=e.radius??10,this.arc=e.arc??2*Math.PI,this.thickness=e.thickness??1,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[],this._m1=new _l}update(e,t){Ml.Random!=this.mode&&(this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t)}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t),r=Math.random(),i=fl.lerp(1-this.thickness,1,Math.random()),a=n*this.arc,o=Math.acos(r),s=Math.sin(a),c=Math.cos(a),l=Math.sin(o),u=Math.cos(o);if(e.position.x=l*c,e.position.y=l*s,e.position.z=u,e.velocity.copy(e.position).multiplyScalar(e.startSpeed),e.position.multiplyScalar(this.radius*i),e.rotation instanceof pl){let t=e.rotation;t.x===0&&t.y===0&&t.z===0&&t.w===1&&(this._m1.lookAt(cu,e.position,su),e.rotation.setFromRotationMatrix(this._m1))}}toJSON(){return{type:`hemisphere`,radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({radius:t.radius,arc:t.arc,thickness:t.thickness,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({radius:this.radius,arc:this.arc,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}},hu=class e{constructor(e={}){this.type=`grid`,this.width=e.width??1,this.height=e.height??1,this.column=e.column??10,this.row=e.row??10}initialize(e){let t=Math.floor(Math.random()*this.row),n=Math.floor(Math.random()*this.column);e.position.x=n*this.width/this.column-this.width/2,e.position.y=t*this.height/this.row-this.height/2,e.position.z=0,e.velocity.set(0,0,e.startSpeed)}toJSON(){return{type:`grid`,width:this.width,height:this.height,column:this.column,row:this.row}}static fromJSON(t){return new e(t)}clone(){return new e({width:this.width,height:this.height,column:this.column,row:this.row})}update(e,t){}},gu=class e{constructor(e={}){this.type=`rectangle`,this.currentValue=0,this.width=e.width??10,this.height=e.height??10,this.thickness=e.thickness??1,this.mode=e.mode??Ml.Random,this.spread=e.spread??0,this.speed=e.speed??new I(1),this.memory=[],this._m1=new _l}update(e,t){this.currentValue+=this.speed.genValue(this.memory,e.emissionState.time/e.duration)*t}initialize(e,t){let n=Nl(this.mode,this.currentValue,this.spread,t)*(2*(this.width+this.height)),r,i;n<this.width?(r=n-this.width/2,i=-this.height/2):n<this.width+this.height?(r=this.width/2,i=n-this.width-this.height/2):n<2*this.width+this.height?(r=this.width/2-(n-this.width-this.height),i=this.height/2):(r=-this.width/2,i=this.height/2-(n-2*this.width-this.height));let a=Math.random(),o=1-this.thickness*a;if(e.position.x=r*o,e.position.y=i*o,e.position.z=0,e.velocity.x=r,e.velocity.y=i,e.velocity.z=0,e.velocity.normalize().multiplyScalar(e.startSpeed),e.rotation instanceof pl){let t=e.rotation;t.x===0&&t.y===0&&t.z===0&&t.w===1&&(this._m1.lookAt(cu,e.velocity,su),e.rotation.setFromRotationMatrix(this._m1))}}toJSON(){return{type:`rectangle`,width:this.width,height:this.height,thickness:this.thickness,mode:this.mode,spread:this.spread,speed:this.speed.toJSON()}}static fromJSON(t){return new e({width:t.width,height:t.height,thickness:t.thickness,mode:t.mode,speed:t.speed?L(t.speed):void 0,spread:t.spread})}clone(){return new e({width:this.width,height:this.height,thickness:this.thickness,mode:this.mode,speed:this.speed.clone(),spread:this.spread})}},_u={circle:{type:`circle`,params:[[`radius`,[`number`]],[`arc`,[`radian`]],[`thickness`,[`number`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:au,loadJSON:au.fromJSON},cone:{type:`cone`,params:[[`radius`,[`number`]],[`arc`,[`radian`]],[`thickness`,[`number`]],[`angle`,[`radian`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:iu,loadJSON:iu.fromJSON},donut:{type:`donut`,params:[[`radius`,[`number`]],[`arc`,[`radian`]],[`thickness`,[`number`]],[`donutRadius`,[`number`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:du,loadJSON:du.fromJSON},point:{type:`point`,params:[],constructor:fu,loadJSON:fu.fromJSON},sphere:{type:`sphere`,params:[[`radius`,[`number`]],[`arc`,[`radian`]],[`thickness`,[`number`]],[`angle`,[`radian`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:pu,loadJSON:pu.fromJSON},hemisphere:{type:`hemisphere`,params:[[`radius`,[`number`]],[`arc`,[`radian`]],[`thickness`,[`number`]],[`angle`,[`radian`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:mu,loadJSON:mu.fromJSON},grid:{type:`grid`,params:[[`width`,[`number`]],[`height`,[`number`]],[`rows`,[`number`]],[`column`,[`number`]]],constructor:hu,loadJSON:hu.fromJSON},rectangle:{type:`rectangle`,params:[[`width`,[`number`]],[`height`,[`number`]],[`thickness`,[`number`]],[`mode`,[`emitterMode`]],[`spread`,[`number`]],[`speed`,[`valueFunc`,`value`]]],constructor:gu,loadJSON:gu.fromJSON}};function vu(e,t){return _u[e.type].loadJSON(e,t)}var yu=class e{constructor(e){this.color=e,this.type=`ColorOverLife`}initialize(e){this.color.startGen(e.memory)}update(e,t){this.color.genColor(e.memory,e.color,e.age/e.life),e.color.x*=e.startColor.x,e.color.y*=e.startColor.y,e.color.z*=e.startColor.z,e.color.w*=e.startColor.w}frameUpdate(e){}toJSON(){return{type:this.type,color:this.color.toJSON()}}static fromJSON(t){return new e(ql(t.color))}clone(){return new e(this.color.clone())}reset(){}},bu=class e{constructor(e){this.angularVelocity=e,this.type=`RotationOverLife`}initialize(e){typeof e.rotation==`number`&&this.angularVelocity.startGen(e.memory)}update(e,t){typeof e.rotation==`number`&&(e.rotation+=t*this.angularVelocity.genValue(e.memory,e.age/e.life))}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON()}}static fromJSON(t){return new e(L(t.angularVelocity))}frameUpdate(e){}clone(){return new e(this.angularVelocity.clone())}reset(){}},xu=class e{constructor(e){this.angularVelocity=e,this.type=`Rotation3DOverLife`,this.tempQuat=new pl,this.tempQuat2=new pl}initialize(e){e.rotation instanceof pl&&(e.angularVelocity=new pl,this.angularVelocity.startGen(e.memory))}update(e,t){e.rotation instanceof pl&&(this.angularVelocity.genValue(e.memory,this.tempQuat,t,e.age/e.life),e.rotation.multiply(this.tempQuat))}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON()}}static fromJSON(t){return new e(eu(t.angularVelocity))}frameUpdate(e){}clone(){return new e(this.angularVelocity.clone())}reset(){}},Su=class e{initialize(e,t){this.ps=t,this.x.startGen(e.memory),this.y.startGen(e.memory),this.z.startGen(e.memory)}constructor(e,t,n){this.x=e,this.y=t,this.z=n,this.type=`ForceOverLife`,this._temp=new F,this._tempScale=new F,this._tempQ=new pl}update(e,t){this._temp.set(this.x.genValue(e.memory,e.age/e.life),this.y.genValue(e.memory,e.age/e.life),this.z.genValue(e.memory,e.age/e.life)),this.ps.worldSpace||this._temp.multiply(this._tempScale).applyQuaternion(this._tempQ),e.velocity.addScaledVector(this._temp,t)}toJSON(){return{type:this.type,x:this.x.toJSON(),y:this.y.toJSON(),z:this.z.toJSON()}}static fromJSON(t){return new e(L(t.x),L(t.y),L(t.z))}frameUpdate(e){if(this.ps&&!this.ps.worldSpace){let e=this._temp,t=this._tempQ,n=this._tempScale;this.ps.emitter.matrixWorld.decompose(e,t,n),t.invert(),n.set(1/n.x,1/n.y,1/n.z)}}clone(){return new e(this.x.clone(),this.y.clone(),this.z.clone())}reset(){}},Cu=class e{initialize(e){this.size.startGen(e.memory)}constructor(e){this.size=e,this.type=`SizeOverLife`}update(e){this.size instanceof tu?this.size.genValue(e.memory,e.size,e.age/e.life).multiply(e.startSize):e.size.copy(e.startSize).multiplyScalar(this.size.genValue(e.memory,e.age/e.life))}toJSON(){return{type:this.type,size:this.size.toJSON()}}static fromJSON(t){return new e(ru(t.size))}frameUpdate(e){}clone(){return new e(this.size.clone())}reset(){}},wu=class e{initialize(e){this.speed.startGen(e.memory)}constructor(e){this.speed=e,this.type=`SpeedOverLife`}update(e){e.speedModifier=this.speed.genValue(e.memory,e.age/e.life)}toJSON(){return{type:this.type,speed:this.speed.toJSON()}}static fromJSON(t){return new e(L(t.speed))}frameUpdate(e){}clone(){return new e(this.speed.clone())}reset(){}},Tu=class e{constructor(e){this.frame=e,this.type=`FrameOverLife`}initialize(e){this.frame.startGen(e.memory)}update(e,t){this.frame instanceof Xl&&(e.uvTile=this.frame.genValue(e.memory,e.age/e.life))}frameUpdate(e){}toJSON(){return{type:this.type,frame:this.frame.toJSON()}}static fromJSON(t){return new e(L(t.frame))}clone(){return new e(this.frame.clone())}reset(){}},Eu=class e{constructor(e,t=new F(0,1,0)){this.orbitSpeed=e,this.axis=t,this.type=`OrbitOverLife`,this.temp=new F,this.rotation=new pl}initialize(e){this.orbitSpeed.startGen(e.memory)}update(e,t){this.temp.copy(e.position).projectOnVector(this.axis),this.rotation.setFromAxisAngle(this.axis,this.orbitSpeed.genValue(e.memory,e.age/e.life)*t),e.position.sub(this.temp),e.position.applyQuaternion(this.rotation),e.position.add(this.temp)}frameUpdate(e){}toJSON(){return{type:this.type,orbitSpeed:this.orbitSpeed.toJSON(),axis:[this.axis.x,this.axis.y,this.axis.z]}}static fromJSON(t){return new e(L(t.orbitSpeed),t.axis?new F(t.axis[0],t.axis[1],t.axis[2]):void 0)}clone(){return new e(this.orbitSpeed.clone())}reset(){}},Du=class{constructor(e){this.data=e,this.next=null,this.prev=null}hasPrev(){return this.prev!==null}hasNext(){return this.next!==null}},Ou=class{constructor(){this.length=0,this.head=this.tail=null}isEmpty(){return this.head===null}clear(){this.length=0,this.head=this.tail=null}front(){return this.head===null?null:this.head.data}back(){return this.tail===null?null:this.tail.data}dequeue(){if(this.head){let e=this.head.data;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}}pop(){if(this.tail){let e=this.tail.data;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}}queue(e){let t=new Du(e);this.tail||=t,this.head&&(this.head.prev=t,t.next=this.head),this.head=t,this.length++}push(e){let t=new Du(e);this.head||=t,this.tail&&(this.tail.next=t,t.prev=this.tail),this.tail=t,this.length++}insertBefore(e,t){let n=new Du(t);n.next=e,n.prev=e.prev,n.prev!==null&&(n.prev.next=n),n.next.prev=n,e==this.head&&(this.head=n),this.length++}remove(e){if(this.head===null||this.tail===null)return;let t=this.head;for(e===this.head.data&&(this.head=this.head.next),e===this.tail.data&&(this.tail=this.tail.prev);t.next!==null&&t.data!==e;)t=t.next;t.data===e&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.length--)}*values(){let e=this.head;for(;e!==null;)yield e.data,e=e.next}},ku=class{constructor(){this.startSpeed=0,this.startColor=new kl,this.startSize=new F(1,1,1),this.position=new F,this.velocity=new F,this.age=0,this.life=1,this.size=new F(1,1,1),this.speedModifier=1,this.rotation=0,this.color=new kl,this.uvTile=0,this.memory=[]}get died(){return this.age>=this.life}reset(){this.memory.length=0}},Au=class{constructor(e,t,n){this.position=e,this.size=t,this.color=n}},ju=class{constructor(){this.startSpeed=0,this.startColor=new kl,this.startSize=new F(1,1,1),this.position=new F,this.velocity=new F,this.age=0,this.life=1,this.size=new F(1,1,1),this.length=100,this.speedModifier=1,this.color=new kl,this.previous=new Ou,this.uvTile=0,this.memory=[]}update(){for(this.age<=this.life?this.previous.push(new Au(this.position.clone(),this.size.x,this.color.clone())):this.previous.length>0&&this.previous.dequeue();this.previous.length>this.length;)this.previous.dequeue()}get died(){return this.age>=this.life}reset(){this.memory.length=0,this.previous.clear()}},Mu=class e{initialize(e){this.width.startGen(e.memory)}constructor(e){this.width=e,this.type=`WidthOverLength`}update(e){if(e instanceof ju){let t=e.previous.values();for(let n=0;n<e.previous.length;n++){let r=t.next();r.value.size=this.width.genValue(e.memory,(e.previous.length-n)/e.length)}}}frameUpdate(e){}toJSON(){return{type:this.type,width:this.width.toJSON()}}static fromJSON(t){return new e(L(t.width))}clone(){return new e(this.width.clone())}reset(){}},Nu=class e{constructor(e,t){this.direction=e,this.magnitude=t,this.type=`ApplyForce`,this.memory={data:[],dataCount:0},this.magnitudeValue=this.magnitude.genValue(this.memory)}initialize(e){}update(e,t){e.velocity.addScaledVector(this.direction,this.magnitudeValue*t)}frameUpdate(e){this.magnitudeValue=this.magnitude.genValue(this.memory)}toJSON(){return{type:this.type,direction:[this.direction.x,this.direction.y,this.direction.z],magnitude:this.magnitude.toJSON()}}static fromJSON(t){return new e(new F(t.direction[0],t.direction[1],t.direction[2]),L(t.magnitude??t.force))}clone(){return new e(this.direction.clone(),this.magnitude.clone())}reset(){}},Pu=class e{constructor(e,t){this.center=e,this.magnitude=t,this.type=`GravityForce`,this.temp=new F}initialize(e){}update(e,t){this.temp.copy(this.center).sub(e.position).normalize(),e.velocity.addScaledVector(this.temp,this.magnitude/e.position.distanceToSquared(this.center)*t)}frameUpdate(e){}toJSON(){return{type:this.type,center:[this.center.x,this.center.y,this.center.z],magnitude:this.magnitude}}static fromJSON(t){return new e(new F(t.center[0],t.center[1],t.center[2]),t.magnitude)}clone(){return new e(this.center.clone(),this.magnitude)}reset(){}},Fu=class e{constructor(e){this.angle=e,this.type=`ChangeEmitDirection`,this._temp=new F,this._q=new pl,this.memory={data:[],dataCount:0}}initialize(e){let t=e.velocity.length();t!=0&&(e.velocity.normalize(),e.velocity.x===0&&e.velocity.y===0?this._temp.set(0,e.velocity.z,0):this._temp.set(-e.velocity.y,e.velocity.x,0),this.angle.startGen(this.memory),this._q.setFromAxisAngle(this._temp.normalize(),this.angle.genValue(this.memory)),this._temp.copy(e.velocity),e.velocity.applyQuaternion(this._q),this._q.setFromAxisAngle(this._temp,Math.random()*Math.PI*2),e.velocity.applyQuaternion(this._q),e.velocity.setLength(t))}update(e,t){}frameUpdate(e){}toJSON(){return{type:this.type,angle:this.angle.toJSON()}}static fromJSON(t){return new e(L(t.angle))}clone(){return new e(this.angle)}reset(){}},Iu;(function(e){e[e.Death=0]=`Death`,e[e.Birth=1]=`Birth`,e[e.Frame=2]=`Frame`})(Iu||={});var Lu=class e{constructor(e,t,n,r=Iu.Frame,i=1){this.particleSystem=e,this.useVelocityAsBasis=t,this.subParticleSystem=n,this.mode=r,this.emitProbability=i,this.type=`EmitSubParticleSystem`,this.q_=new pl,this.v_=new F,this.v2_=new F,this.subEmissions=[],this.subParticleSystem&&this.subParticleSystem.system&&(this.subParticleSystem.system.onlyUsedByOther=!0)}initialize(e){}update(e,t){(this.mode===Iu.Frame||this.mode===Iu.Birth&&e.age===0||this.mode===Iu.Death&&e.age+t>=e.life)&&this.emit(e,t)}emit(e,t){if(!this.subParticleSystem||Math.random()>this.emitProbability)return;let n=new _l;this.setMatrixFromParticle(n,e),this.subEmissions.push({burstParticleCount:0,burstParticleIndex:0,isBursting:!1,burstIndex:0,burstWaveIndex:0,time:0,waitEmiting:0,matrix:n,travelDistance:0,particle:e})}frameUpdate(e){if(this.subParticleSystem)for(let t=0;t<this.subEmissions.length;t++)if(this.subEmissions[t].time>=this.subParticleSystem.system.duration)this.subEmissions[t]=this.subEmissions[this.subEmissions.length-1],this.subEmissions.length=this.subEmissions.length-1,t--;else{let n=this.subEmissions[t];n.particle&&n.particle.age<n.particle.life?this.setMatrixFromParticle(n.matrix,n.particle):n.particle=void 0,this.subParticleSystem.system.emit(e,n,n.matrix)}}toJSON(){return{type:this.type,subParticleSystem:this.subParticleSystem?this.subParticleSystem.uuid:``,useVelocityAsBasis:this.useVelocityAsBasis,mode:this.mode,emitProbability:this.emitProbability}}static fromJSON(t,n){return new e(n,t.useVelocityAsBasis,t.subParticleSystem,t.mode,t.emitProbability)}clone(){return new e(this.particleSystem,this.useVelocityAsBasis,this.subParticleSystem,this.mode,this.emitProbability)}reset(){}setMatrixFromParticle(e,t){let n;if(t.rotation===void 0||this.useVelocityAsBasis)if(t.velocity.x===0&&t.velocity.y===0&&(t.velocity.z===1||t.velocity.z===0))e.set(1,0,0,t.position.x,0,1,0,t.position.y,0,0,1,t.position.z,0,0,0,1);else{this.v_.copy(uu).cross(t.velocity),this.v2_.copy(t.velocity).cross(this.v_);let n=this.v_.length(),r=this.v2_.length();e.set(this.v_.x/n,this.v2_.x/r,t.velocity.x,t.position.x,this.v_.y/n,this.v2_.y/r,t.velocity.y,t.position.y,this.v_.z/n,this.v2_.z/r,t.velocity.z,t.position.z,0,0,0,1)}else t.rotation instanceof pl?n=t.rotation:(this.q_.setFromAxisAngle(uu,t.rotation),n=this.q_),e.compose(t.position,n,lu);this.particleSystem.worldSpace||e.multiplyMatrices(this.particleSystem.emitter.matrixWorld,e)}},Ru=.5*(Math.sqrt(3)-1),zu=(3-Math.sqrt(3))/6,Bu=1/3,Vu=1/6,Hu=(Math.sqrt(5)-1)/4,Uu=(5-Math.sqrt(5))/20,Wu=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),Gu=new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),Ku=class{constructor(e=Math.random){let t=typeof e==`function`?e:Ju(e);this.p=qu(t),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(let e=0;e<512;e++)this.perm[e]=this.p[e&255],this.permMod12[e]=this.perm[e]%12}noise2D(e,t){let n=this.permMod12,r=this.perm,i=0,a=0,o=0,s=(e+t)*Ru,c=Math.floor(e+s),l=Math.floor(t+s),u=(c+l)*zu,d=c-u,f=l-u,p=e-d,m=t-f,h,g;p>m?(h=1,g=0):(h=0,g=1);let _=p-h+zu,v=m-g+zu,y=p-1+2*zu,b=m-1+2*zu,x=c&255,S=l&255,C=.5-p*p-m*m;if(C>=0){let e=n[x+r[S]]*3;C*=C,i=C*C*(Wu[e]*p+Wu[e+1]*m)}let w=.5-_*_-v*v;if(w>=0){let e=n[x+h+r[S+g]]*3;w*=w,a=w*w*(Wu[e]*_+Wu[e+1]*v)}let T=.5-y*y-b*b;if(T>=0){let e=n[x+1+r[S+1]]*3;T*=T,o=T*T*(Wu[e]*y+Wu[e+1]*b)}return 70*(i+a+o)}noise3D(e,t,n){let r=this.permMod12,i=this.perm,a,o,s,c,l=(e+t+n)*Bu,u=Math.floor(e+l),d=Math.floor(t+l),f=Math.floor(n+l),p=(u+d+f)*Vu,m=u-p,h=d-p,g=f-p,_=e-m,v=t-h,y=n-g,b,x,S,C,w,T;_>=v?v>=y?(b=1,x=0,S=0,C=1,w=1,T=0):_>=y?(b=1,x=0,S=0,C=1,w=0,T=1):(b=0,x=0,S=1,C=1,w=0,T=1):v<y?(b=0,x=0,S=1,C=0,w=1,T=1):_<y?(b=0,x=1,S=0,C=0,w=1,T=1):(b=0,x=1,S=0,C=1,w=1,T=0);let E=_-b+Vu,D=v-x+Vu,O=y-S+Vu,ee=_-C+2*Vu,te=v-w+2*Vu,ne=y-T+2*Vu,re=_-1+3*Vu,ie=v-1+3*Vu,ae=y-1+3*Vu,oe=u&255,se=d&255,ce=f&255,le=.6-_*_-v*v-y*y;if(le<0)a=0;else{let e=r[oe+i[se+i[ce]]]*3;le*=le,a=le*le*(Wu[e]*_+Wu[e+1]*v+Wu[e+2]*y)}let ue=.6-E*E-D*D-O*O;if(ue<0)o=0;else{let e=r[oe+b+i[se+x+i[ce+S]]]*3;ue*=ue,o=ue*ue*(Wu[e]*E+Wu[e+1]*D+Wu[e+2]*O)}let k=.6-ee*ee-te*te-ne*ne;if(k<0)s=0;else{let e=r[oe+C+i[se+w+i[ce+T]]]*3;k*=k,s=k*k*(Wu[e]*ee+Wu[e+1]*te+Wu[e+2]*ne)}let de=.6-re*re-ie*ie-ae*ae;if(de<0)c=0;else{let e=r[oe+1+i[se+1+i[ce+1]]]*3;de*=de,c=de*de*(Wu[e]*re+Wu[e+1]*ie+Wu[e+2]*ae)}return 32*(a+o+s+c)}noise4D(e,t,n,r){let i=this.perm,a,o,s,c,l,u=(e+t+n+r)*Hu,d=Math.floor(e+u),f=Math.floor(t+u),p=Math.floor(n+u),m=Math.floor(r+u),h=(d+f+p+m)*Uu,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)}let Ne=.6-xe*xe-Se*Se-Ce*Ce-we*we;if(Ne<0)l=0;else{let e=i[Te+1+i[Ee+1+i[De+1+i[Oe+1]]]]%32*4;Ne*=Ne,l=Ne*Ne*(Gu[e]*xe+Gu[e+1]*Se+Gu[e+2]*Ce+Gu[e+3]*we)}return 27*(a+o+s+c+l)}};function qu(e){let t=new Uint8Array(256);for(let e=0;e<256;e++)t[e]=e;for(let n=0;n<255;n++){let r=n+~~(e()*(256-n)),i=t[n];t[n]=t[r],t[r]=i}return t}function Ju(e){let t=0,n=0,r=0,i=1,a=Yu();return t=a(` `),n=a(` `),r=a(` `),t-=a(e),t<0&&(t+=1),n-=a(e),n<0&&(n+=1),r-=a(e),r<0&&(r+=1),function(){let e=2091639*t+i*23283064365386963e-26;return t=n,n=r,r=e-(i=e|0)}}function Yu(){let e=4022871197;return function(t){t=t.toString();for(let n=0;n<t.length;n++){e+=t.charCodeAt(n);let r=.02519603282416938*e;e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=r*4294967296}return(e>>>0)*23283064365386963e-26}}var Xu=class e{constructor(e,t,n,r){this.scale=e,this.octaves=t,this.velocityMultiplier=n,this.timeScale=r,this.type=`TurbulenceField`,this.generator=new Ku,this.timeOffset=new F,this.temp=new F,this.temp2=new F,this.timeOffset.x=Math.random()/this.scale.x*this.timeScale.x,this.timeOffset.y=Math.random()/this.scale.y*this.timeScale.y,this.timeOffset.z=Math.random()/this.scale.z*this.timeScale.z}initialize(e){}update(e,t){let n=e.position.x/this.scale.x,r=e.position.y/this.scale.y,i=e.position.z/this.scale.z;this.temp.set(0,0,0);let a=1;for(let e=0;e<this.octaves;e++)this.temp2.set(this.generator.noise4D(n*a,r*a,i*a,this.timeOffset.x*a)/a,this.generator.noise4D(n*a,r*a,i*a,this.timeOffset.y*a)/a,this.generator.noise4D(n*a,r*a,i*a,this.timeOffset.z*a)/a),this.temp.add(this.temp2),a*=2;this.temp.multiply(this.velocityMultiplier),e.velocity.addScaledVector(this.temp,t)}toJSON(){return{type:this.type,scale:[this.scale.x,this.scale.y,this.scale.z],octaves:this.octaves,velocityMultiplier:[this.velocityMultiplier.x,this.velocityMultiplier.y,this.velocityMultiplier.z],timeScale:[this.timeScale.x,this.timeScale.y,this.timeScale.z]}}frameUpdate(e){this.timeOffset.x+=e*this.timeScale.x,this.timeOffset.y+=e*this.timeScale.y,this.timeOffset.z+=e*this.timeScale.z}static fromJSON(t){return new e(new F(t.scale[0],t.scale[1],t.scale[2]),t.octaves,new F(t.velocityMultiplier[0],t.velocityMultiplier[1],t.velocityMultiplier[2]),new F(t.timeScale[0],t.timeScale[1],t.timeScale[2]))}clone(){return new e(this.scale.clone(),this.octaves,this.velocityMultiplier.clone(),this.timeScale.clone())}reset(){}},Zu=[],Qu=new F,$u=new pl,ed=class e{constructor(e,t,n=new I(1),r=new I(0)){if(this.frequency=e,this.power=t,this.positionAmount=n,this.rotationAmount=r,this.type=`Noise`,this.duration=0,Zu.length===0)for(let e=0;e<100;e++)Zu.push(new Ku)}initialize(e){e.lastPosNoise=new F,typeof e.rotation==`number`?e.lastRotNoise=0:e.lastRotNoise=new pl,e.generatorIndex=[ou(0,100),ou(0,100),ou(0,100),ou(0,100)],this.positionAmount.startGen(e.memory),this.rotationAmount.startGen(e.memory),this.frequency.startGen(e.memory),this.power.startGen(e.memory)}update(e,t){let n=this.frequency.genValue(e.memory,e.age/e.life),r=this.power.genValue(e.memory,e.age/e.life),i=this.positionAmount.genValue(e.memory,e.age/e.life),a=this.rotationAmount.genValue(e.memory,e.age/e.life);i>0&&e.lastPosNoise!==void 0&&(e.position.sub(e.lastPosNoise),Qu.set(Zu[e.generatorIndex[0]].noise2D(0,e.age*n)*r*i,Zu[e.generatorIndex[1]].noise2D(0,e.age*n)*r*i,Zu[e.generatorIndex[2]].noise2D(0,e.age*n)*r*i),e.position.add(Qu),e.lastPosNoise.copy(Qu)),a>0&&e.lastRotNoise!==void 0&&(typeof e.rotation==`number`?(e.rotation-=e.lastRotNoise,e.rotation+=Zu[e.generatorIndex[3]].noise2D(0,e.age*n)*Math.PI*r*a):(e.lastRotNoise.invert(),e.rotation.multiply(e.lastRotNoise),$u.set(Zu[e.generatorIndex[0]].noise2D(0,e.age*n)*r*a,Zu[e.generatorIndex[1]].noise2D(0,e.age*n)*r*a,Zu[e.generatorIndex[2]].noise2D(0,e.age*n)*r*a,Zu[e.generatorIndex[3]].noise2D(0,e.age*n)*r*a).normalize(),e.rotation.multiply($u),e.lastRotNoise.copy($u)))}toJSON(){return{type:this.type,frequency:this.frequency.toJSON(),power:this.power.toJSON(),positionAmount:this.positionAmount.toJSON(),rotationAmount:this.rotationAmount.toJSON()}}frameUpdate(e){this.duration+=e}static fromJSON(t){return new e(L(t.frequency),L(t.power),L(t.positionAmount),L(t.rotationAmount))}clone(){return new e(this.frequency.clone(),this.power.clone(),this.positionAmount.clone(),this.rotationAmount.clone())}reset(){}},td=class e{constructor(e=0,t=0,n=new F){this.scaleX=e,this.scaleY=t,this.position=n,this.locations=[]}transform(e,t){e.x=this.locations[t%this.locations.length].x*this.scaleX+this.position.x,e.y=this.locations[t%this.locations.length].y*this.scaleY+this.position.y,e.z=this.position.z}static fromJSON(t){let n=new e(t.scaleX,t.scaleY,new F(t.position[0],t.position[1],t.position[2]));return n.locations=t.locations.map(e=>new Ol(e.x,e.y)),n}clone(){let t=new e(this.scaleX,this.scaleY,this.position.clone());return t.locations=this.locations.map(e=>e.clone()),t}toJSON(){return{scaleX:this.scaleX,scaleY:this.scaleY,position:this.position,locations:this.locations.map(e=>({x:e.x,y:e.y}))}}fromImage(e,t){let n=document.createElement(`canvas`);n.width=e.width,n.height=e.height;let r=n.getContext(`2d`);if(!r)return;r.drawImage(e,0,0);let i=r.getImageData(0,0,n.width,n.height,{colorSpace:`srgb`});n.remove(),this.locations.length=0;for(let e=0;e<i.height;e++)for(let n=0;n<i.width;n++)i.data[(e*i.width+n)*4+3]>t&&this.locations.push(new Ol(n,i.height-e))}};function nd(e){switch(e.type){case`TextureSequencer`:return td.fromJSON(e);default:return new td}}var rd=class e{constructor(e){this.type=`ApplySequences`,this.sequencers=[],this.time=0,this.index=0,this.pCount=0,this.tempV=new F,this.delay=e}initialize(e){e.id=this.pCount,e.dst=new F,e.begin=new F,e.inMotion=!1,this.pCount++}reset(){this.time=0,this.index=0,this.pCount=0}update(t,n){let r=this.sequencers[this.index],i=t.id*this.delay;this.time>=r[0].a+i&&this.time<=r[0].b+i?(t.inMotion||(t.inMotion=!0,t.begin.copy(t.position),r[1].transform(t.dst,t.id)),t.position.lerpVectors(t.begin,t.dst,e.BEZIER.genValue((this.time-r[0].a-i)/(r[0].b-r[0].a)))):this.time>r[0].b+i&&(t.inMotion=!1)}frameUpdate(e){for(;this.index+1<this.sequencers.length&&this.time>=this.sequencers[this.index+1][0].a;)this.index++;this.time+=e}appendSequencer(e,t){this.sequencers.push([e,t])}toJSON(){return{type:this.type,delay:this.delay,sequencers:this.sequencers.map(([e,t])=>({range:e.toJSON(),sequencer:t.toJSON()}))}}static fromJSON(t){let n=new e(t.delay);return t.sequencers.forEach(e=>{n.sequencers.push([L(e.range),nd(e.sequencer)])}),n}clone(){let t=new e(this.delay);return t.sequencers=this.sequencers.map(e=>[e[0].clone(),e[1].clone()]),t}};rd.BEZIER=new Pl(0,0,1,1);var id=class e{constructor(e,t){this.color=e,this.speedRange=t,this.type=`ColorBySpeed`}initialize(e){this.color.startGen(e.memory)}update(e,t){let n=(e.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);this.color.genColor(e.memory,e.color,n),e.color.x*=e.startColor.x,e.color.y*=e.startColor.y,e.color.z*=e.startColor.z,e.color.w*=e.startColor.w}frameUpdate(e){}toJSON(){return{type:this.type,color:this.color.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new e(ql(t.color),Jl.fromJSON(t.speedRange))}clone(){return new e(this.color.clone(),this.speedRange.clone())}reset(){}},ad=class e{initialize(e){this.size.startGen(e.memory)}constructor(e,t){this.size=e,this.speedRange=t,this.type=`SizeBySpeed`}update(e){let t=(e.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);this.size instanceof tu?this.size.genValue(e.memory,e.size,t).multiply(e.startSize):e.size.copy(e.startSize).multiplyScalar(this.size.genValue(e.memory,t))}toJSON(){return{type:this.type,size:this.size.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new e(ru(t.size),Jl.fromJSON(t.speedRange))}frameUpdate(e){}clone(){return new e(this.size.clone(),this.speedRange.clone())}reset(){}},od=class e{constructor(e,t){this.angularVelocity=e,this.speedRange=t,this.type=`RotationBySpeed`,this.tempQuat=new pl}initialize(e){typeof e.rotation==`number`&&this.angularVelocity.startGen(e.memory)}update(e,t){if(typeof e.rotation==`number`){let n=(e.startSpeed-this.speedRange.a)/(this.speedRange.b-this.speedRange.a);e.rotation+=t*this.angularVelocity.genValue(e.memory,n)}}toJSON(){return{type:this.type,angularVelocity:this.angularVelocity.toJSON(),speedRange:this.speedRange.toJSON()}}static fromJSON(t){return new e(L(t.angularVelocity),Jl.fromJSON(t.speedRange))}frameUpdate(e){}clone(){return new e(this.angularVelocity.clone(),this.speedRange.clone())}reset(){}},sd=class e{initialize(e){this.speed.startGen(e.memory)}constructor(e,t){this.speed=e,this.dampen=t,this.type=`LimitSpeedOverLife`}update(e,t){let n=e.velocity.length(),r=this.speed.genValue(e.memory,e.age/e.life);if(n>r){let i=(n-r)/n;e.velocity.multiplyScalar(1-i*this.dampen*t*20)}}toJSON(){return{type:this.type,speed:this.speed.toJSON(),dampen:this.dampen}}static fromJSON(t){return new e(L(t.speed),t.dampen)}frameUpdate(e){}clone(){return new e(this.speed.clone(),this.dampen)}reset(){}},cd={ApplyForce:{type:`ApplyForce`,constructor:Nu,params:[[`direction`,[`vec3`]],[`magnitude`,[`value`]]],loadJSON:Nu.fromJSON},Noise:{type:`Noise`,constructor:ed,params:[[`frequency`,[`value`]],[`power`,[`value`]],[`positionAmount`,[`value`]],[`rotationAmount`,[`value`]]],loadJSON:ed.fromJSON},TurbulenceField:{type:`TurbulenceField`,constructor:Xu,params:[[`scale`,[`vec3`]],[`octaves`,[`number`]],[`velocityMultiplier`,[`vec3`]],[`timeScale`,[`vec3`]]],loadJSON:Xu.fromJSON},GravityForce:{type:`GravityForce`,constructor:Pu,params:[[`center`,[`vec3`]],[`magnitude`,[`number`]]],loadJSON:Pu.fromJSON},ColorOverLife:{type:`ColorOverLife`,constructor:yu,params:[[`color`,[`colorFunc`]]],loadJSON:yu.fromJSON},RotationOverLife:{type:`RotationOverLife`,constructor:bu,params:[[`angularVelocity`,[`value`,`valueFunc`]]],loadJSON:bu.fromJSON},Rotation3DOverLife:{type:`Rotation3DOverLife`,constructor:xu,params:[[`angularVelocity`,[`rotationFunc`]]],loadJSON:xu.fromJSON},SizeOverLife:{type:`SizeOverLife`,constructor:Cu,params:[[`size`,[`value`,`valueFunc`,`vec3Func`]]],loadJSON:Cu.fromJSON},ColorBySpeed:{type:`ColorBySpeed`,constructor:id,params:[[`color`,[`colorFunc`]],[`speedRange`,[`range`]]],loadJSON:id.fromJSON},RotationBySpeed:{type:`RotationBySpeed`,constructor:od,params:[[`angularVelocity`,[`value`,`valueFunc`]],[`speedRange`,[`range`]]],loadJSON:od.fromJSON},SizeBySpeed:{type:`SizeBySpeed`,constructor:ad,params:[[`size`,[`value`,`valueFunc`,`vec3Func`]],[`speedRange`,[`range`]]],loadJSON:ad.fromJSON},SpeedOverLife:{type:`SpeedOverLife`,constructor:wu,params:[[`speed`,[`value`,`valueFunc`]]],loadJSON:wu.fromJSON},FrameOverLife:{type:`FrameOverLife`,constructor:Tu,params:[[`frame`,[`value`,`valueFunc`]]],loadJSON:Tu.fromJSON},ForceOverLife:{type:`ForceOverLife`,constructor:Su,params:[[`x`,[`value`,`valueFunc`]],[`y`,[`value`,`valueFunc`]],[`z`,[`value`,`valueFunc`]]],loadJSON:Su.fromJSON},OrbitOverLife:{type:`OrbitOverLife`,constructor:Eu,params:[[`orbitSpeed`,[`value`,`valueFunc`]],[`axis`,[`vec3`]]],loadJSON:Eu.fromJSON},WidthOverLength:{type:`WidthOverLength`,constructor:Mu,params:[[`width`,[`value`,`valueFunc`]]],loadJSON:Mu.fromJSON},ChangeEmitDirection:{type:`ChangeEmitDirection`,constructor:Fu,params:[[`angle`,[`value`]]],loadJSON:Fu.fromJSON},EmitSubParticleSystem:{type:`EmitSubParticleSystem`,constructor:Lu,params:[[`particleSystem`,[`self`]],[`useVelocityAsBasis`,[`boolean`]],[`subParticleSystem`,[`particleSystem`]],[`mode`,[`number`]],[`emitProbability`,[`number`]]],loadJSON:Lu.fromJSON},LimitSpeedOverLife:{type:`LimitSpeedOverLife`,constructor:sd,params:[[`speed`,[`value`,`valueFunc`]],[`dampen`,[`number`]]],loadJSON:sd.fromJSON}};function ld(e,t){return cd[e.type]?cd[e.type].loadJSON(e,t):null}var ud=[];function dd(e){if(!ud.find(t=>t.id===e.id)){e.initialize();for(let t of e.emitterShapes)_u[t.type]||(_u[t.type]=t);for(let t of e.behaviors)cd[t.type]||(cd[t.type]=t)}}var fd=class e{get geometry(){return this._geometry}set geometry(e){if(this._geometry=e,e===void 0||typeof e==`string`)return;let t=new b;this._triangleIndexToArea.length=0;let n=0;if(!e.getIndex())return;let r=e.getIndex().array,i=r.length/3;this._triangleIndexToArea.push(0);for(let a=0;a<i;a++)t.setFromAttributeAndIndices(e.getAttribute(`position`),r[a*3],r[a*3+1],r[a*3+2]),n+=t.getArea(),this._triangleIndexToArea.push(n);e.userData.triangleIndexToArea=this._triangleIndexToArea}constructor(e){this.type=`mesh_surface`,this._triangleIndexToArea=[],this._tempA=new c,this._tempB=new c,this._tempC=new c,e&&(this.geometry=e)}initialize(e){let t=this._geometry;if(!t||t.getIndex()===null){e.position.set(0,0,0),e.velocity.set(0,0,1).multiplyScalar(e.startSpeed);return}let n=this._triangleIndexToArea.length-1,r=0,i=n,a=Math.random()*this._triangleIndexToArea[n];for(;r+1<i;){let e=Math.floor((r+i)/2);a<this._triangleIndexToArea[e]?i=e:r=e}let o=Math.random(),s=Math.random();o+s>1&&(o=1-o,s=1-s);let c=t.getIndex().array[r*3],l=t.getIndex().array[r*3+1],u=t.getIndex().array[r*3+2],d=t.getAttribute(`position`);this._tempA.fromBufferAttribute(d,c),this._tempB.fromBufferAttribute(d,l),this._tempC.fromBufferAttribute(d,u),this._tempB.sub(this._tempA),this._tempC.sub(this._tempA),this._tempA.addScaledVector(this._tempB,o).addScaledVector(this._tempC,s),e.position.copy(this._tempA),this._tempA.copy(this._tempB).cross(this._tempC).normalize(),e.velocity.copy(this._tempA).normalize().multiplyScalar(e.startSpeed)}toJSON(){return{type:`mesh_surface`,mesh:this._geometry?this._geometry.uuid:``}}static fromJSON(t,n){return new e(n.geometries[t.geometry])}clone(){return new e(this._geometry)}update(e,t){}},pd={id:`three.quarks`,initialize:()=>{},emitterShapes:[{type:`mesh_surface`,params:[[`geometry`,[`geometry`]]],constructor:fd,loadJSON:fd.fromJSON}],behaviors:[]},md=`
395
- #ifdef SOFT_PARTICLES
396
-
397
- /* #ifdef LOGDEPTH
398
- float distSample = linearize_depth_log(sampleDepth, near, far);
399
- #else
400
- float distSample = ortho ? linearize_depth_ortho(sampleDepth, near, far) : linearize_depth(sampleDepth, near, far);
401
- #endif */
402
-
403
- vec2 p2 = projPosition.xy / projPosition.w;
404
-
405
- p2 = 0.5 * p2 + 0.5;
406
-
407
- float readDepth = texture2D(depthTexture, p2.xy).r;
408
- float viewDepth = linearize_depth(readDepth);
409
-
410
- float softParticlesFade = saturate(SOFT_INV_FADE_DISTANCE * ((viewDepth - SOFT_NEAR_FADE) - linearDepth));
411
-
412
- gl_FragColor *= softParticlesFade;
413
-
414
- //gl_FragColor = vec4(softParticlesFade , 0, 0, 1);
415
- #endif
416
- `,hd=`
417
- #ifdef SOFT_PARTICLES
418
-
419
- uniform sampler2D depthTexture;
420
- uniform vec4 projParams;
421
- uniform vec2 softParams;
422
-
423
- varying vec4 projPosition;
424
- varying float linearDepth;
425
-
426
- #define SOFT_NEAR_FADE softParams.x
427
- #define SOFT_INV_FADE_DISTANCE softParams.y
428
-
429
- #define zNear projParams.x
430
- #define zFar projParams.y
431
-
432
- float linearize_depth(float d)
433
- {
434
- return (zFar * zNear) / (zFar - d * (zFar - zNear));
435
- }
436
-
437
- #endif
438
- `,gd=`
439
- #ifdef SOFT_PARTICLES
440
- varying vec4 projPosition;
441
- varying float linearDepth;
442
- #endif
443
- `,_d=`
444
- #ifdef SOFT_PARTICLES
445
- projPosition = gl_Position;
446
- linearDepth = -mvPosition.z;
447
- #endif
448
- `,vd=`
449
- #ifdef USE_MAP
450
- vec4 texelColor = texture2D( map, vUv);
451
- #ifdef TILE_BLEND
452
- texelColor = mix( texelColor, texture2D( map, vUvNext ), vUvBlend );
453
- #endif
454
- diffuseColor *= texelColor;
455
- #endif
456
- `,yd=`
457
- #if defined( USE_UV ) || defined( USE_ANISOTROPY )
458
-
459
- varying vec2 vUv;
460
- #ifdef TILE_BLEND
461
- varying vec2 vUvNext;
462
- varying float vUvBlend;
463
- #endif
464
-
465
- #endif
466
- #ifdef USE_MAP
467
-
468
- uniform mat3 mapTransform;
469
- varying vec2 vMapUv;
470
- #ifdef TILE_BLEND
471
- varying vec2 vMapUvNext;
472
- #endif
473
-
474
- #endif
475
- #ifdef USE_ALPHAMAP
476
-
477
- uniform mat3 alphaMapTransform;
478
- varying vec2 vAlphaMapUv;
479
-
480
- #endif
481
- #ifdef USE_LIGHTMAP
482
-
483
- uniform mat3 lightMapTransform;
484
- varying vec2 vLightMapUv;
485
-
486
- #endif
487
- #ifdef USE_AOMAP
488
-
489
- uniform mat3 aoMapTransform;
490
- varying vec2 vAoMapUv;
491
-
492
- #endif
493
- #ifdef USE_BUMPMAP
494
-
495
- uniform mat3 bumpMapTransform;
496
- varying vec2 vBumpMapUv;
497
-
498
- #endif
499
- #ifdef USE_NORMALMAP
500
-
501
- uniform mat3 normalMapTransform;
502
- varying vec2 vNormalMapUv;
503
-
504
- #endif
505
- #ifdef USE_DISPLACEMENTMAP
506
-
507
- uniform mat3 displacementMapTransform;
508
- varying vec2 vDisplacementMapUv;
509
-
510
- #endif
511
- #ifdef USE_EMISSIVEMAP
512
-
513
- uniform mat3 emissiveMapTransform;
514
- varying vec2 vEmissiveMapUv;
515
-
516
- #endif
517
- #ifdef USE_METALNESSMAP
518
-
519
- uniform mat3 metalnessMapTransform;
520
- varying vec2 vMetalnessMapUv;
521
-
522
- #endif
523
- #ifdef USE_ROUGHNESSMAP
524
-
525
- uniform mat3 roughnessMapTransform;
526
- varying vec2 vRoughnessMapUv;
527
-
528
- #endif
529
- #ifdef USE_ANISOTROPYMAP
530
-
531
- uniform mat3 anisotropyMapTransform;
532
- varying vec2 vAnisotropyMapUv;
533
-
534
- #endif
535
- #ifdef USE_CLEARCOATMAP
536
-
537
- uniform mat3 clearcoatMapTransform;
538
- varying vec2 vClearcoatMapUv;
539
-
540
- #endif
541
- #ifdef USE_CLEARCOAT_NORMALMAP
542
-
543
- uniform mat3 clearcoatNormalMapTransform;
544
- varying vec2 vClearcoatNormalMapUv;
545
-
546
- #endif
547
- #ifdef USE_CLEARCOAT_ROUGHNESSMAP
548
-
549
- uniform mat3 clearcoatRoughnessMapTransform;
550
- varying vec2 vClearcoatRoughnessMapUv;
551
-
552
- #endif
553
- #ifdef USE_SHEEN_COLORMAP
554
-
555
- uniform mat3 sheenColorMapTransform;
556
- varying vec2 vSheenColorMapUv;
557
-
558
- #endif
559
- #ifdef USE_SHEEN_ROUGHNESSMAP
560
-
561
- uniform mat3 sheenRoughnessMapTransform;
562
- varying vec2 vSheenRoughnessMapUv;
563
-
564
- #endif
565
- #ifdef USE_IRIDESCENCEMAP
566
-
567
- uniform mat3 iridescenceMapTransform;
568
- varying vec2 vIridescenceMapUv;
569
-
570
- #endif
571
- #ifdef USE_IRIDESCENCE_THICKNESSMAP
572
-
573
- uniform mat3 iridescenceThicknessMapTransform;
574
- varying vec2 vIridescenceThicknessMapUv;
575
-
576
- #endif
577
- #ifdef USE_SPECULARMAP
578
-
579
- uniform mat3 specularMapTransform;
580
- varying vec2 vSpecularMapUv;
581
-
582
- #endif
583
- #ifdef USE_SPECULAR_COLORMAP
584
-
585
- uniform mat3 specularColorMapTransform;
586
- varying vec2 vSpecularColorMapUv;
587
-
588
- #endif
589
- #ifdef USE_SPECULAR_INTENSITYMAP
590
-
591
- uniform mat3 specularIntensityMapTransform;
592
- varying vec2 vSpecularIntensityMapUv;
593
-
594
- #endif
595
- #ifdef USE_TRANSMISSIONMAP
596
-
597
- uniform mat3 transmissionMapTransform;
598
- varying vec2 vTransmissionMapUv;
599
-
600
- #endif
601
- #ifdef USE_THICKNESSMAP
602
-
603
- uniform mat3 thicknessMapTransform;
604
- varying vec2 vThicknessMapUv;
605
-
606
- #endif
607
- `,bd=`
608
- #ifdef UV_TILE
609
- attribute float uvTile;
610
- uniform vec2 tileCount;
611
-
612
- mat3 makeTileTransform(float uvTile) {
613
- float col = mod(uvTile, tileCount.x);
614
- float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);
615
-
616
- return mat3(
617
- 1.0 / tileCount.x, 0.0, 0.0,
618
- 0.0, 1.0 / tileCount.y, 0.0,
619
- col / tileCount.x, row / tileCount.y, 1.0);
620
- }
621
- #else
622
- mat3 makeTileTransform(float uvTile) {
623
- return mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
624
- }
625
- #endif
626
-
627
- #if defined( USE_UV ) || defined( USE_ANISOTROPY )
628
-
629
- varying vec2 vUv;
630
- #ifdef TILE_BLEND
631
- varying vec2 vUvNext;
632
- varying float vUvBlend;
633
- #endif
634
-
635
- #endif
636
- #ifdef USE_MAP
637
-
638
- uniform mat3 mapTransform;
639
- varying vec2 vMapUv;
640
- #ifdef TILE_BLEND
641
- varying vec2 vMapUvNext;
642
- #endif
643
-
644
- #endif
645
- #ifdef USE_ALPHAMAP
646
-
647
- uniform mat3 alphaMapTransform;
648
- varying vec2 vAlphaMapUv;
649
-
650
- #endif
651
- #ifdef USE_LIGHTMAP
652
-
653
- uniform mat3 lightMapTransform;
654
- varying vec2 vLightMapUv;
655
-
656
- #endif
657
- #ifdef USE_AOMAP
658
-
659
- uniform mat3 aoMapTransform;
660
- varying vec2 vAoMapUv;
661
-
662
- #endif
663
- #ifdef USE_BUMPMAP
664
-
665
- uniform mat3 bumpMapTransform;
666
- varying vec2 vBumpMapUv;
667
-
668
- #endif
669
- #ifdef USE_NORMALMAP
670
-
671
- uniform mat3 normalMapTransform;
672
- varying vec2 vNormalMapUv;
673
-
674
- #endif
675
- #ifdef USE_DISPLACEMENTMAP
676
-
677
- uniform mat3 displacementMapTransform;
678
- varying vec2 vDisplacementMapUv;
679
-
680
- #endif
681
- #ifdef USE_EMISSIVEMAP
682
-
683
- uniform mat3 emissiveMapTransform;
684
- varying vec2 vEmissiveMapUv;
685
-
686
- #endif
687
- #ifdef USE_METALNESSMAP
688
-
689
- uniform mat3 metalnessMapTransform;
690
- varying vec2 vMetalnessMapUv;
691
-
692
- #endif
693
- #ifdef USE_ROUGHNESSMAP
694
-
695
- uniform mat3 roughnessMapTransform;
696
- varying vec2 vRoughnessMapUv;
697
-
698
- #endif
699
- #ifdef USE_ANISOTROPYMAP
700
-
701
- uniform mat3 anisotropyMapTransform;
702
- varying vec2 vAnisotropyMapUv;
703
-
704
- #endif
705
- #ifdef USE_CLEARCOATMAP
706
-
707
- uniform mat3 clearcoatMapTransform;
708
- varying vec2 vClearcoatMapUv;
709
-
710
- #endif
711
- #ifdef USE_CLEARCOAT_NORMALMAP
712
-
713
- uniform mat3 clearcoatNormalMapTransform;
714
- varying vec2 vClearcoatNormalMapUv;
715
-
716
- #endif
717
- #ifdef USE_CLEARCOAT_ROUGHNESSMAP
718
-
719
- uniform mat3 clearcoatRoughnessMapTransform;
720
- varying vec2 vClearcoatRoughnessMapUv;
721
-
722
- #endif
723
- #ifdef USE_SHEEN_COLORMAP
724
-
725
- uniform mat3 sheenColorMapTransform;
726
- varying vec2 vSheenColorMapUv;
727
-
728
- #endif
729
- #ifdef USE_SHEEN_ROUGHNESSMAP
730
-
731
- uniform mat3 sheenRoughnessMapTransform;
732
- varying vec2 vSheenRoughnessMapUv;
733
-
734
- #endif
735
- #ifdef USE_IRIDESCENCEMAP
736
-
737
- uniform mat3 iridescenceMapTransform;
738
- varying vec2 vIridescenceMapUv;
739
-
740
- #endif
741
- #ifdef USE_IRIDESCENCE_THICKNESSMAP
742
-
743
- uniform mat3 iridescenceThicknessMapTransform;
744
- varying vec2 vIridescenceThicknessMapUv;
745
-
746
- #endif
747
- #ifdef USE_SPECULARMAP
748
-
749
- uniform mat3 specularMapTransform;
750
- varying vec2 vSpecularMapUv;
751
-
752
- #endif
753
- #ifdef USE_SPECULAR_COLORMAP
754
-
755
- uniform mat3 specularColorMapTransform;
756
- varying vec2 vSpecularColorMapUv;
757
-
758
- #endif
759
- #ifdef USE_SPECULAR_INTENSITYMAP
760
-
761
- uniform mat3 specularIntensityMapTransform;
762
- varying vec2 vSpecularIntensityMapUv;
763
-
764
- #endif
765
- #ifdef USE_TRANSMISSIONMAP
766
-
767
- uniform mat3 transmissionMapTransform;
768
- varying vec2 vTransmissionMapUv;
769
-
770
- #endif
771
- #ifdef USE_THICKNESSMAP
772
-
773
- uniform mat3 thicknessMapTransform;
774
- varying vec2 vThicknessMapUv;
775
-
776
- #endif
777
- `,xd=`
778
- #ifdef UV_TILE
779
- mat3 tileTransform = makeTileTransform(floor(uvTile));
780
- #ifdef TILE_BLEND
781
- mat3 nextTileTransform = makeTileTransform(ceil(uvTile));
782
- vUvBlend = fract(uvTile);
783
- #endif
784
- #else
785
- mat3 tileTransform = makeTileTransform(0.0);
786
- #endif
787
-
788
- #if defined( USE_UV ) || defined( USE_ANISOTROPY )
789
-
790
- vUv = (tileTransform *vec3( uv, 1 )).xy;
791
- #if defined( TILE_BLEND ) && defined( UV_TILE )
792
- vUvNext = (nextTileTransform *vec3( uv, 1 )).xy;
793
- #endif
794
-
795
- #endif
796
- #ifdef USE_MAP
797
-
798
- vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;
799
- #if defined( TILE_BLEND ) && defined( UV_TILE )
800
- vMapUvNext = (nextTileTransform * (mapTransform * vec3( MAP_UV, 1 ))).xy;
801
- #endif
802
-
803
- #endif
804
- #ifdef USE_ALPHAMAP
805
-
806
- vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;
807
-
808
- #endif
809
- #ifdef USE_LIGHTMAP
810
-
811
- vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;
812
-
813
- #endif
814
- #ifdef USE_AOMAP
815
-
816
- vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;
817
-
818
- #endif
819
- #ifdef USE_BUMPMAP
820
-
821
- vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;
822
-
823
- #endif
824
- #ifdef USE_NORMALMAP
825
-
826
- vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;
827
-
828
- #endif
829
- #ifdef USE_DISPLACEMENTMAP
830
-
831
- vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;
832
-
833
- #endif
834
- #ifdef USE_EMISSIVEMAP
835
-
836
- vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;
837
-
838
- #endif
839
- #ifdef USE_METALNESSMAP
840
-
841
- vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;
842
-
843
- #endif
844
- #ifdef USE_ROUGHNESSMAP
845
-
846
- vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;
847
-
848
- #endif
849
- #ifdef USE_ANISOTROPYMAP
850
-
851
- vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;
852
-
853
- #endif
854
- #ifdef USE_CLEARCOATMAP
855
-
856
- vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;
857
-
858
- #endif
859
- #ifdef USE_CLEARCOAT_NORMALMAP
860
-
861
- vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;
862
-
863
- #endif
864
- #ifdef USE_CLEARCOAT_ROUGHNESSMAP
865
-
866
- vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;
867
-
868
- #endif
869
- #ifdef USE_IRIDESCENCEMAP
870
-
871
- vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;
872
-
873
- #endif
874
- #ifdef USE_IRIDESCENCE_THICKNESSMAP
875
-
876
- vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;
877
-
878
- #endif
879
- #ifdef USE_SHEEN_COLORMAP
880
-
881
- vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;
882
-
883
- #endif
884
- #ifdef USE_SHEEN_ROUGHNESSMAP
885
-
886
- vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;
887
-
888
- #endif
889
- #ifdef USE_SPECULARMAP
890
-
891
- vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;
892
-
893
- #endif
894
- #ifdef USE_SPECULAR_COLORMAP
895
-
896
- vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;
897
-
898
- #endif
899
- #ifdef USE_SPECULAR_INTENSITYMAP
900
-
901
- vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;
902
-
903
- #endif
904
- #ifdef USE_TRANSMISSIONMAP
905
-
906
- vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;
907
-
908
- #endif
909
- #ifdef USE_THICKNESSMAP
910
-
911
- vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;
912
-
913
- #endif
914
-
915
- `,Sd=se;function Cd(){Sd.tile_pars_vertex=bd,Sd.tile_vertex=xd,Sd.tile_pars_fragment=yd,Sd.tile_fragment=vd,Sd.soft_pars_vertex=gd,Sd.soft_vertex=_d,Sd.soft_pars_fragment=hd,Sd.soft_fragment=md}var wd=class extends re{constructor(e){super(),this.type=`ParticleEmitter`,this.system=e}clone(){let e=this.system.clone();return e.emitter.copy(this,!0),e.emitter}dispose(){}extractFromCache(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}toJSON(e,t={}){let n=this.children;this.children=this.children.filter(e=>e.type!==`ParticleSystemPreview`);let r=super.toJSON(e);return this.children=n,this.system!==null&&(r.object.ps=this.system.toJSON(e,t)),r}},R;(function(e){e[e.BillBoard=0]=`BillBoard`,e[e.StretchedBillBoard=1]=`StretchedBillBoard`,e[e.Mesh=2]=`Mesh`,e[e.Trail=3]=`Trail`,e[e.HorizontalBillBoard=4]=`HorizontalBillBoard`,e[e.VerticalBillBoard=5]=`VerticalBillBoard`})(R||={});var Td=class extends he{constructor(e){super(),this.type=`VFXBatch`,this.maxParticles=1e3,this.systems=new Set;let t=new o;t.mask=e.layers.mask;let n=e.material.clone();n.defines={},Object.assign(n.defines,e.material.defines),this.settings={instancingGeometry:e.instancingGeometry,renderMode:e.renderMode,renderOrder:e.renderOrder,material:n,uTileCount:e.uTileCount,vTileCount:e.vTileCount,blendTiles:e.blendTiles,softParticles:e.softParticles,softNearFade:e.softNearFade,softFarFade:e.softFarFade,layers:t},this.frustumCulled=!1,this.renderOrder=this.settings.renderOrder}addSystem(e){this.systems.add(e)}removeSystem(e){this.systems.delete(e)}applyDepthTexture(e){let t=this.material.uniforms.depthTexture;t&&t.value!==e&&(t.value=e,this.material.needsUpdate=!0)}getVisibleSystems(){return Array.from(this.systems).filter(e=>e.emitter.visible)}},Ed=new F(0,0,1),Dd=new pl,Od=new F,kd=new F;new F;var Ad=60,jd=new Ee(1,1,1,1),Md=class e{set time(e){this.emissionState.time=e}get time(){return this.emissionState.time}get layers(){return this.rendererSettings.layers}get texture(){return this.rendererSettings.material.map}set texture(e){this.rendererSettings.material.map=e,this.neededToUpdateRender=!0}get material(){return this.rendererSettings.material}set material(e){this.rendererSettings.material=e,this.neededToUpdateRender=!0}get uTileCount(){return this.rendererSettings.uTileCount}set uTileCount(e){this.rendererSettings.uTileCount=e,this.neededToUpdateRender=!0}get vTileCount(){return this.rendererSettings.vTileCount}set vTileCount(e){this.rendererSettings.vTileCount=e,this.neededToUpdateRender=!0}get blendTiles(){return this.rendererSettings.blendTiles}set blendTiles(e){this.rendererSettings.blendTiles=e,this.neededToUpdateRender=!0}get softParticles(){return this.rendererSettings.softParticles}set softParticles(e){this.rendererSettings.softParticles=e,this.neededToUpdateRender=!0}get softNearFade(){return this.rendererSettings.softNearFade}set softNearFade(e){this.rendererSettings.softNearFade=e,this.neededToUpdateRender=!0}get softFarFade(){return this.rendererSettings.softFarFade}set softFarFade(e){this.rendererSettings.softFarFade=e,this.neededToUpdateRender=!0}get instancingGeometry(){return this.rendererSettings.instancingGeometry}set instancingGeometry(e){this.restart(),this.particles.length=0,this.rendererSettings.instancingGeometry=e,this.neededToUpdateRender=!0}get renderMode(){return this.rendererSettings.renderMode}set renderMode(e){if(this.rendererSettings.renderMode!==e){let t=!1;switch(this.rendererSettings.renderMode===R.Trail&&(t=!0),this.rendererSettings.renderMode===R.Mesh&&(this.startRotation=new I(0)),e){case R.Trail:this.rendererEmitterSettings={startLength:new I(30),followLocalOrigin:!1},t=!0;break;case R.Mesh:this.rendererEmitterSettings={geometry:jd},this.startRotation=new Ql(new F(0,1,0),new I(0));break;case R.StretchedBillBoard:this.rendererEmitterSettings={speedFactor:0,lengthFactor:2},this.rendererSettings.instancingGeometry=jd;break;case R.BillBoard:case R.VerticalBillBoard:case R.HorizontalBillBoard:this.rendererEmitterSettings={},this.rendererSettings.instancingGeometry=jd;break}this.rendererSettings.renderMode=e,t&&(this.restart(),this.particles.length=0),this.neededToUpdateRender=!0}}get renderOrder(){return this.rendererSettings.renderOrder}set renderOrder(e){this.rendererSettings.renderOrder=e,this.neededToUpdateRender=!0}get blending(){return this.rendererSettings.material.blending}set blending(e){this.rendererSettings.material.blending=e,this.neededToUpdateRender=!0}constructor(e){if(this.temp=new F,this.travelDistance=0,this.normalMatrix=new Al,this.memory=[],this.listeners={},this.firstTimeUpdate=!0,this.autoDestroy=e.autoDestroy===void 0?!1:e.autoDestroy,this.duration=e.duration??1,this.looping=e.looping===void 0?!0:e.looping,this.prewarm=e.prewarm===void 0?!1:e.prewarm,this.startLife=e.startLife??new I(5),this.startSpeed=e.startSpeed??new I(0),this.startRotation=e.startRotation??new I(0),this.startSize=e.startSize??new I(1),this.startColor=e.startColor??new Kl(new kl(1,1,1,1)),this.emissionOverTime=e.emissionOverTime??new I(10),this.emissionOverDistance=e.emissionOverDistance??new I(0),this.emissionBursts=e.emissionBursts??[],this.onlyUsedByOther=e.onlyUsedByOther??!1,this.emitterShape=e.shape??new pu,this.behaviors=e.behaviors??[],this.worldSpace=e.worldSpace??!1,this.rendererEmitterSettings=e.rendererEmitterSettings??{},e.renderMode===R.StretchedBillBoard){let t=this.rendererEmitterSettings;e.speedFactor!==void 0&&(t.speedFactor=e.speedFactor),t.speedFactor=t.speedFactor??0,t.lengthFactor=t.lengthFactor??0}this.rendererSettings={instancingGeometry:e.instancingGeometry??jd,renderMode:e.renderMode??R.BillBoard,renderOrder:e.renderOrder??0,material:e.material,uTileCount:e.uTileCount??1,vTileCount:e.vTileCount??1,blendTiles:e.blendTiles??!1,softParticles:e.softParticles??!1,softNearFade:e.softNearFade??0,softFarFade:e.softFarFade??0,layers:e.layers??new o},this.neededToUpdateRender=!0,this.particles=[],this.startTileIndex=e.startTileIndex||new I(0),this.emitter=new wd(this),this.paused=!1,this.particleNum=0,this.emissionState={isBursting:!1,burstParticleIndex:0,burstParticleCount:0,burstIndex:0,burstWaveIndex:0,time:0,waitEmiting:0,travelDistance:0},this.emissionBursts.forEach(e=>e.count.startGen(this.memory)),this.emissionOverDistance.startGen(this.memory),this.emitEnded=!1,this.markForDestroy=!1,this.prewarmed=!1}pause(){this.paused=!0}play(){this.paused=!1}stop(){this.restart(),this.pause()}spawn(e,t,n){Dd.setFromRotationMatrix(n);let r=Od,i=Dd,a=kd;n.decompose(r,i,a);for(let r=0;r<e;r++){for(t.burstParticleIndex=r,this.particleNum++;this.particles.length<this.particleNum;)this.rendererSettings.renderMode===R.Trail?this.particles.push(new ju):this.particles.push(new ku);let e=this.particles[this.particleNum-1];if(e.reset(),e.speedModifier=1,this.startColor.startGen(e.memory),this.startColor.genColor(e.memory,e.startColor,this.emissionState.time),e.color.copy(e.startColor),this.startSpeed.startGen(e.memory),e.startSpeed=this.startSpeed.genValue(e.memory,t.time/this.duration),this.startLife.startGen(e.memory),e.life=this.startLife.genValue(e.memory,t.time/this.duration),e.age=0,this.startSize.startGen(e.memory),this.startSize.type===`vec3function`)this.startSize.genValue(e.memory,e.startSize,t.time/this.duration);else{let n=this.startSize.genValue(e.memory,t.time/this.duration);e.startSize.set(n,n,n)}if(this.startTileIndex.startGen(e.memory),e.uvTile=this.startTileIndex.genValue(e.memory),e.size.copy(e.startSize),this.rendererSettings.renderMode===R.Mesh||this.rendererSettings.renderMode===R.BillBoard||this.rendererSettings.renderMode===R.VerticalBillBoard||this.rendererSettings.renderMode===R.HorizontalBillBoard||this.rendererSettings.renderMode===R.StretchedBillBoard){let n=e;this.startRotation.startGen(e.memory),this.rendererSettings.renderMode===R.Mesh?(n.rotation instanceof pl||(n.rotation=new pl),this.startRotation.type===`rotation`?this.startRotation.genValue(e.memory,n.rotation,1,t.time/this.duration):n.rotation.setFromAxisAngle(Ed,this.startRotation.genValue(n.memory,t.time/this.duration))):this.startRotation.type===`rotation`?n.rotation=0:n.rotation=this.startRotation.genValue(n.memory,t.time/this.duration)}else if(this.rendererSettings.renderMode===R.Trail){let n=e;this.rendererEmitterSettings.startLength.startGen(n.memory),n.length=this.rendererEmitterSettings.startLength.genValue(n.memory,t.time/this.duration)}if(this.emitterShape.initialize(e,t),this.rendererSettings.renderMode===R.Trail&&this.rendererEmitterSettings.followLocalOrigin){let t=e;t.localPosition=new F().copy(t.position)}this.worldSpace?(e.position.applyMatrix4(n),e.startSize.multiply(a).abs(),e.size.copy(e.startSize),e.velocity.multiply(a).applyMatrix3(this.normalMatrix),e.rotation&&e.rotation instanceof pl&&e.rotation.multiplyQuaternions(Dd,e.rotation)):this.onlyUsedByOther&&(e.parentMatrix=n);for(let t=0;t<this.behaviors.length;t++)this.behaviors[t].initialize(e,this)}}endEmit(){this.emitEnded=!0,this.autoDestroy&&(this.markForDestroy=!0),this.fire({type:`emitEnd`,particleSystem:this})}dispose(){this._renderer&&this._renderer.deleteSystem(this),this.emitter.dispose(),this.emitter.parent&&this.emitter.parent.remove(this.emitter),this.fire({type:`destroy`,particleSystem:this})}restart(){this.memory.length=0,this.paused=!1,this.particleNum=0,this.emissionState.isBursting=!1,this.emissionState.burstIndex=0,this.emissionState.burstWaveIndex=0,this.emissionState.time=0,this.emissionState.waitEmiting=0,this.behaviors.forEach(e=>{e.reset()}),this.emitEnded=!1,this.markForDestroy=!1,this.prewarmed=!1,this.emissionBursts.forEach(e=>e.count.startGen(this.memory)),this.emissionOverDistance.startGen(this.memory)}update(e){if(this.paused)return;let t=this.emitter;for(;t.parent;)t=t.parent;if(t.type!==`Scene`){this.dispose();return}if(this.firstTimeUpdate&&(this.firstTimeUpdate=!1,this.emitter.updateWorldMatrix(!0,!1)),this.emitEnded&&this.particleNum===0){this.markForDestroy&&this.emitter.parent&&this.dispose();return}if(this.looping&&this.prewarm&&!this.prewarmed){this.prewarmed=!0;for(let e=0;e<this.duration*Ad;e++)this.update(1/Ad)}e>.1&&(e=.1),this.neededToUpdateRender&&=(this._renderer&&this._renderer.updateSystem(this),!1),this.onlyUsedByOther||this.emit(e,this.emissionState,this.emitter.matrixWorld),this.emitterShape.update(this,e);for(let t=0;t<this.behaviors.length;t++){this.behaviors[t].frameUpdate(e);for(let n=0;n<this.particleNum;n++)this.particles[n].died||this.behaviors[t].update(this.particles[n],e)}for(let t=0;t<this.particleNum;t++)this.rendererEmitterSettings.followLocalOrigin&&this.particles[t].localPosition?(this.particles[t].position.copy(this.particles[t].localPosition),this.particles[t].parentMatrix?this.particles[t].position.applyMatrix4(this.particles[t].parentMatrix):this.particles[t].position.applyMatrix4(this.emitter.matrixWorld)):this.particles[t].position.addScaledVector(this.particles[t].velocity,e*this.particles[t].speedModifier),this.particles[t].age+=e;if(this.rendererSettings.renderMode===R.Trail)for(let e=0;e<this.particleNum;e++)this.particles[e].update();for(let e=0;e<this.particleNum;e++){let t=this.particles[e];t.died&&(!(t instanceof ju)||t.previous.length===0)&&(this.particles[e]=this.particles[this.particleNum-1],this.particles[this.particleNum-1]=t,this.particleNum--,e--,this.fire({type:`particleDied`,particleSystem:this,particle:t}))}}emit(e,t,n){t.time>this.duration&&(this.looping?(t.time-=this.duration,t.burstIndex=0,this.behaviors.forEach(e=>{e.reset()})):!this.emitEnded&&!this.onlyUsedByOther&&this.endEmit()),this.normalMatrix.getNormalMatrix(n);let r=Math.ceil(t.waitEmiting);for(this.spawn(r,t,n),t.waitEmiting-=r;t.burstIndex<this.emissionBursts.length&&this.emissionBursts[t.burstIndex].time<=t.time;){if(Math.random()<this.emissionBursts[t.burstIndex].probability){let e=this.emissionBursts[t.burstIndex].count.genValue(this.memory,this.time);t.isBursting=!0,t.burstParticleCount=e,this.spawn(e,t,n),t.isBursting=!1}t.burstIndex++}if(!this.emitEnded&&(t.waitEmiting+=e*this.emissionOverTime.genValue(this.memory,t.time/this.duration),t.previousWorldPos!=null)){this.temp.set(n.elements[12],n.elements[13],n.elements[14]),t.travelDistance+=t.previousWorldPos.distanceTo(this.temp);let e=this.emissionOverDistance.genValue(this.memory,t.time/this.duration);if(t.travelDistance*e>0){let n=Math.floor(t.travelDistance*e);t.travelDistance-=n/e,t.waitEmiting+=n}}t.previousWorldPos===void 0&&(t.previousWorldPos=new F),t.previousWorldPos.set(n.elements[12],n.elements[13],n.elements[14]),t.time+=e}toJSON(e,t={}){if((e===void 0||typeof e==`string`)&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}}),e.materials[this.rendererSettings.material.uuid]=this.rendererSettings.material.toJSON(e),t.useUrlForImage&&this.texture?.source!==void 0){let t=this.texture.source;e.images[t.uuid]={uuid:t.uuid,url:this.texture.image.url}}let n;n=this.renderMode===R.Trail?{startLength:this.rendererEmitterSettings.startLength.toJSON(),followLocalOrigin:this.rendererEmitterSettings.followLocalOrigin}:this.renderMode===R.Mesh?{}:this.renderMode===R.StretchedBillBoard?{speedFactor:this.rendererEmitterSettings.speedFactor,lengthFactor:this.rendererEmitterSettings.lengthFactor}:{};let r=this.rendererSettings.instancingGeometry;return e.geometries&&!e.geometries[r.uuid]&&(e.geometries[r.uuid]=r.toJSON()),{version:`3.0`,autoDestroy:this.autoDestroy,looping:this.looping,prewarm:this.prewarm,duration:this.duration,shape:this.emitterShape.toJSON(),startLife:this.startLife.toJSON(),startSpeed:this.startSpeed.toJSON(),startRotation:this.startRotation.toJSON(),startSize:this.startSize.toJSON(),startColor:this.startColor.toJSON(),emissionOverTime:this.emissionOverTime.toJSON(),emissionOverDistance:this.emissionOverDistance.toJSON(),emissionBursts:this.emissionBursts.map(e=>({time:e.time,count:e.count.toJSON(),probability:e.probability,interval:e.interval,cycle:e.cycle})),onlyUsedByOther:this.onlyUsedByOther,instancingGeometry:this.rendererSettings.instancingGeometry.uuid,renderOrder:this.renderOrder,renderMode:this.renderMode,rendererEmitterSettings:n,material:this.rendererSettings.material.uuid,layers:this.layers.mask,startTileIndex:this.startTileIndex.toJSON(),uTileCount:this.uTileCount,vTileCount:this.vTileCount,blendTiles:this.blendTiles,softParticles:this.rendererSettings.softParticles,softFarFade:this.rendererSettings.softFarFade,softNearFade:this.rendererSettings.softNearFade,behaviors:this.behaviors.map(e=>e.toJSON()),worldSpace:this.worldSpace}}static fromJSON(t,n,r){let i=vu(t.shape,n),a;if(t.renderMode===R.Trail){let e=t.rendererEmitterSettings;a={startLength:e.startLength==null?new I(30):L(e.startLength),followLocalOrigin:e.followLocalOrigin}}else t.renderMode===R.Mesh?a={}:t.renderMode===R.StretchedBillBoard?(a=t.rendererEmitterSettings,t.speedFactor!=null&&(a.speedFactor=t.speedFactor)):a={};let s=new o;t.layers&&(s.mask=t.layers);let c=new e({autoDestroy:t.autoDestroy,looping:t.looping,prewarm:t.prewarm,duration:t.duration,shape:i,startLife:L(t.startLife),startSpeed:L(t.startSpeed),startRotation:ru(t.startRotation),startSize:ru(t.startSize),startColor:ql(t.startColor),emissionOverTime:L(t.emissionOverTime),emissionOverDistance:L(t.emissionOverDistance),emissionBursts:t.emissionBursts?.map(e=>({time:e.time,count:typeof e.count==`number`?new I(e.count):L(e.count),probability:e.probability??1,interval:e.interval??.1,cycle:e.cycle??1})),onlyUsedByOther:t.onlyUsedByOther,instancingGeometry:n.geometries[t.instancingGeometry],renderMode:t.renderMode,rendererEmitterSettings:a,renderOrder:t.renderOrder,layers:s,material:t.material?n.materials[t.material]:t.texture?new ae({map:n.textures[t.texture],transparent:t.transparent??!0,blending:t.blending,side:2}):new ae({color:16777215,transparent:!0,blending:2,side:2}),startTileIndex:typeof t.startTileIndex==`number`?new I(t.startTileIndex):L(t.startTileIndex),uTileCount:t.uTileCount,vTileCount:t.vTileCount,blendTiles:t.blendTiles,softParticles:t.softParticles,softFarFade:t.softFarFade,softNearFade:t.softNearFade,behaviors:[],worldSpace:t.worldSpace});return c.behaviors=t.behaviors.map(e=>{let t=ld(e,c);return t&&t.type===`EmitSubParticleSystem`&&(r[e.subParticleSystem]=t),t}).filter(e=>e!==null),c}addBehavior(e){this.behaviors.push(e)}getRendererSettings(){return this.rendererSettings}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}removeAllEventListeners(e){this.listeners[e]&&(this.listeners[e]=[])}removeEventListener(e,t){if(this.listeners[e]){let n=this.listeners[e].indexOf(t);n!==-1&&this.listeners[e].splice(n,1)}}fire(e){this.listeners[e.type]&&this.listeners[e.type].forEach(t=>t(e))}clone(){let t=[];for(let e of this.emissionBursts){let n={};Object.assign(n,e),t.push(n)}let n=[];for(let e of this.behaviors)n.push(e.clone());let r;r=this.renderMode===R.Trail?{startLength:this.rendererEmitterSettings.startLength.clone(),followLocalOrigin:this.rendererEmitterSettings.followLocalOrigin}:this.renderMode===R.StretchedBillBoard?{lengthFactor:this.rendererEmitterSettings.lengthFactor,speedFactor:this.rendererEmitterSettings.speedFactor}:{};let i=new o;return i.mask=this.layers.mask,new e({autoDestroy:this.autoDestroy,looping:this.looping,duration:this.duration,shape:this.emitterShape.clone(),startLife:this.startLife.clone(),startSpeed:this.startSpeed.clone(),startRotation:this.startRotation.clone(),startSize:this.startSize.clone(),startColor:this.startColor.clone(),emissionOverTime:this.emissionOverTime.clone(),emissionOverDistance:this.emissionOverDistance.clone(),emissionBursts:t,onlyUsedByOther:this.onlyUsedByOther,instancingGeometry:this.rendererSettings.instancingGeometry,renderMode:this.renderMode,renderOrder:this.renderOrder,rendererEmitterSettings:r,material:this.rendererSettings.material,startTileIndex:this.startTileIndex,uTileCount:this.uTileCount,vTileCount:this.vTileCount,blendTiles:this.blendTiles,softParticles:this.softParticles,softFarFade:this.softFarFade,softNearFade:this.softNearFade,behaviors:n,worldSpace:this.worldSpace,layers:i})}},Nd=`
916
-
917
- #include <common>
918
- #include <color_pars_fragment>
919
- #include <map_pars_fragment>
920
- #include <logdepthbuf_pars_fragment>
921
- #include <clipping_planes_pars_fragment>
922
- #include <alphatest_pars_fragment>
923
-
924
- #include <tile_pars_fragment>
925
- #include <soft_pars_fragment>
926
-
927
- void main() {
928
-
929
- #include <clipping_planes_fragment>
930
-
931
- vec3 outgoingLight = vec3( 0.0 );
932
- vec4 diffuseColor = vColor;
933
-
934
- #include <logdepthbuf_fragment>
935
-
936
- #include <tile_fragment>
937
- #include <alphatest_fragment>
938
-
939
- outgoingLight = diffuseColor.rgb;
940
-
941
- #ifdef USE_COLOR_AS_ALPHA
942
- gl_FragColor = vec4( outgoingLight, diffuseColor.r );
943
- #else
944
- gl_FragColor = vec4( outgoingLight, diffuseColor.a );
945
- #endif
946
-
947
- #include <soft_fragment>
948
- #include <tonemapping_fragment>
949
- }
950
- `,Pd=`
951
- #define STANDARD
952
-
953
- #ifdef PHYSICAL
954
- #define IOR
955
- #define USE_SPECULAR
956
- #endif
957
-
958
- uniform vec3 diffuse;
959
- uniform vec3 emissive;
960
- uniform float roughness;
961
- uniform float metalness;
962
- uniform float opacity;
963
-
964
- #ifdef IOR
965
- uniform float ior;
966
- #endif
967
-
968
- #ifdef USE_SPECULAR
969
- uniform float specularIntensity;
970
- uniform vec3 specularColor;
971
-
972
- #ifdef USE_SPECULAR_COLORMAP
973
- uniform sampler2D specularColorMap;
974
- #endif
975
-
976
- #ifdef USE_SPECULAR_INTENSITYMAP
977
- uniform sampler2D specularIntensityMap;
978
- #endif
979
- #endif
980
-
981
- #ifdef USE_CLEARCOAT
982
- uniform float clearcoat;
983
- uniform float clearcoatRoughness;
984
- #endif
985
-
986
- #ifdef USE_DISPERSION
987
- uniform float dispersion;
988
- #endif
989
-
990
- #ifdef USE_IRIDESCENCE
991
- uniform float iridescence;
992
- uniform float iridescenceIOR;
993
- uniform float iridescenceThicknessMinimum;
994
- uniform float iridescenceThicknessMaximum;
995
- #endif
996
-
997
- #ifdef USE_SHEEN
998
- uniform vec3 sheenColor;
999
- uniform float sheenRoughness;
1000
-
1001
- #ifdef USE_SHEEN_COLORMAP
1002
- uniform sampler2D sheenColorMap;
1003
- #endif
1004
-
1005
- #ifdef USE_SHEEN_ROUGHNESSMAP
1006
- uniform sampler2D sheenRoughnessMap;
1007
- #endif
1008
- #endif
1009
-
1010
- #ifdef USE_ANISOTROPY
1011
- uniform vec2 anisotropyVector;
1012
-
1013
- #ifdef USE_ANISOTROPYMAP
1014
- uniform sampler2D anisotropyMap;
1015
- #endif
1016
- #endif
1017
-
1018
- varying vec3 vViewPosition;
1019
-
1020
- #include <common>
1021
- #include <packing>
1022
- #include <dithering_pars_fragment>
1023
- #include <color_pars_fragment>
1024
- #include <uv_pars_fragment>
1025
- #include <map_pars_fragment>
1026
- #include <alphamap_pars_fragment>
1027
- #include <alphatest_pars_fragment>
1028
- #include <alphahash_pars_fragment>
1029
- #include <aomap_pars_fragment>
1030
- #include <lightmap_pars_fragment>
1031
- #include <emissivemap_pars_fragment>
1032
- #include <iridescence_fragment>
1033
- #include <cube_uv_reflection_fragment>
1034
- #include <envmap_common_pars_fragment>
1035
- #include <envmap_physical_pars_fragment>
1036
- #include <fog_pars_fragment>
1037
- #include <lights_pars_begin>
1038
- #include <normal_pars_fragment>
1039
- #include <lights_physical_pars_fragment>
1040
- #include <transmission_pars_fragment>
1041
- #include <shadowmap_pars_fragment>
1042
- #include <bumpmap_pars_fragment>
1043
- #include <normalmap_pars_fragment>
1044
- #include <clearcoat_pars_fragment>
1045
- #include <iridescence_pars_fragment>
1046
- #include <roughnessmap_pars_fragment>
1047
- #include <metalnessmap_pars_fragment>
1048
- #include <logdepthbuf_pars_fragment>
1049
- #include <clipping_planes_pars_fragment>
1050
-
1051
- void main() {
1052
-
1053
- vec4 diffuseColor = vec4( diffuse, opacity );
1054
- #include <clipping_planes_fragment>
1055
-
1056
- ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
1057
- vec3 totalEmissiveRadiance = emissive;
1058
-
1059
- #include <logdepthbuf_fragment>
1060
- #include <map_fragment>
1061
- #include <color_fragment>
1062
- #include <alphamap_fragment>
1063
- #include <alphatest_fragment>
1064
- #include <alphahash_fragment>
1065
- #include <roughnessmap_fragment>
1066
- #include <metalnessmap_fragment>
1067
- #include <normal_fragment_begin>
1068
- #include <normal_fragment_maps>
1069
- #include <clearcoat_normal_fragment_begin>
1070
- #include <clearcoat_normal_fragment_maps>
1071
- #include <emissivemap_fragment>
1072
-
1073
- // accumulation
1074
- #include <lights_physical_fragment>
1075
- #include <lights_fragment_begin>
1076
- #include <lights_fragment_maps>
1077
- #include <lights_fragment_end>
1078
-
1079
- // modulation
1080
- #include <aomap_fragment>
1081
-
1082
- vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
1083
- vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
1084
-
1085
- #include <transmission_fragment>
1086
-
1087
- vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
1088
-
1089
- #ifdef USE_SHEEN
1090
-
1091
- // Sheen energy compensation approximation calculation can be found at the end of
1092
- // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
1093
- float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
1094
-
1095
- outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
1096
-
1097
- #endif
1098
-
1099
- #ifdef USE_CLEARCOAT
1100
-
1101
- float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
1102
-
1103
- vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
1104
-
1105
- outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
1106
-
1107
- #endif
1108
-
1109
- #include <opaque_fragment>
1110
- #include <tonemapping_fragment>
1111
- #include <colorspace_fragment>
1112
- #include <fog_fragment>
1113
- #include <premultiplied_alpha_fragment>
1114
- #include <dithering_fragment>
1115
- }`,Fd=`
1116
- #include <common>
1117
- #include <color_pars_vertex>
1118
- #include <logdepthbuf_pars_vertex>
1119
- #include <clipping_planes_pars_vertex>
1120
-
1121
- #include <tile_pars_vertex>
1122
- #include <soft_pars_vertex>
1123
-
1124
- attribute vec3 offset;
1125
- attribute float rotation;
1126
- attribute vec3 size;
1127
-
1128
- void main() {
1129
-
1130
- vec2 alignedPosition = position.xy * size.xy;
1131
-
1132
- vec2 rotatedPosition;
1133
- rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
1134
- rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
1135
- #ifdef HORIZONTAL
1136
- vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );
1137
- mvPosition.x += rotatedPosition.x;
1138
- mvPosition.z -= rotatedPosition.y;
1139
- mvPosition = viewMatrix * mvPosition;
1140
- #elif defined(VERTICAL)
1141
- vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );
1142
- mvPosition.y += rotatedPosition.y;
1143
- mvPosition = viewMatrix * mvPosition;
1144
- mvPosition.x += rotatedPosition.x;
1145
- #else
1146
- vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
1147
- mvPosition.xy += rotatedPosition;
1148
- #endif
1149
-
1150
- vColor = color;
1151
-
1152
- gl_Position = projectionMatrix * mvPosition;
1153
-
1154
- #include <logdepthbuf_vertex>
1155
-
1156
- #include <clipping_planes_vertex>
1157
-
1158
- #include <tile_vertex>
1159
- #include <soft_vertex>
1160
- }
1161
- `,Id=`
1162
- #include <common>
1163
- #include <color_pars_vertex>
1164
- #include <logdepthbuf_pars_vertex>
1165
- #include <clipping_planes_pars_vertex>
1166
- #include <tile_pars_vertex>
1167
- #include <soft_pars_vertex>
1168
-
1169
- attribute vec3 offset;
1170
- attribute vec4 rotation;
1171
- attribute vec3 size;
1172
- // attribute vec4 color;
1173
-
1174
- void main() {
1175
-
1176
- float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;
1177
- float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;
1178
- float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;
1179
- float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;
1180
- float sx = size.x, sy = size.y, sz = size.z;
1181
-
1182
- mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column
1183
- ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column
1184
- ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column
1185
- offset.x, offset.y, offset.z, 1.0);
1186
-
1187
- vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));
1188
-
1189
- vColor = color;
1190
-
1191
- gl_Position = projectionMatrix * mvPosition;
1192
-
1193
- #include <logdepthbuf_vertex>
1194
- #include <clipping_planes_vertex>
1195
- #include <tile_vertex>
1196
- #include <soft_vertex>
1197
- }
1198
- `,Ld=`
1199
- #define STANDARD
1200
- varying vec3 vViewPosition;
1201
- #ifdef USE_TRANSMISSION
1202
- varying vec3 vWorldPosition;
1203
- #endif
1204
- #include <common>
1205
-
1206
- attribute vec3 offset;
1207
- attribute vec4 rotation;
1208
- attribute vec3 size;
1209
- #include <tile_pars_vertex>
1210
- #include <displacementmap_pars_vertex>
1211
- #include <color_pars_vertex>
1212
- #include <fog_pars_vertex>
1213
- #include <normal_pars_vertex>
1214
- #include <morphtarget_pars_vertex>
1215
- #include <skinning_pars_vertex>
1216
- #include <shadowmap_pars_vertex>
1217
- #include <logdepthbuf_pars_vertex>
1218
- #include <clipping_planes_pars_vertex>
1219
-
1220
- void main() {
1221
-
1222
- #include <tile_vertex>
1223
- float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;
1224
- float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;
1225
- float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;
1226
- float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;
1227
- float sx = size.x, sy = size.y, sz = size.z;
1228
-
1229
- mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column
1230
- ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column
1231
- ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column
1232
- offset.x, offset.y, offset.z, 1.0);
1233
-
1234
- #include <color_vertex>
1235
- #include <morphinstance_vertex>
1236
- #include <morphcolor_vertex>
1237
- #include <batching_vertex>
1238
-
1239
- #include <beginnormal_vertex>
1240
- #include <morphnormal_vertex>
1241
- #include <skinbase_vertex>
1242
- #include <skinnormal_vertex>
1243
-
1244
- // replace defaultnormal_vertex
1245
- vec3 transformedNormal = objectNormal;
1246
- mat3 m = mat3( particleMatrix );
1247
- transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
1248
- transformedNormal = m * transformedNormal;
1249
- transformedNormal = normalMatrix * transformedNormal;
1250
- #ifdef FLIP_SIDED
1251
- transformedNormal = - transformedNormal;
1252
- #endif
1253
- #ifdef USE_TANGENT
1254
- vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
1255
- #ifdef FLIP_SIDED
1256
- transformedTangent = - transformedTangent;
1257
- #endif
1258
- #endif
1259
-
1260
- #include <normal_vertex>
1261
- #include <begin_vertex>
1262
- #include <morphtarget_vertex>
1263
- #include <skinning_vertex>
1264
- #include <displacementmap_vertex>
1265
-
1266
- // replace include <project_vertex>
1267
- vec4 mvPosition = vec4( transformed, 1.0 );
1268
- mvPosition = modelViewMatrix * (particleMatrix * mvPosition);
1269
- gl_Position = projectionMatrix * mvPosition;
1270
-
1271
- #include <logdepthbuf_vertex>
1272
- #include <clipping_planes_vertex>
1273
-
1274
- vViewPosition = - mvPosition.xyz;
1275
-
1276
- #include <worldpos_vertex>
1277
- #include <shadowmap_vertex>
1278
- #include <fog_vertex>
1279
- #ifdef USE_TRANSMISSION
1280
- vWorldPosition = worldPosition.xyz;
1281
- #endif
1282
- }
1283
- `,Rd=`
1284
- #include <common>
1285
- #include <color_pars_vertex>
1286
- #include <logdepthbuf_pars_vertex>
1287
- #include <clipping_planes_pars_vertex>
1288
-
1289
- #include <tile_pars_vertex>
1290
- #include <soft_pars_vertex>
1291
-
1292
- attribute vec3 offset;
1293
- attribute float rotation;
1294
- attribute vec3 size;
1295
- attribute vec4 velocity;
1296
-
1297
- uniform float speedFactor;
1298
-
1299
- void main() {
1300
- float lengthFactor = velocity.w;
1301
- float avgSize = (size.x + size.y) * 0.5;
1302
- #ifdef USE_SKEW
1303
- vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
1304
- vec3 viewVelocity = normalMatrix * velocity.xyz;
1305
-
1306
- vec3 scaledPos = vec3(position.xy * size.xy, position.z);
1307
- float vlength = length(viewVelocity);
1308
- vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;
1309
- mvPosition.xyz += scaledPos + projVelocity * (speedFactor / avgSize + lengthFactor / vlength);
1310
- #else
1311
- vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );
1312
- vec3 viewVelocity = normalMatrix * velocity.xyz;
1313
- float vlength = length(viewVelocity);
1314
- mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * avgSize; // switch the cross to match unity implementation
1315
- mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * avgSize; // minus position.x to match unity implementation
1316
- #endif
1317
- vColor = color;
1318
- gl_Position = projectionMatrix * mvPosition;
1319
- #include <logdepthbuf_vertex>
1320
- #include <clipping_planes_vertex>
1321
- #include <tile_vertex>
1322
- #include <soft_vertex>
1323
- }
1324
- `;function zd(e){return e===0?`uv`:`uv${e}`}var Bd=class extends ce{constructor(e){super(e)}onBeforeCompile(e,t){super.onBeforeCompile(e,t),e.vertexShader=Ld,e.fragmentShader=Pd}},Vd=class extends ee{constructor(e){super(e)}onBeforeCompile(e,t){super.onBeforeCompile(e,t),e.vertexShader=Ld,e.fragmentShader=Pd}},Hd=class extends Td{constructor(e){super(e),this.vector_=new F,this.vector2_=new F,this.vector3_=new F,this.quaternion_=new pl,this.quaternion2_=new pl,this.quaternion3_=new pl,this.rotationMat_=new Al,this.rotationMat2_=new Al,this.maxParticles=1e3,this.setupBuffers(),this.rebuildMaterial()}buildExpandableBuffers(){this.offsetBuffer=new p(new Float32Array(this.maxParticles*3),3),this.offsetBuffer.setUsage(n),this.geometry.setAttribute(`offset`,this.offsetBuffer),this.colorBuffer=new p(new Float32Array(this.maxParticles*4),4),this.colorBuffer.setUsage(n),this.geometry.setAttribute(`color`,this.colorBuffer),this.settings.renderMode===R.Mesh?(this.rotationBuffer=new p(new Float32Array(this.maxParticles*4),4),this.rotationBuffer.setUsage(n),this.geometry.setAttribute(`rotation`,this.rotationBuffer)):(this.settings.renderMode===R.BillBoard||this.settings.renderMode===R.HorizontalBillBoard||this.settings.renderMode===R.VerticalBillBoard||this.settings.renderMode===R.StretchedBillBoard)&&(this.rotationBuffer=new p(new Float32Array(this.maxParticles),1),this.rotationBuffer.setUsage(n),this.geometry.setAttribute(`rotation`,this.rotationBuffer)),this.sizeBuffer=new p(new Float32Array(this.maxParticles*3),3),this.sizeBuffer.setUsage(n),this.geometry.setAttribute(`size`,this.sizeBuffer),this.uvTileBuffer=new p(new Float32Array(this.maxParticles),1),this.uvTileBuffer.setUsage(n),this.geometry.setAttribute(`uvTile`,this.uvTileBuffer),this.settings.renderMode===R.StretchedBillBoard&&(this.velocityBuffer=new p(new Float32Array(this.maxParticles*4),4),this.velocityBuffer.setUsage(n),this.geometry.setAttribute(`velocity`,this.velocityBuffer))}setupBuffers(){this.geometry&&this.geometry.dispose(),this.geometry=new i,this.geometry.setIndex(this.settings.instancingGeometry.getIndex()),this.settings.instancingGeometry.hasAttribute(`normal`)&&this.geometry.setAttribute(`normal`,this.settings.instancingGeometry.getAttribute(`normal`)),this.geometry.setAttribute(`position`,this.settings.instancingGeometry.getAttribute(`position`)),this.settings.instancingGeometry.hasAttribute(`uv`)&&this.geometry.setAttribute(`uv`,this.settings.instancingGeometry.getAttribute(`uv`)),this.buildExpandableBuffers()}expandBuffers(e){for(;e>=this.maxParticles;)this.maxParticles*=2;this.setupBuffers()}rebuildMaterial(){this.layers.mask=this.settings.layers.mask;let e={},t={};this.settings.material.type!==`MeshStandardMaterial`&&this.settings.material.type!==`MeshPhysicalMaterial`&&(e.map=new a(this.settings.material.map)),this.settings.material.alphaTest&&(t.USE_ALPHATEST=``,e.alphaTest=new a(this.settings.material.alphaTest)),t.USE_UV=``;let n=this.settings.uTileCount,r=this.settings.vTileCount;(n>1||r>1)&&(t.UV_TILE=``,e.tileCount=new a(new Ol(n,r))),this.settings.material.defines&&this.settings.material.defines.USE_COLOR_AS_ALPHA!==void 0&&(t.USE_COLOR_AS_ALPHA=``),this.settings.material.normalMap&&(t.USE_NORMALMAP=``,t.NORMALMAP_UV=zd(this.settings.material.normalMap.channel),e.normalMapTransform=new a(new Al().copy(this.settings.material.normalMap.matrix))),this.settings.material.map&&(t.USE_MAP=``,this.settings.blendTiles&&(t.TILE_BLEND=``),t.MAP_UV=zd(this.settings.material.map.channel),e.mapTransform=new a(new Al().copy(this.settings.material.map.matrix))),t.USE_COLOR_ALPHA=``;let i;if(this.settings.softParticles){t.SOFT_PARTICLES=``;let n=this.settings.softNearFade;e.softParams=new a(new Ol(n,1/(this.settings.softFarFade-this.settings.softNearFade))),e.depthTexture=new a(null);let r=e.projParams=new a(new kl);i=(e,t,n)=>{r.value.set(n.near,n.far,0,0)}}let o=!1;if(this.settings.renderMode===R.BillBoard||this.settings.renderMode===R.VerticalBillBoard||this.settings.renderMode===R.HorizontalBillBoard||this.settings.renderMode===R.Mesh){let n,r;this.settings.renderMode===R.Mesh?this.settings.material.type===`MeshStandardMaterial`||this.settings.material.type===`MeshPhysicalMaterial`?(t.USE_COLOR=``,n=Ld,r=Pd,o=!0):(n=Id,r=Nd):(n=Fd,r=Nd),this.settings.renderMode===R.VerticalBillBoard?t.VERTICAL=``:this.settings.renderMode===R.HorizontalBillBoard&&(t.HORIZONTAL=``);let i=!1;this.settings.renderMode===R.Mesh&&(this.settings.material.type===`MeshStandardMaterial`?(this.material=new Bd({}),this.material.copy(this.settings.material),this.material.uniforms=e,this.material.defines=t,i=!0):this.settings.material.type===`MeshPhysicalMaterial`&&(this.material=new Vd({}),this.material.copy(this.settings.material),this.material.uniforms=e,this.material.defines=t,i=!0)),i||(this.material=new m({uniforms:e,defines:t,vertexShader:n,fragmentShader:r,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,blending:this.settings.material.blending,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha,side:this.settings.material.side,alphaTest:this.settings.material.alphaTest,depthTest:this.settings.material.depthTest,lights:o}))}else if(this.settings.renderMode===R.StretchedBillBoard)e.speedFactor=new a(1),this.material=new m({uniforms:e,defines:t,vertexShader:Rd,fragmentShader:Nd,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,blending:this.settings.material.blending,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha,side:this.settings.material.side,alphaTest:this.settings.material.alphaTest,depthTest:this.settings.material.depthTest});else throw Error(`render mode unavailable`);this.material&&i&&(this.material.onBeforeRender=i)}update(){let e=0,t=0,n=this.getVisibleSystems();for(let e of n)t+=e.particleNum;t>this.maxParticles&&this.expandBuffers(t);for(let t of n){t.emitter.updateMatrixWorld&&(t.emitter.updateWorldMatrix(!0,!1),t.emitter.updateMatrixWorld(!0));let n=t.particles,r=t.particleNum,i=this.quaternion2_,a=this.vector2_,o=this.vector3_;t.emitter.matrixWorld.decompose(a,i,o),this.rotationMat_.setFromMatrix4(t.emitter.matrixWorld);for(let a=0;a<r;a++,e++){let r=n[a];if(this.settings.renderMode===R.Mesh){let n;if(t.worldSpace)n=r.rotation;else{let e;e=r.parentMatrix?this.quaternion3_.setFromRotationMatrix(r.parentMatrix):i,n=this.quaternion_,n.copy(e).multiply(r.rotation)}this.rotationBuffer.setXYZW(e,n.x,n.y,n.z,n.w)}else (this.settings.renderMode===R.StretchedBillBoard||this.settings.renderMode===R.VerticalBillBoard||this.settings.renderMode===R.HorizontalBillBoard||this.settings.renderMode===R.BillBoard)&&this.rotationBuffer.setX(e,r.rotation);let s;if(t.worldSpace?s=r.position:(s=this.vector_,r.parentMatrix?s.copy(r.position).applyMatrix4(r.parentMatrix):s.copy(r.position).applyMatrix4(t.emitter.matrixWorld)),this.offsetBuffer.setXYZ(e,s.x,s.y,s.z),this.colorBuffer.setXYZW(e,r.color.x,r.color.y,r.color.z,r.color.w),t.worldSpace||r.parentMatrix?this.sizeBuffer.setXYZ(e,r.size.x,r.size.y,r.size.z):this.sizeBuffer.setXYZ(e,r.size.x*Math.abs(o.x),r.size.y*Math.abs(o.y),r.size.z*Math.abs(o.z)),this.uvTileBuffer.setX(e,r.uvTile),this.settings.renderMode===R.StretchedBillBoard&&this.velocityBuffer){let n=t.rendererEmitterSettings.speedFactor;n===0&&(n=.001);let i=t.rendererEmitterSettings.lengthFactor,a;t.worldSpace?a=r.velocity:(a=this.vector_,r.parentMatrix?(this.rotationMat2_.setFromMatrix4(r.parentMatrix),a.copy(r.velocity).applyMatrix3(this.rotationMat2_)):a.copy(r.velocity).applyMatrix3(this.rotationMat_)),this.velocityBuffer.setXYZW(e,a.x*n,a.y*n,a.z*n,i)}}}this.geometry.instanceCount=e,e>0&&(this.offsetBuffer.clearUpdateRanges(),this.offsetBuffer.addUpdateRange(0,e*3),this.offsetBuffer.needsUpdate=!0,this.sizeBuffer.clearUpdateRanges(),this.sizeBuffer.addUpdateRange(0,e*3),this.sizeBuffer.needsUpdate=!0,this.colorBuffer.clearUpdateRanges(),this.colorBuffer.addUpdateRange(0,e*4),this.colorBuffer.needsUpdate=!0,this.uvTileBuffer.clearUpdateRanges(),this.uvTileBuffer.addUpdateRange(0,e),this.uvTileBuffer.needsUpdate=!0,this.settings.renderMode===R.StretchedBillBoard&&this.velocityBuffer&&(this.velocityBuffer.clearUpdateRanges(),this.velocityBuffer.addUpdateRange(0,e*4),this.velocityBuffer.needsUpdate=!0),this.settings.renderMode===R.Mesh?(this.rotationBuffer.clearUpdateRanges(),this.rotationBuffer.addUpdateRange(0,e*4),this.rotationBuffer.needsUpdate=!0):(this.settings.renderMode===R.StretchedBillBoard||this.settings.renderMode===R.HorizontalBillBoard||this.settings.renderMode===R.VerticalBillBoard||this.settings.renderMode===R.BillBoard)&&(this.rotationBuffer.clearUpdateRanges(),this.rotationBuffer.addUpdateRange(0,e),this.rotationBuffer.needsUpdate=!0))}dispose(){this.geometry.dispose()}},Ud=`
1325
-
1326
- #include <common>
1327
- #include <tile_pars_fragment>
1328
- #include <map_pars_fragment>
1329
- #include <fog_pars_fragment>
1330
- #include <logdepthbuf_pars_fragment>
1331
- #include <clipping_planes_pars_fragment>
1332
-
1333
- uniform sampler2D alphaMap;
1334
- uniform float useAlphaMap;
1335
- uniform float visibility;
1336
- uniform float alphaTest;
1337
-
1338
- varying vec4 vColor;
1339
-
1340
- void main() {
1341
- #include <clipping_planes_fragment>
1342
- #include <logdepthbuf_fragment>
1343
-
1344
- vec4 diffuseColor = vColor;
1345
-
1346
- #ifdef USE_MAP
1347
- #include <tile_fragment>
1348
- #ifndef USE_COLOR_AS_ALPHA
1349
- #endif
1350
- #endif
1351
- if( useAlphaMap == 1. ) diffuseColor.a *= texture2D( alphaMap, vUv).a;
1352
- if( diffuseColor.a < alphaTest ) discard;
1353
- gl_FragColor = diffuseColor;
1354
-
1355
- #include <fog_fragment>
1356
- #include <tonemapping_fragment>
1357
- }`,Wd=`
1358
- #include <common>
1359
- #include <tile_pars_vertex>
1360
- #include <color_pars_vertex>
1361
- #include <clipping_planes_pars_vertex>
1362
- #include <logdepthbuf_pars_vertex>
1363
- #include <fog_pars_vertex>
1364
-
1365
- attribute vec3 previous;
1366
- attribute vec3 next;
1367
- attribute float side;
1368
- attribute float width;
1369
-
1370
- uniform vec2 resolution;
1371
- uniform float lineWidth;
1372
- uniform float sizeAttenuation;
1373
-
1374
- vec2 fix(vec4 i, float aspect) {
1375
- vec2 res = i.xy / i.w;
1376
- res.x *= aspect;
1377
- return res;
1378
- }
1379
-
1380
- void main() {
1381
-
1382
- #include <tile_vertex>
1383
-
1384
- float aspect = resolution.x / resolution.y;
1385
-
1386
- vColor = color;
1387
-
1388
- mat4 m = projectionMatrix * modelViewMatrix;
1389
- vec4 finalPosition = m * vec4( position, 1.0 );
1390
- vec4 prevPos = m * vec4( previous, 1.0 );
1391
- vec4 nextPos = m * vec4( next, 1.0 );
1392
-
1393
- vec2 currentP = fix( finalPosition, aspect );
1394
- vec2 prevP = fix( prevPos, aspect );
1395
- vec2 nextP = fix( nextPos, aspect );
1396
-
1397
- float w = lineWidth * width;
1398
-
1399
- vec2 dir;
1400
- if( nextP == currentP ) dir = normalize( currentP - prevP );
1401
- else if( prevP == currentP ) dir = normalize( nextP - currentP );
1402
- else {
1403
- vec2 dir1 = normalize( currentP - prevP );
1404
- vec2 dir2 = normalize( nextP - currentP );
1405
- dir = normalize( dir1 + dir2 );
1406
-
1407
- vec2 perp = vec2( -dir1.y, dir1.x );
1408
- vec2 miter = vec2( -dir.y, dir.x );
1409
- //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );
1410
-
1411
- }
1412
-
1413
- //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;
1414
- vec4 normal = vec4( -dir.y, dir.x, 0., 1. );
1415
- normal.xy *= .5 * w;
1416
- normal *= projectionMatrix;
1417
- if( sizeAttenuation == 0. ) {
1418
- normal.xy *= finalPosition.w;
1419
- normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;
1420
- }
1421
-
1422
- finalPosition.xy += normal.xy * side;
1423
-
1424
- gl_Position = finalPosition;
1425
-
1426
- #include <logdepthbuf_vertex>
1427
- #include <clipping_planes_vertex>
1428
-
1429
- vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
1430
-
1431
- #include <fog_vertex>
1432
- }`,Gd=class extends Td{constructor(e){super(e),this.vector_=new F,this.vector2_=new F,this.vector3_=new F,this.quaternion_=new pl,this.maxParticles=1e4,this.setupBuffers(),this.rebuildMaterial()}setupBuffers(){this.geometry&&this.geometry.dispose(),this.geometry=new D,this.indexBuffer=new Te(new Uint32Array(this.maxParticles*6),1),this.indexBuffer.setUsage(n),this.geometry.setIndex(this.indexBuffer),this.positionBuffer=new Te(new Float32Array(this.maxParticles*6),3),this.positionBuffer.setUsage(n),this.geometry.setAttribute(`position`,this.positionBuffer),this.previousBuffer=new Te(new Float32Array(this.maxParticles*6),3),this.previousBuffer.setUsage(n),this.geometry.setAttribute(`previous`,this.previousBuffer),this.nextBuffer=new Te(new Float32Array(this.maxParticles*6),3),this.nextBuffer.setUsage(n),this.geometry.setAttribute(`next`,this.nextBuffer),this.widthBuffer=new Te(new Float32Array(this.maxParticles*2),1),this.widthBuffer.setUsage(n),this.geometry.setAttribute(`width`,this.widthBuffer),this.sideBuffer=new Te(new Float32Array(this.maxParticles*2),1),this.sideBuffer.setUsage(n),this.geometry.setAttribute(`side`,this.sideBuffer),this.uvBuffer=new Te(new Float32Array(this.maxParticles*4),2),this.uvBuffer.setUsage(n),this.geometry.setAttribute(`uv`,this.uvBuffer),this.colorBuffer=new Te(new Float32Array(this.maxParticles*8),4),this.colorBuffer.setUsage(n),this.geometry.setAttribute(`color`,this.colorBuffer)}expandBuffers(e){for(;e>=this.maxParticles;)this.maxParticles*=2;this.setupBuffers()}rebuildMaterial(){this.layers.mask=this.settings.layers.mask;let e={lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},resolution:{value:new Ol(1,1)},sizeAttenuation:{value:1},visibility:{value:1},alphaTest:{value:0}},t={};if(t.USE_UV=``,t.USE_COLOR_ALPHA=``,this.settings.material.map&&(t.USE_MAP=``,t.MAP_UV=zd(this.settings.material.map.channel),e.map=new a(this.settings.material.map),e.mapTransform=new a(new Al().copy(this.settings.material.map.matrix))),this.settings.material.defines&&this.settings.material.defines.USE_COLOR_AS_ALPHA!==void 0&&(t.USE_COLOR_AS_ALPHA=``),this.settings.renderMode===R.Trail)this.material=new m({uniforms:e,defines:t,vertexShader:Wd,fragmentShader:Ud,transparent:this.settings.material.transparent,depthWrite:!this.settings.material.transparent,side:this.settings.material.side,blending:this.settings.material.blending||2,blendDst:this.settings.material.blendDst,blendSrc:this.settings.material.blendSrc,blendEquation:this.settings.material.blendEquation,premultipliedAlpha:this.settings.material.premultipliedAlpha});else throw Error(`render mode unavailable`)}update(){let e=0,t=0,n=0,r=this.getVisibleSystems();for(let e of r)for(let t=0;t<e.particleNum;t++)n+=e.particles[t].previous.length*2;n>this.maxParticles&&this.expandBuffers(n);for(let n of r){n.emitter.updateMatrixWorld&&(n.emitter.updateWorldMatrix(!0,!1),n.emitter.updateMatrixWorld(!0));let r=this.quaternion_,i=this.vector2_,a=this.vector3_;n.emitter.matrixWorld.decompose(i,r,a);let o=n.particles,s=n.particleNum,c=this.settings.uTileCount,l=this.settings.vTileCount,u=1/c,d=1/l;for(let r=0;r<s;r++){let i=o[r],s=i.uvTile%l,c=Math.floor(i.uvTile/l+.001),f=i.previous.values(),p=f.next(),m=p.value,h=m;p.done||(p=f.next());let g;g=p.value===void 0?h:p.value;for(let r=0;r<i.previous.length;r++,e+=2){if(this.positionBuffer.setXYZ(e,h.position.x,h.position.y,h.position.z),this.positionBuffer.setXYZ(e+1,h.position.x,h.position.y,h.position.z),n.worldSpace?(this.positionBuffer.setXYZ(e,h.position.x,h.position.y,h.position.z),this.positionBuffer.setXYZ(e+1,h.position.x,h.position.y,h.position.z)):(i.parentMatrix?this.vector_.copy(h.position).applyMatrix4(i.parentMatrix):this.vector_.copy(h.position).applyMatrix4(n.emitter.matrixWorld),this.positionBuffer.setXYZ(e,this.vector_.x,this.vector_.y,this.vector_.z),this.positionBuffer.setXYZ(e+1,this.vector_.x,this.vector_.y,this.vector_.z)),n.worldSpace?(this.previousBuffer.setXYZ(e,m.position.x,m.position.y,m.position.z),this.previousBuffer.setXYZ(e+1,m.position.x,m.position.y,m.position.z)):(i.parentMatrix?this.vector_.copy(m.position).applyMatrix4(i.parentMatrix):this.vector_.copy(m.position).applyMatrix4(n.emitter.matrixWorld),this.previousBuffer.setXYZ(e,this.vector_.x,this.vector_.y,this.vector_.z),this.previousBuffer.setXYZ(e+1,this.vector_.x,this.vector_.y,this.vector_.z)),n.worldSpace?(this.nextBuffer.setXYZ(e,g.position.x,g.position.y,g.position.z),this.nextBuffer.setXYZ(e+1,g.position.x,g.position.y,g.position.z)):(i.parentMatrix?this.vector_.copy(g.position).applyMatrix4(i.parentMatrix):this.vector_.copy(g.position).applyMatrix4(n.emitter.matrixWorld),this.nextBuffer.setXYZ(e,this.vector_.x,this.vector_.y,this.vector_.z),this.nextBuffer.setXYZ(e+1,this.vector_.x,this.vector_.y,this.vector_.z)),this.sideBuffer.setX(e,1),this.sideBuffer.setX(e+1,-1),n.worldSpace)this.widthBuffer.setX(e,h.size),this.widthBuffer.setX(e+1,h.size);else if(i.parentMatrix)this.widthBuffer.setX(e,h.size),this.widthBuffer.setX(e+1,h.size);else{let t=(Math.abs(a.x)+Math.abs(a.y)+Math.abs(a.z))/3;this.widthBuffer.setX(e,h.size*t),this.widthBuffer.setX(e+1,h.size*t)}this.uvBuffer.setXY(e,(r/i.previous.length+s)*u,(l-c-1)*d),this.uvBuffer.setXY(e+1,(r/i.previous.length+s)*u,(l-c)*d),this.colorBuffer.setXYZW(e,h.color.x,h.color.y,h.color.z,h.color.w),this.colorBuffer.setXYZW(e+1,h.color.x,h.color.y,h.color.z,h.color.w),r+1<i.previous.length&&(this.indexBuffer.setX(t*3,e),this.indexBuffer.setX(t*3+1,e+1),this.indexBuffer.setX(t*3+2,e+2),t++,this.indexBuffer.setX(t*3,e+2),this.indexBuffer.setX(t*3+1,e+1),this.indexBuffer.setX(t*3+2,e+3),t++),m=h,h=g,p.done||(p=f.next(),p.value!==void 0&&(g=p.value))}}}this.positionBuffer.clearUpdateRanges(),this.positionBuffer.addUpdateRange(0,e*3),this.positionBuffer.needsUpdate=!0,this.previousBuffer.clearUpdateRanges(),this.previousBuffer.addUpdateRange(0,e*3),this.previousBuffer.needsUpdate=!0,this.nextBuffer.clearUpdateRanges(),this.nextBuffer.addUpdateRange(0,e*3),this.nextBuffer.needsUpdate=!0,this.sideBuffer.clearUpdateRanges(),this.sideBuffer.addUpdateRange(0,e),this.sideBuffer.needsUpdate=!0,this.widthBuffer.clearUpdateRanges(),this.widthBuffer.addUpdateRange(0,e),this.widthBuffer.needsUpdate=!0,this.uvBuffer.clearUpdateRanges(),this.uvBuffer.addUpdateRange(0,e*2),this.uvBuffer.needsUpdate=!0,this.colorBuffer.clearUpdateRanges(),this.colorBuffer.addUpdateRange(0,e*4),this.colorBuffer.needsUpdate=!0,this.indexBuffer.clearUpdateRanges(),this.indexBuffer.addUpdateRange(0,t*3),this.indexBuffer.needsUpdate=!0,this.geometry.setDrawRange(0,t*3)}dispose(){this.geometry.dispose()}},Kd=class e extends re{constructor(){super(),this.batches=[],this.systemToBatchIndex=new Map,this.type=`BatchedRenderer`,this.depthTexture=null}static equals(e,t){return e.material.side===t.material.side&&e.material.blending===t.material.blending&&e.material.blendSrc===t.material.blendSrc&&e.material.blendDst===t.material.blendDst&&e.material.blendEquation===t.material.blendEquation&&e.material.premultipliedAlpha===t.material.premultipliedAlpha&&e.material.transparent===t.material.transparent&&e.material.depthTest===t.material.depthTest&&e.material.type===t.material.type&&e.material.alphaTest===t.material.alphaTest&&e.material.map===t.material.map&&e.renderMode===t.renderMode&&e.blendTiles===t.blendTiles&&e.softParticles===t.softParticles&&e.softFarFade===t.softFarFade&&e.softNearFade===t.softNearFade&&e.uTileCount===t.uTileCount&&e.vTileCount===t.vTileCount&&e.instancingGeometry===t.instancingGeometry&&e.renderOrder===t.renderOrder&&e.layers.mask===t.layers.mask}addSystem(t){t._renderer=this;let n=t.getRendererSettings();for(let r=0;r<this.batches.length;r++)if(e.equals(this.batches[r].settings,n)){this.batches[r].addSystem(t),this.systemToBatchIndex.set(t,r);return}let r;switch(n.renderMode){case R.Trail:r=new Gd(n);break;case R.Mesh:case R.BillBoard:case R.VerticalBillBoard:case R.HorizontalBillBoard:case R.StretchedBillBoard:r=new Hd(n);break}this.depthTexture&&r.applyDepthTexture(this.depthTexture),r.addSystem(t),this.batches.push(r),this.systemToBatchIndex.set(t,this.batches.length-1),this.add(r)}deleteSystem(e){let t=this.systemToBatchIndex.get(e);t!=null&&(this.batches[t].removeSystem(e),this.systemToBatchIndex.delete(e))}setDepthTexture(e){this.depthTexture=e;for(let t of this.batches)t.applyDepthTexture(e)}updateSystem(e){this.deleteSystem(e),this.addSystem(e)}update(e){this.systemToBatchIndex.forEach((t,n)=>{n.update(e)});for(let e=0;e<this.batches.length;e++)this.batches[e].update()}};Cd(),dd(pd),console.log(`%c Particle system powered by three.quarks. https://quarks.art/`,`font-size: 14px; font-weight: bold;`);var qd;function Jd(){if(qd!==void 0)return qd;if(typeof document>`u`)return qd=null;let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`);if(!t)return qd=null;let n=t.createRadialGradient(64/2,64/2,0,64/2,64/2,64/2);n.addColorStop(0,`rgba(255,255,255,1)`),n.addColorStop(.4,`rgba(255,255,255,0.6)`),n.addColorStop(1,`rgba(255,255,255,0)`),t.fillStyle=n,t.fillRect(0,0,64,64);let r=new g(e);return r.needsUpdate=!0,qd=r}var Yd=9.81,Xd={Billboard:R.BillBoard,StretchedBillboard:R.StretchedBillBoard,HorizontalBillboard:R.HorizontalBillBoard,VerticalBillboard:R.VerticalBillBoard,Mesh:R.Mesh},Zd={Additive:2,Alpha:1};function Qd(e){let t=[];e.gravityModifier&&t.push(new Nu(new F(0,-1,0),new I(e.gravityModifier*Yd))),e.colorOverLifetime?.length&&t.push(new yu(tf(e.colorOverLifetime))),e.sizeOverLifetime?.length&&t.push(new Cu(nf(e.sizeOverLifetime))),e.rotationOverLifetime&&t.push(new bu(new I(ye.degToRad(e.rotationOverLifetime)))),e.noise&&t.push(new ed(new I(e.noise.frequency??2),new I(e.noise.strength??1)));let n=e.startColor??$d;return{duration:e.duration??5,looping:e.looping??!0,prewarm:e.prewarm??!1,startLife:new I(e.startLifetime??5),startSpeed:new I(e.startSpeed??5),startSize:new I(e.startSize??1),startRotation:new I(ye.degToRad(e.startRotation??0)),startColor:new Kl(new kl(n.r,n.g,n.b,1)),emissionOverTime:new I(e.rateOverTime??10),emissionBursts:(e.bursts??[]).map(e=>({time:e.time,count:new I(e.count),cycle:1,interval:0,probability:1})),shape:ef(e.shape??{}),material:rf(e.renderer?.blending,e.renderer?.texture),renderMode:Xd[e.renderer?.renderMode??`Billboard`],renderOrder:0,worldSpace:e.simulationSpace===`World`,behaviors:t}}var $d=new Ce(16777215);function ef(e){let t=e.radius??1,n=ye.degToRad(e.arc??360);switch(e.type){case`Sphere`:return new pu({radius:t});case`Hemisphere`:return new mu({radius:t,arc:n});case`Circle`:return new au({radius:t,arc:n});case`Donut`:return new du({radius:t,arc:n});case`Rectangle`:return new gu({width:t*2,height:t*2});case`Point`:return new fu;default:return new iu({radius:t,angle:ye.degToRad(e.angle??25),arc:n,thickness:1})}}function tf(e){return new Ul(e.map((t,n)=>[new F(t.r,t.g,t.b),e.length===1?0:n/(e.length-1)]),[[1,0],[1,.7],[0,1]])}function nf(e){if(e.length===1){let t=e[0];return new Xl([[new Pl(t,t,t,t),0]])}let t=[],n=e.length-1;for(let r=0;r<n;r++){let i=e[r],a=e[r+1];t.push([new Pl(i,i+(a-i)/3,i+2*(a-i)/3,a),r/n])}return new Xl(t)}function rf(e,t){let n=new ae({blending:Zd[e??`Additive`],transparent:!0,depthWrite:!1}),r=t??Jd();return r&&(n.map=r),n}var af=class extends de{renderer;built=new Map;awake(){this.renderer=new Kd,this.scene.add(this.renderer)}update(e){this.renderer.update(e)}onDestroy(){for(let e of this.built.values())e.dispose();this.built.clear(),this.renderer.removeFromParent()}createSystem(e){let t=new Md(Qd(e.effect));return e.object3D.add(t.emitter),this.renderer.addSystem(t),this.built.set(e,t),t}destroySystem(e){let t=this.built.get(e);t&&(this.renderer.deleteSystem(t),t.emitter.removeFromParent(),t.dispose(),this.built.delete(e))}},of=class extends ge{effect;playOnAwake=!0;system=null;renderer=null;wasPlaying=!0;awake(){if(!this.effect)throw Error(`ParticleSystem has no effect. Point it at a .particle.xml: <ParticleSystem effect="../vfx/fire.particle.xml" />`);this.renderer=this.requireSystem(af),this.system=this.renderer.createSystem(this),this.playOnAwake||this.stop()}onEnable(){this.wasPlaying&&this.play()}onDisable(){this.wasPlaying=this.isPlaying,this.pause()}onDestroy(){this.renderer?.destroySystem(this),this.renderer=null,this.system=null}get isPlaying(){return this.system!==null&&!this.system.paused}get particleCount(){return this.system?.particleNum??0}play(){this.system?.play(),this.wasPlaying=!0}pause(){this.system?.pause()}stop(){this.system?.stop(),this.wasPlaying=!1}restart(){this.system?.restart(),this.wasPlaying=!0}},sf=S({ParticleRenderer:()=>af,ParticleSystem:()=>of,configToParameters:()=>Qd}),cf=function(e,t){return cf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},cf(e,t)};function lf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);cf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var uf=function(){return uf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uf.apply(this,arguments)},df=function(e,t){e??={};var n=uf({},e);for(var r in t)t.hasOwnProperty(r)&&e[r]===void 0&&(n[r]=t[r]);if(typeof Object.getOwnPropertySymbols==`function`)for(var i=Object.getOwnPropertySymbols(t),a=0;a<i.length;a++){var o=i[a];t.propertyIsEnumerable(o)&&e[o]===void 0&&(n[o]=t[o])}return n},ff=Math.random,pf=1e-9,mf=Number.isFinite;function hf(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e+1}function gf(e){return e>0&&(e&e-1)==0}function _f(e,t,n){return t===void 0?(n=1,t=0):n===void 0&&(n=t,t=0),n>t?(e=(e-t)%(n-t),e+(e<0?n:t)):(e=(e-n)%(t-n),e+(e<=0?t:n))}function vf(e,t,n){return e<t?t:e>n?n:e}function yf(e,t){return e===void 0?(t=1,e=0):t===void 0&&(t=e,e=0),e===t?e:ff()*(t-e)+e}var bf=Object.create(Math);bf.EPSILON=pf,bf.isFinite=mf,bf.nextPowerOfTwo=hf,bf.isPowerOfTwo=gf,bf.mod=_f,bf.clamp=vf,bf.random=yf;var xf=Math.abs,Sf=Math.sqrt,Cf=Math.max,wf=Math.min,z=(function(){function e(t,n){if(!(this instanceof e))return new e(t,n);t===void 0?(this.x=0,this.y=0):typeof t==`object`?(this.x=t.x,this.y=t.y):(this.x=t,this.y=n)}return e.prototype._serialize=function(){return{x:this.x,y:this.y}},e._deserialize=function(t){var n=Object.create(e.prototype);return n.x=t.x,n.y=t.y,n},e.zero=function(){var t=Object.create(e.prototype);return t.x=0,t.y=0,t},e.neo=function(t,n){var r=Object.create(e.prototype);return r.x=t,r.y=n,r},e.clone=function(t){return e.neo(t.x,t.y)},e.prototype.toString=function(){return JSON.stringify(this)},e.isValid=function(e){return e==null?!1:Number.isFinite(e.x)&&Number.isFinite(e.y)},e.assert=function(e){},e.prototype.clone=function(){return e.clone(this)},e.prototype.setZero=function(){return this.x=0,this.y=0,this},e.prototype.set=function(e,t){return typeof e==`object`?(this.x=e.x,this.y=e.y):(this.x=e,this.y=t),this},e.prototype.setNum=function(e,t){return this.x=e,this.y=t,this},e.prototype.setVec2=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.wSet=function(e,t,n,r){return n!==void 0||r!==void 0?this.setCombine(e,t,n,r):this.setMul(e,t)},e.prototype.setCombine=function(e,t,n,r){var i=e*t.x+n*r.x,a=e*t.y+n*r.y;return this.x=i,this.y=a,this},e.prototype.setMul=function(e,t){var n=e*t.x,r=e*t.y;return this.x=n,this.y=r,this},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.wAdd=function(e,t,n,r){return n!==void 0||r!==void 0?this.addCombine(e,t,n,r):this.addMul(e,t)},e.prototype.addCombine=function(e,t,n,r){var i=e*t.x+n*r.x,a=e*t.y+n*r.y;return this.x+=i,this.y+=a,this},e.prototype.addMul=function(e,t){var n=e*t.x,r=e*t.y;return this.x+=n,this.y+=r,this},e.prototype.wSub=function(e,t,n,r){return n!==void 0||r!==void 0?this.subCombine(e,t,n,r):this.subMul(e,t)},e.prototype.subCombine=function(e,t,n,r){var i=e*t.x+n*r.x,a=e*t.y+n*r.y;return this.x-=i,this.y-=a,this},e.prototype.subMul=function(e,t){var n=e*t.x,r=e*t.y;return this.x-=n,this.y-=r,this},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.mul=function(e){return this.x*=e,this.y*=e,this},e.prototype.length=function(){return e.lengthOf(this)},e.prototype.lengthSquared=function(){return e.lengthSquared(this)},e.prototype.normalize=function(){var e=this.length();if(e<pf)return 0;var t=1/e;return this.x*=t,this.y*=t,e},e.normalize=function(t){var n=e.lengthOf(t);if(n<pf)return e.zero();var r=1/n;return e.neo(t.x*r,t.y*r)},e.lengthOf=function(e){return Sf(e.x*e.x+e.y*e.y)},e.lengthSquared=function(e){return e.x*e.x+e.y*e.y},e.distance=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Sf(n*n+r*r)},e.distanceSquared=function(e,t){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r},e.areEqual=function(e,t){return e===t||typeof t==`object`&&!!t&&e.x===t.x&&e.y===t.y},e.skew=function(t){return e.neo(-t.y,t.x)},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.cross=function(t,n){return typeof n==`number`?e.neo(n*t.y,-n*t.x):typeof t==`number`?e.neo(-t*n.y,t*n.x):t.x*n.y-t.y*n.x},e.crossVec2Vec2=function(e,t){return e.x*t.y-e.y*t.x},e.crossVec2Num=function(t,n){return e.neo(n*t.y,-n*t.x)},e.crossNumVec2=function(t,n){return e.neo(-t*n.y,t*n.x)},e.addCross=function(t,n,r){if(typeof r==`number`)return e.neo(r*n.y+t.x,-r*n.x+t.y);if(typeof n==`number`)return e.neo(-n*r.y+t.x,n*r.x+t.y)},e.addCrossVec2Num=function(t,n,r){return e.neo(r*n.y+t.x,-r*n.x+t.y)},e.addCrossNumVec2=function(t,n,r){return e.neo(-n*r.y+t.x,n*r.x+t.y)},e.add=function(t,n){return e.neo(t.x+n.x,t.y+n.y)},e.wAdd=function(t,n,r,i){return r!==void 0||i!==void 0?e.combine(t,n,r,i):e.mulNumVec2(t,n)},e.combine=function(t,n,r,i){return e.zero().setCombine(t,n,r,i)},e.sub=function(t,n){return e.neo(t.x-n.x,t.y-n.y)},e.mul=function(t,n){if(typeof t==`object`)return e.neo(t.x*n,t.y*n);if(typeof n==`object`)return e.neo(t*n.x,t*n.y)},e.mulVec2Num=function(t,n){return e.neo(t.x*n,t.y*n)},e.mulNumVec2=function(t,n){return e.neo(t*n.x,t*n.y)},e.prototype.neg=function(){return this.x=-this.x,this.y=-this.y,this},e.neg=function(t){return e.neo(-t.x,-t.y)},e.abs=function(t){return e.neo(xf(t.x),xf(t.y))},e.mid=function(t,n){return e.neo((t.x+n.x)*.5,(t.y+n.y)*.5)},e.upper=function(t,n){return e.neo(Cf(t.x,n.x),Cf(t.y,n.y))},e.lower=function(t,n){return e.neo(wf(t.x,n.x),wf(t.y,n.y))},e.prototype.clamp=function(e){var t=this.x*this.x+this.y*this.y;if(t>e*e){var n=e/Sf(t);this.x*=n,this.y*=n}return this},e.clamp=function(t,n){var r=e.neo(t.x,t.y);return r.clamp(n),r},e.clampVec2=function(e,t,n){return{x:vf(e.x,t?.x,n?.x),y:vf(e.y,t?.y,n?.y)}},e.scaleFn=function(t,n){return function(r){return e.neo(r.x*t,r.y*n)}},e.translateFn=function(t,n){return function(r){return e.neo(r.x+t,r.y+n)}},e})(),Tf=Math.max,Ef=Math.min,Df=(function(){function e(t,n){if(!(this instanceof e))return new e(t,n);this.lowerBound=z.zero(),this.upperBound=z.zero(),typeof t==`object`&&this.lowerBound.setVec2(t),typeof n==`object`?this.upperBound.setVec2(n):typeof t==`object`&&this.upperBound.setVec2(t)}return e.prototype.isValid=function(){return e.isValid(this)},e.isValid=function(e){return e==null?!1:z.isValid(e.lowerBound)&&z.isValid(e.upperBound)&&z.sub(e.upperBound,e.lowerBound).lengthSquared()>=0},e.assert=function(e){},e.prototype.getCenter=function(){return z.neo((this.lowerBound.x+this.upperBound.x)*.5,(this.lowerBound.y+this.upperBound.y)*.5)},e.prototype.getExtents=function(){return z.neo((this.upperBound.x-this.lowerBound.x)*.5,(this.upperBound.y-this.lowerBound.y)*.5)},e.prototype.getPerimeter=function(){return 2*(this.upperBound.x-this.lowerBound.x+this.upperBound.y-this.lowerBound.y)},e.prototype.combine=function(e,t){t||=this;var n=e.lowerBound,r=e.upperBound,i=t.lowerBound,a=t.upperBound,o=Ef(n.x,i.x),s=Ef(n.y,i.y),c=Tf(a.x,r.x),l=Tf(a.y,r.y);this.lowerBound.setNum(o,s),this.upperBound.setNum(c,l)},e.prototype.combinePoints=function(e,t){this.lowerBound.setNum(Ef(e.x,t.x),Ef(e.y,t.y)),this.upperBound.setNum(Tf(e.x,t.x),Tf(e.y,t.y))},e.prototype.set=function(e){this.lowerBound.setNum(e.lowerBound.x,e.lowerBound.y),this.upperBound.setNum(e.upperBound.x,e.upperBound.y)},e.prototype.contains=function(e){var t=!0;return t&&=this.lowerBound.x<=e.lowerBound.x,t&&=this.lowerBound.y<=e.lowerBound.y,t&&=e.upperBound.x<=this.upperBound.x,t&&=e.upperBound.y<=this.upperBound.y,t},e.prototype.extend=function(t){return e.extend(this,t),this},e.extend=function(e,t){return e.lowerBound.x-=t,e.lowerBound.y-=t,e.upperBound.x+=t,e.upperBound.y+=t,e},e.testOverlap=function(e,t){var n=t.lowerBound.x-e.upperBound.x,r=e.lowerBound.x-t.upperBound.x,i=t.lowerBound.y-e.upperBound.y,a=e.lowerBound.y-t.upperBound.y;return!(n>0||i>0||r>0||a>0)},e.areEqual=function(e,t){return z.areEqual(e.lowerBound,t.lowerBound)&&z.areEqual(e.upperBound,t.upperBound)},e.diff=function(e,t){var n=Tf(0,Ef(e.upperBound.x,t.upperBound.x)-Tf(t.lowerBound.x,e.lowerBound.x)),r=Tf(0,Ef(e.upperBound.y,t.upperBound.y)-Tf(t.lowerBound.y,e.lowerBound.y)),i=e.upperBound.x-e.lowerBound.x,a=e.upperBound.y-e.lowerBound.y,o=t.upperBound.x-t.lowerBound.x,s=t.upperBound.y-t.lowerBound.y;return i*a+o*s-n*r},e.prototype.rayCast=function(e,t){var n=-1/0,r=1/0,i=t.p1,a=z.sub(t.p2,t.p1),o=z.abs(a),s=z.zero();if(o.x<pf){if(i.x<this.lowerBound.x||this.upperBound.x<i.x)return!1}else{var c=1/a.x,l=(this.lowerBound.x-i.x)*c,u=(this.upperBound.x-i.x)*c,d=-1;if(l>u){var f=l;l=u,u=f,d=1}if(l>n&&(s.setZero(),s.x=d,n=l),r=Ef(r,u),n>r)return!1}if(o.y<pf){if(i.y<this.lowerBound.y||this.upperBound.y<i.y)return!1}else{var c=1/a.y,l=(this.lowerBound.y-i.y)*c,u=(this.upperBound.y-i.y)*c,d=-1;if(l>u){var f=l;l=u,u=f,d=1}if(l>n&&(s.setZero(),s.y=d,n=l),r=Ef(r,u),n>r)return!1}return n<0||t.maxFraction<n?!1:(e.fraction=n,e.normal=s,!0)},e.prototype.toString=function(){return JSON.stringify(this)},e.combinePoints=function(e,t,n){return e.lowerBound.x=Ef(t.x,n.x),e.lowerBound.y=Ef(t.y,n.y),e.upperBound.x=Tf(t.x,n.x),e.upperBound.y=Tf(t.y,n.y),e},e.combinedPerimeter=function(e,t){var n=Ef(e.lowerBound.x,t.lowerBound.x),r=Ef(e.lowerBound.y,t.lowerBound.y),i=Tf(e.upperBound.x,t.upperBound.x),a=Tf(e.upperBound.y,t.upperBound.y);return 2*(i-n+a-r)},e})(),Of=Math.PI,B=(function(){function e(){}return Object.defineProperty(e,"polygonRadius",{get:function(){return 2*e.linearSlop},enumerable:!1,configurable:!0}),e.lengthUnitsPerMeter=1,e.maxManifoldPoints=2,e.maxPolygonVertices=12,e.aabbExtension=.1,e.aabbMultiplier=2,e.linearSlop=.005,e.angularSlop=2/180*Of,e.maxSubSteps=8,e.maxTOIContacts=32,e.maxTOIIterations=20,e.maxDistanceIterations=20,e.velocityThreshold=1,e.maxLinearCorrection=.2,e.maxAngularCorrection=8/180*Of,e.maxTranslation=2,e.maxRotation=.5*Of,e.baumgarte=.2,e.toiBaugarte=.75,e.timeToSleep=.5,e.linearSleepTolerance=.01,e.angularSleepTolerance=2/180*Of,e})(),V=(function(){function e(){}return Object.defineProperty(e,"maxManifoldPoints",{get:function(){return B.maxManifoldPoints},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxPolygonVertices",{get:function(){return B.maxPolygonVertices},enumerable:!1,configurable:!0}),Object.defineProperty(e,"aabbExtension",{get:function(){return B.aabbExtension*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"aabbMultiplier",{get:function(){return B.aabbMultiplier},enumerable:!1,configurable:!0}),Object.defineProperty(e,"linearSlop",{get:function(){return B.linearSlop*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"linearSlopSquared",{get:function(){return B.linearSlop*B.lengthUnitsPerMeter*B.linearSlop*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"angularSlop",{get:function(){return B.angularSlop},enumerable:!1,configurable:!0}),Object.defineProperty(e,"polygonRadius",{get:function(){return 2*B.linearSlop},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxSubSteps",{get:function(){return B.maxSubSteps},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxTOIContacts",{get:function(){return B.maxTOIContacts},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxTOIIterations",{get:function(){return B.maxTOIIterations},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxDistanceIterations",{get:function(){return B.maxDistanceIterations},enumerable:!1,configurable:!0}),Object.defineProperty(e,"velocityThreshold",{get:function(){return B.velocityThreshold*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxLinearCorrection",{get:function(){return B.maxLinearCorrection*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxAngularCorrection",{get:function(){return B.maxAngularCorrection},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxTranslation",{get:function(){return B.maxTranslation*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxTranslationSquared",{get:function(){return B.maxTranslation*B.lengthUnitsPerMeter*B.maxTranslation*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxRotation",{get:function(){return B.maxRotation},enumerable:!1,configurable:!0}),Object.defineProperty(e,"maxRotationSquared",{get:function(){return B.maxRotation*B.maxRotation},enumerable:!1,configurable:!0}),Object.defineProperty(e,"baumgarte",{get:function(){return B.baumgarte},enumerable:!1,configurable:!0}),Object.defineProperty(e,"toiBaugarte",{get:function(){return B.toiBaugarte},enumerable:!1,configurable:!0}),Object.defineProperty(e,"timeToSleep",{get:function(){return B.timeToSleep},enumerable:!1,configurable:!0}),Object.defineProperty(e,"linearSleepTolerance",{get:function(){return B.linearSleepTolerance*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"linearSleepToleranceSqr",{get:function(){return B.linearSleepTolerance*B.lengthUnitsPerMeter*B.linearSleepTolerance*B.lengthUnitsPerMeter},enumerable:!1,configurable:!0}),Object.defineProperty(e,"angularSleepTolerance",{get:function(){return B.angularSleepTolerance},enumerable:!1,configurable:!0}),Object.defineProperty(e,"angularSleepToleranceSqr",{get:function(){return B.angularSleepTolerance*B.angularSleepTolerance},enumerable:!1,configurable:!0}),e})(),kf=(function(){function e(e){this._list=[],this._max=1/0,this._hasCreateFn=!1,this._createCount=0,this._hasAllocateFn=!1,this._allocateCount=0,this._hasReleaseFn=!1,this._releaseCount=0,this._hasDisposeFn=!1,this._disposeCount=0,this._list=[],this._max=e.max||this._max,this._createFn=e.create,this._hasCreateFn=typeof this._createFn==`function`,this._allocateFn=e.allocate,this._hasAllocateFn=typeof this._allocateFn==`function`,this._releaseFn=e.release,this._hasReleaseFn=typeof this._releaseFn==`function`,this._disposeFn=e.dispose,this._hasDisposeFn=typeof this._disposeFn==`function`}return e.prototype.max=function(e){return typeof e==`number`?(this._max=e,this):this._max},e.prototype.size=function(){return this._list.length},e.prototype.allocate=function(){var e;return this._list.length>0?e=this._list.shift():(this._createCount++,e=this._hasCreateFn?this._createFn():{}),this._allocateCount++,this._hasAllocateFn&&this._allocateFn(e),e},e.prototype.release=function(e){this._list.length<this._max?(this._releaseCount++,this._hasReleaseFn&&this._releaseFn(e),this._list.push(e)):(this._disposeCount++,this._hasDisposeFn&&(e=this._disposeFn(e)))},e.prototype.toString=function(){return` +`+this._createCount+` >`+this._allocateCount+` <`+this._releaseCount+` -`+this._disposeCount+` =`+this._list.length+`/`+this._max},e})(),Af=Math.abs,jf=Math.max,Mf=(function(){function e(e){this.aabb=new Df,this.userData=null,this.parent=null,this.child1=null,this.child2=null,this.height=-1,this.id=e}return e.prototype.toString=function(){return this.id+`: `+this.userData},e.prototype.isLeaf=function(){return this.child1==null},e})(),Nf=new kf({create:function(){return new Mf},release:function(e){e.userData=null,e.parent=null,e.child1=null,e.child2=null,e.height=-1,e.id=void 0}}),Pf=(function(){function e(){this.inputPool=new kf({create:function(){return{}},release:function(e){}}),this.stackPool=new kf({create:function(){return[]},release:function(e){e.length=0}}),this.iteratorPool=new kf({create:function(){return new Ff},release:function(e){e.close()}}),this.m_root=null,this.m_nodes={},this.m_lastProxyId=0}return e.prototype.getUserData=function(e){return this.m_nodes[e].userData},e.prototype.getFatAABB=function(e){return this.m_nodes[e].aabb},e.prototype.allocateNode=function(){var e=Nf.allocate();return e.id=++this.m_lastProxyId,this.m_nodes[e.id]=e,e},e.prototype.freeNode=function(e){delete this.m_nodes[e.id],Nf.release(e)},e.prototype.createProxy=function(e,t){var n=this.allocateNode();return n.aabb.set(e),Df.extend(n.aabb,V.aabbExtension),n.userData=t,n.height=0,this.insertLeaf(n),n.id},e.prototype.destroyProxy=function(e){var t=this.m_nodes[e];this.removeLeaf(t),this.freeNode(t)},e.prototype.moveProxy=function(e,t,n){var r=this.m_nodes[e];return r.aabb.contains(t)?!1:(this.removeLeaf(r),r.aabb.set(t),t=r.aabb,Df.extend(t,V.aabbExtension),n.x<0?t.lowerBound.x+=n.x*V.aabbMultiplier:t.upperBound.x+=n.x*V.aabbMultiplier,n.y<0?t.lowerBound.y+=n.y*V.aabbMultiplier:t.upperBound.y+=n.y*V.aabbMultiplier,this.insertLeaf(r),!0)},e.prototype.insertLeaf=function(e){if(this.m_root==null){this.m_root=e,this.m_root.parent=null;return}for(var t=e.aabb,n=this.m_root;!n.isLeaf();){var r=n.child1,i=n.child2,a=n.aabb.getPerimeter(),o=Df.combinedPerimeter(n.aabb,t),s=2*o,c=2*(o-a),l=Df.combinedPerimeter(t,r.aabb)+c;if(!r.isLeaf()){var u=r.aabb.getPerimeter();l-=u}var d=Df.combinedPerimeter(t,i.aabb)+c;if(!i.isLeaf()){var u=i.aabb.getPerimeter();d-=u}if(s<l&&s<d)break;n=l<d?r:i}var f=n,p=f.parent,m=this.allocateNode();for(m.parent=p,m.userData=null,m.aabb.combine(t,f.aabb),m.height=f.height+1,p==null?(m.child1=f,m.child2=e,f.parent=m,e.parent=m,this.m_root=m):(p.child1===f?p.child1=m:p.child2=m,m.child1=f,m.child2=e,f.parent=m,e.parent=m),n=e.parent;n!=null;){n=this.balance(n);var r=n.child1,i=n.child2;n.height=1+jf(r.height,i.height),n.aabb.combine(r.aabb,i.aabb),n=n.parent}},e.prototype.removeLeaf=function(e){if(e===this.m_root){this.m_root=null;return}var t=e.parent,n=t.parent,r=t.child1===e?t.child2:t.child1;if(n!=null){n.child1===t?n.child1=r:n.child2=r,r.parent=n,this.freeNode(t);for(var i=n;i!=null;){i=this.balance(i);var a=i.child1,o=i.child2;i.aabb.combine(a.aabb,o.aabb),i.height=1+jf(a.height,o.height),i=i.parent}}else this.m_root=r,r.parent=null,this.freeNode(t)},e.prototype.balance=function(e){var t=e;if(t.isLeaf()||t.height<2)return e;var n=t.child1,r=t.child2,i=r.height-n.height;if(i>1){var a=r.child1,o=r.child2;return r.child1=t,r.parent=t.parent,t.parent=r,r.parent==null?this.m_root=r:r.parent.child1===e?r.parent.child1=r:r.parent.child2=r,a.height>o.height?(r.child2=a,t.child2=o,o.parent=t,t.aabb.combine(n.aabb,o.aabb),r.aabb.combine(t.aabb,a.aabb),t.height=1+jf(n.height,o.height),r.height=1+jf(t.height,a.height)):(r.child2=o,t.child2=a,a.parent=t,t.aabb.combine(n.aabb,a.aabb),r.aabb.combine(t.aabb,o.aabb),t.height=1+jf(n.height,a.height),r.height=1+jf(t.height,o.height)),r}if(i<-1){var s=n.child1,c=n.child2;return n.child1=t,n.parent=t.parent,t.parent=n,n.parent==null?this.m_root=n:n.parent.child1===t?n.parent.child1=n:n.parent.child2=n,s.height>c.height?(n.child2=s,t.child1=c,c.parent=t,t.aabb.combine(r.aabb,c.aabb),n.aabb.combine(t.aabb,s.aabb),t.height=1+jf(r.height,c.height),n.height=1+jf(t.height,s.height)):(n.child2=c,t.child1=s,s.parent=t,t.aabb.combine(r.aabb,s.aabb),n.aabb.combine(t.aabb,c.aabb),t.height=1+jf(r.height,s.height),n.height=1+jf(t.height,c.height)),n}return t},e.prototype.getHeight=function(){return this.m_root==null?0:this.m_root.height},e.prototype.getAreaRatio=function(){if(this.m_root==null)return 0;for(var e=this.m_root.aabb.getPerimeter(),t=0,n,r=this.iteratorPool.allocate().preorder(this.m_root);n=r.next();)n.height<0||(t+=n.aabb.getPerimeter());return this.iteratorPool.release(r),t/e},e.prototype.computeHeight=function(e){var t=e===void 0?this.m_root:this.m_nodes[e];return t.isLeaf()?0:1+jf(this.computeHeight(t.child1.id),this.computeHeight(t.child2.id))},e.prototype.validateStructure=function(e){if(e!=null){this.m_root;var t=e.child1,n=e.child2;e.isLeaf()||(this.validateStructure(t),this.validateStructure(n))}},e.prototype.validateMetrics=function(e){if(e!=null){var t=e.child1,n=e.child2;e.isLeaf()||(this.validateMetrics(t),this.validateMetrics(n))}},e.prototype.validate=function(){},e.prototype.getMaxBalance=function(){for(var e=0,t,n=this.iteratorPool.allocate().preorder(this.m_root);t=n.next();)if(!(t.height<=1)){var r=Af(t.child2.height-t.child1.height);e=jf(e,r)}return this.iteratorPool.release(n),e},e.prototype.rebuildBottomUp=function(){for(var e=[],t=0,n,r=this.iteratorPool.allocate().preorder(this.m_root);n=r.next();)n.height<0||(n.isLeaf()?(n.parent=null,e[t]=n,++t):this.freeNode(n));for(this.iteratorPool.release(r);t>1;){for(var i=1/0,a=-1,o=-1,s=0;s<t;++s)for(var c=e[s].aabb,l=s+1;l<t;++l){var u=e[l].aabb,d=Df.combinedPerimeter(c,u);d<i&&(a=s,o=l,i=d)}var f=e[a],p=e[o],m=this.allocateNode();m.child1=f,m.child2=p,m.height=1+jf(f.height,p.height),m.aabb.combine(f.aabb,p.aabb),m.parent=null,f.parent=m,p.parent=m,e[o]=e[t-1],e[a]=m,--t}this.m_root=e[0]},e.prototype.shiftOrigin=function(e){for(var t,n=this.iteratorPool.allocate().preorder(this.m_root);t=n.next();){var r=t.aabb;r.lowerBound.x-=e.x,r.lowerBound.y-=e.y,r.upperBound.x-=e.x,r.upperBound.y-=e.y}this.iteratorPool.release(n)},e.prototype.query=function(e,t){var n=this.stackPool.allocate();for(n.push(this.m_root);n.length>0;){var r=n.pop();if(r!=null&&Df.testOverlap(r.aabb,e))if(r.isLeaf()){if(t(r.id)===!1)return}else n.push(r.child1),n.push(r.child2)}this.stackPool.release(n)},e.prototype.rayCast=function(e,t){var n=e.p1,r=e.p2,i=z.sub(r,n);i.normalize();var a=z.crossNumVec2(1,i),o=z.abs(a),s=e.maxFraction,c=new Df,l=z.combine(1-s,n,s,r);c.combinePoints(n,l);var u=this.stackPool.allocate(),d=this.inputPool.allocate();for(u.push(this.m_root);u.length>0;){var f=u.pop();if(f!=null&&Df.testOverlap(f.aabb,c)!==!1){var p=f.aabb.getCenter(),m=f.aabb.getExtents();if(!(Af(z.dot(a,z.sub(n,p)))-z.dot(o,m)>0))if(f.isLeaf()){d.p1=z.clone(e.p1),d.p2=z.clone(e.p2),d.maxFraction=s;var h=t(d,f.id);if(h===0)break;h>0&&(s=h,l=z.combine(1-s,n,s,r),c.combinePoints(n,l))}else u.push(f.child1),u.push(f.child2)}}this.stackPool.release(u),this.inputPool.release(d)},e})(),Ff=(function(){function e(){this.parents=[],this.states=[]}return e.prototype.preorder=function(e){return this.parents.length=0,this.parents.push(e),this.states.length=0,this.states.push(0),this},e.prototype.next=function(){for(;this.parents.length>0;){var e=this.parents.length-1,t=this.parents[e];if(this.states[e]===0)return this.states[e]=1,t;if(this.states[e]===1&&(this.states[e]=2,t.child1))return this.parents.push(t.child1),this.states.push(1),t.child1;if(this.states[e]===2&&(this.states[e]=3,t.child2))return this.parents.push(t.child2),this.states.push(1),t.child2;this.parents.pop(),this.states.pop()}},e.prototype.close=function(){this.parents.length=0},e})(),If=Math.max,Lf=Math.min,Rf=(function(){function e(){var e=this;this.m_tree=new Pf,this.m_moveBuffer=[],this.query=function(t,n){e.m_tree.query(t,n)},this.queryCallback=function(t){if(t===e.m_queryProxyId)return!0;var n=Lf(t,e.m_queryProxyId),r=If(t,e.m_queryProxyId),i=e.m_tree.getUserData(n),a=e.m_tree.getUserData(r);return e.m_callback(i,a),!0}}return e.prototype.getUserData=function(e){return this.m_tree.getUserData(e)},e.prototype.testOverlap=function(e,t){var n=this.m_tree.getFatAABB(e),r=this.m_tree.getFatAABB(t);return Df.testOverlap(n,r)},e.prototype.getFatAABB=function(e){return this.m_tree.getFatAABB(e)},e.prototype.getProxyCount=function(){return this.m_moveBuffer.length},e.prototype.getTreeHeight=function(){return this.m_tree.getHeight()},e.prototype.getTreeBalance=function(){return this.m_tree.getMaxBalance()},e.prototype.getTreeQuality=function(){return this.m_tree.getAreaRatio()},e.prototype.rayCast=function(e,t){this.m_tree.rayCast(e,t)},e.prototype.shiftOrigin=function(e){this.m_tree.shiftOrigin(e)},e.prototype.createProxy=function(e,t){var n=this.m_tree.createProxy(e,t);return this.bufferMove(n),n},e.prototype.destroyProxy=function(e){this.unbufferMove(e),this.m_tree.destroyProxy(e)},e.prototype.moveProxy=function(e,t,n){this.m_tree.moveProxy(e,t,n)&&this.bufferMove(e)},e.prototype.touchProxy=function(e){this.bufferMove(e)},e.prototype.bufferMove=function(e){this.m_moveBuffer.push(e)},e.prototype.unbufferMove=function(e){for(var t=0;t<this.m_moveBuffer.length;++t)this.m_moveBuffer[t]===e&&(this.m_moveBuffer[t]=null)},e.prototype.updatePairs=function(e){for(this.m_callback=e;this.m_moveBuffer.length>0;)if(this.m_queryProxyId=this.m_moveBuffer.pop(),this.m_queryProxyId!==null){var t=this.m_tree.getFatAABB(this.m_queryProxyId);this.m_tree.query(t,this.queryCallback)}},e})(),zf=Math.sin,Bf=Math.cos,Vf=Math.sqrt;function H(e,t){return{x:e,y:t}}function Hf(e){return{s:zf(e),c:Bf(e)}}function Uf(e,t,n){return e.x=t,e.y=n,e}function U(e,t){return e.x=t.x,e.y=t.y,e}function W(e){return e.x=0,e.y=0,e}function Wf(e){return e.x=-e.x,e.y=-e.y,e}function Gf(e,t){return e.x+=t.x,e.y+=t.y,e}function Kf(e,t,n){return e.x=t.x+n.x,e.y=t.y+n.y,e}function qf(e,t){return e.x-=t.x,e.y-=t.y,e}function G(e,t,n){return e.x=t.x-n.x,e.y=t.y-n.y,e}function Jf(e,t){return e.x*=t,e.y*=t,e}function K(e,t,n){return e.x=t*n.x,e.y=t*n.y,e}function Yf(e,t,n){return e.x+=t*n.x,e.y+=t*n.y,e}function Xf(e,t,n){return e.x-=t*n.x,e.y-=t*n.y,e}function Zf(e,t,n,r,i){return e.x=t*n.x+r*i.x,e.y=t*n.y+r*i.y,e}function Qf(e,t,n,r,i,a,o){return e.x=t*n.x+r*i.x+a*o.x,e.y=t*n.y+r*i.y+a*o.y,e}function $f(e){var t=Vf(e.x*e.x+e.y*e.y);if(t!==0){var n=1/t;e.x*=n,e.y*=n}return t}function ep(e){var t=Vf(e.x*e.x+e.y*e.y);if(t>0){var n=1/t;e.x*=n,e.y*=n}return e}function tp(e,t,n){var r=n*t.y,i=-n*t.x;return e.x=r,e.y=i,e}function np(e,t,n){var r=-t*n.y,i=t*n.x;return e.x=r,e.y=i,e}function q(e,t){return e.x*t.y-e.y*t.x}function J(e,t){return e.x*t.x+e.y*t.y}function rp(e){return e.x*e.x+e.y*e.y}function ip(e,t){var n=e.x-t.x,r=e.y-t.y;return Vf(n*n+r*r)}function ap(e,t){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function op(e,t){return e.c=Bf(t),e.s=zf(t),e}function sp(e,t,n){return e.x=t.c*n.x-t.s*n.y,e.y=t.s*n.x+t.c*n.y,e}function cp(e,t,n){var r=t.c*n.x+t.s*n.y,i=-t.s*n.x+t.c*n.y;return e.x=r,e.y=i,e}function lp(e,t,n,r){var i=t.c*r.x+t.s*r.y,a=-t.s*r.x+t.c*r.y,o=n.c*i-n.s*a,s=n.s*i+n.c*a;return e.x=o,e.y=s,e}function up(e,t,n){return{p:H(e,t),q:Hf(n)}}function dp(e,t){return e.p.x=t.p.x,e.p.y=t.p.y,e.q.s=t.q.s,e.q.c=t.q.c,e}function Y(e,t,n){var r=t.q.c*n.x-t.q.s*n.y+t.p.x,i=t.q.s*n.x+t.q.c*n.y+t.p.y;return e.x=r,e.y=i,e}function fp(e,t,n){var r=n.x-t.p.x,i=n.y-t.p.y,a=t.q.c*r+t.q.s*i,o=-t.q.s*r+t.q.c*i;return e.x=a,e.y=o,e}function pp(e,t,n,r){var i=t.q.c*r.x-t.q.s*r.y+t.p.x,a=t.q.s*r.x+t.q.c*r.y+t.p.y,o=i-n.p.x,s=a-n.p.y,c=n.q.c*o+n.q.s*s,l=-n.q.s*o+n.q.c*s;return e.x=c,e.y=l,e}function mp(e,t,n){var r=t.q.c*n.q.c+t.q.s*n.q.s,i=t.q.c*n.q.s-t.q.s*n.q.c,a=t.q.c*(n.p.x-t.p.x)+t.q.s*(n.p.y-t.p.y),o=-t.q.s*(n.p.x-t.p.x)+t.q.c*(n.p.y-t.p.y);return e.q.c=r,e.q.s=i,e.p.x=a,e.p.y=o,e}var hp=Math.sin,gp=Math.cos,_p=Math.atan2,X=(function(){function e(t){if(!(this instanceof e))return new e(t);typeof t==`number`?this.setAngle(t):typeof t==`object`?this.setRot(t):this.setIdentity()}return e.neo=function(t){var n=Object.create(e.prototype);return n.setAngle(t),n},e.clone=function(t){var n=Object.create(e.prototype);return n.s=t.s,n.c=t.c,n},e.identity=function(){var t=Object.create(e.prototype);return t.s=0,t.c=1,t},e.isValid=function(e){return e==null?!1:Number.isFinite(e.s)&&Number.isFinite(e.c)},e.assert=function(e){},e.prototype.setIdentity=function(){this.s=0,this.c=1},e.prototype.set=function(e){typeof e==`object`?(this.s=e.s,this.c=e.c):(this.s=hp(e),this.c=gp(e))},e.prototype.setRot=function(e){this.s=e.s,this.c=e.c},e.prototype.setAngle=function(e){this.s=hp(e),this.c=gp(e)},e.prototype.getAngle=function(){return _p(this.s,this.c)},e.prototype.getXAxis=function(){return z.neo(this.c,this.s)},e.prototype.getYAxis=function(){return z.neo(-this.s,this.c)},e.mul=function(t,n){if(`c`in n&&`s`in n){var r=e.identity();return r.s=t.s*n.c+t.c*n.s,r.c=t.c*n.c-t.s*n.s,r}else if(`x`in n&&`y`in n)return z.neo(t.c*n.x-t.s*n.y,t.s*n.x+t.c*n.y)},e.mulRot=function(t,n){var r=e.identity();return r.s=t.s*n.c+t.c*n.s,r.c=t.c*n.c-t.s*n.s,r},e.mulVec2=function(e,t){return z.neo(e.c*t.x-e.s*t.y,e.s*t.x+e.c*t.y)},e.mulSub=function(e,t,n){var r=e.c*(t.x-n.x)-e.s*(t.y-n.y),i=e.s*(t.x-n.x)+e.c*(t.y-n.y);return z.neo(r,i)},e.mulT=function(t,n){if(`c`in n&&`s`in n){var r=e.identity();return r.s=t.c*n.s-t.s*n.c,r.c=t.c*n.c+t.s*n.s,r}else if(`x`in n&&`y`in n)return z.neo(t.c*n.x+t.s*n.y,-t.s*n.x+t.c*n.y)},e.mulTRot=function(t,n){var r=e.identity();return r.s=t.c*n.s-t.s*n.c,r.c=t.c*n.c+t.s*n.s,r},e.mulTVec2=function(e,t){return z.neo(e.c*t.x+e.s*t.y,-e.s*t.x+e.c*t.y)},e})(),vp=Math.atan2,yp=Math.PI,bp=H(0,0),xp=(function(){function e(){this.localCenter=z.zero(),this.c=z.zero(),this.a=0,this.alpha0=0,this.c0=z.zero(),this.a0=0}return e.prototype.recycle=function(){W(this.localCenter),W(this.c),this.a=0,this.alpha0=0,W(this.c0),this.a0=0},e.prototype.setTransform=function(e){Y(bp,e,this.localCenter),U(this.c,bp),U(this.c0,bp),this.a=this.a0=vp(e.q.s,e.q.c)},e.prototype.setLocalCenter=function(e,t){U(this.localCenter,e),Y(bp,t,this.localCenter),U(this.c,bp),U(this.c0,bp)},e.prototype.getTransform=function(e,t){t===void 0&&(t=0),op(e.q,(1-t)*this.a0+t*this.a),Zf(e.p,1-t,this.c0,t,this.c),qf(e.p,sp(bp,e.q,this.localCenter))},e.prototype.advance=function(e){var t=(e-this.alpha0)/(1-this.alpha0);Zf(this.c0,t,this.c,1-t,this.c0),this.a0=t*this.a+(1-t)*this.a0,this.alpha0=e},e.prototype.forward=function(){this.a0=this.a,U(this.c0,this.c)},e.prototype.normalize=function(){var e=_f(this.a0,-yp,+yp);this.a-=this.a0-e,this.a0=e},e.prototype.set=function(e){U(this.localCenter,e.localCenter),U(this.c,e.c),this.a=e.a,this.alpha0=e.alpha0,U(this.c0,e.c0),this.a0=e.a0},e})(),Sp=(function(){function e(t,n){if(!(this instanceof e))return new e(t,n);this.p=z.zero(),this.q=X.identity(),t!==void 0&&this.p.setVec2(t),n!==void 0&&this.q.setAngle(n)}return e.clone=function(t){var n=Object.create(e.prototype);return n.p=z.clone(t.p),n.q=X.clone(t.q),n},e.neo=function(t,n){var r=Object.create(e.prototype);return r.p=z.clone(t),r.q=X.clone(n),r},e.identity=function(){var t=Object.create(e.prototype);return t.p=z.zero(),t.q=X.identity(),t},e.prototype.setIdentity=function(){this.p.setZero(),this.q.setIdentity()},e.prototype.set=function(e,t){t===void 0?(this.p.set(e.p),this.q.set(e.q)):(this.p.set(e),this.q.set(t))},e.prototype.setNum=function(e,t){this.p.setVec2(e),this.q.setAngle(t)},e.prototype.setTransform=function(e){this.p.setVec2(e.p),this.q.setRot(e.q)},e.isValid=function(e){return e==null?!1:z.isValid(e.p)&&X.isValid(e.q)},e.assert=function(e){},e.mul=function(t,n){if(Array.isArray(n)){for(var r=[],i=0;i<n.length;i++)r[i]=e.mul(t,n[i]);return r}else if(`x`in n&&`y`in n)return e.mulVec2(t,n);else if(`p`in n&&`q`in n)return e.mulXf(t,n)},e.mulAll=function(t,n){for(var r=[],i=0;i<n.length;i++)r[i]=e.mul(t,n[i]);return r},e.mulFn=function(t){return function(n){return e.mul(t,n)}},e.mulVec2=function(e,t){var n=e.q.c*t.x-e.q.s*t.y+e.p.x,r=e.q.s*t.x+e.q.c*t.y+e.p.y;return z.neo(n,r)},e.mulXf=function(t,n){var r=e.identity();return r.q=X.mulRot(t.q,n.q),r.p=z.add(X.mulVec2(t.q,n.p),t.p),r},e.mulT=function(t,n){if(`x`in n&&`y`in n)return e.mulTVec2(t,n);if(`p`in n&&`q`in n)return e.mulTXf(t,n)},e.mulTVec2=function(e,t){var n=t.x-e.p.x,r=t.y-e.p.y,i=e.q.c*n+e.q.s*r,a=-e.q.s*n+e.q.c*r;return z.neo(i,a)},e.mulTXf=function(t,n){var r=e.identity();return r.q.setRot(X.mulTRot(t.q,n.q)),r.p.setVec2(X.mulTVec2(t.q,z.sub(n.p,t.p))),r},e})(),Cp=(function(){function e(){this.v=z.zero(),this.w=0}return e})(),wp=Math.sin,Tp=Math.cos,Ep=(function(){function e(){this.c=z.zero(),this.a=0}return e.prototype.getTransform=function(e,t){return e.q.c=Tp(this.a),e.q.s=wp(this.a),e.p.x=this.c.x-(e.q.c*t.x-e.q.s*t.y),e.p.y=this.c.y-(e.q.s*t.x+e.q.c*t.y),e},e})();function Dp(e,t,n,r){return e.q.c=Tp(r),e.q.s=wp(r),e.p.x=n.x-(e.q.c*t.x-e.q.s*t.y),e.p.y=n.y-(e.q.s*t.x+e.q.c*t.y),e}var Op=(function(){function e(){this.style={},this.appData={}}return e.isValid=function(e){return e==null?!1:typeof e.m_type==`string`&&typeof e.m_radius==`number`},e})(),kp=new Df,Ap=new Df,jp=H(0,0),Mp={userData:null,friction:.2,restitution:0,density:0,isSensor:!1,filterGroupIndex:0,filterCategoryBits:1,filterMaskBits:65535},Np=(function(){function e(e,t){this.aabb=new Df,this.fixture=e,this.childIndex=t}return e})(),Pp=(function(){function e(e,t,n){this.style={},this.appData={},t.shape?(n=t,t=t.shape):typeof n==`number`&&(n={density:n}),n=df(n,Mp),this.m_body=e,this.m_friction=n.friction,this.m_restitution=n.restitution,this.m_density=n.density,this.m_isSensor=n.isSensor,this.m_filterGroupIndex=n.filterGroupIndex,this.m_filterCategoryBits=n.filterCategoryBits,this.m_filterMaskBits=n.filterMaskBits,this.m_shape=t,this.m_next=null,this.m_proxies=[],this.m_proxyCount=0;for(var r=this.m_shape.getChildCount(),i=0;i<r;++i)this.m_proxies[i]=new Np(this,i);this.m_userData=n.userData,typeof n.style==`object`&&n.style!==null&&(this.style=n.style)}return e.prototype._reset=function(){var e=this.getBody(),t=e.m_world.m_broadPhase;this.destroyProxies(t),this.m_shape._reset&&this.m_shape._reset();for(var n=this.m_shape.getChildCount(),r=0;r<n;++r)this.m_proxies[r]=new Np(this,r);this.createProxies(t,e.m_xf),e.resetMassData()},e.prototype._serialize=function(){return{friction:this.m_friction,restitution:this.m_restitution,density:this.m_density,isSensor:this.m_isSensor,filterGroupIndex:this.m_filterGroupIndex,filterCategoryBits:this.m_filterCategoryBits,filterMaskBits:this.m_filterMaskBits,shape:this.m_shape}},e._deserialize=function(t,n,r){var i=r(Op,t.shape);return i&&new e(n,i,t)},e.prototype.getType=function(){return this.m_shape.m_type},e.prototype.getShape=function(){return this.m_shape},e.prototype.isSensor=function(){return this.m_isSensor},e.prototype.setSensor=function(e){e!=this.m_isSensor&&(this.m_body.setAwake(!0),this.m_isSensor=e)},e.prototype.getUserData=function(){return this.m_userData},e.prototype.setUserData=function(e){this.m_userData=e},e.prototype.getBody=function(){return this.m_body},e.prototype.getNext=function(){return this.m_next},e.prototype.getDensity=function(){return this.m_density},e.prototype.setDensity=function(e){this.m_density=e},e.prototype.getFriction=function(){return this.m_friction},e.prototype.setFriction=function(e){this.m_friction=e},e.prototype.getRestitution=function(){return this.m_restitution},e.prototype.setRestitution=function(e){this.m_restitution=e},e.prototype.testPoint=function(e){return this.m_shape.testPoint(this.m_body.getTransform(),e)},e.prototype.rayCast=function(e,t,n){return this.m_shape.rayCast(e,t,this.m_body.getTransform(),n)},e.prototype.getMassData=function(e){this.m_shape.computeMass(e,this.m_density)},e.prototype.getAABB=function(e){return this.m_proxies[e].aabb},e.prototype.createProxies=function(e,t){this.m_proxyCount=this.m_shape.getChildCount();for(var n=0;n<this.m_proxyCount;++n){var r=this.m_proxies[n];this.m_shape.computeAABB(r.aabb,t,n),r.proxyId=e.createProxy(r.aabb,r)}},e.prototype.destroyProxies=function(e){for(var t=0;t<this.m_proxyCount;++t){var n=this.m_proxies[t];e.destroyProxy(n.proxyId),n.proxyId=null}this.m_proxyCount=0},e.prototype.synchronize=function(e,t,n){for(var r=0;r<this.m_proxyCount;++r){var i=this.m_proxies[r];this.m_shape.computeAABB(kp,t,i.childIndex),this.m_shape.computeAABB(Ap,n,i.childIndex),i.aabb.combine(kp,Ap),G(jp,n.p,t.p),e.moveProxy(i.proxyId,i.aabb,jp)}},e.prototype.setFilterData=function(e){this.m_filterGroupIndex=e.groupIndex,this.m_filterCategoryBits=e.categoryBits,this.m_filterMaskBits=e.maskBits,this.refilter()},e.prototype.getFilterGroupIndex=function(){return this.m_filterGroupIndex},e.prototype.setFilterGroupIndex=function(e){this.m_filterGroupIndex=e,this.refilter()},e.prototype.getFilterCategoryBits=function(){return this.m_filterCategoryBits},e.prototype.setFilterCategoryBits=function(e){this.m_filterCategoryBits=e,this.refilter()},e.prototype.getFilterMaskBits=function(){return this.m_filterMaskBits},e.prototype.setFilterMaskBits=function(e){this.m_filterMaskBits=e,this.refilter()},e.prototype.refilter=function(){if(this.m_body!=null){for(var e=this.m_body.getContactList();e;){var t=e.contact,n=t.getFixtureA(),r=t.getFixtureB();(n==this||r==this)&&t.flagForFiltering(),e=e.next}var i=this.m_body.getWorld();if(i!=null)for(var a=i.m_broadPhase,o=0;o<this.m_proxyCount;++o)a.touchProxy(this.m_proxies[o].proxyId)}},e.prototype.shouldCollide=function(e){if(e.m_filterGroupIndex===this.m_filterGroupIndex&&e.m_filterGroupIndex!==0)return e.m_filterGroupIndex>0;var t=(e.m_filterMaskBits&this.m_filterCategoryBits)!==0,n=(e.m_filterCategoryBits&this.m_filterMaskBits)!==0;return t&&n},e})(),Fp=`static`,Ip=`kinematic`,Lp=`dynamic`,Rp=H(0,0),zp=H(0,0),Bp=H(0,0),Vp=H(0,0),Hp=up(0,0,0),Up={type:Fp,position:z.zero(),angle:0,linearVelocity:z.zero(),angularVelocity:0,linearDamping:0,angularDamping:0,fixedRotation:!1,bullet:!1,gravityScale:1,allowSleep:!0,awake:!0,active:!0,userData:null},Wp=(function(){function e(e,t){this.style={},this.appData={},t=df(t,Up),this.m_world=e,this.m_awakeFlag=t.awake,this.m_autoSleepFlag=t.allowSleep,this.m_bulletFlag=t.bullet,this.m_fixedRotationFlag=t.fixedRotation,this.m_activeFlag=t.active,this.m_islandFlag=!1,this.m_toiFlag=!1,this.m_userData=t.userData,this.m_type=t.type,this.m_type==Lp?(this.m_mass=1,this.m_invMass=1):(this.m_mass=0,this.m_invMass=0),this.m_I=0,this.m_invI=0,this.m_xf=Sp.identity(),this.m_xf.p.setVec2(t.position),this.m_xf.q.setAngle(t.angle),this.m_sweep=new xp,this.m_sweep.setTransform(this.m_xf),this.c_velocity=new Cp,this.c_position=new Ep,this.m_force=z.zero(),this.m_torque=0,this.m_linearVelocity=z.clone(t.linearVelocity),this.m_angularVelocity=t.angularVelocity,this.m_linearDamping=t.linearDamping,this.m_angularDamping=t.angularDamping,this.m_gravityScale=t.gravityScale,this.m_sleepTime=0,this.m_jointList=null,this.m_contactList=null,this.m_fixtureList=null,this.m_prev=null,this.m_next=null,this.m_destroyed=!1,typeof t.style==`object`&&t.style!==null&&(this.style=t.style)}return e.prototype._serialize=function(){for(var e=[],t=this.m_fixtureList;t;t=t.m_next)e.push(t);return{type:this.m_type,bullet:this.m_bulletFlag,fixedRotation:this.m_fixedRotationFlag,position:this.m_xf.p,angle:this.m_xf.q.getAngle(),linearVelocity:this.m_linearVelocity,angularVelocity:this.m_angularVelocity,fixtures:e}},e._deserialize=function(t,n,r){var i=new e(n,t);if(t.fixtures)for(var a=t.fixtures.length-1;a>=0;a--){var o=r(Pp,t.fixtures[a],i);i._addFixture(o)}return i},e.prototype.isWorldLocked=function(){return!!(this.m_world&&this.m_world.isLocked())},e.prototype.getWorld=function(){return this.m_world},e.prototype.getNext=function(){return this.m_next},e.prototype.setUserData=function(e){this.m_userData=e},e.prototype.getUserData=function(){return this.m_userData},e.prototype.getFixtureList=function(){return this.m_fixtureList},e.prototype.getJointList=function(){return this.m_jointList},e.prototype.getContactList=function(){return this.m_contactList},e.prototype.isStatic=function(){return this.m_type==Fp},e.prototype.isDynamic=function(){return this.m_type==Lp},e.prototype.isKinematic=function(){return this.m_type==Ip},e.prototype.setStatic=function(){return this.setType(Fp),this},e.prototype.setDynamic=function(){return this.setType(Lp),this},e.prototype.setKinematic=function(){return this.setType(Ip),this},e.prototype.getType=function(){return this.m_type},e.prototype.setType=function(e){if(this.isWorldLocked()!=1&&this.m_type!=e){this.m_type=e,this.resetMassData(),this.m_type==Fp&&(this.m_linearVelocity.setZero(),this.m_angularVelocity=0,this.m_sweep.forward(),this.synchronizeFixtures()),this.setAwake(!0),this.m_force.setZero(),this.m_torque=0;for(var t=this.m_contactList;t;){var n=t;t=t.next,this.m_world.destroyContact(n.contact)}this.m_contactList=null;for(var r=this.m_world.m_broadPhase,i=this.m_fixtureList;i;i=i.m_next)for(var a=0;a<i.m_proxyCount;++a)r.touchProxy(i.m_proxies[a].proxyId)}},e.prototype.isBullet=function(){return this.m_bulletFlag},e.prototype.setBullet=function(e){this.m_bulletFlag=!!e},e.prototype.isSleepingAllowed=function(){return this.m_autoSleepFlag},e.prototype.setSleepingAllowed=function(e){this.m_autoSleepFlag=!!e,this.m_autoSleepFlag==0&&this.setAwake(!0)},e.prototype.isAwake=function(){return this.m_awakeFlag},e.prototype.setAwake=function(e){e?(this.m_awakeFlag=!0,this.m_sleepTime=0):(this.m_awakeFlag=!1,this.m_sleepTime=0,this.m_linearVelocity.setZero(),this.m_angularVelocity=0,this.m_force.setZero(),this.m_torque=0)},e.prototype.isActive=function(){return this.m_activeFlag},e.prototype.setActive=function(e){if(e!=this.m_activeFlag)if(this.m_activeFlag=!!e,this.m_activeFlag){for(var t=this.m_world.m_broadPhase,n=this.m_fixtureList;n;n=n.m_next)n.createProxies(t,this.m_xf);this.m_world.m_newFixture=!0}else{for(var t=this.m_world.m_broadPhase,n=this.m_fixtureList;n;n=n.m_next)n.destroyProxies(t);for(var r=this.m_contactList;r;){var i=r;r=r.next,this.m_world.destroyContact(i.contact)}this.m_contactList=null}},e.prototype.isFixedRotation=function(){return this.m_fixedRotationFlag},e.prototype.setFixedRotation=function(e){this.m_fixedRotationFlag!=e&&(this.m_fixedRotationFlag=!!e,this.m_angularVelocity=0,this.resetMassData())},e.prototype.getTransform=function(){return this.m_xf},e.prototype.setTransform=function(e,t){if(this.isWorldLocked()!=1){typeof t==`number`?this.m_xf.setNum(e,t):this.m_xf.setTransform(e),this.m_sweep.setTransform(this.m_xf);for(var n=this.m_world.m_broadPhase,r=this.m_fixtureList;r;r=r.m_next)r.synchronize(n,this.m_xf,this.m_xf);this.setAwake(!0)}},e.prototype.synchronizeTransform=function(){this.m_sweep.getTransform(this.m_xf,1)},e.prototype.synchronizeFixtures=function(){this.m_sweep.getTransform(Hp,0);for(var e=this.m_world.m_broadPhase,t=this.m_fixtureList;t;t=t.m_next)t.synchronize(e,Hp,this.m_xf)},e.prototype.advance=function(e){this.m_sweep.advance(e),U(this.m_sweep.c,this.m_sweep.c0),this.m_sweep.a=this.m_sweep.a0,this.m_sweep.getTransform(this.m_xf,1)},e.prototype.getPosition=function(){return this.m_xf.p},e.prototype.setPosition=function(e){this.setTransform(e,this.m_sweep.a)},e.prototype.getAngle=function(){return this.m_sweep.a},e.prototype.setAngle=function(e){this.setTransform(this.m_xf.p,e)},e.prototype.getWorldCenter=function(){return this.m_sweep.c},e.prototype.getLocalCenter=function(){return this.m_sweep.localCenter},e.prototype.getLinearVelocity=function(){return this.m_linearVelocity},e.prototype.getLinearVelocityFromWorldPoint=function(e){var t=z.sub(e,this.m_sweep.c);return z.add(this.m_linearVelocity,z.crossNumVec2(this.m_angularVelocity,t))},e.prototype.getLinearVelocityFromLocalPoint=function(e){return this.getLinearVelocityFromWorldPoint(this.getWorldPoint(e))},e.prototype.setLinearVelocity=function(e){this.m_type!=Fp&&(z.dot(e,e)>0&&this.setAwake(!0),this.m_linearVelocity.setVec2(e))},e.prototype.getAngularVelocity=function(){return this.m_angularVelocity},e.prototype.setAngularVelocity=function(e){this.m_type!=Fp&&(e*e>0&&this.setAwake(!0),this.m_angularVelocity=e)},e.prototype.getLinearDamping=function(){return this.m_linearDamping},e.prototype.setLinearDamping=function(e){this.m_linearDamping=e},e.prototype.getAngularDamping=function(){return this.m_angularDamping},e.prototype.setAngularDamping=function(e){this.m_angularDamping=e},e.prototype.getGravityScale=function(){return this.m_gravityScale},e.prototype.setGravityScale=function(e){this.m_gravityScale=e},e.prototype.getMass=function(){return this.m_mass},e.prototype.getInertia=function(){return this.m_I+this.m_mass*z.dot(this.m_sweep.localCenter,this.m_sweep.localCenter)},e.prototype.getMassData=function(e){e.mass=this.m_mass,e.I=this.getInertia(),U(e.center,this.m_sweep.localCenter)},e.prototype.resetMassData=function(){if(this.m_mass=0,this.m_invMass=0,this.m_I=0,this.m_invI=0,W(this.m_sweep.localCenter),this.isStatic()||this.isKinematic()){U(this.m_sweep.c0,this.m_xf.p),U(this.m_sweep.c,this.m_xf.p),this.m_sweep.a0=this.m_sweep.a;return}W(zp);for(var e=this.m_fixtureList;e;e=e.m_next)if(e.m_density!=0){var t={mass:0,center:H(0,0),I:0};e.getMassData(t),this.m_mass+=t.mass,Yf(zp,t.mass,t.center),this.m_I+=t.I}this.m_mass>0?(this.m_invMass=1/this.m_mass,K(zp,this.m_invMass,zp)):(this.m_mass=1,this.m_invMass=1),this.m_I>0&&this.m_fixedRotationFlag==0?(this.m_I-=this.m_mass*J(zp,zp),this.m_invI=1/this.m_I):(this.m_I=0,this.m_invI=0),U(Rp,this.m_sweep.c),this.m_sweep.setLocalCenter(zp,this.m_xf),G(Bp,this.m_sweep.c,Rp),np(Vp,this.m_angularVelocity,Bp),Gf(this.m_linearVelocity,Vp)},e.prototype.setMassData=function(e){this.isWorldLocked()!=1&&this.m_type==Lp&&(this.m_invMass=0,this.m_I=0,this.m_invI=0,this.m_mass=e.mass,this.m_mass<=0&&(this.m_mass=1),this.m_invMass=1/this.m_mass,e.I>0&&this.m_fixedRotationFlag==0&&(this.m_I=e.I-this.m_mass*J(e.center,e.center),this.m_invI=1/this.m_I),U(Rp,this.m_sweep.c),this.m_sweep.setLocalCenter(e.center,this.m_xf),G(Bp,this.m_sweep.c,Rp),np(Vp,this.m_angularVelocity,Bp),Gf(this.m_linearVelocity,Vp))},e.prototype.applyForce=function(e,t,n){n===void 0&&(n=!0),this.m_type==Lp&&(n&&this.m_awakeFlag==0&&this.setAwake(!0),this.m_awakeFlag&&(this.m_force.add(e),this.m_torque+=z.crossVec2Vec2(z.sub(t,this.m_sweep.c),e)))},e.prototype.applyForceToCenter=function(e,t){t===void 0&&(t=!0),this.m_type==Lp&&(t&&this.m_awakeFlag==0&&this.setAwake(!0),this.m_awakeFlag&&this.m_force.add(e))},e.prototype.applyTorque=function(e,t){t===void 0&&(t=!0),this.m_type==Lp&&(t&&this.m_awakeFlag==0&&this.setAwake(!0),this.m_awakeFlag&&(this.m_torque+=e))},e.prototype.applyLinearImpulse=function(e,t,n){n===void 0&&(n=!0),this.m_type==Lp&&(n&&this.m_awakeFlag==0&&this.setAwake(!0),this.m_awakeFlag&&(this.m_linearVelocity.addMul(this.m_invMass,e),this.m_angularVelocity+=this.m_invI*z.crossVec2Vec2(z.sub(t,this.m_sweep.c),e)))},e.prototype.applyAngularImpulse=function(e,t){t===void 0&&(t=!0),this.m_type==Lp&&(t&&this.m_awakeFlag==0&&this.setAwake(!0),this.m_awakeFlag&&(this.m_angularVelocity+=this.m_invI*e))},e.prototype.shouldCollide=function(e){if(this.m_type!=Lp&&e.m_type!=Lp)return!1;for(var t=this.m_jointList;t;t=t.next)if(t.other==e&&t.joint.m_collideConnected==0)return!1;return!0},e.prototype._addFixture=function(e){if(this.isWorldLocked()==1)return null;if(this.m_activeFlag){var t=this.m_world.m_broadPhase;e.createProxies(t,this.m_xf)}return e.m_next=this.m_fixtureList,this.m_fixtureList=e,e.m_density>0&&this.resetMassData(),this.m_world.m_newFixture=!0,e},e.prototype.createFixture=function(e,t){if(this.isWorldLocked()==1)return null;var n=new Pp(this,e,t);return this._addFixture(n),this.m_world.publish(`add-fixture`,n),n},e.prototype.destroyFixture=function(e){if(this.isWorldLocked()!=1){if(this.m_fixtureList===e)this.m_fixtureList=e.m_next;else for(var t=this.m_fixtureList;t!=null;){if(t.m_next===e){t.m_next=e.m_next;break}t=t.m_next}for(var n=this.m_contactList;n;){var r=n.contact;n=n.next;var i=r.getFixtureA(),a=r.getFixtureB();(e==i||e==a)&&this.m_world.destroyContact(r)}if(this.m_activeFlag){var o=this.m_world.m_broadPhase;e.destroyProxies(o)}e.m_body=null,e.m_next=null,this.m_world.publish(`remove-fixture`,e),this.resetMassData()}},e.prototype.getWorldPoint=function(e){return Sp.mulVec2(this.m_xf,e)},e.prototype.getWorldVector=function(e){return X.mulVec2(this.m_xf.q,e)},e.prototype.getLocalPoint=function(e){return Sp.mulTVec2(this.m_xf,e)},e.prototype.getLocalVector=function(e){return X.mulTVec2(this.m_xf.q,e)},e.STATIC=`static`,e.KINEMATIC=`kinematic`,e.DYNAMIC=`dynamic`,e})(),Gp=(function(){function e(){this.other=null,this.joint=null,this.prev=null,this.next=null}return e})(),Kp=(function(){function e(e,t,n){this.m_type=`unknown-joint`,this.m_prev=null,this.m_next=null,this.m_edgeA=new Gp,this.m_edgeB=new Gp,this.m_islandFlag=!1,this.style={},this.appData={},t=`bodyA`in e?e.bodyA:t,n=`bodyB`in e?e.bodyB:n,this.m_bodyA=t,this.m_bodyB=n,this.m_collideConnected=!!e.collideConnected,this.m_userData=e.userData,typeof e.style==`object`&&e.style!==null&&(this.style=e.style)}return e.prototype.isActive=function(){return this.m_bodyA.isActive()&&this.m_bodyB.isActive()},e.prototype.getType=function(){return this.m_type},e.prototype.getBodyA=function(){return this.m_bodyA},e.prototype.getBodyB=function(){return this.m_bodyB},e.prototype.getNext=function(){return this.m_next},e.prototype.getUserData=function(){return this.m_userData},e.prototype.setUserData=function(e){this.m_userData=e},e.prototype.getCollideConnected=function(){return this.m_collideConnected},e.prototype.shiftOrigin=function(e){},e.prototype._resetAnchors=function(e){return this._reset(e)},e})(),qp={gjkCalls:0,gjkIters:0,gjkMaxIters:0,toiTime:0,toiMaxTime:0,toiCalls:0,toiIters:0,toiMaxIters:0,toiRootIters:0,toiMaxRootIters:0,toString:function(e){e=typeof e==`string`?e:`
1433
- `;var t=``;for(var n in this)typeof this[n]!=`function`&&typeof this[n]!=`object`&&(t+=n+`: `+this[n]+e);return t}},Jp={now:function(){return Date.now()},diff:function(e){return Date.now()-e}},Yp=Math.max,Xp=H(0,0),Zp=H(0,0),Qp=H(0,0),$p=H(0,0),em=H(0,0),tm=H(0,0),nm=H(0,0);qp.gjkCalls=0,qp.gjkIters=0,qp.gjkMaxIters=0;var rm=(function(){function e(){this.proxyA=new sm,this.proxyB=new sm,this.transformA=Sp.identity(),this.transformB=Sp.identity(),this.useRadii=!1}return e.prototype.recycle=function(){this.proxyA.recycle(),this.proxyB.recycle(),this.transformA.setIdentity(),this.transformB.setIdentity(),this.useRadii=!1},e})(),im=(function(){function e(){this.pointA=H(0,0),this.pointB=H(0,0),this.distance=0,this.iterations=0}return e.prototype.recycle=function(){W(this.pointA),W(this.pointB),this.distance=0,this.iterations=0},e})(),am=(function(){function e(){this.metric=0,this.indexA=[],this.indexB=[],this.count=0}return e.prototype.recycle=function(){this.metric=0,this.indexA.length=0,this.indexB.length=0,this.count=0},e})(),om=function(e,t,n){++qp.gjkCalls;var r=n.proxyA,i=n.proxyB,a=n.transformA,o=n.transformB;dm.recycle(),dm.readCache(t,r,a,i,o);for(var s=dm.m_v,c=V.maxDistanceIterations,l=[],u=[],d=0,f=0;f<c;){d=dm.m_count;for(var p=0;p<d;++p)l[p]=s[p].indexA,u[p]=s[p].indexB;if(dm.solve(),dm.m_count===3)break;var m=dm.getSearchDirection();if(rp(m)<pf*pf)break;var h=s[dm.m_count];h.indexA=r.getSupport(cp(Xp,a.q,K(Xp,-1,m))),Y(h.wA,a,r.getVertex(h.indexA)),h.indexB=i.getSupport(cp(Xp,o.q,m)),Y(h.wB,o,i.getVertex(h.indexB)),G(h.w,h.wB,h.wA),++f,++qp.gjkIters;for(var g=!1,p=0;p<d;++p)if(h.indexA===l[p]&&h.indexB===u[p]){g=!0;break}if(g)break;++dm.m_count}if(qp.gjkMaxIters=Yp(qp.gjkMaxIters,f),dm.getWitnessPoints(e.pointA,e.pointB),e.distance=ip(e.pointA,e.pointB),e.iterations=f,dm.writeCache(t),n.useRadii){var _=r.m_radius,v=i.m_radius;if(e.distance>_+v&&e.distance>pf)e.distance-=_+v,G(Zp,e.pointB,e.pointA),ep(Zp),Yf(e.pointA,_,Zp),Xf(e.pointB,v,Zp);else{var y=G(Xp,e.pointA,e.pointB);U(e.pointA,y),U(e.pointB,y),e.distance=0}}},sm=(function(){function e(){this.m_vertices=[],this.m_count=0,this.m_radius=0}return e.prototype.recycle=function(){this.m_vertices.length=0,this.m_count=0,this.m_radius=0},e.prototype.getVertexCount=function(){return this.m_count},e.prototype.getVertex=function(e){return this.m_vertices[e]},e.prototype.getSupport=function(e){for(var t=-1,n=-1/0,r=0;r<this.m_count;++r){var i=J(this.m_vertices[r],e);i>n&&(t=r,n=i)}return t},e.prototype.getSupportVertex=function(e){return this.m_vertices[this.getSupport(e)]},e.prototype.set=function(e,t){e.computeDistanceProxy(this,t)},e.prototype.setVertices=function(e,t,n){this.m_vertices=e,this.m_count=t,this.m_radius=n},e})(),cm=(function(){function e(){this.wA=H(0,0),this.indexA=0,this.wB=H(0,0),this.indexB=0,this.w=H(0,0),this.a=0}return e.prototype.recycle=function(){this.indexA=0,this.indexB=0,W(this.wA),W(this.wB),W(this.w),this.a=0},e.prototype.set=function(e){this.indexA=e.indexA,this.indexB=e.indexB,U(this.wA,e.wA),U(this.wB,e.wB),U(this.w,e.w),this.a=e.a},e})(),lm=H(0,0),um=H(0,0),dm=new((function(){function e(){this.m_v1=new cm,this.m_v2=new cm,this.m_v3=new cm,this.m_v=[this.m_v1,this.m_v2,this.m_v3]}return e.prototype.recycle=function(){this.m_v1.recycle(),this.m_v2.recycle(),this.m_v3.recycle(),this.m_count=0},e.prototype.toString=function(){return this.m_count===3?[`+`+this.m_count,this.m_v1.a,this.m_v1.wA.x,this.m_v1.wA.y,this.m_v1.wB.x,this.m_v1.wB.y,this.m_v2.a,this.m_v2.wA.x,this.m_v2.wA.y,this.m_v2.wB.x,this.m_v2.wB.y,this.m_v3.a,this.m_v3.wA.x,this.m_v3.wA.y,this.m_v3.wB.x,this.m_v3.wB.y].toString():this.m_count===2?[`+`+this.m_count,this.m_v1.a,this.m_v1.wA.x,this.m_v1.wA.y,this.m_v1.wB.x,this.m_v1.wB.y,this.m_v2.a,this.m_v2.wA.x,this.m_v2.wA.y,this.m_v2.wB.x,this.m_v2.wB.y].toString():this.m_count===1?[`+`+this.m_count,this.m_v1.a,this.m_v1.wA.x,this.m_v1.wA.y,this.m_v1.wB.x,this.m_v1.wB.y].toString():`+`+this.m_count},e.prototype.readCache=function(e,t,n,r,i){this.m_count=e.count;for(var a=0;a<this.m_count;++a){var o=this.m_v[a];o.indexA=e.indexA[a],o.indexB=e.indexB[a];var s=t.getVertex(o.indexA),c=r.getVertex(o.indexB);Y(o.wA,n,s),Y(o.wB,i,c),G(o.w,o.wB,o.wA),o.a=0}if(this.m_count>1){var l=e.metric,u=this.getMetric();(u<.5*l||2*l<u||u<pf)&&(this.m_count=0)}if(this.m_count===0){var o=this.m_v[0];o.indexA=0,o.indexB=0;var s=t.getVertex(0),c=r.getVertex(0);Y(o.wA,n,s),Y(o.wB,i,c),G(o.w,o.wB,o.wA),o.a=1,this.m_count=1}},e.prototype.writeCache=function(e){e.metric=this.getMetric(),e.count=this.m_count;for(var t=0;t<this.m_count;++t)e.indexA[t]=this.m_v[t].indexA,e.indexB[t]=this.m_v[t].indexB},e.prototype.getSearchDirection=function(){var e=this.m_v1,t=this.m_v2;switch(this.m_count){case 1:return Uf(lm,-e.w.x,-e.w.y);case 2:return G(Qp,t.w,e.w),-q(Qp,e.w)>0?Uf(lm,-Qp.y,Qp.x):Uf(lm,Qp.y,-Qp.x);default:return W(lm)}},e.prototype.getClosestPoint=function(){var e=this.m_v1,t=this.m_v2;switch(this.m_count){case 0:return W(um);case 1:return U(um,e.w);case 2:return Zf(um,e.a,e.w,t.a,t.w);case 3:return W(um);default:return W(um)}},e.prototype.getWitnessPoints=function(e,t){var n=this.m_v1,r=this.m_v2,i=this.m_v3;switch(this.m_count){case 0:break;case 1:U(e,n.wA),U(t,n.wB);break;case 2:Zf(e,n.a,n.wA,r.a,r.wA),Zf(t,n.a,n.wB,r.a,r.wB);break;case 3:Qf(e,n.a,n.wA,r.a,r.wA,i.a,i.wA),U(t,e);break}},e.prototype.getMetric=function(){switch(this.m_count){case 0:return 0;case 1:return 0;case 2:return ip(this.m_v1.w,this.m_v2.w);case 3:return q(G(tm,this.m_v2.w,this.m_v1.w),G(nm,this.m_v3.w,this.m_v1.w));default:return 0}},e.prototype.solve=function(){switch(this.m_count){case 1:break;case 2:this.solve2();break;case 3:this.solve3();break}},e.prototype.solve2=function(){var e=this.m_v1.w,t=this.m_v2.w;G(Qp,t,e);var n=-J(e,Qp);if(n<=0){this.m_v1.a=1,this.m_count=1;return}var r=J(t,Qp);if(r<=0){this.m_v2.a=1,this.m_count=1,this.m_v1.set(this.m_v2);return}var i=1/(r+n);this.m_v1.a=r*i,this.m_v2.a=n*i,this.m_count=2},e.prototype.solve3=function(){var e=this.m_v1.w,t=this.m_v2.w,n=this.m_v3.w;G(Qp,t,e);var r=J(e,Qp),i=J(t,Qp),a=-r;G($p,n,e);var o=J(e,$p),s=J(n,$p),c=-o;G(em,n,t);var l=J(t,em),u=J(n,em),d=-l,f=q(Qp,$p),p=f*q(t,n),m=f*q(n,e),h=f*q(e,t);if(a<=0&&c<=0){this.m_v1.a=1,this.m_count=1;return}if(i>0&&a>0&&h<=0){var g=1/(i+a);this.m_v1.a=i*g,this.m_v2.a=a*g,this.m_count=2;return}if(s>0&&c>0&&m<=0){var _=1/(s+c);this.m_v1.a=s*_,this.m_v3.a=c*_,this.m_count=2,this.m_v2.set(this.m_v3);return}if(i<=0&&d<=0){this.m_v2.a=1,this.m_count=1,this.m_v1.set(this.m_v2);return}if(s<=0&&u<=0){this.m_v3.a=1,this.m_count=1,this.m_v1.set(this.m_v3);return}if(u>0&&d>0&&p<=0){var v=1/(u+d);this.m_v2.a=u*v,this.m_v3.a=d*v,this.m_count=2,this.m_v1.set(this.m_v3);return}var y=1/(p+m+h);this.m_v1.a=p*y,this.m_v2.a=m*y,this.m_v3.a=h*y,this.m_count=3},e})()),fm=new rm,pm=new am,mm=new im,hm=function(e,t,n,r,i,a){return fm.recycle(),fm.proxyA.set(e,t),fm.proxyB.set(n,r),dp(fm.transformA,i),dp(fm.transformB,a),fm.useRadii=!0,mm.recycle(),pm.recycle(),om(mm,pm,fm),mm.distance<10*pf};om.testOverlap=hm,om.Input=rm,om.Output=im,om.Proxy=sm,om.Cache=am,(function(){function e(){this.proxyA=new sm,this.proxyB=new sm,this.transformA=Sp.identity(),this.transformB=Sp.identity(),this.translationB=z.zero()}return e.prototype.recycle=function(){this.proxyA.recycle(),this.proxyB.recycle(),this.transformA.setIdentity(),this.transformB.setIdentity(),W(this.translationB)},e})();var gm=Math.abs,_m=Math.max,vm=(function(){function e(){this.proxyA=new sm,this.proxyB=new sm,this.sweepA=new xp,this.sweepB=new xp}return e.prototype.recycle=function(){this.proxyA.recycle(),this.proxyB.recycle(),this.sweepA.recycle(),this.sweepB.recycle(),this.tMax=-1},e})(),ym;(function(e){e[e.e_unset=-1]=`e_unset`,e[e.e_unknown=0]=`e_unknown`,e[e.e_failed=1]=`e_failed`,e[e.e_overlapped=2]=`e_overlapped`,e[e.e_touching=3]=`e_touching`,e[e.e_separated=4]=`e_separated`})(ym||={});var bm=(function(){function e(){this.state=ym.e_unset,this.t=-1}return e.prototype.recycle=function(){this.state=ym.e_unset,this.t=-1},e})();qp.toiTime=0,qp.toiMaxTime=0,qp.toiCalls=0,qp.toiIters=0,qp.toiMaxIters=0,qp.toiRootIters=0,qp.toiMaxRootIters=0;var xm=new rm,Sm=new im,Cm=new am,wm=up(0,0,0),Tm=up(0,0,0),Em=H(0,0),Dm=H(0,0),Om=H(0,0),km=H(0,0),Am=H(0,0),jm=H(0,0),Mm=H(0,0),Nm=H(0,0),Pm=function(e,t){var n=Jp.now();++qp.toiCalls,e.state=ym.e_unknown,e.t=t.tMax;var r=t.proxyA,i=t.proxyB,a=t.sweepA,o=t.sweepB;a.normalize(),o.normalize();var s=t.tMax,c=r.m_radius+i.m_radius,l=_m(V.linearSlop,c-3*V.linearSlop),u=.25*V.linearSlop,d=0,f=V.maxTOIIterations,p=0;for(Cm.recycle(),xm.proxyA.setVertices(r.m_vertices,r.m_count,r.m_radius),xm.proxyB.setVertices(i.m_vertices,i.m_count,i.m_radius),xm.useRadii=!1;;){if(a.getTransform(wm,d),o.getTransform(Tm,d),dp(xm.transformA,wm),dp(xm.transformB,Tm),om(Sm,Cm,xm),Sm.distance<=0){e.state=ym.e_overlapped,e.t=0;break}if(Sm.distance<l+u){e.state=ym.e_touching,e.t=d;break}Im.initialize(Cm,r,a,i,o,d);for(var m=!1,h=s,g=0;;){var _=Im.findMinSeparation(h);if(_>l+u){e.state=ym.e_separated,e.t=s,m=!0;break}if(_>l-u){d=h;break}var v=Im.evaluate(d);if(v<l-u){e.state=ym.e_failed,e.t=d,m=!0;break}if(v<=l+u){e.state=ym.e_touching,e.t=d,m=!0;break}for(var y=0,b=d,x=h;;){var S=void 0;S=y&1?b+(l-v)*(x-b)/(_-v):.5*(b+x),++y,++qp.toiRootIters;var C=Im.evaluate(S);if(gm(C-l)<u){h=S;break}if(C>l?(b=S,v=C):(x=S,_=C),y===50)break}if(qp.toiMaxRootIters=_m(qp.toiMaxRootIters,y),++g,g===V.maxPolygonVertices)break}if(++p,++qp.toiIters,m)break;if(p===f){e.state=ym.e_failed,e.t=d;break}}qp.toiMaxIters=_m(qp.toiMaxIters,p);var w=Jp.diff(n);qp.toiMaxTime=_m(qp.toiMaxTime,w),qp.toiTime+=w,Im.recycle()},Fm;(function(e){e[e.e_unset=-1]=`e_unset`,e[e.e_points=1]=`e_points`,e[e.e_faceA=2]=`e_faceA`,e[e.e_faceB=3]=`e_faceB`})(Fm||={});var Im=new((function(){function e(){this.m_proxyA=null,this.m_proxyB=null,this.m_sweepA=null,this.m_sweepB=null,this.m_type=Fm.e_unset,this.m_localPoint=H(0,0),this.m_axis=H(0,0),this.indexA=-1,this.indexB=-1}return e.prototype.recycle=function(){this.m_proxyA=null,this.m_proxyB=null,this.m_sweepA=null,this.m_sweepB=null,this.m_type=Fm.e_unset,W(this.m_localPoint),W(this.m_axis),this.indexA=-1,this.indexB=-1},e.prototype.initialize=function(e,t,n,r,i,a){var o=e.count;if(this.m_proxyA=t,this.m_proxyB=r,this.m_sweepA=n,this.m_sweepB=i,this.m_sweepA.getTransform(wm,a),this.m_sweepB.getTransform(Tm,a),o===1){this.m_type=Fm.e_points;var s=this.m_proxyA.getVertex(e.indexA[0]),c=this.m_proxyB.getVertex(e.indexB[0]);Y(Dm,wm,s),Y(Om,Tm,c),G(this.m_axis,Om,Dm);var l=$f(this.m_axis);return l}else if(e.indexA[0]===e.indexA[1]){this.m_type=Fm.e_faceB;var u=r.getVertex(e.indexB[0]),d=r.getVertex(e.indexB[1]);tp(this.m_axis,G(Em,d,u),1),ep(this.m_axis),sp(km,Tm.q,this.m_axis),Zf(this.m_localPoint,.5,u,.5,d),Y(Om,Tm,this.m_localPoint);var f=t.getVertex(e.indexA[0]),l=J(Sp.mulVec2(wm,f),km)-J(Om,km);return l<0&&(Wf(this.m_axis),l=-l),l}else{this.m_type=Fm.e_faceA;var p=this.m_proxyA.getVertex(e.indexA[0]),m=this.m_proxyA.getVertex(e.indexA[1]);tp(this.m_axis,G(Em,m,p),1),ep(this.m_axis),sp(km,wm.q,this.m_axis),Zf(this.m_localPoint,.5,p,.5,m),Y(Dm,wm,this.m_localPoint),Y(Om,Tm,this.m_proxyB.getVertex(e.indexB[0]));var l=J(Om,km)-J(Dm,km);return l<0&&(Wf(this.m_axis),l=-l),l}},e.prototype.compute=function(e,t){switch(this.m_sweepA.getTransform(wm,t),this.m_sweepB.getTransform(Tm,t),this.m_type){case Fm.e_points:e&&(cp(Am,wm.q,this.m_axis),cp(jm,Tm.q,K(Em,-1,this.m_axis)),this.indexA=this.m_proxyA.getSupport(Am),this.indexB=this.m_proxyB.getSupport(jm)),U(Mm,this.m_proxyA.getVertex(this.indexA)),U(Nm,this.m_proxyB.getVertex(this.indexB)),Y(Dm,wm,Mm),Y(Om,Tm,Nm);var n=J(Om,this.m_axis)-J(Dm,this.m_axis);return n;case Fm.e_faceA:sp(km,wm.q,this.m_axis),Y(Dm,wm,this.m_localPoint),e&&(cp(jm,Tm.q,K(Em,-1,km)),this.indexA=-1,this.indexB=this.m_proxyB.getSupport(jm)),U(Nm,this.m_proxyB.getVertex(this.indexB)),Y(Om,Tm,Nm);var n=J(Om,km)-J(Dm,km);return n;case Fm.e_faceB:sp(km,Tm.q,this.m_axis),Y(Om,Tm,this.m_localPoint),e&&(cp(Am,wm.q,K(Em,-1,km)),this.indexB=-1,this.indexA=this.m_proxyA.getSupport(Am)),U(Mm,this.m_proxyA.getVertex(this.indexA)),Y(Dm,wm,Mm);var n=J(Dm,km)-J(Om,km);return n;default:return e&&(this.indexA=-1,this.indexB=-1),0}},e.prototype.findMinSeparation=function(e){return this.compute(!0,e)},e.prototype.evaluate=function(e){return this.compute(!1,e)},e})());Pm.Input=vm,Pm.Output=bm;var Lm=Math.abs,Rm=Math.sqrt,zm=Math.min,Bm=(function(){function e(){this.dt=0,this.inv_dt=0,this.velocityIterations=0,this.positionIterations=0,this.warmStarting=!1,this.blockSolve=!0,this.inv_dt0=0,this.dtRatio=1}return e.prototype.reset=function(e){this.dt>0&&(this.inv_dt0=this.inv_dt),this.dt=e,this.inv_dt=e==0?0:1/e,this.dtRatio=e*this.inv_dt0},e})(),Vm=new Bm,Hm=H(0,0),Um=H(0,0),Wm=H(0,0),Gm=new vm,Km=new bm,qm=new xp,Jm=new xp,Ym=new xp,Xm=(function(){function e(e){this.contact=e,this.normals=[],this.tangents=[]}return e.prototype.recycle=function(){this.normals.length=0,this.tangents.length=0},Object.defineProperty(e.prototype,"normalImpulses",{get:function(){var e=this.contact,t=this.normals;t.length=0;for(var n=0;n<e.v_points.length;++n)t.push(e.v_points[n].normalImpulse);return t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tangentImpulses",{get:function(){var e=this.contact,t=this.tangents;t.length=0;for(var n=0;n<e.v_points.length;++n)t.push(e.v_points[n].tangentImpulse);return t},enumerable:!1,configurable:!0}),e})(),Zm=(function(){function e(e){this.m_world=e,this.m_stack=[],this.m_bodies=[],this.m_contacts=[],this.m_joints=[]}return e.prototype.clear=function(){this.m_stack.length=0,this.m_bodies.length=0,this.m_contacts.length=0,this.m_joints.length=0},e.prototype.addBody=function(e){this.m_bodies.push(e)},e.prototype.addContact=function(e){this.m_contacts.push(e)},e.prototype.addJoint=function(e){this.m_joints.push(e)},e.prototype.solveWorld=function(e){for(var t=this.m_world,n=t.m_bodyList;n;n=n.m_next)n.m_islandFlag=!1;for(var r=t.m_contactList;r;r=r.m_next)r.m_islandFlag=!1;for(var i=t.m_jointList;i;i=i.m_next)i.m_islandFlag=!1;for(var a=this.m_stack,o=t.m_bodyList;o;o=o.m_next)if(!o.m_islandFlag&&!(o.isAwake()==0||o.isActive()==0)&&!o.isStatic()){for(this.clear(),a.push(o),o.m_islandFlag=!0;a.length>0;){var n=a.pop();if(this.addBody(n),n.m_awakeFlag=!0,!n.isStatic()){for(var s=n.m_contactList;s;s=s.next){var c=s.contact;if(!c.m_islandFlag&&!(c.isEnabled()==0||c.isTouching()==0)){var l=c.m_fixtureA.m_isSensor,u=c.m_fixtureB.m_isSensor;if(!(l||u)){this.addContact(c),c.m_islandFlag=!0;var d=s.other;d.m_islandFlag||=(a.push(d),!0)}}}for(var f=n.m_jointList;f;f=f.next)if(f.joint.m_islandFlag!=1){var d=f.other;d.isActive()!=0&&(this.addJoint(f.joint),f.joint.m_islandFlag=!0,!d.m_islandFlag&&(a.push(d),d.m_islandFlag=!0))}}}this.solveIsland(e);for(var p=0;p<this.m_bodies.length;++p){var n=this.m_bodies[p];n.isStatic()&&(n.m_islandFlag=!1)}}},e.prototype.solveIsland=function(e){for(var t=this.m_world,n=t.m_gravity,r=t.m_allowSleep,i=e.dt,a=0;a<this.m_bodies.length;++a){var o=this.m_bodies[a];U(Hm,o.m_sweep.c);var s=o.m_sweep.a;U(Um,o.m_linearVelocity);var c=o.m_angularVelocity;U(o.m_sweep.c0,o.m_sweep.c),o.m_sweep.a0=o.m_sweep.a,o.isDynamic()&&(Yf(Um,i*o.m_gravityScale,n),Yf(Um,i*o.m_invMass,o.m_force),c+=i*o.m_invI*o.m_torque,K(Um,1/(1+i*o.m_linearDamping),Um),c*=1/(1+i*o.m_angularDamping)),U(o.c_position.c,Hm),o.c_position.a=s,U(o.c_velocity.v,Um),o.c_velocity.w=c}for(var a=0;a<this.m_contacts.length;++a){var l=this.m_contacts[a];l.initConstraint(e)}for(var a=0;a<this.m_contacts.length;++a){var l=this.m_contacts[a];l.initVelocityConstraint(e)}if(e.warmStarting)for(var a=0;a<this.m_contacts.length;++a){var l=this.m_contacts[a];l.warmStartConstraint(e)}for(var a=0;a<this.m_joints.length;++a){var u=this.m_joints[a];u.initVelocityConstraints(e)}for(var a=0;a<e.velocityIterations;++a){for(var d=0;d<this.m_joints.length;++d){var u=this.m_joints[d];u.solveVelocityConstraints(e)}for(var d=0;d<this.m_contacts.length;++d){var l=this.m_contacts[d];l.solveVelocityConstraint(e)}}for(var a=0;a<this.m_contacts.length;++a){var l=this.m_contacts[a];l.storeConstraintImpulses(e)}for(var a=0;a<this.m_bodies.length;++a){var o=this.m_bodies[a];U(Hm,o.c_position.c);var s=o.c_position.a;U(Um,o.c_velocity.v);var c=o.c_velocity.w;K(Wm,i,Um);var f=rp(Wm);if(f>V.maxTranslationSquared){var p=V.maxTranslation/Rm(f);Jf(Um,p)}var m=i*c;if(m*m>V.maxRotationSquared){var p=V.maxRotation/Lm(m);c*=p}Yf(Hm,i,Um),s+=i*c,U(o.c_position.c,Hm),o.c_position.a=s,U(o.c_velocity.v,Um),o.c_velocity.w=c}for(var h=!1,a=0;a<e.positionIterations;++a){for(var g=0,d=0;d<this.m_contacts.length;++d){var l=this.m_contacts[d],_=l.solvePositionConstraint(e);g=zm(g,_)}for(var v=g>=-3*V.linearSlop,y=!0,d=0;d<this.m_joints.length;++d){var u=this.m_joints[d],b=u.solvePositionConstraints(e);y&&=b}if(v&&y){h=!0;break}}for(var a=0;a<this.m_bodies.length;++a){var o=this.m_bodies[a];U(o.m_sweep.c,o.c_position.c),o.m_sweep.a=o.c_position.a,U(o.m_linearVelocity,o.c_velocity.v),o.m_angularVelocity=o.c_velocity.w,o.synchronizeTransform()}if(this.postSolveIsland(),r){for(var x=1/0,S=V.linearSleepToleranceSqr,C=V.angularSleepToleranceSqr,a=0;a<this.m_bodies.length;++a){var o=this.m_bodies[a];o.isStatic()||(o.m_autoSleepFlag==0||o.m_angularVelocity*o.m_angularVelocity>C||rp(o.m_linearVelocity)>S?(o.m_sleepTime=0,x=0):(o.m_sleepTime+=i,x=zm(x,o.m_sleepTime)))}if(x>=V.timeToSleep&&h)for(var a=0;a<this.m_bodies.length;++a){var o=this.m_bodies[a];o.setAwake(!1)}}},e.prototype.solveWorldTOI=function(e){var t=this.m_world;if(t.m_stepComplete){for(var n=t.m_bodyList;n;n=n.m_next)n.m_islandFlag=!1,n.m_sweep.alpha0=0;for(var r=t.m_contactList;r;r=r.m_next)r.m_toiFlag=!1,r.m_islandFlag=!1,r.m_toiCount=0,r.m_toi=1}for(;;){for(var i=null,a=1,o=t.m_contactList;o;o=o.m_next)if(o.isEnabled()!=0&&!(o.m_toiCount>V.maxSubSteps)){var s=1;if(o.m_toiFlag)s=o.m_toi;else{var c=o.getFixtureA(),l=o.getFixtureB();if(c.isSensor()||l.isSensor())continue;var u=c.getBody(),d=l.getBody(),f=u.isAwake()&&!u.isStatic(),p=d.isAwake()&&!d.isStatic();if(f==0&&p==0)continue;var m=u.isBullet()||!u.isDynamic(),h=d.isBullet()||!d.isDynamic();if(m==0&&h==0)continue;var g=u.m_sweep.alpha0;u.m_sweep.alpha0<d.m_sweep.alpha0?(g=d.m_sweep.alpha0,u.m_sweep.advance(g)):d.m_sweep.alpha0<u.m_sweep.alpha0&&(g=u.m_sweep.alpha0,d.m_sweep.advance(g));var _=o.getChildIndexA(),v=o.getChildIndexB();Gm.proxyA.set(c.getShape(),_),Gm.proxyB.set(l.getShape(),v),Gm.sweepA.set(u.m_sweep),Gm.sweepB.set(d.m_sweep),Gm.tMax=1,Pm(Km,Gm);var y=Km.t;s=Km.state==ym.e_touching?zm(g+(1-g)*y,1):1,o.m_toi=s,o.m_toiFlag=!0}s<a&&(i=o,a=s)}if(i==null||1-10*pf<a){t.m_stepComplete=!0;break}var b=i.getFixtureA(),x=i.getFixtureB(),S=b.getBody(),C=x.getBody();if(Jm.set(S.m_sweep),Ym.set(C.m_sweep),S.advance(a),C.advance(a),i.update(t),i.m_toiFlag=!1,++i.m_toiCount,i.isEnabled()==0||i.isTouching()==0){i.setEnabled(!1),S.m_sweep.set(Jm),C.m_sweep.set(Ym),S.synchronizeTransform(),C.synchronizeTransform();continue}S.setAwake(!0),C.setAwake(!0),this.clear(),this.addBody(S),this.addBody(C),this.addContact(i),S.m_islandFlag=!0,C.m_islandFlag=!0,i.m_islandFlag=!0;for(var w=[S,C],T=0;T<w.length;++T){var E=w[T];if(E.isDynamic())for(var D=E.m_contactList;D;D=D.next){var O=D.contact;if(!O.m_islandFlag){var ee=D.other;if(!(ee.isDynamic()&&!E.isBullet()&&!ee.isBullet())){var te=O.m_fixtureA.m_isSensor,ne=O.m_fixtureB.m_isSensor;if(!(te||ne)){if(qm.set(ee.m_sweep),ee.m_islandFlag==0&&ee.advance(a),O.update(t),O.isEnabled()==0||O.isTouching()==0){ee.m_sweep.set(qm),ee.synchronizeTransform();continue}O.m_islandFlag=!0,this.addContact(O),!ee.m_islandFlag&&(ee.m_islandFlag=!0,ee.isStatic()||ee.setAwake(!0),this.addBody(ee))}}}}}Vm.reset((1-a)*e.dt),Vm.dtRatio=1,Vm.positionIterations=20,Vm.velocityIterations=e.velocityIterations,Vm.warmStarting=!1,this.solveIslandTOI(Vm,S,C);for(var T=0;T<this.m_bodies.length;++T){var E=this.m_bodies[T];if(E.m_islandFlag=!1,E.isDynamic()){E.synchronizeFixtures();for(var D=E.m_contactList;D;D=D.next)D.contact.m_toiFlag=!1,D.contact.m_islandFlag=!1}}if(t.findNewContacts(),t.m_subStepping){t.m_stepComplete=!1;break}}},e.prototype.solveIslandTOI=function(e,t,n){for(var r=0;r<this.m_bodies.length;++r){var i=this.m_bodies[r];U(i.c_position.c,i.m_sweep.c),i.c_position.a=i.m_sweep.a,U(i.c_velocity.v,i.m_linearVelocity),i.c_velocity.w=i.m_angularVelocity}for(var r=0;r<this.m_contacts.length;++r){var a=this.m_contacts[r];a.initConstraint(e)}for(var r=0;r<e.positionIterations;++r){for(var o=0,s=0;s<this.m_contacts.length;++s){var a=this.m_contacts[s],c=a.solvePositionConstraintTOI(e,t,n);o=zm(o,c)}if(o>=-1.5*V.linearSlop)break}var r;U(t.m_sweep.c0,t.c_position.c),t.m_sweep.a0=t.c_position.a,U(n.m_sweep.c0,n.c_position.c),n.m_sweep.a0=n.c_position.a;for(var r=0;r<this.m_contacts.length;++r){var a=this.m_contacts[r];a.initVelocityConstraint(e)}for(var r=0;r<e.velocityIterations;++r)for(var s=0;s<this.m_contacts.length;++s){var a=this.m_contacts[s];a.solveVelocityConstraint(e)}for(var l=e.dt,r=0;r<this.m_bodies.length;++r){var i=this.m_bodies[r];U(Hm,i.c_position.c);var u=i.c_position.a;U(Um,i.c_velocity.v);var d=i.c_velocity.w;K(Wm,l,Um);var f=rp(Wm);if(f>V.maxTranslationSquared){var p=V.maxTranslation/Rm(f);Jf(Um,p)}var m=l*d;if(m*m>V.maxRotationSquared){var p=V.maxRotation/Lm(m);d*=p}Yf(Hm,l,Um),u+=l*d,U(i.c_position.c,Hm),i.c_position.a=u,U(i.c_velocity.v,Um),i.c_velocity.w=d,U(i.m_sweep.c,Hm),i.m_sweep.a=u,U(i.m_linearVelocity,Um),i.m_angularVelocity=d,i.synchronizeTransform()}this.postSolveIsland()},e.prototype.postSolveIsland=function(){for(var e=0;e<this.m_contacts.length;++e){var t=this.m_contacts[e];this.m_world.postSolve(t,t.m_impulse)}},e})();Zm.TimeStep=Bm;var Qm=(function(){function e(e,t,n,r){typeof e==`object`&&e?(this.ex=z.clone(e),this.ey=z.clone(t)):typeof e==`number`?(this.ex=z.neo(e,n),this.ey=z.neo(t,r)):(this.ex=z.zero(),this.ey=z.zero())}return e.prototype.toString=function(){return JSON.stringify(this)},e.isValid=function(e){return e==null?!1:z.isValid(e.ex)&&z.isValid(e.ey)},e.assert=function(e){},e.prototype.set=function(e,t,n,r){typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`?(this.ex.setNum(e,n),this.ey.setNum(t,r)):typeof e==`object`&&typeof t==`object`?(this.ex.setVec2(e),this.ey.setVec2(t)):typeof e==`object`&&(this.ex.setVec2(e.ex),this.ey.setVec2(e.ey))},e.prototype.setIdentity=function(){this.ex.x=1,this.ey.x=0,this.ex.y=0,this.ey.y=1},e.prototype.setZero=function(){this.ex.x=0,this.ey.x=0,this.ex.y=0,this.ey.y=0},e.prototype.getInverse=function(){var t=this.ex.x,n=this.ey.x,r=this.ex.y,i=this.ey.y,a=t*i-n*r;a!==0&&(a=1/a);var o=new e;return o.ex.x=a*i,o.ey.x=-a*n,o.ex.y=-a*r,o.ey.y=a*t,o},e.prototype.solve=function(e){var t=this.ex.x,n=this.ey.x,r=this.ex.y,i=this.ey.y,a=t*i-n*r;a!==0&&(a=1/a);var o=z.zero();return o.x=a*(i*e.x-n*e.y),o.y=a*(t*e.y-r*e.x),o},e.mul=function(t,n){if(n&&`x`in n&&`y`in n){var r=t.ex.x*n.x+t.ey.x*n.y,i=t.ex.y*n.x+t.ey.y*n.y;return z.neo(r,i)}else if(n&&`ex`in n&&`ey`in n)return new e(t.ex.x*n.ex.x+t.ey.x*n.ex.y,t.ex.x*n.ey.x+t.ey.x*n.ey.y,t.ex.y*n.ex.x+t.ey.y*n.ex.y,t.ex.y*n.ey.x+t.ey.y*n.ey.y)},e.mulVec2=function(e,t){var n=e.ex.x*t.x+e.ey.x*t.y,r=e.ex.y*t.x+e.ey.y*t.y;return z.neo(n,r)},e.mulMat22=function(t,n){return new e(t.ex.x*n.ex.x+t.ey.x*n.ex.y,t.ex.x*n.ey.x+t.ey.x*n.ey.y,t.ex.y*n.ex.x+t.ey.y*n.ex.y,t.ex.y*n.ey.x+t.ey.y*n.ey.y)},e.mulT=function(t,n){if(n&&`x`in n&&`y`in n)return z.neo(z.dot(n,t.ex),z.dot(n,t.ey));if(n&&`ex`in n&&`ey`in n)return new e(z.neo(z.dot(t.ex,n.ex),z.dot(t.ey,n.ex)),z.neo(z.dot(t.ex,n.ey),z.dot(t.ey,n.ey)))},e.mulTVec2=function(e,t){return z.neo(z.dot(t,e.ex),z.dot(t,e.ey))},e.mulTMat22=function(t,n){return new e(z.neo(z.dot(t.ex,n.ex),z.dot(t.ey,n.ex)),z.neo(z.dot(t.ex,n.ey),z.dot(t.ey,n.ey)))},e.abs=function(t){return new e(z.abs(t.ex),z.abs(t.ey))},e.add=function(t,n){return new e(z.add(t.ex,n.ex),z.add(t.ey,n.ey))},e})(),$m=Math.sqrt,eh=H(0,0),th=H(0,0),nh=H(0,0),rh=H(0,0),ih=H(0,0),ah=H(0,0),oh=H(0,0),sh=H(0,0),ch;(function(e){e[e.e_unset=-1]=`e_unset`,e[e.e_circles=0]=`e_circles`,e[e.e_faceA=1]=`e_faceA`,e[e.e_faceB=2]=`e_faceB`})(ch||={});var Z;(function(e){e[e.e_unset=-1]=`e_unset`,e[e.e_vertex=0]=`e_vertex`,e[e.e_face=1]=`e_face`})(Z||={});var lh;(function(e){e[e.nullState=0]=`nullState`,e[e.addState=1]=`addState`,e[e.persistState=2]=`persistState`,e[e.removeState=3]=`removeState`})(lh||={});var uh=(function(){function e(){this.v=H(0,0),this.id=new ph}return e.prototype.set=function(e){U(this.v,e.v),this.id.set(e.id)},e.prototype.recycle=function(){W(this.v),this.id.recycle()},e})(),dh=(function(){function e(){this.localNormal=H(0,0),this.localPoint=H(0,0),this.points=[new fh,new fh],this.pointCount=0}return e.prototype.set=function(e){this.type=e.type,U(this.localNormal,e.localNormal),U(this.localPoint,e.localPoint),this.pointCount=e.pointCount,this.points[0].set(e.points[0]),this.points[1].set(e.points[1])},e.prototype.recycle=function(){this.type=ch.e_unset,W(this.localNormal),W(this.localPoint),this.pointCount=0,this.points[0].recycle(),this.points[1].recycle()},e.prototype.getWorldManifold=function(e,t,n,r,i){if(this.pointCount==0)return e;e||=new mh,e.pointCount=this.pointCount;var a=e.normal,o=e.points,s=e.separations;switch(this.type){case ch.e_circles:Uf(a,1,0);var c=this.points[0];Y(eh,t,this.localPoint),Y(th,r,c.localPoint),G(ah,th,eh);var l=rp(ah);l>pf*pf&&K(a,1/$m(l),ah),Zf(rh,1,eh,n,a),Zf(ih,1,th,-i,a),Zf(o[0],.5,rh,.5,ih),s[0]=J(G(nh,ih,rh),a);break;case ch.e_faceA:sp(a,t.q,this.localNormal),Y(oh,t,this.localPoint);for(var u=0;u<this.pointCount;++u){var c=this.points[u];Y(sh,r,c.localPoint),Zf(rh,1,sh,n-J(G(nh,sh,oh),a),a),Zf(ih,1,sh,-i,a),Zf(o[u],.5,rh,.5,ih),s[u]=J(G(nh,ih,rh),a)}break;case ch.e_faceB:sp(a,r.q,this.localNormal),Y(oh,r,this.localPoint);for(var u=0;u<this.pointCount;++u){var c=this.points[u];Y(sh,t,c.localPoint),Zf(ih,1,sh,i-J(G(nh,sh,oh),a),a),Zf(rh,1,sh,-n,a),Zf(o[u],.5,rh,.5,ih),s[u]=J(G(nh,rh,ih),a)}Wf(a);break}return e},e.clipSegmentToLine=gh,e.ClipVertex=uh,e.getPointStates=hh,e.PointState=lh,e})(),fh=(function(){function e(){this.localPoint=H(0,0),this.normalImpulse=0,this.tangentImpulse=0,this.id=new ph}return e.prototype.set=function(e){U(this.localPoint,e.localPoint),this.normalImpulse=e.normalImpulse,this.tangentImpulse=e.tangentImpulse,this.id.set(e.id)},e.prototype.recycle=function(){W(this.localPoint),this.normalImpulse=0,this.tangentImpulse=0,this.id.recycle()},e})(),ph=(function(){function e(){this.key=-1,this.indexA=-1,this.indexB=-1,this.typeA=Z.e_unset,this.typeB=Z.e_unset}return e.prototype.setFeatures=function(e,t,n,r){this.indexA=e,this.indexB=n,this.typeA=t,this.typeB=r,this.key=this.indexA+this.indexB*4+this.typeA*16+this.typeB*64},e.prototype.set=function(e){this.indexA=e.indexA,this.indexB=e.indexB,this.typeA=e.typeA,this.typeB=e.typeB,this.key=this.indexA+this.indexB*4+this.typeA*16+this.typeB*64},e.prototype.swapFeatures=function(){var e=this.indexA,t=this.indexB,n=this.typeA,r=this.typeB;this.indexA=t,this.indexB=e,this.typeA=r,this.typeB=n,this.key=this.indexA+this.indexB*4+this.typeA*16+this.typeB*64},e.prototype.recycle=function(){this.indexA=0,this.indexB=0,this.typeA=Z.e_unset,this.typeB=Z.e_unset,this.key=-1},e})(),mh=(function(){function e(){this.normal=H(0,0),this.points=[H(0,0),H(0,0)],this.separations=[0,0],this.pointCount=0}return e.prototype.recycle=function(){W(this.normal),W(this.points[0]),W(this.points[1]),this.separations[0]=0,this.separations[1]=0,this.pointCount=0},e})();function hh(e,t,n,r){for(var i=0;i<n.pointCount;++i){var a=n.points[i].id;e[i]=lh.removeState;for(var o=0;o<r.pointCount;++o)if(r.points[o].id.key===a.key){e[i]=lh.persistState;break}}for(var i=0;i<r.pointCount;++i){var a=r.points[i].id;t[i]=lh.addState;for(var o=0;o<n.pointCount;++o)if(n.points[o].id.key===a.key){t[i]=lh.persistState;break}}}function gh(e,t,n,r,i){var a=0,o=J(n,t[0].v)-r,s=J(n,t[1].v)-r;if(o<=0&&e[a++].set(t[0]),s<=0&&e[a++].set(t[1]),o*s<0){var c=o/(o-s);Zf(e[a].v,1-c,t[0].v,c,t[1].v),e[a].id.setFeatures(i,Z.e_vertex,t[0].id.indexB,Z.e_face),++a}return a}var _h=Math.sqrt,vh=Math.max,yh=Math.min,bh=new kf({create:function(){return new eg},release:function(e){e.recycle()}}),xh=new dh,Sh=new mh,Ch=(function(){function e(e){this.prev=null,this.next=null,this.other=null,this.contact=e}return e.prototype.recycle=function(){this.prev=null,this.next=null,this.other=null},e})();function wh(e,t){return _h(e*t)}function Th(e,t){return e>t?e:t}var Eh=[],Dh=(function(){function e(){this.rA=H(0,0),this.rB=H(0,0),this.normalImpulse=0,this.tangentImpulse=0,this.normalMass=0,this.tangentMass=0,this.velocityBias=0}return e.prototype.recycle=function(){W(this.rA),W(this.rB),this.normalImpulse=0,this.tangentImpulse=0,this.normalMass=0,this.tangentMass=0,this.velocityBias=0},e})(),Oh=H(0,0),kh=H(0,0),Ah=H(0,0),jh=H(0,0),Mh=H(0,0),Nh=up(0,0,0),Ph=up(0,0,0),Fh=H(0,0),Ih=H(0,0),Lh=H(0,0),Rh=H(0,0),zh=H(0,0),Bh=H(0,0),Vh=H(0,0),Hh=H(0,0),Uh=H(0,0),Wh=H(0,0),Gh=H(0,0),Kh=H(0,0),qh=H(0,0),Jh=H(0,0),Yh=H(0,0),Xh=H(0,0),Zh=H(0,0),Qh=H(0,0),$h=H(0,0),eg=(function(){function e(){this.m_nodeA=new Ch(this),this.m_nodeB=new Ch(this),this.m_fixtureA=null,this.m_fixtureB=null,this.m_indexA=-1,this.m_indexB=-1,this.m_evaluateFcn=null,this.m_manifold=new dh,this.m_prev=null,this.m_next=null,this.m_toi=1,this.m_toiCount=0,this.m_toiFlag=!1,this.m_friction=0,this.m_restitution=0,this.m_tangentSpeed=0,this.m_enabledFlag=!0,this.m_islandFlag=!1,this.m_touchingFlag=!1,this.m_filterFlag=!1,this.m_bulletHitFlag=!1,this.m_impulse=new Xm(this),this.v_points=[new Dh,new Dh],this.v_normal=H(0,0),this.v_normalMass=new Qm,this.v_K=new Qm,this.v_pointCount=0,this.v_tangentSpeed=0,this.v_friction=0,this.v_restitution=0,this.v_invMassA=0,this.v_invMassB=0,this.v_invIA=0,this.v_invIB=0,this.p_localPoints=[H(0,0),H(0,0)],this.p_localNormal=H(0,0),this.p_localPoint=H(0,0),this.p_localCenterA=H(0,0),this.p_localCenterB=H(0,0),this.p_type=ch.e_unset,this.p_radiusA=0,this.p_radiusB=0,this.p_pointCount=0,this.p_invMassA=0,this.p_invMassB=0,this.p_invIA=0,this.p_invIB=0}return e.prototype.initialize=function(e,t,n,r,i){this.m_fixtureA=e,this.m_fixtureB=n,this.m_indexA=t,this.m_indexB=r,this.m_evaluateFcn=i,this.m_friction=wh(this.m_fixtureA.m_friction,this.m_fixtureB.m_friction),this.m_restitution=Th(this.m_fixtureA.m_restitution,this.m_fixtureB.m_restitution)},e.prototype.recycle=function(){this.m_nodeA.recycle(),this.m_nodeB.recycle(),this.m_fixtureA=null,this.m_fixtureB=null,this.m_indexA=-1,this.m_indexB=-1,this.m_evaluateFcn=null,this.m_manifold.recycle(),this.m_prev=null,this.m_next=null,this.m_toi=1,this.m_toiCount=0,this.m_toiFlag=!1,this.m_friction=0,this.m_restitution=0,this.m_tangentSpeed=0,this.m_enabledFlag=!0,this.m_islandFlag=!1,this.m_touchingFlag=!1,this.m_filterFlag=!1,this.m_bulletHitFlag=!1,this.m_impulse.recycle();for(var e=0,t=this.v_points;e<t.length;e++)t[e].recycle();W(this.v_normal),this.v_normalMass.setZero(),this.v_K.setZero(),this.v_pointCount=0,this.v_tangentSpeed=0,this.v_friction=0,this.v_restitution=0,this.v_invMassA=0,this.v_invMassB=0,this.v_invIA=0,this.v_invIB=0;for(var n=0,r=this.p_localPoints;n<r.length;n++){var i=r[n];W(i)}W(this.p_localNormal),W(this.p_localPoint),W(this.p_localCenterA),W(this.p_localCenterB),this.p_type=ch.e_unset,this.p_radiusA=0,this.p_radiusB=0,this.p_pointCount=0,this.p_invMassA=0,this.p_invMassB=0,this.p_invIA=0,this.p_invIB=0},e.prototype.initConstraint=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=t.m_shape,o=n.m_shape;if(!(a===null||o===null)){var s=this.m_manifold,c=s.pointCount;this.v_invMassA=r.m_invMass,this.v_invMassB=i.m_invMass,this.v_invIA=r.m_invI,this.v_invIB=i.m_invI,this.v_friction=this.m_friction,this.v_restitution=this.m_restitution,this.v_tangentSpeed=this.m_tangentSpeed,this.v_pointCount=c,this.v_K.setZero(),this.v_normalMass.setZero(),this.p_invMassA=r.m_invMass,this.p_invMassB=i.m_invMass,this.p_invIA=r.m_invI,this.p_invIB=i.m_invI,U(this.p_localCenterA,r.m_sweep.localCenter),U(this.p_localCenterB,i.m_sweep.localCenter),this.p_radiusA=a.m_radius,this.p_radiusB=o.m_radius,this.p_type=s.type,U(this.p_localNormal,s.localNormal),U(this.p_localPoint,s.localPoint),this.p_pointCount=c;for(var l=0;l<V.maxManifoldPoints;++l)this.v_points[l].recycle(),W(this.p_localPoints[l]);for(var l=0;l<c;++l){var u=s.points[l],d=this.v_points[l];e.warmStarting&&(d.normalImpulse=e.dtRatio*u.normalImpulse,d.tangentImpulse=e.dtRatio*u.tangentImpulse),U(this.p_localPoints[l],u.localPoint)}}}}},e.prototype.getManifold=function(){return this.m_manifold},e.prototype.getWorldManifold=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=t.m_shape,o=n.m_shape;if(!(a===null||o===null))return this.m_manifold.getWorldManifold(e,r.getTransform(),a.m_radius,i.getTransform(),o.m_radius)}}},e.prototype.setEnabled=function(e){this.m_enabledFlag=!!e},e.prototype.isEnabled=function(){return this.m_enabledFlag},e.prototype.isTouching=function(){return this.m_touchingFlag},e.prototype.getNext=function(){return this.m_next},e.prototype.getFixtureA=function(){return this.m_fixtureA},e.prototype.getFixtureB=function(){return this.m_fixtureB},e.prototype.getChildIndexA=function(){return this.m_indexA},e.prototype.getChildIndexB=function(){return this.m_indexB},e.prototype.flagForFiltering=function(){this.m_filterFlag=!0},e.prototype.setFriction=function(e){this.m_friction=e},e.prototype.getFriction=function(){return this.m_friction},e.prototype.resetFriction=function(){var e=this.m_fixtureA,t=this.m_fixtureB;e===null||t===null||(this.m_friction=wh(e.m_friction,t.m_friction))},e.prototype.setRestitution=function(e){this.m_restitution=e},e.prototype.getRestitution=function(){return this.m_restitution},e.prototype.resetRestitution=function(){var e=this.m_fixtureA,t=this.m_fixtureB;e===null||t===null||(this.m_restitution=Th(e.m_restitution,t.m_restitution))},e.prototype.setTangentSpeed=function(e){this.m_tangentSpeed=e},e.prototype.getTangentSpeed=function(){return this.m_tangentSpeed},e.prototype.evaluate=function(e,t,n){var r=this.m_fixtureA,i=this.m_fixtureB;r===null||i===null||this.m_evaluateFcn(e,t,r,this.m_indexA,n,i,this.m_indexB)},e.prototype.update=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=t.m_shape,o=n.m_shape;if(!(a===null||o===null)){this.m_enabledFlag=!0;var s=!1,c=this.m_touchingFlag,l=t.m_isSensor,u=n.m_isSensor,d=l||u,f=r.m_xf,p=i.m_xf;if(d)s=hm(a,this.m_indexA,o,this.m_indexB,f,p),this.m_manifold.pointCount=0;else{xh.recycle(),xh.set(this.m_manifold),this.m_manifold.recycle(),this.evaluate(this.m_manifold,f,p),s=this.m_manifold.pointCount>0;for(var m=0;m<this.m_manifold.pointCount;++m){var h=this.m_manifold.points[m];h.normalImpulse=0,h.tangentImpulse=0;for(var g=0;g<xh.pointCount;++g){var _=xh.points[g];if(_.id.key===h.id.key){h.normalImpulse=_.normalImpulse,h.tangentImpulse=_.tangentImpulse;break}}}s!==c&&(r.setAwake(!0),i.setAwake(!0))}this.m_touchingFlag=s;var v=typeof e==`object`&&!!e;!c&&s&&v&&e.beginContact(this),c&&!s&&v&&e.endContact(this),!d&&s&&v&&xh&&e.preSolve(this,xh)}}}},e.prototype.solvePositionConstraint=function(e){return this._solvePositionConstraint(e,null,null)},e.prototype.solvePositionConstraintTOI=function(e,t,n){return this._solvePositionConstraint(e,t,n)},e.prototype._solvePositionConstraint=function(e,t,n){var r=t!==null&&n!==null,i=0,a=this.m_fixtureA,o=this.m_fixtureB;if(a===null||o===null)return i;var s=a.m_body,c=o.m_body;if(s===null||c===null)return i;var l=s.c_position,u=c.c_position,d=this.p_localCenterA,f=this.p_localCenterB,p=0,m=0;(!r||s===t||s===n)&&(p=this.p_invMassA,m=this.p_invIA);var h=0,g=0;(!r||c===t||c===n)&&(h=this.p_invMassB,g=this.p_invIB),U(Oh,l.c);var _=l.a;U(Ah,u.c);for(var v=u.a,y=0;y<this.p_pointCount;++y){Dp(Nh,d,Oh,_),Dp(Ph,f,Ah,v);var b=void 0;switch(this.p_type){case ch.e_circles:Y(Fh,Nh,this.p_localPoint),Y(Ih,Ph,this.p_localPoints[0]),G(Hh,Ih,Fh),ep(Hh),Zf(Uh,.5,Fh,.5,Ih),b=J(Ih,Hh)-J(Fh,Hh)-this.p_radiusA-this.p_radiusB;break;case ch.e_faceA:sp(Hh,Nh.q,this.p_localNormal),Y(Rh,Nh,this.p_localPoint),Y(Lh,Ph,this.p_localPoints[y]),b=J(Lh,Hh)-J(Rh,Hh)-this.p_radiusA-this.p_radiusB,U(Uh,Lh);break;case ch.e_faceB:sp(Hh,Ph.q,this.p_localNormal),Y(Rh,Ph,this.p_localPoint),Y(Lh,Nh,this.p_localPoints[y]),b=J(Lh,Hh)-J(Rh,Hh)-this.p_radiusA-this.p_radiusB,U(Uh,Lh),Wf(Hh);break;default:return i}G(zh,Uh,Oh),G(Bh,Uh,Ah),i=yh(i,b);var x=r?V.toiBaugarte:V.baumgarte,S=V.linearSlop,C=V.maxLinearCorrection,w=vf(x*(b+S),-C,0),T=q(zh,Hh),E=q(Bh,Hh),D=p+h+m*T*T+g*E*E;K(Vh,D>0?-w/D:0,Hh),Xf(Oh,p,Vh),_-=m*q(zh,Vh),Yf(Ah,h,Vh),v+=g*q(Bh,Vh)}return U(l.c,Oh),l.a=_,U(u.c,Ah),u.a=v,i},e.prototype.initVelocityConstraint=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=r.c_velocity,o=i.c_velocity,s=r.c_position,c=i.c_position,l=this.p_radiusA,u=this.p_radiusB,d=this.m_manifold,f=this.v_invMassA,p=this.v_invMassB,m=this.v_invIA,h=this.v_invIB,g=this.p_localCenterA,_=this.p_localCenterB;U(Oh,s.c);var v=s.a;U(kh,a.v);var y=a.w;U(Ah,c.c);var b=c.a;U(jh,o.v);var x=o.w;Dp(Nh,g,Oh,v),Dp(Ph,_,Ah,b),Sh.recycle(),d.getWorldManifold(Sh,Nh,l,Ph,u),U(this.v_normal,Sh.normal);for(var S=0;S<this.v_pointCount;++S){var C=this.v_points[S],w=Sh.points[S];G(C.rA,w,Oh),G(C.rB,w,Ah);var T=q(C.rA,this.v_normal),E=q(C.rB,this.v_normal),D=f+p+m*T*T+h*E*E;C.normalMass=D>0?1/D:0,tp(Mh,this.v_normal,1);var O=q(C.rA,Mh),ee=q(C.rB,Mh),te=f+p+m*O*O+h*ee*ee;C.tangentMass=te>0?1/te:0,C.velocityBias=0;var ne=0;ne+=J(this.v_normal,jh),ne+=J(this.v_normal,np($h,x,C.rB)),ne-=J(this.v_normal,kh),ne-=J(this.v_normal,np($h,y,C.rA)),ne<-V.velocityThreshold&&(C.velocityBias=-this.v_restitution*ne)}if(this.v_pointCount==2&&e.blockSolve){var re=this.v_points[0],ie=this.v_points[1],ae=q(re.rA,this.v_normal),oe=q(re.rB,this.v_normal),se=q(ie.rA,this.v_normal),ce=q(ie.rB,this.v_normal),le=f+p+m*ae*ae+h*oe*oe,ue=f+p+m*se*se+h*ce*ce,k=f+p+m*ae*se+h*oe*ce;if(le*le<1e3*(le*ue-k*k)){this.v_K.ex.setNum(le,k),this.v_K.ey.setNum(k,ue);var de=this.v_K.ex.x,fe=this.v_K.ey.x,pe=this.v_K.ex.y,A=this.v_K.ey.y,me=de*A-fe*pe;me!==0&&(me=1/me),this.v_normalMass.ex.x=me*A,this.v_normalMass.ey.x=-me*fe,this.v_normalMass.ex.y=-me*pe,this.v_normalMass.ey.y=me*de}else this.v_pointCount=1}U(s.c,Oh),s.a=v,U(a.v,kh),a.w=y,U(c.c,Ah),c.a=b,U(o.v,jh),o.w=x}}},e.prototype.warmStartConstraint=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=r.c_velocity,o=i.c_velocity,s=this.v_invMassA,c=this.v_invIA,l=this.v_invMassB,u=this.v_invIB;U(kh,a.v);var d=a.w;U(jh,o.v);var f=o.w;U(Hh,this.v_normal),tp(Mh,Hh,1);for(var p=0;p<this.v_pointCount;++p){var m=this.v_points[p];Zf(Vh,m.normalImpulse,Hh,m.tangentImpulse,Mh),d-=c*q(m.rA,Vh),Xf(kh,s,Vh),f+=u*q(m.rB,Vh),Yf(jh,l,Vh)}U(a.v,kh),a.w=d,U(o.v,jh),o.w=f}}},e.prototype.storeConstraintImpulses=function(e){for(var t=this.m_manifold,n=0;n<this.v_pointCount;++n)t.points[n].normalImpulse=this.v_points[n].normalImpulse,t.points[n].tangentImpulse=this.v_points[n].tangentImpulse},e.prototype.solveVelocityConstraint=function(e){var t=this.m_fixtureA,n=this.m_fixtureB;if(!(t===null||n===null)){var r=t.m_body,i=n.m_body;if(!(r===null||i===null)){var a=r.c_velocity,o=i.c_velocity,s=this.v_invMassA,c=this.v_invIA,l=this.v_invMassB,u=this.v_invIB;U(kh,a.v);var d=a.w;U(jh,o.v);var f=o.w;U(Hh,this.v_normal),tp(Mh,Hh,1);for(var p=this.v_friction,m=0;m<this.v_pointCount;++m){var h=this.v_points[m];W(Wh),Gf(Wh,jh),Gf(Wh,np($h,f,h.rB)),qf(Wh,kh),qf(Wh,np($h,d,h.rA));var g=J(Wh,Mh)-this.v_tangentSpeed,_=h.tangentMass*-g,v=p*h.normalImpulse,y=vf(h.tangentImpulse+_,-v,v);_=y-h.tangentImpulse,h.tangentImpulse=y,K(Vh,_,Mh),Xf(kh,s,Vh),d-=c*q(h.rA,Vh),Yf(jh,l,Vh),f+=u*q(h.rB,Vh)}if(this.v_pointCount==1||e.blockSolve==0)for(var b=0;b<this.v_pointCount;++b){var h=this.v_points[b];W(Wh),Gf(Wh,jh),Gf(Wh,np($h,f,h.rB)),qf(Wh,kh),qf(Wh,np($h,d,h.rA));var x=J(Wh,Hh),_=-h.normalMass*(x-h.velocityBias),y=vh(h.normalImpulse+_,0);_=y-h.normalImpulse,h.normalImpulse=y,K(Vh,_,Hh),Xf(kh,s,Vh),d-=c*q(h.rA,Vh),Yf(jh,l,Vh),f+=u*q(h.rB,Vh)}else{var S=this.v_points[0],C=this.v_points[1];Uf(Jh,S.normalImpulse,C.normalImpulse),W(Gh),Gf(Gh,jh),Gf(Gh,np($h,f,S.rB)),qf(Gh,kh),qf(Gh,np($h,d,S.rA)),W(Kh),Gf(Kh,jh),Gf(Kh,np($h,f,C.rB)),qf(Kh,kh),qf(Kh,np($h,d,C.rA));var w=J(Gh,Hh),T=J(Kh,Hh);for(Uf(qh,w-S.velocityBias,T-C.velocityBias),qh.x-=this.v_K.ex.x*Jh.x+this.v_K.ey.x*Jh.y,qh.y-=this.v_K.ex.y*Jh.x+this.v_K.ey.y*Jh.y;;){if(W(Yh),Yh.x=-(this.v_normalMass.ex.x*qh.x+this.v_normalMass.ey.x*qh.y),Yh.y=-(this.v_normalMass.ex.y*qh.x+this.v_normalMass.ey.y*qh.y),Yh.x>=0&&Yh.y>=0){G(Xh,Yh,Jh),K(Zh,Xh.x,Hh),K(Qh,Xh.y,Hh),Qf(kh,-s,Zh,-s,Qh,1,kh),d-=c*(q(S.rA,Zh)+q(C.rA,Qh)),Qf(jh,l,Zh,l,Qh,1,jh),f+=u*(q(S.rB,Zh)+q(C.rB,Qh)),S.normalImpulse=Yh.x,C.normalImpulse=Yh.y;break}if(Yh.x=-S.normalMass*qh.x,Yh.y=0,w=0,T=this.v_K.ex.y*Yh.x+qh.y,Yh.x>=0&&T>=0){G(Xh,Yh,Jh),K(Zh,Xh.x,Hh),K(Qh,Xh.y,Hh),Qf(kh,-s,Zh,-s,Qh,1,kh),d-=c*(q(S.rA,Zh)+q(C.rA,Qh)),Qf(jh,l,Zh,l,Qh,1,jh),f+=u*(q(S.rB,Zh)+q(C.rB,Qh)),S.normalImpulse=Yh.x,C.normalImpulse=Yh.y;break}if(Yh.x=0,Yh.y=-C.normalMass*qh.y,w=this.v_K.ey.x*Yh.y+qh.x,T=0,Yh.y>=0&&w>=0){G(Xh,Yh,Jh),K(Zh,Xh.x,Hh),K(Qh,Xh.y,Hh),Qf(kh,-s,Zh,-s,Qh,1,kh),d-=c*(q(S.rA,Zh)+q(C.rA,Qh)),Qf(jh,l,Zh,l,Qh,1,jh),f+=u*(q(S.rB,Zh)+q(C.rB,Qh)),S.normalImpulse=Yh.x,C.normalImpulse=Yh.y;break}if(Yh.x=0,Yh.y=0,w=qh.x,T=qh.y,w>=0&&T>=0){G(Xh,Yh,Jh),K(Zh,Xh.x,Hh),K(Qh,Xh.y,Hh),Qf(kh,-s,Zh,-s,Qh,1,kh),d-=c*(q(S.rA,Zh)+q(C.rA,Qh)),Qf(jh,l,Zh,l,Qh,1,jh),f+=u*(q(S.rB,Zh)+q(C.rB,Qh)),S.normalImpulse=Yh.x,C.normalImpulse=Yh.y;break}break}}U(a.v,kh),a.w=d,U(o.v,jh),o.w=f}}},e.addType=function(e,t,n){Eh[e]=Eh[e]||{},Eh[e][t]=n},e.create=function(e,t,n,r){var i=e.m_shape.m_type,a=n.m_shape.m_type,o=bh.allocate(),s;if(s=Eh[i]&&Eh[i][a])o.initialize(e,t,n,r,s);else if(s=Eh[a]&&Eh[a][i])o.initialize(n,r,e,t,s);else return null;e=o.m_fixtureA,n=o.m_fixtureB,t=o.getChildIndexA(),r=o.getChildIndexB();var c=e.m_body,l=n.m_body;return o.m_nodeA.contact=o,o.m_nodeA.other=l,o.m_nodeA.prev=null,o.m_nodeA.next=c.m_contactList,c.m_contactList!=null&&(c.m_contactList.prev=o.m_nodeA),c.m_contactList=o.m_nodeA,o.m_nodeB.contact=o,o.m_nodeB.other=c,o.m_nodeB.prev=null,o.m_nodeB.next=l.m_contactList,l.m_contactList!=null&&(l.m_contactList.prev=o.m_nodeB),l.m_contactList=o.m_nodeB,e.isSensor()==0&&n.isSensor()==0&&(c.setAwake(!0),l.setAwake(!0)),o},e.destroy=function(e,t){var n=e.m_fixtureA,r=e.m_fixtureB;if(!(n===null||r===null)){var i=n.m_body,a=r.m_body;i===null||a===null||(e.isTouching()&&t.endContact(e),e.m_nodeA.prev&&(e.m_nodeA.prev.next=e.m_nodeA.next),e.m_nodeA.next&&(e.m_nodeA.next.prev=e.m_nodeA.prev),e.m_nodeA==i.m_contactList&&(i.m_contactList=e.m_nodeA.next),e.m_nodeB.prev&&(e.m_nodeB.prev.next=e.m_nodeB.next),e.m_nodeB.next&&(e.m_nodeB.next.prev=e.m_nodeB.prev),e.m_nodeB==a.m_contactList&&(a.m_contactList=e.m_nodeB.next),e.m_manifold.pointCount>0&&!n.m_isSensor&&!r.m_isSensor&&(i.setAwake(!0),a.setAwake(!0)),bh.release(e))}},e})(),tg={gravity:z.zero(),allowSleep:!0,warmStarting:!0,continuousPhysics:!0,subStepping:!1,blockSolve:!0,velocityIterations:8,positionIterations:3},ng=(function(){function e(t){if(!(this instanceof e))return new e(t);this.s_step=new Bm,t?z.isValid(t)&&(t={gravity:t}):t={},t=df(t,tg),this.m_solver=new Zm(this),this.m_broadPhase=new Rf,this.m_contactList=null,this.m_contactCount=0,this.m_bodyList=null,this.m_bodyCount=0,this.m_jointList=null,this.m_jointCount=0,this.m_stepComplete=!0,this.m_allowSleep=t.allowSleep,this.m_gravity=z.clone(t.gravity),this.m_clearForces=!0,this.m_newFixture=!1,this.m_locked=!1,this.m_warmStarting=t.warmStarting,this.m_continuousPhysics=t.continuousPhysics,this.m_subStepping=t.subStepping,this.m_blockSolve=t.blockSolve,this.m_velocityIterations=t.velocityIterations,this.m_positionIterations=t.positionIterations,this.m_t=0,this.m_step_callback=[]}return e.prototype._serialize=function(){for(var e=[],t=[],n=this.getBodyList();n;n=n.getNext())e.push(n);for(var r=this.getJointList();r;r=r.getNext())typeof r._serialize==`function`&&t.push(r);return{gravity:this.m_gravity,bodies:e,joints:t}},e._deserialize=function(t,n,r){if(!t)return new e;var i=new e(t.gravity);if(t.bodies)for(var a=t.bodies.length-1;a>=0;--a)i._addBody(r(Wp,t.bodies[a],i));if(t.joints)for(var a=t.joints.length-1;a>=0;a--)i.createJoint(r(Kp,t.joints[a],i));return i},e.prototype.getBodyList=function(){return this.m_bodyList},e.prototype.getJointList=function(){return this.m_jointList},e.prototype.getContactList=function(){return this.m_contactList},e.prototype.getBodyCount=function(){return this.m_bodyCount},e.prototype.getJointCount=function(){return this.m_jointCount},e.prototype.getContactCount=function(){return this.m_contactCount},e.prototype.setGravity=function(e){this.m_gravity.set(e)},e.prototype.getGravity=function(){return this.m_gravity},e.prototype.isLocked=function(){return this.m_locked},e.prototype.setAllowSleeping=function(e){if(e!=this.m_allowSleep&&(this.m_allowSleep=e,this.m_allowSleep==0))for(var t=this.m_bodyList;t;t=t.m_next)t.setAwake(!0)},e.prototype.getAllowSleeping=function(){return this.m_allowSleep},e.prototype.setWarmStarting=function(e){this.m_warmStarting=e},e.prototype.getWarmStarting=function(){return this.m_warmStarting},e.prototype.setContinuousPhysics=function(e){this.m_continuousPhysics=e},e.prototype.getContinuousPhysics=function(){return this.m_continuousPhysics},e.prototype.setSubStepping=function(e){this.m_subStepping=e},e.prototype.getSubStepping=function(){return this.m_subStepping},e.prototype.setAutoClearForces=function(e){this.m_clearForces=e},e.prototype.getAutoClearForces=function(){return this.m_clearForces},e.prototype.clearForces=function(){for(var e=this.m_bodyList;e;e=e.getNext())e.m_force.setZero(),e.m_torque=0},e.prototype.queryAABB=function(e,t){var n=this.m_broadPhase;this.m_broadPhase.query(e,function(e){return t(n.getUserData(e).fixture)})},e.prototype.rayCast=function(e,t,n){var r=this.m_broadPhase;this.m_broadPhase.rayCast({maxFraction:1,p1:e,p2:t},function(e,t){var i=r.getUserData(t),a=i.fixture,o=i.childIndex,s={};if(a.rayCast(s,e,o)){var c=s.fraction;return n(a,z.add(z.mulNumVec2(1-c,e.p1),z.mulNumVec2(c,e.p2)),s.normal,c)}return e.maxFraction})},e.prototype.getProxyCount=function(){return this.m_broadPhase.getProxyCount()},e.prototype.getTreeHeight=function(){return this.m_broadPhase.getTreeHeight()},e.prototype.getTreeBalance=function(){return this.m_broadPhase.getTreeBalance()},e.prototype.getTreeQuality=function(){return this.m_broadPhase.getTreeQuality()},e.prototype.shiftOrigin=function(e){if(!this.isLocked()){for(var t=this.m_bodyList;t;t=t.m_next)t.m_xf.p.sub(e),t.m_sweep.c0.sub(e),t.m_sweep.c.sub(e);for(var n=this.m_jointList;n;n=n.m_next)n.shiftOrigin(e);this.m_broadPhase.shiftOrigin(e)}},e.prototype._addBody=function(e){this.isLocked()||(e.m_prev=null,e.m_next=this.m_bodyList,this.m_bodyList&&(this.m_bodyList.m_prev=e),this.m_bodyList=e,++this.m_bodyCount,this.publish(`add-body`,e))},e.prototype.createBody=function(e,t){if(this.isLocked())return null;var n={};e&&(z.isValid(e)?n={position:e,angle:t}:typeof e==`object`&&(n=e));var r=new Wp(this,n);return this._addBody(r),r},e.prototype.createDynamicBody=function(e,t){var n={};return e&&(z.isValid(e)?n={position:e,angle:t}:typeof e==`object`&&(n=e)),n.type=`dynamic`,this.createBody(n)},e.prototype.createKinematicBody=function(e,t){var n={};return e&&(z.isValid(e)?n={position:e,angle:t}:typeof e==`object`&&(n=e)),n.type=`kinematic`,this.createBody(n)},e.prototype.destroyBody=function(e){if(!this.isLocked()){if(e.m_destroyed)return!1;for(var t=e.m_jointList;t;){var n=t;t=t.next,this.publish(`remove-joint`,n.joint),this.destroyJoint(n.joint),e.m_jointList=t}e.m_jointList=null;for(var r=e.m_contactList;r;){var i=r;r=r.next,this.destroyContact(i.contact),e.m_contactList=r}e.m_contactList=null;for(var a=e.m_fixtureList;a;){var o=a;a=a.m_next,this.publish(`remove-fixture`,o),o.destroyProxies(this.m_broadPhase),e.m_fixtureList=a}return e.m_fixtureList=null,e.m_prev&&(e.m_prev.m_next=e.m_next),e.m_next&&(e.m_next.m_prev=e.m_prev),e==this.m_bodyList&&(this.m_bodyList=e.m_next),e.m_destroyed=!0,--this.m_bodyCount,this.publish(`remove-body`,e),!0}},e.prototype.createJoint=function(e){if(this.isLocked())return null;if(e.m_prev=null,e.m_next=this.m_jointList,this.m_jointList&&(this.m_jointList.m_prev=e),this.m_jointList=e,++this.m_jointCount,e.m_edgeA.joint=e,e.m_edgeA.other=e.m_bodyB,e.m_edgeA.prev=null,e.m_edgeA.next=e.m_bodyA.m_jointList,e.m_bodyA.m_jointList&&(e.m_bodyA.m_jointList.prev=e.m_edgeA),e.m_bodyA.m_jointList=e.m_edgeA,e.m_edgeB.joint=e,e.m_edgeB.other=e.m_bodyA,e.m_edgeB.prev=null,e.m_edgeB.next=e.m_bodyB.m_jointList,e.m_bodyB.m_jointList&&(e.m_bodyB.m_jointList.prev=e.m_edgeB),e.m_bodyB.m_jointList=e.m_edgeB,e.m_collideConnected==0)for(var t=e.m_bodyB.getContactList();t;t=t.next)t.other==e.m_bodyA&&t.contact.flagForFiltering();return this.publish(`add-joint`,e),e},e.prototype.destroyJoint=function(e){if(!this.isLocked()){e.m_prev&&(e.m_prev.m_next=e.m_next),e.m_next&&(e.m_next.m_prev=e.m_prev),e==this.m_jointList&&(this.m_jointList=e.m_next);var t=e.m_bodyA,n=e.m_bodyB;if(t.setAwake(!0),n.setAwake(!0),e.m_edgeA.prev&&(e.m_edgeA.prev.next=e.m_edgeA.next),e.m_edgeA.next&&(e.m_edgeA.next.prev=e.m_edgeA.prev),e.m_edgeA==t.m_jointList&&(t.m_jointList=e.m_edgeA.next),e.m_edgeA.prev=null,e.m_edgeA.next=null,e.m_edgeB.prev&&(e.m_edgeB.prev.next=e.m_edgeB.next),e.m_edgeB.next&&(e.m_edgeB.next.prev=e.m_edgeB.prev),e.m_edgeB==n.m_jointList&&(n.m_jointList=e.m_edgeB.next),e.m_edgeB.prev=null,e.m_edgeB.next=null,--this.m_jointCount,e.m_collideConnected==0)for(var r=n.getContactList();r;)r.other==t&&r.contact.flagForFiltering(),r=r.next;this.publish(`remove-joint`,e)}},e.prototype.step=function(e,t,n){if(this.publish(`pre-step`,e),(t|0)!==t&&(t=0),t||=this.m_velocityIterations,n||=this.m_positionIterations,this.m_newFixture&&=(this.findNewContacts(),!1),this.m_locked=!0,this.s_step.reset(e),this.s_step.velocityIterations=t,this.s_step.positionIterations=n,this.s_step.warmStarting=this.m_warmStarting,this.s_step.blockSolve=this.m_blockSolve,this.updateContacts(),this.m_stepComplete&&e>0){this.m_solver.solveWorld(this.s_step);for(var r=this.m_bodyList;r;r=r.getNext())r.m_islandFlag!=0&&(r.isStatic()||r.synchronizeFixtures());this.findNewContacts()}this.m_continuousPhysics&&e>0&&this.m_solver.solveWorldTOI(this.s_step),this.m_clearForces&&this.clearForces(),this.m_locked=!1;for(var i;i=this.m_step_callback.shift();)i(this);this.publish(`post-step`,e)},e.prototype.queueUpdate=function(e){this.isLocked()?this.m_step_callback.push(e):e(this)},e.prototype.findNewContacts=function(){var e=this;this.m_broadPhase.updatePairs(function(t,n){return e.createContact(t,n)})},e.prototype.createContact=function(e,t){var n=e.fixture,r=t.fixture,i=e.childIndex,a=t.childIndex,o=n.getBody(),s=r.getBody();if(o!=s){for(var c=s.getContactList();c;){if(c.other==o){var l=c.contact.getFixtureA(),u=c.contact.getFixtureB(),d=c.contact.getChildIndexA(),f=c.contact.getChildIndexB();if(l==n&&u==r&&d==i&&f==a||l==r&&u==n&&d==a&&f==i)return}c=c.next}if(s.shouldCollide(o)!=0&&r.shouldCollide(n)!=0){var p=eg.create(n,i,r,a);p!=null&&(p.m_prev=null,this.m_contactList!=null&&(p.m_next=this.m_contactList,this.m_contactList.m_prev=p),this.m_contactList=p,++this.m_contactCount)}}},e.prototype.updateContacts=function(){for(var e,t=this.m_contactList;e=t;){t=e.getNext();var n=e.getFixtureA(),r=e.getFixtureB(),i=e.getChildIndexA(),a=e.getChildIndexB(),o=n.getBody(),s=r.getBody();if(e.m_filterFlag){if(s.shouldCollide(o)==0){this.destroyContact(e);continue}if(r.shouldCollide(n)==0){this.destroyContact(e);continue}e.m_filterFlag=!1}var c=o.isAwake()&&!o.isStatic(),l=s.isAwake()&&!s.isStatic();if(!(c==0&&l==0)){var u=n.m_proxies[i].proxyId,d=r.m_proxies[a].proxyId;if(this.m_broadPhase.testOverlap(u,d)==0){this.destroyContact(e);continue}e.update(this)}}},e.prototype.destroyContact=function(e){e.m_prev&&(e.m_prev.m_next=e.m_next),e.m_next&&(e.m_next.m_prev=e.m_prev),e==this.m_contactList&&(this.m_contactList=e.m_next),eg.destroy(e,this),--this.m_contactCount},e.prototype.on=function(e,t){return typeof e!=`string`||typeof t!=`function`?this:(this._listeners||={},this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this)},e.prototype.off=function(e,t){if(typeof e!=`string`||typeof t!=`function`)return this;var n=this._listeners&&this._listeners[e];if(!n||!n.length)return this;var r=n.indexOf(t);return r>=0&&n.splice(r,1),this},e.prototype.publish=function(e,t,n,r){var i=this._listeners&&this._listeners[e];if(!i||!i.length)return 0;for(var a=0;a<i.length;a++)i[a].call(this,t,n,r);return i.length},e.prototype.beginContact=function(e){this.publish(`begin-contact`,e)},e.prototype.endContact=function(e){this.publish(`end-contact`,e)},e.prototype.preSolve=function(e,t){this.publish(`pre-solve`,e,t)},e.prototype.postSolve=function(e,t){this.publish(`post-solve`,e,t)},e})(),rg=(function(){function e(t,n,r){if(!(this instanceof e))return new e(t,n,r);t===void 0?(this.x=0,this.y=0,this.z=0):typeof t==`object`?(this.x=t.x,this.y=t.y,this.z=t.z):(this.x=t,this.y=n,this.z=r)}return e.prototype._serialize=function(){return{x:this.x,y:this.y,z:this.z}},e._deserialize=function(t){var n=Object.create(e.prototype);return n.x=t.x,n.y=t.y,n.z=t.z,n},e.neo=function(t,n,r){var i=Object.create(e.prototype);return i.x=t,i.y=n,i.z=r,i},e.zero=function(){var t=Object.create(e.prototype);return t.x=0,t.y=0,t.z=0,t},e.clone=function(t){return e.neo(t.x,t.y,t.z)},e.prototype.toString=function(){return JSON.stringify(this)},e.isValid=function(e){return e==null?!1:Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)},e.assert=function(e){},e.prototype.setZero=function(){return this.x=0,this.y=0,this.z=0,this},e.prototype.set=function(e,t,n){return this.x=e,this.y=t,this.z=n,this},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},e.prototype.mul=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.areEqual=function(e,t){return e===t||typeof e==`object`&&!!e&&typeof t==`object`&&!!t&&e.x===t.x&&e.y===t.y&&e.z===t.z},e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},e.cross=function(t,n){return new e(t.y*n.z-t.z*n.y,t.z*n.x-t.x*n.z,t.x*n.y-t.y*n.x)},e.add=function(t,n){return new e(t.x+n.x,t.y+n.y,t.z+n.z)},e.sub=function(t,n){return new e(t.x-n.x,t.y-n.y,t.z-n.z)},e.mul=function(t,n){return new e(n*t.x,n*t.y,n*t.z)},e.prototype.neg=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.neg=function(t){return new e(-t.x,-t.y,-t.z)},e})(),ig=H(0,0),ag=H(0,0),og=(function(e){lf(t,e);function t(n,r){var i=this;return i instanceof t?(i=e.call(this)||this,i.m_type=t.TYPE,i.m_radius=V.polygonRadius,i.m_vertex1=n?z.clone(n):z.zero(),i.m_vertex2=r?z.clone(r):z.zero(),i.m_vertex0=z.zero(),i.m_vertex3=z.zero(),i.m_hasVertex0=!1,i.m_hasVertex3=!1,i):new t(n,r)}return t.prototype._serialize=function(){return{type:this.m_type,vertex1:this.m_vertex1,vertex2:this.m_vertex2,vertex0:this.m_vertex0,vertex3:this.m_vertex3}},t._deserialize=function(e){var n=new t(e.vertex1,e.vertex2);return n.m_hasVertex0&&n.setPrevVertex(e.vertex0),n.m_hasVertex3&&n.setNextVertex(e.vertex3),n},t.prototype._reset=function(){},t.prototype.getRadius=function(){return this.m_radius},t.prototype.getType=function(){return this.m_type},t.prototype.setNext=function(e){return this.setNextVertex(e)},t.prototype.setNextVertex=function(e){return e?(this.m_vertex3.setVec2(e),this.m_hasVertex3=!0):(this.m_vertex3.setZero(),this.m_hasVertex3=!1),this},t.prototype.getNextVertex=function(){return this.m_vertex3},t.prototype.setPrev=function(e){return this.setPrevVertex(e)},t.prototype.setPrevVertex=function(e){return e?(this.m_vertex0.setVec2(e),this.m_hasVertex0=!0):(this.m_vertex0.setZero(),this.m_hasVertex0=!1),this},t.prototype.getPrevVertex=function(){return this.m_vertex0},t.prototype._set=function(e,t){return this.m_vertex1.setVec2(e),this.m_vertex2.setVec2(t),this.m_hasVertex0=!1,this.m_hasVertex3=!1,this},t.prototype._clone=function(){var e=new t;return e.m_type=this.m_type,e.m_radius=this.m_radius,e.m_vertex1.setVec2(this.m_vertex1),e.m_vertex2.setVec2(this.m_vertex2),e.m_vertex0.setVec2(this.m_vertex0),e.m_vertex3.setVec2(this.m_vertex3),e.m_hasVertex0=this.m_hasVertex0,e.m_hasVertex3=this.m_hasVertex3,e},t.prototype.getChildCount=function(){return 1},t.prototype.testPoint=function(e,t){return!1},t.prototype.rayCast=function(e,t,n,r){var i=X.mulTVec2(n.q,z.sub(t.p1,n.p)),a=X.mulTVec2(n.q,z.sub(t.p2,n.p)),o=z.sub(a,i),s=this.m_vertex1,c=this.m_vertex2,l=z.sub(c,s),u=z.neo(l.y,-l.x);u.normalize();var d=z.dot(u,z.sub(s,i)),f=z.dot(u,o);if(f==0)return!1;var p=d/f;if(p<0||t.maxFraction<p)return!1;var m=z.add(i,z.mulNumVec2(p,o)),h=z.sub(c,s),g=z.dot(h,h);if(g==0)return!1;var _=z.dot(z.sub(m,s),h)/g;return _<0||1<_?!1:(e.fraction=p,d>0?e.normal=X.mulVec2(n.q,u).neg():e.normal=X.mulVec2(n.q,u),!0)},t.prototype.computeAABB=function(e,t,n){Y(ig,t,this.m_vertex1),Y(ag,t,this.m_vertex2),Df.combinePoints(e,ig,ag),Df.extend(e,this.m_radius)},t.prototype.computeMass=function(e,t){e.mass=0,Zf(e.center,.5,this.m_vertex1,.5,this.m_vertex2),e.I=0},t.prototype.computeDistanceProxy=function(e){e.m_vertices[0]=this.m_vertex1,e.m_vertices[1]=this.m_vertex2,e.m_vertices.length=2,e.m_count=2,e.m_radius=this.m_radius},t.TYPE=`edge`,t})(Op),sg=H(0,0),cg=H(0,0),lg=(function(e){lf(t,e);function t(n,r){var i=this;return i instanceof t?(i=e.call(this)||this,i.m_type=t.TYPE,i.m_radius=V.polygonRadius,i.m_vertices=[],i.m_count=0,i.m_prevVertex=null,i.m_nextVertex=null,i.m_hasPrevVertex=!1,i.m_hasNextVertex=!1,i.m_isLoop=!!r,n&&n.length&&(r?i._createLoop(n):i._createChain(n)),i):new t(n,r)}return t.prototype._serialize=function(){var e={type:this.m_type,vertices:this.m_isLoop?this.m_vertices.slice(0,this.m_vertices.length-1):this.m_vertices,isLoop:this.m_isLoop,hasPrevVertex:this.m_hasPrevVertex,hasNextVertex:this.m_hasNextVertex,prevVertex:null,nextVertex:null};return this.m_prevVertex&&(e.prevVertex=this.m_prevVertex),this.m_nextVertex&&(e.nextVertex=this.m_nextVertex),e},t._deserialize=function(e,n,r){var i=[];if(e.vertices)for(var a=0;a<e.vertices.length;a++)i.push(e.vertices[a]);var o=new t(i,e.isLoop);return e.prevVertex&&o.setPrevVertex(e.prevVertex),e.nextVertex&&o.setNextVertex(e.nextVertex),o},t.prototype.getType=function(){return this.m_type},t.prototype.getRadius=function(){return this.m_radius},t.prototype._createLoop=function(e){if(!(e.length<3)){var t;this.m_vertices=[],this.m_count=e.length+1;for(var t=0;t<e.length;++t)this.m_vertices[t]=z.clone(e[t]);return this.m_vertices[e.length]=z.clone(e[0]),this.m_prevVertex=this.m_vertices[this.m_count-2],this.m_nextVertex=this.m_vertices[1],this.m_hasPrevVertex=!0,this.m_hasNextVertex=!0,this}},t.prototype._createChain=function(e){var t;this.m_vertices=[],this.m_count=e.length;for(var t=0;t<e.length;++t)this.m_vertices[t]=z.clone(e[t]);return this.m_prevVertex=null,this.m_nextVertex=null,this.m_hasPrevVertex=!1,this.m_hasNextVertex=!1,this},t.prototype._reset=function(){this.m_isLoop?this._createLoop(this.m_vertices.slice(0,this.m_vertices.length-1)):this._createChain(this.m_vertices)},t.prototype.setPrevVertex=function(e){this.m_prevVertex=e,this.m_hasPrevVertex=!0},t.prototype.getPrevVertex=function(){return this.m_prevVertex},t.prototype.setNextVertex=function(e){this.m_nextVertex=e,this.m_hasNextVertex=!0},t.prototype.getNextVertex=function(){return this.m_nextVertex},t.prototype._clone=function(){var e=new t;return e._createChain(this.m_vertices),e.m_type=this.m_type,e.m_radius=this.m_radius,e.m_prevVertex=this.m_prevVertex,e.m_nextVertex=this.m_nextVertex,e.m_hasPrevVertex=this.m_hasPrevVertex,e.m_hasNextVertex=this.m_hasNextVertex,e},t.prototype.getChildCount=function(){return this.m_count-1},t.prototype.getChildEdge=function(e,t){e.m_type=og.TYPE,e.m_radius=this.m_radius,e.m_vertex1=this.m_vertices[t],e.m_vertex2=this.m_vertices[t+1],t>0?(e.m_vertex0=this.m_vertices[t-1],e.m_hasVertex0=!0):(e.m_vertex0=this.m_prevVertex,e.m_hasVertex0=this.m_hasPrevVertex),t<this.m_count-2?(e.m_vertex3=this.m_vertices[t+2],e.m_hasVertex3=!0):(e.m_vertex3=this.m_nextVertex,e.m_hasVertex3=this.m_hasNextVertex)},t.prototype.getVertex=function(e){return e<this.m_count?this.m_vertices[e]:this.m_vertices[0]},t.prototype.isLoop=function(){return this.m_isLoop},t.prototype.testPoint=function(e,t){return!1},t.prototype.rayCast=function(e,t,n,r){return new og(this.getVertex(r),this.getVertex(r+1)).rayCast(e,t,n,0)},t.prototype.computeAABB=function(e,t,n){Y(sg,t,this.getVertex(n)),Y(cg,t,this.getVertex(n+1)),Df.combinePoints(e,sg,cg)},t.prototype.computeMass=function(e,t){e.mass=0,W(e.center),e.I=0},t.prototype.computeDistanceProxy=function(e,t){e.m_vertices[0]=this.getVertex(t),e.m_vertices[1]=this.getVertex(t+1),e.m_count=2,e.m_radius=this.m_radius},t.TYPE=`chain`,t})(Op),ug=Math.max,dg=Math.min,fg=H(0,0),pg=H(0,0),mg=H(0,0),hg=H(0,0),gg=H(0,0),_g=H(0,0),vg=(function(e){lf(t,e);function t(n){var r=this;return r instanceof t?(r=e.call(this)||this,r.m_type=t.TYPE,r.m_radius=V.polygonRadius,r.m_centroid=z.zero(),r.m_vertices=[],r.m_normals=[],r.m_count=0,n&&n.length&&r._set(n),r):new t(n)}return t.prototype._serialize=function(){return{type:this.m_type,vertices:this.m_vertices}},t._deserialize=function(e,n,r){var i=[];if(e.vertices)for(var a=0;a<e.vertices.length;a++)i.push(e.vertices[a]);return new t(i)},t.prototype.getType=function(){return this.m_type},t.prototype.getRadius=function(){return this.m_radius},t.prototype._clone=function(){var e=new t;e.m_type=this.m_type,e.m_radius=this.m_radius,e.m_count=this.m_count,e.m_centroid.setVec2(this.m_centroid);for(var n=0;n<this.m_count;n++)e.m_vertices.push(this.m_vertices[n].clone());for(var n=0;n<this.m_normals.length;n++)e.m_normals.push(this.m_normals[n].clone());return e},t.prototype.getChildCount=function(){return 1},t.prototype._reset=function(){this._set(this.m_vertices)},t.prototype._set=function(e){if(e.length<3){this._setAsBox(1,1);return}for(var t=dg(e.length,V.maxPolygonVertices),n=[],r=0;r<t;++r){for(var i=e[r],a=!0,o=0;o<n.length;++o)if(z.distanceSquared(i,n[o])<.25*V.linearSlopSquared){a=!1;break}a&&n.push(z.clone(i))}if(t=n.length,t<3){this._setAsBox(1,1);return}for(var s=0,c=n[0].x,r=1;r<t;++r){var l=n[r].x;(l>c||l===c&&n[r].y<n[s].y)&&(s=r,c=l)}for(var u=[],d=0,f=s;;){u[d]=f;for(var p=0,o=1;o<t;++o){if(p===f){p=o;continue}var m=z.sub(n[p],n[u[d]]),i=z.sub(n[o],n[u[d]]),h=z.crossVec2Vec2(m,i);h<0&&(p=o),h===0&&i.lengthSquared()>m.lengthSquared()&&(p=o)}if(++d,f=p,p===s)break}if(d<3){this._setAsBox(1,1);return}this.m_count=d,this.m_vertices=[];for(var r=0;r<d;++r)this.m_vertices[r]=n[u[r]];for(var r=0;r<d;++r){var g=r,_=r+1<d?r+1:0,v=z.sub(this.m_vertices[_],this.m_vertices[g]);this.m_normals[r]=z.crossVec2Num(v,1),this.m_normals[r].normalize()}this.m_centroid=yg(this.m_vertices,d)},t.prototype._setAsBox=function(e,t,n,r){if(this.m_vertices[0]=z.neo(e,-t),this.m_vertices[1]=z.neo(e,t),this.m_vertices[2]=z.neo(-e,t),this.m_vertices[3]=z.neo(-e,-t),this.m_normals[0]=z.neo(1,0),this.m_normals[1]=z.neo(0,1),this.m_normals[2]=z.neo(-1,0),this.m_normals[3]=z.neo(0,-1),this.m_count=4,n&&z.isValid(n)){r||=0,U(this.m_centroid,n);var i=Sp.identity();i.p.setVec2(n),i.q.setAngle(r);for(var a=0;a<this.m_count;++a)this.m_vertices[a]=Sp.mulVec2(i,this.m_vertices[a]),this.m_normals[a]=X.mulVec2(i.q,this.m_normals[a])}},t.prototype.testPoint=function(e,t){for(var n=fp(fg,e,t),r=0;r<this.m_count;++r)if(J(this.m_normals[r],n)-J(this.m_normals[r],this.m_vertices[r])>0)return!1;return!0},t.prototype.rayCast=function(e,t,n,r){for(var i=X.mulTVec2(n.q,z.sub(t.p1,n.p)),a=X.mulTVec2(n.q,z.sub(t.p2,n.p)),o=z.sub(a,i),s=0,c=t.maxFraction,l=-1,u=0;u<this.m_count;++u){var d=z.dot(this.m_normals[u],z.sub(this.m_vertices[u],i)),f=z.dot(this.m_normals[u],o);if(f==0){if(d<0)return!1}else f<0&&d<s*f?(s=d/f,l=u):f>0&&d<c*f&&(c=d/f);if(c<s)return!1}return l>=0?(e.fraction=s,e.normal=X.mulVec2(n.q,this.m_normals[l]),!0):!1},t.prototype.computeAABB=function(e,t,n){for(var r=1/0,i=1/0,a=-1/0,o=-1/0,s=0;s<this.m_count;++s){var c=Y(fg,t,this.m_vertices[s]);r=dg(r,c.x),a=ug(a,c.x),i=dg(i,c.y),o=ug(o,c.y)}Uf(e.lowerBound,r-this.m_radius,i-this.m_radius),Uf(e.upperBound,a+this.m_radius,o+this.m_radius)},t.prototype.computeMass=function(e,t){W(gg);var n=0,r=0;W(_g);for(var i=0;i<this.m_count;++i)Gf(_g,this.m_vertices[i]);K(_g,1/this.m_count,_g);for(var a=1/3,i=0;i<this.m_count;++i){G(mg,this.m_vertices[i],_g),i+1<this.m_count?G(hg,this.m_vertices[i+1],_g):G(hg,this.m_vertices[0],_g);var o=q(mg,hg),s=.5*o;n+=s,Zf(fg,s*a,mg,s*a,hg),Gf(gg,fg);var c=mg.x,l=mg.y,u=hg.x,d=hg.y,f=c*c+u*c+u*u,p=l*l+d*l+d*d;r+=.25*a*o*(f+p)}e.mass=t*n,K(gg,1/n,gg),Kf(e.center,gg,_g),e.I=t*r,e.I+=e.mass*(J(e.center,e.center)-J(gg,gg))},t.prototype.validate=function(){for(var e=0;e<this.m_count;++e){var t=e,n=e<this.m_count-1?t+1:0,r=this.m_vertices[t];G(pg,this.m_vertices[n],r);for(var i=0;i<this.m_count;++i)if(!(i==t||i==n)&&q(pg,G(fg,this.m_vertices[i],r))<0)return!1}return!0},t.prototype.computeDistanceProxy=function(e){for(var t=0;t<this.m_count;++t)e.m_vertices[t]=this.m_vertices[t];e.m_vertices.length=this.m_count,e.m_count=this.m_count,e.m_radius=this.m_radius},t.TYPE=`polygon`,t})(Op);function yg(e,t){for(var n=z.zero(),r=0,i=z.zero(),a,o=1/3,a=0;a<t;++a){var s=i,c=e[a],l=a+1<t?e[a+1]:e[0],u=z.sub(c,s),d=z.sub(l,s),f=.5*z.crossVec2Vec2(u,d);r+=f,Qf(fg,1,s,1,c,1,l),Yf(n,f*o,fg)}return n.mul(1/r),n}var bg=Math.sqrt,xg=Math.PI,Sg=H(0,0),Cg=(function(e){lf(t,e);function t(n,r){var i=this;return i instanceof t?(i=e.call(this)||this,i.m_type=t.TYPE,i.m_p=z.zero(),i.m_radius=1,typeof n==`object`&&z.isValid(n)?(i.m_p.setVec2(n),typeof r==`number`&&(i.m_radius=r)):typeof n==`number`&&(i.m_radius=n),i):new t(n,r)}return t.prototype._serialize=function(){return{type:this.m_type,p:this.m_p,radius:this.m_radius}},t._deserialize=function(e){return new t(e.p,e.radius)},t.prototype._reset=function(){},t.prototype.getType=function(){return this.m_type},t.prototype.getRadius=function(){return this.m_radius},t.prototype.getCenter=function(){return this.m_p},t.prototype._clone=function(){var e=new t;return e.m_type=this.m_type,e.m_radius=this.m_radius,e.m_p=this.m_p.clone(),e},t.prototype.getChildCount=function(){return 1},t.prototype.testPoint=function(e,t){return ap(t,Y(Sg,e,this.m_p))<=this.m_radius*this.m_radius},t.prototype.rayCast=function(e,t,n,r){var i=z.add(n.p,X.mulVec2(n.q,this.m_p)),a=z.sub(t.p1,i),o=z.dot(a,a)-this.m_radius*this.m_radius,s=z.sub(t.p2,t.p1),c=z.dot(a,s),l=z.dot(s,s),u=c*c-l*o;if(u<0||l<pf)return!1;var d=-(c+bg(u));return 0<=d&&d<=t.maxFraction*l?(d/=l,e.fraction=d,e.normal=z.add(a,z.mulNumVec2(d,s)),e.normal.normalize(),!0):!1},t.prototype.computeAABB=function(e,t,n){var r=Y(Sg,t,this.m_p);Uf(e.lowerBound,r.x-this.m_radius,r.y-this.m_radius),Uf(e.upperBound,r.x+this.m_radius,r.y+this.m_radius)},t.prototype.computeMass=function(e,t){e.mass=t*xg*this.m_radius*this.m_radius,U(e.center,this.m_p),e.I=e.mass*(.5*this.m_radius*this.m_radius+rp(this.m_p))},t.prototype.computeDistanceProxy=function(e){e.m_vertices[0]=this.m_p,e.m_vertices.length=1,e.m_count=1,e.m_radius=this.m_radius},t.TYPE=`circle`,t})(Op),wg=Math.abs,Tg=Math.PI,Eg={frequencyHz:0,dampingRatio:0},Dg=(function(e){lf(t,e);function t(n,r,i,a,o){var s=this;if(!(s instanceof t))return new t(n,r,i,a,o);if(i&&a&&`m_type`in a&&`x`in i&&`y`in i){var c=i;i=a,a=c}return n=df(n,Eg),s=e.call(this,n,r,i)||this,r=s.m_bodyA,i=s.m_bodyB,s.m_type=t.TYPE,s.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.zero()),s.m_localAnchorB=z.clone(o?i.getLocalPoint(o):n.localAnchorB||z.zero()),s.m_length=Number.isFinite(n.length)?n.length:z.distance(r.getWorldPoint(s.m_localAnchorA),i.getWorldPoint(s.m_localAnchorB)),s.m_frequencyHz=n.frequencyHz,s.m_dampingRatio=n.dampingRatio,s.m_impulse=0,s.m_gamma=0,s.m_bias=0,s}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,frequencyHz:this.m_frequencyHz,dampingRatio:this.m_dampingRatio,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,length:this.m_length}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),e.length>0?this.m_length=+e.length:e.length<0||(e.anchorA||e.anchorA||e.anchorA||e.anchorA)&&(this.m_length=z.distance(this.m_bodyA.getWorldPoint(this.m_localAnchorA),this.m_bodyB.getWorldPoint(this.m_localAnchorB))),Number.isFinite(e.frequencyHz)&&(this.m_frequencyHz=e.frequencyHz),Number.isFinite(e.dampingRatio)&&(this.m_dampingRatio=e.dampingRatio)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.setLength=function(e){this.m_length=e},t.prototype.getLength=function(){return this.m_length},t.prototype.setFrequency=function(e){this.m_frequencyHz=e},t.prototype.getFrequency=function(){return this.m_frequencyHz},t.prototype.setDampingRatio=function(e){this.m_dampingRatio=e},t.prototype.getDampingRatio=function(){return this.m_dampingRatio},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(this.m_impulse,this.m_u).mul(e)},t.prototype.getReactionTorque=function(e){return 0},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyA.c_velocity.v,i=this.m_bodyA.c_velocity.w,a=this.m_bodyB.c_position.c,o=this.m_bodyB.c_position.a,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=X.neo(n),u=X.neo(o);this.m_rA=X.mulVec2(l,z.sub(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=X.mulVec2(u,z.sub(this.m_localAnchorB,this.m_localCenterB)),this.m_u=z.sub(z.add(a,this.m_rB),z.add(t,this.m_rA));var d=this.m_u.length();d>V.linearSlop?this.m_u.mul(1/d):this.m_u.setNum(0,0);var f=z.crossVec2Vec2(this.m_rA,this.m_u),p=z.crossVec2Vec2(this.m_rB,this.m_u),m=this.m_invMassA+this.m_invIA*f*f+this.m_invMassB+this.m_invIB*p*p;if(this.m_mass=m==0?0:1/m,this.m_frequencyHz>0){var h=d-this.m_length,g=2*Tg*this.m_frequencyHz,_=2*this.m_mass*this.m_dampingRatio*g,v=this.m_mass*g*g,y=e.dt;this.m_gamma=y*(_+y*v),this.m_gamma=this.m_gamma==0?0:1/this.m_gamma,this.m_bias=h*y*v*this.m_gamma,m+=this.m_gamma,this.m_mass=m==0?0:1/m}else this.m_gamma=0,this.m_bias=0;if(e.warmStarting){this.m_impulse*=e.dtRatio;var b=z.mulNumVec2(this.m_impulse,this.m_u);r.subMul(this.m_invMassA,b),i-=this.m_invIA*z.crossVec2Vec2(this.m_rA,b),s.addMul(this.m_invMassB,b),c+=this.m_invIB*z.crossVec2Vec2(this.m_rB,b)}else this.m_impulse=0;this.m_bodyA.c_velocity.v.setVec2(r),this.m_bodyA.c_velocity.w=i,this.m_bodyB.c_velocity.v.setVec2(s),this.m_bodyB.c_velocity.w=c},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=z.add(t,z.crossNumVec2(n,this.m_rA)),o=z.add(r,z.crossNumVec2(i,this.m_rB)),s=z.dot(this.m_u,o)-z.dot(this.m_u,a),c=-this.m_mass*(s+this.m_bias+this.m_gamma*this.m_impulse);this.m_impulse+=c;var l=z.mulNumVec2(c,this.m_u);t.subMul(this.m_invMassA,l),n-=this.m_invIA*z.crossVec2Vec2(this.m_rA,l),r.addMul(this.m_invMassB,l),i+=this.m_invIB*z.crossVec2Vec2(this.m_rB,l),this.m_bodyA.c_velocity.v.setVec2(t),this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v.setVec2(r),this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){if(this.m_frequencyHz>0)return!0;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=X.mulSub(a,this.m_localAnchorA,this.m_localCenterA),c=X.mulSub(o,this.m_localAnchorB,this.m_localCenterB),l=z.sub(z.add(r,c),z.add(t,s)),u=vf(l.normalize()-this.m_length,-V.maxLinearCorrection,V.maxLinearCorrection),d=-this.m_mass*u,f=z.mulNumVec2(d,l);return t.subMul(this.m_invMassA,f),n-=this.m_invIA*z.crossVec2Vec2(s,f),r.addMul(this.m_invMassB,f),i+=this.m_invIB*z.crossVec2Vec2(c,f),this.m_bodyA.c_position.c.setVec2(t),this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c.setVec2(r),this.m_bodyB.c_position.a=i,wg(u)<V.linearSlop},t.TYPE=`distance-joint`,t})(Kp),Og={maxForce:0,maxTorque:0},kg=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(n=df(n,Og),o=e.call(this,n,r,i)||this,r=o.m_bodyA,i=o.m_bodyB,o.m_type=t.TYPE,o.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.zero()),o.m_localAnchorB=z.clone(a?i.getLocalPoint(a):n.localAnchorB||z.zero()),o.m_linearImpulse=z.zero(),o.m_angularImpulse=0,o.m_maxForce=n.maxForce,o.m_maxTorque=n.maxTorque,o):new t(n,r,i,a)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,maxForce:this.m_maxForce,maxTorque:this.m_maxTorque,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),Number.isFinite(e.maxForce)&&(this.m_maxForce=e.maxForce),Number.isFinite(e.maxTorque)&&(this.m_maxTorque=e.maxTorque)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.setMaxForce=function(e){this.m_maxForce=e},t.prototype.getMaxForce=function(){return this.m_maxForce},t.prototype.setMaxTorque=function(e){this.m_maxTorque=e},t.prototype.getMaxTorque=function(){return this.m_maxTorque},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(e,this.m_linearImpulse)},t.prototype.getReactionTorque=function(e){return e*this.m_angularImpulse},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.a,n=this.m_bodyA.c_velocity.v,r=this.m_bodyA.c_velocity.w,i=this.m_bodyB.c_position.a,a=this.m_bodyB.c_velocity.v,o=this.m_bodyB.c_velocity.w,s=X.neo(t),c=X.neo(i);this.m_rA=X.mulVec2(s,z.sub(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=X.mulVec2(c,z.sub(this.m_localAnchorB,this.m_localCenterB));var l=this.m_invMassA,u=this.m_invMassB,d=this.m_invIA,f=this.m_invIB,p=new Qm;if(p.ex.x=l+u+d*this.m_rA.y*this.m_rA.y+f*this.m_rB.y*this.m_rB.y,p.ex.y=-d*this.m_rA.x*this.m_rA.y-f*this.m_rB.x*this.m_rB.y,p.ey.x=p.ex.y,p.ey.y=l+u+d*this.m_rA.x*this.m_rA.x+f*this.m_rB.x*this.m_rB.x,this.m_linearMass=p.getInverse(),this.m_angularMass=d+f,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angularMass),e.warmStarting){this.m_linearImpulse.mul(e.dtRatio),this.m_angularImpulse*=e.dtRatio;var m=z.neo(this.m_linearImpulse.x,this.m_linearImpulse.y);n.subMul(l,m),r-=d*(z.crossVec2Vec2(this.m_rA,m)+this.m_angularImpulse),a.addMul(u,m),o+=f*(z.crossVec2Vec2(this.m_rB,m)+this.m_angularImpulse)}else this.m_linearImpulse.setZero(),this.m_angularImpulse=0;this.m_bodyA.c_velocity.v=n,this.m_bodyA.c_velocity.w=r,this.m_bodyB.c_velocity.v=a,this.m_bodyB.c_velocity.w=o},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_invMassA,o=this.m_invMassB,s=this.m_invIA,c=this.m_invIB,l=e.dt,u=i-n,d=-this.m_angularMass*u,f=this.m_angularImpulse,p=l*this.m_maxTorque;this.m_angularImpulse=vf(this.m_angularImpulse+d,-p,p),d=this.m_angularImpulse-f,n-=s*d,i+=c*d;var u=z.sub(z.add(r,z.crossNumVec2(i,this.m_rB)),z.add(t,z.crossNumVec2(n,this.m_rA))),d=z.neg(Qm.mulVec2(this.m_linearMass,u)),f=this.m_linearImpulse;this.m_linearImpulse.add(d);var p=l*this.m_maxForce;this.m_linearImpulse.lengthSquared()>p*p&&(this.m_linearImpulse.normalize(),this.m_linearImpulse.mul(p)),d=z.sub(this.m_linearImpulse,f),t.subMul(a,d),n-=s*z.crossVec2Vec2(this.m_rA,d),r.addMul(o,d),i+=c*z.crossVec2Vec2(this.m_rB,d),this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){return!0},t.TYPE=`friction-joint`,t})(Kp),Ag=(function(){function e(e,t,n){typeof e==`object`&&e?(this.ex=rg.clone(e),this.ey=rg.clone(t),this.ez=rg.clone(n)):(this.ex=rg.zero(),this.ey=rg.zero(),this.ez=rg.zero())}return e.prototype.toString=function(){return JSON.stringify(this)},e.isValid=function(e){return e==null?!1:rg.isValid(e.ex)&&rg.isValid(e.ey)&&rg.isValid(e.ez)},e.assert=function(e){},e.prototype.setZero=function(){return this.ex.setZero(),this.ey.setZero(),this.ez.setZero(),this},e.prototype.solve33=function(e){var t=this.ey.y*this.ez.z-this.ey.z*this.ez.y,n=this.ey.z*this.ez.x-this.ey.x*this.ez.z,r=this.ey.x*this.ez.y-this.ey.y*this.ez.x,i=this.ex.x*t+this.ex.y*n+this.ex.z*r;i!==0&&(i=1/i);var a=new rg;return t=this.ey.y*this.ez.z-this.ey.z*this.ez.y,n=this.ey.z*this.ez.x-this.ey.x*this.ez.z,r=this.ey.x*this.ez.y-this.ey.y*this.ez.x,a.x=i*(e.x*t+e.y*n+e.z*r),t=e.y*this.ez.z-e.z*this.ez.y,n=e.z*this.ez.x-e.x*this.ez.z,r=e.x*this.ez.y-e.y*this.ez.x,a.y=i*(this.ex.x*t+this.ex.y*n+this.ex.z*r),t=this.ey.y*e.z-this.ey.z*e.y,n=this.ey.z*e.x-this.ey.x*e.z,r=this.ey.x*e.y-this.ey.y*e.x,a.z=i*(this.ex.x*t+this.ex.y*n+this.ex.z*r),a},e.prototype.solve22=function(e){var t=this.ex.x,n=this.ey.x,r=this.ex.y,i=this.ey.y,a=t*i-n*r;a!==0&&(a=1/a);var o=z.zero();return o.x=a*(i*e.x-n*e.y),o.y=a*(t*e.y-r*e.x),o},e.prototype.getInverse22=function(e){var t=this.ex.x,n=this.ey.x,r=this.ex.y,i=this.ey.y,a=t*i-n*r;a!==0&&(a=1/a),e.ex.x=a*i,e.ey.x=-a*n,e.ex.z=0,e.ex.y=-a*r,e.ey.y=a*t,e.ey.z=0,e.ez.x=0,e.ez.y=0,e.ez.z=0},e.prototype.getSymInverse33=function(e){var t=rg.dot(this.ex,rg.cross(this.ey,this.ez));t!==0&&(t=1/t);var n=this.ex.x,r=this.ey.x,i=this.ez.x,a=this.ey.y,o=this.ez.y,s=this.ez.z;e.ex.x=t*(a*s-o*o),e.ex.y=t*(i*o-r*s),e.ex.z=t*(r*o-i*a),e.ey.x=e.ex.y,e.ey.y=t*(n*s-i*i),e.ey.z=t*(i*r-n*o),e.ez.x=e.ex.z,e.ez.y=e.ey.z,e.ez.z=t*(n*a-r*r)},e.mul=function(e,t){if(t&&`z`in t&&`y`in t&&`x`in t){var n=e.ex.x*t.x+e.ey.x*t.y+e.ez.x*t.z,r=e.ex.y*t.x+e.ey.y*t.y+e.ez.y*t.z;return new rg(n,r,e.ex.z*t.x+e.ey.z*t.y+e.ez.z*t.z)}else if(t&&`y`in t&&`x`in t){var n=e.ex.x*t.x+e.ey.x*t.y,r=e.ex.y*t.x+e.ey.y*t.y;return z.neo(n,r)}},e.mulVec3=function(e,t){return new rg(e.ex.x*t.x+e.ey.x*t.y+e.ez.x*t.z,e.ex.y*t.x+e.ey.y*t.y+e.ez.y*t.z,e.ex.z*t.x+e.ey.z*t.y+e.ez.z*t.z)},e.mulVec2=function(e,t){var n=e.ex.x*t.x+e.ey.x*t.y,r=e.ex.y*t.x+e.ey.y*t.y;return z.neo(n,r)},e.add=function(t,n){return new e(rg.add(t.ex,n.ex),rg.add(t.ey,n.ey),rg.add(t.ez,n.ez))},e})(),jg=Math.abs,Mg;(function(e){e[e.inactiveLimit=0]=`inactiveLimit`,e[e.atLowerLimit=1]=`atLowerLimit`,e[e.atUpperLimit=2]=`atUpperLimit`,e[e.equalLimits=3]=`equalLimits`})(Mg||={});var Ng={lowerAngle:0,upperAngle:0,maxMotorTorque:0,motorSpeed:0,enableLimit:!1,enableMotor:!1},Pg=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(n??={},o=e.call(this,n,r,i)||this,r=o.m_bodyA,i=o.m_bodyB,o.m_mass=new Ag,o.m_limitState=Mg.inactiveLimit,o.m_type=t.TYPE,z.isValid(a)?o.m_localAnchorA=r.getLocalPoint(a):z.isValid(n.localAnchorA)?o.m_localAnchorA=z.clone(n.localAnchorA):o.m_localAnchorA=z.zero(),z.isValid(a)?o.m_localAnchorB=i.getLocalPoint(a):z.isValid(n.localAnchorB)?o.m_localAnchorB=z.clone(n.localAnchorB):o.m_localAnchorB=z.zero(),Number.isFinite(n.referenceAngle)?o.m_referenceAngle=n.referenceAngle:o.m_referenceAngle=i.getAngle()-r.getAngle(),o.m_impulse=new rg,o.m_motorImpulse=0,o.m_lowerAngle=n.lowerAngle??Ng.lowerAngle,o.m_upperAngle=n.upperAngle??Ng.upperAngle,o.m_maxMotorTorque=n.maxMotorTorque??Ng.maxMotorTorque,o.m_motorSpeed=n.motorSpeed??Ng.motorSpeed,o.m_enableLimit=n.enableLimit??Ng.enableLimit,o.m_enableMotor=n.enableMotor??Ng.enableMotor,o):new t(n,r,i,a)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,lowerAngle:this.m_lowerAngle,upperAngle:this.m_upperAngle,maxMotorTorque:this.m_maxMotorTorque,motorSpeed:this.m_motorSpeed,enableLimit:this.m_enableLimit,enableMotor:this.m_enableMotor,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,referenceAngle:this.m_referenceAngle}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),Number.isFinite(e.referenceAngle)&&(this.m_referenceAngle=e.referenceAngle),e.enableLimit!==void 0&&(this.m_enableLimit=e.enableLimit),Number.isFinite(e.lowerAngle)&&(this.m_lowerAngle=e.lowerAngle),Number.isFinite(e.upperAngle)&&(this.m_upperAngle=e.upperAngle),Number.isFinite(e.maxMotorTorque)&&(this.m_maxMotorTorque=e.maxMotorTorque),Number.isFinite(e.motorSpeed)&&(this.m_motorSpeed=e.motorSpeed),e.enableMotor!==void 0&&(this.m_enableMotor=e.enableMotor)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.getReferenceAngle=function(){return this.m_referenceAngle},t.prototype.getJointAngle=function(){var e=this.m_bodyA;return this.m_bodyB.m_sweep.a-e.m_sweep.a-this.m_referenceAngle},t.prototype.getJointSpeed=function(){var e=this.m_bodyA;return this.m_bodyB.m_angularVelocity-e.m_angularVelocity},t.prototype.isMotorEnabled=function(){return this.m_enableMotor},t.prototype.enableMotor=function(e){e!=this.m_enableMotor&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_enableMotor=e)},t.prototype.getMotorTorque=function(e){return e*this.m_motorImpulse},t.prototype.setMotorSpeed=function(e){e!=this.m_motorSpeed&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_motorSpeed=e)},t.prototype.getMotorSpeed=function(){return this.m_motorSpeed},t.prototype.setMaxMotorTorque=function(e){e!=this.m_maxMotorTorque&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_maxMotorTorque=e)},t.prototype.getMaxMotorTorque=function(){return this.m_maxMotorTorque},t.prototype.isLimitEnabled=function(){return this.m_enableLimit},t.prototype.enableLimit=function(e){e!=this.m_enableLimit&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_enableLimit=e,this.m_impulse.z=0)},t.prototype.getLowerLimit=function(){return this.m_lowerAngle},t.prototype.getUpperLimit=function(){return this.m_upperAngle},t.prototype.setLimits=function(e,t){(e!=this.m_lowerAngle||t!=this.m_upperAngle)&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_impulse.z=0,this.m_lowerAngle=e,this.m_upperAngle=t)},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.neo(this.m_impulse.x,this.m_impulse.y).mul(e)},t.prototype.getReactionTorque=function(e){return e*this.m_impulse.z},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.a,n=this.m_bodyA.c_velocity.v,r=this.m_bodyA.c_velocity.w,i=this.m_bodyB.c_position.a,a=this.m_bodyB.c_velocity.v,o=this.m_bodyB.c_velocity.w,s=X.neo(t),c=X.neo(i);this.m_rA=X.mulVec2(s,z.sub(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=X.mulVec2(c,z.sub(this.m_localAnchorB,this.m_localCenterB));var l=this.m_invMassA,u=this.m_invMassB,d=this.m_invIA,f=this.m_invIB,p=d+f===0;if(this.m_mass.ex.x=l+u+this.m_rA.y*this.m_rA.y*d+this.m_rB.y*this.m_rB.y*f,this.m_mass.ey.x=-this.m_rA.y*this.m_rA.x*d-this.m_rB.y*this.m_rB.x*f,this.m_mass.ez.x=-this.m_rA.y*d-this.m_rB.y*f,this.m_mass.ex.y=this.m_mass.ey.x,this.m_mass.ey.y=l+u+this.m_rA.x*this.m_rA.x*d+this.m_rB.x*this.m_rB.x*f,this.m_mass.ez.y=this.m_rA.x*d+this.m_rB.x*f,this.m_mass.ex.z=this.m_mass.ez.x,this.m_mass.ey.z=this.m_mass.ez.y,this.m_mass.ez.z=d+f,this.m_motorMass=d+f,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass),(this.m_enableMotor==0||p)&&(this.m_motorImpulse=0),this.m_enableLimit&&p==0){var m=i-t-this.m_referenceAngle;jg(this.m_upperAngle-this.m_lowerAngle)<2*V.angularSlop?this.m_limitState=Mg.equalLimits:m<=this.m_lowerAngle?(this.m_limitState!=Mg.atLowerLimit&&(this.m_impulse.z=0),this.m_limitState=Mg.atLowerLimit):m>=this.m_upperAngle?(this.m_limitState!=Mg.atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=Mg.atUpperLimit):(this.m_limitState=Mg.inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=Mg.inactiveLimit;if(e.warmStarting){this.m_impulse.mul(e.dtRatio),this.m_motorImpulse*=e.dtRatio;var h=z.neo(this.m_impulse.x,this.m_impulse.y);n.subMul(l,h),r-=d*(z.crossVec2Vec2(this.m_rA,h)+this.m_motorImpulse+this.m_impulse.z),a.addMul(u,h),o+=f*(z.crossVec2Vec2(this.m_rB,h)+this.m_motorImpulse+this.m_impulse.z)}else this.m_impulse.setZero(),this.m_motorImpulse=0;this.m_bodyA.c_velocity.v=n,this.m_bodyA.c_velocity.w=r,this.m_bodyB.c_velocity.v=a,this.m_bodyB.c_velocity.w=o},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_invMassA,o=this.m_invMassB,s=this.m_invIA,c=this.m_invIB,l=s+c===0;if(this.m_enableMotor&&this.m_limitState!=Mg.equalLimits&&l==0){var u=i-n-this.m_motorSpeed,d=-this.m_motorMass*u,f=this.m_motorImpulse,p=e.dt*this.m_maxMotorTorque;this.m_motorImpulse=vf(this.m_motorImpulse+d,-p,p),d=this.m_motorImpulse-f,n-=s*d,i+=c*d}if(this.m_enableLimit&&this.m_limitState!=Mg.inactiveLimit&&l==0){var m=z.zero();m.addCombine(1,r,1,z.crossNumVec2(i,this.m_rB)),m.subCombine(1,t,1,z.crossNumVec2(n,this.m_rA));var h=i-n,u=new rg(m.x,m.y,h),d=rg.neg(this.m_mass.solve33(u));if(this.m_limitState==Mg.equalLimits)this.m_impulse.add(d);else if(this.m_limitState==Mg.atLowerLimit){var g=this.m_impulse.z+d.z;if(g<0){var _=z.combine(-1,m,this.m_impulse.z,z.neo(this.m_mass.ez.x,this.m_mass.ez.y)),v=this.m_mass.solve22(_);d.x=v.x,d.y=v.y,d.z=-this.m_impulse.z,this.m_impulse.x+=v.x,this.m_impulse.y+=v.y,this.m_impulse.z=0}else this.m_impulse.add(d)}else if(this.m_limitState==Mg.atUpperLimit){var g=this.m_impulse.z+d.z;if(g>0){var _=z.combine(-1,m,this.m_impulse.z,z.neo(this.m_mass.ez.x,this.m_mass.ez.y)),v=this.m_mass.solve22(_);d.x=v.x,d.y=v.y,d.z=-this.m_impulse.z,this.m_impulse.x+=v.x,this.m_impulse.y+=v.y,this.m_impulse.z=0}else this.m_impulse.add(d)}var y=z.neo(d.x,d.y);t.subMul(a,y),n-=s*(z.crossVec2Vec2(this.m_rA,y)+d.z),r.addMul(o,y),i+=c*(z.crossVec2Vec2(this.m_rB,y)+d.z)}else{var u=z.zero();u.addCombine(1,r,1,z.crossNumVec2(i,this.m_rB)),u.subCombine(1,t,1,z.crossNumVec2(n,this.m_rA));var d=this.m_mass.solve22(z.neg(u));this.m_impulse.x+=d.x,this.m_impulse.y+=d.y,t.subMul(a,d),n-=s*z.crossVec2Vec2(this.m_rA,d),r.addMul(o,d),i+=c*z.crossVec2Vec2(this.m_rB,d)}this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=0,c=0,l=this.m_invIA+this.m_invIB==0;if(this.m_enableLimit&&this.m_limitState!=Mg.inactiveLimit&&l==0){var u=i-n-this.m_referenceAngle,d=0;if(this.m_limitState==Mg.equalLimits){var f=vf(u-this.m_lowerAngle,-V.maxAngularCorrection,V.maxAngularCorrection);d=-this.m_motorMass*f,s=jg(f)}else if(this.m_limitState==Mg.atLowerLimit){var f=u-this.m_lowerAngle;s=-f,f=vf(f+V.angularSlop,-V.maxAngularCorrection,0),d=-this.m_motorMass*f}else if(this.m_limitState==Mg.atUpperLimit){var f=u-this.m_upperAngle;s=f,f=vf(f-V.angularSlop,0,V.maxAngularCorrection),d=-this.m_motorMass*f}n-=this.m_invIA*d,i+=this.m_invIB*d}a.setAngle(n),o.setAngle(i);var p=X.mulVec2(a,z.sub(this.m_localAnchorA,this.m_localCenterA)),m=X.mulVec2(o,z.sub(this.m_localAnchorB,this.m_localCenterB)),f=z.zero();f.addCombine(1,r,1,m),f.subCombine(1,t,1,p),c=f.length();var h=this.m_invMassA,g=this.m_invMassB,_=this.m_invIA,v=this.m_invIB,y=new Qm;y.ex.x=h+g+_*p.y*p.y+v*m.y*m.y,y.ex.y=-_*p.x*p.y-v*m.x*m.y,y.ey.x=y.ex.y,y.ey.y=h+g+_*p.x*p.x+v*m.x*m.x;var b=z.neg(y.solve(f));return t.subMul(h,b),n-=_*z.crossVec2Vec2(p,b),r.addMul(g,b),i+=v*z.crossVec2Vec2(m,b),this.m_bodyA.c_position.c.setVec2(t),this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c.setVec2(r),this.m_bodyB.c_position.a=i,c<=V.linearSlop&&s<=V.angularSlop},t.TYPE=`revolute-joint`,t})(Kp),Fg=Math.abs,Ig=Math.max,Lg=Math.min,Rg;(function(e){e[e.inactiveLimit=0]=`inactiveLimit`,e[e.atLowerLimit=1]=`atLowerLimit`,e[e.atUpperLimit=2]=`atUpperLimit`,e[e.equalLimits=3]=`equalLimits`})(Rg||={});var zg={enableLimit:!1,lowerTranslation:0,upperTranslation:0,enableMotor:!1,maxMotorForce:0,motorSpeed:0},Bg=(function(e){lf(t,e);function t(n,r,i,a,o){var s=this;return s instanceof t?(n=df(n,zg),s=e.call(this,n,r,i)||this,r=s.m_bodyA,i=s.m_bodyB,s.m_type=t.TYPE,s.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.zero()),s.m_localAnchorB=z.clone(a?i.getLocalPoint(a):n.localAnchorB||z.zero()),s.m_localXAxisA=z.clone(o?r.getLocalVector(o):n.localAxisA||z.neo(1,0)),s.m_localXAxisA.normalize(),s.m_localYAxisA=z.crossNumVec2(1,s.m_localXAxisA),s.m_referenceAngle=Number.isFinite(n.referenceAngle)?n.referenceAngle:i.getAngle()-r.getAngle(),s.m_impulse=new rg,s.m_motorMass=0,s.m_motorImpulse=0,s.m_lowerTranslation=n.lowerTranslation,s.m_upperTranslation=n.upperTranslation,s.m_maxMotorForce=n.maxMotorForce,s.m_motorSpeed=n.motorSpeed,s.m_enableLimit=n.enableLimit,s.m_enableMotor=n.enableMotor,s.m_limitState=Rg.inactiveLimit,s.m_axis=z.zero(),s.m_perp=z.zero(),s.m_K=new Ag,s):new t(n,r,i,a,o)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,lowerTranslation:this.m_lowerTranslation,upperTranslation:this.m_upperTranslation,maxMotorForce:this.m_maxMotorForce,motorSpeed:this.m_motorSpeed,enableLimit:this.m_enableLimit,enableMotor:this.m_enableMotor,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,localAxisA:this.m_localXAxisA,referenceAngle:this.m_referenceAngle}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),e.localAxisA=z.clone(e.localAxisA),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),e.localAxisA&&(this.m_localXAxisA.setVec2(e.localAxisA),this.m_localYAxisA.setVec2(z.crossNumVec2(1,e.localAxisA))),Number.isFinite(e.referenceAngle)&&(this.m_referenceAngle=e.referenceAngle),e.enableLimit!==void 0&&(this.m_enableLimit=!!e.enableLimit),Number.isFinite(e.lowerTranslation)&&(this.m_lowerTranslation=e.lowerTranslation),Number.isFinite(e.upperTranslation)&&(this.m_upperTranslation=e.upperTranslation),e.enableMotor!==void 0&&(this.m_enableMotor=!!e.enableMotor),Number.isFinite(e.maxMotorForce)&&(this.m_maxMotorForce=e.maxMotorForce),Number.isFinite(e.motorSpeed)&&(this.m_motorSpeed=e.motorSpeed)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.getLocalAxisA=function(){return this.m_localXAxisA},t.prototype.getReferenceAngle=function(){return this.m_referenceAngle},t.prototype.getJointTranslation=function(){var e=this.m_bodyA.getWorldPoint(this.m_localAnchorA),t=this.m_bodyB.getWorldPoint(this.m_localAnchorB),n=z.sub(t,e),r=this.m_bodyA.getWorldVector(this.m_localXAxisA);return z.dot(n,r)},t.prototype.getJointSpeed=function(){var e=this.m_bodyA,t=this.m_bodyB,n=X.mulVec2(e.m_xf.q,z.sub(this.m_localAnchorA,e.m_sweep.localCenter)),r=X.mulVec2(t.m_xf.q,z.sub(this.m_localAnchorB,t.m_sweep.localCenter)),i=z.add(e.m_sweep.c,n),a=z.add(t.m_sweep.c,r),o=z.sub(a,i),s=X.mulVec2(e.m_xf.q,this.m_localXAxisA),c=e.m_linearVelocity,l=t.m_linearVelocity,u=e.m_angularVelocity,d=t.m_angularVelocity;return z.dot(o,z.crossNumVec2(u,s))+z.dot(s,z.sub(z.addCrossNumVec2(l,d,r),z.addCrossNumVec2(c,u,n)))},t.prototype.isLimitEnabled=function(){return this.m_enableLimit},t.prototype.enableLimit=function(e){e!=this.m_enableLimit&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_enableLimit=e,this.m_impulse.z=0)},t.prototype.getLowerLimit=function(){return this.m_lowerTranslation},t.prototype.getUpperLimit=function(){return this.m_upperTranslation},t.prototype.setLimits=function(e,t){(e!=this.m_lowerTranslation||t!=this.m_upperTranslation)&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_lowerTranslation=e,this.m_upperTranslation=t,this.m_impulse.z=0)},t.prototype.isMotorEnabled=function(){return this.m_enableMotor},t.prototype.enableMotor=function(e){e!=this.m_enableMotor&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_enableMotor=e)},t.prototype.setMotorSpeed=function(e){e!=this.m_motorSpeed&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_motorSpeed=e)},t.prototype.setMaxMotorForce=function(e){e!=this.m_maxMotorForce&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_maxMotorForce=e)},t.prototype.getMaxMotorForce=function(){return this.m_maxMotorForce},t.prototype.getMotorSpeed=function(){return this.m_motorSpeed},t.prototype.getMotorForce=function(e){return e*this.m_motorImpulse},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.combine(this.m_impulse.x,this.m_perp,this.m_motorImpulse+this.m_impulse.z,this.m_axis).mul(e)},t.prototype.getReactionTorque=function(e){return e*this.m_impulse.y},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyA.c_velocity.v,i=this.m_bodyA.c_velocity.w,a=this.m_bodyB.c_position.c,o=this.m_bodyB.c_position.a,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=X.neo(n),u=X.neo(o),d=X.mulVec2(l,z.sub(this.m_localAnchorA,this.m_localCenterA)),f=X.mulVec2(u,z.sub(this.m_localAnchorB,this.m_localCenterB)),p=z.zero();p.addCombine(1,a,1,f),p.subCombine(1,t,1,d);var m=this.m_invMassA,h=this.m_invMassB,g=this.m_invIA,_=this.m_invIB;this.m_axis=X.mulVec2(l,this.m_localXAxisA),this.m_a1=z.crossVec2Vec2(z.add(p,d),this.m_axis),this.m_a2=z.crossVec2Vec2(f,this.m_axis),this.m_motorMass=m+h+g*this.m_a1*this.m_a1+_*this.m_a2*this.m_a2,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass),this.m_perp=X.mulVec2(l,this.m_localYAxisA),this.m_s1=z.crossVec2Vec2(z.add(p,d),this.m_perp),this.m_s2=z.crossVec2Vec2(f,this.m_perp),z.crossVec2Vec2(d,this.m_perp);var v=m+h+g*this.m_s1*this.m_s1+_*this.m_s2*this.m_s2,y=g*this.m_s1+_*this.m_s2,b=g*this.m_s1*this.m_a1+_*this.m_s2*this.m_a2,x=g+_;x==0&&(x=1);var S=g*this.m_a1+_*this.m_a2,C=m+h+g*this.m_a1*this.m_a1+_*this.m_a2*this.m_a2;if(this.m_K.ex.set(v,y,b),this.m_K.ey.set(y,x,S),this.m_K.ez.set(b,S,C),this.m_enableLimit){var w=z.dot(this.m_axis,p);Fg(this.m_upperTranslation-this.m_lowerTranslation)<2*V.linearSlop?this.m_limitState=Rg.equalLimits:w<=this.m_lowerTranslation?this.m_limitState!=Rg.atLowerLimit&&(this.m_limitState=Rg.atLowerLimit,this.m_impulse.z=0):w>=this.m_upperTranslation?this.m_limitState!=Rg.atUpperLimit&&(this.m_limitState=Rg.atUpperLimit,this.m_impulse.z=0):(this.m_limitState=Rg.inactiveLimit,this.m_impulse.z=0)}else this.m_limitState=Rg.inactiveLimit,this.m_impulse.z=0;if(this.m_enableMotor==0&&(this.m_motorImpulse=0),e.warmStarting){this.m_impulse.mul(e.dtRatio),this.m_motorImpulse*=e.dtRatio;var T=z.combine(this.m_impulse.x,this.m_perp,this.m_motorImpulse+this.m_impulse.z,this.m_axis),E=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,D=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a2;r.subMul(m,T),i-=g*E,s.addMul(h,T),c+=_*D}else this.m_impulse.setZero(),this.m_motorImpulse=0;this.m_bodyA.c_velocity.v.setVec2(r),this.m_bodyA.c_velocity.w=i,this.m_bodyB.c_velocity.v.setVec2(s),this.m_bodyB.c_velocity.w=c},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_invMassA,o=this.m_invMassB,s=this.m_invIA,c=this.m_invIB;if(this.m_enableMotor&&this.m_limitState!=Rg.equalLimits){var l=z.dot(this.m_axis,z.sub(r,t))+this.m_a2*i-this.m_a1*n,u=this.m_motorMass*(this.m_motorSpeed-l),d=this.m_motorImpulse,f=e.dt*this.m_maxMotorForce;this.m_motorImpulse=vf(this.m_motorImpulse+u,-f,f),u=this.m_motorImpulse-d;var p=z.mulNumVec2(u,this.m_axis),m=u*this.m_a1,h=u*this.m_a2;t.subMul(a,p),n-=s*m,r.addMul(o,p),i+=c*h}var g=z.zero();if(g.x+=z.dot(this.m_perp,r)+this.m_s2*i,g.x-=z.dot(this.m_perp,t)+this.m_s1*n,g.y=i-n,this.m_enableLimit&&this.m_limitState!=Rg.inactiveLimit){var _=0;_+=z.dot(this.m_axis,r)+this.m_a2*i,_-=z.dot(this.m_axis,t)+this.m_a1*n;var l=new rg(g.x,g.y,_),v=rg.clone(this.m_impulse),y=this.m_K.solve33(rg.neg(l));this.m_impulse.add(y),this.m_limitState==Rg.atLowerLimit?this.m_impulse.z=Ig(this.m_impulse.z,0):this.m_limitState==Rg.atUpperLimit&&(this.m_impulse.z=Lg(this.m_impulse.z,0));var b=z.combine(-1,g,-(this.m_impulse.z-v.z),z.neo(this.m_K.ez.x,this.m_K.ez.y)),x=z.add(this.m_K.solve22(b),z.neo(v.x,v.y));this.m_impulse.x=x.x,this.m_impulse.y=x.y,y=rg.sub(this.m_impulse,v);var p=z.combine(y.x,this.m_perp,y.z,this.m_axis),m=y.x*this.m_s1+y.y+y.z*this.m_a1,h=y.x*this.m_s2+y.y+y.z*this.m_a2;t.subMul(a,p),n-=s*m,r.addMul(o,p),i+=c*h}else{var y=this.m_K.solve22(z.neg(g));this.m_impulse.x+=y.x,this.m_impulse.y+=y.y;var p=z.mulNumVec2(y.x,this.m_perp),m=y.x*this.m_s1+y.y,h=y.x*this.m_s2+y.y;t.subMul(a,p),n-=s*m,r.addMul(o,p),i+=c*h}this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=this.m_invMassA,c=this.m_invMassB,l=this.m_invIA,u=this.m_invIB,d=X.mulVec2(a,z.sub(this.m_localAnchorA,this.m_localCenterA)),f=X.mulVec2(o,z.sub(this.m_localAnchorB,this.m_localCenterB)),p=z.sub(z.add(r,f),z.add(t,d)),m=X.mulVec2(a,this.m_localXAxisA),h=z.crossVec2Vec2(z.add(p,d),m),g=z.crossVec2Vec2(f,m),_=X.mulVec2(a,this.m_localYAxisA),v=z.crossVec2Vec2(z.add(p,d),_),y=z.crossVec2Vec2(f,_),b=new rg,x=z.zero();x.x=z.dot(_,p),x.y=i-n-this.m_referenceAngle;var S=Fg(x.x),C=Fg(x.y),w=V.linearSlop,T=V.maxLinearCorrection,E=!1,D=0;if(this.m_enableLimit){var O=z.dot(m,p);Fg(this.m_upperTranslation-this.m_lowerTranslation)<2*w?(D=vf(O,-T,T),S=Ig(S,Fg(O)),E=!0):O<=this.m_lowerTranslation?(D=vf(O-this.m_lowerTranslation+w,-T,0),S=Math.max(S,this.m_lowerTranslation-O),E=!0):O>=this.m_upperTranslation&&(D=vf(O-this.m_upperTranslation-w,0,T),S=Math.max(S,O-this.m_upperTranslation),E=!0)}if(E){var ee=s+c+l*v*v+u*y*y,te=l*v+u*y,ne=l*v*h+u*y*g,re=l+u;re==0&&(re=1);var ie=l*h+u*g,ae=s+c+l*h*h+u*g*g,oe=new Ag;oe.ex.set(ee,te,ne),oe.ey.set(te,re,ie),oe.ez.set(ne,ie,ae);var se=new rg;se.x=x.x,se.y=x.y,se.z=D,b=oe.solve33(rg.neg(se))}else{var ee=s+c+l*v*v+u*y*y,te=l*v+u*y,re=l+u;re==0&&(re=1);var oe=new Qm;oe.ex.setNum(ee,te),oe.ey.setNum(te,re);var ce=oe.solve(z.neg(x));b.x=ce.x,b.y=ce.y,b.z=0}var le=z.combine(b.x,_,b.z,m),ue=b.x*v+b.y+b.z*h,k=b.x*y+b.y+b.z*g;return t.subMul(s,le),n-=l*ue,r.addMul(c,le),i+=u*k,this.m_bodyA.c_position.c=t,this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c=r,this.m_bodyB.c_position.a=i,S<=V.linearSlop&&C<=V.angularSlop},t.TYPE=`prismatic-joint`,t})(Kp),Vg={ratio:1},Hg=(function(e){lf(t,e);function t(n,r,i,a,o,s){var c=this;if(!(c instanceof t))return new t(n,r,i,a,o,s);n=df(n,Vg),c=e.call(this,n,r,i)||this,r=c.m_bodyA,i=c.m_bodyB,c.m_type=t.TYPE,c.m_joint1=a||n.joint1,c.m_joint2=o||n.joint2,c.m_ratio=Number.isFinite(s)?s:n.ratio,c.m_type1=c.m_joint1.getType(),c.m_type2=c.m_joint2.getType();var l,u;c.m_bodyC=c.m_joint1.getBodyA(),c.m_bodyA=c.m_joint1.getBodyB();var d=c.m_bodyA.m_xf,f=c.m_bodyA.m_sweep.a,p=c.m_bodyC.m_xf,m=c.m_bodyC.m_sweep.a;if(c.m_type1===Pg.TYPE){var h=c.m_joint1;c.m_localAnchorC=h.m_localAnchorA,c.m_localAnchorA=h.m_localAnchorB,c.m_referenceAngleA=h.m_referenceAngle,c.m_localAxisC=z.zero(),l=f-m-c.m_referenceAngleA}else{var g=c.m_joint1;c.m_localAnchorC=g.m_localAnchorA,c.m_localAnchorA=g.m_localAnchorB,c.m_referenceAngleA=g.m_referenceAngle,c.m_localAxisC=g.m_localXAxisA;var _=c.m_localAnchorC,v=X.mulTVec2(p.q,z.add(X.mulVec2(d.q,c.m_localAnchorA),z.sub(d.p,p.p)));l=z.dot(v,c.m_localAxisC)-z.dot(_,c.m_localAxisC)}c.m_bodyD=c.m_joint2.getBodyA(),c.m_bodyB=c.m_joint2.getBodyB();var y=c.m_bodyB.m_xf,b=c.m_bodyB.m_sweep.a,x=c.m_bodyD.m_xf,S=c.m_bodyD.m_sweep.a;if(c.m_type2===Pg.TYPE){var h=c.m_joint2;c.m_localAnchorD=h.m_localAnchorA,c.m_localAnchorB=h.m_localAnchorB,c.m_referenceAngleB=h.m_referenceAngle,c.m_localAxisD=z.zero(),u=b-S-c.m_referenceAngleB}else{var g=c.m_joint2;c.m_localAnchorD=g.m_localAnchorA,c.m_localAnchorB=g.m_localAnchorB,c.m_referenceAngleB=g.m_referenceAngle,c.m_localAxisD=g.m_localXAxisA;var C=c.m_localAnchorD,w=X.mulTVec2(x.q,z.add(X.mulVec2(y.q,c.m_localAnchorB),z.sub(y.p,x.p)));u=z.dot(w,c.m_localAxisD)-z.dot(C,c.m_localAxisD)}return c.m_constant=l+c.m_ratio*u,c.m_impulse=0,c}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,joint1:this.m_joint1,joint2:this.m_joint2,ratio:this.m_ratio}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),e.joint1=r(Kp,e.joint1,n),e.joint2=r(Kp,e.joint2,n),new t(e)},t.prototype._reset=function(e){Number.isFinite(e.ratio)&&(this.m_ratio=e.ratio)},t.prototype.getJoint1=function(){return this.m_joint1},t.prototype.getJoint2=function(){return this.m_joint2},t.prototype.setRatio=function(e){this.m_ratio=e},t.prototype.getRatio=function(){return this.m_ratio},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(this.m_impulse,this.m_JvAC).mul(e)},t.prototype.getReactionTorque=function(e){return e*(this.m_impulse*this.m_JwA)},t.prototype.initVelocityConstraints=function(e){this.m_lcA=this.m_bodyA.m_sweep.localCenter,this.m_lcB=this.m_bodyB.m_sweep.localCenter,this.m_lcC=this.m_bodyC.m_sweep.localCenter,this.m_lcD=this.m_bodyD.m_sweep.localCenter,this.m_mA=this.m_bodyA.m_invMass,this.m_mB=this.m_bodyB.m_invMass,this.m_mC=this.m_bodyC.m_invMass,this.m_mD=this.m_bodyD.m_invMass,this.m_iA=this.m_bodyA.m_invI,this.m_iB=this.m_bodyB.m_invI,this.m_iC=this.m_bodyC.m_invI,this.m_iD=this.m_bodyD.m_invI;var t=this.m_bodyA.c_position.a,n=this.m_bodyA.c_velocity.v,r=this.m_bodyA.c_velocity.w,i=this.m_bodyB.c_position.a,a=this.m_bodyB.c_velocity.v,o=this.m_bodyB.c_velocity.w,s=this.m_bodyC.c_position.a,c=this.m_bodyC.c_velocity.v,l=this.m_bodyC.c_velocity.w,u=this.m_bodyD.c_position.a,d=this.m_bodyD.c_velocity.v,f=this.m_bodyD.c_velocity.w,p=X.neo(t),m=X.neo(i),h=X.neo(s),g=X.neo(u);if(this.m_mass=0,this.m_type1==Pg.TYPE)this.m_JvAC=z.zero(),this.m_JwA=1,this.m_JwC=1,this.m_mass+=this.m_iA+this.m_iC;else{var _=X.mulVec2(h,this.m_localAxisC),v=X.mulSub(h,this.m_localAnchorC,this.m_lcC),y=X.mulSub(p,this.m_localAnchorA,this.m_lcA);this.m_JvAC=_,this.m_JwC=z.crossVec2Vec2(v,_),this.m_JwA=z.crossVec2Vec2(y,_),this.m_mass+=this.m_mC+this.m_mA+this.m_iC*this.m_JwC*this.m_JwC+this.m_iA*this.m_JwA*this.m_JwA}if(this.m_type2==Pg.TYPE)this.m_JvBD=z.zero(),this.m_JwB=this.m_ratio,this.m_JwD=this.m_ratio,this.m_mass+=this.m_ratio*this.m_ratio*(this.m_iB+this.m_iD);else{var _=X.mulVec2(g,this.m_localAxisD),b=X.mulSub(g,this.m_localAnchorD,this.m_lcD),x=X.mulSub(m,this.m_localAnchorB,this.m_lcB);this.m_JvBD=z.mulNumVec2(this.m_ratio,_),this.m_JwD=this.m_ratio*z.crossVec2Vec2(b,_),this.m_JwB=this.m_ratio*z.crossVec2Vec2(x,_),this.m_mass+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_mB)+this.m_iD*this.m_JwD*this.m_JwD+this.m_iB*this.m_JwB*this.m_JwB}this.m_mass=this.m_mass>0?1/this.m_mass:0,e.warmStarting?(n.addMul(this.m_mA*this.m_impulse,this.m_JvAC),r+=this.m_iA*this.m_impulse*this.m_JwA,a.addMul(this.m_mB*this.m_impulse,this.m_JvBD),o+=this.m_iB*this.m_impulse*this.m_JwB,c.subMul(this.m_mC*this.m_impulse,this.m_JvAC),l-=this.m_iC*this.m_impulse*this.m_JwC,d.subMul(this.m_mD*this.m_impulse,this.m_JvBD),f-=this.m_iD*this.m_impulse*this.m_JwD):this.m_impulse=0,this.m_bodyA.c_velocity.v.setVec2(n),this.m_bodyA.c_velocity.w=r,this.m_bodyB.c_velocity.v.setVec2(a),this.m_bodyB.c_velocity.w=o,this.m_bodyC.c_velocity.v.setVec2(c),this.m_bodyC.c_velocity.w=l,this.m_bodyD.c_velocity.v.setVec2(d),this.m_bodyD.c_velocity.w=f},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_bodyC.c_velocity.v,o=this.m_bodyC.c_velocity.w,s=this.m_bodyD.c_velocity.v,c=this.m_bodyD.c_velocity.w,l=z.dot(this.m_JvAC,t)-z.dot(this.m_JvAC,a)+z.dot(this.m_JvBD,r)-z.dot(this.m_JvBD,s);l+=this.m_JwA*n-this.m_JwC*o+(this.m_JwB*i-this.m_JwD*c);var u=-this.m_mass*l;this.m_impulse+=u,t.addMul(this.m_mA*u,this.m_JvAC),n+=this.m_iA*u*this.m_JwA,r.addMul(this.m_mB*u,this.m_JvBD),i+=this.m_iB*u*this.m_JwB,a.subMul(this.m_mC*u,this.m_JvAC),o-=this.m_iC*u*this.m_JwC,s.subMul(this.m_mD*u,this.m_JvBD),c-=this.m_iD*u*this.m_JwD,this.m_bodyA.c_velocity.v.setVec2(t),this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v.setVec2(r),this.m_bodyB.c_velocity.w=i,this.m_bodyC.c_velocity.v.setVec2(a),this.m_bodyC.c_velocity.w=o,this.m_bodyD.c_velocity.v.setVec2(s),this.m_bodyD.c_velocity.w=c},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=this.m_bodyC.c_position.c,o=this.m_bodyC.c_position.a,s=this.m_bodyD.c_position.c,c=this.m_bodyD.c_position.a,l=X.neo(n),u=X.neo(i),d=X.neo(o),f=X.neo(c),p=0,m,h,g,_,v,y,b,x,S=0;if(this.m_type1==Pg.TYPE)g=z.zero(),v=1,b=1,S+=this.m_iA+this.m_iC,m=n-o-this.m_referenceAngleA;else{var C=X.mulVec2(d,this.m_localAxisC),w=X.mulSub(d,this.m_localAnchorC,this.m_lcC),T=X.mulSub(l,this.m_localAnchorA,this.m_lcA);g=C,b=z.crossVec2Vec2(w,C),v=z.crossVec2Vec2(T,C),S+=this.m_mC+this.m_mA+this.m_iC*b*b+this.m_iA*v*v;var E=z.sub(this.m_localAnchorC,this.m_lcC),D=X.mulTVec2(d,z.add(T,z.sub(t,a)));m=z.dot(z.sub(D,E),this.m_localAxisC)}if(this.m_type2==Pg.TYPE)_=z.zero(),y=this.m_ratio,x=this.m_ratio,S+=this.m_ratio*this.m_ratio*(this.m_iB+this.m_iD),h=i-c-this.m_referenceAngleB;else{var C=X.mulVec2(f,this.m_localAxisD),O=X.mulSub(f,this.m_localAnchorD,this.m_lcD),ee=X.mulSub(u,this.m_localAnchorB,this.m_lcB);_=z.mulNumVec2(this.m_ratio,C),x=this.m_ratio*z.crossVec2Vec2(O,C),y=this.m_ratio*z.crossVec2Vec2(ee,C),S+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_mB)+this.m_iD*x*x+this.m_iB*y*y;var te=z.sub(this.m_localAnchorD,this.m_lcD),ne=X.mulTVec2(f,z.add(ee,z.sub(r,s)));h=z.dot(ne,this.m_localAxisD)-z.dot(te,this.m_localAxisD)}var re=m+this.m_ratio*h-this.m_constant,ie=0;return S>0&&(ie=-re/S),t.addMul(this.m_mA*ie,g),n+=this.m_iA*ie*v,r.addMul(this.m_mB*ie,_),i+=this.m_iB*ie*y,a.subMul(this.m_mC*ie,g),o-=this.m_iC*ie*b,s.subMul(this.m_mD*ie,_),c-=this.m_iD*ie*x,this.m_bodyA.c_position.c.setVec2(t),this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c.setVec2(r),this.m_bodyB.c_position.a=i,this.m_bodyC.c_position.c.setVec2(a),this.m_bodyC.c_position.a=o,this.m_bodyD.c_position.c.setVec2(s),this.m_bodyD.c_position.a=c,p<V.linearSlop},t.TYPE=`gear-joint`,t})(Kp),Ug={maxForce:1,maxTorque:1,correctionFactor:.3},Wg=(function(e){lf(t,e);function t(n,r,i){var a=this;return a instanceof t?(n=df(n,Ug),a=e.call(this,n,r,i)||this,r=a.m_bodyA,i=a.m_bodyB,a.m_type=t.TYPE,a.m_linearOffset=z.isValid(n.linearOffset)?z.clone(n.linearOffset):r.getLocalPoint(i.getPosition()),a.m_angularOffset=Number.isFinite(n.angularOffset)?n.angularOffset:i.getAngle()-r.getAngle(),a.m_linearImpulse=z.zero(),a.m_angularImpulse=0,a.m_maxForce=n.maxForce,a.m_maxTorque=n.maxTorque,a.m_correctionFactor=n.correctionFactor,a):new t(n,r,i)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,maxForce:this.m_maxForce,maxTorque:this.m_maxTorque,correctionFactor:this.m_correctionFactor,linearOffset:this.m_linearOffset,angularOffset:this.m_angularOffset}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){Number.isFinite(e.angularOffset)&&(this.m_angularOffset=e.angularOffset),Number.isFinite(e.maxForce)&&(this.m_maxForce=e.maxForce),Number.isFinite(e.maxTorque)&&(this.m_maxTorque=e.maxTorque),Number.isFinite(e.correctionFactor)&&(this.m_correctionFactor=e.correctionFactor),z.isValid(e.linearOffset)&&this.m_linearOffset.set(e.linearOffset)},t.prototype.setMaxForce=function(e){this.m_maxForce=e},t.prototype.getMaxForce=function(){return this.m_maxForce},t.prototype.setMaxTorque=function(e){this.m_maxTorque=e},t.prototype.getMaxTorque=function(){return this.m_maxTorque},t.prototype.setCorrectionFactor=function(e){this.m_correctionFactor=e},t.prototype.getCorrectionFactor=function(){return this.m_correctionFactor},t.prototype.setLinearOffset=function(e){(e.x!=this.m_linearOffset.x||e.y!=this.m_linearOffset.y)&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_linearOffset.set(e))},t.prototype.getLinearOffset=function(){return this.m_linearOffset},t.prototype.setAngularOffset=function(e){e!=this.m_angularOffset&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_angularOffset=e)},t.prototype.getAngularOffset=function(){return this.m_angularOffset},t.prototype.getAnchorA=function(){return this.m_bodyA.getPosition()},t.prototype.getAnchorB=function(){return this.m_bodyB.getPosition()},t.prototype.getReactionForce=function(e){return z.mulNumVec2(e,this.m_linearImpulse)},t.prototype.getReactionTorque=function(e){return e*this.m_angularImpulse},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyA.c_velocity.v,i=this.m_bodyA.c_velocity.w,a=this.m_bodyB.c_position.c,o=this.m_bodyB.c_position.a,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=X.neo(n),u=X.neo(o);this.m_rA=X.mulVec2(l,z.sub(this.m_linearOffset,this.m_localCenterA)),this.m_rB=X.mulVec2(u,z.neg(this.m_localCenterB));var d=this.m_invMassA,f=this.m_invMassB,p=this.m_invIA,m=this.m_invIB,h=new Qm;if(h.ex.x=d+f+p*this.m_rA.y*this.m_rA.y+m*this.m_rB.y*this.m_rB.y,h.ex.y=-p*this.m_rA.x*this.m_rA.y-m*this.m_rB.x*this.m_rB.y,h.ey.x=h.ex.y,h.ey.y=d+f+p*this.m_rA.x*this.m_rA.x+m*this.m_rB.x*this.m_rB.x,this.m_linearMass=h.getInverse(),this.m_angularMass=p+m,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angularMass),this.m_linearError=z.zero(),this.m_linearError.addCombine(1,a,1,this.m_rB),this.m_linearError.subCombine(1,t,1,this.m_rA),this.m_angularError=o-n-this.m_angularOffset,e.warmStarting){this.m_linearImpulse.mul(e.dtRatio),this.m_angularImpulse*=e.dtRatio;var g=z.neo(this.m_linearImpulse.x,this.m_linearImpulse.y);r.subMul(d,g),i-=p*(z.crossVec2Vec2(this.m_rA,g)+this.m_angularImpulse),s.addMul(f,g),c+=m*(z.crossVec2Vec2(this.m_rB,g)+this.m_angularImpulse)}else this.m_linearImpulse.setZero(),this.m_angularImpulse=0;this.m_bodyA.c_velocity.v=r,this.m_bodyA.c_velocity.w=i,this.m_bodyB.c_velocity.v=s,this.m_bodyB.c_velocity.w=c},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_invMassA,o=this.m_invMassB,s=this.m_invIA,c=this.m_invIB,l=e.dt,u=e.inv_dt,d=i-n+u*this.m_correctionFactor*this.m_angularError,f=-this.m_angularMass*d,p=this.m_angularImpulse,m=l*this.m_maxTorque;this.m_angularImpulse=vf(this.m_angularImpulse+f,-m,m),f=this.m_angularImpulse-p,n-=s*f,i+=c*f;var d=z.zero();d.addCombine(1,r,1,z.crossNumVec2(i,this.m_rB)),d.subCombine(1,t,1,z.crossNumVec2(n,this.m_rA)),d.addMul(u*this.m_correctionFactor,this.m_linearError);var f=z.neg(Qm.mulVec2(this.m_linearMass,d)),p=z.clone(this.m_linearImpulse);this.m_linearImpulse.add(f);var m=l*this.m_maxForce;this.m_linearImpulse.clamp(m),f=z.sub(this.m_linearImpulse,p),t.subMul(a,f),n-=s*z.crossVec2Vec2(this.m_rA,f),r.addMul(o,f),i+=c*z.crossVec2Vec2(this.m_rB,f),this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){return!0},t.TYPE=`motor-joint`,t})(Kp),Gg=Math.PI,Kg={maxForce:0,frequencyHz:5,dampingRatio:.7},qg=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(n=df(n,Kg),o=e.call(this,n,r,i)||this,r=o.m_bodyA,i=o.m_bodyB,o.m_type=t.TYPE,z.isValid(a)?o.m_targetA=z.clone(a):z.isValid(n.target)?o.m_targetA=z.clone(n.target):o.m_targetA=z.zero(),o.m_localAnchorB=Sp.mulTVec2(i.getTransform(),o.m_targetA),o.m_maxForce=n.maxForce,o.m_impulse=z.zero(),o.m_frequencyHz=n.frequencyHz,o.m_dampingRatio=n.dampingRatio,o.m_beta=0,o.m_gamma=0,o.m_rB=z.zero(),o.m_localCenterB=z.zero(),o.m_invMassB=0,o.m_invIB=0,o.m_mass=new Qm,o.m_C=z.zero(),o):new t(n,r,i,a)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,target:this.m_targetA,maxForce:this.m_maxForce,frequencyHz:this.m_frequencyHz,dampingRatio:this.m_dampingRatio,_localAnchorB:this.m_localAnchorB}},t._deserialize=function(e,n,r){e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),e.target=z.clone(e.target);var i=new t(e);return e._localAnchorB&&(i.m_localAnchorB=e._localAnchorB),i},t.prototype._reset=function(e){Number.isFinite(e.maxForce)&&(this.m_maxForce=e.maxForce),Number.isFinite(e.frequencyHz)&&(this.m_frequencyHz=e.frequencyHz),Number.isFinite(e.dampingRatio)&&(this.m_dampingRatio=e.dampingRatio)},t.prototype.setTarget=function(e){z.areEqual(e,this.m_targetA)||(this.m_bodyB.setAwake(!0),this.m_targetA.set(e))},t.prototype.getTarget=function(){return this.m_targetA},t.prototype.setMaxForce=function(e){this.m_maxForce=e},t.prototype.getMaxForce=function(){return this.m_maxForce},t.prototype.setFrequency=function(e){this.m_frequencyHz=e},t.prototype.getFrequency=function(){return this.m_frequencyHz},t.prototype.setDampingRatio=function(e){this.m_dampingRatio=e},t.prototype.getDampingRatio=function(){return this.m_dampingRatio},t.prototype.getAnchorA=function(){return z.clone(this.m_targetA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(e,this.m_impulse)},t.prototype.getReactionTorque=function(e){return e*0},t.prototype.shiftOrigin=function(e){this.m_targetA.sub(e)},t.prototype.initVelocityConstraints=function(e){this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyB.c_position,n=this.m_bodyB.c_velocity,r=t.c,i=t.a,a=n.v,o=n.w,s=X.neo(i),c=this.m_bodyB.getMass(),l=2*Gg*this.m_frequencyHz,u=2*c*this.m_dampingRatio*l,d=l*l*c,f=e.dt;this.m_gamma=f*(u+f*d),this.m_gamma!=0&&(this.m_gamma=1/this.m_gamma),this.m_beta=f*d*this.m_gamma,this.m_rB=X.mulVec2(s,z.sub(this.m_localAnchorB,this.m_localCenterB));var p=new Qm;p.ex.x=this.m_invMassB+this.m_invIB*this.m_rB.y*this.m_rB.y+this.m_gamma,p.ex.y=-this.m_invIB*this.m_rB.x*this.m_rB.y,p.ey.x=p.ex.y,p.ey.y=this.m_invMassB+this.m_invIB*this.m_rB.x*this.m_rB.x+this.m_gamma,this.m_mass=p.getInverse(),this.m_C.setVec2(r),this.m_C.addCombine(1,this.m_rB,-1,this.m_targetA),this.m_C.mul(this.m_beta),o*=.98,e.warmStarting?(this.m_impulse.mul(e.dtRatio),a.addMul(this.m_invMassB,this.m_impulse),o+=this.m_invIB*z.crossVec2Vec2(this.m_rB,this.m_impulse)):this.m_impulse.setZero(),n.v.setVec2(a),n.w=o},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyB.c_velocity,n=z.clone(t.v),r=t.w,i=z.crossNumVec2(r,this.m_rB);i.add(n),i.addCombine(1,this.m_C,this.m_gamma,this.m_impulse),i.neg();var a=Qm.mulVec2(this.m_mass,i),o=z.clone(this.m_impulse);this.m_impulse.add(a);var s=e.dt*this.m_maxForce;this.m_impulse.clamp(s),a=z.sub(this.m_impulse,o),n.addMul(this.m_invMassB,a),r+=this.m_invIB*z.crossVec2Vec2(this.m_rB,a),t.v.setVec2(n),t.w=r},t.prototype.solvePositionConstraints=function(e){return!0},t.TYPE=`mouse-joint`,t})(Kp),Jg=Math.abs,Yg={collideConnected:!0},Xg=(function(e){lf(t,e);function t(n,r,i,a,o,s,c,l){var u=this;return u instanceof t?(n=df(n,Yg),u=e.call(this,n,r,i)||this,r=u.m_bodyA,i=u.m_bodyB,u.m_type=t.TYPE,u.m_groundAnchorA=z.clone(a||n.groundAnchorA||z.neo(-1,1)),u.m_groundAnchorB=z.clone(o||n.groundAnchorB||z.neo(1,1)),u.m_localAnchorA=z.clone(s?r.getLocalPoint(s):n.localAnchorA||z.neo(-1,0)),u.m_localAnchorB=z.clone(c?i.getLocalPoint(c):n.localAnchorB||z.neo(1,0)),u.m_lengthA=Number.isFinite(n.lengthA)?n.lengthA:z.distance(s,a),u.m_lengthB=Number.isFinite(n.lengthB)?n.lengthB:z.distance(c,o),u.m_ratio=Number.isFinite(l)?l:n.ratio,u.m_constant=u.m_lengthA+u.m_ratio*u.m_lengthB,u.m_impulse=0,u):new t(n,r,i,a,o,s,c,l)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,groundAnchorA:this.m_groundAnchorA,groundAnchorB:this.m_groundAnchorB,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,lengthA:this.m_lengthA,lengthB:this.m_lengthB,ratio:this.m_ratio}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){z.isValid(e.groundAnchorA)&&this.m_groundAnchorA.set(e.groundAnchorA),z.isValid(e.groundAnchorB)&&this.m_groundAnchorB.set(e.groundAnchorB),z.isValid(e.localAnchorA)?this.m_localAnchorA.set(e.localAnchorA):z.isValid(e.anchorA)&&this.m_localAnchorA.set(this.m_bodyA.getLocalPoint(e.anchorA)),z.isValid(e.localAnchorB)?this.m_localAnchorB.set(e.localAnchorB):z.isValid(e.anchorB)&&this.m_localAnchorB.set(this.m_bodyB.getLocalPoint(e.anchorB)),Number.isFinite(e.lengthA)&&(this.m_lengthA=e.lengthA),Number.isFinite(e.lengthB)&&(this.m_lengthB=e.lengthB),Number.isFinite(e.ratio)&&(this.m_ratio=e.ratio)},t.prototype.getGroundAnchorA=function(){return this.m_groundAnchorA},t.prototype.getGroundAnchorB=function(){return this.m_groundAnchorB},t.prototype.getLengthA=function(){return this.m_lengthA},t.prototype.getLengthB=function(){return this.m_lengthB},t.prototype.getRatio=function(){return this.m_ratio},t.prototype.getCurrentLengthA=function(){var e=this.m_bodyA.getWorldPoint(this.m_localAnchorA),t=this.m_groundAnchorA;return z.distance(e,t)},t.prototype.getCurrentLengthB=function(){var e=this.m_bodyB.getWorldPoint(this.m_localAnchorB),t=this.m_groundAnchorB;return z.distance(e,t)},t.prototype.shiftOrigin=function(e){this.m_groundAnchorA.sub(e),this.m_groundAnchorB.sub(e)},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(this.m_impulse,this.m_uB).mul(e)},t.prototype.getReactionTorque=function(e){return 0},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyA.c_velocity.v,i=this.m_bodyA.c_velocity.w,a=this.m_bodyB.c_position.c,o=this.m_bodyB.c_position.a,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=X.neo(n),u=X.neo(o);this.m_rA=X.mulVec2(l,z.sub(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=X.mulVec2(u,z.sub(this.m_localAnchorB,this.m_localCenterB)),this.m_uA=z.sub(z.add(t,this.m_rA),this.m_groundAnchorA),this.m_uB=z.sub(z.add(a,this.m_rB),this.m_groundAnchorB);var d=this.m_uA.length(),f=this.m_uB.length();d>10*V.linearSlop?this.m_uA.mul(1/d):this.m_uA.setZero(),f>10*V.linearSlop?this.m_uB.mul(1/f):this.m_uB.setZero();var p=z.crossVec2Vec2(this.m_rA,this.m_uA),m=z.crossVec2Vec2(this.m_rB,this.m_uB),h=this.m_invMassA+this.m_invIA*p*p,g=this.m_invMassB+this.m_invIB*m*m;if(this.m_mass=h+this.m_ratio*this.m_ratio*g,this.m_mass>0&&(this.m_mass=1/this.m_mass),e.warmStarting){this.m_impulse*=e.dtRatio;var _=z.mulNumVec2(-this.m_impulse,this.m_uA),v=z.mulNumVec2(-this.m_ratio*this.m_impulse,this.m_uB);r.addMul(this.m_invMassA,_),i+=this.m_invIA*z.crossVec2Vec2(this.m_rA,_),s.addMul(this.m_invMassB,v),c+=this.m_invIB*z.crossVec2Vec2(this.m_rB,v)}else this.m_impulse=0;this.m_bodyA.c_velocity.v=r,this.m_bodyA.c_velocity.w=i,this.m_bodyB.c_velocity.v=s,this.m_bodyB.c_velocity.w=c},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=z.add(t,z.crossNumVec2(n,this.m_rA)),o=z.add(r,z.crossNumVec2(i,this.m_rB)),s=-z.dot(this.m_uA,a)-this.m_ratio*z.dot(this.m_uB,o),c=-this.m_mass*s;this.m_impulse+=c;var l=z.mulNumVec2(-c,this.m_uA),u=z.mulNumVec2(-this.m_ratio*c,this.m_uB);t.addMul(this.m_invMassA,l),n+=this.m_invIA*z.crossVec2Vec2(this.m_rA,l),r.addMul(this.m_invMassB,u),i+=this.m_invIB*z.crossVec2Vec2(this.m_rB,u),this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=X.mulVec2(a,z.sub(this.m_localAnchorA,this.m_localCenterA)),c=X.mulVec2(o,z.sub(this.m_localAnchorB,this.m_localCenterB)),l=z.sub(z.add(t,this.m_rA),this.m_groundAnchorA),u=z.sub(z.add(r,this.m_rB),this.m_groundAnchorB),d=l.length(),f=u.length();d>10*V.linearSlop?l.mul(1/d):l.setZero(),f>10*V.linearSlop?u.mul(1/f):u.setZero();var p=z.crossVec2Vec2(s,l),m=z.crossVec2Vec2(c,u),h=this.m_invMassA+this.m_invIA*p*p,g=this.m_invMassB+this.m_invIB*m*m,_=h+this.m_ratio*this.m_ratio*g;_>0&&(_=1/_);var v=this.m_constant-d-this.m_ratio*f,y=Jg(v),b=-_*v,x=z.mulNumVec2(-b,l),S=z.mulNumVec2(-this.m_ratio*b,u);return t.addMul(this.m_invMassA,x),n+=this.m_invIA*z.crossVec2Vec2(s,x),r.addMul(this.m_invMassB,S),i+=this.m_invIB*z.crossVec2Vec2(c,S),this.m_bodyA.c_position.c=t,this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c=r,this.m_bodyB.c_position.a=i,y<V.linearSlop},t.TYPE=`pulley-joint`,t})(Kp),Zg=Math.min,Qg;(function(e){e[e.inactiveLimit=0]=`inactiveLimit`,e[e.atLowerLimit=1]=`atLowerLimit`,e[e.atUpperLimit=2]=`atUpperLimit`,e[e.equalLimits=3]=`equalLimits`})(Qg||={});var $g={maxLength:0},e_=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(n=df(n,$g),o=e.call(this,n,r,i)||this,r=o.m_bodyA,i=o.m_bodyB,o.m_type=t.TYPE,o.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.neo(-1,0)),o.m_localAnchorB=z.clone(a?i.getLocalPoint(a):n.localAnchorB||z.neo(1,0)),o.m_maxLength=n.maxLength,o.m_mass=0,o.m_impulse=0,o.m_length=0,o.m_state=Qg.inactiveLimit,o):new t(n,r,i,a)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,maxLength:this.m_maxLength}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){Number.isFinite(e.maxLength)&&(this.m_maxLength=e.maxLength)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.setMaxLength=function(e){this.m_maxLength=e},t.prototype.getMaxLength=function(){return this.m_maxLength},t.prototype.getLimitState=function(){return this.m_state},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.mulNumVec2(this.m_impulse,this.m_u).mul(e)},t.prototype.getReactionTorque=function(e){return 0},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyA.c_velocity.v,i=this.m_bodyA.c_velocity.w,a=this.m_bodyB.c_position.c,o=this.m_bodyB.c_position.a,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=X.neo(n),u=X.neo(o);if(this.m_rA=X.mulSub(l,this.m_localAnchorA,this.m_localCenterA),this.m_rB=X.mulSub(u,this.m_localAnchorB,this.m_localCenterB),this.m_u=z.zero(),this.m_u.addCombine(1,a,1,this.m_rB),this.m_u.subCombine(1,t,1,this.m_rA),this.m_length=this.m_u.length(),this.m_length-this.m_maxLength>0?this.m_state=Qg.atUpperLimit:this.m_state=Qg.inactiveLimit,this.m_length>V.linearSlop)this.m_u.mul(1/this.m_length);else{this.m_u.setZero(),this.m_mass=0,this.m_impulse=0;return}var d=z.crossVec2Vec2(this.m_rA,this.m_u),f=z.crossVec2Vec2(this.m_rB,this.m_u),p=this.m_invMassA+this.m_invIA*d*d+this.m_invMassB+this.m_invIB*f*f;if(this.m_mass=p==0?0:1/p,e.warmStarting){this.m_impulse*=e.dtRatio;var m=z.mulNumVec2(this.m_impulse,this.m_u);r.subMul(this.m_invMassA,m),i-=this.m_invIA*z.crossVec2Vec2(this.m_rA,m),s.addMul(this.m_invMassB,m),c+=this.m_invIB*z.crossVec2Vec2(this.m_rB,m)}else this.m_impulse=0;this.m_bodyA.c_velocity.v.setVec2(r),this.m_bodyA.c_velocity.w=i,this.m_bodyB.c_velocity.v.setVec2(s),this.m_bodyB.c_velocity.w=c},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=z.addCrossNumVec2(t,n,this.m_rA),o=z.addCrossNumVec2(r,i,this.m_rB),s=this.m_length-this.m_maxLength,c=z.dot(this.m_u,z.sub(o,a));s<0&&(c+=e.inv_dt*s);var l=-this.m_mass*c,u=this.m_impulse;this.m_impulse=Zg(0,this.m_impulse+l),l=this.m_impulse-u;var d=z.mulNumVec2(l,this.m_u);t.subMul(this.m_invMassA,d),n-=this.m_invIA*z.crossVec2Vec2(this.m_rA,d),r.addMul(this.m_invMassB,d),i+=this.m_invIB*z.crossVec2Vec2(this.m_rB,d),this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=X.mulSub(a,this.m_localAnchorA,this.m_localCenterA),c=X.mulSub(o,this.m_localAnchorB,this.m_localCenterB),l=z.zero();l.addCombine(1,r,1,c),l.subCombine(1,t,1,s);var u=l.normalize(),d=u-this.m_maxLength;d=vf(d,0,V.maxLinearCorrection);var f=-this.m_mass*d,p=z.mulNumVec2(f,l);return t.subMul(this.m_invMassA,p),n-=this.m_invIA*z.crossVec2Vec2(s,p),r.addMul(this.m_invMassB,p),i+=this.m_invIB*z.crossVec2Vec2(c,p),this.m_bodyA.c_position.c.setVec2(t),this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c.setVec2(r),this.m_bodyB.c_position.a=i,u-this.m_maxLength<V.linearSlop},t.TYPE=`rope-joint`,t})(Kp),t_=Math.abs,n_=Math.PI,r_={frequencyHz:0,dampingRatio:0},i_=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(n=df(n,r_),o=e.call(this,n,r,i)||this,r=o.m_bodyA,i=o.m_bodyB,o.m_type=t.TYPE,o.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.zero()),o.m_localAnchorB=z.clone(a?i.getLocalPoint(a):n.localAnchorB||z.zero()),o.m_referenceAngle=Number.isFinite(n.referenceAngle)?n.referenceAngle:i.getAngle()-r.getAngle(),o.m_frequencyHz=n.frequencyHz,o.m_dampingRatio=n.dampingRatio,o.m_impulse=new rg,o.m_bias=0,o.m_gamma=0,o.m_mass=new Ag,o):new t(n,r,i,a)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,frequencyHz:this.m_frequencyHz,dampingRatio:this.m_dampingRatio,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,referenceAngle:this.m_referenceAngle}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),Number.isFinite(e.frequencyHz)&&(this.m_frequencyHz=e.frequencyHz),Number.isFinite(e.dampingRatio)&&(this.m_dampingRatio=e.dampingRatio)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.getReferenceAngle=function(){return this.m_referenceAngle},t.prototype.setFrequency=function(e){this.m_frequencyHz=e},t.prototype.getFrequency=function(){return this.m_frequencyHz},t.prototype.setDampingRatio=function(e){this.m_dampingRatio=e},t.prototype.getDampingRatio=function(){return this.m_dampingRatio},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.neo(this.m_impulse.x,this.m_impulse.y).mul(e)},t.prototype.getReactionTorque=function(e){return e*this.m_impulse.z},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_bodyA.c_position.a,n=this.m_bodyA.c_velocity.v,r=this.m_bodyA.c_velocity.w,i=this.m_bodyB.c_position.a,a=this.m_bodyB.c_velocity.v,o=this.m_bodyB.c_velocity.w,s=X.neo(t),c=X.neo(i);this.m_rA=X.mulVec2(s,z.sub(this.m_localAnchorA,this.m_localCenterA)),this.m_rB=X.mulVec2(c,z.sub(this.m_localAnchorB,this.m_localCenterB));var l=this.m_invMassA,u=this.m_invMassB,d=this.m_invIA,f=this.m_invIB,p=new Ag;if(p.ex.x=l+u+this.m_rA.y*this.m_rA.y*d+this.m_rB.y*this.m_rB.y*f,p.ey.x=-this.m_rA.y*this.m_rA.x*d-this.m_rB.y*this.m_rB.x*f,p.ez.x=-this.m_rA.y*d-this.m_rB.y*f,p.ex.y=p.ey.x,p.ey.y=l+u+this.m_rA.x*this.m_rA.x*d+this.m_rB.x*this.m_rB.x*f,p.ez.y=this.m_rA.x*d+this.m_rB.x*f,p.ex.z=p.ez.x,p.ey.z=p.ez.y,p.ez.z=d+f,this.m_frequencyHz>0){p.getInverse22(this.m_mass);var m=d+f,h=m>0?1/m:0,g=i-t-this.m_referenceAngle,_=2*n_*this.m_frequencyHz,v=2*h*this.m_dampingRatio*_,y=h*_*_,b=e.dt;this.m_gamma=b*(v+b*y),this.m_gamma=this.m_gamma==0?0:1/this.m_gamma,this.m_bias=g*b*y*this.m_gamma,m+=this.m_gamma,this.m_mass.ez.z=m==0?0:1/m}else p.ez.z==0?(p.getInverse22(this.m_mass),this.m_gamma=0,this.m_bias=0):(p.getSymInverse33(this.m_mass),this.m_gamma=0,this.m_bias=0);if(e.warmStarting){this.m_impulse.mul(e.dtRatio);var x=z.neo(this.m_impulse.x,this.m_impulse.y);n.subMul(l,x),r-=d*(z.crossVec2Vec2(this.m_rA,x)+this.m_impulse.z),a.addMul(u,x),o+=f*(z.crossVec2Vec2(this.m_rB,x)+this.m_impulse.z)}else this.m_impulse.setZero();this.m_bodyA.c_velocity.v=n,this.m_bodyA.c_velocity.w=r,this.m_bodyB.c_velocity.v=a,this.m_bodyB.c_velocity.w=o},t.prototype.solveVelocityConstraints=function(e){var t=this.m_bodyA.c_velocity.v,n=this.m_bodyA.c_velocity.w,r=this.m_bodyB.c_velocity.v,i=this.m_bodyB.c_velocity.w,a=this.m_invMassA,o=this.m_invMassB,s=this.m_invIA,c=this.m_invIB;if(this.m_frequencyHz>0){var l=i-n,u=-this.m_mass.ez.z*(l+this.m_bias+this.m_gamma*this.m_impulse.z);this.m_impulse.z+=u,n-=s*u,i+=c*u;var d=z.zero();d.addCombine(1,r,1,z.crossNumVec2(i,this.m_rB)),d.subCombine(1,t,1,z.crossNumVec2(n,this.m_rA));var f=z.neg(Ag.mulVec2(this.m_mass,d));this.m_impulse.x+=f.x,this.m_impulse.y+=f.y;var p=z.clone(f);t.subMul(a,p),n-=s*z.crossVec2Vec2(this.m_rA,p),r.addMul(o,p),i+=c*z.crossVec2Vec2(this.m_rB,p)}else{var d=z.zero();d.addCombine(1,r,1,z.crossNumVec2(i,this.m_rB)),d.subCombine(1,t,1,z.crossNumVec2(n,this.m_rA));var l=i-n,m=new rg(d.x,d.y,l),h=rg.neg(Ag.mulVec3(this.m_mass,m));this.m_impulse.add(h);var p=z.neo(h.x,h.y);t.subMul(a,p),n-=s*(z.crossVec2Vec2(this.m_rA,p)+h.z),r.addMul(o,p),i+=c*(z.crossVec2Vec2(this.m_rB,p)+h.z)}this.m_bodyA.c_velocity.v=t,this.m_bodyA.c_velocity.w=n,this.m_bodyB.c_velocity.v=r,this.m_bodyB.c_velocity.w=i},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=this.m_invMassA,c=this.m_invMassB,l=this.m_invIA,u=this.m_invIB,d=X.mulVec2(a,z.sub(this.m_localAnchorA,this.m_localCenterA)),f=X.mulVec2(o,z.sub(this.m_localAnchorB,this.m_localCenterB)),p,m,h=new Ag;if(h.ex.x=s+c+d.y*d.y*l+f.y*f.y*u,h.ey.x=-d.y*d.x*l-f.y*f.x*u,h.ez.x=-d.y*l-f.y*u,h.ex.y=h.ey.x,h.ey.y=s+c+d.x*d.x*l+f.x*f.x*u,h.ez.y=d.x*l+f.x*u,h.ex.z=h.ez.x,h.ey.z=h.ez.y,h.ez.z=l+u,this.m_frequencyHz>0){var g=z.zero();g.addCombine(1,r,1,f),g.subCombine(1,t,1,d),p=g.length(),m=0;var _=z.neg(h.solve22(g));t.subMul(s,_),n-=l*z.crossVec2Vec2(d,_),r.addMul(c,_),i+=u*z.crossVec2Vec2(f,_)}else{var g=z.zero();g.addCombine(1,r,1,f),g.subCombine(1,t,1,d);var v=i-n-this.m_referenceAngle;p=g.length(),m=t_(v);var y=new rg(g.x,g.y,v),b=new rg;if(h.ez.z>0)b=rg.neg(h.solve33(y));else{var x=z.neg(h.solve22(g));b.set(x.x,x.y,0)}var _=z.neo(b.x,b.y);t.subMul(s,_),n-=l*(z.crossVec2Vec2(d,_)+b.z),r.addMul(c,_),i+=u*(z.crossVec2Vec2(f,_)+b.z)}return this.m_bodyA.c_position.c=t,this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c=r,this.m_bodyB.c_position.a=i,p<=V.linearSlop&&m<=V.angularSlop},t.TYPE=`weld-joint`,t})(Kp),a_=Math.abs,o_=Math.PI,s_={enableMotor:!1,maxMotorTorque:0,motorSpeed:0,frequencyHz:2,dampingRatio:.7},c_=(function(e){lf(t,e);function t(n,r,i,a,o){var s=this;return s instanceof t?(n=df(n,s_),s=e.call(this,n,r,i)||this,r=s.m_bodyA,i=s.m_bodyB,s.m_ax=z.zero(),s.m_ay=z.zero(),s.m_type=t.TYPE,s.m_localAnchorA=z.clone(a?r.getLocalPoint(a):n.localAnchorA||z.zero()),s.m_localAnchorB=z.clone(a?i.getLocalPoint(a):n.localAnchorB||z.zero()),z.isValid(o)?s.m_localXAxisA=r.getLocalVector(o):z.isValid(n.localAxisA)?s.m_localXAxisA=z.clone(n.localAxisA):z.isValid(n.localAxis)?s.m_localXAxisA=z.clone(n.localAxis):s.m_localXAxisA=z.neo(1,0),s.m_localYAxisA=z.crossNumVec2(1,s.m_localXAxisA),s.m_mass=0,s.m_impulse=0,s.m_motorMass=0,s.m_motorImpulse=0,s.m_springMass=0,s.m_springImpulse=0,s.m_maxMotorTorque=n.maxMotorTorque,s.m_motorSpeed=n.motorSpeed,s.m_enableMotor=n.enableMotor,s.m_frequencyHz=n.frequencyHz,s.m_dampingRatio=n.dampingRatio,s.m_bias=0,s.m_gamma=0,s):new t(n,r,i,a,o)}return t.prototype._serialize=function(){return{type:this.m_type,bodyA:this.m_bodyA,bodyB:this.m_bodyB,collideConnected:this.m_collideConnected,enableMotor:this.m_enableMotor,maxMotorTorque:this.m_maxMotorTorque,motorSpeed:this.m_motorSpeed,frequencyHz:this.m_frequencyHz,dampingRatio:this.m_dampingRatio,localAnchorA:this.m_localAnchorA,localAnchorB:this.m_localAnchorB,localAxisA:this.m_localXAxisA}},t._deserialize=function(e,n,r){return e=uf({},e),e.bodyA=r(Wp,e.bodyA,n),e.bodyB=r(Wp,e.bodyB,n),new t(e)},t.prototype._reset=function(e){e.anchorA?this.m_localAnchorA.setVec2(this.m_bodyA.getLocalPoint(e.anchorA)):e.localAnchorA&&this.m_localAnchorA.setVec2(e.localAnchorA),e.anchorB?this.m_localAnchorB.setVec2(this.m_bodyB.getLocalPoint(e.anchorB)):e.localAnchorB&&this.m_localAnchorB.setVec2(e.localAnchorB),e.localAxisA&&(this.m_localXAxisA.setVec2(e.localAxisA),this.m_localYAxisA.setVec2(z.crossNumVec2(1,e.localAxisA))),e.enableMotor!==void 0&&(this.m_enableMotor=e.enableMotor),Number.isFinite(e.maxMotorTorque)&&(this.m_maxMotorTorque=e.maxMotorTorque),Number.isFinite(e.motorSpeed)&&(this.m_motorSpeed=e.motorSpeed),Number.isFinite(e.frequencyHz)&&(this.m_frequencyHz=e.frequencyHz),Number.isFinite(e.dampingRatio)&&(this.m_dampingRatio=e.dampingRatio)},t.prototype.getLocalAnchorA=function(){return this.m_localAnchorA},t.prototype.getLocalAnchorB=function(){return this.m_localAnchorB},t.prototype.getLocalAxisA=function(){return this.m_localXAxisA},t.prototype.getJointTranslation=function(){var e=this.m_bodyA,t=this.m_bodyB,n=e.getWorldPoint(this.m_localAnchorA),r=t.getWorldPoint(this.m_localAnchorB),i=z.sub(r,n),a=e.getWorldVector(this.m_localXAxisA);return z.dot(i,a)},t.prototype.getJointSpeed=function(){var e=this.m_bodyA.m_angularVelocity;return this.m_bodyB.m_angularVelocity-e},t.prototype.isMotorEnabled=function(){return this.m_enableMotor},t.prototype.enableMotor=function(e){e!=this.m_enableMotor&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_enableMotor=e)},t.prototype.setMotorSpeed=function(e){e!=this.m_motorSpeed&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_motorSpeed=e)},t.prototype.getMotorSpeed=function(){return this.m_motorSpeed},t.prototype.setMaxMotorTorque=function(e){e!=this.m_maxMotorTorque&&(this.m_bodyA.setAwake(!0),this.m_bodyB.setAwake(!0),this.m_maxMotorTorque=e)},t.prototype.getMaxMotorTorque=function(){return this.m_maxMotorTorque},t.prototype.getMotorTorque=function(e){return e*this.m_motorImpulse},t.prototype.setSpringFrequencyHz=function(e){this.m_frequencyHz=e},t.prototype.getSpringFrequencyHz=function(){return this.m_frequencyHz},t.prototype.setSpringDampingRatio=function(e){this.m_dampingRatio=e},t.prototype.getSpringDampingRatio=function(){return this.m_dampingRatio},t.prototype.getAnchorA=function(){return this.m_bodyA.getWorldPoint(this.m_localAnchorA)},t.prototype.getAnchorB=function(){return this.m_bodyB.getWorldPoint(this.m_localAnchorB)},t.prototype.getReactionForce=function(e){return z.combine(this.m_impulse,this.m_ay,this.m_springImpulse,this.m_ax).mul(e)},t.prototype.getReactionTorque=function(e){return e*this.m_motorImpulse},t.prototype.initVelocityConstraints=function(e){this.m_localCenterA=this.m_bodyA.m_sweep.localCenter,this.m_localCenterB=this.m_bodyB.m_sweep.localCenter,this.m_invMassA=this.m_bodyA.m_invMass,this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_bodyB.m_invI;var t=this.m_invMassA,n=this.m_invMassB,r=this.m_invIA,i=this.m_invIB,a=this.m_bodyA.c_position.c,o=this.m_bodyA.c_position.a,s=this.m_bodyA.c_velocity.v,c=this.m_bodyA.c_velocity.w,l=this.m_bodyB.c_position.c,u=this.m_bodyB.c_position.a,d=this.m_bodyB.c_velocity.v,f=this.m_bodyB.c_velocity.w,p=X.neo(o),m=X.neo(u),h=X.mulVec2(p,z.sub(this.m_localAnchorA,this.m_localCenterA)),g=X.mulVec2(m,z.sub(this.m_localAnchorB,this.m_localCenterB)),_=z.zero();if(_.addCombine(1,l,1,g),_.subCombine(1,a,1,h),this.m_ay=X.mulVec2(p,this.m_localYAxisA),this.m_sAy=z.crossVec2Vec2(z.add(_,h),this.m_ay),this.m_sBy=z.crossVec2Vec2(g,this.m_ay),this.m_mass=t+n+r*this.m_sAy*this.m_sAy+i*this.m_sBy*this.m_sBy,this.m_mass>0&&(this.m_mass=1/this.m_mass),this.m_springMass=0,this.m_bias=0,this.m_gamma=0,this.m_frequencyHz>0){this.m_ax=X.mulVec2(p,this.m_localXAxisA),this.m_sAx=z.crossVec2Vec2(z.add(_,h),this.m_ax),this.m_sBx=z.crossVec2Vec2(g,this.m_ax);var v=t+n+r*this.m_sAx*this.m_sAx+i*this.m_sBx*this.m_sBx;if(v>0){this.m_springMass=1/v;var y=z.dot(_,this.m_ax),b=2*o_*this.m_frequencyHz,x=2*this.m_springMass*this.m_dampingRatio*b,S=this.m_springMass*b*b,C=e.dt;this.m_gamma=C*(x+C*S),this.m_gamma>0&&(this.m_gamma=1/this.m_gamma),this.m_bias=y*C*S*this.m_gamma,this.m_springMass=v+this.m_gamma,this.m_springMass>0&&(this.m_springMass=1/this.m_springMass)}}else this.m_springImpulse=0;if(this.m_enableMotor?(this.m_motorMass=r+i,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass)):(this.m_motorMass=0,this.m_motorImpulse=0),e.warmStarting){this.m_impulse*=e.dtRatio,this.m_springImpulse*=e.dtRatio,this.m_motorImpulse*=e.dtRatio;var w=z.combine(this.m_impulse,this.m_ay,this.m_springImpulse,this.m_ax),T=this.m_impulse*this.m_sAy+this.m_springImpulse*this.m_sAx+this.m_motorImpulse,E=this.m_impulse*this.m_sBy+this.m_springImpulse*this.m_sBx+this.m_motorImpulse;s.subMul(this.m_invMassA,w),c-=this.m_invIA*T,d.addMul(this.m_invMassB,w),f+=this.m_invIB*E}else this.m_impulse=0,this.m_springImpulse=0,this.m_motorImpulse=0;this.m_bodyA.c_velocity.v.setVec2(s),this.m_bodyA.c_velocity.w=c,this.m_bodyB.c_velocity.v.setVec2(d),this.m_bodyB.c_velocity.w=f},t.prototype.solveVelocityConstraints=function(e){var t=this.m_invMassA,n=this.m_invMassB,r=this.m_invIA,i=this.m_invIB,a=this.m_bodyA.c_velocity.v,o=this.m_bodyA.c_velocity.w,s=this.m_bodyB.c_velocity.v,c=this.m_bodyB.c_velocity.w,l=z.dot(this.m_ax,s)-z.dot(this.m_ax,a)+this.m_sBx*c-this.m_sAx*o,u=-this.m_springMass*(l+this.m_bias+this.m_gamma*this.m_springImpulse);this.m_springImpulse+=u;var d=z.mulNumVec2(u,this.m_ax),f=u*this.m_sAx,p=u*this.m_sBx;a.subMul(t,d),o-=r*f,s.addMul(n,d),c+=i*p;var l=c-o-this.m_motorSpeed,u=-this.m_motorMass*l,m=this.m_motorImpulse,h=e.dt*this.m_maxMotorTorque;this.m_motorImpulse=vf(this.m_motorImpulse+u,-h,h),u=this.m_motorImpulse-m,o-=r*u,c+=i*u;var l=z.dot(this.m_ay,s)-z.dot(this.m_ay,a)+this.m_sBy*c-this.m_sAy*o,u=-this.m_mass*l;this.m_impulse+=u;var d=z.mulNumVec2(u,this.m_ay),f=u*this.m_sAy,p=u*this.m_sBy;a.subMul(t,d),o-=r*f,s.addMul(n,d),c+=i*p,this.m_bodyA.c_velocity.v.setVec2(a),this.m_bodyA.c_velocity.w=o,this.m_bodyB.c_velocity.v.setVec2(s),this.m_bodyB.c_velocity.w=c},t.prototype.solvePositionConstraints=function(e){var t=this.m_bodyA.c_position.c,n=this.m_bodyA.c_position.a,r=this.m_bodyB.c_position.c,i=this.m_bodyB.c_position.a,a=X.neo(n),o=X.neo(i),s=X.mulVec2(a,z.sub(this.m_localAnchorA,this.m_localCenterA)),c=X.mulVec2(o,z.sub(this.m_localAnchorB,this.m_localCenterB)),l=z.zero();l.addCombine(1,r,1,c),l.subCombine(1,t,1,s);var u=X.mulVec2(a,this.m_localYAxisA),d=z.crossVec2Vec2(z.add(l,s),u),f=z.crossVec2Vec2(c,u),p=z.dot(l,u),m=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_sAy*this.m_sAy+this.m_invIB*this.m_sBy*this.m_sBy,h=m==0?0:-p/m,g=z.mulNumVec2(h,u),_=h*d,v=h*f;return t.subMul(this.m_invMassA,g),n-=this.m_invIA*_,r.addMul(this.m_invMassB,g),i+=this.m_invIB*v,this.m_bodyA.c_position.c.setVec2(t),this.m_bodyA.c_position.a=n,this.m_bodyB.c_position.c.setVec2(r),this.m_bodyB.c_position.a=i,a_(p)<=V.linearSlop},t.TYPE=`wheel-joint`,t})(Kp),l_,u_=0,d_={World:ng,Body:Wp,Joint:Kp,Fixture:Pp,Shape:Op},f_={Vec2:z,Vec3:rg,World:ng,Body:Wp,Joint:Kp,Fixture:Pp,Shape:Op},p_=(l_={},l_[Wp.STATIC]=Wp,l_[Wp.DYNAMIC]=Wp,l_[Wp.KINEMATIC]=Wp,l_[lg.TYPE]=lg,l_[vg.TYPE]=vg,l_[og.TYPE]=og,l_[Cg.TYPE]=Cg,l_[Dg.TYPE]=Dg,l_[kg.TYPE]=kg,l_[Hg.TYPE]=Hg,l_[Wg.TYPE]=Wg,l_[qg.TYPE]=qg,l_[Bg.TYPE]=Bg,l_[Xg.TYPE]=Xg,l_[Pg.TYPE]=Pg,l_[e_.TYPE]=e_,l_[i_.TYPE]=i_,l_[c_.TYPE]=c_,l_),m_={rootClass:ng,preSerialize:function(e){return e},postSerialize:function(e,t){return e},preDeserialize:function(e){return e},postDeserialize:function(e,t){return e}},h_=(function(){function e(e){var t=this;this.toJson=function(e){var n=t.options.preSerialize,r=t.options.postSerialize,i=[],a=[e],o={};function s(e,t){if(e.__sid=e.__sid||++u_,!o[e.__sid]){a.push(e);var n={refIndex:i.length+a.length,refType:t};o[e.__sid]=n}return o[e.__sid]}function c(e){e=n(e);var t=e._serialize();return t=r(t,e),t}function l(e,t){if(t===void 0&&(t=!1),typeof e!=`object`||!e)return e;if(typeof e._serialize==`function`){if(!t){for(var n in d_)if(e instanceof d_[n])return s(e,n)}e=c(e)}if(Array.isArray(e)){for(var r=[],i=0;i<e.length;i++)r[i]=l(e[i]);e=r}else{var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=l(e[i]));e=r}return e}for(;a.length;){var u=l(a.shift(),!0);i.push(u)}return i},this.fromJson=function(e){var n=t.options.preDeserialize,r=t.options.postDeserialize,i=t.options.rootClass,a={};function o(e,t,i){if((!e||!e._deserialize)&&(e=p_[t.type]),e&&e._deserialize){t=n(t);var a=e._deserialize,o=a(t,i,s);return o=r(o,t),o}}function s(t,n,r){if(!(n.refIndex&&n.refType))return o(t,n,r);var i=n;f_[i.refType]&&(t=f_[i.refType]);var s=i.refIndex;if(!a[s]){var c=e[s];a[s]=o(t,c,r)}return a[s]}return o(i,e[0],null)},this.options=uf(uf({},m_),e)}return e})(),g_=new h_({rootClass:ng});h_.fromJson=g_.fromJson,h_.toJson=g_.toJson,(function(){function e(){}return e.mount=function(e){throw Error(`Not implemented`)},e.start=function(t){var n=e.mount();return n.start(t),n},e})();var __=(function(e){lf(t,e);function t(n,r,i,a){var o=this;return o instanceof t?(o=e.call(this)||this,o._setAsBox(n,r,i,a),o):new t(n,r,i,a)}return t.TYPE=`polygon`,t})(vg);eg.addType(Cg.TYPE,Cg.TYPE,v_);function v_(e,t,n,r,i,a,o){x_(e,n.getShape(),t,a.getShape(),i)}var y_=H(0,0),b_=H(0,0),x_=function(e,t,n,r,i){e.pointCount=0,Y(y_,n,t.m_p),Y(b_,i,r.m_p);var a=ap(b_,y_),o=t.m_radius+r.m_radius;a>o*o||(e.type=ch.e_circles,U(e.localPoint,t.m_p),W(e.localNormal),e.pointCount=1,U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex))};eg.addType(og.TYPE,Cg.TYPE,S_),eg.addType(lg.TYPE,Cg.TYPE,C_);function S_(e,t,n,r,i,a,o){A_(e,n.getShape(),t,a.getShape(),i)}function C_(e,t,n,r,i,a,o){var s=n.getShape(),c=new og;s.getChildEdge(c,r),A_(e,c,t,a.getShape(),i)}var w_=H(0,0),T_=H(0,0),E_=H(0,0),D_=H(0,0),O_=H(0,0),k_=H(0,0),A_=function(e,t,n,r,i){e.pointCount=0,pp(D_,i,n,r.m_p);var a=t.m_vertex1,o=t.m_vertex2;G(w_,o,a);var s=J(w_,o)-J(w_,D_),c=J(w_,D_)-J(w_,a),l=t.m_radius+r.m_radius;if(c<=0){if(U(O_,a),ap(D_,a)>l*l)return;if(t.m_hasVertex0){var u=t.m_vertex0,d=a;if(G(T_,d,u),J(T_,d)-J(T_,D_)>0)return}e.type=ch.e_circles,W(e.localNormal),U(e.localPoint,O_),e.pointCount=1,U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex);return}if(s<=0){if(U(O_,o),ap(D_,O_)>l*l)return;if(t.m_hasVertex3){var f=t.m_vertex3,p=o;if(G(E_,f,p),J(E_,D_)-J(E_,p)>0)return}e.type=ch.e_circles,W(e.localNormal),U(e.localPoint,O_),e.pointCount=1,U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(1,Z.e_vertex,0,Z.e_vertex);return}var m=rp(w_);Zf(O_,s/m,a,c/m,o),!(ap(D_,O_)>l*l)&&(np(k_,1,w_),J(k_,D_)-J(k_,a)<0&&Wf(k_),ep(k_),e.type=ch.e_faceA,U(e.localNormal,k_),U(e.localPoint,a),e.pointCount=1,U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_face,0,Z.e_vertex))},j_=[new uh,new uh],M_=[new uh,new uh],N_=[new uh,new uh],P_=H(0,0),F_=H(0,0),I_=H(0,0),L_=up(0,0,0),R_=H(0,0),z_=H(0,0),B_=H(0,0),V_=H(0,0),H_=H(0,0),U_=H(0,0),W_=H(0,0),G_=H(0,0);eg.addType(vg.TYPE,vg.TYPE,K_);function K_(e,t,n,r,i,a,o){X_(e,n.getShape(),t,a.getShape(),i)}function q_(e,t,n,r,i){var a=e.m_count,o=n.m_count,s=e.m_normals,c=e.m_vertices,l=n.m_vertices;mp(L_,r,t);for(var u=0,d=-1/0,f=0;f<a;++f){sp(I_,L_.q,s[f]),Y(F_,L_,c[f]);for(var p=1/0,m=0;m<o;++m){var h=J(I_,l[m])-J(I_,F_);h<p&&(p=h)}p>d&&(d=p,u=f)}i.maxSeparation=d,i.bestIndex=u}function J_(e,t,n,r,i,a){var o=t.m_normals,s=i.m_count,c=i.m_vertices,l=i.m_normals;lp(G_,a.q,n.q,o[r]);for(var u=0,d=1/0,f=0;f<s;++f){var p=J(G_,l[f]);p<d&&(d=p,u=f)}var m=u,h=m+1<s?m+1:0;Y(e[0].v,a,c[m]),e[0].id.setFeatures(r,Z.e_face,m,Z.e_vertex),Y(e[1].v,a,c[h]),e[1].id.setFeatures(r,Z.e_face,h,Z.e_vertex)}var Y_={maxSeparation:0,bestIndex:0},X_=function(e,t,n,r,i){e.pointCount=0;var a=t.m_radius+r.m_radius;q_(t,n,r,i,Y_);var o=Y_.bestIndex,s=Y_.maxSeparation;if(!(s>a)){q_(r,i,t,n,Y_);var c=Y_.bestIndex,l=Y_.maxSeparation;if(!(l>a)){var u,d,f,p,m,h;l>s+.1*V.linearSlop?(u=r,d=t,f=i,p=n,m=c,e.type=ch.e_faceB,h=!0):(u=t,d=r,f=n,p=i,m=o,e.type=ch.e_faceA,h=!1),j_[0].recycle(),j_[1].recycle(),J_(j_,u,f,m,d,p);var g=u.m_count,_=u.m_vertices,v=m,y=m+1<g?m+1:0;U(R_,_[v]),U(z_,_[y]),G(B_,z_,R_),ep(B_),tp(V_,B_,1),Zf(H_,.5,R_,.5,z_),sp(U_,f.q,B_),tp(W_,U_,1),Y(R_,f,R_),Y(z_,f,z_);var b=J(W_,R_),x=-J(U_,R_)+a,S=J(U_,z_)+a;if(M_[0].recycle(),M_[1].recycle(),N_[0].recycle(),N_[1].recycle(),Uf(P_,-U_.x,-U_.y),!(gh(M_,j_,P_,x,v)<2)&&(Uf(P_,U_.x,U_.y),!(gh(N_,M_,P_,S,y)<2))){U(e.localNormal,V_),U(e.localPoint,H_);for(var C=0,w=0;w<N_.length;++w)if(J(W_,N_[w].v)-b<=a){var T=e.points[C];fp(T.localPoint,p,N_[w].v),T.id.set(N_[w].id),h&&T.id.swapFeatures(),++C}e.pointCount=C}}}};eg.addType(vg.TYPE,Cg.TYPE,Z_);function Z_(e,t,n,r,i,a,o){ev(e,n.getShape(),t,a.getShape(),i)}var Q_=H(0,0),$_=H(0,0),ev=function(e,t,n,r,i){e.pointCount=0,pp(Q_,i,n,r.m_p);for(var a=0,o=-1/0,s=t.m_radius+r.m_radius,c=t.m_count,l=t.m_vertices,u=t.m_normals,d=0;d<c;++d){var f=J(u[d],Q_)-J(u[d],l[d]);if(f>s)return;f>o&&(o=f,a=d)}var p=a,m=p+1<c?p+1:0,h=l[p],g=l[m];if(o<pf){e.pointCount=1,e.type=ch.e_faceA,U(e.localNormal,u[a]),Zf(e.localPoint,.5,h,.5,g),U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex);return}var _=J(Q_,g)-J(Q_,h)-J(h,g)+J(h,h),v=J(Q_,h)-J(Q_,g)-J(g,h)+J(g,g);if(_<=0){if(ap(Q_,h)>s*s)return;e.pointCount=1,e.type=ch.e_faceA,G(e.localNormal,Q_,h),ep(e.localNormal),U(e.localPoint,h),U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex)}else if(v<=0){if(ap(Q_,g)>s*s)return;e.pointCount=1,e.type=ch.e_faceA,G(e.localNormal,Q_,g),ep(e.localNormal),U(e.localPoint,g),U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex)}else{if(Zf($_,.5,h,.5,g),J(Q_,u[p])-J($_,u[p])>s)return;e.pointCount=1,e.type=ch.e_faceA,U(e.localNormal,u[p]),U(e.localPoint,$_),U(e.points[0].localPoint,r.m_p),e.points[0].id.setFeatures(0,Z.e_vertex,0,Z.e_vertex)}},tv=Math.min;eg.addType(og.TYPE,vg.TYPE,nv),eg.addType(lg.TYPE,vg.TYPE,iv);function nv(e,t,n,r,i,a,o){Ov(e,n.getShape(),t,a.getShape(),i)}var rv=new og;function iv(e,t,n,r,i,a,o){n.getShape().getChildEdge(rv,r),Ov(e,rv,t,a.getShape(),i)}var av;(function(e){e[e.e_unknown=-1]=`e_unknown`,e[e.e_edgeA=1]=`e_edgeA`,e[e.e_edgeB=2]=`e_edgeB`})(av||={});var ov;(function(e){e[e.e_isolated=0]=`e_isolated`,e[e.e_concave=1]=`e_concave`,e[e.e_convex=2]=`e_convex`})(ov||={});var sv=(function(){function e(){}return e})(),cv=(function(){function e(){this.vertices=[],this.normals=[],this.count=0;for(var e=0;e<V.maxPolygonVertices;e++)this.vertices.push(H(0,0)),this.normals.push(H(0,0))}return e})(),lv=(function(){function e(){this.v1=H(0,0),this.v2=H(0,0),this.normal=H(0,0),this.sideNormal1=H(0,0),this.sideNormal2=H(0,0)}return e.prototype.recycle=function(){W(this.v1),W(this.v2),W(this.normal),W(this.sideNormal1),W(this.sideNormal2)},e})(),uv=[new uh,new uh],dv=[new uh,new uh],fv=[new uh,new uh],pv=new sv,mv=new sv,hv=new cv,Q=new lv,gv=H(0,0),_v=H(0,0),vv=H(0,0),yv=H(0,0),bv=up(0,0,0),xv=H(0,0),Sv=H(0,0),$=H(0,0),Cv=H(0,0),wv=H(0,0),Tv=H(0,0),Ev=H(0,0),Dv=H(0,0),Ov=function(e,t,n,r,i){mp(bv,n,i),Y(gv,bv,r.m_centroid);var a=t.m_vertex0,o=t.m_vertex1,s=t.m_vertex2,c=t.m_vertex3,l=t.m_hasVertex0,u=t.m_hasVertex3;G(vv,s,o),ep(vv),Uf($,vv.y,-vv.x);var d=J($,gv)-J($,o),f=0,p=0,m=!1,h=!1;W(Sv),W(Cv),l&&(G(_v,o,a),ep(_v),Uf(Sv,_v.y,-_v.x),m=q(_v,vv)>=0,f=z.dot(Sv,gv)-z.dot(Sv,a)),u&&(G(yv,c,s),ep(yv),Uf(Cv,yv.y,-yv.x),h=z.crossVec2Vec2(vv,yv)>0,p=z.dot(Cv,gv)-z.dot(Cv,s));var g;W(xv),W(wv),W(Tv),l&&u?m&&h?(g=f>=0||d>=0||p>=0,g?(U(xv,$),U(wv,Sv),U(Tv,Cv)):(K(xv,-1,$),K(wv,-1,$),K(Tv,-1,$))):m?(g=f>=0||d>=0&&p>=0,g?(U(xv,$),U(wv,Sv),U(Tv,$)):(K(xv,-1,$),K(wv,-1,Cv),K(Tv,-1,$))):h?(g=p>=0||f>=0&&d>=0,g?(U(xv,$),U(wv,$),U(Tv,Cv)):(K(xv,-1,$),K(wv,-1,$),K(Tv,-1,Sv))):(g=f>=0&&d>=0&&p>=0,g?(U(xv,$),U(wv,$),U(Tv,$)):(K(xv,-1,$),K(wv,-1,Cv),K(Tv,-1,Sv))):l?m?(g=f>=0||d>=0,g?(U(xv,$),U(wv,Sv),K(Tv,-1,$)):(K(xv,-1,$),U(wv,$),K(Tv,-1,$))):(g=f>=0&&d>=0,g?(U(xv,$),U(wv,$),K(Tv,-1,$)):(K(xv,-1,$),U(wv,$),K(Tv,-1,Sv))):u?h?(g=d>=0||p>=0,g?(U(xv,$),K(wv,-1,$),U(Tv,Cv)):(K(xv,-1,$),K(wv,-1,$),U(Tv,$))):(g=d>=0&&p>=0,g?(U(xv,$),K(wv,-1,$),U(Tv,$)):(K(xv,-1,$),K(wv,-1,Cv),U(Tv,$))):(g=d>=0,g?(U(xv,$),K(wv,-1,$),K(Tv,-1,$)):(K(xv,-1,$),U(wv,$),U(Tv,$))),hv.count=r.m_count;for(var _=0;_<r.m_count;++_)Y(hv.vertices[_],bv,r.m_vertices[_]),sp(hv.normals[_],bv.q,r.m_normals[_]);var v=r.m_radius+t.m_radius;e.pointCount=0,pv.type=av.e_edgeA,pv.index=+!g,pv.separation=1/0;for(var _=0;_<hv.count;++_){var y=hv.vertices[_],b=J(xv,y)-J(xv,o);b<pv.separation&&(pv.separation=b)}if(pv.type!=av.e_unknown&&!(pv.separation>v)){mv.type=av.e_unknown,mv.index=-1,mv.separation=-1/0,Uf(Ev,-xv.y,xv.x);for(var _=0;_<hv.count;++_){K(Dv,-1,hv.normals[_]);var b=tv(J(Dv,hv.vertices[_])-J(Dv,o),J(Dv,hv.vertices[_])-J(Dv,s));if(b>v){mv.type=av.e_edgeB,mv.index=_,mv.separation=b;break}if(J(Dv,Ev)>=0){if(J(Dv,xv)-J(Tv,xv)<-V.angularSlop)continue}else if(J(Dv,xv)-J(wv,xv)<-V.angularSlop)continue;b>mv.separation&&(mv.type=av.e_edgeB,mv.index=_,mv.separation=b)}if(!(mv.type!=av.e_unknown&&mv.separation>v)){var x=mv.type==av.e_unknown?pv:mv.separation>.98*pv.separation+.001?mv:pv;if(fv[0].recycle(),fv[1].recycle(),x.type==av.e_edgeA){e.type=ch.e_faceA;for(var S=0,C=J(xv,hv.normals[0]),_=1;_<hv.count;++_){var w=J(xv,hv.normals[_]);w<C&&(C=w,S=_)}var T=S,E=T+1<hv.count?T+1:0;U(fv[0].v,hv.vertices[T]),fv[0].id.setFeatures(0,Z.e_face,T,Z.e_vertex),U(fv[1].v,hv.vertices[E]),fv[1].id.setFeatures(0,Z.e_face,E,Z.e_vertex),g?(Q.i1=0,Q.i2=1,U(Q.v1,o),U(Q.v2,s),U(Q.normal,$)):(Q.i1=1,Q.i2=0,U(Q.v1,s),U(Q.v2,o),K(Q.normal,-1,$))}else e.type=ch.e_faceB,U(fv[0].v,o),fv[0].id.setFeatures(0,Z.e_vertex,x.index,Z.e_face),U(fv[1].v,s),fv[1].id.setFeatures(0,Z.e_vertex,x.index,Z.e_face),Q.i1=x.index,Q.i2=Q.i1+1<hv.count?Q.i1+1:0,U(Q.v1,hv.vertices[Q.i1]),U(Q.v2,hv.vertices[Q.i2]),U(Q.normal,hv.normals[Q.i1]);if(Uf(Q.sideNormal1,Q.normal.y,-Q.normal.x),Uf(Q.sideNormal2,-Q.sideNormal1.x,-Q.sideNormal1.y),Q.sideOffset1=J(Q.sideNormal1,Q.v1),Q.sideOffset2=J(Q.sideNormal2,Q.v2),uv[0].recycle(),uv[1].recycle(),dv[0].recycle(),dv[1].recycle(),!(gh(uv,fv,Q.sideNormal1,Q.sideOffset1,Q.i1)<V.maxManifoldPoints)&&!(gh(dv,uv,Q.sideNormal2,Q.sideOffset2,Q.i2)<V.maxManifoldPoints)){x.type==av.e_edgeA?(U(e.localNormal,Q.normal),U(e.localPoint,Q.v1)):(U(e.localNormal,r.m_normals[Q.i1]),U(e.localPoint,r.m_vertices[Q.i1]));for(var D=0,_=0;_<V.maxManifoldPoints;++_)if(J(Q.normal,dv[_].v)-J(Q.normal,Q.v1)<=v){var O=e.points[D];x.type==av.e_edgeA?(fp(O.localPoint,bv,dv[_].v),O.id.set(dv[_].id)):(U(O.localPoint,dv[_].v),O.id.set(dv[_].id),O.id.swapFeatures()),++D}e.pointCount=D}}}};(function(){function e(e,t){this._refMap={},this._map={},this._xmap={},this._data=[],this._entered=[],this._exited=[],this._key=e,this._listener=t}return e.prototype.update=function(e){if(!Array.isArray(e))throw`Invalid data: `+e;this._entered.length=0,this._exited.length=0,this._data.length=e.length;for(var t=0;t<e.length;t++)if(!(typeof e[t]!=`object`||e[t]===null)){var n=e[t],r=this._key(n);this._map[r]?delete this._map[r]:this._entered.push(n),this._data[t]=n,this._xmap[r]=n}for(var r in this._map)this._exited.push(this._map[r]),delete this._map[r];var i=this._map;this._map=this._xmap,this._xmap=i;for(var t=0;t<this._exited.length;t++){var n=this._exited[t],a=this._key(n),o=this._refMap[a];this._listener.exit(n,o),delete this._refMap[a]}for(var t=0;t<this._entered.length;t++){var n=this._entered[t],a=this._key(n),o=this._listener.enter(n);o&&(this._refMap[a]=o)}for(var t=0;t<this._data.length;t++)if(!(typeof e[t]!=`object`||e[t]===null)){var n=this._data[t],a=this._key(n),o=this._refMap[a];this._listener.update(n,o)}this._entered.length=0,this._exited.length=0,this._data.length=0},e.prototype.ref=function(e){return this._refMap[this._key(e)]},e})();var kv=class extends ge{density=1;friction=.3;restitution=0;isSensor=!1;fixtureOptions(){return{density:this.density,friction:this.friction,restitution:this.restitution,isSensor:this.isSensor}}start(){this.body()?.attachCollider(this)}onEnable(){this.body()?.attachCollider(this)}onDisable(){this.body()?.detachCollider(this)}onDestroy(){this.body()?.detachCollider(this)}rebuild(){let e=this.body();e&&(e.detachCollider(this),this.isActiveAndEnabled&&e.attachCollider(this))}body(){return this.getComponent(Av)}},Av=class extends ge{kind=`dynamic`;linearDamping=0;angularDamping=0;fixedRotation=!1;gravityScale=1;bullet=!1;body=null;physics=null;fixtures=new Map;awake(){this.physics=this.requireSystem(jv),this.body=this.physics.createBody(this);for(let e of this.object3D.getComponents(kv))e.isActiveAndEnabled&&this.attachCollider(e)}onEnable(){this.body&&(this.body.setActive(!0),this.syncFromNode(),this.physics?.resetInterpolation(this))}onDisable(){this.body?.setActive(!1)}onDestroy(){this.physics?.destroyBody(this),this.fixtures.clear(),this.body=null,this.physics=null}attachCollider(e){if(!this.body||this.fixtures.has(e))return;let t=this.body.createFixture(e.toShape(),e.fixtureOptions());t.setUserData(e),this.fixtures.set(e,t)}detachCollider(e){let t=this.fixtures.get(e);!t||!this.body||(this.body.destroyFixture(t),this.fixtures.delete(e))}syncFromNode(){let{position:e,rotation:t}=this.object3D;this.body?.setTransform(new z(e.x,e.y),t.z)}applyImpulse(e,t){this.body?.applyLinearImpulse({x:e,y:t},this.body.getWorldCenter(),!0)}setVelocity(e,t){this.body?.setLinearVelocity({x:e,y:t})}getVelocity(){let e=this.body?.getLinearVelocity();return e?[e.x,e.y]:[0,0]}setPosition(e,t){this.body&&(this.body.setPosition({x:e,y:t}),this.body.setAwake(!0),this.physics?.resetInterpolation(this))}bodyType(){return this.kind}},jv=class extends de{gravity=new A(0,-9.81);velocityIterations=8;positionIterations=3;world;bodies=new Set;poses=new Map;contacts=[];awake(){this.world=new ng({gravity:new z(this.gravity.x,this.gravity.y)}),this.world.on(`begin-contact`,e=>this.queue(e,`enter`)),this.world.on(`end-contact`,e=>this.queue(e,`exit`))}onDestroy(){for(let e of this.bodies)e.body=null;this.bodies.clear(),this.poses.clear(),this.contacts.length=0}createBody(e){let{position:t,rotation:n}=e.object3D,r=this.world.createBody({type:e.bodyType(),position:new z(t.x,t.y),angle:n.z,linearDamping:e.linearDamping,angularDamping:e.angularDamping,fixedRotation:e.fixedRotation,gravityScale:e.gravityScale,bullet:e.bullet});return r.setUserData(e),this.bodies.add(e),e.kind===`dynamic`&&this.poses.set(e,Mv(r)),r}destroyBody(e){e.body&&this.world.destroyBody(e.body),this.bodies.delete(e),this.poses.delete(e)}resetInterpolation(e){e.body&&this.poses.has(e)&&this.poses.set(e,Mv(e.body))}syncTransforms(){for(let e of this.bodies)e.body&&(e.syncFromNode(),this.resetInterpolation(e))}fixedUpdate(e){for(let e of this.bodies)e.kind===`kinematic`&&e.isActiveAndEnabled&&e.syncFromNode();this.world.step(e,this.velocityIterations,this.positionIterations);for(let[t,n]of this.poses)!t.isActiveAndEnabled||!t.body||Nv(n,t.body,e);this.flushContacts()}update(){let e=O.interpolationAlpha;for(let[t,n]of this.poses){if(!t.isActiveAndEnabled)continue;let r=t.object3D;r.position.x=n.previousX+(n.x-n.previousX)*e,r.position.y=n.previousY+(n.y-n.previousY)*e,r.rotation.z=Lv(n.previousAngle,n.angle,e)}}queue(e,t){let n=e.getFixtureA(),r=e.getFixtureB(),i=n.getBody().getUserData(),a=r.getBody().getUserData();!i||!a||this.contacts.push({a:i.object3D,b:a.object3D,sensor:n.isSensor()||r.isSensor(),phase:t})}flushContacts(){for(let{a:e,b:t,sensor:n,phase:r}of this.contacts)Iv(e,t,n,r),Iv(t,e,n,r);this.contacts.length=0}};function Mv(e){let t=e.getPosition(),n=e.getAngle();return{previousX:t.x,previousY:t.y,previousAngle:n,x:t.x,y:t.y,angle:n}}function Nv(e,t,n){let r=t.getPosition(),i=t.getAngle(),a=t.getLinearVelocity();Math.hypot(r.x-e.x,r.y-e.y)>Math.hypot(a.x,a.y)*n*Pv+Fv?(e.previousX=r.x,e.previousY=r.y,e.previousAngle=i):(e.previousX=e.x,e.previousY=e.y,e.previousAngle=e.angle),e.x=r.x,e.y=r.y,e.angle=i}var Pv=4,Fv=.1;function Iv(e,t,n,r){for(let i of e.components)i.isDestroyed||i._pendingDestroy||(n?r===`enter`?i.onTriggerEnter2D:i.onTriggerExit2D:r===`enter`?i.onCollisionEnter2D:i.onCollisionExit2D)?.call(i,t)}function Lv(e,t,n){let r=(t-e)%(Math.PI*2);return r>Math.PI?r-=Math.PI*2:r<-Math.PI&&(r+=Math.PI*2),e+r*n}var Rv=class extends kv{halfExtents=new A(.5,.5);toShape(){return new __(this.halfExtents.x,this.halfExtents.y)}},zv=class extends kv{radius=.5;toShape(){return new Cg(this.radius)}},Bv=class extends kv{size=new A(.5,1);direction=`vertical`;toShape(){return new vg(Vv(this.size.x,this.size.y,this.direction===`vertical`))}};function Vv(e,t,n){let[r,i]=n?[t,e]:[e,t],a=i/2,o=Math.max(0,r/2-a),s=[],c=(e,t)=>s.push(n?new z(e,t):new z(t,e));for(let e=0;e<=5;e++){let t=Math.PI*e/5;c(Math.cos(t)*a,o+Math.sin(t)*a)}for(let e=0;e<=5;e++){let t=Math.PI+Math.PI*e/5;c(Math.cos(t)*a,-o+Math.sin(t)*a)}return s}var Hv=class extends kv{from=new A(-.5,0);to=new A(.5,0);toShape(){return new og(new z(this.from.x,this.from.y),new z(this.to.x,this.to.y))}},Uv=class extends kv{points=[new A(-.5,-.5),new A(.5,-.5),new A(.5,.5),new A(-.5,.5)];toShape(){return new vg(this.points.map(e=>new z(e.x,e.y)))}},Wv=class extends kv{points=[new A(-.5,0),new A(.5,0)];loop=!1;toShape(){return new lg(this.points.map(e=>new z(e.x,e.y)),this.loop)}},Gv=S({BoxCollider2D:()=>Rv,CapsuleCollider2D:()=>Bv,ChainCollider2D:()=>Wv,CircleCollider2D:()=>zv,Collider2D:()=>kv,EdgeCollider2D:()=>Hv,Physics2D:()=>jv,PolygonCollider2D:()=>Uv,RigidBody2D:()=>Av}),Kv={...be,...Qe,...wc,...Mc,...zc,...sf,...Gv};export{Kv as registry};